diff --git a/frontend/README.md b/frontend/README.md index 2d953d822..065018de9 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -1856,6 +1856,10 @@ MPA 智能体详情当前仅显示基本信息。其他页面及 Profile 配置 ### MPA Feishu multi-bot accounts / MPA 飞书多机器人 +When Runtime advertises `botBindingTypes`, adding a Feishu or Lark Bot offers Shared/Private (Shared by default). QR, retry and manual binding send the selected `bindingType`; older Runtime payloads remain unchanged. The choice is locked during binding and is not an existing-account editing control. Private: “Private chats can recall this Bot’s history, including group chats.” Runtime still enforces recall authorization and isolation. + +Runtime 声明 `botBindingTypes` 时,添加飞书或 Lark Bot 可选择共享/私有(默认共享);扫码、重试和手动绑定携带所选 `bindingType`,旧 Runtime 请求不变。绑定过程中锁定类型,不提供已有账号类型编辑。私有说明:“私聊可召回同 Bot 的历史,包括群聊。”召回鉴权和隔离仍由 Runtime 执行。 + Runtimes advertising `multiBotChannels: ["feishu"]` expose a robot selector in Automations → Messaging channels → MPA agent messaging channels. Add bots with QR or manual binding, then manage enablement, unbinding, diagnostics and group diff --git a/frontend/src/adk/client.ts b/frontend/src/adk/client.ts index afb78f8bf..7c14cd647 100644 --- a/frontend/src/adk/client.ts +++ b/frontend/src/adk/client.ts @@ -6596,7 +6596,8 @@ export async function updateSandboxTool(kind: SandboxToolKind): Promise<{ export type ChannelScope = "group" | "group_sender" | "group_topic" | "group_topic_sender"; -export interface ChannelCapabilities { feishuDomains?: string[]; channels?: string[]; credentialBindingChannels?: string[]; serverSideBinding: boolean; bindingReady: boolean; bindingError?: string | null; multiBotChannels?: string[]; accountScopedPermissions?: boolean; } +export type BotBindingType = "shared" | "private"; +export interface ChannelCapabilities { botBindingTypes?: BotBindingType[]; feishuDomains?: string[]; channels?: string[]; credentialBindingChannels?: string[]; serverSideBinding: boolean; bindingReady: boolean; bindingError?: string | null; multiBotChannels?: string[]; accountScopedPermissions?: boolean; } export interface FeishuBinding { id: string; status: "PENDING" | "SCANNED" | "AUTHORIZED" | "REGISTERING" | "BOUND" | "FAILED" | "EXPIRED"; diff --git a/frontend/src/i18n/resources/en-US/ui.json b/frontend/src/i18n/resources/en-US/ui.json index 1df2bef0f..aad878690 100644 --- a/frontend/src/i18n/resources/en-US/ui.json +++ b/frontend/src/i18n/resources/en-US/ui.json @@ -1968,6 +1968,11 @@ } }, "channels": { + "bindingType": "Bot type", + "bindingType_shared": "Shared", + "bindingType_private": "Private", + "bindingTypeHelp_shared": "Sessions are isolated from each other.", + "bindingTypeHelp_private": "Private chats can recall this Bot’s history, including group chats.", "title": "Feishu channel", "refresh": "Refresh", "loading": "Loading channel configuration…", diff --git a/frontend/src/i18n/resources/zh-CN/ui.json b/frontend/src/i18n/resources/zh-CN/ui.json index 0e474e434..41464b478 100644 --- a/frontend/src/i18n/resources/zh-CN/ui.json +++ b/frontend/src/i18n/resources/zh-CN/ui.json @@ -1968,6 +1968,11 @@ } }, "channels": { + "bindingType": "Bot 类型", + "bindingType_shared": "共享", + "bindingType_private": "私有", + "bindingTypeHelp_shared": "各会话相互隔离。", + "bindingTypeHelp_private": "私聊可召回同 Bot 的历史,包括群聊。", "title": "飞书渠道", "refresh": "刷新", "loading": "正在加载渠道配置…", diff --git a/frontend/src/ui/RuntimeChannels.tsx b/frontend/src/ui/RuntimeChannels.tsx index 5815ad513..3e0398bb4 100644 --- a/frontend/src/ui/RuntimeChannels.tsx +++ b/frontend/src/ui/RuntimeChannels.tsx @@ -6,6 +6,7 @@ import { Radio } from "../components/primitives/Radio/Radio"; import { channelRequest, ChannelApiError, + type BotBindingType, type ChannelCapabilities, type ChannelDiagnostics, type ChannelPermission, @@ -164,6 +165,17 @@ function ProviderChannel({ null, ); const [groups, setGroups] = useState([]); + const [selectedBindingType, setSelectedBindingType] = + useState("shared"); + const bindingTypes = (["shared", "private"] as const).filter( + (value) => + isFeishu && + Array.isArray(capability?.botBindingTypes) && + capability.botBindingTypes.includes(value), + ); + const bindingType = + bindingTypes.find((value) => value === selectedBindingType) ?? + bindingTypes[0]; const [pairingRequested, setPairingRequested] = useState(false); const [binding, setBinding] = useState(null); const [botId, setBotId] = useState(""); @@ -363,7 +375,10 @@ function ProviderChannel({ : `/${apiProvider}/bindings`, { method: "POST", - body: provider === "lark" ? JSON.stringify({ domain }) : "{}", + body: JSON.stringify({ + ...(provider === "lark" ? { domain } : {}), + ...(bindingType ? { bindingType } : {}), + }), signal, }, ); @@ -596,6 +611,28 @@ function ProviderChannel({ )} {accountMode !== "manage" && ( <> + {bindingType && ( +
+ {t("channels.bindingType")} +
+ {bindingTypes.map((value) => ( + setSelectedBindingType(value)} + /> + ))} +
+

+ {t(`channels.bindingTypeHelp_${bindingType}`)} +

+
+ )}
{t("channels.configurationMethod")}
@@ -667,6 +704,7 @@ function ProviderChannel({ ? { appId: botId.trim(), appSecret: secret.trim(), + ...(bindingType ? { bindingType } : {}), ...(provider === "lark" ? { domain } : {}), } : { diff --git a/frontend/tests/runtimeChannels.test.tsx b/frontend/tests/runtimeChannels.test.tsx index 9887b760f..6d4ab752e 100644 --- a/frontend/tests/runtimeChannels.test.tsx +++ b/frontend/tests/runtimeChannels.test.tsx @@ -1551,3 +1551,239 @@ it("blocks Lark IME and duplicate writes and aborts on brand switch", async () = expect(host.textContent).not.toContain("lark-new"); expect(host.textContent).toContain("channels.accountsTitle"); }); + +function bindingTypesFixture( + types: unknown = ["shared", "private"], + lark = false, +) { + if (lark) larkFixture(); + else multiBotFixture(); + const original = request.getMockImplementation()!; + request.mockImplementation(async (ep, path, init) => { + if (path === "/capabilities") + return { ...(await original(ep, path, init)), botBindingTypes: types }; + if (path === "/feishu/bindings") return pending; + if (path.endsWith("/retry")) return { ...pending, status: "BOUND", appId: "bot-new" }; + return original(ep, path, init); + }); +} +const typeInput = (value: string) => + host.querySelector(`input[type="radio"][value="${value}"]`); +async function chooseType(value: string) { + expect(typeInput(value)).not.toBeNull(); + await act(async () => typeInput(value)!.click()); +} +async function submitCredentials() { + await selectMethod("manual"); + await fillCredential("appId", " bot-new "); + await fillCredential("secret", "fixture-secret"); + await act(async () => + host + .querySelector("form[data-channel-binding]")! + .dispatchEvent(new Event("submit", { bubbles: true, cancelable: true })), + ); +} +function lastBody(path: string) { + const calls = request.mock.calls.filter( + ([, value, init]) => value === path && init?.method === "POST", + ); + expect(calls.length).toBeGreaterThan(0); + return JSON.parse(String(calls.at(-1)![2]!.body)); +} + +it.each(["shared", "private"])( + "sends the selected %s type for QR and manual binding", + async (type) => { + bindingTypesFixture(); + await render(); + await click("channels.addAccount"); + expect(typeInput("shared")?.checked).toBe(true); + await chooseType(type); + expect(host.textContent).toContain(`channels.bindingTypeHelp_${type}`); + await click("channels.bind"); + expect(lastBody("/feishu/bindings")).toEqual({ bindingType: type }); + expect(typeInput("shared")?.disabled).toBe(true); + expect(typeInput("private")?.disabled).toBe(true); + await submitCredentials(); + expect(lastBody("/feishu/bindings/manual")).toEqual({ + appId: "bot-new", + appSecret: "fixture-secret", + bindingType: type, + }); + expect(localStorage.setItem).not.toHaveBeenCalled(); + }, +); + +it.each([undefined, [], ["future"], null, "private"])( + "keeps legacy payloads when types are unsupported: %j", + async (types) => { + bindingTypesFixture(types === undefined ? [] : types); + if (types === undefined) { + const original = request.getMockImplementation()!; + request.mockImplementation(async (ep, path, init) => { + const data = await original(ep, path, init); + if (path === "/capabilities") delete data.botBindingTypes; + return data; + }); + } + await render(); + await click("channels.addAccount"); + expect(typeInput("private")).toBeNull(); + expect(typeInput("shared")).toBeNull(); + await click("channels.bind"); + expect(lastBody("/feishu/bindings")).toEqual({}); + await submitCredentials(); + expect(lastBody("/feishu/bindings/manual")).toEqual({ + appId: "bot-new", + appSecret: "fixture-secret", + }); + }, +); + +it.each([["private"], ["future", "private"], ["private", "private"]])( + "only offers advertised known types: %j", + async (...types) => { + bindingTypesFixture(types); + await render(); + await click("channels.addAccount"); + expect(typeInput("shared")).toBeNull(); + expect(typeInput("private")?.checked).toBe(true); + expect(host.querySelectorAll('input[value="private"]')).toHaveLength(1); + await click("channels.bind"); + expect(lastBody("/feishu/bindings")).toEqual({ bindingType: "private" }); + }, +); + +it("preserves private type when retrying a durable failed QR binding", async () => { + bindingTypesFixture(); + const original = request.getMockImplementation()!; + request.mockImplementation(async (ep, path, init) => + path === "/feishu/bindings" + ? { ...pending, status: "FAILED", lastErrorCode: "REGISTRATION_FAILED" } + : original(ep, path, init), + ); + await render(); + await click("channels.addAccount"); + await chooseType("private"); + await click("channels.bind"); + expect(typeInput("shared")?.disabled).toBe(true); + await chooseType("shared"); + expect(typeInput("private")?.checked).toBe(true); + await click("common.retry"); + expect(lastBody("/feishu/bindings/binding-1/retry")).toEqual({ + bindingType: "private", + }); +}); + +it("locks selection while sending and preserves it after a recoverable error", async () => { + bindingTypesFixture(); + const original = request.getMockImplementation()!; + let reject!: (reason: unknown) => void; + request.mockImplementation((ep, path, init) => + path === "/feishu/bindings" + ? new Promise((_resolve, fail) => { + reject = fail; + }) + : original(ep, path, init), + ); + await render(); + await click("channels.addAccount"); + await chooseType("private"); + await click("channels.bind"); + expect(typeInput("shared")?.disabled).toBe(true); + await act(async () => reject(new ChannelApiError(502))); + expect(host.textContent).toContain("channels.requestFailed"); + expect(typeInput("private")?.checked).toBe(true); + expect(typeInput("shared")?.disabled).toBe(false); +}); + +it("resets type when cancelling Add bot or changing Runtime and ignores late capabilities", async () => { + bindingTypesFixture(); + await render(); + await click("channels.addAccount"); + await chooseType("private"); + await click("channels.cancelAddAccount"); + await click("channels.addAccount"); + expect(typeInput("shared")?.checked).toBe(true); + await chooseType("private"); + const original = request.getMockImplementation()!; + let finish!: (value: unknown) => void; + let signal: AbortSignal | null | undefined; + request.mockImplementation((ep, path, init) => + ep.runtimeId === "runtime-slow" && path === "/capabilities" + ? new Promise((resolve) => { + finish = resolve; + signal = init?.signal; + }) + : original(ep, path, init), + ); + await act(async () => + root.render( + , + ), + ); + expect(typeInput("private")).toBeNull(); + await act(async () => + root.render( + , + ), + ); + expect(signal?.aborted).toBe(true); + await act(async () => + finish({ + serverSideBinding: true, + bindingReady: true, + botBindingTypes: ["private"], + }), + ); + await click("channels.addAccount"); + expect(typeInput("shared")?.checked).toBe(true); + expect( + request.mock.calls.filter(([, , init]) => init?.method === "POST"), + ).toHaveLength(0); +}); + +it("does not expose an editable type for existing accounts or other providers", async () => { + bindingTypesFixture(); + await render(); + await selectBot("bot-a"); + expect(typeInput("private")).toBeNull(); + await click("channels.provider_wecom"); + expect(typeInput("private")).toBeNull(); + await click("channels.provider_dingtalk"); + expect(typeInput("private")).toBeNull(); +}); + +it("retains Lark domain alongside private type in QR, retry and manual requests", async () => { + bindingTypesFixture(["shared", "private"], true); + const original = request.getMockImplementation()!; + request.mockImplementation(async (ep, path, init) => + path === "/feishu/bindings" + ? { ...pending, status: "FAILED", lastErrorCode: "REGISTRATION_FAILED" } + : original(ep, path, init), + ); + await renderLark(); + await click("channels.addAccount"); + await chooseType("private"); + await click("channels.bind"); + expect(lastBody("/feishu/bindings")).toEqual({ + domain: "lark", + bindingType: "private", + }); + await click("common.retry"); + expect(lastBody("/feishu/bindings/binding-1/retry")).toEqual({ + domain: "lark", + bindingType: "private", + }); + // The successful retry closes the add panel; a new binding chooses its own type. + await click("channels.addAccount"); + expect(typeInput("shared")?.checked).toBe(true); + await chooseType("private"); + await submitCredentials(); + expect(lastBody("/feishu/bindings/manual")).toEqual({ + appId: "bot-new", + appSecret: "fixture-secret", + domain: "lark", + bindingType: "private", + }); +}); diff --git a/prd-spec/features/bot-binding-types/2026-10-16-bot-binding-types.md b/prd-spec/features/bot-binding-types/2026-10-16-bot-binding-types.md new file mode 100644 index 000000000..6d666a652 --- /dev/null +++ b/prd-spec/features/bot-binding-types/2026-10-16-bot-binding-types.md @@ -0,0 +1,49 @@ +# Studio Bot binding types + +[中文](2026-10-16-bot-binding-types.zh.md) + +Date: 2026-10-16. Base: origin/main edae5b58. Status: implemented. + +## Scope and approval + +The user requested a branch from main and a PR for the existing private/shared binding selector. This explicitly authorizes implementation, testing, commit, push and PR creation. A subsequent instruction fixes the private description to “私聊可召回同 Bot 的历史,包括群聊。” No cloud deployment or changes to Runtime recall/authentication rules are included. + +## Background and design + +Runtime already advertises botBindingTypes and accepts bindingType, but Studio's ProviderChannel sends only credentials/domain. Reuse Radio and the configuration-method fieldset styling. Render a separate “Bot type” group before Quick/Manual setup, only for Feishu (including the Lark brand) and only for known advertised shared/private values. Prefer shared by default; a Runtime advertising private only selects private. Missing, empty or unknown-only capabilities retain the exact legacy payload. Both binding modes and QR retry forward the selection. Preserve domain=lark. + +Selection stays in component memory, is locked during requests and after a durable QR binding exists (including failure/retry), and resets when switching Runtime/provider or cancelling/reopening Add bot. Switching setup methods cancels the old QR UI and allows a new choice; it does not mutate the existing server binding. Management of an existing account exposes no editable type. All existing cancellation, late-result guards, administrator authorization and error presentation remain in place. No owner identity is invented or sent by the browser. + +Private copy: “Private chats can recall this Bot’s history, including group chats.” Shared copy: “Sessions are isolated from each other.” These are short UI descriptions, not a replacement for Runtime authorization policy. + +## Requirements and acceptance + +| Requirement/task | Acceptance | Verification | +| --- | --- | --- | +| FR-1 / T-1 | Advertised shared/private options, shared default, requested concise descriptions, no control for unsupported providers/versions | RuntimeChannels component cases and browser fixture | +| FR-2 / T-2 | QR/manual/retry payloads carry selected type; Lark keeps domain; old payload unchanged | Component request assertions | +| FR-3 / T-3 | Busy/pending/retry locks; reset on target/add lifecycle; errors and cancellation cannot leak selection | Component cases and keyboard/narrow browser checks | +| FR-4 / T-4 | Bilingual contract/user docs, rebuilt release assets, >95% changed executable line coverage | Build, i18n, asset checks, coverage diff and pre-commit | + +Affected files: frontend/src/ui/RuntimeChannels.tsx, frontend/src/adk/client.ts, both ui.json locales, frontend/tests/runtimeChannels.test.tsx, frontend/README.md, specs/mpa-channels/README.md and README.zh.md, veadk/webui generated assets. No Python, storage, dependencies or permission policy changes. + +## Review and risks + +Design reviewed directly because review-spec is unavailable: additive capability/field, legacy and Lark compatibility, request ownership, retry type stability, no secret storage, bilingual equivalence, testability and S1–S8 reuse checked; no blocker. frontend-design read; ui-ux-pro-max unavailable in repository/installed skill catalog; use frontend/SPEC.md and foundation instead. Existing Radio controls supply focus/keyboard semantics; no new styles/icons. The user's current request supplies scope approval; no additional approval is needed. + +A compatible Runtime remains required; the server owns immutable type validation and recall rules. Component/browser fixtures do not prove real Feishu binding. Verification below. + +## Verification and delivery (2026-10-16) + +Scope: origin/main edae5b58 plus this change. Implementation review: no blockers; checked capability absence/unknown values, private-only support, immutable retry selection, Lark domain, target lifecycle, no owner spoofing and no type editing on managed accounts. No Python contract or permission implementation changes. + +- pass — TDD: added 15 component cases. Before implementation, 9 new assertions failed and 78 tests passed; after implementation all 87 passed. The initial feature gap is resolved; no additional defect reported. +- pass — `vitest run --environment jsdom tests/runtimeChannels.test.tsx tests/feishuAccounts.test.ts tests/mpaChannelsAutomation.test.tsx src/adk/channels.test.ts --coverage`: 116 passed. An initial invocation omitted jsdom and failed the existing client test with `window is not defined`; rerun with the required browser environment passed. Fixed an incomplete new retry fixture to return a terminal binding rather than an object without polling metadata. +- pass — `npm --prefix frontend test`: 1,389 Node tests and 118 Vitest tests. +- pass — `npm --prefix frontend run build`: TypeScript and both production bundles; generated WebUI assets included. Existing large-chunk/dependency warnings remain. +- pass — `npm --prefix frontend run check:i18n`: 2 locales / 21 namespaces consistent. `npm --prefix frontend run test:webui-assets`: 113 files / 350 internal references. +- pass — changed executable lines: 6/6 (100%) against edae5b58; client.ts changes are type-only. RuntimeChannels overall line coverage is 94.71%, distinct from incremental coverage. Coverage source: V8/Istanbul JSON + Cobertura line hits intersected with git diff; utree's parser returned zero targets for this TSX file and is not used as passing evidence. Raw logs and reproducible diff counts: `/tmp/studio-bot-binding-types/`. +- pass — `uv run --extra dev pytest tests/test_mpa_channel_proxy_policy.py -q`: 6 passed. +- pass — real in-app browser with isolated mocked Runtime: empty list, shared default, keyboard ArrowRight selects private, exact private description, QR and retry private payloads, locked radio state, manual payload, legacy absence, capability error/retry and loading state. Existing Radio/fieldset styling reused; S1–S8 inspected. At the actual 708px width no horizontal overflow; 390px override did not take effect, so 390px is not verified. Temporary fixture files/browser removed; no real credentials or cloud writes. +- not_run — real Feishu registration, cloud deployment, actual IME input and full Python regression (no Python production change). Existing component IME/duplicate-submit regression remains covered. This PR does not assert live authorization or recall behavior. +- pass — fetched origin/main and rebased with autostash (base remained edae5b58), restored all changes; `uv run --extra dev pre-commit run --all-files` passed Ruff, hardcoded-secret, dependency-policy and YAML-secret checks; final focused rerun: 116 passed. `git diff --check` passed. diff --git a/prd-spec/features/bot-binding-types/2026-10-16-bot-binding-types.zh.md b/prd-spec/features/bot-binding-types/2026-10-16-bot-binding-types.zh.md new file mode 100644 index 000000000..9a8f6d85b --- /dev/null +++ b/prd-spec/features/bot-binding-types/2026-10-16-bot-binding-types.zh.md @@ -0,0 +1,49 @@ +# Studio Bot 绑定类型 + +[English](2026-10-16-bot-binding-types.md) + +日期:2026-10-16。基线:origin/main edae5b58。状态:implemented。 + +## 范围与授权 + +用户要求从主分支新建分支,迁入已有的私有/共享绑定选择并提交 PR,已明确授权实现、测试、提交、推送和创建 PR。后续要求私有说明固定为“私聊可召回同 Bot 的历史,包括群聊。”不部署云端,不修改 Runtime 召回或鉴权规则。 + +## 背景与设计 + +Runtime 已声明 botBindingTypes 并接受 bindingType,Studio ProviderChannel 当前仅发送凭据或 domain。复用 Radio 和配置方式 fieldset 样式,在极速/手动配置之前单独显示“Bot 类型”。仅飞书(含 Lark 品牌)且 Runtime 声明已知 shared/private 值时显示。优先默认共享;只声明 private 时选择私有。能力缺失、空数组或仅未知值时保持旧请求体。扫码、手动和扫码重试均传递所选类型,保留 domain=lark。 + +选择仅存在组件内存中,请求中和存在持久扫码绑定后(包括失败重试)锁定。切换 Runtime/渠道、取消后重新添加时重置。切换配置方式会取消旧扫码界面并允许重新选择,不修改旧服务端绑定。已有账号管理不显示可编辑类型。保留现有取消、迟到响应保护、管理员鉴权和错误提示;浏览器不构造或发送 owner 身份。 + +私有文案:“私聊可召回同 Bot 的历史,包括群聊。”共享文案:“各会话相互隔离。”英文语义一致。简短 UI 描述不替代 Runtime 授权规则。 + +## 需求与验收 + +| 需求/任务 | 验收条件 | 验证 | +| --- | --- | --- | +| FR-1 / T-1 | 按能力显示共享/私有,默认共享,使用指定简短说明;旧版本和其他渠道不显示 | RuntimeChannels 组件用例及浏览器夹具 | +| FR-2 / T-2 | 扫码/手动/重试携带类型;Lark 保留 domain;旧请求不变 | 组件请求断言 | +| FR-3 / T-3 | 请求/扫码等待/重试锁定;目标和添加生命周期重置;失败和取消不串选项 | 组件用例、键盘和窄屏浏览器检查 | +| FR-4 / T-4 | 双语契约和用户文档、重建产物、增量可执行行覆盖率 >95% | 构建、国际化、产物、增量覆盖率及 pre-commit | + +涉及文件:frontend/src/ui/RuntimeChannels.tsx、frontend/src/adk/client.ts、双语 ui.json、frontend/tests/runtimeChannels.test.tsx、frontend/README.md、specs/mpa-channels/README.md 及 README.zh.md、veadk/webui 构建产物。不改 Python、存储、依赖和权限规则。 + +## 审查与风险 + +review-spec 不可用,已直接审查设计:增量能力字段、旧版和 Lark 兼容、请求归属、重试类型稳定性、不持久化密钥、双语等价、可测试性及 S1–S8 复用,无阻塞。已读 frontend-design;仓库及已安装技能目录未提供 ui-ux-pro-max,按 frontend/SPEC.md 和 foundation 执行。已有 Radio 提供焦点/键盘语义,不新增样式或图标。当前用户请求已授权此范围,无需重复确认。 + +仍需兼容 Runtime;类型不可变校验和召回规则由服务端负责。组件/浏览器夹具不代表真实飞书绑定验证。验证见下文。 + +## 验证与交付(2026-10-16) + +范围:origin/main edae5b58 加本次改动。实现审查无阻塞:已检查能力缺失/未知值、仅私有选项、重试类型不可变、Lark domain、目标生命周期、不伪造 owner、已有账号不编辑类型。没有 Python 契约或权限实现改动。 + +- pass — TDD:新增 15 个组件用例。实现前 9 个新断言失败、78 个通过;实现后 87 个全部通过。原功能缺口已补齐,未发现额外缺陷。 +- pass — `vitest run --environment jsdom tests/runtimeChannels.test.tsx tests/feishuAccounts.test.ts tests/mpaChannelsAutomation.test.tsx src/adk/channels.test.ts --coverage`:116 个通过。首次命令遗漏 jsdom,已有客户端测试报 `window is not defined`;补齐浏览器环境重跑通过。新重试夹具补齐为终态绑定,避免缺少轮询元数据。 +- pass — `npm --prefix frontend test`:1,389 个 Node 测试和 118 个 Vitest 测试。 +- pass — `npm --prefix frontend run build`:TypeScript 和两套生产 bundle;已包含匹配的 WebUI 产物。保留已有大包/依赖警告。 +- pass — `npm --prefix frontend run check:i18n`:2 个语言、21 个命名空间一致。`npm --prefix frontend run test:webui-assets`:113 个文件、350 个内部引用。 +- pass — 相对 edae5b58 的增量可执行行 6/6(100%),client.ts 仅类型声明。RuntimeChannels 全文件行覆盖率为 94.71%,与增量覆盖率分开统计。依据 V8/Istanbul JSON 和 Cobertura 行命中与 git diff 交集;utree 对此 TSX 返回零目标,不作为通过证据。原始日志和可复核增量计数:`/tmp/studio-bot-binding-types/`。 +- pass — `uv run --extra dev pytest tests/test_mpa_channel_proxy_policy.py -q`:6 个通过。 +- pass — 真实应用内浏览器、隔离模拟 Runtime:空列表、默认共享、ArrowRight 切换私有、指定私有说明、扫码与重试私有请求、单选框锁定、手动请求、旧能力缺失、能力错误/重试、加载态。复用 Radio/fieldset,检查 S1–S8。实际 708px 宽度无横向溢出;390px 覆盖未生效,未将 390px 记为通过。临时夹具及浏览器已清理,未使用真实凭据或执行云写入。 +- not_run — 真实飞书注册、云部署、真实 IME 输入、全量 Python 回归(未改 Python 生产代码)。已有组件 IME/重复提交回归仍被覆盖。本 PR 不声称已验证线上授权或召回。 +- pass — fetch origin/main 后使用 autostash rebase(基线仍为 edae5b58),改动完整恢复;`uv run --extra dev pre-commit run --all-files` 的 Ruff、硬编码密钥、依赖规则、YAML 密钥检查全部通过;最终定向复测 116 个通过。`git diff --check` 通过。 diff --git a/specs/mpa-channels/README.md b/specs/mpa-channels/README.md index 759a0e59b..76a17c22b 100644 --- a/specs/mpa-channels/README.md +++ b/specs/mpa-channels/README.md @@ -58,3 +58,10 @@ Design: [server-default-scope](../../prd-spec/bugfixes/channel-group-actions/202 ## Lark brand (2026-10-15) CON-18 (approved addition): BytePlus exposes Lark only when `feishuDomains` includes `lark` and Feishu multi-account support is advertised. Reuse `/feishu/bindings` and `/feishu/bindings/manual` with `domain=lark`; omission remains Feishu. Canonical storage/API channel is `feishu`; `config.domain` identifies brand, absent means Feishu. Lists filter brand; account operations always carry appId. Runtime owns fixed API hosts and Gateway adapter=lark registration, validates inbound Bot identity and preserves request/delivery IDs. Existing domestic records and APIs remain compatible. See [design](../../prd-spec/features/lark-binding/2026-10-15-lark-binding.md). + + +## Bot binding types (2026-10-16) + +CON-19: Optional botBindingTypes advertises shared/private for Feishu and Lark. Studio shows only known advertised types while adding a Bot, prefers shared by default, and sends bindingType on QR creation, QR retry and manual binding. Lark retains domain=lark. Missing/empty/unknown-only capabilities omit the field and retain legacy behavior. Other providers are unchanged. Existing-account management does not edit type. Selection is memory-only, resets on Runtime/provider or add-panel remount, and is locked while busy or a durable QR binding exists; retries preserve its type. Runtime remains responsible for authorization, immutable type validation and recall isolation. Private UI description is “Private chats can recall this Bot’s history, including group chats.” + +Design: [Bot binding types](../../prd-spec/features/bot-binding-types/2026-10-16-bot-binding-types.md). diff --git a/specs/mpa-channels/README.zh.md b/specs/mpa-channels/README.zh.md index 96aa4c701..39921fbab 100644 --- a/specs/mpa-channels/README.zh.md +++ b/specs/mpa-channels/README.zh.md @@ -58,3 +58,10 @@ CON-17:Studio 新增群表单不提供会话隔离选择器,仅提交 channe ## Lark 品牌(2026-10-15) CON-18(已批准增量):BytePlus 仅在 `feishuDomains` 包含 `lark` 且声明飞书多账号支持时开放 Lark。复用 `/feishu/bindings` 和 `/feishu/bindings/manual`,传 `domain=lark`;省略仍为飞书。存储/API 的 channel 仍为 `feishu`,以 `config.domain` 区分品牌,缺失为飞书。列表按品牌过滤,账号操作始终带 appId。Runtime 负责固定域名及 Gateway adapter=lark 注册,校验入站 Bot 身份并保留 request/delivery ID。国内已有记录及接口兼容。见[设计](../../prd-spec/features/lark-binding/2026-10-15-lark-binding.zh.md)。 + + +## Bot 绑定类型(2026-10-16) + +CON-19:可选 botBindingTypes 为飞书及 Lark 声明 shared/private。Studio 添加 Bot 时仅显示已知且声明的类型,优先默认共享;扫码创建、扫码重试和手动绑定均发送 bindingType。Lark 保留 domain=lark。能力缺失/为空/仅含未知值时省略字段,保持旧行为;其他渠道不变。已有账号管理不编辑类型。选择仅保存在内存中,切换 Runtime/渠道或重新打开添加面板时重置;请求中或存在持久扫码绑定时锁定,重试保持原类型。鉴权、类型不可变校验及召回隔离仍由 Runtime 负责。私有类型 UI 说明为“私聊可召回同 Bot 的历史,包括群聊。” + +设计:[Bot 绑定类型](../../prd-spec/features/bot-binding-types/2026-10-16-bot-binding-types.zh.md)。 diff --git a/veadk/webui/assets/app/index-BIS1-cw9.js b/veadk/webui/assets/app/index-CpQQ3l5F.js similarity index 80% rename from veadk/webui/assets/app/index-BIS1-cw9.js rename to veadk/webui/assets/app/index-CpQQ3l5F.js index f3201753d..e24816a64 100644 --- a/veadk/webui/assets/app/index-BIS1-cw9.js +++ b/veadk/webui/assets/app/index-CpQQ3l5F.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/visualizations/mermaid/mermaid.core-Xn0bMahe.js","assets/chunks/purify.es-BnINGy_Y.js","assets/chunks/MarkdownPromptEditor-Duc3_Vyj.js","assets/styles/MarkdownPromptEditor-ZH9qtki0.css","assets/chunks/QuickAgentCreateDialog-CP2k798F.js","assets/styles/QuickAgentCreateDialog-DGsLIlOX.css"])))=>i.map(i=>d[i]); -var Bze=Object.defineProperty;var MG=e=>{throw TypeError(e)};var Uze=(e,t,n)=>t in e?Bze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Zt=(e,t,n)=>Uze(e,typeof t!="symbol"?t+"":t,n),LG=(e,t,n)=>t.has(e)||MG("Cannot "+n);var kl=(e,t,n)=>(LG(e,t,"read from private field"),n?n.call(e):t.get(e)),$G=(e,t,n)=>t.has(e)?MG("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),w5=(e,t,n,i)=>(LG(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n);function Qze(e,t){for(var n=0;ni[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();var lg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function N1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rue={exports:{}},KP={};/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/visualizations/mermaid/mermaid.core-DX8cWFj6.js","assets/chunks/purify.es-BnINGy_Y.js","assets/chunks/MarkdownPromptEditor-C9QSY0U-.js","assets/styles/MarkdownPromptEditor-ZH9qtki0.css","assets/chunks/QuickAgentCreateDialog-aPDR54fV.js","assets/styles/QuickAgentCreateDialog-DGsLIlOX.css"])))=>i.map(i=>d[i]); +var Uze=Object.defineProperty;var MG=e=>{throw TypeError(e)};var Qze=(e,t,n)=>t in e?Uze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Zt=(e,t,n)=>Qze(e,typeof t!="symbol"?t+"":t,n),LG=(e,t,n)=>t.has(e)||MG("Cannot "+n);var kl=(e,t,n)=>(LG(e,t,"read from private field"),n?n.call(e):t.get(e)),$G=(e,t,n)=>t.has(e)?MG("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),w5=(e,t,n,i)=>(LG(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n);function zze(e,t){for(var n=0;ni[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();var lg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function N1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Iue={exports:{}},KP={};/** * @license React * react-jsx-runtime.production.js * @@ -7,8 +7,8 @@ var Bze=Object.defineProperty;var MG=e=>{throw TypeError(e)};var Uze=(e,t,n)=>t * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var zze=Symbol.for("react.transitional.element"),Vze=Symbol.for("react.fragment");function Iue(e,t,n){var i=null;if(n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:zze,type:e,key:i,ref:t!==void 0?t:null,props:n}}KP.Fragment=Vze;KP.jsx=Iue;KP.jsxs=Iue;Rue.exports=KP;var a=Rue.exports;const Pue={requestFailed:"Request failed ({{status}})",unknownError:"Unknown error",contentTypeMissing:"Content-Type missing",response:"Response: {{response}}",fallbackWithDetail:"{{fallback}}: {{detail}}",fallbackWithHttpStatus:"{{fallback}} (HTTP {{status}})",nonJsonResponse:"{{fallback}}: the server returned a non-JSON response ({{contentType}})"},Due={unconfigured:"AgentKit Dev Sandbox has not been configured by an administrator.",invalidSession:"AgentKit CLI returned an invalid session.",loadCapabilitiesFailed:"Unable to load the AgentKit CLI configuration.",invalidCapabilities:"AgentKit CLI returned an invalid configuration status.",listSessionsFailed:"Unable to load AgentKit CLI sessions.",invalidSessionList:"AgentKit CLI returned an invalid session list.",createSessionFailed:"Unable to create an AgentKit CLI session.",openSessionFailed:"Unable to open the AgentKit CLI session.",openTerminalFailed:"Unable to open the AgentKit CLI terminal.",invalidTerminalUrl:"AgentKit CLI returned an invalid terminal URL."},Mue={cnBeijing:"China North 2 (Beijing)",cnShanghai:"China East 2 (Shanghai)"},Lue={runtimeUnsupported:"This Runtime does not currently support connections. Confirm that the service is running normally."},$ue={autoConfigureFailed:"Failed to configure the Feishu bot automatically"},Fue={actionFailed:"Failed to {{action}}",detail:"Details: {{detail}}",request:"Request: {{request}}"},Bue={persistentMemoryHint:"Tip: The session no longer exists. With in-memory or SQLite short-term memory, sessions may be lost during multi-instance routing, process restarts, or rolling deployments. Use database-backed persistent short-term memory instead.",unsupportedRouteHint:"Tip: This Runtime does not provide the session run API and may be incompatible with the current Studio version.",toolArgumentHint:"Tip: The model generated incomplete tool arguments. Send the request again.",resourceCollectionExpiredHint:"Tip: This resource collection has expired. Send the task again so the system can collect the resources before creating the Agent.",networkConfigurationHint:"Tip: Try again later, and review the Runtime, model, or gateway logs.",modelQuotaHint:"Tip: The model has reached its TPM/RPM quota. Try again later or increase the model quota.",rawResponseLabel:"Raw response: ",copySecretFailed:"Failed to copy the secret value"},Uue={httpStatus:"HTTP status: {{status}}",errorCode:"Error code: {{code}}",cloudResponseBody:`Cloud response body: -{{body}}`,loadFailedWithDetail:"Failed to load instance logs: {{detail}}",invalidFormat:"Failed to load instance logs: the service returned an invalid format"},Que={untitledSession:"Untitled session",webUnavailable:"Web search is unavailable because /web/search is not enabled on the server.",webFailed:"Web search failed: {{message}}",webNotMounted:"This Agent does not have the web_search tool mounted.",knowledgeNotMounted:"This Agent does not have a knowledge base mounted.",memoryNotMounted:"This Agent does not have long-term memory mounted.",knowledge:"Knowledge base",longTermMemory:"Long-term memory"},zue={listSpacesFailed:"Failed to load Skill spaces",createSpaceFailed:"Failed to create the Skill space",updateSpaceFailed:"Failed to update the Skill space",deleteSpaceFailed:"Failed to delete the Skill space",uploadFailed:"Failed to upload the Skill",validateFailed:"Failed to validate the Skill",deleteFailed:"Failed to delete the Skill",listFilesFailed:"Failed to load Skill files",downloadFailed:"Failed to download the Skill",sharedSpaceFailed:"Shared space unavailable",reservedSpaceName:"This name is reserved for a system space; choose another name",reviewSpaceFailed:"The review space is unavailable",submitReviewFailed:"Could not submit the publication request",listReviewsFailed:"Could not load review requests",reviewFilesFailed:"Could not load submitted files",decideReviewFailed:"Review failed, please try again",listVersionsFailed:"Unable to load skill versions",uploadVersionFailed:"Unable to upload the new skill version"},Vue={truncatedData:"{{data}}… (truncated, {{count}} characters total)",incompleteEvent:"The stream ended with an incomplete SSE event. Raw data: {{data}}",invalidEventJson:"Failed to parse the SSE event JSON. Raw data: {{data}}"},Hue={loadConfigNetworkFailed:"Unable to load the sign-in configuration. Check your network and try again.",configServiceFailed:"The sign-in configuration service failed (HTTP {{status}}). Try again later.",invalidConfigResponse:"The sign-in configuration service returned an unreadable response. Try again later.",serviceNetworkFailed:"Unable to connect to the identity service. Check your network and try again.",invalidServiceResponse:"The identity service returned an unreadable response. Try again later.",serviceFailed:"The identity service failed (HTTP {{status}}). Try again later."},que={invalidToken:"The GitHub token is invalid or does not have repository write access",notFound:"The repository, branch, or file does not exist, or the token cannot access it",rejectedCommit:"GitHub rejected the commit. Check the branch and file state",requestFailed:"GitHub request failed (HTTP {{status}})",networkFailed:"Unable to connect to GitHub. Check your network and try again",invalidRepositoryFormat:"The GitHub repository must use the owner/repository format",insecureRepositoryUrl:"Only secure github.com repository URLs are supported",unsafeProjectPath:"The Agent project directory must be a safe relative path within the repository",tokenRequired:"A GitHub token is required",invalidBaseBranch:"The target branch format is invalid",invalidPublishBranch:"The publish branch format is invalid",noFiles:"There are no files to commit",missingBaseSha:"The target branch does not have a valid Git SHA",fileAlreadyExists:"{{path}} already exists in the target repository; the existing file was not overwritten",pathNotUpdatable:"The target path {{path}} is not an updatable file",invalidPullRequest:"GitHub did not return a valid pull request"},Wue={loadCapabilitiesFailed:"Failed to load video model capabilities",uploadAssetFailed:"Failed to upload {{fileName}}",enhancePromptFailed:"Failed to enhance the prompt",createTaskFailed:"Failed to create the video generation task",getTaskFailed:"Failed to load the video generation task",downloadFailed:"Failed to download the generated video"},Kue={listFailed:"Failed to load website integrations",createFailed:"Failed to create the website integration",deleteFailed:"Failed to delete the website integration"},Gue={loadFailed:"Failed to load the knowledge base",htmlHidden:"[HTML content hidden]",redacted:"[redacted]",depthTruncated:"[content nested too deeply; truncated]",circularReference:"[circular reference]",diagnosticsUnavailable:"[diagnostic information unavailable]",statusCode:"Status: {{status}}",errorCode:"Error code: {{code}}",requestId:"Request ID: {{requestId}}",diagnostics:"Diagnostics: {{diagnostics}}",detail:"Details: {{detail}}",signInRequired:"Sign in before accessing knowledge bases",forbidden:"You do not have permission to operate on this knowledge base",notFound:"The knowledge base or knowledge content does not exist",conflict:"The knowledge base cannot perform this operation in its current state",requestFailed:"Knowledge base request failed ({{status}})"},Xue={invalidName:"Names must contain 1–128 characters, without control or invisible formatting characters, or < >.",renameProjectFailed:"Unable to update the project name",renameVersionFailed:"Unable to update the version name",invalidNameUpdateResponse:"The name update response does not match the request. Refresh and try again.",invalidSourceSnapshot:"The source snapshot response has an invalid format.",invalidProjectList:"The project list response has an invalid format.",invalidProjectVersion:"The project version response has an invalid format.",loadProjectsFailed:"Unable to load saved projects",loadVersionsFailed:"Unable to load project versions",deleteVersionFailed:"Failed to delete the project version",invalidDeleteVersionResponse:"The project version deletion response has an invalid format.",loadProjectSourceFailed:"Unable to load project source",loadSnapshotFailed:"Unable to load the source snapshot",restoreSnapshotFailed:"Unable to restore the current source snapshot",downloadSourceFailed:"Failed to download the source",downloadNotZip:"The source download response is not a ZIP file.",downloadSizeMismatch:"The source archive size does not match the published record. Try again."},Yue={invalidFormat:"{{label}} has an invalid format.",validationSeparator:"; ",invalidAnalysisResult:"The migration analysis result has an invalid format.",invalidFrameworkCandidate:"A framework candidate has an invalid format.",invalidAnalysisEvidence:"The analysis evidence has an invalid format.",invalidEntryCandidate:"An entry candidate has an invalid format.",invalidQuestion:"A follow-up question has an invalid format.",invalidPendingInput:"Analysis questions are not readable",invalidTask:"The migration session has an invalid format.",invalidAnalysisReference:"The analysis result reference has an invalid format.",invalidSourcePersistence:"The migration source persistence status has an invalid format.",invalidActivity:"The migration activity has an invalid format.",invalidActivityItem:"A migration activity item has an invalid format.",invalidActivityTool:"A migration activity tool item has an invalid format.",invalidActivityPlan:"The migration execution plan has an invalid format.",invalidActivityPlanItem:"A migration execution plan item has an invalid format.",invalidArtifact:"The migration artifact has an invalid format.",invalidEnvironmentDefaults:"The environment variable defaults have an invalid format.",invalidArtifactFile:"A migration artifact file has an invalid format.",invalidVerificationCheck:"A migration verification check has an invalid format.",requestValidationFailed:"Request validation failed: {{detail}}",gatewayError:"{{fallback}} (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",nonJsonResponse:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}). Check the proxy or gateway configuration.",loadCapabilitiesFailed:"Failed to load migration capabilities",invalidCapabilities:"The migration capabilities have an invalid format.",invalidModelCapabilities:"The migration model capabilities have an invalid format.",loadTasksFailed:"Failed to load migration sessions",invalidTaskList:"The migration session list has an invalid format.",createTaskFailed:"Failed to create the migration session",uploadProjectFailed:"Failed to upload the migration project",loadActivityFailed:"Failed to load migration activity",loadEventsFailed:"Failed to follow the migration progress stream",invalidEventsResponse:"The migration progress stream returned an invalid frame.",reconnecting:"Connection lost. Reconnecting to the migration progress stream…",startFailed:"Failed to start the migration",submitAnswersFailed:"Failed to submit additional analysis information",submitInputFailed:"Could not submit the analysis answer",stopFailed:"Failed to stop the migration",deleteTaskFailed:"Failed to delete the migration session",loadArtifactFailed:"Failed to load the migration artifact",loadArtifactFileFailed:"Failed to load the migration artifact file",downloadArtifactFailed:"Failed to download the migration artifact",evaluation:{datasetSaveFailed:"Failed to save evaluation cases",datasetLoadFailed:"Failed to load evaluation cases",statusLoadFailed:"Failed to load evaluation status",resumeFailed:"Failed to continue evaluation",retryFailed:"Failed to retry evaluation",reportLoadFailed:"Failed to load the evaluation report",reportDownloadFailed:"Failed to download the evaluation report"},labels:{analysisResult:"Migration analysis result",recommendation:"Migration recommendation",boundary:"Migration boundary",frameworkCandidate:"Framework candidate",analysisEvidence:"Analysis evidence",recommendedFramework:"Recommended framework",entryCandidate:"Entry candidate",entryFramework:"Entry framework",includeScope:"Migration include scope",excludeScope:"Migration exclude scope",assumptions:"Analysis assumptions",question:"Follow-up question",analysisWarnings:"Migration warnings",task:"Migration session",artifactStatus:"Migration artifact status",analysisReference:"Analysis result reference",confirmation:"Migration confirmation",confirmedFramework:"Confirmed framework",error:"Migration error",sourcePersistence:"Migration source persistence status",activity:"Migration activity",activityItem:"Migration activity item",activityTool:"Migration activity tool item",activityPlanItem:"Migration activity plan item",artifact:"Migration artifact",cli:"CLI information",migration:"Migration information",startup:"Startup information",environment:"Environment variable information",verification:"Verification information",report:"Migration report",archive:"Artifact archive",environmentDefaults:"Environment variable defaults",requiredEnvironment:"Required environment variables",optionalEnvironment:"Optional environment variables",artifactFile:"Migration artifact file",verificationCheck:"Migration verification check",artifactWarnings:"Migration artifact warnings",errorResponse:"Error response",errorDetail:"Error details",capabilities:"Migration capabilities",framework:"Migration framework",modelCapabilities:"Migration model capabilities",taskList:"Migration session list",evaluationAsset:"Evaluation asset",evaluation:"Evaluation status",evaluationCapabilities:"Evaluation capabilities",evaluationDimension:"Evaluation dimension",evaluationCase:"Evaluation case",evaluationCriteria:"Evaluation criteria",evaluationMessage:"Evaluation conversation",evaluationDataset:"Evaluation dataset",evaluationDimensionResult:"Evaluation dimension result",evaluationEvidence:"Evaluation evidence",evaluationReport:"Evaluation report",evaluationSummary:"Evaluation summary",evaluationCaseResult:"Evaluation case result",evaluationOutput:"Evaluation output",evaluationLimitations:"Evaluation limitations",pendingInput:"Analysis question",pendingQuestion:"Analysis question item",pendingOption:"Analysis question option"}},Zue={status:{ready:"Ready",wakeable:"Asleep",creating:"Creating",starting:"Starting",pending:"Pending",running:"Running",failed:"Error",stopped:"Stopped",expired:"Expired",deleting:"Deleting",deleted:"Deleted",unknown:"Unknown status"},developmentTimeout:"The development environment timed out. The task may still be running; reopen this session later to check its status.",developmentDisconnected:"The connection to the development environment was interrupted. The task may still be running; reopen this session later to check its status.",developmentFailed:"The development task could not continue. The environment was preserved; try again in this session.",invalidStudioResponse:"{{fallback}} Studio returned an invalid response. Refresh and try again.",invalidSession:"AgentKit Sandbox returned invalid session information.",invalidSnapshot:"AgentKit Sandbox returned invalid snapshot information.",invalidSettings:"Sandbox returned invalid settings.",invalidThreadSnapshot:"Sandbox returned an invalid thread snapshot.",emptyConversationResponse:"The Sandbox conversation service returned no content.",invalidConversationResponse:"The Sandbox conversation service returned an unreadable response.",conversationFailed:"The Sandbox conversation failed. Try again later.",emptyReply:"Sandbox did not return a valid reply. Try again.",missingSession:"The AgentKit session is missing.",listCodexFailed:"Unable to load Codex agents. Try again later.",invalidSessionList:"AgentKit Sandbox returned an invalid session list.",invalidSnapshotList:"AgentKit Sandbox returned an invalid snapshot list.",startFailed:"Unable to start AgentKit Sandbox. Try again later.",listAgentFailed:"Unable to load {{kind}} agents. Try again later.",invalidKindSessionList:"AgentKit returned an invalid {{kind}} session list.",invalidKindSnapshotList:"AgentKit returned an invalid {{kind}} snapshot list.",createAgentFailed:"Unable to create a {{kind}} agent. Try again later.",missingSessionToOpen:"The AgentKit session to open is missing.",openAgentFailed:"Unable to open the {{kind}} agent.",invalidAgentHomeUrl:"The {{kind}} agent returned an invalid home URL.",missingSessionForTerminal:"The AgentKit session for the terminal is missing.",openTerminalFailed:"Unable to open the {{kind}} terminal.",deleteAgentFailed:"Unable to delete the {{kind}} agent.",missingSnapshot:"The agent to wake was not found.",resumeSnapshotFailed:"Unable to wake the agent. Try again later.",deleteSnapshotFailed:"Unable to delete the agent. Try again later.",missingSessionToConnect:"The AgentKit session to connect is missing.",connectCodexFailed:"Unable to connect to the Codex agent. Try again later.",sessionNotReady:"The AgentKit session is not ready. Current status: {{status}}.",invalidMessage:"The built-in agent session does not contain a valid message.",interruptFailed:"Unable to stop the current task.",getStatusFailed:"Unable to load Codex status.",getEndpointFailed:"Unable to load the Sandbox endpoint.",invalidEndpoint:"Sandbox returned an invalid endpoint.",createHandoffPairingFailed:"Unable to create a Codex cloud handoff pairing code.",invalidHandoffPairing:"Studio returned an invalid Codex cloud handoff pairing code.",getHandoffStatusFailed:"Unable to load the cloud handoff status.",invalidHandoffStatus:"Studio returned an invalid cloud handoff status.",listModelsFailed:"Unable to load Codex models.",invalidModelList:"Sandbox returned an invalid model list.",setModelFailed:"Unable to switch the Codex model.",invalidModel:"Sandbox returned an invalid model.",listSkillsFailed:"Unable to load Codex Skills.",invalidSkillList:"Sandbox returned an invalid Skill list.",listThreadsFailed:"Unable to load Codex threads.",invalidThreadList:"Sandbox returned an invalid thread list.",createThreadFailed:"Unable to create a new Codex thread.",missingThread:"The Codex thread to read is missing.",readThreadFailed:"Unable to load Codex history.",resumeThreadFailed:"Unable to resume the Codex thread.",forkThreadFailed:"Unable to fork the Codex thread.",archiveThreadFailed:"Unable to archive the Codex thread.",invalidArchiveResult:"Sandbox returned an invalid archive result.",deleteThreadFailed:"Unable to delete the Codex thread.",invalidDeleteResult:"Sandbox returned an invalid deletion result.",compactThreadFailed:"Unable to compact the Codex thread.",getSettingsFailed:"Unable to load Codex permissions and workspace settings.",updatePermissionsFailed:"Unable to update Codex permissions.",updateWorkspaceFailed:"Unable to update the Codex workspace.",invalidWorkingDirectory:"Sandbox returned an invalid working directory.",listDirectoriesFailed:"Unable to load Sandbox directories.",invalidDirectoryList:"Sandbox returned an invalid directory list.",resolveApprovalFailed:"Unable to submit the Codex approval decision.",uploadFileFailed:"Unable to upload the file to Sandbox.",invalidUploadResult:"Sandbox returned an invalid upload result.",disconnectCodexFailed:"Unable to disconnect the Codex agent.",deleteCodexFailed:"Unable to delete the Codex agent.",openSandboxTerminalFailed:"Unable to open the Sandbox terminal.",openSandboxBrowserFailed:"Unable to open the Sandbox browser.",toolLabel:"Sandbox tool",invalidToolUrl:"{{label}} returned an invalid URL.",unsafeToolUrl:"{{label}} returned an unsafe URL."},Jue={invalidSandboxVersion:"Invalid sandbox version response",loadSandboxVersionsFailed:"Failed to check sandbox versions",updateSandboxFailed:"Failed to update sandbox",invalidSandboxUpdate:"Invalid sandbox update response",errorWithDetailAndRawResponse:`{{context}} + */var Vze=Symbol.for("react.transitional.element"),Hze=Symbol.for("react.fragment");function Pue(e,t,n){var i=null;if(n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:Vze,type:e,key:i,ref:t!==void 0?t:null,props:n}}KP.Fragment=Hze;KP.jsx=Pue;KP.jsxs=Pue;Iue.exports=KP;var a=Iue.exports;const Due={requestFailed:"Request failed ({{status}})",unknownError:"Unknown error",contentTypeMissing:"Content-Type missing",response:"Response: {{response}}",fallbackWithDetail:"{{fallback}}: {{detail}}",fallbackWithHttpStatus:"{{fallback}} (HTTP {{status}})",nonJsonResponse:"{{fallback}}: the server returned a non-JSON response ({{contentType}})"},Mue={unconfigured:"AgentKit Dev Sandbox has not been configured by an administrator.",invalidSession:"AgentKit CLI returned an invalid session.",loadCapabilitiesFailed:"Unable to load the AgentKit CLI configuration.",invalidCapabilities:"AgentKit CLI returned an invalid configuration status.",listSessionsFailed:"Unable to load AgentKit CLI sessions.",invalidSessionList:"AgentKit CLI returned an invalid session list.",createSessionFailed:"Unable to create an AgentKit CLI session.",openSessionFailed:"Unable to open the AgentKit CLI session.",openTerminalFailed:"Unable to open the AgentKit CLI terminal.",invalidTerminalUrl:"AgentKit CLI returned an invalid terminal URL."},Lue={cnBeijing:"China North 2 (Beijing)",cnShanghai:"China East 2 (Shanghai)"},$ue={runtimeUnsupported:"This Runtime does not currently support connections. Confirm that the service is running normally."},Fue={autoConfigureFailed:"Failed to configure the Feishu bot automatically"},Bue={actionFailed:"Failed to {{action}}",detail:"Details: {{detail}}",request:"Request: {{request}}"},Uue={persistentMemoryHint:"Tip: The session no longer exists. With in-memory or SQLite short-term memory, sessions may be lost during multi-instance routing, process restarts, or rolling deployments. Use database-backed persistent short-term memory instead.",unsupportedRouteHint:"Tip: This Runtime does not provide the session run API and may be incompatible with the current Studio version.",toolArgumentHint:"Tip: The model generated incomplete tool arguments. Send the request again.",resourceCollectionExpiredHint:"Tip: This resource collection has expired. Send the task again so the system can collect the resources before creating the Agent.",networkConfigurationHint:"Tip: Try again later, and review the Runtime, model, or gateway logs.",modelQuotaHint:"Tip: The model has reached its TPM/RPM quota. Try again later or increase the model quota.",rawResponseLabel:"Raw response: ",copySecretFailed:"Failed to copy the secret value"},Que={httpStatus:"HTTP status: {{status}}",errorCode:"Error code: {{code}}",cloudResponseBody:`Cloud response body: +{{body}}`,loadFailedWithDetail:"Failed to load instance logs: {{detail}}",invalidFormat:"Failed to load instance logs: the service returned an invalid format"},zue={untitledSession:"Untitled session",webUnavailable:"Web search is unavailable because /web/search is not enabled on the server.",webFailed:"Web search failed: {{message}}",webNotMounted:"This Agent does not have the web_search tool mounted.",knowledgeNotMounted:"This Agent does not have a knowledge base mounted.",memoryNotMounted:"This Agent does not have long-term memory mounted.",knowledge:"Knowledge base",longTermMemory:"Long-term memory"},Vue={listSpacesFailed:"Failed to load Skill spaces",createSpaceFailed:"Failed to create the Skill space",updateSpaceFailed:"Failed to update the Skill space",deleteSpaceFailed:"Failed to delete the Skill space",uploadFailed:"Failed to upload the Skill",validateFailed:"Failed to validate the Skill",deleteFailed:"Failed to delete the Skill",listFilesFailed:"Failed to load Skill files",downloadFailed:"Failed to download the Skill",sharedSpaceFailed:"Shared space unavailable",reservedSpaceName:"This name is reserved for a system space; choose another name",reviewSpaceFailed:"The review space is unavailable",submitReviewFailed:"Could not submit the publication request",listReviewsFailed:"Could not load review requests",reviewFilesFailed:"Could not load submitted files",decideReviewFailed:"Review failed, please try again",listVersionsFailed:"Unable to load skill versions",uploadVersionFailed:"Unable to upload the new skill version"},Hue={truncatedData:"{{data}}… (truncated, {{count}} characters total)",incompleteEvent:"The stream ended with an incomplete SSE event. Raw data: {{data}}",invalidEventJson:"Failed to parse the SSE event JSON. Raw data: {{data}}"},que={loadConfigNetworkFailed:"Unable to load the sign-in configuration. Check your network and try again.",configServiceFailed:"The sign-in configuration service failed (HTTP {{status}}). Try again later.",invalidConfigResponse:"The sign-in configuration service returned an unreadable response. Try again later.",serviceNetworkFailed:"Unable to connect to the identity service. Check your network and try again.",invalidServiceResponse:"The identity service returned an unreadable response. Try again later.",serviceFailed:"The identity service failed (HTTP {{status}}). Try again later."},Wue={invalidToken:"The GitHub token is invalid or does not have repository write access",notFound:"The repository, branch, or file does not exist, or the token cannot access it",rejectedCommit:"GitHub rejected the commit. Check the branch and file state",requestFailed:"GitHub request failed (HTTP {{status}})",networkFailed:"Unable to connect to GitHub. Check your network and try again",invalidRepositoryFormat:"The GitHub repository must use the owner/repository format",insecureRepositoryUrl:"Only secure github.com repository URLs are supported",unsafeProjectPath:"The Agent project directory must be a safe relative path within the repository",tokenRequired:"A GitHub token is required",invalidBaseBranch:"The target branch format is invalid",invalidPublishBranch:"The publish branch format is invalid",noFiles:"There are no files to commit",missingBaseSha:"The target branch does not have a valid Git SHA",fileAlreadyExists:"{{path}} already exists in the target repository; the existing file was not overwritten",pathNotUpdatable:"The target path {{path}} is not an updatable file",invalidPullRequest:"GitHub did not return a valid pull request"},Kue={loadCapabilitiesFailed:"Failed to load video model capabilities",uploadAssetFailed:"Failed to upload {{fileName}}",enhancePromptFailed:"Failed to enhance the prompt",createTaskFailed:"Failed to create the video generation task",getTaskFailed:"Failed to load the video generation task",downloadFailed:"Failed to download the generated video"},Gue={listFailed:"Failed to load website integrations",createFailed:"Failed to create the website integration",deleteFailed:"Failed to delete the website integration"},Xue={loadFailed:"Failed to load the knowledge base",htmlHidden:"[HTML content hidden]",redacted:"[redacted]",depthTruncated:"[content nested too deeply; truncated]",circularReference:"[circular reference]",diagnosticsUnavailable:"[diagnostic information unavailable]",statusCode:"Status: {{status}}",errorCode:"Error code: {{code}}",requestId:"Request ID: {{requestId}}",diagnostics:"Diagnostics: {{diagnostics}}",detail:"Details: {{detail}}",signInRequired:"Sign in before accessing knowledge bases",forbidden:"You do not have permission to operate on this knowledge base",notFound:"The knowledge base or knowledge content does not exist",conflict:"The knowledge base cannot perform this operation in its current state",requestFailed:"Knowledge base request failed ({{status}})"},Yue={invalidName:"Names must contain 1–128 characters, without control or invisible formatting characters, or < >.",renameProjectFailed:"Unable to update the project name",renameVersionFailed:"Unable to update the version name",invalidNameUpdateResponse:"The name update response does not match the request. Refresh and try again.",invalidSourceSnapshot:"The source snapshot response has an invalid format.",invalidProjectList:"The project list response has an invalid format.",invalidProjectVersion:"The project version response has an invalid format.",loadProjectsFailed:"Unable to load saved projects",loadVersionsFailed:"Unable to load project versions",deleteVersionFailed:"Failed to delete the project version",invalidDeleteVersionResponse:"The project version deletion response has an invalid format.",loadProjectSourceFailed:"Unable to load project source",loadSnapshotFailed:"Unable to load the source snapshot",restoreSnapshotFailed:"Unable to restore the current source snapshot",downloadSourceFailed:"Failed to download the source",downloadNotZip:"The source download response is not a ZIP file.",downloadSizeMismatch:"The source archive size does not match the published record. Try again."},Zue={invalidFormat:"{{label}} has an invalid format.",validationSeparator:"; ",invalidAnalysisResult:"The migration analysis result has an invalid format.",invalidFrameworkCandidate:"A framework candidate has an invalid format.",invalidAnalysisEvidence:"The analysis evidence has an invalid format.",invalidEntryCandidate:"An entry candidate has an invalid format.",invalidQuestion:"A follow-up question has an invalid format.",invalidPendingInput:"Analysis questions are not readable",invalidTask:"The migration session has an invalid format.",invalidAnalysisReference:"The analysis result reference has an invalid format.",invalidSourcePersistence:"The migration source persistence status has an invalid format.",invalidActivity:"The migration activity has an invalid format.",invalidActivityItem:"A migration activity item has an invalid format.",invalidActivityTool:"A migration activity tool item has an invalid format.",invalidActivityPlan:"The migration execution plan has an invalid format.",invalidActivityPlanItem:"A migration execution plan item has an invalid format.",invalidArtifact:"The migration artifact has an invalid format.",invalidEnvironmentDefaults:"The environment variable defaults have an invalid format.",invalidArtifactFile:"A migration artifact file has an invalid format.",invalidVerificationCheck:"A migration verification check has an invalid format.",requestValidationFailed:"Request validation failed: {{detail}}",gatewayError:"{{fallback}} (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",nonJsonResponse:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}). Check the proxy or gateway configuration.",loadCapabilitiesFailed:"Failed to load migration capabilities",invalidCapabilities:"The migration capabilities have an invalid format.",invalidModelCapabilities:"The migration model capabilities have an invalid format.",loadTasksFailed:"Failed to load migration sessions",invalidTaskList:"The migration session list has an invalid format.",createTaskFailed:"Failed to create the migration session",uploadProjectFailed:"Failed to upload the migration project",loadActivityFailed:"Failed to load migration activity",loadEventsFailed:"Failed to follow the migration progress stream",invalidEventsResponse:"The migration progress stream returned an invalid frame.",reconnecting:"Connection lost. Reconnecting to the migration progress stream…",startFailed:"Failed to start the migration",submitAnswersFailed:"Failed to submit additional analysis information",submitInputFailed:"Could not submit the analysis answer",stopFailed:"Failed to stop the migration",deleteTaskFailed:"Failed to delete the migration session",loadArtifactFailed:"Failed to load the migration artifact",loadArtifactFileFailed:"Failed to load the migration artifact file",downloadArtifactFailed:"Failed to download the migration artifact",evaluation:{datasetSaveFailed:"Failed to save evaluation cases",datasetLoadFailed:"Failed to load evaluation cases",statusLoadFailed:"Failed to load evaluation status",resumeFailed:"Failed to continue evaluation",retryFailed:"Failed to retry evaluation",reportLoadFailed:"Failed to load the evaluation report",reportDownloadFailed:"Failed to download the evaluation report"},labels:{analysisResult:"Migration analysis result",recommendation:"Migration recommendation",boundary:"Migration boundary",frameworkCandidate:"Framework candidate",analysisEvidence:"Analysis evidence",recommendedFramework:"Recommended framework",entryCandidate:"Entry candidate",entryFramework:"Entry framework",includeScope:"Migration include scope",excludeScope:"Migration exclude scope",assumptions:"Analysis assumptions",question:"Follow-up question",analysisWarnings:"Migration warnings",task:"Migration session",artifactStatus:"Migration artifact status",analysisReference:"Analysis result reference",confirmation:"Migration confirmation",confirmedFramework:"Confirmed framework",error:"Migration error",sourcePersistence:"Migration source persistence status",activity:"Migration activity",activityItem:"Migration activity item",activityTool:"Migration activity tool item",activityPlanItem:"Migration activity plan item",artifact:"Migration artifact",cli:"CLI information",migration:"Migration information",startup:"Startup information",environment:"Environment variable information",verification:"Verification information",report:"Migration report",archive:"Artifact archive",environmentDefaults:"Environment variable defaults",requiredEnvironment:"Required environment variables",optionalEnvironment:"Optional environment variables",artifactFile:"Migration artifact file",verificationCheck:"Migration verification check",artifactWarnings:"Migration artifact warnings",errorResponse:"Error response",errorDetail:"Error details",capabilities:"Migration capabilities",framework:"Migration framework",modelCapabilities:"Migration model capabilities",taskList:"Migration session list",evaluationAsset:"Evaluation asset",evaluation:"Evaluation status",evaluationCapabilities:"Evaluation capabilities",evaluationDimension:"Evaluation dimension",evaluationCase:"Evaluation case",evaluationCriteria:"Evaluation criteria",evaluationMessage:"Evaluation conversation",evaluationDataset:"Evaluation dataset",evaluationDimensionResult:"Evaluation dimension result",evaluationEvidence:"Evaluation evidence",evaluationReport:"Evaluation report",evaluationSummary:"Evaluation summary",evaluationCaseResult:"Evaluation case result",evaluationOutput:"Evaluation output",evaluationLimitations:"Evaluation limitations",pendingInput:"Analysis question",pendingQuestion:"Analysis question item",pendingOption:"Analysis question option"}},Jue={status:{ready:"Ready",wakeable:"Asleep",creating:"Creating",starting:"Starting",pending:"Pending",running:"Running",failed:"Error",stopped:"Stopped",expired:"Expired",deleting:"Deleting",deleted:"Deleted",unknown:"Unknown status"},developmentTimeout:"The development environment timed out. The task may still be running; reopen this session later to check its status.",developmentDisconnected:"The connection to the development environment was interrupted. The task may still be running; reopen this session later to check its status.",developmentFailed:"The development task could not continue. The environment was preserved; try again in this session.",invalidStudioResponse:"{{fallback}} Studio returned an invalid response. Refresh and try again.",invalidSession:"AgentKit Sandbox returned invalid session information.",invalidSnapshot:"AgentKit Sandbox returned invalid snapshot information.",invalidSettings:"Sandbox returned invalid settings.",invalidThreadSnapshot:"Sandbox returned an invalid thread snapshot.",emptyConversationResponse:"The Sandbox conversation service returned no content.",invalidConversationResponse:"The Sandbox conversation service returned an unreadable response.",conversationFailed:"The Sandbox conversation failed. Try again later.",emptyReply:"Sandbox did not return a valid reply. Try again.",missingSession:"The AgentKit session is missing.",listCodexFailed:"Unable to load Codex agents. Try again later.",invalidSessionList:"AgentKit Sandbox returned an invalid session list.",invalidSnapshotList:"AgentKit Sandbox returned an invalid snapshot list.",startFailed:"Unable to start AgentKit Sandbox. Try again later.",listAgentFailed:"Unable to load {{kind}} agents. Try again later.",invalidKindSessionList:"AgentKit returned an invalid {{kind}} session list.",invalidKindSnapshotList:"AgentKit returned an invalid {{kind}} snapshot list.",createAgentFailed:"Unable to create a {{kind}} agent. Try again later.",missingSessionToOpen:"The AgentKit session to open is missing.",openAgentFailed:"Unable to open the {{kind}} agent.",invalidAgentHomeUrl:"The {{kind}} agent returned an invalid home URL.",missingSessionForTerminal:"The AgentKit session for the terminal is missing.",openTerminalFailed:"Unable to open the {{kind}} terminal.",deleteAgentFailed:"Unable to delete the {{kind}} agent.",missingSnapshot:"The agent to wake was not found.",resumeSnapshotFailed:"Unable to wake the agent. Try again later.",deleteSnapshotFailed:"Unable to delete the agent. Try again later.",missingSessionToConnect:"The AgentKit session to connect is missing.",connectCodexFailed:"Unable to connect to the Codex agent. Try again later.",sessionNotReady:"The AgentKit session is not ready. Current status: {{status}}.",invalidMessage:"The built-in agent session does not contain a valid message.",interruptFailed:"Unable to stop the current task.",getStatusFailed:"Unable to load Codex status.",getEndpointFailed:"Unable to load the Sandbox endpoint.",invalidEndpoint:"Sandbox returned an invalid endpoint.",createHandoffPairingFailed:"Unable to create a Codex cloud handoff pairing code.",invalidHandoffPairing:"Studio returned an invalid Codex cloud handoff pairing code.",getHandoffStatusFailed:"Unable to load the cloud handoff status.",invalidHandoffStatus:"Studio returned an invalid cloud handoff status.",listModelsFailed:"Unable to load Codex models.",invalidModelList:"Sandbox returned an invalid model list.",setModelFailed:"Unable to switch the Codex model.",invalidModel:"Sandbox returned an invalid model.",listSkillsFailed:"Unable to load Codex Skills.",invalidSkillList:"Sandbox returned an invalid Skill list.",listThreadsFailed:"Unable to load Codex threads.",invalidThreadList:"Sandbox returned an invalid thread list.",createThreadFailed:"Unable to create a new Codex thread.",missingThread:"The Codex thread to read is missing.",readThreadFailed:"Unable to load Codex history.",resumeThreadFailed:"Unable to resume the Codex thread.",forkThreadFailed:"Unable to fork the Codex thread.",archiveThreadFailed:"Unable to archive the Codex thread.",invalidArchiveResult:"Sandbox returned an invalid archive result.",deleteThreadFailed:"Unable to delete the Codex thread.",invalidDeleteResult:"Sandbox returned an invalid deletion result.",compactThreadFailed:"Unable to compact the Codex thread.",getSettingsFailed:"Unable to load Codex permissions and workspace settings.",updatePermissionsFailed:"Unable to update Codex permissions.",updateWorkspaceFailed:"Unable to update the Codex workspace.",invalidWorkingDirectory:"Sandbox returned an invalid working directory.",listDirectoriesFailed:"Unable to load Sandbox directories.",invalidDirectoryList:"Sandbox returned an invalid directory list.",resolveApprovalFailed:"Unable to submit the Codex approval decision.",uploadFileFailed:"Unable to upload the file to Sandbox.",invalidUploadResult:"Sandbox returned an invalid upload result.",disconnectCodexFailed:"Unable to disconnect the Codex agent.",deleteCodexFailed:"Unable to delete the Codex agent.",openSandboxTerminalFailed:"Unable to open the Sandbox terminal.",openSandboxBrowserFailed:"Unable to open the Sandbox browser.",toolLabel:"Sandbox tool",invalidToolUrl:"{{label}} returned an invalid URL.",unsafeToolUrl:"{{label}} returned an unsafe URL."},ede={invalidSandboxVersion:"Invalid sandbox version response",loadSandboxVersionsFailed:"Failed to check sandbox versions",updateSandboxFailed:"Failed to update sandbox",invalidSandboxUpdate:"Invalid sandbox update response",errorWithDetailAndRawResponse:`{{context}} {{detail}} Response details: {{response}}`,errorWithRawResponse:`{{context}} @@ -17,21 +17,21 @@ Response details: {{detail}}`,mpaRuntimeSessionsLoadFailed:"Failed to load MPA Runtime sessions",mpaDeletePreviewFailed:"Failed to load MPA delete preview",loadMpaDiagnosticsFailed:"Failed to load MPA Runtime diagnostics",mpaExecutionConfigFailed:"Failed to update the MPA session configuration",deploymentDisconnected:"Deployment failed: connection interrupted",deploymentMissingAgentName:"Deployment failed: Agent name missing from response",deploymentMissingConnection:"Deployment failed: AgentKit connection information missing from response",cancelDeploymentFailed:"Failed to cancel deployment ({{status}})",loadFailed:"Failed to load ({{status}})",loadPermissionsFailed:"Failed to load permissions ({{status}})",invalidPermissionResponse:"The permission service returned an unreadable response",checkStudioUpdateFailed:"Failed to check for Studio updates ({{status}})",studioUpdatePreflightFailed:"Studio update permission check failed ({{status}})",submitStudioUpdateFailed:"Failed to submit the Studio update ({{status}})",loadAgentUsageFailed:"Failed to load Agent usage",notProvided:"Not provided",agentUsageNonJson:"Failed to load Agent usage: the server returned a non-JSON response (HTTP {{status}}, Content-Type: {{contentType}}). ",checkStudioGateway:"Confirm that the current service is running in Studio mode and check the proxy or gateway configuration.",agentUsageInvalidJson:"Failed to load Agent usage: the server returned invalid JSON (HTTP {{status}}, Content-Type: {{contentType}}). ",retryCheckGateway:"Try again later. If the problem persists, check the proxy or gateway configuration.",loadCronJobsFailed:"Failed to load scheduled tasks",loadCronJobFailed:"Failed to load scheduled task details",createCronJobFailed:"Failed to create the scheduled task",updateCronJobFailed:"Failed to update the scheduled task",enableCronJobFailed:"Failed to enable the scheduled task",pauseCronJobFailed:"Failed to pause the scheduled task",runCronJobFailed:"Failed to run the scheduled task now",loadCronHistoryFailed:"Failed to load execution history",stopCronRunFailed:"Failed to stop the execution",deleteCronJobFailed:"Failed to delete the scheduled task",loadRuntimeFailed:"Failed to load the Runtime",loadLocalToolsFailed:"Failed to load local tools",connectDynamicRouteFailed:"Failed to connect the Studio dynamic route",a2aProbeDenied:"The Runtime rejected the A2A probe. Check the Runtime authentication configuration.",loadA2aCardFailed:"Failed to load the A2A Agent Card",loadRuntimeApiKeyFailed:"Failed to load the Runtime API key",runtimeApiKeyMissing:"The Runtime did not return a usable API key",loadMcpCredentialsFailed:"Failed to load MCP authentication",invalidMcpCredentials:"Studio returned invalid MCP authentication data",mpaDeleteUnconfirmed:"The deletion request timed out and Runtime deletion is not confirmed. Cleanup may still be running; refresh and check again later.",deleteFailed:"Delete failed ({{status}})",runtimeManageForbidden:"This account cannot manage the Runtime.",runtimeNotFound:"The Runtime does not exist or has been deleted.",runtimeUnavailable:"This account cannot access the Runtime.",checkRuntimeUpdateFailed:"Failed to check Runtime update capability (HTTP {{status}}). Try again later.",loadRuntimeDetailFailed:"Failed to load Runtime details",generateProjectFailed:"Failed to generate the project",generateAgentConfigFailed:"Failed to generate the Agent configuration",createDebugRunFailed:"Failed to create the debug run",createDebugSessionFailed:"Failed to create the debug session",loadDebugTraceFailed:"Failed to load the debug trace",invalidDebugTrace:"Failed to load the debug trace: invalid response format",debugRunFailed:"Debug run failed",cleanupDebugRunFailed:"Failed to clean up the debug run",errorWithCloudResponse:`{{context}} Cloud API: {{action}} Original cloud response: -{{response}}`,emptyCloudResponse:"(empty response body)"},ede={loadFailed:"Failed to load conversation mode capabilities (HTTP {{status}})",invalidResponse:"The conversation mode capabilities response has an invalid format"},tde={nonJson:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}, {{contentType}}){{detail}}"},nde={busy:"The workspace is busy. Try again shortly",notFound:"Workspace not found",duplicates:"Multiple personal workspace sessions were found. Contact your administrator",timeout:"Workspace recovery timed out. Your projects are retained. Try again",unavailable:"The workspace cannot be restored right now. Your projects are retained. Try again",persistence:"Persistence is not enabled for this Sandbox. Check the workspace configuration",startup:"Workspace startup failed. Check the Sandbox status",exists:"This project already exists. Open it from the project list",directory:"Project directory not found",configuration:"Configure the workspace Sandbox image first",state:"Could not check workspace status. Try again",list:"Could not restore the workspace or load projects. Try again",create:"Project initialization failed. Check that the image is available and try again",open:"Could not restore the workspace or open the project. Try again",connection:"Could not connect to the workspace. Try again",invalidWorkspaceUrl:"The workspace returned an invalid URL",operation:"Project operation failed. Try again",invalidProjectUrl:"The project URL is invalid",listFallback:"Could not load projects",connectionState:"Could not connect to the workspace. Try again"},ide={reporting:"Completing delivery details",packaging:"Preparing artifacts",savingVersion:"Saving version",finishing:"Finishing request",submitResult:"Submit build result",requestFailed:"Task request failed. Please retry.",invalidResponse:"Invalid task state response.",eventGap:"Restoring missing task output.",reconnecting:"Reconnecting. Existing output is preserved.",input:{pending:"Queued",sending:"Confirming delivery",delivered:"Delivered",withdrawn:"Not sent"},plan:"Execution plan",diff:"File changes",preparing:"Preparing task",preparingEnvironment:"Preparing development environment…",connectingEnvironment:"Connecting to development environment…",processing:"Processing request",thinking:"Thinking",read:"Read file · {{target}}",listFiles:"List directory · {{target}}",search:"Search · {{target}}",command:"Run command · {{target}}",editFiles:"Edit files · {{target}}",webSearch:"Search web · {{target}}",processSummary:"Processed {{count}} items",duration:"{{seconds}}s",durationUnits:{milliseconds:"{{value}} ms",hours:"{{value}} h",minutes:"{{value}} min",seconds:"{{value}} s"},failedTools:"{{count}} tools failed",toolFailed:"Failed",toolCalls:"{{count}} tool calls",turnDuration:"Turn elapsed {{duration}}",toolDuration:"Tool time {{duration}}",toolDurationPartial:"Recorded tool time {{duration}}",toolDurationHelp:"Sum of tool durations. Parallel calls can exceed turn elapsed time.",turnStatus:{completed:"Completed",failed:"Failed",interrupted:"Interrupted",cancelled:"Interrupted",unavailable:"Task ended"},notReported:"Not reported",partial:"Recorded",partialHelp:"Usage for this turn may be incomplete.",tokenDetails:"Turn token usage",model:"Turn model",totalTokens:"Total",inputTokens:"Input",cachedInputTokens:"Cached input",uncachedInputTokens:"Uncached input",cacheWriteInputTokens:"Cache write",outputTokens:"Output",reasoningOutputTokens:"Reasoning output",cacheHitRate:"Input cache hit rate",tokenHelp:"Cached input and reasoning output are subsets of input and output. Uncached input = input − cached input."},rde={common:Pue,agentkitCli:Due,cloudRegion:Mue,connections:Lue,feishuBot:$ue,requestError:Fue,runSse:Bue,runtimeLogs:Uue,search:Que,skills:zue,sse:Vue,identity:Hue,github:que,video:Wue,websiteIntegration:Kue,knowledge:Gue,intelligentDevelopment:Xue,migrations:Yue,sandbox:Zue,client:Jue,newChatCapabilities:ede,jsonResponse:tde,workspaceProjects:nde,developmentRuns:ide},Hze=Object.freeze(Object.defineProperty({__proto__:null,agentkitCli:Due,client:Jue,cloudRegion:Mue,common:Pue,connections:Lue,default:rde,developmentRuns:ide,feishuBot:$ue,github:que,identity:Hue,intelligentDevelopment:Xue,jsonResponse:tde,knowledge:Gue,migrations:Yue,newChatCapabilities:ede,requestError:Fue,runSse:Bue,runtimeLogs:Uue,sandbox:Zue,search:Que,skills:zue,sse:Vue,video:Wue,websiteIntegration:Kue,workspaceProjects:nde},Symbol.toStringTag,{value:"Module"})),sde="Agent reviews",ade="Request access for everyone in your organization",ode="Close",lde="Refresh",cde="Status",ude="Applicant",dde="Submitted",fde="Current version",hde="Model",pde="Returned by",mde="Approved by",gde="Reviewed",bde="Agent description",yde="Application notes",vde="Return reason",xde="Review comment",wde="Return reason (required)",kde="Content changed after submission; return and submit again",Ode="Withdraw to edit this Agent, then submit a new request to publish it",Sde="Other users will lose access to this Agent. Unpublish it?",Ede="Cancel",Cde="Confirm",Ade="Saving",Tde="Unpublish",_de="Withdraw request",jde="Approve",Nde="Publish for everyone",Rde="Request publication",Ide="Everyone",Pde={pending:"Pending",approved:"Approved",returned:"Returned",withdrawn:"Withdrawn"},Dde="Search agents or applicants",Mde="Region",Lde="All statuses",$de="Agent",Fde="Actions",Bde="Review application",Ude="Application details",Qde="No matching applications",zde="No Agent review requests",Vde="{{count}} / {{limit}} characters",qze={title:sde,dialogDescription:ade,close:ode,refresh:lde,statusTitle:cde,submitter:ude,submittedAt:dde,version:fde,model:hde,returnedBy:pde,approvedBy:mde,reviewedAt:gde,description:bde,message:yde,reason:vde,comment:xde,reasonRequired:wde,contentChanged:kde,withdrawConfirm:Ode,unpublishConfirm:Sde,cancel:Ede,confirm:Cde,saving:Ade,unpublish:Tde,withdraw:_de,return:"Return",approve:jde,publish:Nde,submit:Rde,private:"Private",enterprise:Ide,status:Pde,search:Dde,region:Mde,all:Lde,agent:$de,actions:Fde,review:Bde,details:Ude,noMatches:Qde,empty:zde,textCount:Vde},Wze=Object.freeze(Object.defineProperty({__proto__:null,actions:Fde,agent:$de,all:Lde,approve:jde,approvedBy:mde,cancel:Ede,close:ode,comment:xde,confirm:Cde,contentChanged:kde,default:qze,description:bde,details:Ude,dialogDescription:ade,empty:zde,enterprise:Ide,message:yde,model:hde,noMatches:Qde,publish:Nde,reason:vde,reasonRequired:wde,refresh:lde,region:Mde,returnedBy:pde,review:Bde,reviewedAt:gde,saving:Ade,search:Dde,status:Pde,statusTitle:cde,submit:Rde,submittedAt:dde,submitter:ude,textCount:Vde,title:sde,unpublish:Tde,unpublishConfirm:Sde,version:fde,withdraw:_de,withdrawConfirm:Ode},Symbol.toStringTag,{value:"Module"})),Hde={backToEvaluationCase:"Back to evaluation case",cancel:"Cancel",copied:"Copied",copy:"Copy",exportConversation:"Export conversation",retry:"Retry"},qde={title:"How would you like to add an Agent?",subtitle:"Choose the approach that best fits your project.",quickCreate:{title:"Create from scratch",description:"Build an Agent with intelligent, custom, template, or workflow modes."},intelligent:{title:"Intelligent mode",description:"Describe your goal, then build, debug, and validate the Agent interactively."},package:{title:"Add and deploy a code package",description:"Upload an Agent project archive, review the code, and deploy it to AgentKit Runtime."},migrate:{title:"Migrate an existing project",description:"Migrate an existing LangChain, Dify, or similar project to AgentKit Runtime."}},Wde={subject:{file:"file changes",command:"command execution"},decision:{accept:"Allowed {{subject}} once",acceptForSession:"Allowed {{subject}} for this session",decline:"Declined {{subject}}",cancel:"Cancelled approval for {{subject}}"},details:{command:"Command",grantRoot:"Authorized path",cwd:"Working directory"}},Kde={noDescription:"No description",region:"Region",unknownAgent:"Unknown Agent"},Gde={agentTransfer:"Agent handoff",annotationHint:"Model response; select text to add an annotation",continueBranch:"Continue with “{{branch}}”",emptyResponse:"This response has no displayable content.",subagentDescription:"Working on a task handed off by the primary Agent."},Xde={title:"Configure {{provider}} credentials",prefix:"Agent Workspace requires {{provider}} credentials. Set",and:"and",suffix:"in the runtime environment, then retry."},Yde={buildRunning:{title:"A build is still running",description:"Leaving will stop this build. The session will remain available in your history.",confirm:"Stop and leave"},deleteThread:{title:"Delete Codex session",description:"Delete “{{name}}” and remove it from your session history?",confirm:"Delete"},returnToCreate:{title:"Return to the create page?",description:"Your current entries will be lost.",confirm:"Return"}},Zde={additionalAgentDeleteFailures:"; {{count}} more failed",agentDeleteFailures:"Failed to delete {{count}} Agents: {{failures}}{{suffix}}",agentToolsMissing:"This Agent is missing required tools: {{tools}}",buildStopUnconfirmed:"You left the development environment, but Studio could not confirm that the build stopped. It may still be running; check its status in session history later.",builtinAgentSendFailed:"Failed to send to the built-in Agent: {{message}}",bytePlusEvaluationUnsupported:"AgentKit evaluation sets are not currently supported on BytePlus",clipboardUnsupported:"This browser does not support writing to the clipboard.",cloudCodexEmptyReply:"The cloud Codex task ended without a response. Send the task again.",cloudCodexSessionMissing:"The cloud Codex session has not appeared in the list yet. Try again shortly.",deploymentRuntimeIdMissing:"Deployment completed without returning a Runtime ID.",environmentExpired:"The selected environment is no longer available. Refresh and select it again.",environmentsLoadFailed:"Failed to load environments",evaluationCaseSessionMissing:"This evaluation case has no session reference and cannot be opened.",evaluationUnsupportedForReply:"This response cannot be added to an evaluation set",firstFrameRequired:"Add a first-frame image before generating from first and last frames.",incompletePromptOptimization:"The prompt optimization result is incomplete. Run the optimization again.",intelligentCapabilityCheckFailed:"Failed to check intelligent development capabilities (HTTP {{status}})",intelligentSessionCreateFailed:"Failed to create the intelligent development session",invalidIntelligentCapability:"The intelligent development capability response is invalid.",localBffToolsNotConfigured:"No tools are configured for the local Studio BFF.",localToolsLoadFailed:"Failed to load local tools",loginPopupBlocked:"The browser blocked the sign-in window. Allow pop-ups and try again.",loginPopupClosed:"The sign-in window was closed. Sign in again to continue.",mediaTooLarge:"{{fileName}} exceeds this platform's media size limit.",mountEnvironmentFailed:"Failed to mount the environment",noConnectedSandbox:"No Sandbox is currently connected.",noCreateAgentPermission:"Your account does not have permission to add Agents.",noManageAgentPermission:"Your account does not have permission to manage Agents.",noOptimizationBaseline:"There is no pre-optimization version available for comparison.",oauthUrlMissing:"The event does not include an authorization URL.",onlyCloudAgentUpdatable:"Only deployed cloud Agents can be updated.",optimizationVersionMissing:"The project version for this optimization could not be found. It may have been deleted.",persistentStorageNotConfigured:"Persistent storage has not been configured by an administrator",readDraftFailed:"Unable to read local drafts. Try again.",runtimeAgentNameMissing:"The Runtime is missing an Agent name and cannot be updated.",runtimeBffToolsDisabled:"BFF tool capabilities are not enabled for this Runtime Agent.",runtimeDeploymentConfigUnavailable:"The Runtime's original deployment configuration cannot be restored, so it cannot be updated safely.",runtimeMissingForConnection:"Runtime information is missing, so the Agent cannot be connected.",runtimeRegionMissingForDelete:"The Runtime is missing region information and cannot be deleted.",runtimeRegionMissingForUpdate:"The Runtime is missing region information and cannot be updated.",runtimeUpdateUnsupported:"This Runtime does not support in-place updates.",sandboxRuntimeUnavailable:"This Agent does not have an available Sandbox Runtime.",sandboxToolsUnavailable:"The current Studio BFF does not provide Sandbox execution tools.",saveDraftLocationRejected:"The browser could not save the current draft location. Check site storage permissions and try again.",saveDraftRejected:"The browser could not save the draft. Try again.",selectSkillToOptimize:"Select a Skill to optimize first.",sessionMissingForMount:"The current session does not exist, so an environment cannot be mounted.",sessionNotReady:"The session is not ready yet.",sessionUnavailable:"The current session is unavailable. Close it and try again.",sourceNotReady:"The source is not ready yet. Return to the conversation to continue.",textVideoRejectsReferences:"Text-to-video does not use reference media. Remove the images or videos first.",videoEditRequiresVideo:"Add the video you want to edit first.",videoExtendRequiresVideo:"Add a source video before extending it.",videoGenerationFailed:"Video generation failed. Try again later.",videoModeUnsupported:"The selected video mode is not supported on this platform.",videoPreviewMissing:"The video task completed, but the server did not return a preview URL.",videoReferenceRequired:"Add at least one reference image or video."},Jde={like:"Like",removeLike:"Remove like",dislike:"Dislike",removeDislike:"Remove dislike",reportIssue:"Report an issue",traceFlameGraph:"Tracing flame graph"},efe={0:"What would you like to work on today?",1:"How can I help?",2:"What would you like me to look into?",3:"Ask me anything",4:"Hi, let's get started",5:"Start a new conversation",6:"What should we tackle first?",7:"Tell me what you have in mind",8:"Where should we begin?",9:"What can I help you with?",10:"Ready to move this forward?",11:"What's most important right now?",12:"Let's get something done today",13:"I'm ready when you are",intelligentDevelopment:"Give your ideas room to grow"},tfe={agentCapabilities:"Checking Agent capabilities…",session:"Loading session…"},nfe={cancelled:"Authorization was cancelled.",pasteCallbackUrl:"After authorization, paste the full callback URL from your browser's address bar:",popupBlocked:"The browser blocked the authorization window. Allow pop-ups and try again.",unsupportedUrl:"The authorization URL is not HTTP or HTTPS and was blocked."},ife={volcengine:"Volcengine"},rfe={checkingPersistence:"Checking persistent storage…",exitDevelopment:"Exit development",fileUploaded:"Uploaded a file to the Sandbox",filesUploaded:"Uploaded {{count}} files to the Sandbox",intelligentDevelopment:"Intelligent development",mode:{readOnly:"Read only",workspaceWrite:"Workspace write",fullAccess:"Full access"},approvalPolicy:{untrusted:"Untrusted commands only",onRequest:"Ask when needed",never:"Never ask"},reviewer:{user:"Ask me",autoReview:"Automatic review"},labels:{approvalPolicy:"Approval policy",file:"File",fileNumber:"File {{number}}",mode:"Sandbox mode",networkAccess:"Network access",reviewer:"Approval method",workingDirectory:"Working directory"},network:{allowed:"Allowed",disabled:"Off"},permissionsUpdated:"Updated Codex permissions for this Sandbox session",persistenceUnknown:"Unable to verify persistent storage",stoppedReady:"Stopped. You can continue typing.",uploadedFilesPrompt:"The following files were uploaded to the current Sandbox workspace. Use them in this task:",workspaceUpdated:"Workspace updated"},sfe={addAgent:"Add Agent",addFromPackage:"Add from code package",agent:"Agent",automations:"Automations",createAgent:"Create Agent",createSkill:"Create Skill",cronJobs:"Cronjob",issueFeedback:"Issue feedback",library:"Library",migrateAgent:"Migrate Agent",newConversation:"New conversation",optimizeSkill:"Optimize {{name}}",search:"Search",skill:"Skill",skillLibrary:"Skill library",systemInfo:"System information",updateAgent:"Update {{name}}",codeProjects:"Code projects",reviewCenter:"Review center"},afe={title:"Create from workspace",description:"Create and manage code projects, then develop and debug in VS Code"},ofe={actions:Hde,addAgent:qde,approval:Wde,common:Kde,conversation:Gde,credentials:Xde,dialogs:Yde,errors:Zde,feedback:Jde,greetings:efe,loading:tfe,oauth:nfe,providers:ife,sandbox:rfe,titles:sfe,workspaceProjectEntry:afe},Kze=Object.freeze(Object.defineProperty({__proto__:null,actions:Hde,addAgent:qde,approval:Wde,common:Kde,conversation:Gde,credentials:Xde,default:ofe,dialogs:Yde,errors:Zde,feedback:Jde,greetings:efe,loading:tfe,oauth:nfe,providers:ife,sandbox:rfe,titles:sfe,workspaceProjectEntry:afe},Symbol.toStringTag,{value:"Module"})),lfe="Automations",cfe="Connect development tools and extend your Agents with automated workflows",ufe="Search automations",dfe="Automation categories",ffe={development:"Development",channels:"Messaging channels"},hfe="{{category}} automations",pfe="Open {{name}}",mfe="Available only in local deployments",gfe="No matching automations",bfe="Try searching for another name",yfe="Back to automations",vfe={"coding-agents":{name:"Configure coding agents",badge:"Local",description:"Install built-in VeADK and AgentKit skills globally for Trae, Claude Code, or Codex."},template:{name:"Import starter project",description:"Create a minimal Agent project in your repository with continuous delivery to AgentKit Runtime.",title:"Import starter project",subtitle:"Add a ready-to-run basic Agent and continuous delivery configuration to your repository",panel:"This creates a pull request containing the basic project and AgentKit Runtime delivery workflow.",submitLabel:"Import template and create PR",regionHelp:"Must match the target Runtime region",pullRequest:{title:"feat: import AgentKit basic template",description:"Import a basic Agent project with the AgentKit Studio App Server and add continuous delivery to AgentKit Runtime. Configure the required {{provider}} secrets before merging."},fields:{repository:{label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL"},baseBranch:{label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base"},projectPath:{label:"Agent project directory",placeholder:"agentkit-basic-agent",help:"The basic project will be added here; app.py mounts the complete Studio App Server and serves as the entry point"},runtimeName:{label:"Runtime name",placeholder:"support-agent",help:"Used by the AgentKit delivery configuration"},runtimeId:{label:"Runtime ID",placeholder:"rt-xxxxxxxx",help:"The AgentKit Runtime that will receive continuous updates"}}},delivery:{name:"AgentKit Runtime delivery",description:"Add a workflow that continuously delivers your repository to AgentKit Runtime.",title:"AgentKit Runtime delivery",subtitle:"Add continuous delivery to the repository through a pull request",panel:"This creates a release branch and opens a pull request containing the GitHub Actions workflow.",submitLabel:"Confirm and create PR",regionHelp:"Must match the target Runtime region",pullRequest:{title:"feat: continuously publish to AgentKit Runtime",description:"Add a GitHub Actions workflow that continuously publishes updates from the target branch to AgentKit Runtime. Configure the required {{provider}} secrets before merging."},fields:{repository:{label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL"},baseBranch:{label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base"},projectPath:{label:"Agent project directory",placeholder:".",help:"Defaults to the repository root; the directory must contain an app.py that mounts the complete Studio App Server"},runtimeName:{label:"Runtime name",placeholder:"support-agent",help:"Used by the AgentKit delivery configuration"},runtimeId:{label:"Runtime ID",placeholder:"rt-xxxxxxxx",help:"The AgentKit Runtime that will receive continuous updates"}}},review:{name:"Automated PR review",description:"Use a GitHub App to review pull requests in an isolated Sandbox.",title:"Automated PR review",subtitle:"Trigger Sandbox reviews through the GitHub App and publish results to pull requests",panel:"Install the GitHub App to target repositories, then enable automated review for each repository.",submitLabel:"Install GitHub App",regionHelp:"",pullRequest:{title:"chore: configure automated PR review",description:"Add a GitHub Actions workflow that reviews same-repository pull requests in an isolated Sandbox and publishes the result as a GitHub review. Configure the required workflow secrets before merging."},fields:{repository:{label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL"},baseBranch:{label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base"},sandboxToolId:{label:"Sandbox Tool ID",placeholder:"tool-xxxxxxxx",help:"The AgentKit CodeEnv used for each review"},modelName:{label:"Review model",placeholder:"review-model",help:"The code review model name injected into the Sandbox"},modelBaseUrl:{label:"Model API URL",placeholder:"https://ark.example.com/api/v3",help:"Must be an OpenAI-compatible HTTPS endpoint"}}},"gitlab-review":{name:"GitLab MR review",description:"Use a GitLab integration to review merge requests in an isolated Sandbox."},feishu:{name:"Feishu bot",badge:"Beta",description:"Create a Feishu bot and connect its messages directly to AgentKit Runtime."},"mpa-channels":{name:"MPA agent messaging channels",description:"Connect an existing MPA agent to Feishu, WeCom and DingTalk."},"website-integration":{name:"Website integration",description:"Embed an AgentKit Runtime on your website as a floating chat window."}},xfe={required:"Required",optional:"Optional",region:"Region",tokenLabel:"GitHub Token",getToken:"Get token",createToken:"Create GitHub token",tokenPlaceholder:"Requires write access to repository contents and pull requests",tokenWorkflowPlaceholder:"Requires write access to contents, pull requests, and workflows",hideToken:"Hide token",showToken:"Show token",tokenHelp:"The token is used only for this submission. It is not stored in the browser or written to the pull request.",tokenWorkflowHelp:"This token is used only to create the configuration PR. It is not a general Sandbox requirement and is not stored in the browser or written to the PR.",prCreated:"PR #{{number}} created",configPrCreated:"Configuration PR #{{number}} created",configPrNextStep:"After it is merged, later pull requests in the same repository will trigger reviews automatically.",viewOnGitHub:"View on GitHub",viewConfigPr:"View configuration PR",secretsHeading:"Before merging the pull request, configure these GitHub Actions secrets in the repository:",secretsConfigHeading:"Before merging the configuration PR, add runtime secrets to the target repository",openSecrets:"Open Secrets settings",secretsPath:"Path: Settings → Secrets and variables → Actions → Repository secrets",repositoryConfigHelp:"A PR review configuration will be added for {{repository}}",repositoryReviewHelp:"GitHub App will validate pull requests for {{repository}}",secretPair:"{{accessKey}}, {{secretKey}} (required)",sessionToken:"{{sessionToken}} (required when using temporary credentials)",requiredSecret:"{{name}} (required)",temporaryCredentialRequired:" (required when using temporary credentials)",requiredSuffix:" (required)",submitting:"Creating PR…",validation:{required:"This field is required",repository:"Enter owner/repository or a full GitHub repository URL",baseBranch:"The target branch format is invalid",projectPath:"Enter a relative path within the repository",runtimeId:"The Runtime ID format is invalid",sandboxToolId:"The Sandbox Tool ID format is invalid",modelName:"The model name format is invalid",modelBaseUrlSafe:"Enter an HTTPS URL without credentials, query parameters, or fragments",modelBaseUrl:"Enter a valid HTTPS URL",runtimeName:{required:"Runtime name is required",characters:"Runtime name can contain only letters, numbers, underscores, and hyphens",length:"Runtime name must be 4–64 characters"}}},wfe={title:"Configure coding agents",description:"Install the AgentKit skills bundled with Studio globally for local coding clients.",retry:"Retry",clients:{ariaLabel:"Select coding agents",title:"Local clients",detectAgain:"Detect again",detecting:"Detecting local clients…",detected:"Client detected",available:"Available",unavailable:"Not detected"},skills:{ariaLabel:"Select bundled skills",title:"Bundled skills",viewFiles:"View files",items:{"veadk-agent-development":{name:"VeADK Agent development",description:"Build and refine Agents with VeADK."},"agentkit-cli":{name:"AgentKit CLI",description:"Manage and deploy AgentKit resources with AgentKit CLI."}}},global:{ariaLabel:"Global installation directories",title:"Global installation",description:"Available to other local projects after configuration",empty:"Select a client to see its installation directory."},success:"Configured {{skillCount}} skill(s) for {{agentCount}} client(s)",selection:"{{agentCount}} client(s) and {{skillCount}} skill(s) selected",selectClient:"Select a client first",configuring:"Configuring…",configure:"Configure",errors:{detect:"Failed to detect local clients",configure:"Configuration failed. Check permissions for your user directory and try again."},preview:{description:"Browse the skill files bundled with Studio in read-only mode",close:"Close file preview",loading:"Loading files…",error:"Failed to load skill files",skillFiles:"{{name}} files",files:"Files",fileContent:"File contents",notPreviewable:"This file is not previewable UTF-8 text.",noFiles:"No previewable files."}},kfe={noDescription:"No description",unknownCreator:"Unknown creator",optionMetadata:"{{creator}} | {{createdAt}}",selectAgent:"Select an MPA agent",chooseAgent:"Choose an MPA agent",search:"Search by name, Runtime ID or region",noMatches:"No matching MPA agents",loading:"Loading MPA agents…",empty:"No manageable MPA agents. Create or deploy an MPA agent first.",unauthorized:"Studio administrator access is required to manage MPA messaging channels. Contact an administrator.",loadFailed:"Could not load MPA agents. Please retry.",retry:"Retry",refresh:"Refresh list",loadMore:"Load more",moreAvailable:"More agents are available. Search matches loaded results; load more to continue.",chooseHint:"Select an MPA agent to configure Feishu, WeCom and DingTalk."},Ofe={title:"Feishu bot",description:"Create a Feishu Agent powered by AgentKit Runtime",panel:"Enter the credentials for a published Feishu app. Studio will generate a basic Agent, create a dedicated Runtime, and enable the persistent Feishu messaging connection.",agentName:"Agent name",agentNameHelp:"Used as the root Agent name in the new Runtime",region:"Deployment region",regionHelp:"The Runtime and build artifacts will be created in this region",regions:{"cn-beijing":"Beijing","cn-shanghai":"Shanghai"},appId:"Feishu App ID",appIdHelp:"Application credential from the Feishu Open Platform",appSecret:"Feishu App Secret",appSecretPlaceholder:"Enter the App Secret",appSecretHelp:"Written only to the environment variables of the new Runtime",hideSecret:"Hide App Secret",showSecret:"Show App Secret",hide:"Hide",show:"Show",confirmCancel:"Cancelling will stop the task and clean up any Runtime already created. Continue?",status:{preparing:"Generating the basic Agent",running:"Creating Runtime",cancelling:"Cancelling deployment",succeeded:"Feishu bot Runtime created",cancelled:"Deployment cancelled",failed:"Creation failed"},steps:{prepare:"Generate Agent",build:"Build image",deploy:"Create Runtime",publish:"Publish service"},openConsole:"Open Runtime console",credentials:{title:"Credential handling",description:"The App Secret is used only for this deployment. It is never written to generated source code or browser storage."},cancelDeployment:"Cancel deployment",creating:"Creating…",create:"Create Feishu bot Runtime",validation:{appId:"Enter the Feishu App ID",appSecret:"Enter the Feishu App Secret",agentName:{required:"Name is required",reserved:"user is reserved by Google ADK. Choose another name",characters:"Name must start with a letter or underscore and contain only letters, numbers, and underscores"}},generatedAgent:{description:"A helpful assistant that receives messages through Feishu.",instruction:"You are a helpful assistant serving users through Feishu. Understand each request accurately and provide concise, reliable answers. Ask clarifying questions when information is missing, and never invent facts."}},Sfe={title:lfe,description:cfe,search:ufe,categoriesLabel:dfe,categories:ffe,resultsLabel:hfe,open:pfe,localOnly:mfe,emptyTitle:gfe,emptyDescription:bfe,backToAutomations:yfe,cards:vfe,github:xfe,codingAgents:wfe,mpaChannels:kfe,feishu:Ofe},Gze=Object.freeze(Object.defineProperty({__proto__:null,backToAutomations:yfe,cards:vfe,categories:ffe,categoriesLabel:dfe,codingAgents:wfe,default:Sfe,description:cfe,emptyDescription:bfe,emptyTitle:gfe,feishu:Ofe,github:xfe,localOnly:mfe,mpaChannels:kfe,open:pfe,resultsLabel:hfe,search:ufe,title:lfe},Symbol.toStringTag,{value:"Module"})),Efe={"zh-CN":"简体中文","en-US":"English"},Xze={languageNames:Efe},Yze=Object.freeze(Object.defineProperty({__proto__:null,default:Xze,languageNames:Efe},Symbol.toStringTag,{value:"Module"})),Cfe={selectedExcerptLabel:"Selected excerpt",commentLabel:"Annotation",commentSeparator:": ",successTitle:"Added to the Bad Case evaluation set",successDescription:"This annotation is linked to the current question and the complete model response.",done:"Done",ariaLabel:"Annotate the selected model response",title:"Add annotation",content:"Annotation",placeholder:"Describe the issue or the expected change",retryError:"{{error}}. Please try again.",cancel:"Cancel",submit:"Add to Bad Case"},Afe={attachment:"attachment",image:"image",preview:"Preview {{name}}",uploading:"Uploading",uploadFailed:"Upload failed",remove:"Remove {{name}}",previewDialog:"{{name}} preview",download:"Download",close:"Close",reading:"Loading document…",loadFailed:"Failed to load document: {{error}}"},Tfe={errorTitle:"Cloud log error",copyError:"Copy complete error details",retry:"Retry",statuses:{live:"Live",connecting:"Connecting",retrying:"Reconnecting",idle:"Disconnected"},title:"Instance logs",description:"The VeFaaS instance handling the current conversation request",close:"Close instance logs",instanceId:"Instance ID",waitingInstance:"Waiting for instance",request:"Request {{id}}",ariaLabel:"Live VeFaaS instance logs",notCapturedTitle:"No instance captured yet",notCapturedDescription:"Send a message to see the instance that handles it and its live logs.",connectingTitle:"Connecting to instance logs",connectingDescription:"Establishing a secure log stream through the Studio BFF.",emptyTitle:"No logs yet",emptyDescription:"Connected to the instance and waiting for new log output.",download:"Download logs",retention:"Logs refresh automatically. Only the latest {{count}} lines are kept."},_fe={title:"Trace",statuses:{loading:"Loading",ready:"",collecting:"Collecting",disabled:"Disabled",forbidden:"Permission required",error:"Failed to load"},errors:{collecting:"The trace is still being collected. Please wait.",disabled:"Tracing is not enabled for this agent. Enable it in the console and try again.",forbidden:"Your account cannot read APMPlus traces. Ask an administrator for read access.",error:"Failed to load the trace. Please try again later."},callCount:"{{count}} calls · {{duration}} ms",close:"Close",loading:"Loading trace…",retryNow:"Retry now",reload:"Reload",empty:"No trace is available for this session yet.",attributes:"Attributes",selectCall:"Select a call on the left to view its details"},jfe={exportNote:"This conversation was exported from AgentKit Studio for reference only.",imageFailed:"Failed to generate the image. Please try again.",browserUnsupported:"This browser cannot generate a conversation image. Please try again.",copyUnsupported:"This browser cannot copy images. Download the image instead.",exportFailed:"Export failed. Please try again.",title:"Export conversation",description:"Choose a format and download all inputs and outputs through the current response.",close:"Close",generatingContent:"Preparing export…",retry:"Try again",previewPage:"Previewing page 1 of {{count}}",previewAlt:"Conversation export page 1 of {{count}}",format:"Export format",generatingFormat:"Generating {{format}}…",copying:"Copying…",copiedFirst:"First page copied",copied:"Copied",copyFirst:"Copy first page",copyImage:"Copy image",generating:"Generating…",downloadArchive:"Download PNG archive ({{count}} pages)",downloadFormat:"Download {{format}}"},Nfe={a2a:{connecting:"Waiting for Runtime response…",submitted:"Task queued…",working:"Task running…"},unsupportedComponent:"Unsupported component: {{component}}",sandboxIdentity:"Codex Sandbox execution identifiers",useSkill:"Use the {{name}} skill",thinkingDone:"Finished working thought",thinking:"Working thought",reasoningDone:"Finished model reasoning",reasoning:"Model reasoning",justNow:"Just now",sourceUnavailable:"The generated source is temporarily unavailable. Please try again later.",downloadStarted:"Download started",verifiedDelivery:"Verified deliverable",generatedSource:"Generated agent source",entryPoint:"Entry point",fileCount:"Files",size:"Size",validationTime:"Validated",generationTime:"Generated",checksPassed:"{{count}} checks passed",sourceReady:"Source is ready to deploy",sourceGuidance:"The source is ready to view, download, or deploy. Confirm the runtime configuration before deployment.",viewSource:"View source",preparing:"Preparing…",viewChanges:"View changes",downloadSource:"Download source",sourceNotReady:"The source is not ready yet",manualDeploy:"Deploy manually to Runtime",deployAgent:"Deploy Agent",beforeOptimization:"Before optimization",afterOptimization:"After optimization",planStatuses:{pending:"Pending",in_progress:"In progress",completed:"Completed",failed:"Incomplete"},renderUi:"Render UI",truncated:"… (truncated)",agentAdjusting:"Agent is adjusting",sandboxDetails:"Detailed Codex Sandbox output",waitingCodex:"Waiting for Codex output",arguments:"Arguments",result:"Result",artifacts:"Artifacts",downloadNamed:"Download {{name}}",powerpoint:"PowerPoint presentation",preview:"Preview",download:"Download",previewDialog:"{{name}} preview",closePreview:"Close preview",slidePreview:"{{name}} slide preview",mcpToolset:"MCP toolset",authorized:"Authorized · {{tool}}",authorizationRequired:"{{tool}} requires authorization",oauthDescription:"The {{tool}} toolset is protected by OAuth and requires sign-in before use.",oauthProvider:"You will be redirected to {{provider}} to sign in.",oauthContinue:"The conversation will continue automatically after authorization.",waitingAuthorization:"Waiting for authorization…",authorize:"Authorize",missingAuthorizationUrl:"No authorization URL was found in the event.",tools:{web_search:{running:"Searching the web",done:"Web search complete"},link_reader:{running:"Reading webpage",done:"Webpage read complete"},run_code:{running:"Running code in the AgentKit sandbox",done:"Code execution completed in the AgentKit sandbox"},list_envs:{running:"Checking available environments",done:"Available environments loaded"},get_env_manifest:{running:"Loading the environment manifest",done:"Environment manifest loaded"},execute_in_sandbox:{running:"Running a command in the environment",done:"Command completed in the environment"},delegate_to_codex_sandbox:{running:"Codex Sandbox is running",done:"Codex Sandbox completed",failed:"Codex Sandbox failed"},image_generate:{running:"Generating image",done:"Image generated"},video_generate:{running:"Generating video",done:"Video generated"},ppt_generate:{running:"Generating presentation",done:"Presentation generated"},load_memory:{running:"Searching long-term memory",done:"Memory search complete"},load_knowledgebase:{running:"Searching the knowledge base",done:"Knowledge base search complete"},load_skill:{running:"Loading skill",done:"Skill loaded"},collect_resources:{running:"Collecting available resources",done:"Resource collection complete",failed:"Resource collection failed"},create_agents:{running:"Creating and running agents",done:"Agent creation complete",failed:"Agent creation failed"}},createAgents:{categories:{skill_hub:"Skill Hub",skill_space:"AgentKit Skill Center",knowledge_base:"Knowledge base",tool:"Tools"},agentTypes:{llm:"LLM Agent",sequential:"Sequential Agent",parallel:"Parallel Agent",loop:"Loop Agent",workflow:"Workflow"},skill:"Skill",subAgents:"Sub-agents",builtinTool:"Built-in tool",skillCenter:"AgentKit Skill Center",selfAuthoredTools:"Custom tools",dependencies:"Dependencies: {{items}}",fullCode:"Complete code for {{name}}",itemCount:"{{label}}: {{count}} items",collectionAria:"Retrieved resource information",retrieving:"Retrieving resources",retrievalFailed:"Resource retrieval did not complete",checkConfig:"Check the resource service configuration and try again.",notSearched:"Not searched",notConfigured:"Not configured",resourceList:"{{label}} resource list",searchKeywords:"Search keywords",skillHubSkipped:"No search keywords were provided, so Skill Hub was not searched.",sourceSkipped:"{{label}} is not configured, so this source was not searched.",noResources:"No resources in this category were returned.",resultAria:"Agent creation results",creationFailed:"Agent creation did not complete",agentResources:"Resources available to {{name}}",knowledgeBase:"Knowledge base",toolsLabel:"Tools",creating:"Creating agents",noAgents:"No agents to display",noAgentResult:"The tool response did not include an agent configuration or execution result.",sourceLabels:{tool:"Tools",knowledge:"AgentKit Knowledge Base",skillCenter:"AgentKit Skill Center",unknown:"Unknown source"},unnamedResource:"Unnamed resource",unnamedAgent:"Unnamed agent"},branchCompare:{ariaLabel:"Compare branches",selectDirection:"Select a direction",continue:"Continue in this direction"},codexProgress:{planTitle:"Codex execution plan",fallback:{fileChange:"Modify files",approval:"Waiting for approval",status:"Codex status",command:"Run command"},planSummary:"{{completed}}/{{total}} completed",command:{running:"Running command",completed:"Command completed",failed:"Command failed"},projectFiles:"{{count}} project files",projectFile:"project files",fileChange:{running:"Updating {{subject}}",completed:"Updated {{subject}}",failed:"Failed to update {{subject}}"},externalTool:"external tool",mcp:{running:"Calling {{tool}}",completed:"Called {{tool}}",failed:"{{tool}} call did not complete"},collaboration:{spawn_agent:{running:"Starting subtask",completed:"Subtask started",failed:"Failed to start subtask"},send_input:{running:"Sending information to subtask",completed:"Information sent to subtask",failed:"Failed to send information to subtask"},wait:{running:"Waiting for subtask",completed:"Subtask wait complete",failed:"Subtask wait failed"},close_agent:{running:"Ending subtask",completed:"Subtask ended",failed:"Failed to end subtask"},default:{running:"Coordinating subtasks",completed:"Subtask collaboration complete",failed:"Subtask collaboration failed"}},webSearch:{running:"Searching the web",completed:"Web search complete",failed:"Web search did not complete"},errorDetail:"Codex execution did not complete.",errorTitle:"Codex encountered an error"},toolActivity:{status:{queued:"Queued",running:"Running",completed:"Completed",failed:"Failed"},goal:{queued:"Waiting to create goal",running:"Creating goal",completed:"Created goal",failed:"Failed to create goal"},command:{queued:"Waiting to run command",running:"Running command",completed:"Ran command",failed:"Command failed"},read:{queued:"Waiting to read",running:"Reading",completed:"Read content",failed:"Read failed"},search:{queued:"Waiting to search",running:"Searching",completed:"Search complete",failed:"Search failed"},"file-change":{queued:"Waiting to change files",running:"Changing files",completed:"Changed files",failed:"File change failed"},mcp:{queued:"Waiting to call external tool",running:"Calling external tool",completed:"Called external tool",failed:"External tool call failed"},authorization:{queued:"Waiting for authorization",running:"Waiting for authorization",completed:"Authorization complete",failed:"Authorization failed"},generic:{queued:"Waiting to call tool",running:"Calling tool",completed:"Called tool",failed:"Tool call failed",named:{queued:"Waiting to call {{tool}}",running:"Calling {{tool}}",completed:"Called {{tool}}",failed:"{{tool}} call failed"}},exitCode:"exit {{code}}",omittedLines:"… {{count}} lines omitted …",omittedCharacters:"… {{count}} characters omitted …",rawData:"View raw data",callId:"Call ID",copyCallId:"Copy call ID",copy:"Copy",copied:"Copied",copyFailed:"Copy failed. Try again.",explored_one:"Explored 1 item",explored_other:"Explored {{count}} items"}},Rfe={segments:{system:"System and tools",input:"Input and history",output:"Output and reasoning",remaining:"Remaining"},modelUnavailable:"Model information unavailable",promptWithSystem:"Prompt (including system)",systemUnknown:"System and tool usage unknown",systemApprox:"System and tools approximately {{count}} tokens",ariaKnown:"Context {{percentage}}% used, {{system}}, {{inputLabel}} {{input}} tokens, output and reasoning {{output}} tokens, remaining {{remaining}} tokens",ariaUnknown:"{{model}}, context window unknown, {{count}} cumulative session tokens used",composition:"Context composition",percentageUsed:"{{percentage}}% used",gridAria:"100-cell context composition chart. Each cell represents one percent of the context window.",estimated:"Estimated",unknown:"Unknown",summaryPercentage:"{{used}} used, {{remaining}} remaining",summaryTokens:"{{used}} used, {{remaining}} remaining, {{total}} total",overflow:"Context exceeded by {{count}} tokens",title:"Context usage",category:"Category",currentTurn:"Current Turn",sessionTotal:"Session total",details:{input:"Input",output:"Output",reasoning:"Reasoning",cache:"Cache hit",total:"Total"},unknownModel:"The context window for this model is not available",unknownRuntime:"The current runtime did not provide model information"},Ife={title:"Add AgentKit agent",noAgents:"Connected successfully, but no agents were found at this address (/list-apps was empty).",connectionFailed:"Connection failed: {{error}}. Check the URL, API key, and whether the gateway allows cross-origin requests.",description:"Enter the URL and API key of an AgentKit deployment to connect through the ADK protocol. Connected agents will appear in the selector in the upper-left corner.",url:"Endpoint URL",apiKeyHint:"Connect using Authorization: Bearer",displayName:"Display name (optional)",displayNameHint:"Uses the URL hostname by default",cancel:"Cancel",connecting:"Connecting…",connect:"Connect and add"},Pfe={placeholder:"Type a message…",inputAria:"Message",generating:"Generating",send:"Send",model:"Model"},Dfe={ariaLabel:"Invocation context for this turn",removeSkill:"Remove skill {{name}}",removeAgent:"Remove agent {{name}}"},Mfe={cardAria:"{{label}} chart",viewAria:"{{label}} display mode",preview:"Preview",code:"Code",invalidEcharts:"The ECharts configuration is not a valid, safe data object. Switch to Code to inspect it.",renderFailed:"The chart cannot be rendered right now. Switch to Code to inspect it.",echartsAria:"ECharts preview",rendering:"Rendering chart…",mermaidFailed:"The chart cannot be rendered right now. Switch to Code to inspect the Mermaid source.",mermaidAria:"Mermaid preview"},Lfe={downloadFile:"Download file",downloading:"Downloading…",downloadFailed:"Download failed. Check that the Sandbox and file are still available, then click to retry.",playVideo:"Play video: {{name}}",enlargeImage:"Enlarge image preview: {{name}}",image:"image",enlargeVideo:"Enlarge video",videoPreview:"Video preview",downloadVideo:"Download video",close:"Close"},$fe={annotation:Cfe,media:Afe,runtimeLogs:Tfe,trace:_fe,share:jfe,blocks:Nfe,tokenUsage:Rfe,addAgentKit:Ife,composer:Pfe,invocation:Dfe,visualization:Mfe,markdown:Lfe},Zze=Object.freeze(Object.defineProperty({__proto__:null,addAgentKit:Ife,annotation:Cfe,blocks:Nfe,composer:Pfe,default:$fe,invocation:Dfe,markdown:Lfe,media:Afe,runtimeLogs:Tfe,share:jfe,tokenUsage:Rfe,trace:_fe,visualization:Mfe},Symbol.toStringTag,{value:"Module"})),Ffe={back:"Back",cancel:"Cancel",deploy:"Deploy",delete:"Delete",loading:"Loading…",next:"Next",notSupported:"Not supported",previous:"Previous",required:"Required",retry:"Retry",actions:"Actions",value:"Value",disabled:"Off",enabled:"Enabled",none:"None",close:"Close",name:"Name",description:"Description",send:"Send"},Bfe={heading:"VeADK agent structure configuration",importHint:"Reload this file from Import YAML on the Create Agent page."},Ufe={agentName:{required:"Name is required",reserved:"user is reserved by Google ADK. Choose another name.",characters:"Start with a letter or underscore and use only letters, numbers, and underscores"},runtimeName:{required:"Runtime name is required",characters:"Runtime name can contain only letters, numbers, underscores, and hyphens",length:"Runtime name must be 4–64 characters"}},Qfe={description:"A VeADK-powered assistant that understands user intent and uses the right tools to complete tasks.",instruction:`You are a professional and reliable assistant. +{{response}}`,emptyCloudResponse:"(empty response body)"},tde={loadFailed:"Failed to load conversation mode capabilities (HTTP {{status}})",invalidResponse:"The conversation mode capabilities response has an invalid format"},nde={nonJson:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}, {{contentType}}){{detail}}"},ide={busy:"The workspace is busy. Try again shortly",notFound:"Workspace not found",duplicates:"Multiple personal workspace sessions were found. Contact your administrator",timeout:"Workspace recovery timed out. Your projects are retained. Try again",unavailable:"The workspace cannot be restored right now. Your projects are retained. Try again",persistence:"Persistence is not enabled for this Sandbox. Check the workspace configuration",startup:"Workspace startup failed. Check the Sandbox status",exists:"This project already exists. Open it from the project list",directory:"Project directory not found",configuration:"Configure the workspace Sandbox image first",state:"Could not check workspace status. Try again",list:"Could not restore the workspace or load projects. Try again",create:"Project initialization failed. Check that the image is available and try again",open:"Could not restore the workspace or open the project. Try again",connection:"Could not connect to the workspace. Try again",invalidWorkspaceUrl:"The workspace returned an invalid URL",operation:"Project operation failed. Try again",invalidProjectUrl:"The project URL is invalid",listFallback:"Could not load projects",connectionState:"Could not connect to the workspace. Try again"},rde={reporting:"Completing delivery details",packaging:"Preparing artifacts",savingVersion:"Saving version",finishing:"Finishing request",submitResult:"Submit build result",requestFailed:"Task request failed. Please retry.",invalidResponse:"Invalid task state response.",eventGap:"Restoring missing task output.",reconnecting:"Reconnecting. Existing output is preserved.",input:{pending:"Queued",sending:"Confirming delivery",delivered:"Delivered",withdrawn:"Not sent"},plan:"Execution plan",diff:"File changes",preparing:"Preparing task",preparingEnvironment:"Preparing development environment…",connectingEnvironment:"Connecting to development environment…",processing:"Processing request",thinking:"Thinking",read:"Read file · {{target}}",listFiles:"List directory · {{target}}",search:"Search · {{target}}",command:"Run command · {{target}}",editFiles:"Edit files · {{target}}",webSearch:"Search web · {{target}}",processSummary:"Processed {{count}} items",duration:"{{seconds}}s",durationUnits:{milliseconds:"{{value}} ms",hours:"{{value}} h",minutes:"{{value}} min",seconds:"{{value}} s"},failedTools:"{{count}} tools failed",toolFailed:"Failed",toolCalls:"{{count}} tool calls",turnDuration:"Turn elapsed {{duration}}",toolDuration:"Tool time {{duration}}",toolDurationPartial:"Recorded tool time {{duration}}",toolDurationHelp:"Sum of tool durations. Parallel calls can exceed turn elapsed time.",turnStatus:{completed:"Completed",failed:"Failed",interrupted:"Interrupted",cancelled:"Interrupted",unavailable:"Task ended"},notReported:"Not reported",partial:"Recorded",partialHelp:"Usage for this turn may be incomplete.",tokenDetails:"Turn token usage",model:"Turn model",totalTokens:"Total",inputTokens:"Input",cachedInputTokens:"Cached input",uncachedInputTokens:"Uncached input",cacheWriteInputTokens:"Cache write",outputTokens:"Output",reasoningOutputTokens:"Reasoning output",cacheHitRate:"Input cache hit rate",tokenHelp:"Cached input and reasoning output are subsets of input and output. Uncached input = input − cached input."},sde={common:Due,agentkitCli:Mue,cloudRegion:Lue,connections:$ue,feishuBot:Fue,requestError:Bue,runSse:Uue,runtimeLogs:Que,search:zue,skills:Vue,sse:Hue,identity:que,github:Wue,video:Kue,websiteIntegration:Gue,knowledge:Xue,intelligentDevelopment:Yue,migrations:Zue,sandbox:Jue,client:ede,newChatCapabilities:tde,jsonResponse:nde,workspaceProjects:ide,developmentRuns:rde},qze=Object.freeze(Object.defineProperty({__proto__:null,agentkitCli:Mue,client:ede,cloudRegion:Lue,common:Due,connections:$ue,default:sde,developmentRuns:rde,feishuBot:Fue,github:Wue,identity:que,intelligentDevelopment:Yue,jsonResponse:nde,knowledge:Xue,migrations:Zue,newChatCapabilities:tde,requestError:Bue,runSse:Uue,runtimeLogs:Que,sandbox:Jue,search:zue,skills:Vue,sse:Hue,video:Kue,websiteIntegration:Gue,workspaceProjects:ide},Symbol.toStringTag,{value:"Module"})),ade="Agent reviews",ode="Request access for everyone in your organization",lde="Close",cde="Refresh",ude="Status",dde="Applicant",fde="Submitted",hde="Current version",pde="Model",mde="Returned by",gde="Approved by",bde="Reviewed",yde="Agent description",vde="Application notes",xde="Return reason",wde="Review comment",kde="Return reason (required)",Ode="Content changed after submission; return and submit again",Sde="Withdraw to edit this Agent, then submit a new request to publish it",Ede="Other users will lose access to this Agent. Unpublish it?",Cde="Cancel",Ade="Confirm",Tde="Saving",_de="Unpublish",jde="Withdraw request",Nde="Approve",Rde="Publish for everyone",Ide="Request publication",Pde="Everyone",Dde={pending:"Pending",approved:"Approved",returned:"Returned",withdrawn:"Withdrawn"},Mde="Search agents or applicants",Lde="Region",$de="All statuses",Fde="Agent",Bde="Actions",Ude="Review application",Qde="Application details",zde="No matching applications",Vde="No Agent review requests",Hde="{{count}} / {{limit}} characters",Wze={title:ade,dialogDescription:ode,close:lde,refresh:cde,statusTitle:ude,submitter:dde,submittedAt:fde,version:hde,model:pde,returnedBy:mde,approvedBy:gde,reviewedAt:bde,description:yde,message:vde,reason:xde,comment:wde,reasonRequired:kde,contentChanged:Ode,withdrawConfirm:Sde,unpublishConfirm:Ede,cancel:Cde,confirm:Ade,saving:Tde,unpublish:_de,withdraw:jde,return:"Return",approve:Nde,publish:Rde,submit:Ide,private:"Private",enterprise:Pde,status:Dde,search:Mde,region:Lde,all:$de,agent:Fde,actions:Bde,review:Ude,details:Qde,noMatches:zde,empty:Vde,textCount:Hde},Kze=Object.freeze(Object.defineProperty({__proto__:null,actions:Bde,agent:Fde,all:$de,approve:Nde,approvedBy:gde,cancel:Cde,close:lde,comment:wde,confirm:Ade,contentChanged:Ode,default:Wze,description:yde,details:Qde,dialogDescription:ode,empty:Vde,enterprise:Pde,message:vde,model:pde,noMatches:zde,publish:Rde,reason:xde,reasonRequired:kde,refresh:cde,region:Lde,returnedBy:mde,review:Ude,reviewedAt:bde,saving:Tde,search:Mde,status:Dde,statusTitle:ude,submit:Ide,submittedAt:fde,submitter:dde,textCount:Hde,title:ade,unpublish:_de,unpublishConfirm:Ede,version:hde,withdraw:jde,withdrawConfirm:Sde},Symbol.toStringTag,{value:"Module"})),qde={backToEvaluationCase:"Back to evaluation case",cancel:"Cancel",copied:"Copied",copy:"Copy",exportConversation:"Export conversation",retry:"Retry"},Wde={title:"How would you like to add an Agent?",subtitle:"Choose the approach that best fits your project.",quickCreate:{title:"Create from scratch",description:"Build an Agent with intelligent, custom, template, or workflow modes."},intelligent:{title:"Intelligent mode",description:"Describe your goal, then build, debug, and validate the Agent interactively."},package:{title:"Add and deploy a code package",description:"Upload an Agent project archive, review the code, and deploy it to AgentKit Runtime."},migrate:{title:"Migrate an existing project",description:"Migrate an existing LangChain, Dify, or similar project to AgentKit Runtime."}},Kde={subject:{file:"file changes",command:"command execution"},decision:{accept:"Allowed {{subject}} once",acceptForSession:"Allowed {{subject}} for this session",decline:"Declined {{subject}}",cancel:"Cancelled approval for {{subject}}"},details:{command:"Command",grantRoot:"Authorized path",cwd:"Working directory"}},Gde={noDescription:"No description",region:"Region",unknownAgent:"Unknown Agent"},Xde={agentTransfer:"Agent handoff",annotationHint:"Model response; select text to add an annotation",continueBranch:"Continue with “{{branch}}”",emptyResponse:"This response has no displayable content.",subagentDescription:"Working on a task handed off by the primary Agent."},Yde={title:"Configure {{provider}} credentials",prefix:"Agent Workspace requires {{provider}} credentials. Set",and:"and",suffix:"in the runtime environment, then retry."},Zde={buildRunning:{title:"A build is still running",description:"Leaving will stop this build. The session will remain available in your history.",confirm:"Stop and leave"},deleteThread:{title:"Delete Codex session",description:"Delete “{{name}}” and remove it from your session history?",confirm:"Delete"},returnToCreate:{title:"Return to the create page?",description:"Your current entries will be lost.",confirm:"Return"}},Jde={additionalAgentDeleteFailures:"; {{count}} more failed",agentDeleteFailures:"Failed to delete {{count}} Agents: {{failures}}{{suffix}}",agentToolsMissing:"This Agent is missing required tools: {{tools}}",buildStopUnconfirmed:"You left the development environment, but Studio could not confirm that the build stopped. It may still be running; check its status in session history later.",builtinAgentSendFailed:"Failed to send to the built-in Agent: {{message}}",bytePlusEvaluationUnsupported:"AgentKit evaluation sets are not currently supported on BytePlus",clipboardUnsupported:"This browser does not support writing to the clipboard.",cloudCodexEmptyReply:"The cloud Codex task ended without a response. Send the task again.",cloudCodexSessionMissing:"The cloud Codex session has not appeared in the list yet. Try again shortly.",deploymentRuntimeIdMissing:"Deployment completed without returning a Runtime ID.",environmentExpired:"The selected environment is no longer available. Refresh and select it again.",environmentsLoadFailed:"Failed to load environments",evaluationCaseSessionMissing:"This evaluation case has no session reference and cannot be opened.",evaluationUnsupportedForReply:"This response cannot be added to an evaluation set",firstFrameRequired:"Add a first-frame image before generating from first and last frames.",incompletePromptOptimization:"The prompt optimization result is incomplete. Run the optimization again.",intelligentCapabilityCheckFailed:"Failed to check intelligent development capabilities (HTTP {{status}})",intelligentSessionCreateFailed:"Failed to create the intelligent development session",invalidIntelligentCapability:"The intelligent development capability response is invalid.",localBffToolsNotConfigured:"No tools are configured for the local Studio BFF.",localToolsLoadFailed:"Failed to load local tools",loginPopupBlocked:"The browser blocked the sign-in window. Allow pop-ups and try again.",loginPopupClosed:"The sign-in window was closed. Sign in again to continue.",mediaTooLarge:"{{fileName}} exceeds this platform's media size limit.",mountEnvironmentFailed:"Failed to mount the environment",noConnectedSandbox:"No Sandbox is currently connected.",noCreateAgentPermission:"Your account does not have permission to add Agents.",noManageAgentPermission:"Your account does not have permission to manage Agents.",noOptimizationBaseline:"There is no pre-optimization version available for comparison.",oauthUrlMissing:"The event does not include an authorization URL.",onlyCloudAgentUpdatable:"Only deployed cloud Agents can be updated.",optimizationVersionMissing:"The project version for this optimization could not be found. It may have been deleted.",persistentStorageNotConfigured:"Persistent storage has not been configured by an administrator",readDraftFailed:"Unable to read local drafts. Try again.",runtimeAgentNameMissing:"The Runtime is missing an Agent name and cannot be updated.",runtimeBffToolsDisabled:"BFF tool capabilities are not enabled for this Runtime Agent.",runtimeDeploymentConfigUnavailable:"The Runtime's original deployment configuration cannot be restored, so it cannot be updated safely.",runtimeMissingForConnection:"Runtime information is missing, so the Agent cannot be connected.",runtimeRegionMissingForDelete:"The Runtime is missing region information and cannot be deleted.",runtimeRegionMissingForUpdate:"The Runtime is missing region information and cannot be updated.",runtimeUpdateUnsupported:"This Runtime does not support in-place updates.",sandboxRuntimeUnavailable:"This Agent does not have an available Sandbox Runtime.",sandboxToolsUnavailable:"The current Studio BFF does not provide Sandbox execution tools.",saveDraftLocationRejected:"The browser could not save the current draft location. Check site storage permissions and try again.",saveDraftRejected:"The browser could not save the draft. Try again.",selectSkillToOptimize:"Select a Skill to optimize first.",sessionMissingForMount:"The current session does not exist, so an environment cannot be mounted.",sessionNotReady:"The session is not ready yet.",sessionUnavailable:"The current session is unavailable. Close it and try again.",sourceNotReady:"The source is not ready yet. Return to the conversation to continue.",textVideoRejectsReferences:"Text-to-video does not use reference media. Remove the images or videos first.",videoEditRequiresVideo:"Add the video you want to edit first.",videoExtendRequiresVideo:"Add a source video before extending it.",videoGenerationFailed:"Video generation failed. Try again later.",videoModeUnsupported:"The selected video mode is not supported on this platform.",videoPreviewMissing:"The video task completed, but the server did not return a preview URL.",videoReferenceRequired:"Add at least one reference image or video."},efe={like:"Like",removeLike:"Remove like",dislike:"Dislike",removeDislike:"Remove dislike",reportIssue:"Report an issue",traceFlameGraph:"Tracing flame graph"},tfe={0:"What would you like to work on today?",1:"How can I help?",2:"What would you like me to look into?",3:"Ask me anything",4:"Hi, let's get started",5:"Start a new conversation",6:"What should we tackle first?",7:"Tell me what you have in mind",8:"Where should we begin?",9:"What can I help you with?",10:"Ready to move this forward?",11:"What's most important right now?",12:"Let's get something done today",13:"I'm ready when you are",intelligentDevelopment:"Give your ideas room to grow"},nfe={agentCapabilities:"Checking Agent capabilities…",session:"Loading session…"},ife={cancelled:"Authorization was cancelled.",pasteCallbackUrl:"After authorization, paste the full callback URL from your browser's address bar:",popupBlocked:"The browser blocked the authorization window. Allow pop-ups and try again.",unsupportedUrl:"The authorization URL is not HTTP or HTTPS and was blocked."},rfe={volcengine:"Volcengine"},sfe={checkingPersistence:"Checking persistent storage…",exitDevelopment:"Exit development",fileUploaded:"Uploaded a file to the Sandbox",filesUploaded:"Uploaded {{count}} files to the Sandbox",intelligentDevelopment:"Intelligent development",mode:{readOnly:"Read only",workspaceWrite:"Workspace write",fullAccess:"Full access"},approvalPolicy:{untrusted:"Untrusted commands only",onRequest:"Ask when needed",never:"Never ask"},reviewer:{user:"Ask me",autoReview:"Automatic review"},labels:{approvalPolicy:"Approval policy",file:"File",fileNumber:"File {{number}}",mode:"Sandbox mode",networkAccess:"Network access",reviewer:"Approval method",workingDirectory:"Working directory"},network:{allowed:"Allowed",disabled:"Off"},permissionsUpdated:"Updated Codex permissions for this Sandbox session",persistenceUnknown:"Unable to verify persistent storage",stoppedReady:"Stopped. You can continue typing.",uploadedFilesPrompt:"The following files were uploaded to the current Sandbox workspace. Use them in this task:",workspaceUpdated:"Workspace updated"},afe={addAgent:"Add Agent",addFromPackage:"Add from code package",agent:"Agent",automations:"Automations",createAgent:"Create Agent",createSkill:"Create Skill",cronJobs:"Cronjob",issueFeedback:"Issue feedback",library:"Library",migrateAgent:"Migrate Agent",newConversation:"New conversation",optimizeSkill:"Optimize {{name}}",search:"Search",skill:"Skill",skillLibrary:"Skill library",systemInfo:"System information",updateAgent:"Update {{name}}",codeProjects:"Code projects",reviewCenter:"Review center"},ofe={title:"Create from workspace",description:"Create and manage code projects, then develop and debug in VS Code"},lfe={actions:qde,addAgent:Wde,approval:Kde,common:Gde,conversation:Xde,credentials:Yde,dialogs:Zde,errors:Jde,feedback:efe,greetings:tfe,loading:nfe,oauth:ife,providers:rfe,sandbox:sfe,titles:afe,workspaceProjectEntry:ofe},Gze=Object.freeze(Object.defineProperty({__proto__:null,actions:qde,addAgent:Wde,approval:Kde,common:Gde,conversation:Xde,credentials:Yde,default:lfe,dialogs:Zde,errors:Jde,feedback:efe,greetings:tfe,loading:nfe,oauth:ife,providers:rfe,sandbox:sfe,titles:afe,workspaceProjectEntry:ofe},Symbol.toStringTag,{value:"Module"})),cfe="Automations",ufe="Connect development tools and extend your Agents with automated workflows",dfe="Search automations",ffe="Automation categories",hfe={development:"Development",channels:"Messaging channels"},pfe="{{category}} automations",mfe="Open {{name}}",gfe="Available only in local deployments",bfe="No matching automations",yfe="Try searching for another name",vfe="Back to automations",xfe={"coding-agents":{name:"Configure coding agents",badge:"Local",description:"Install built-in VeADK and AgentKit skills globally for Trae, Claude Code, or Codex."},template:{name:"Import starter project",description:"Create a minimal Agent project in your repository with continuous delivery to AgentKit Runtime.",title:"Import starter project",subtitle:"Add a ready-to-run basic Agent and continuous delivery configuration to your repository",panel:"This creates a pull request containing the basic project and AgentKit Runtime delivery workflow.",submitLabel:"Import template and create PR",regionHelp:"Must match the target Runtime region",pullRequest:{title:"feat: import AgentKit basic template",description:"Import a basic Agent project with the AgentKit Studio App Server and add continuous delivery to AgentKit Runtime. Configure the required {{provider}} secrets before merging."},fields:{repository:{label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL"},baseBranch:{label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base"},projectPath:{label:"Agent project directory",placeholder:"agentkit-basic-agent",help:"The basic project will be added here; app.py mounts the complete Studio App Server and serves as the entry point"},runtimeName:{label:"Runtime name",placeholder:"support-agent",help:"Used by the AgentKit delivery configuration"},runtimeId:{label:"Runtime ID",placeholder:"rt-xxxxxxxx",help:"The AgentKit Runtime that will receive continuous updates"}}},delivery:{name:"AgentKit Runtime delivery",description:"Add a workflow that continuously delivers your repository to AgentKit Runtime.",title:"AgentKit Runtime delivery",subtitle:"Add continuous delivery to the repository through a pull request",panel:"This creates a release branch and opens a pull request containing the GitHub Actions workflow.",submitLabel:"Confirm and create PR",regionHelp:"Must match the target Runtime region",pullRequest:{title:"feat: continuously publish to AgentKit Runtime",description:"Add a GitHub Actions workflow that continuously publishes updates from the target branch to AgentKit Runtime. Configure the required {{provider}} secrets before merging."},fields:{repository:{label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL"},baseBranch:{label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base"},projectPath:{label:"Agent project directory",placeholder:".",help:"Defaults to the repository root; the directory must contain an app.py that mounts the complete Studio App Server"},runtimeName:{label:"Runtime name",placeholder:"support-agent",help:"Used by the AgentKit delivery configuration"},runtimeId:{label:"Runtime ID",placeholder:"rt-xxxxxxxx",help:"The AgentKit Runtime that will receive continuous updates"}}},review:{name:"Automated PR review",description:"Use a GitHub App to review pull requests in an isolated Sandbox.",title:"Automated PR review",subtitle:"Trigger Sandbox reviews through the GitHub App and publish results to pull requests",panel:"Install the GitHub App to target repositories, then enable automated review for each repository.",submitLabel:"Install GitHub App",regionHelp:"",pullRequest:{title:"chore: configure automated PR review",description:"Add a GitHub Actions workflow that reviews same-repository pull requests in an isolated Sandbox and publishes the result as a GitHub review. Configure the required workflow secrets before merging."},fields:{repository:{label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL"},baseBranch:{label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base"},sandboxToolId:{label:"Sandbox Tool ID",placeholder:"tool-xxxxxxxx",help:"The AgentKit CodeEnv used for each review"},modelName:{label:"Review model",placeholder:"review-model",help:"The code review model name injected into the Sandbox"},modelBaseUrl:{label:"Model API URL",placeholder:"https://ark.example.com/api/v3",help:"Must be an OpenAI-compatible HTTPS endpoint"}}},"gitlab-review":{name:"GitLab MR review",description:"Use a GitLab integration to review merge requests in an isolated Sandbox."},feishu:{name:"Feishu bot",badge:"Beta",description:"Create a Feishu bot and connect its messages directly to AgentKit Runtime."},"mpa-channels":{name:"MPA agent messaging channels",description:"Connect an existing MPA agent to Feishu, WeCom and DingTalk."},"website-integration":{name:"Website integration",description:"Embed an AgentKit Runtime on your website as a floating chat window."}},wfe={required:"Required",optional:"Optional",region:"Region",tokenLabel:"GitHub Token",getToken:"Get token",createToken:"Create GitHub token",tokenPlaceholder:"Requires write access to repository contents and pull requests",tokenWorkflowPlaceholder:"Requires write access to contents, pull requests, and workflows",hideToken:"Hide token",showToken:"Show token",tokenHelp:"The token is used only for this submission. It is not stored in the browser or written to the pull request.",tokenWorkflowHelp:"This token is used only to create the configuration PR. It is not a general Sandbox requirement and is not stored in the browser or written to the PR.",prCreated:"PR #{{number}} created",configPrCreated:"Configuration PR #{{number}} created",configPrNextStep:"After it is merged, later pull requests in the same repository will trigger reviews automatically.",viewOnGitHub:"View on GitHub",viewConfigPr:"View configuration PR",secretsHeading:"Before merging the pull request, configure these GitHub Actions secrets in the repository:",secretsConfigHeading:"Before merging the configuration PR, add runtime secrets to the target repository",openSecrets:"Open Secrets settings",secretsPath:"Path: Settings → Secrets and variables → Actions → Repository secrets",repositoryConfigHelp:"A PR review configuration will be added for {{repository}}",repositoryReviewHelp:"GitHub App will validate pull requests for {{repository}}",secretPair:"{{accessKey}}, {{secretKey}} (required)",sessionToken:"{{sessionToken}} (required when using temporary credentials)",requiredSecret:"{{name}} (required)",temporaryCredentialRequired:" (required when using temporary credentials)",requiredSuffix:" (required)",submitting:"Creating PR…",validation:{required:"This field is required",repository:"Enter owner/repository or a full GitHub repository URL",baseBranch:"The target branch format is invalid",projectPath:"Enter a relative path within the repository",runtimeId:"The Runtime ID format is invalid",sandboxToolId:"The Sandbox Tool ID format is invalid",modelName:"The model name format is invalid",modelBaseUrlSafe:"Enter an HTTPS URL without credentials, query parameters, or fragments",modelBaseUrl:"Enter a valid HTTPS URL",runtimeName:{required:"Runtime name is required",characters:"Runtime name can contain only letters, numbers, underscores, and hyphens",length:"Runtime name must be 4–64 characters"}}},kfe={title:"Configure coding agents",description:"Install the AgentKit skills bundled with Studio globally for local coding clients.",retry:"Retry",clients:{ariaLabel:"Select coding agents",title:"Local clients",detectAgain:"Detect again",detecting:"Detecting local clients…",detected:"Client detected",available:"Available",unavailable:"Not detected"},skills:{ariaLabel:"Select bundled skills",title:"Bundled skills",viewFiles:"View files",items:{"veadk-agent-development":{name:"VeADK Agent development",description:"Build and refine Agents with VeADK."},"agentkit-cli":{name:"AgentKit CLI",description:"Manage and deploy AgentKit resources with AgentKit CLI."}}},global:{ariaLabel:"Global installation directories",title:"Global installation",description:"Available to other local projects after configuration",empty:"Select a client to see its installation directory."},success:"Configured {{skillCount}} skill(s) for {{agentCount}} client(s)",selection:"{{agentCount}} client(s) and {{skillCount}} skill(s) selected",selectClient:"Select a client first",configuring:"Configuring…",configure:"Configure",errors:{detect:"Failed to detect local clients",configure:"Configuration failed. Check permissions for your user directory and try again."},preview:{description:"Browse the skill files bundled with Studio in read-only mode",close:"Close file preview",loading:"Loading files…",error:"Failed to load skill files",skillFiles:"{{name}} files",files:"Files",fileContent:"File contents",notPreviewable:"This file is not previewable UTF-8 text.",noFiles:"No previewable files."}},Ofe={noDescription:"No description",unknownCreator:"Unknown creator",optionMetadata:"{{creator}} | {{createdAt}}",selectAgent:"Select an MPA agent",chooseAgent:"Choose an MPA agent",search:"Search by name, Runtime ID or region",noMatches:"No matching MPA agents",loading:"Loading MPA agents…",empty:"No manageable MPA agents. Create or deploy an MPA agent first.",unauthorized:"Studio administrator access is required to manage MPA messaging channels. Contact an administrator.",loadFailed:"Could not load MPA agents. Please retry.",retry:"Retry",refresh:"Refresh list",loadMore:"Load more",moreAvailable:"More agents are available. Search matches loaded results; load more to continue.",chooseHint:"Select an MPA agent to configure Feishu, WeCom and DingTalk."},Sfe={title:"Feishu bot",description:"Create a Feishu Agent powered by AgentKit Runtime",panel:"Enter the credentials for a published Feishu app. Studio will generate a basic Agent, create a dedicated Runtime, and enable the persistent Feishu messaging connection.",agentName:"Agent name",agentNameHelp:"Used as the root Agent name in the new Runtime",region:"Deployment region",regionHelp:"The Runtime and build artifacts will be created in this region",regions:{"cn-beijing":"Beijing","cn-shanghai":"Shanghai"},appId:"Feishu App ID",appIdHelp:"Application credential from the Feishu Open Platform",appSecret:"Feishu App Secret",appSecretPlaceholder:"Enter the App Secret",appSecretHelp:"Written only to the environment variables of the new Runtime",hideSecret:"Hide App Secret",showSecret:"Show App Secret",hide:"Hide",show:"Show",confirmCancel:"Cancelling will stop the task and clean up any Runtime already created. Continue?",status:{preparing:"Generating the basic Agent",running:"Creating Runtime",cancelling:"Cancelling deployment",succeeded:"Feishu bot Runtime created",cancelled:"Deployment cancelled",failed:"Creation failed"},steps:{prepare:"Generate Agent",build:"Build image",deploy:"Create Runtime",publish:"Publish service"},openConsole:"Open Runtime console",credentials:{title:"Credential handling",description:"The App Secret is used only for this deployment. It is never written to generated source code or browser storage."},cancelDeployment:"Cancel deployment",creating:"Creating…",create:"Create Feishu bot Runtime",validation:{appId:"Enter the Feishu App ID",appSecret:"Enter the Feishu App Secret",agentName:{required:"Name is required",reserved:"user is reserved by Google ADK. Choose another name",characters:"Name must start with a letter or underscore and contain only letters, numbers, and underscores"}},generatedAgent:{description:"A helpful assistant that receives messages through Feishu.",instruction:"You are a helpful assistant serving users through Feishu. Understand each request accurately and provide concise, reliable answers. Ask clarifying questions when information is missing, and never invent facts."}},Efe={title:cfe,description:ufe,search:dfe,categoriesLabel:ffe,categories:hfe,resultsLabel:pfe,open:mfe,localOnly:gfe,emptyTitle:bfe,emptyDescription:yfe,backToAutomations:vfe,cards:xfe,github:wfe,codingAgents:kfe,mpaChannels:Ofe,feishu:Sfe},Xze=Object.freeze(Object.defineProperty({__proto__:null,backToAutomations:vfe,cards:xfe,categories:hfe,categoriesLabel:ffe,codingAgents:kfe,default:Efe,description:ufe,emptyDescription:yfe,emptyTitle:bfe,feishu:Sfe,github:wfe,localOnly:gfe,mpaChannels:Ofe,open:mfe,resultsLabel:pfe,search:dfe,title:cfe},Symbol.toStringTag,{value:"Module"})),Cfe={"zh-CN":"简体中文","en-US":"English"},Yze={languageNames:Cfe},Zze=Object.freeze(Object.defineProperty({__proto__:null,default:Yze,languageNames:Cfe},Symbol.toStringTag,{value:"Module"})),Afe={selectedExcerptLabel:"Selected excerpt",commentLabel:"Annotation",commentSeparator:": ",successTitle:"Added to the Bad Case evaluation set",successDescription:"This annotation is linked to the current question and the complete model response.",done:"Done",ariaLabel:"Annotate the selected model response",title:"Add annotation",content:"Annotation",placeholder:"Describe the issue or the expected change",retryError:"{{error}}. Please try again.",cancel:"Cancel",submit:"Add to Bad Case"},Tfe={attachment:"attachment",image:"image",preview:"Preview {{name}}",uploading:"Uploading",uploadFailed:"Upload failed",remove:"Remove {{name}}",previewDialog:"{{name}} preview",download:"Download",close:"Close",reading:"Loading document…",loadFailed:"Failed to load document: {{error}}"},_fe={errorTitle:"Cloud log error",copyError:"Copy complete error details",retry:"Retry",statuses:{live:"Live",connecting:"Connecting",retrying:"Reconnecting",idle:"Disconnected"},title:"Instance logs",description:"The VeFaaS instance handling the current conversation request",close:"Close instance logs",instanceId:"Instance ID",waitingInstance:"Waiting for instance",request:"Request {{id}}",ariaLabel:"Live VeFaaS instance logs",notCapturedTitle:"No instance captured yet",notCapturedDescription:"Send a message to see the instance that handles it and its live logs.",connectingTitle:"Connecting to instance logs",connectingDescription:"Establishing a secure log stream through the Studio BFF.",emptyTitle:"No logs yet",emptyDescription:"Connected to the instance and waiting for new log output.",download:"Download logs",retention:"Logs refresh automatically. Only the latest {{count}} lines are kept."},jfe={title:"Trace",statuses:{loading:"Loading",ready:"",collecting:"Collecting",disabled:"Disabled",forbidden:"Permission required",error:"Failed to load"},errors:{collecting:"The trace is still being collected. Please wait.",disabled:"Tracing is not enabled for this agent. Enable it in the console and try again.",forbidden:"Your account cannot read APMPlus traces. Ask an administrator for read access.",error:"Failed to load the trace. Please try again later."},callCount:"{{count}} calls · {{duration}} ms",close:"Close",loading:"Loading trace…",retryNow:"Retry now",reload:"Reload",empty:"No trace is available for this session yet.",attributes:"Attributes",selectCall:"Select a call on the left to view its details"},Nfe={exportNote:"This conversation was exported from AgentKit Studio for reference only.",imageFailed:"Failed to generate the image. Please try again.",browserUnsupported:"This browser cannot generate a conversation image. Please try again.",copyUnsupported:"This browser cannot copy images. Download the image instead.",exportFailed:"Export failed. Please try again.",title:"Export conversation",description:"Choose a format and download all inputs and outputs through the current response.",close:"Close",generatingContent:"Preparing export…",retry:"Try again",previewPage:"Previewing page 1 of {{count}}",previewAlt:"Conversation export page 1 of {{count}}",format:"Export format",generatingFormat:"Generating {{format}}…",copying:"Copying…",copiedFirst:"First page copied",copied:"Copied",copyFirst:"Copy first page",copyImage:"Copy image",generating:"Generating…",downloadArchive:"Download PNG archive ({{count}} pages)",downloadFormat:"Download {{format}}"},Rfe={a2a:{connecting:"Waiting for Runtime response…",submitted:"Task queued…",working:"Task running…"},unsupportedComponent:"Unsupported component: {{component}}",sandboxIdentity:"Codex Sandbox execution identifiers",useSkill:"Use the {{name}} skill",thinkingDone:"Finished working thought",thinking:"Working thought",reasoningDone:"Finished model reasoning",reasoning:"Model reasoning",justNow:"Just now",sourceUnavailable:"The generated source is temporarily unavailable. Please try again later.",downloadStarted:"Download started",verifiedDelivery:"Verified deliverable",generatedSource:"Generated agent source",entryPoint:"Entry point",fileCount:"Files",size:"Size",validationTime:"Validated",generationTime:"Generated",checksPassed:"{{count}} checks passed",sourceReady:"Source is ready to deploy",sourceGuidance:"The source is ready to view, download, or deploy. Confirm the runtime configuration before deployment.",viewSource:"View source",preparing:"Preparing…",viewChanges:"View changes",downloadSource:"Download source",sourceNotReady:"The source is not ready yet",manualDeploy:"Deploy manually to Runtime",deployAgent:"Deploy Agent",beforeOptimization:"Before optimization",afterOptimization:"After optimization",planStatuses:{pending:"Pending",in_progress:"In progress",completed:"Completed",failed:"Incomplete"},renderUi:"Render UI",truncated:"… (truncated)",agentAdjusting:"Agent is adjusting",sandboxDetails:"Detailed Codex Sandbox output",waitingCodex:"Waiting for Codex output",arguments:"Arguments",result:"Result",artifacts:"Artifacts",downloadNamed:"Download {{name}}",powerpoint:"PowerPoint presentation",preview:"Preview",download:"Download",previewDialog:"{{name}} preview",closePreview:"Close preview",slidePreview:"{{name}} slide preview",mcpToolset:"MCP toolset",authorized:"Authorized · {{tool}}",authorizationRequired:"{{tool}} requires authorization",oauthDescription:"The {{tool}} toolset is protected by OAuth and requires sign-in before use.",oauthProvider:"You will be redirected to {{provider}} to sign in.",oauthContinue:"The conversation will continue automatically after authorization.",waitingAuthorization:"Waiting for authorization…",authorize:"Authorize",missingAuthorizationUrl:"No authorization URL was found in the event.",tools:{web_search:{running:"Searching the web",done:"Web search complete"},link_reader:{running:"Reading webpage",done:"Webpage read complete"},run_code:{running:"Running code in the AgentKit sandbox",done:"Code execution completed in the AgentKit sandbox"},list_envs:{running:"Checking available environments",done:"Available environments loaded"},get_env_manifest:{running:"Loading the environment manifest",done:"Environment manifest loaded"},execute_in_sandbox:{running:"Running a command in the environment",done:"Command completed in the environment"},delegate_to_codex_sandbox:{running:"Codex Sandbox is running",done:"Codex Sandbox completed",failed:"Codex Sandbox failed"},image_generate:{running:"Generating image",done:"Image generated"},video_generate:{running:"Generating video",done:"Video generated"},ppt_generate:{running:"Generating presentation",done:"Presentation generated"},load_memory:{running:"Searching long-term memory",done:"Memory search complete"},load_knowledgebase:{running:"Searching the knowledge base",done:"Knowledge base search complete"},load_skill:{running:"Loading skill",done:"Skill loaded"},collect_resources:{running:"Collecting available resources",done:"Resource collection complete",failed:"Resource collection failed"},create_agents:{running:"Creating and running agents",done:"Agent creation complete",failed:"Agent creation failed"}},createAgents:{categories:{skill_hub:"Skill Hub",skill_space:"AgentKit Skill Center",knowledge_base:"Knowledge base",tool:"Tools"},agentTypes:{llm:"LLM Agent",sequential:"Sequential Agent",parallel:"Parallel Agent",loop:"Loop Agent",workflow:"Workflow"},skill:"Skill",subAgents:"Sub-agents",builtinTool:"Built-in tool",skillCenter:"AgentKit Skill Center",selfAuthoredTools:"Custom tools",dependencies:"Dependencies: {{items}}",fullCode:"Complete code for {{name}}",itemCount:"{{label}}: {{count}} items",collectionAria:"Retrieved resource information",retrieving:"Retrieving resources",retrievalFailed:"Resource retrieval did not complete",checkConfig:"Check the resource service configuration and try again.",notSearched:"Not searched",notConfigured:"Not configured",resourceList:"{{label}} resource list",searchKeywords:"Search keywords",skillHubSkipped:"No search keywords were provided, so Skill Hub was not searched.",sourceSkipped:"{{label}} is not configured, so this source was not searched.",noResources:"No resources in this category were returned.",resultAria:"Agent creation results",creationFailed:"Agent creation did not complete",agentResources:"Resources available to {{name}}",knowledgeBase:"Knowledge base",toolsLabel:"Tools",creating:"Creating agents",noAgents:"No agents to display",noAgentResult:"The tool response did not include an agent configuration or execution result.",sourceLabels:{tool:"Tools",knowledge:"AgentKit Knowledge Base",skillCenter:"AgentKit Skill Center",unknown:"Unknown source"},unnamedResource:"Unnamed resource",unnamedAgent:"Unnamed agent"},branchCompare:{ariaLabel:"Compare branches",selectDirection:"Select a direction",continue:"Continue in this direction"},codexProgress:{planTitle:"Codex execution plan",fallback:{fileChange:"Modify files",approval:"Waiting for approval",status:"Codex status",command:"Run command"},planSummary:"{{completed}}/{{total}} completed",command:{running:"Running command",completed:"Command completed",failed:"Command failed"},projectFiles:"{{count}} project files",projectFile:"project files",fileChange:{running:"Updating {{subject}}",completed:"Updated {{subject}}",failed:"Failed to update {{subject}}"},externalTool:"external tool",mcp:{running:"Calling {{tool}}",completed:"Called {{tool}}",failed:"{{tool}} call did not complete"},collaboration:{spawn_agent:{running:"Starting subtask",completed:"Subtask started",failed:"Failed to start subtask"},send_input:{running:"Sending information to subtask",completed:"Information sent to subtask",failed:"Failed to send information to subtask"},wait:{running:"Waiting for subtask",completed:"Subtask wait complete",failed:"Subtask wait failed"},close_agent:{running:"Ending subtask",completed:"Subtask ended",failed:"Failed to end subtask"},default:{running:"Coordinating subtasks",completed:"Subtask collaboration complete",failed:"Subtask collaboration failed"}},webSearch:{running:"Searching the web",completed:"Web search complete",failed:"Web search did not complete"},errorDetail:"Codex execution did not complete.",errorTitle:"Codex encountered an error"},toolActivity:{status:{queued:"Queued",running:"Running",completed:"Completed",failed:"Failed"},goal:{queued:"Waiting to create goal",running:"Creating goal",completed:"Created goal",failed:"Failed to create goal"},command:{queued:"Waiting to run command",running:"Running command",completed:"Ran command",failed:"Command failed"},read:{queued:"Waiting to read",running:"Reading",completed:"Read content",failed:"Read failed"},search:{queued:"Waiting to search",running:"Searching",completed:"Search complete",failed:"Search failed"},"file-change":{queued:"Waiting to change files",running:"Changing files",completed:"Changed files",failed:"File change failed"},mcp:{queued:"Waiting to call external tool",running:"Calling external tool",completed:"Called external tool",failed:"External tool call failed"},authorization:{queued:"Waiting for authorization",running:"Waiting for authorization",completed:"Authorization complete",failed:"Authorization failed"},generic:{queued:"Waiting to call tool",running:"Calling tool",completed:"Called tool",failed:"Tool call failed",named:{queued:"Waiting to call {{tool}}",running:"Calling {{tool}}",completed:"Called {{tool}}",failed:"{{tool}} call failed"}},exitCode:"exit {{code}}",omittedLines:"… {{count}} lines omitted …",omittedCharacters:"… {{count}} characters omitted …",rawData:"View raw data",callId:"Call ID",copyCallId:"Copy call ID",copy:"Copy",copied:"Copied",copyFailed:"Copy failed. Try again.",explored_one:"Explored 1 item",explored_other:"Explored {{count}} items"}},Ife={segments:{system:"System and tools",input:"Input and history",output:"Output and reasoning",remaining:"Remaining"},modelUnavailable:"Model information unavailable",promptWithSystem:"Prompt (including system)",systemUnknown:"System and tool usage unknown",systemApprox:"System and tools approximately {{count}} tokens",ariaKnown:"Context {{percentage}}% used, {{system}}, {{inputLabel}} {{input}} tokens, output and reasoning {{output}} tokens, remaining {{remaining}} tokens",ariaUnknown:"{{model}}, context window unknown, {{count}} cumulative session tokens used",composition:"Context composition",percentageUsed:"{{percentage}}% used",gridAria:"100-cell context composition chart. Each cell represents one percent of the context window.",estimated:"Estimated",unknown:"Unknown",summaryPercentage:"{{used}} used, {{remaining}} remaining",summaryTokens:"{{used}} used, {{remaining}} remaining, {{total}} total",overflow:"Context exceeded by {{count}} tokens",title:"Context usage",category:"Category",currentTurn:"Current Turn",sessionTotal:"Session total",details:{input:"Input",output:"Output",reasoning:"Reasoning",cache:"Cache hit",total:"Total"},unknownModel:"The context window for this model is not available",unknownRuntime:"The current runtime did not provide model information"},Pfe={title:"Add AgentKit agent",noAgents:"Connected successfully, but no agents were found at this address (/list-apps was empty).",connectionFailed:"Connection failed: {{error}}. Check the URL, API key, and whether the gateway allows cross-origin requests.",description:"Enter the URL and API key of an AgentKit deployment to connect through the ADK protocol. Connected agents will appear in the selector in the upper-left corner.",url:"Endpoint URL",apiKeyHint:"Connect using Authorization: Bearer",displayName:"Display name (optional)",displayNameHint:"Uses the URL hostname by default",cancel:"Cancel",connecting:"Connecting…",connect:"Connect and add"},Dfe={placeholder:"Type a message…",inputAria:"Message",generating:"Generating",send:"Send",model:"Model"},Mfe={ariaLabel:"Invocation context for this turn",removeSkill:"Remove skill {{name}}",removeAgent:"Remove agent {{name}}"},Lfe={cardAria:"{{label}} chart",viewAria:"{{label}} display mode",preview:"Preview",code:"Code",invalidEcharts:"The ECharts configuration is not a valid, safe data object. Switch to Code to inspect it.",renderFailed:"The chart cannot be rendered right now. Switch to Code to inspect it.",echartsAria:"ECharts preview",rendering:"Rendering chart…",mermaidFailed:"The chart cannot be rendered right now. Switch to Code to inspect the Mermaid source.",mermaidAria:"Mermaid preview"},$fe={downloadFile:"Download file",downloading:"Downloading…",downloadFailed:"Download failed. Check that the Sandbox and file are still available, then click to retry.",playVideo:"Play video: {{name}}",enlargeImage:"Enlarge image preview: {{name}}",image:"image",enlargeVideo:"Enlarge video",videoPreview:"Video preview",downloadVideo:"Download video",close:"Close"},Ffe={annotation:Afe,media:Tfe,runtimeLogs:_fe,trace:jfe,share:Nfe,blocks:Rfe,tokenUsage:Ife,addAgentKit:Pfe,composer:Dfe,invocation:Mfe,visualization:Lfe,markdown:$fe},Jze=Object.freeze(Object.defineProperty({__proto__:null,addAgentKit:Pfe,annotation:Afe,blocks:Rfe,composer:Dfe,default:Ffe,invocation:Mfe,markdown:$fe,media:Tfe,runtimeLogs:_fe,share:Nfe,tokenUsage:Ife,trace:jfe,visualization:Lfe},Symbol.toStringTag,{value:"Module"})),Bfe={back:"Back",cancel:"Cancel",deploy:"Deploy",delete:"Delete",loading:"Loading…",next:"Next",notSupported:"Not supported",previous:"Previous",required:"Required",retry:"Retry",actions:"Actions",value:"Value",disabled:"Off",enabled:"Enabled",none:"None",close:"Close",name:"Name",description:"Description",send:"Send"},Ufe={heading:"VeADK agent structure configuration",importHint:"Reload this file from Import YAML on the Create Agent page."},Qfe={agentName:{required:"Name is required",reserved:"user is reserved by Google ADK. Choose another name.",characters:"Start with a letter or underscore and use only letters, numbers, and underscores"},runtimeName:{required:"Runtime name is required",characters:"Runtime name can contain only letters, numbers, underscores, and hyphens",length:"Runtime name must be 4–64 characters"}},zfe={description:"A VeADK-powered assistant that understands user intent and uses the right tools to complete tasks.",instruction:`You are a professional and reliable assistant. Your goal is to understand the user's request accurately and provide clear, concise, and useful answers. Guidelines: - Ask clarifying questions when information is missing. Do not invent facts. - Use available tools when appropriate and explain key conclusions. -- Maintain a polite, professional tone.`},zfe={requestFailed:"Request failed ({{status}}){{detail}}",a2aSpaces:{credentialsMissing:"The server does not have cloud provider credentials configured, so AgentKit agent centers are unavailable",loginRequired:"Sign in to access AgentKit agent centers"},vikingKnowledge:{credentialsMissing:"The server does not have cloud provider credentials configured, so VikingDB knowledge bases are unavailable",loginRequired:"Sign in to access VikingDB knowledge bases"},vikingMemory:{credentialsMissing:"The server does not have cloud provider credentials configured, so VikingDB memory stores are unavailable",loginRequired:"Sign in to access VikingDB memory stores"},mcpGateway:{missingHttpTool:"Go back to Add MCP tool and add at least one HTTP MCP service. MCP resilience does not support stdio services.",missingUrl:"An HTTP MCP tool is missing a valid service URL. Go back to Add MCP tool and complete it before publishing."},customModel:{fallbackName:"Custom model",apiKeyLabel:"{{name}} model API Key",fallbackApiKeyLabel:"{{name}} fallback model {{model}} API Key"},deploymentEnv:{serverInjected:"Provided by the server",selectedApiKeyPlaceholder:"Provided by the selected API Key",mcpInjectedComment:"Provided by the added MCP tools",restoredPlaceholder:"Securely restored by the Studio server",generatedMcpPlaceholder:"Generated from the added HTTP MCP tools",restoredHelp:"When updating, the Studio server merges MCP addresses and authentication without returning existing secrets to the browser.",mergedMcpHelp:"The Studio server merges MCP addresses and optional authentication without returning existing secrets to the browser.",listSeparator:", ",requirementHint:"Required by the following optimizations: {{labels}}.",requiredBy:"Required by the following optimizations: {{labels}}. Enter {{key}}.",required:"Enter {{label}} ({{key}}).",invalidJson:"Invalid JSON format"},drafts:{unsupportedVersion:"This local draft version is not supported. Upgrade Studio and try again.",invalidFormat:"The local draft data is invalid.",readFailed:"Could not read local drafts. The browser data may be corrupted.",quotaExceeded:"Browser storage is full, so the draft was not saved. Delete unused drafts or clear this site's storage, then try again.",writeRejected:"The browser blocked saving this draft. Check the site's storage permissions and try again."},skills:{searchFailed:"Search failed ({{status}})",downloadFailed:"Skill download failed ({{status}})",agentKitRequestFailed:"AgentKit Skills request failed",missingManifest:"{{location}} is missing SKILL.md",invalidParentPath:"{{location}} contains an invalid parent path (..): {{path}}",invalidPath:"{{location}} contains an invalid path: {{path}}",localDescription:"Local skill",folderSource:"Folder",noManifest:"No SKILL.md was found in {{location}}"},zip:{invalid:"Invalid zip: EOCD was not found",tooManyFiles:"A zip file cannot contain more than {{count}} files",tooLarge:"The extracted zip content is too large"}},Vfe={back:"Back to development session",runtimeName:"Runtime name",runtimeNameExists:"This Runtime name already exists. Choose another name.",checkingRuntimeName:"Checking Runtime name",verifiedSource:"Verified source",deployableSource:"Deployable source",verifiedByCodex:"Verified by Codex in the cloud",entryPoint:"Entry point",files:"Files",artifact:"Artifact",validationReport:"Validation report",verifiedHint:"The server materializes source from the verified artifact. Browser files cannot replace it.",unverifiedHint:"The server securely materialized the source. Confirm the Runtime configuration before deploying.",env:{requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}"}},Hfe={name:"Code package",back:"Back to creation methods",reading:"Reading the code package",readingEllipsis:"Reading the code package…",uploadFirst:"Upload a code package first",uploadAriaLabel:"Code package upload",upload:"Upload code package",reupload:"Upload a different code package",uploadPrompt:"Upload a code package",filesRecognized:"{{count}} files found. Select this area to upload a different package.",dropHint:"Select or drop a .zip file up to 50 MB. Use app.py or declare an entry point in agentkit.yaml.",viewFiles:"View files",chooseFile:"Choose code package",errors:{invalidFormat:"Choose a .zip code package.",tooLarge:"The code package must be 50 MB or smaller.",invalidPath:"The archive contains an invalid path: {{name}}",empty:"The archive does not contain any deployable files.",tooManyFiles:"A code package cannot contain more than {{count}} files.",duplicateFile:"The code package contains a duplicate file: {{path}}",manifestParse:"Could not parse agentkit.yaml: {{detail}}",manifestRoot:"The root of agentkit.yaml must be an object.",manifestCommon:"common in agentkit.yaml must be an object.",entryPointType:"common.entry_point in agentkit.yaml must be a file path.",entryPointInvalid:"common.entry_point in agentkit.yaml is not a valid file path.",entryPointMissing:"The entry point declared in agentkit.yaml is missing from the code package: {{entryPoint}}",defaultEntryPointMissing:"The code package root must contain app.py, or common.entry_point in agentkit.yaml must declare an existing entry point."}},qfe={label:"Agent execution canvas",readOnlyLabel:"Read-only agent execution canvas",minimapLabel:"Execution flow minimap",controls:{ariaLabel:"Execution flow controls",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Fit view"},rootAgent:"Main agent",unnamedStep:"Unnamed step",terminals:{input:"User request",output:"Final response"},edges:{then:"Then",continueLoop:"Continue loop",call:"Call"},patterns:{llm:{label:"Agent",description:"Understand a task and complete one specific job"},sequential:{label:"Sequential",description:"Run internal steps one after another"},parallel:{label:"Parallel",description:"Run internal steps together, then combine their results"},loop:{label:"Loop",description:"Repeat internal steps until the stop condition is met"},a2a:{label:"Remote agent",description:"Call an existing remote agent"}},actions:{insertHere:"Insert a step here",deleteNamed:"Delete {{name}}",deleteNode:"Delete node",addSubagent:"Add subagent",addParallelStep:"Add a parallel step",addLoopStep:"Add a loop step",addNextStep:"Add next step",addFirst:"Add at the beginning",addLast:"Add at the end"}},Wfe={title:"Intelligent build",subtitle:"Describe what you need. Build, debug, and validate your agent.",model:{label:"Model",placeholder:"Select a model",retiring:"Retiring soon",currentConfiguration:"Current configuration",loadError:"Failed to load models"},availability:{checking:"Checking intelligent development availability…",unavailable:"Intelligent mode is currently unavailable. Go back and try again."},goal:{title:"Start with a goal",continueTitle:"Continue improving the project",hint:"Describe the problem your agent should solve. We will ask about any details that could affect the result.",continueHint:"Describe what you want to change. The result will be saved as a new version.",basedOn:"Based on",clearSelection:"Clear selection",label:"Goal",optimizationLabel:"Optimization goal",placeholder:"For example: Build an agent that reads sales data, creates weekly reports, and validates the output format",optimizationPlaceholder:"For example: Cite data sources and ask the user when information is incomplete"},actions:{preparing:"Preparing…",build:"Start building",optimize:"Start optimizing"},preparation:{accepted:"Goal received. Implementation is starting now.",preparing:"Creating the task environment…",starting:"Environment ready. Starting Codex…",next:"Next, Codex will plan the approach, then build, run, and validate the agent."},tasks:{title:"Tasks in progress",hint:"Work continues when you leave. Return to follow progress or add instructions.",refresh:"Refresh tasks",loading:"Loading tasks…",empty:"No tasks in progress",emptyHint:"Once a build starts, you can return to it here.",loadError:"Unable to load tasks. Please retry.",openError:"Unable to open this task. Please retry.",startedAt:"Started {{time}}",open:"Open task",opening:"Connecting…",states:{queued:"Queued",running:"Building",recovering:"Reconnecting",waiting_user:"Awaiting your reply",stopping:"Stopping",succeeded:"Completed",failed:"Incomplete",cancelled:"Stopped"}}},Kfe={title:"Saved projects",description:"Continue improving an existing version, or view, download, and deploy its source.",refresh:"Refresh projects",checkingStorage:"Checking project storage…",unavailableTitle:"Projects are temporarily unavailable",storageCheckError:"Could not confirm project storage status. Try again shortly.",storageNotConfigured:"Project storage is not configured.",loadingMigrated:"Loading migrated projects…",loadingSaved:"Loading saved projects…",loadingVersions:"Loading project versions…",unknownTime:"Unknown time",sourceDownloaded:"Source downloaded.",projectSummary_one:"{{count}} version · Updated {{time}}",projectSummary_other:"{{count}} versions · Updated {{time}}",versionSummary_one:"{{time}} · {{count}} file",versionSummary_other:"{{time}} · {{count}} files",noVersionDescription:"No version description",latestVersion:"Latest version",defaultVersionName:"Version · {{time}}",rename:{projectTitle:"Edit project name",versionTitle:"Edit version name",projectLabel:"Project name",versionLabel:"Version name",hint:"Use letters, numbers and common punctuation, up to {{max}} characters.",required:"Enter a name.",tooLong:"Names can contain up to {{max}} characters.",invalidCharacters:"Names cannot contain line breaks, control or invisible formatting characters, or < >.",save:"Save name",saving:"Saving…",updated:"Name updated.",failed:"Unable to save the name. Try again."},verified:"Verified",pendingVerification:"Needs review",viewSource:"View source",download:"Download",downloading:"Downloading…",optimize:"Optimize",optimizeUnavailable:"Optimize, not supported",errors:{projects:"Could not load saved projects.",source:"Could not load project source.",versions:"Could not load project versions.",download:"Could not download the source.",prepareDeployment:"Could not prepare the source for deployment.",deleteVersion:"Could not delete the project version.",migrated:"Could not load migrated projects",saved:"Could not load saved projects"},empty:{migratedTitle:"No migrated projects yet",savedTitle:"No saved projects yet",migratedDescription:"Source will be saved here after your first migration.",savedDescription:"Source will be saved here after your first build.",noVersions:"This project has no available versions."},compare:{selected:"{{count}}/2 selected",selectedLabel:"Selected",select:"Select",view:"View comparison",start:"Compare versions"},delete:{title:"Delete this version?",onlyVersion:"“{{name}}” has only one version. Deleting it will also remove the project. This cannot be undone.",description:"This version's source and validation records will be permanently deleted. Other versions are not affected.",confirm:"Delete version"}},Gfe={title:"Choose how to create",subtitle:"Build your agent with the workflow that fits your needs",features:"Features",quick:{title:"Quick mode",description:"Delegate tasks to dynamically created subagents",features:{dynamicSubagents:"Dynamic subagents",autonomousPlanning:"Autonomous planning",collaboration:"Multi-agent collaboration",summary:"Automatic result summaries",skills:"Skills on demand",trace:"Traceable task execution"}},traditional:{title:"Advanced mode",description:"Customize your agent structure in detail",features:{visualConfig:"Visual configuration",migration:"Existing agent migration",debugging:"Live debugging",optimization:"Optional optimization",parameters:"Fine-grained controls"}}},Xfe={placeholder:"Enter a system prompt. Type ## followed by a space to add a level-two heading…",toolbar:{undo:"Undo {{shortcut}}",redo:"Redo {{shortcut}}",paragraph:"Paragraph",quote:"Quote",heading:"Heading {{level}}",selectBlockType:"Select text style",blockType:"Text style",bold:"Bold",removeBold:"Remove bold",italic:"Italic",removeItalic:"Remove italic",bulletedList:"Bulleted list",numberedList:"Numbered list"}},Yfe={local:{duplicatesSkipped:"Skipped duplicate skills: {{names}}",invalidDrop:"Drop a folder containing SKILL.md or a .zip file",readError:"Could not read the files: {{detail}}",dropLabel:"Drop a folder or ZIP file to detect skills automatically",hint:"Each skill must contain a SKILL.md file. Directories can contain multiple skills.",reading:"Reading files…",fileCount:"Local · {{count}} files"},hub:{searchError:"Search failed. Try again shortly.",searchPlaceholder:"Search Volcano Find Skill, such as data analysis or PDF",search:"Search",searching:"Searching…",noResults:"No matching skills found. Try another keyword.",hint:"Search Volcano Find Skill by keyword. Selected skills are downloaded to the skills/ directory when the project is generated."},space:{loadError:"Failed to load",loadingSpaces:"Loading AgentKit Skills centers…",noSpaces:"This account has no AgentKit Skills centers.",selectSpace:"Select an AgentKit Skills center",openConsole:"Open in the Volcano Engine console",loadingSkills:"Loading skills…",noSkills:"This AgentKit Skills center has no skills."}},Zfe={unnamedNode:"Unnamed node",editInstruction:"Select to edit instructions…",controls:{ariaLabel:"Workflow canvas controls",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Fit view"},sections:{info:"Workflow information",execution:"Execution mode",nodes:"Nodes",nodeConfig:"Node configuration"},types:{sequential:{label:"Sequential",description:"Run nodes one after another"},parallel:{label:"Parallel",description:"Run nodes at the same time"},loop:{label:"Loop",description:"Run nodes repeatedly"}},placeholders:{description:"Describe what this workflow does…",agentDescription:"Describe what this agent does…",instruction:"You are…"},errors:{workflowNameUnique:"The workflow name must be unique among agent node names",agentNameUnique:"Agent names must be unique within this workflow"},dragHint:"Drag onto the canvas, or use the button below",agentNode:"Agent node",addNode:"Add node",connectHint:"Drag between node handles to define the execution order.",create:"Create workflow",deleteNode:"Delete node",nameHelp:"Use only letters, numbers, and underscores. Names must be unique.",instruction:"Instructions",tools:"Tools (comma-separated)",nodeId:"Node ID",empty:{selectNode:"Select a node to edit its configuration",summary:"{{nodes}} nodes · {{edges}} connections"}},Jfe={ariaLabel:"Quick mode creation",progress:"Quick mode creation progress",steps:{agent:{label:"Agent",title:"Basic information",description:"Set the agent's name, purpose, behavior, and capabilities"},environment:{label:"Environment",title:"Configure the environment",description:"Choose the default environment or a custom environment you have built"},deployment:{label:"Deployment",title:"Deployment preferences",description:"Configure AgentKit cloud settings"}},model:{label:"Model",source:"Model source",name:"Model name",fallbacks:"Fallback models",fallbackPlaceholder:"Fallback model name",addFallback:"Add fallback model",addProviderFallback:"Add other provider",removeFallback:"Remove",fallbackType:"Fallback model type",fallbackSameProvider:"Same provider",fallbackOtherProvider:"Other provider",apiKeyEnv:"API Key environment variable",invalidApiKeyEnv:"Use letters, numbers, and underscores only, and do not start with a number.",fallbackHelp:"Same-provider fallbacks reuse the primary connection. Other providers use separate provider, API base, and API Key settings.",fallbackIgnored:"Empty, duplicate, or primary-model entries will be ignored.",provider:"Provider",invalidApiBase:"Enter a valid http:// or https:// URL.",volcengineArk:"Volcano Ark",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",currentApiKey:"Current API Key",currentConfiguration:"Current configuration",loadingApiKeys:"Loading API Keys",selectApiKey:"Select an API Key",searchApiKeys:"Search API Key names",noApiKeys:"No API Keys available",loadingModels:"Loading models",selectModel:"Select a model",searchModels:"Search by name, Model ID, or provider",noModels:"No models available",apiKeyPlaceholder:"Enter a model API Key",credentialsLoadError:"Failed to load model credentials",modelsLoadError:"Failed to load models"},identity:{unnamedPool:"Unnamed user pool",currentPool:"{{value}} (current user pool)",userPool:"User pool",loading:"Loading user pools",placeholder:"Select a user pool",search:"Search user pools",empty:"This account has no Identity user pools",currentHint:"This Studio's login JWT will be forwarded to the Runtime",mismatchHint:"The selected user pool is not used by this Studio, so the Studio will not be able to call the Runtime after deployment",selectionHint:"The user pool used by this Studio is marked in the list"},agent:{namePlaceholder:"Enter an agent name",descriptionPlaceholder:"Describe what this agent can do",prompt:"Prompt",promptPlaceholder:"Define the role, goals, and behavior boundaries",skills:"Skills",addSkill:"Add skills"},validation:{descriptionRequired:"Enter a description",promptRequired:"Enter a prompt",modelRequired:"Select a model",apiKeyRequired:"Enter or select the model API Key",instanceIntegers:"Minimum instances must be an integer of 0 or greater, and maximum instances must be an integer greater than 0",instanceOrder:"Minimum instances cannot exceed maximum instances",userPoolRequired:"Select a user pool for Runtime authentication"},deployment:{runtimeName:"Runtime name",runtimeNameUpdateHint:"The existing Runtime name is preserved during updates",runtimeNameHint:"Use only letters, numbers, underscores, and hyphens",region:"Deployment region",authentication:"Authentication",apiKeyDescription:"Default: access with the Runtime API Key",userPoolDescription:"Use a JWT issued by an Identity user pool",sessionStorage:"Session storage",inMemoryStorage:"Temporary in-memory storage",backends:{sqlite:"SQLite file",mysql:"MySQL",postgresql:"PostgreSQL"},instances:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",inMemoryHint:"To prevent session loss across instances, keep the Runtime at 1–1 instances",networkMode:"Network mode",network:{public:"Public",private:"Private",both:"Public and private"},subnetIds:"Subnet IDs (optional, comma-separated)",sharedInternet:"Shared public egress in the VPC",sharedInternetHint:"Allow private Runtimes to access the public internet through shared egress",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",evaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment",resources:"Resource configuration",complete:"Deployment complete",preparing:"Preparing deployment…"},environmentVariables:{title:"Environment variables",add:"Add variable",nameAriaLabel:"Environment variable name",valueAriaLabel:"Value for {{name}}",deleteNamed:"Delete {{name}}"},actions:{updateAgain:"Update again",deployAgain:"Deploy again",updateAndPublish:"Update and publish",applyProfile:"Apply Profile",applyProfileAgain:"Apply Profile again"}},ehe={actions:{addSubagent:"Add subagent",clearRoot:"Clear main agent",clearRootConfirmation:"Clear all settings and subagents from the main agent? This cannot be undone."},workspace:{progress:"Agent creation progress",modes:{build:"Build",validate:"Debug",optimize:"Optimize",environment:"Environment",publish:"Publish"},titles:{build:"Customize your agent architecture",validate:"Debug your agent",optimize:"Choose optimizations for your agent",environment:"Configure the cloud environment",publish:"Prepare your agent for deployment"}},sections:{type:{label:"Agent type",hint:"Choose an agent type"},basic:{label:"Basic information",hint:"Name, description, and system prompt"},model:{label:"Model",hint:"Model and service (optional)"},tools:{label:"Tools",hint:"Callable capabilities"},skills:{label:"Skills",hint:"Declarative skills"},knowledge:{label:"Knowledge base",hint:"External knowledge retrieval"},memory:{label:"Memory",hint:"Short-term and long-term memory"},subagents:{label:"Subagents",hint:"Nested collaboration"},review:{label:"Finish",hint:"Preview and create"}},agentTypes:{ariaLabel:"Agent type",remoteChildOnly:"Remote agents can only be used as child steps",llm:{label:"Agent",fullLabel:"LLM agent",description:"Uses an LLM to complete tasks autonomously"},sequential:{label:"Sequential",fullLabel:"Sequential agent",description:"Runs subagents one after another"},parallel:{label:"Parallel",fullLabel:"Parallel agent",description:"Runs subagents in parallel, then combines their results"},loop:{label:"Loop",fullLabel:"Loop agent",description:"Repeats subagents until the stop condition is met"},a2a:{label:"Remote agent",fullLabel:"Remote agent",description:"Calls a remote agent through the A2A protocol"}},basic:{agentName:"Agent name",name:"Name",agentDescription:"Agent description",descriptionPlaceholder:"Briefly describe what this agent does so your team can identify it…",nameHelp:"Follow Google ADK naming rules and keep the name unique in the execution flow.",rootDescriptionHelp:"The full description is preserved and converted to a Runtime-compatible single line during deployment.",descriptionHelp:"The description appears in agent lists and selectors.",orchestratorHelp:"This is a collaboration container and does not answer directly. Add task steps on the canvas and drag them to reorder.",maxIterations:"Maximum iterations",maxIterationsHelp:"The loop repeats its subagents until the condition is met or this limit is reached.",agentCenter:"AgentKit agent center",agentCenterHelp:"The remote agent's name, description, and capabilities come from the Agent Card returned by the center. The system discovers and attaches matching agents for each task.",moreOptions:"More options",systemPrompt:"System prompt",loadingMarkdown:"Loading Markdown editor…",markdownHelp:"Markdown shortcuts are supported. For example, type ## followed by a space to create a level-two heading.",unnamed:"Unnamed",unnamedAgent:"Unnamed agent"},validation:{remoteRoot:"A remote agent can only be a subagent",missingRegistry:"Select an AgentKit agent center",name:{required:"Name is required",reserved:"user is reserved by Google ADK. Choose another name.",characters:"Start with a letter or underscore and use only letters, numbers, and underscores"},duplicateName:"Agent names must be unique within this structure",missingDescription:"Description is required",mcpDuplicateName:"MCP names must be unique",mcpDuplicateUrl:"Remove the duplicate MCP endpoint before publishing",missingSubagent:"A subagent is required",missingPrompt:"System prompt is required",apiKeyRequired:"Enter or select the model API Key",missingSubagentDetail:"Add at least one subagent to {{type}} before debugging or publishing.",problem:"{{name}}: {{problem}}"},ai:{ariaLabel:"Fill agent configuration with AI",minimumLength:"Enter at least {{count}} characters.",replaceConfirmation:"The generated configuration will replace the current canvas and settings. Continue?",placeholder:"Describe your goal and use {{model}} to generate the configuration",generate:"Generate",generating:"Generating",success:"Configuration generated",regenerate:"Generate again",failed:"Generation failed"},debug:{ariaLabel:"Agent debugging workspace",unavailable:"This backend does not currently support generated-agent debug runs.",baseline:"Baseline",comparison:"Variant {{count}}",selectModel:"Select a model",enterDescription:"Enter a description",enterPrompt:"Enter a system prompt",duplicateConfiguration:"Test configurations must be unique",starting:"Starting…",applyAndRestart:"Apply and restart",restart:"Restart",start:"Start environment",defaultModel:"Default model",testConfiguration:"Test configuration",deleteVariant:"Delete {{name}}",deleteVariantGroup:"Delete comparison variant",creatingEnvironment:"Creating the test environment…",configurationChanged:"The configuration changed. Restart the environment.",ready:"Environment ready",readyHint:"Send a message to compare agent responses.",startHint:"Complete the configuration, then start the environment.",viewTraceNamed:"View the trace for {{name}}",traceUnavailable:"Send a message to view its trace",trace:"Trace",useConfiguration:"Use this configuration",finishConfiguration:"Finish configuration",finishAndStart:"Finish and start",currentAgentModel:"Current agent model",configurationHint:"Changes apply only to this comparison. Select this configuration to continue to deployment.",messagePlaceholder:"Send a message to the running test environments…",startOneFirst:"Start at least one test environment first",addVariant:"Add variant",traceTitle:"Trace · {{name}}",leaveTitle:"Leave debugging?",leaveDescription:"The current environments will be removed when you leave. You can start new environments when you return.",cleaning:"Cleaning up…",confirmLeave:"Leave",closeLeaveConfirmation:"Close leave-debugging confirmation"},optimization:{ariaLabel:"Agent optimization options",scenario:"Optimization scenario",components:"Optimization components",bytePlusUnavailable:"Harness Sidecar optimizations are not available for BytePlus accounts yet. Leave all optimizations unselected to continue; regular BytePlus agents are not affected.",releaseScenario:"Optimization scenario: {{profile}}",profiles:{default:{label:"Custom",description:"Choose components as needed. The Sidecar stays off when none are selected."},ops:{label:"Operations",description:"For operations diagnostics, databases, logs, and monitoring MCP servers."}},groups:{quality:"Improve response quality",cost:"Reduce runtime cost",stability:"Improve runtime stability"},options:{context_engine:{label:"Context management",description:"Manage context assembly, task anchoring, and context budgets."},compressor:{label:"Context and result compression",description:"Compress long context and large tool results to reduce token usage."},verifier:{label:"Response verification and repair",description:"Verify evidence and responses, then repair or alert on failure."},long_run_control:{label:"Goal task control",description:"Manage progress, continuation, and completion conditions for Goal tasks."},mcp_resilience:{label:"MCP resilience",description:"Manage connections, timeouts, empty results, large responses, and call budgets. Includes read-only SQL protection by default."}}},model:{label:"Model",source:"Model source",volcanoArk:"Volcano Ark",volcengineArk:"Volcano Ark",bytePlusModelArk:"BytePlus ModelArk",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",configuration:"Model configuration",name:"Model name",fallbacks:"Fallback models",fallbackPlaceholder:"Fallback model name",addFallback:"Add fallback model",addProviderFallback:"Add other provider",removeFallback:"Remove",fallbackType:"Fallback model type",fallbackSameProvider:"Same provider",fallbackOtherProvider:"Other provider",apiKeyEnv:"API Key environment variable",invalidApiKeyEnv:"Use letters, numbers, and underscores only, and do not start with a number.",fallbackHelp:"Same-provider fallbacks reuse the primary connection. Other providers use separate provider, API base, and API Key settings.",fallbackIgnored:"Empty, duplicate, or primary-model entries will be ignored.",provider:"Provider",invalidApiBase:"Enter a valid http:// or https:// URL.",liteLlmProviders:"LiteLLM providers",apiKeyPlaceholder:"Enter the model API Key",available:"Available",retiring:"Retiring soon",notActivated:"Not activated",unavailable:"Unavailable",apiKeyLoadError:"Failed to load Ark API Keys",loadingApiKeys:"Loading API Keys…",selectApiKey:"Select an API Key",currentApiKey:"Current API Key",apiKeyList:"API Key list",searchApiKey:"Search API Keys",searchApiKeyName:"Search API Key names",noApiKeys:"No API Keys available",noMatchingApiKey:"No matching API Keys",loading:"Loading models…",loaded:"{{count}} models loaded",loadError:"Failed to load models",selectModel:"Select a model",selectProviderModel:"Select a provider model",providerModels:"Provider models",search:"Search models",searchPlaceholder:"Search by name, Model ID, or provider",noMatches:"No matching models",empty:"No models available",unknownStatus:"Unknown status",refresh:"Refresh",refreshing:"Refreshing…",activate:"Activate",activateAction:"Open activation",currentConfiguration:"Current configuration"},tools:{builtIn:"Built-in tools",builtInHelp:"Select VeADK capabilities. Imports and required environment variables are added automatically.",codeExecution:"Code execution configuration",codeExecutionHelp:"Select the AgentKit code execution sandbox.",mcp:"MCP tools"},catalog:{web_search:{label:"Web search",description:"Get real-time information with Volcengine Web Search."},parallel_web_search:{label:"Parallel web search",description:"Run multiple search queries in parallel and combine the results faster."},link_reader:{label:"Link reader",description:"Fetch and read the main content from a URL."},web_scraper:{label:"Web scraper",description:"Crawl webpages into structured data. Requires the Scraper service."},image_generate:{label:"Image generation",description:"Generate images from text with Doubao Seedream."},image_edit:{label:"Image editing",description:"Edit or transform images with Doubao SeedEdit."},video_generate:{label:"Video generation",description:"Generate videos from text or images with Doubao Seedance, including task status queries."},text_to_speech:{label:"Text to speech (TTS)",description:"Convert text to speech with Volcengine Speech."},run_code:{label:"Code execution",description:"Run code in a sandbox."},vesearch:{label:"VeSearch",description:"Search with Volcengine VeSearch. Requires a bot endpoint."},links:{console:"Console",documentation:"Documentation"},env:{modelAgentName:{comment:"Model name"},embeddingModelName:{comment:"Embedding model required by memory and knowledge bases"},vikingMemoryProject:{comment:"VikingDB memory project"},vikingMemoryRegion:{comment:"VikingDB memory region"},vikingMemoryType:{comment:"Memory types"},feishuAppId:{comment:"Feishu app ID"},feishuAppSecret:{comment:"Feishu app secret",placeholder:"Enter the app secret"},registrySpaceId:{comment:"AgentKit agent center",placeholder:"Select an agent center"},registryTopK:{comment:"Number of agents to retrieve"},registryRegion:{comment:"AgentKit agent center region"},registryEndpoint:{comment:"AgentKit agent center OpenAPI endpoint"},agentKitToolId:{comment:"Code execution sandbox ID"},agentKitToolRegion:{comment:"AgentKit Tools region"},openVikingUrl:{comment:"OpenViking service URL"},openVikingMemoryUserId:{comment:"Memory owner ID",help:"The user segment in viking://user//peers//memories. Use it to isolate agents, tenants, or business scenarios. The default is default."},openVikingMemoryPolicy:{comment:"Memory policy",help:"Controls memory extraction and isolation. Leave it blank to use the official default policy."},openVikingKnowledgeUserId:{comment:"Knowledge base owner ID",help:"Used in the default path viking://user//resources// when no resource directory is configured. The default is default."},openVikingTargetUri:{comment:"Knowledge base resource directory",help:"Leave blank to generate it from the KnowledgeBase index. When provided, this OpenViking resource directory takes precedence."},tlsServiceName:{comment:"TLS topic_id. Leave blank to create one automatically"}}},backends:{shortTerm:{local:{label:"In-memory",description:"Stored in the process without persistence. Best for development and debugging."},sqlite:{label:"SQLite file",description:"Persist data to a local .db file."},mysql:{label:"MySQL",description:"Persist data to MySQL."},postgresql:{label:"PostgreSQL",description:"Persist data to PostgreSQL."}},longTerm:{local:{label:"Local vector store",description:"In-process llama-index vector store."},opensearch:{label:"OpenSearch",description:"Vector retrieval with OpenSearch."},redis:{label:"Redis",description:"Vector retrieval with Redis."},viking:{label:"VikingDB Memory",description:"VikingDB memory with user profile support."},openviking:{label:"OpenViking Memory",description:"Long-term memory that stores and retrieves preferences, events, and entities per user."},mem0:{label:"Mem0",description:"Managed memory from Mem0."}},knowledge:{viking:{label:"VikingDB Knowledge",description:"VikingDB knowledge base."},opensearch:{label:"OpenSearch",description:"Vector retrieval with OpenSearch."},context_search:{label:"Context Search",description:"Volcengine Context Search without embedding configuration."},openviking:{label:"OpenViking Knowledge",description:"OpenViking resource-directory knowledge base without embedding configuration."}}},exporters:{apmplus:{label:"APMPlus",description:"Volcengine APMPlus application performance monitoring."},cozeloop:{label:"CozeLoop",description:"Distributed tracing with CozeLoop."},tls:{label:"TLS (Log Service)",description:"Export logs to Volcengine TLS."}},knowledge:{title:"Knowledge base",description:"Enable external knowledge retrieval (RAG) so the agent can answer from your data.",backend:"Knowledge base backend",vikingDatabase:"VikingDB knowledge base"},memory:{shortTerm:"Short-term memory",shortTermDescription:"Store context for one session",shortTermBackend:"Short-term memory backend",longTerm:"Long-term memory",longTermDescription:"Store context across sessions, usually with vector retrieval",longTermBackend:"Long-term memory backend",vikingDatabase:"VikingDB memory",autoSave:"Save sessions to long-term memory automatically",autoSaveDescription:"Write session content to long-term memory when a session ends."},mcp:{removeTool:"Remove MCP tool",namePlaceholder:"Name (optional)",urlPlaceholder:"MCP service URL",pathWarning:"This is a gateway root address. Use it only when the root path is the MCP endpoint; otherwise include the complete service path.",tokenPlaceholder:"Bearer token (optional)",showToken:"Show Bearer token",hideToken:"Hide Bearer token",commandPlaceholder:"Command, such as npx",argsPlaceholder:"Arguments separated by spaces",stdioHint:"The stdio tool starts in the deployment environment. Make sure its command and dependencies are available.",addTool:"Add MCP tool"},resources:{unnamedAgentCenter:"Unnamed agent center",unnamedKnowledgeBase:"Unnamed knowledge base",unnamedMemory:"Unnamed memory store",loadError:"Failed to load",loadingAgentCenters:"Loading agent centers…",agentCentersLoaded:"{{count}} agent centers loaded",noAgentCenters:"No agent centers available",noMatchingAgentCenters:"No matching agent centers",searchAgentKitCenter:"Search AgentKit agent centers",searchNameOrId:"Search by name or ID",selectAgentCenter:"Select an agent center",selectAgentKitCenter:"Select an AgentKit agent center",selectedAgentCenter:"Selected agent center",agentKitCenter:"AgentKit agent center",refreshAgentCenters:"Refresh agent centers",knowledgeBaseList:"Knowledge base list",knowledgeBasePlaceholder:"Select a knowledge base",loadingKnowledgeBases:"Loading knowledge bases…",knowledgeBasesLoaded:"{{count}} knowledge bases loaded",noKnowledgeBases:"No knowledge bases available",noMatchingKnowledgeBases:"No matching knowledge bases",searchKnowledgeBase:"Search knowledge bases",selectKnowledgeBase:"Select a knowledge base",refreshKnowledgeBases:"Refresh knowledge bases",memoryList:"Memory store list",memoryPlaceholder:"Select a memory store",loadingMemories:"Loading memory stores…",memoriesLoaded:"{{count}} memory stores loaded",noMemories:"No memory stores available",noMatchingMemories:"No matching memory stores",searchMemory:"Search memory stores",selectMemory:"Select a memory store",refreshMemories:"Refresh memory stores"},env:{noAdditionalParameters:"This backend needs no additional runtime parameters.",invalidJson:"Enter valid JSON.",helpAriaLabel:"Help for {{label}}: {{help}}",openOpenViking:"Open OpenViking {{label}}",valuePlaceholder:"Enter a value",openVikingIndex:"OpenViking resource index",openVikingIndexHelp:"Leave blank to generate an index from the agent name, such as my_agent_kb. Without DATABASE_OPENVIKING_TARGET_URI, the default URI is viking://user/{knowledge base owner ID, or default}/resources/{resource index}/. When DATABASE_OPENVIKING_TARGET_URI is set, that complete URI is used instead.",openVikingIndexAriaLabel:"OpenViking resource index help: {{help}}"},deployment:{vpcRequired:"Enter a VPC ID when using VPC networking.",apiKeyRequired:"Select the API Key used by the model.",invalidEnvName:"Invalid environment variable name: {{key}}",requiredEnv:"{{name}}: enter this required environment variable",generatingConfiguration:"Generating deployment configuration",runtimeNameExists:"This Runtime name already exists. Choose another name and try again.",preparing:"Preparing deployment",applyingMpaProfile:"Applying the Agent profile to MPA Runtime",mpaProfileApplied:"MPA Runtime profile applied",runningMpaSmoke:"Verifying the MPA Runtime execution path",mpaReady:"MPA Runtime is ready",mpaOperationIncomplete:"MPA Runtime setup did not complete. Retry this deployment task.",complete:"Deployment complete",failed:"Deployment failed",updateAndPublish:"Update and publish",stages:{build:"Build image",deploy:"Deploy Runtime",publish:"Publish service",applyMpaProfile:"Apply MPA profile",verifyMpaRuntime:"Verify MPA Runtime",mpaReady:"MPA Runtime ready",running:"Deploying"}},publish:{generating:"Generating publish configuration",validating:"Validating the agent structure and preparing the deployment snapshot…"}},the={presets:{support:{name:"Customer support assistant",description:"Answer questions around the clock using your knowledge base and conversation history, with consistent and considerate responses.",instruction:"You are a professional and patient customer support assistant. Always use a courteous, friendly tone. Base answers on the knowledge base whenever possible. When the available information is insufficient, say so clearly and ask for the details you need instead of inventing an answer. Keep responses concise and well structured, and provide steps when useful.",subagents:{}},analyst:{name:"Data analyst",description:"Run code for statistics and visualization with tracing enabled, so every analysis is observable and reproducible.",instruction:"You are a rigorous data analyst. Clarify the objective and definitions before cleaning, analyzing, and visualizing data with executable code. Explain assumptions and methods at each step, support conclusions with key evidence, and identify possible bias or limitations.",subagents:{}},translator:{name:"Translation assistant",description:"Translate between Chinese and English accurately and naturally while preserving tone and terminology.",instruction:"You are a professional translator fluent in Chinese and English. Preserve the meaning of the source while producing natural language for the target audience. Keep proper nouns and technical terminology accurate and reflect the original tone and style. Return only the translation unless the user asks for an explanation.",subagents:{}},coder:{name:"Coding assistant",description:"Write, debug, and refactor code, validate it by running tests, and produce clear, maintainable implementations.",instruction:"You are a senior software engineer. Write correct, clear, maintainable code that follows the conventions and best practices of the target language. When uncertain, run the code to validate the implementation, cover important edge cases, and add concise comments for complex logic.",subagents:{}},researcher:{name:"Researcher",description:"Search primary sources online and combine them with knowledge and long-term memory to produce evidence-backed findings.",instruction:"You are a rigorous researcher. Break each question into key subproblems, collect multiple credible primary sources through web search, and cross-check the evidence before drawing conclusions. Cite sources, state uncertainty, distinguish facts from inference, and avoid overgeneralization.",subagents:{}},"research-team":{name:"Multi-agent research team",description:"Coordinate a researcher, analyst, and writer to produce an end-to-end research report.",instruction:"You coordinate a research team. Break down the user's research task, delegate search, analysis, and writing to the appropriate subagents, synthesize their work, and deliver a clear, evidence-backed report.",subagents:{0:{name:"Researcher",description:"Collect primary sources and data related to the topic online.",instruction:"You are the team's researcher. Find multiple credible sources about the topic, organize the key facts, data, and original citations, and hand them to the analyst without adding unsupported conclusions."},1:{name:"Analyst",description:"Cross-check and synthesize the collected material.",instruction:"You are the team's analyst. Cross-check, compare, and synthesize the research material. Extract insights, identify contradictions and uncertainty, and produce a structured set of findings."},2:{name:"Writer",description:"Turn the analysis into a clear report with reliable citations.",instruction:"You are the team's writer. Turn the analyst's findings into a clear, well-written report with consistent citations, ensuring every conclusion can be traced to a source."}}}},tags:{tools:"Tools",memory:"Memory",knowledgeBase:"Knowledge base",tracing:"Tracing",subagents:"{{count}} subagents"},gallery:{title:"Create from a template",subtitle:"Choose a prebuilt agent template and customize it to fit your needs."},detail:{back:"Back to templates",name:"Name",systemPrompt:"System prompt",model:"Model",tools:"Tools",memory:"Memory",knowledgeBase:"Knowledge base",tracing:"Tracing",subagents:"Subagents ({{count}})",create:"Create from this template",shortTermMemory:"Short-term",longTermMemory:"Long-term"}},nhe={checkingExpiry:"Checking expiry",waitingRecovery:"Waiting for recovery",listFailed:"Could not load projects",recoveryFailed:"Could not restore the workspace. Try again",operationFailed:"Project operation failed. Try again",title:"Code projects",back:"Back to code projects",restart:"This development environment will restart in {{countdown}}. Save your work regularly",expiresAt:"Expires at {{date}}",exitFullscreen:"Exit full screen",fullscreen:"Full screen",exitFullscreenHint:"Exit full screen (Esc)",recovering:"Restoring your workspace. Your project will reopen automatically",retry:"Retry connection",search:"Search code projects",newTitle:"New code project",new:"New project",readingStats:"Loading project details",createdAt:"Created",opening:"Opening",unknownCreatedAt:"Creation time unknown",open:"Open project",empty:"No matching code projects",close:"Close new project",name:"Project name",placeholder:"e.g. my-agent",nameHelp:"Start with a letter and use letters, numbers, underscores or hyphens, up to 64 characters",cancel:"Cancel",create:"Create project",files_one:"{{count}} file",files_other:"{{count}} files",directories_one:"{{count}} directory",directories_other:"{{count}} directories",separator:", "},ihe={enabled:"Enabled",disabled:"Disabled",unknownStatus:"Unknown status",allPermissions:"All permissions",customPermissions:"Custom permissions",unknownPermissions:"Unknown permissions",unnamed:"Unnamed API Key",search:"Search name, status or permissions",noMatches:"No matching API Keys",noModelPermission:"Not permitted by this API Key",modelAvailable:"Available",permissionState:{Available:"Available for chat",Shutdown:"Shut down",VideoGeneration:"Video generation model",Unsupported:"Not a chat model",NotActivated:"Not activated",Unknown:"Model status unavailable"}},rhe={common:Ffe,yaml:Bfe,validation:Ufe,defaults:Qfe,helpers:zfe,intelligentDeployment:Vfe,codePackage:Hfe,buildCanvas:qfe,intelligent:Wfe,projectLibrary:Kfe,modePicker:Gfe,promptEditor:Xfe,skills:Yfe,workflow:Zfe,workbench:Jfe,traditional:ehe,template:the,workspace:nhe,modelApiKey:ihe},Jze=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:qfe,codePackage:Hfe,common:Ffe,default:rhe,defaults:Qfe,helpers:zfe,intelligent:Wfe,intelligentDeployment:Vfe,modePicker:Gfe,modelApiKey:ihe,projectLibrary:Kfe,promptEditor:Xfe,skills:Yfe,template:the,traditional:ehe,validation:Ufe,workbench:Jfe,workflow:Zfe,workspace:nhe,yaml:Bfe},Symbol.toStringTag,{value:"Module"})),she={source:"Task source",studio:"Studio scheduled tasks",title:"Runtime scheduled tasks",selectRuntime:"Select a cloud Runtime from the Agent list first.",scope:"Scheduled tasks for the current Studio user in this Runtime.",refresh:"Refresh",loading:"Loading Runtime tasks",empty:"No matching scheduled tasks in this Runtime.",authRequired:"Runtime rejected the request. Check gateway access and the Runtime authentication setting.",forbidden:"The current user cannot access this Runtime.",unsupported:"This Runtime does not provide the MPA scheduled tasks API.",invalidResponse:"The tasks API returned unrecognized data. Check the Runtime version.",loadFailed:"Could not load tasks. Check the network and Runtime status, then refresh.",pagination:"Runtime task pagination",total:"{{total}} tasks",previous:"Previous",next:"Next",columns:{name:"Task name",enabled:"Status",schedule:"Schedule",next:"Next run",last:"Latest result"},schedule:{once:"Once",interval:"Interval",daily:"Daily",weekly:"Weekly",monthly:"Monthly",cron:"Cron"},search:"Search tasks",executionCount:"Executions",successRate:"Success rate",prompt:"Task content",manage:{view:"Task view",list:"List",calendar:"Calendar",create:"Create scheduled task",edit:"Edit task",copy:"Copy",delete:"Delete",detail:"Details",run:"Run now",name:"Task",lastRun:"Last execution",schedule:"Schedule",lastStatus:"Last execution status",agent:"Executing Agent",actions:"Actions",all:"All statuses",Pending:"Not run yet",Queued:"Queued",Running:"Running",Succeeded:"Succeeded",Failed:"Failed",TimedOut:"Timed out",Cancelled:"Cancelled",Skipped:"Skipped",overview:"Execution statistics:",prompt:"Task content",timezone:"Time zone",localTime:"Execution time (device time zone)",time:"Time",Once:"Once",Interval:"Interval",Daily:"Daily",Weekly:"Weekly",Monthly:"Monthly",Cron:"Cron expression",seconds:"seconds",interval:"Interval in seconds",weekdays:"Weekdays (1 = Monday, 7 = Sunday; comma separated)",monthDays:"Days of month (1–31; comma separated)",delivery:"Delivery",Web:"Web",Feishu:"Feishu",target:"Feishu recipient ID",enabled:"Enable task",cancel:"Cancel",save:"Save",saving:"Saving",required:"Enter a task name, Agent ID, prompt and delivery target.",timezoneInvalid:"Enter a valid IANA time zone, such as Asia/Shanghai.",futureTime:"Choose a future execution time.",intervalInvalid:"Interval must be an integer between 30 and 31536000 seconds.",daysInvalid:"Enter valid, unique days.",history:"Execution history",duration:"Duration",result:"Result / session",noRuns:"No executions yet.",conflict:"The task changed or the request conflicts. Close the dialog, refresh and retry.",invalid:"Request validation failed. Check user identity, execution time, Agent ID and task settings.",queued:"Execution request submitted.",saved:"Task updated.",deleteConfirm:"Delete “{{name}}”? It will no longer be scheduled.",calendarZone:"Display time zone:",prevMonth:"Previous month",nextMonth:"Next month",today:"Today",nextOnly:"Next only",calendarHint:"The calendar shows expected executions. Complex Cron expressions show only the next execution returned by the server.",botAccount:"Delivery bot",selectBot:"Select an enabled delivery bot.",botsLoading:"Loading Feishu bots…",botsFailed:"Could not load delivery bots. Try again.",botsUnauthorized:"You cannot read Feishu bots. Contact an administrator to configure delivery.",retryBots:"Reload bots",botDisabled:"Disabled"}},ahe={backToList:"Back to scheduled tasks",cancel:"Cancel",cancelQueue:"Cancel queued run",cancelQueueFirst:"Cancel the queued run first",cancelling:"Cancelling…",closeDrawer:"Close panel",collapse:"Collapse",connectingRuntime:"Connecting to Runtime…",createScheduledTask:"Create scheduled task",createTask:"Create task",delete:"Delete",deleteTask:"Delete task",edit:"Edit",enable:"Enable",expand:"Expand",pause:"Pause",refresh:"Refresh",refreshHistory:"Refresh run history",rerun:"Run again",retry:"Retry",runNow:"Run now",saveChanges:"Save changes",saving:"Saving…",stop:"Stop run",stopRun:"Stop this run",stopRunFirst:"Stop the current run first",stopping:"Stopping…",viewDetails:"View details"},ohe={cancelDescription:"This Session will be cancelled. Future scheduled runs will remain enabled.",cancelTitle:"Stop this run?",deleteDescription:"“{{name}}” and its complete run history will be permanently deleted.",deleteTitle:"Delete scheduled task?"},lhe={configuration:"Task configuration",nextRun:"Next run",pageLabel:"Scheduled task details",region:"Region",runtime:"Runtime",status:"Task status"},che={createTitle:"Create scheduled task",description:"Each trigger creates a separate Session for the Runtime Agent.",editTitle:"Edit scheduled task"},uhe={minutesSeconds:"{{minutes}} min {{seconds}} sec",seconds:"{{count}} sec"},dhe={cronExpression:"Cron expression",cronHelp:"Enter minute, hour, day of month, month, and day of week.",dailyTime:"Daily run time",enableAfterCreate:"Enable after creation",enableHelp:"The task will run at its next scheduled time after it is enabled.",name:"Task name",namePlaceholder:"For example: Generate a daily operations summary",noRuntime:"No Runtime available",prompt:"Execution prompt",promptPlaceholder:"Enter the text to send to the Agent on every run",runAt:"Run time",runtimeAgent:"Runtime Agent",runtimeHelp:"The task always uses the Runtime's currently active version.",runtimePlaceholder:"Select a Runtime Agent",schedule:"Schedule",scheduleType:"Schedule type",timezone:"Time zone",weekday:"Day of week"},fhe={all:"All"},hhe={description:"Each run uses a separate Session. Results and errors are retained.",duration:"Duration: {{duration}}",emptyDescription:"Runs will appear here after the task is triggered or run manually.",emptyTitle:"No runs yet",errorDetails:"Error details",finalAnswer:"Final answer",loadFailed:"Unable to load run history",loadFailedDescription:"Check the Studio service and try again.",session:"Session",title:"Run history"},phe={cancelRequested:"Stop request submitted.",created:"Task created.",deleted:"The task and its run history were deleted.",enabled:"Task enabled.",paused:"Task paused.",queued:"Task queued and will start within one minute.",requeued:"Task queued again and will start within one minute.",updated:"Task updated."},mhe={filterLabel:"Filter scheduled tasks by status",listLabel:"Scheduled task list",loadFailed:"Unable to load scheduled tasks",loadFailedDescription:"Check the Studio service and try again.",title:"Cronjob"},ghe={cron:"Cron {{cron}}{{zone}}",daily:"Daily at {{time}}{{zone}}",once:"Once · {{date}}{{zone}}",weekly:"{{weekday}} at {{time}}{{zone}}"},bhe={daily:"Daily",once:"Once",weekly:"Weekly"},yhe={cancelled:"Cancelled",enabled:"Enabled",failed:"Failed",notRun:"Not run yet",paused:"Paused",pending:"Preparing",queued:"Queued",retrying:"Retrying",running:"Running",skipped:"Skipped",success:"Succeeded"},vhe={cronFields:"A Cron expression must contain five fields, for example 0 9 * * *.",nameRequired:"Enter a task name.",promptRequired:"Enter the text to send to the Agent on each run.",runtimeAppMissing:"The Runtime Agent did not return an appName. Confirm that the Runtime is ready and compatible.",runtimeRequired:"Select an available Runtime Agent.",timeRequired:"Select a run time."},xhe={friday:"Friday",monday:"Monday",saturday:"Saturday",sunday:"Sunday",thursday:"Thursday",tuesday:"Tuesday",wednesday:"Wednesday"},eVe={mpa:she,actions:ahe,confirm:ohe,detail:lhe,drawer:che,duration:uhe,fields:dhe,filters:fhe,history:hhe,notices:phe,page:mhe,schedule:ghe,scheduleTypes:bhe,status:yhe,validation:vhe,weekdays:xhe},tVe=Object.freeze(Object.defineProperty({__proto__:null,actions:ahe,confirm:ohe,default:eVe,detail:lhe,drawer:che,duration:uhe,fields:dhe,filters:fhe,history:hhe,mpa:she,notices:phe,page:mhe,schedule:ghe,scheduleTypes:bhe,status:yhe,validation:vhe,weekdays:xhe},Symbol.toStringTag,{value:"Module"})),whe="Quick-create Agent",khe="Agent type",Ohe="Close",She="Deploy",Ehe="Preview",Che="Configuration download started",Ahe="Download failed — try again",The="Review {{count}} configuration issues",_he="Custom",jhe="Custom {{field}}",Nhe="Enter a custom value",Rhe="This model declares no reasoning levels; the service settings apply",Ihe="Add a model to this provider first",Phe="Select a provider first",Dhe="Select an option",Mhe="Optional",Lhe="Default model, Agent preset and permissions apply to new sessions. The preset must exist in the deployed Harness",$he="Enter an environment variable name only; supply its secret value at deployment",Fhe="read-only allows reading; workspace-write allows workspace edits; danger-full-access allows full access without approval",Bhe="allowedModels lists the models sub-agents may select. Enabling selection requires at least one provider/model pair",Uhe="Add a custom model service using its endpoint, protocol and model IDs, including compatible Volcengine and BytePlus services",Qhe="Covers common native settings. Other plugin parameters and preset files are not included yet",zhe="Native configuration reference",Vhe="Provider {{index}}",Hhe="Model {{index}}",qhe="Add provider",Whe="Remove provider {{index}}",Khe="Add model",Ghe="Remove model {{index}}",Xhe="Add allowed model",Yhe="Remove allowed model {{index}}",Zhe="Remove",Jhe="Enter the service’s model ID",epe={provider:"Provider {{index}}",model:"Model {{index}}"},tpe={defaults:"Session defaults",deepseek:"DeepSeek model service",providers:"Custom model providers",shell:"Command execution",loop:"Tool calls",subagents:"Sub-agent model selection",search:"DeepSeek web search"},npe={id:"Provider ID",displayName:"Display name",baseURL:"Base URL",api:"API protocol",apiKeyEnv:"API key environment variable"},ipe={id:"e.g. company-models",displayName:"Optional; defaults to the provider ID",baseURL:"https://…/v1",api:"Select a protocol",apiKeyEnv:"e.g. MODEL_API_KEY"},rpe={id:"Model ID",name:"Display name",contextWindow:"Context capacity",maxTokens:"Maximum output capacity"},spe={positive:"Enter a number greater than zero",integer:"Enter a valid positive integer",env:"Use letters, digits and underscores; do not start with a digit",url:"Enter an HTTP or HTTPS URL without credentials",option:"Select a supported native option",required:"Complete this field",duplicate:"This ID or model pair already exists",providerId:"Start with a lowercase letter; use lowercase letters, digits, dots, underscores or hyphens; reserved IDs are unavailable",routes:"Add at least one complete provider/model pair",modelPair:"Enter a model ID for this custom provider",unknownProvider:"Add this custom provider first",unknownModel:"Enter a model ID configured for this provider",timer:"Enter a timeout greater than 0 and no more than 2147483647 ms"},ape={"agent-default-model_provider":"Default provider","agent-default-model_model":"Default model","agent-default-model_reasoningEffort":"Default reasoning effort","agent-presets_default":"Default Agent preset",permission_defaultPreset:"Default permission preset","llm-deepseek_apiKeyEnv":"API key environment variable","llm-deepseek_baseURL":"Base URL","llm-deepseek_thinking":"Thinking mode","llm-deepseek_reasoningEffort":"Reasoning effort","llm-deepseek_maxTokens":"Output limit per request","llm-deepseek_defaultContextWindow":"Default context capacity","llm-deepseek_streamIdleTimeoutMs":"Stream idle timeout (ms)",bash_timeoutMs:"Default execution timeout (ms)",bash_maxTimeoutMs:"Maximum execution timeout (ms)",bash_maxOutputBytes:"Output limit (bytes)","agent-loop_maxParallelToolCalls":"Parallel tool-call limit","subagent-model-selection_enabled":"Enable model selection","web-search-deepseek_apiKeyEnv":"API key environment variable","web-search-deepseek_baseURL":"Search base URL","web-search-deepseek_model":"Search model","web-search-deepseek_apiVersion":"API version","web-search-deepseek_maxTokens":"Search output limit","web-search-deepseek_maxUses":"Maximum search uses"},ope="Cancel",lpe="Back to creation methods",cpe="DeepSeek Harness configuration",nVe={title:whe,agentType:khe,close:Ohe,continue:"Continue",deploy:She,preview:Ehe,export:"Export configuration",downloaded:Che,downloadFailed:Ahe,validationSummary:The,customValue:_he,customField:jhe,enterCustomValue:Nhe,reasoningUnavailable:Rhe,modelsUnavailable:Ihe,selectProviderFirst:Phe,selectOption:Dhe,optional:Mhe,defaultsHelp:Lhe,credentialHelp:$he,permissionHelp:Fhe,routesHelp:Bhe,providersHelp:Uhe,coverage:Qhe,source:zhe,provider:Vhe,model:Hhe,addProvider:qhe,removeProvider:Whe,addModel:Khe,removeModel:Ghe,addRoute:Xhe,removeRoute:Yhe,remove:Zhe,modelIdPlaceholder:Jhe,route:epe,sections:tpe,providerFields:npe,providerPlaceholders:ipe,modelFields:rpe,errors:spe,fields:ape,cancel:ope,back:lpe,pageTitle:cpe},iVe=Object.freeze(Object.defineProperty({__proto__:null,addModel:Khe,addProvider:qhe,addRoute:Xhe,agentType:khe,back:lpe,cancel:ope,close:Ohe,coverage:Qhe,credentialHelp:$he,customField:jhe,customValue:_he,default:nVe,defaultsHelp:Lhe,deploy:She,downloadFailed:Ahe,downloaded:Che,enterCustomValue:Nhe,errors:spe,fields:ape,model:Hhe,modelFields:rpe,modelIdPlaceholder:Jhe,modelsUnavailable:Ihe,optional:Mhe,pageTitle:cpe,permissionHelp:Fhe,preview:Ehe,provider:Vhe,providerFields:npe,providerPlaceholders:ipe,providersHelp:Uhe,reasoningUnavailable:Rhe,remove:Zhe,removeModel:Ghe,removeProvider:Whe,removeRoute:Yhe,route:epe,routesHelp:Bhe,sections:tpe,selectOption:Dhe,selectProviderFirst:Phe,source:zhe,title:whe,validationSummary:The},Symbol.toStringTag,{value:"Module"})),upe="Report an issue",dpe="Description",fpe="Common issues",hpe="Cancel",ppe="Done",mpe="Submit feedback",gpe="Submitting…",bpe={title:"Feedback submitted. Thank you.",description:"The AgentKit team will review your report as soon as possible."},ype={close:"Close issue report",intro:"Select the issues you encountered and add any useful details.",privacy:"Your conversation data will be shared with the AgentKit team. Please protect sensitive information.",descriptionPlaceholder:"Describe what happened (optional)",issues:{slow:"Slow execution",crash:"Runtime crash",incorrect:"Inaccurate result",tool_error:"Tool call failed",other:"Other issue"}},vpe={description:"Tell us about a problem you encountered while using AgentKit Studio.",module:"Area",modules:{conversation:"Conversation",agents:"Agents",applications:"Automations",search:"Search",other:"Other"},commonIssuesMultiple:"Common issues (select all that apply)",issueTypes:"Issue types",issues:{page_slow:"Page loads slowly",feature_unavailable:"Feature unavailable",display_error:"Display issue",no_response:"Action has no response",other:"Other issue"},descriptionPlaceholder:"Describe the page, action, and what happened",quickAdd:"Quick add",suggestionsLabel:"Suggested descriptions",suggestions:{noResponse:"Nothing happens after I click",loading:"The page remains in a loading state",incomplete:"Some content is missing or clipped",error:"An error appears after the action"},privacy:"Your data will be shared with the AgentKit team. Please protect sensitive information."},rVe={title:upe,descriptionLabel:dpe,commonIssues:fpe,cancel:hpe,done:ppe,submit:mpe,submitting:gpe,success:bpe,dialog:ype,page:vpe},sVe=Object.freeze(Object.defineProperty({__proto__:null,cancel:hpe,commonIssues:fpe,default:rVe,descriptionLabel:dpe,dialog:ype,done:ppe,page:vpe,submit:mpe,submitting:gpe,success:bpe,title:upe},Symbol.toStringTag,{value:"Module"})),xpe={back:"Back",close:"Close"},wpe={title:"Optimize migrated project",closeAria:"Close optimization dialog"},kpe={title:"Migrated projects",description:"Manage migrated source versions or continue optimizing any version.",libraryTitle:"Projects and versions",libraryDescription:"View, download, deploy, or compare source versions, or continue optimizing any version.",emptyTitle:"No migrated projects yet",emptyDescription:"Migrated source code will be saved here automatically."},Ope={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any (universal migration)"},Spe={awaitingUpload:"Awaiting upload",analyzing:"Analyzing",needsInput:"Needs input",analysisReady:"Awaiting confirmation",migrating:"Migrating",validating:"Validating",packaging:"Packaging",succeeded:"Completed",succeededWithWarnings:"Completed with notices",partial:"Partially completed",failed:"Failed",cancelled:"Stopped",expired:"Expired"},Epe={evaluationPending:"Evaluation pending",evaluationRunning:"Evaluating",waitingDataset:"Evaluation cases pending",waitingEnvironment:"Environment variables required",evaluationFailed:"Migrated, evaluation incomplete",evaluationBlocked:"Migrated, evaluation needs attention",evaluationCancelled:"Migrated, evaluation cancelled",resultUnavailable:"Result unavailable",environmentExpired:"Environment expired"},Cpe={partialReady:"Migration output is ready, but delivery is incomplete. Review the migration notices.",readyWithWarnings:"Migration output is ready. Review the migration notices.",ready:"Migration output is ready."},Ape={passed:"Output verification passed",failed:"Output verification failed",degraded:"Output verification incomplete"},Tpe={session:"Create migration environment",upload:"Upload project",analysis:"Analyze project"},_pe={agentNameRequired:"Enter an Agent name",agentNameInvalid:"Agent names must be 1–63 characters, contain only lowercase letters, numbers, and hyphens, and start and end with a letter or number"},jpe={seconds:"{{seconds}} sec",minutesSeconds:"{{minutes}} min {{seconds}} sec"},Npe={savedUnaffected:"Saved projects are unaffected",savingUnaffected:"Source is being saved and will be unaffected once complete",activeDetail:"Task history and temporary output will become unavailable after expiration",oneHour:"Temporary migration environment is retained for 1 hour",ended:"Temporary migration environment has ended",savedAvailable:"Saved projects remain available to view, download, deploy, or optimize",unavailable:"Task history and temporary output are no longer available",countdown:"Temporary migration environment ends in {{minutes}} min {{seconds}} sec",expiredSavedMessage:"The temporary migration environment has ended. Saved projects are unaffected.",expiredMessage:"The temporary migration environment has ended. Task history and temporary output are no longer available."},Rpe={recommended:"Recommended migration method",scope:"Migration scope",excluded:"Out of scope",viewEvidence:"View analysis evidence",viewAssumptions:"View key assumptions",viewSourceEvidence:"View source evidence"},Ipe={ariaLabel:"Codex activity",title:"Codex activity",startingAnalysis:"Codex is starting the analysis…",startingMigration:"Codex is starting the migration…",loadError:"Codex activity is temporarily unavailable. The current task is unaffected.",liveAnalyzing:"Analyzing the project",liveMigrating:"Running the migration",liveValidating:"Verifying the migration",livePackaging:"Packaging the migration",liveDelivery:"Reviewing the delivery"},Ppe={title:"Migration output",fileTooLarge:"This file exceeds 2 MiB. Download the complete output to view it.",unsupportedPreview:"This file cannot be previewed here. Download the complete output to view it.",filesAria:"Migration output files",searchAria:"Search output files",searchPlaceholder:"Search files",limit:"Showing the first {{count}} items. Search for a specific file.",noSelection:"No file selected",noPreview:"No files available to preview.",loadingFile:"Loading output file…",startupFile:"Startup file",fileCountLabel:"Files",saved:"Source has been saved. You can view, download, deploy, or optimize it.",saving:"Output is ready and the source version is being saved.",deployReady:"Output is available to preview, download, and deploy. Waiting for source save status.",deployUnavailable:"Output is available to preview and download, but its current delivery status does not support deployment.",viewProjects:"View migrated projects",downloading:"Downloading…",downloadZip:"Download ZIP",deployTitle:"Deploy migration output",deployUnavailableTitle:"Current delivery status does not support deployment",deployRuntime:"Deploy to Runtime",fileCount:"{{count}} files",startup:"Startup file {{module}}",loading:"Loading migration output…"},Dpe={retiring:"Retiring soon",currentDefault:"Current default model",loadError:"Failed to load models",label:"Model",placeholder:"Select a model"},Mpe={zipOnly:"Select a local project in .zip format.",invalidName:"The ZIP file name is invalid. Rename the file and select it again.",tooLarge:"The project ZIP cannot exceed {{size}}.",empty:"The project ZIP cannot be empty.",removeAria:"Remove project ZIP",reselectPrompt:"Select the project ZIP again",selectPrompt:"Select or drop a local project ZIP",reselect:"Select again",selectZip:"Select ZIP",continue:"Continue upload",start:"Upload and analyze",inputAria:"Select a local project ZIP",retention:"The temporary migration environment is retained for 1 hour after creation. Successfully saved source versions are unaffected.",uploading:"Uploading…",sizeHint:"Project ZIP, up to {{size}}"},Lpe={requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}",notReady:"Migration output is not ready yet.",back:"Back to migration results"},$pe={backToAddAgent:"Back to Add Agent",title:"Migrate existing project",newMigration:"New migration",recent:"Recent migrations",loadingSessions:"Loading migration sessions…",noSessions:"No migration sessions",heading:"Migrate an existing Agent project",intro:"Upload a local project ZIP. Codex will first perform a read-only analysis, then ask you to confirm the migration method.",backToHome:"Migration home",navigation:"Migration navigation",showMore:"Show more",showLess:"Show less",projectName:"Project name",status:"Status",createdAt:"Created",actions:"Actions",openTask:"Open migration {{name}}",continueTask:"Continue",viewTask:"View"},Fpe={stop:"Stop migration",stopping:"Stopping…",cancel:"Cancel",reload:"Reload",refreshStatus:"Refresh status"},Bpe={unavailable:"Migration is currently unavailable",defaultReason:"Dev Sandbox is currently unavailable. Contact your administrator to check the configuration."},Upe={creatingSandbox:"Creating Dev Sandbox",initializing:"Initializing the migration workspace and checking AgentKit CLI, Codex, and migration capabilities. The project will upload automatically when the environment is ready.",elapsed:"Elapsed: {{duration}}",uploadThenAnalyze:"Read-only analysis will start automatically after the ZIP upload completes.",analyzing:"Codex is identifying the framework, entry point, and migration boundaries. No migration changes are being made.",migrationLocked:"Attachments and migration settings cannot be changed while migration is running. Wait for the task to finish or stop it.",analysisPaused:"Read-only analysis is paused. Answer only the questions below. After submission, analysis will continue in the same environment without starting the migration.",analysisComplete:"Read-only analysis is complete. Review the recommendation and confirm the final migration method.",awaitingUpload:"The migration environment is ready. Select the local ZIP again to continue uploading.",expiredTitle:"Migration environment expired",expiredDescription:"Migration content and output can no longer be previewed, downloaded, or deployed. If the Runtime deployment completed, return to the Agents page to continue using it.",unsupportedTitle:"This ZIP cannot be migrated yet",unsupportedHint:"Update the project as instructed, then create a new migration and upload it again.",failedTitle:"Migration incomplete",cancelled:"This migration was stopped. Create a new migration and upload the project again."},Qpe={ariaLabel:"Provide project analysis details",title:"Additional information needed for analysis",description:"The attachment stays locked; submitting continues read-only analysis only",submitting:"Continuing analysis…",submit:"Submit and continue analysis"},zpe={ariaLabel:"Answer the questions the migration needs you to decide",title:"The migration needs your answer",description:"Your answer continues the current step instead of restarting it",other:"Other",otherPlaceholder:"Or type your own answer",submitting:"Submitting your answer…",submit:"Submit answer and continue"},Vpe={ariaLabel:"Confirm migration method",title:"Confirm migration method",framework:"Migration method",frameworkPlaceholder:"Select a migration method",agentName:"Agent name",entry:"Project entry point",entryPlaceholder:"Select a project entry point",entryExample:"For example, agent.py:agent",consent:"By selecting “Confirm and start migration,” you confirm the migration scope, exclusions, and key assumptions above.",starting:"Starting migration…",start:"Confirm and start migration"},Hpe={setup:{title:"Migration effect evaluation",description:"Evaluation cases run automatically after migration.",on:"On",off:"Off",unavailable:"Migration effect evaluation is unavailable in this environment.",casesTitle:"Evaluation cases",casesDescription:"Add at least one case. Expected outcomes and criteria are optional.",configuredSummary:"{{count}} cases · {{preset}} · {{dimensions}}",incompleteSummary:"{{count}} cases need content · {{preset}} · {{dimensions}}",dimensionSummary:"{{count}} dimensions",editSettings:"Edit settings",viewSettings:"View settings",lockedTitle:"Evaluation cases",lockedDescription:"Cases cannot change after upload starts.",closeAria:"Close evaluation settings",done:"Finish setup",close:"Close"},tabs:{label:"Migration task content",migration:"Migration",evaluation:"Evaluation",waitingMigration:"Waiting for migration",waitingConfiguration:"Setup required",running:"Running",completed:"Completed",issue:"Needs attention"},bulk:{open:"Paste multiple",label:"Enter one case per line",placeholder:`Check the status of today's orders -Summarize the result in three points`,preview:"{{count}} cases will be added",confirm:"Add cases"},case:{title:"Case {{index}}",add:"Add case",moveUp:"Move case {{index}} up",moveDown:"Move case {{index}} down",copy:"Duplicate",delete:"Delete",userInput:"User input",userInputPlaceholder:"For example: Check the status of today's orders",expectedOutcome:"Expected outcome (optional)",expectedOutcomePlaceholder:"Describe what the Agent should accomplish; exact wording is not required",criteria:"Requirements (optional)",addCriterion:"Add requirement",criterionLabel:"Requirement {{index}}",criterionPlaceholder:"For example: Include the order ID and current status",removeCriterion:"Remove requirement {{index}}"},advanced:{title:"Advanced settings",standard:"Standard evaluation",standardDescription:"Uses 3 dimensions by default: semantic fidelity, output constraints, and workflow/tool fidelity.",custom:"Custom dimensions",customDescription:"Select one or more dimensions based on business risk.",lockedDescription:"The evaluation method and dimensions cannot change after upload starts."},dimension:{semantic_fidelity:"Semantic fidelity",output_contract:"Output contract",workflow_tool_fidelity:"Workflow and tool fidelity",context_memory_fidelity:"Context and memory fidelity",boundary_error_fidelity:"Boundary and error fidelity",safety_refusal_fidelity:"Safety and refusal fidelity"},dimensionDescription:{semantic_fidelity:"Checks whether intent, conclusions, and key facts remain consistent.",output_contract:"Checks required fields, structure, language, and formatting constraints.",workflow_tool_fidelity:"Checks observable workflow branches and tool-driven behavior.",context_memory_fidelity:"Checks supported multi-turn context and memory behavior.",boundary_error_fidelity:"Checks invalid input, missing information, and dependency failures.",safety_refusal_fidelity:"Checks existing authorization, refusal, and sensitive-data boundaries."},validation:{caseCount:"Keep between 1 and {{count}} cases.",dimensionRequired:"Select at least one evaluation dimension.",userInputRequired:"Enter case input.",userInputBytes:"A case cannot exceed 32 KiB.",expectedOutcomeBytes:"The expected outcome cannot exceed 16 KiB.",criteriaCount:"A case can contain at most {{count}} requirements.",criterionRequired:"Requirements cannot be empty.",criterionBytes:"One requirement cannot exceed 2 KiB.",datasetBytes:"All evaluation cases cannot exceed 10 MiB."},dataset:{invalidLockResponse:"The service did not confirm that evaluation cases were saved. Try again.",loadingSettings:"Loading evaluation settings…",loadSettingsFailed:"Evaluation settings could not be loaded.",retryLoadSettings:"Reload",missing:"No saved evaluation cases were found. Enter and save them again.",saveWarning:"Evaluation cases were not saved. Migration continues.",retrySave:"Save evaluation cases again",saving:"Saving…"},state:{disabled:"Evaluation is off",waiting_dataset:"Waiting for evaluation cases",pending:"Evaluation starts automatically after migration",preparing:"Preparing the evaluation environment…",waiting_environment:"Runtime environment variables are required",deploying:"Deploying a temporary Runtime…",executing:"Running evaluation cases…",judging:"Running evaluation analysis…",aggregating:"Aggregating evaluation results…",completed:"Evaluation completed",failed:"Evaluation incomplete",blocked:"Evaluation requires attention before it can continue",cancelled:"Evaluation cancelled"},progress:{label:"Migration and migration effect evaluation progress",migration:"Migration",evaluation:"Migration effect evaluation",notStarted:"Not started",inProgress:"In progress",completed:"Complete",waitingConfiguration:"Waiting for setup",issue:"Needs attention"},environment:{description:"Enter the environment variables required by the temporary Runtime.",security:"Used only for this evaluation.",optional:"Optional",submit:"Submit and continue evaluation",submitting:"Submitting…"},execution:{preparing:"Prepare evaluation",preparingDetail:"Validate migration output and {{count}} evaluation cases",deploying:"Start Runtime",deployingDetail:"Prepare {{runtime}}",runtimeFallback:"isolated runtime",executing:"Run cases",executingDetail:"Run {{count}} cases and capture output",judging:"Run evaluation analysis",judgingDetail:"Evaluate {{cases}} cases · {{dimensions}} dimensions",aggregating:"Generate evaluation report",aggregatingDetail:"Aggregate scores and evidence into an HTML report",waiting:"Waiting",running:"Running",failed:"Failed",complete:"Completed"},result:{title:"Execution progress",attempt:"Evaluation attempt {{attempt}}",pending:"Waiting for migration to complete",retry:"Run evaluation again",retrying:"Retrying…",failureStage:"Failed at",errorCode:"Error code",taskId:"Task ID",diagnosticAttempt:"Evaluation attempt",runtime:"Runtime",errorDetails:"Error details",diagnosticField:"{{label}}: {{value}}",diagnosticHeading:"{{label}}:",loadingReport:"Loading the evaluation report…",reportTitle:"HTML evaluation report",reportHtmlDescription:"View or download the HTML report.",viewReport:"View report",reportDrawerDescription:"Scores, differences, and evidence",closeReport:"Close",closeReportAria:"Close evaluation report",reportPreviewTitle:"Migration effect evaluation report preview",reportSummary:"Evaluation summary",reportVersion:"Dataset {{version}} · Prompt v{{prompt}}",downloadReport:"Download full report",downloadingReport:"Downloading…",overallScore:"Overall fidelity",scoreScale:"0–100; N/A when evidence is insufficient",evidenceCoverage:"Evidence coverage",coverageDetail:"{{scored}} of {{total}} dimensions evidenced",executionSuccess:"Execution success",executionDetail:"{{succeeded}} of {{total}} cases completed",naCount:"N/A count",naDescription:"Insufficient evidence; excluded from scores",gapDescription:"Migration gap summary",lowestScoringCases:"Lowest-scoring cases",executionFailures:"Execution issues",criticalEvidence:"Critical evidence",limitations:"Evaluation limitations",viewEvidence:"View results and evidence for {{count}} cases",outputTruncated:"Long output was truncated",executionState:{succeeded:"Execution completed",failed:"Execution issue"},severityLabel:"Severity: {{severity}}",severity:{none:"None",low:"Low",medium:"Medium",high:"High",critical:"Critical",unknown:"Unknown"},evidenceSource:{user_reference:"Expected outcome",user_criteria:"Provided requirements",source_contract:"Source contract",observed_output:"Observed output",runtime_observation:"Raw Runtime data",deterministic_assertion:"Deterministic assertion"},listSeparator:", "}},qpe={closeAria:"Dismiss error",loadFailed:"Could not load migration data. Try again.",refreshFailed:"Could not refresh the migration status. Try again."},Wpe={title:"Stop the current migration?",description:"Stopping ends the current analysis or migration process. Completed steps will not continue."},aVe={common:xpe,optimization:wpe,projects:kpe,framework:Ope,state:Spe,historyStatus:Epe,task:Cpe,verification:Ape,transfer:Tpe,validation:_pe,duration:jpe,expiry:Npe,analysis:Rpe,activity:Ipe,artifact:Ppe,model:Dpe,upload:Mpe,deployment:Lpe,workspace:$pe,actions:Fpe,capability:Bpe,conversation:Upe,questions:Qpe,pendingInput:zpe,confirmation:Vpe,evaluation:Hpe,errors:qpe,stopDialog:Wpe},oVe=Object.freeze(Object.defineProperty({__proto__:null,actions:Fpe,activity:Ipe,analysis:Rpe,artifact:Ppe,capability:Bpe,common:xpe,confirmation:Vpe,conversation:Upe,default:aVe,deployment:Lpe,duration:jpe,errors:qpe,evaluation:Hpe,expiry:Npe,framework:Ope,historyStatus:Epe,model:Dpe,optimization:wpe,pendingInput:zpe,projects:kpe,questions:Qpe,state:Spe,stopDialog:Wpe,task:Cpe,transfer:Tpe,upload:Mpe,validation:_pe,verification:Ape,workspace:$pe},Symbol.toStringTag,{value:"Module"})),Kpe={loading:"Loading…",searchLabel:"Search {{label}}",searchPlaceholder:"Search {{label}}",retry:"Retry",noMatches:"No matches",noOptions:"No options available",selection:"{{label}}: {{value}}"},Gpe={badge:"All new",view:"See what's new",title:"What's new",defaultNotes:{multiRegion:"Multi-region agents: load Beijing and Shanghai Runtimes in parallel, with more available as you scroll.",switchAgent:"Switch in conversation: choose an agent beside the composer and start a new conversation immediately.",visualCanvas:"Visual execution canvas: inspect multi-agent structures on a horizontal canvas with fullscreen support."}},Xpe={label:"New conversation workspace",agent:"Agent",skill:"Skill customization",video:"Video creation"},Ype={select:"Select conversation mode",agent:{label:"Agent",description:"Chat with the selected Agent"},builtin:{label:"Built-in Agent",description:"Use an Agent provided by the platform"},codex:{label:"Codex Agent",description:"Run tasks in a sandbox"},deepseekHarness:{label:"DeepSeek Harness",description:"Open the DeepSeek Harness workspace"},arkClaw:"ArkClaw",hermes:"Hermes Agent",checking:"Checking configuration",notConfigured:"Not configured by an administrator",unavailable:"Unavailable"},Zpe={select:"Select Agent",typesLabel:"Agent types",listLabel:"{{type}} list",types:{agent:"Agent",general:"General Agent",mpa:"MPA Agent",codex:"Codex Agent",deepseekHarness:"DeepSeek Harness",openclaw:"OpenClaw Agent",hermes:"Hermes Agent"},loading:"Loading Agents",reload:"Reload",empty:"No {{type}} yet",emptyLocal:"No local Agents yet",emptyGeneral:"No General Agents yet",createHint:"Create one from the Agents page",localHint:"Check the directory where Studio was started",waking:"Waking up",opening:"Opening",connecting:"Connecting",loadingMore:"Loading",loadMore:"Load more",runtimeTimeout:"Loading Agents timed out after 15 seconds. Check the network or Runtime service and retry.",loadGeneral:"Load General Agents",loadType:"Load {{type}}",connectGeneral:"Connect to General Agent",openLocal:"Open local Agent",openType:"Open {{type}}",wakingHint:"Waking the agent. This may take some time."},Jpe={spaceAria:"Skill spaces",configuration:"Skill customization settings",actions:{create:"Generate Skill",optimize:"Optimize Skill"},selectAction:"Select a Skill customization action",actionList:"Skill customization actions",style:"Style",selectStyle:"Select style",model:"Model",selectModel:"Select model",styles:{concise:"Concise and practical",strict:"Rigorous and reliable",tutorial:"Tutorial-friendly",automation:"Automation-first"},modelLoadFailed:"Failed to load model configuration",spaceLoadFailed:"Failed to load Skill Spaces",skillLoadFailed:"Failed to load Skills",unnamedSpace:"Unnamed Skill Space",space:"Skill Space",select:"Select Skill",selectAria:"Select Skill: {{skill}}",loadingSpaces:"Loading Skill Spaces",reload:"Reload",emptySpaces:"No Skill Spaces yet",skillList:"{{space}} Skill list",loadingSkills:"Loading Skills",emptySkills:"No Skills yet"},eme={modes:{auto:"Auto detect",text_to_video:"Text to video",reference_to_video:"Reference to video",video_editing:"Video editing",video_extension:"Video extension",first_last_frame:"First and last frames"},taskNames:{auto:"Video generation",text_to_video:"Text-to-video",reference_to_video:"Reference-to-video",video_editing:"Video editing",video_extension:"Video extension",first_last_frame:"First-and-last-frame generation"},controls:{label:"Video creation settings",aspectRatio:"Aspect ratio",selectAspectRatio:"Select aspect ratio",resolution:"Resolution",selectResolution:"Select resolution",duration:"Duration",durationShort:"{{count}}s",durationAria:"Video duration: {{count}} seconds",lastFrame:"Last frame",lastFrameHelper:"Add the video's ending frame",assistImage:"Supporting image",referenceImage:"Reference image",assistImageHelper:"Add visual guidance",imageHelper:"Supports common image formats",referenceVideo:"Reference video",videoHelper:"Supports common video formats",optional:"Optional",replace:"Replace",add:"Add",upload:"Upload {{label}}",replaceFile:"Replace {{label}}: {{name}}",removeFile:"Remove {{label}} {{name}}",storageUnavailable:"Persistent storage is not configured",loadingEnhancer:"Loading prompt enhancement model",enhancerHint:"Uses {{model}} for intent recognition and prompt enhancement",enhancerUnavailable:"Prompt enhancement model unavailable"},task:{title:"Video generation task",closeAria:"Close video generation task dialog",progressAria:"Video generation progress",optimizedPrompt:"Optimized prompt",processingAria:"{{task}} progress",waitingAria:"{{status}}, elapsed {{elapsed}}",elapsed:"Elapsed {{elapsed}}",previewAria:"Generated video preview",close:"Close",download:"Download video",retryOptimization:"Retry prompt optimization",retryGeneration:"Retry video generation",providerQueued:"Waiting for model scheduling",providerRunning:"Model generating",providerSubmitting:"Submitting task",queuedHint:"The task was submitted. Its status will update automatically when processing begins.",runningHint:"This may take several minutes. The video preview will appear here when complete.",backgroundHint:"You can close this dialog. The task will continue in the background.",successHint:"Your video is ready to preview or download.",activationHint:"Activate the service in the model console, then retry generation.",retryHint:"Fix the issue and retry the current step.",steps:{optimizationFailed:"Prompt optimization failed",optimizationDone:"Prompt optimization complete",optimizationActive:"Optimizing prompt",generationDone:"{{task}} complete",generationFailed:"{{task}} failed",generationQueued:"{{task}} queued",generationRunning:"Generating {{task}}",generationActive:"{{task}} in progress",generationPending:"Waiting for video generation",generationComplete:"Video generation complete"},elapsedHours:"{{hours}}h {{minutes}}m",elapsedMinutes:"{{minutes}}m {{seconds}}s",elapsedSeconds:"{{seconds}}s"}},tme={compactSelect:Kpe,featureNotice:Gpe,workspace:Xpe,mode:Ype,agentPicker:Zpe,skill:Jpe,video:eme},lVe=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:Zpe,compactSelect:Kpe,default:tme,featureNotice:Gpe,mode:Ype,skill:Jpe,video:eme,workspace:Xpe},Symbol.toStringTag,{value:"Module"})),nme="Review center",ime="Resource type to review",rme="Only administrators can access the review center",sme="Search name, submitter or version",ame="Review status",ome="Pending: {{count}}",lme="Requests: {{count}}",cme={skill:"Skills",agent:"Agents"},ume={all:"All statuses",pending:"Pending",approved:"Approved",returned:"Returned",approving:"Publishing"},dme={application:"Request",submitter:"Submitter",version:"Version",submittedAt:"Submitted at",status:"Status",actions:"Actions"},fme={details:"Details",detailsFor:"View request for {{name}}",approve:"Approve",approveFor:"Approve request for {{name}}",return:"Return",returnFor:"Return request for {{name}}",close:"Close",backToDetails:"Back to details",confirmApprove:"Confirm approval",confirmReturn:"Confirm return",clearFilters:"Clear filters",refresh:"Refresh",cancel:"Cancel",resumeApproval:"Resume publishing"},hme={title:"No review requests yet",description:"Submitted review requests will appear here",filteredTitle:"No matching requests",filteredDescription:"Try another search or change the review status"},pme={title:"Request details",sections:"Request detail sections",overview:"Overview",files:"Submitted files · {{count}}",requestType:"Request type",update:"Version update",firstRelease:"First release",source:"Source",source_skill:"{{name}}’s personal skill space",source_agent:"{{name}}’s development environment",destination:"Publication target",destination_skill:"Shared skill space",destination_agent:"Shared agent",region:"Region",visibility:"Visibility after publication",shared:"Visible to everyone",description:"Description",changes:"Submission notes",example:"Usage example",history:"Review history",submitted:"{{name}} submitted this request",versionFixed:"Reviewing the submitted version only",instructions:"Instructions",filesTab:"Submitted files",filesFailed:"Could not load submitted files",unknownAuthor:"Unknown submitter",reviewer:"Reviewed by",reviewedAt:"Reviewed at",approved:"{{name}} approved the request",returned:"{{name}} returned the request",unknownReviewer:"Unknown reviewer",approvedBy:"Approved by",returnedBy:"Returned by",comment:"Review comment",result:"Review result",noHistory:"This skill has not been submitted for review",pendingHint:"Waiting for an administrator to review",approvingHint:"Approval is confirmed and publishing to the shared space is in progress",approving:"{{name}} confirmed approval; publishing is in progress"},mme={failed:"The review space is unavailable",retry:"Retry"},gme={approveTitle:"Approve request",returnTitle:"Return request",approveDescription:"Approving {{name}} {{version}} makes this version available to everyone in the enterprise shared space",returnDescription:"Return {{name}} {{version}} and explain what the applicant should change",reason:"Return reason",reasonRequired:"Enter a return reason",reasonHelp:"Up to 256 characters, visible to the applicant",saving:"Saving…",failed:"Review failed, please try again",approved:"{{name}} was approved and shared",returned:"{{name}} was returned",comment:"Comment (optional)",commentHelp:"Up to 256 characters, visible to the applicant"},bme={title:"AI score",points:"{{score}} / 100",insufficient:"Insufficient evidence",status:{unscored:"Not scored",not_requested:"Not scored",queued:"Queued",running:"Scoring",completed:"Scored",failed:"Scoring failed"},loading:"Loading score…",starting:"Submitting for scoring…",loadFailed:"Could not load score",retryFailed:"Could not request scoring",failed:"Scoring failed, ask an administrator to retry",retry:"Score again",start:"Start scoring",reload:"Reload",download:"Download JSON",expand:"Expand",collapse:"Collapse",hint:"Scores apply to this submitted version and inform the administrator’s decision",dimensions:{safety:"Safety",usability:"Usability",completeness:"Completeness",reliability:"Reliability",maintainability:"Maintainability"},risks:"Risk flags",suggestions:"Suggestions",model:"Scoring model",rubric:"Rubric version",time:"Scored at",severity:{low:"Low risk",medium:"Medium risk",high:"High risk",critical:"Critical risk"},coverage:"Review coverage",coverageCount:"Reviewed {{included}} of {{total}} files",coverageIncomplete:"Some content was excluded, so scoring evidence is incomplete",omittedFile:"Not reviewed {{path}}: {{reason}}",truncatedFile:"Partially reviewed {{path}}: {{reason}}",originalError:"Original cloud error"},cVe={title:nme,category:ime,adminOnly:rme,search:sme,filterStatus:ame,pendingCount:ome,total:lme,kind:cme,status:ume,columns:dme,actions:fme,empty:hme,detail:pme,space:mme,decision:gme,score:bme},uVe=Object.freeze(Object.defineProperty({__proto__:null,actions:fme,adminOnly:rme,category:ime,columns:dme,decision:gme,default:cVe,detail:pme,empty:hme,filterStatus:ame,kind:cme,pendingCount:ome,score:bme,search:sme,space:mme,status:ume,title:nme,total:lme},Symbol.toStringTag,{value:"Module"})),yme={cancel:"Cancel",close:"Close",retry:"Retry",tryAgain:"Try again",closeDialog:"Close {{title}}",agentFallback:"{{agent}} Agent",unknownSource:"Unknown source"},vme={terminalTitle:"Terminal",browserTitle:"Sandbox browser",terminalSubtitle:"Connect to the interactive terminal for the current AgentKit Session",browserSubtitle:"View and control the browser in the current AgentKit Session",connecting:"Connecting…",connected:"Connected",notConnected:"Not connected",opening:"Opening {{title}}",connectingSession:"Connecting the tool to the current AgentKit Session.",openFailed:"Failed to open {{title}}"},xme={title:"Resume Codex conversation",subtitle:"Select a recently updated Thread from the current Sandbox Session",loading:"Loading conversation history",loadFailed:"Failed to load conversation history",empty:"No conversations to resume"},wme={title:"Codex permissions",subtitle:"Settings are saved to the current Sandbox Session and applied to all of its Threads",sandboxMode:"Sandbox mode",approvalPolicy:"Approval policy",approvalMethod:"Approval method",networkAccess:"Allow network access",networkAccessHelp:"Control external network access in workspace-write and read-only modes.",fullAccessWarning:"Full access disables file system and network isolation. Use it only for trusted tasks.",save:"Save permissions",sandboxChoices:{readOnly:{label:"Read only",detail:"Allow reading files without writing to the workspace."},workspaceWrite:{label:"Workspace write",detail:"Allow reading and modifying files in the current workspace."},fullAccess:{label:"Full access",detail:"Disable sandbox isolation for explicitly trusted tasks."}},approvalChoices:{untrusted:{label:"Untrusted commands only",detail:"Request approval only for operations Codex considers untrusted."},onRequest:{label:"On request",detail:"Allow Codex to ask you to approve commands or file changes when needed."},never:{label:"Never ask",detail:"Codex will not pause to request manual approval."}},reviewerChoices:{user:{label:"Ask me",detail:"Approval requests appear in Studio for you to decide."},autoReview:{label:"Automatic review",detail:"Use the Codex automatic review flow to handle approval requests."}}},kme={title:"Workspace",subtitle:"Choose the directory where the current Codex Thread runs commands and modifies files",absolutePath:"Absolute path",browse:"Browse",parent:"Parent directory",empty:"This directory has no subdirectories",locked:"The conversation has started and the workspace is locked. Start a new Sandbox Session to choose another workspace.",useDirectory:"Use this directory"},Ome={fileTitle:"Allow file changes?",commandTitle:"Allow command execution?",subtitle:"Codex is waiting for your decision",workingDirectory:"Working directory",decline:"Decline",acceptOnce:"Allow once",acceptSession:"Allow for session"},Sme={availableSkills:"Available Skills",selectModel:"Select model",commands:"Codex shortcuts",currentModel:"Current: {{model}}",loadingSkills:"Discovering Skills in the current workspace…",loadingModels:"Loading models…",noSkillMatches:"No matching Skills in the current workspace",noModelMatches:"No matching models. You can also enter a model ID directly",noCommandMatches:"No matching shortcuts",skillFallback:"Load and run this Skill",add:"Add",uploadImage:"Upload image",uploadDocument:"Upload document or PDF",uploadVideo:"Upload video",openTerminal:"Open terminal",viewBrowser:"View browser",permissions:"Codex permissions",workspaceLocked:"The conversation has started and the workspace is locked",selectWorkspace:"Select workspace",workspace:"Codex workspace",endpointCopied:"Endpoint copied",copyEndpoint:"Copy Sandbox Endpoint",continuePlaceholder:"Describe what you want to implement or adjust next",messagePlaceholder:"Message the AgentKit Sandbox. Type / for commands or $ to invoke a Skill…",stop:"Stop generating",send:"Send",stopping:"Confirming stop…",resume:"Resume task",steer:"Add instructions",steerPlaceholder:"Add instructions, or stop the task at any time…"},Eme={defaultName:"My Agent",namedDefault:"My {{agent}}",creatingTitle:"Creating {{agent}} Agent",failedTitle:"Launch failed",createTitle:"Create {{agent}} Agent",fallbackError:"AgentKit Sandbox initialization failed. Please try again later.",creatingDescription:"Creating the {{agent}} Agent and waiting for it to become ready. This usually takes about 30 seconds.",name:"Agent name",storageSize:"Storage size",storageHelp:"Data will be persisted. Choose {{min}}–{{max}} GiB.",persistent:"Persistent",persistenceUnsupported:"Snapshot persistence is not supported in the current environment",persistentHelp:"Keep Agent data so you can continue later.",temporaryHelp:"Agent data will be cleared after 8 hours",cancelCreation:"Cancel creation",confirm:"Create",retry:"Try again"},Cme={activeAria:"Codex Agent session is active",openAria:"Open a Codex Agent session",active:"Codex Agent session",entry:"Spark an idea",exit:"Exit current Agent",expired:"Expired",remainingHours:"{{hours}}h {{minutes}}m remaining",remainingMinutes:"{{minutes}}m remaining",expiryWarning:"The remote development environment is kept for up to 8 hours and expires at {{expiry}} ({{remaining}}). Conversations and files will then be deleted.",usingAgent:"You are currently using the {{agent}} Agent",activityAria:"Sandbox activity log",activity:"Activity log",tokenUsageAria:"Codex token usage",tokens:"{{label}}: {{value}} tokens",tokenLabels:{total:"Total",input:"Input",cachedInput:"Cached input",output:"Output",reasoningOutput:"Reasoning output"}},Ame={back:"Back to Agents",subtitle:"{{agent}} agent details",type:"Agent type",status:"Status",createdBy:"Created by",snapshotStatus:"Snapshot status",toolType:"Tool type",createdAt:"Created at",snapshotReason:"Snapshot reason",expiresAt:"Expires at",snapshotId:"Snapshot ID",sessionId:"Session ID",sourceSessionId:"Source Session ID",delete:"Delete Agent",waking:"Waking…",opening:"Opening…",wake:"Wake Agent",open:"Open Agent",deleteTitle:"Delete Agent?",deleteDescription:"Delete “{{name}}” and its saved data? This cannot be undone.",deleting:"Deleting…",confirmDelete:"Delete",sleepingHint:"This agent is asleep. Waking it before opening may take some time.",wakingHint:"Waking the agent. This may take some time.",agentId:"Agent ID"},Tme={back:"Back to Agents",createdBy:"Created by {{creator}}",ariaLabel:"Agent workspace",main:"Main",terminal:"Terminal",mainTitle:"{{agent}} main interface",openingTerminal:"Opening terminal…",terminalTitle:"{{agent}} terminal"},_me={prompt:`Use the AgentKit Studio Plugin to hand off the current conversation, project, and task to the cloud. Execute this directly; do not ask me to open a terminal manually. +- Maintain a polite, professional tone.`},Vfe={requestFailed:"Request failed ({{status}}){{detail}}",a2aSpaces:{credentialsMissing:"The server does not have cloud provider credentials configured, so AgentKit agent centers are unavailable",loginRequired:"Sign in to access AgentKit agent centers"},vikingKnowledge:{credentialsMissing:"The server does not have cloud provider credentials configured, so VikingDB knowledge bases are unavailable",loginRequired:"Sign in to access VikingDB knowledge bases"},vikingMemory:{credentialsMissing:"The server does not have cloud provider credentials configured, so VikingDB memory stores are unavailable",loginRequired:"Sign in to access VikingDB memory stores"},mcpGateway:{missingHttpTool:"Go back to Add MCP tool and add at least one HTTP MCP service. MCP resilience does not support stdio services.",missingUrl:"An HTTP MCP tool is missing a valid service URL. Go back to Add MCP tool and complete it before publishing."},customModel:{fallbackName:"Custom model",apiKeyLabel:"{{name}} model API Key",fallbackApiKeyLabel:"{{name}} fallback model {{model}} API Key"},deploymentEnv:{serverInjected:"Provided by the server",selectedApiKeyPlaceholder:"Provided by the selected API Key",mcpInjectedComment:"Provided by the added MCP tools",restoredPlaceholder:"Securely restored by the Studio server",generatedMcpPlaceholder:"Generated from the added HTTP MCP tools",restoredHelp:"When updating, the Studio server merges MCP addresses and authentication without returning existing secrets to the browser.",mergedMcpHelp:"The Studio server merges MCP addresses and optional authentication without returning existing secrets to the browser.",listSeparator:", ",requirementHint:"Required by the following optimizations: {{labels}}.",requiredBy:"Required by the following optimizations: {{labels}}. Enter {{key}}.",required:"Enter {{label}} ({{key}}).",invalidJson:"Invalid JSON format"},drafts:{unsupportedVersion:"This local draft version is not supported. Upgrade Studio and try again.",invalidFormat:"The local draft data is invalid.",readFailed:"Could not read local drafts. The browser data may be corrupted.",quotaExceeded:"Browser storage is full, so the draft was not saved. Delete unused drafts or clear this site's storage, then try again.",writeRejected:"The browser blocked saving this draft. Check the site's storage permissions and try again."},skills:{searchFailed:"Search failed ({{status}})",downloadFailed:"Skill download failed ({{status}})",agentKitRequestFailed:"AgentKit Skills request failed",missingManifest:"{{location}} is missing SKILL.md",invalidParentPath:"{{location}} contains an invalid parent path (..): {{path}}",invalidPath:"{{location}} contains an invalid path: {{path}}",localDescription:"Local skill",folderSource:"Folder",noManifest:"No SKILL.md was found in {{location}}"},zip:{invalid:"Invalid zip: EOCD was not found",tooManyFiles:"A zip file cannot contain more than {{count}} files",tooLarge:"The extracted zip content is too large"}},Hfe={back:"Back to development session",runtimeName:"Runtime name",runtimeNameExists:"This Runtime name already exists. Choose another name.",checkingRuntimeName:"Checking Runtime name",verifiedSource:"Verified source",deployableSource:"Deployable source",verifiedByCodex:"Verified by Codex in the cloud",entryPoint:"Entry point",files:"Files",artifact:"Artifact",validationReport:"Validation report",verifiedHint:"The server materializes source from the verified artifact. Browser files cannot replace it.",unverifiedHint:"The server securely materialized the source. Confirm the Runtime configuration before deploying.",env:{requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}"}},qfe={name:"Code package",back:"Back to creation methods",reading:"Reading the code package",readingEllipsis:"Reading the code package…",uploadFirst:"Upload a code package first",uploadAriaLabel:"Code package upload",upload:"Upload code package",reupload:"Upload a different code package",uploadPrompt:"Upload a code package",filesRecognized:"{{count}} files found. Select this area to upload a different package.",dropHint:"Select or drop a .zip file up to 50 MB. Use app.py or declare an entry point in agentkit.yaml.",viewFiles:"View files",chooseFile:"Choose code package",errors:{invalidFormat:"Choose a .zip code package.",tooLarge:"The code package must be 50 MB or smaller.",invalidPath:"The archive contains an invalid path: {{name}}",empty:"The archive does not contain any deployable files.",tooManyFiles:"A code package cannot contain more than {{count}} files.",duplicateFile:"The code package contains a duplicate file: {{path}}",manifestParse:"Could not parse agentkit.yaml: {{detail}}",manifestRoot:"The root of agentkit.yaml must be an object.",manifestCommon:"common in agentkit.yaml must be an object.",entryPointType:"common.entry_point in agentkit.yaml must be a file path.",entryPointInvalid:"common.entry_point in agentkit.yaml is not a valid file path.",entryPointMissing:"The entry point declared in agentkit.yaml is missing from the code package: {{entryPoint}}",defaultEntryPointMissing:"The code package root must contain app.py, or common.entry_point in agentkit.yaml must declare an existing entry point."}},Wfe={label:"Agent execution canvas",readOnlyLabel:"Read-only agent execution canvas",minimapLabel:"Execution flow minimap",controls:{ariaLabel:"Execution flow controls",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Fit view"},rootAgent:"Main agent",unnamedStep:"Unnamed step",terminals:{input:"User request",output:"Final response"},edges:{then:"Then",continueLoop:"Continue loop",call:"Call"},patterns:{llm:{label:"Agent",description:"Understand a task and complete one specific job"},sequential:{label:"Sequential",description:"Run internal steps one after another"},parallel:{label:"Parallel",description:"Run internal steps together, then combine their results"},loop:{label:"Loop",description:"Repeat internal steps until the stop condition is met"},a2a:{label:"Remote agent",description:"Call an existing remote agent"}},actions:{insertHere:"Insert a step here",deleteNamed:"Delete {{name}}",deleteNode:"Delete node",addSubagent:"Add subagent",addParallelStep:"Add a parallel step",addLoopStep:"Add a loop step",addNextStep:"Add next step",addFirst:"Add at the beginning",addLast:"Add at the end"}},Kfe={title:"Intelligent build",subtitle:"Describe what you need. Build, debug, and validate your agent.",model:{label:"Model",placeholder:"Select a model",retiring:"Retiring soon",currentConfiguration:"Current configuration",loadError:"Failed to load models"},availability:{checking:"Checking intelligent development availability…",unavailable:"Intelligent mode is currently unavailable. Go back and try again."},goal:{title:"Start with a goal",continueTitle:"Continue improving the project",hint:"Describe the problem your agent should solve. We will ask about any details that could affect the result.",continueHint:"Describe what you want to change. The result will be saved as a new version.",basedOn:"Based on",clearSelection:"Clear selection",label:"Goal",optimizationLabel:"Optimization goal",placeholder:"For example: Build an agent that reads sales data, creates weekly reports, and validates the output format",optimizationPlaceholder:"For example: Cite data sources and ask the user when information is incomplete"},actions:{preparing:"Preparing…",build:"Start building",optimize:"Start optimizing"},preparation:{accepted:"Goal received. Implementation is starting now.",preparing:"Creating the task environment…",starting:"Environment ready. Starting Codex…",next:"Next, Codex will plan the approach, then build, run, and validate the agent."},tasks:{title:"Tasks in progress",hint:"Work continues when you leave. Return to follow progress or add instructions.",refresh:"Refresh tasks",loading:"Loading tasks…",empty:"No tasks in progress",emptyHint:"Once a build starts, you can return to it here.",loadError:"Unable to load tasks. Please retry.",openError:"Unable to open this task. Please retry.",startedAt:"Started {{time}}",open:"Open task",opening:"Connecting…",states:{queued:"Queued",running:"Building",recovering:"Reconnecting",waiting_user:"Awaiting your reply",stopping:"Stopping",succeeded:"Completed",failed:"Incomplete",cancelled:"Stopped"}}},Gfe={title:"Saved projects",description:"Continue improving an existing version, or view, download, and deploy its source.",refresh:"Refresh projects",checkingStorage:"Checking project storage…",unavailableTitle:"Projects are temporarily unavailable",storageCheckError:"Could not confirm project storage status. Try again shortly.",storageNotConfigured:"Project storage is not configured.",loadingMigrated:"Loading migrated projects…",loadingSaved:"Loading saved projects…",loadingVersions:"Loading project versions…",unknownTime:"Unknown time",sourceDownloaded:"Source downloaded.",projectSummary_one:"{{count}} version · Updated {{time}}",projectSummary_other:"{{count}} versions · Updated {{time}}",versionSummary_one:"{{time}} · {{count}} file",versionSummary_other:"{{time}} · {{count}} files",noVersionDescription:"No version description",latestVersion:"Latest version",defaultVersionName:"Version · {{time}}",rename:{projectTitle:"Edit project name",versionTitle:"Edit version name",projectLabel:"Project name",versionLabel:"Version name",hint:"Use letters, numbers and common punctuation, up to {{max}} characters.",required:"Enter a name.",tooLong:"Names can contain up to {{max}} characters.",invalidCharacters:"Names cannot contain line breaks, control or invisible formatting characters, or < >.",save:"Save name",saving:"Saving…",updated:"Name updated.",failed:"Unable to save the name. Try again."},verified:"Verified",pendingVerification:"Needs review",viewSource:"View source",download:"Download",downloading:"Downloading…",optimize:"Optimize",optimizeUnavailable:"Optimize, not supported",errors:{projects:"Could not load saved projects.",source:"Could not load project source.",versions:"Could not load project versions.",download:"Could not download the source.",prepareDeployment:"Could not prepare the source for deployment.",deleteVersion:"Could not delete the project version.",migrated:"Could not load migrated projects",saved:"Could not load saved projects"},empty:{migratedTitle:"No migrated projects yet",savedTitle:"No saved projects yet",migratedDescription:"Source will be saved here after your first migration.",savedDescription:"Source will be saved here after your first build.",noVersions:"This project has no available versions."},compare:{selected:"{{count}}/2 selected",selectedLabel:"Selected",select:"Select",view:"View comparison",start:"Compare versions"},delete:{title:"Delete this version?",onlyVersion:"“{{name}}” has only one version. Deleting it will also remove the project. This cannot be undone.",description:"This version's source and validation records will be permanently deleted. Other versions are not affected.",confirm:"Delete version"}},Xfe={title:"Choose how to create",subtitle:"Build your agent with the workflow that fits your needs",features:"Features",quick:{title:"Quick mode",description:"Delegate tasks to dynamically created subagents",features:{dynamicSubagents:"Dynamic subagents",autonomousPlanning:"Autonomous planning",collaboration:"Multi-agent collaboration",summary:"Automatic result summaries",skills:"Skills on demand",trace:"Traceable task execution"}},traditional:{title:"Advanced mode",description:"Customize your agent structure in detail",features:{visualConfig:"Visual configuration",migration:"Existing agent migration",debugging:"Live debugging",optimization:"Optional optimization",parameters:"Fine-grained controls"}}},Yfe={placeholder:"Enter a system prompt. Type ## followed by a space to add a level-two heading…",toolbar:{undo:"Undo {{shortcut}}",redo:"Redo {{shortcut}}",paragraph:"Paragraph",quote:"Quote",heading:"Heading {{level}}",selectBlockType:"Select text style",blockType:"Text style",bold:"Bold",removeBold:"Remove bold",italic:"Italic",removeItalic:"Remove italic",bulletedList:"Bulleted list",numberedList:"Numbered list"}},Zfe={local:{duplicatesSkipped:"Skipped duplicate skills: {{names}}",invalidDrop:"Drop a folder containing SKILL.md or a .zip file",readError:"Could not read the files: {{detail}}",dropLabel:"Drop a folder or ZIP file to detect skills automatically",hint:"Each skill must contain a SKILL.md file. Directories can contain multiple skills.",reading:"Reading files…",fileCount:"Local · {{count}} files"},hub:{searchError:"Search failed. Try again shortly.",searchPlaceholder:"Search Volcano Find Skill, such as data analysis or PDF",search:"Search",searching:"Searching…",noResults:"No matching skills found. Try another keyword.",hint:"Search Volcano Find Skill by keyword. Selected skills are downloaded to the skills/ directory when the project is generated."},space:{loadError:"Failed to load",loadingSpaces:"Loading AgentKit Skills centers…",noSpaces:"This account has no AgentKit Skills centers.",selectSpace:"Select an AgentKit Skills center",openConsole:"Open in the Volcano Engine console",loadingSkills:"Loading skills…",noSkills:"This AgentKit Skills center has no skills."}},Jfe={unnamedNode:"Unnamed node",editInstruction:"Select to edit instructions…",controls:{ariaLabel:"Workflow canvas controls",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Fit view"},sections:{info:"Workflow information",execution:"Execution mode",nodes:"Nodes",nodeConfig:"Node configuration"},types:{sequential:{label:"Sequential",description:"Run nodes one after another"},parallel:{label:"Parallel",description:"Run nodes at the same time"},loop:{label:"Loop",description:"Run nodes repeatedly"}},placeholders:{description:"Describe what this workflow does…",agentDescription:"Describe what this agent does…",instruction:"You are…"},errors:{workflowNameUnique:"The workflow name must be unique among agent node names",agentNameUnique:"Agent names must be unique within this workflow"},dragHint:"Drag onto the canvas, or use the button below",agentNode:"Agent node",addNode:"Add node",connectHint:"Drag between node handles to define the execution order.",create:"Create workflow",deleteNode:"Delete node",nameHelp:"Use only letters, numbers, and underscores. Names must be unique.",instruction:"Instructions",tools:"Tools (comma-separated)",nodeId:"Node ID",empty:{selectNode:"Select a node to edit its configuration",summary:"{{nodes}} nodes · {{edges}} connections"}},ehe={ariaLabel:"Quick mode creation",progress:"Quick mode creation progress",steps:{agent:{label:"Agent",title:"Basic information",description:"Set the agent's name, purpose, behavior, and capabilities"},environment:{label:"Environment",title:"Configure the environment",description:"Choose the default environment or a custom environment you have built"},deployment:{label:"Deployment",title:"Deployment preferences",description:"Configure AgentKit cloud settings"}},model:{label:"Model",source:"Model source",name:"Model name",fallbacks:"Fallback models",fallbackPlaceholder:"Fallback model name",addFallback:"Add fallback model",addProviderFallback:"Add other provider",removeFallback:"Remove",fallbackType:"Fallback model type",fallbackSameProvider:"Same provider",fallbackOtherProvider:"Other provider",apiKeyEnv:"API Key environment variable",invalidApiKeyEnv:"Use letters, numbers, and underscores only, and do not start with a number.",fallbackHelp:"Same-provider fallbacks reuse the primary connection. Other providers use separate provider, API base, and API Key settings.",fallbackIgnored:"Empty, duplicate, or primary-model entries will be ignored.",provider:"Provider",invalidApiBase:"Enter a valid http:// or https:// URL.",volcengineArk:"Volcano Ark",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",currentApiKey:"Current API Key",currentConfiguration:"Current configuration",loadingApiKeys:"Loading API Keys",selectApiKey:"Select an API Key",searchApiKeys:"Search API Key names",noApiKeys:"No API Keys available",loadingModels:"Loading models",selectModel:"Select a model",searchModels:"Search by name, Model ID, or provider",noModels:"No models available",apiKeyPlaceholder:"Enter a model API Key",credentialsLoadError:"Failed to load model credentials",modelsLoadError:"Failed to load models"},identity:{unnamedPool:"Unnamed user pool",currentPool:"{{value}} (current user pool)",userPool:"User pool",loading:"Loading user pools",placeholder:"Select a user pool",search:"Search user pools",empty:"This account has no Identity user pools",currentHint:"This Studio's login JWT will be forwarded to the Runtime",mismatchHint:"The selected user pool is not used by this Studio, so the Studio will not be able to call the Runtime after deployment",selectionHint:"The user pool used by this Studio is marked in the list"},agent:{namePlaceholder:"Enter an agent name",descriptionPlaceholder:"Describe what this agent can do",prompt:"Prompt",promptPlaceholder:"Define the role, goals, and behavior boundaries",skills:"Skills",addSkill:"Add skills"},validation:{descriptionRequired:"Enter a description",promptRequired:"Enter a prompt",modelRequired:"Select a model",apiKeyRequired:"Enter or select the model API Key",instanceIntegers:"Minimum instances must be an integer of 0 or greater, and maximum instances must be an integer greater than 0",instanceOrder:"Minimum instances cannot exceed maximum instances",userPoolRequired:"Select a user pool for Runtime authentication"},deployment:{runtimeName:"Runtime name",runtimeNameUpdateHint:"The existing Runtime name is preserved during updates",runtimeNameHint:"Use only letters, numbers, underscores, and hyphens",region:"Deployment region",authentication:"Authentication",apiKeyDescription:"Default: access with the Runtime API Key",userPoolDescription:"Use a JWT issued by an Identity user pool",sessionStorage:"Session storage",inMemoryStorage:"Temporary in-memory storage",backends:{sqlite:"SQLite file",mysql:"MySQL",postgresql:"PostgreSQL"},instances:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",inMemoryHint:"To prevent session loss across instances, keep the Runtime at 1–1 instances",networkMode:"Network mode",network:{public:"Public",private:"Private",both:"Public and private"},subnetIds:"Subnet IDs (optional, comma-separated)",sharedInternet:"Shared public egress in the VPC",sharedInternetHint:"Allow private Runtimes to access the public internet through shared egress",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",evaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment",resources:"Resource configuration",complete:"Deployment complete",preparing:"Preparing deployment…"},environmentVariables:{title:"Environment variables",add:"Add variable",nameAriaLabel:"Environment variable name",valueAriaLabel:"Value for {{name}}",deleteNamed:"Delete {{name}}"},actions:{updateAgain:"Update again",deployAgain:"Deploy again",updateAndPublish:"Update and publish",applyProfile:"Apply Profile",applyProfileAgain:"Apply Profile again"}},the={actions:{addSubagent:"Add subagent",clearRoot:"Clear main agent",clearRootConfirmation:"Clear all settings and subagents from the main agent? This cannot be undone."},workspace:{progress:"Agent creation progress",modes:{build:"Build",validate:"Debug",optimize:"Optimize",environment:"Environment",publish:"Publish"},titles:{build:"Customize your agent architecture",validate:"Debug your agent",optimize:"Choose optimizations for your agent",environment:"Configure the cloud environment",publish:"Prepare your agent for deployment"}},sections:{type:{label:"Agent type",hint:"Choose an agent type"},basic:{label:"Basic information",hint:"Name, description, and system prompt"},model:{label:"Model",hint:"Model and service (optional)"},tools:{label:"Tools",hint:"Callable capabilities"},skills:{label:"Skills",hint:"Declarative skills"},knowledge:{label:"Knowledge base",hint:"External knowledge retrieval"},memory:{label:"Memory",hint:"Short-term and long-term memory"},subagents:{label:"Subagents",hint:"Nested collaboration"},review:{label:"Finish",hint:"Preview and create"}},agentTypes:{ariaLabel:"Agent type",remoteChildOnly:"Remote agents can only be used as child steps",llm:{label:"Agent",fullLabel:"LLM agent",description:"Uses an LLM to complete tasks autonomously"},sequential:{label:"Sequential",fullLabel:"Sequential agent",description:"Runs subagents one after another"},parallel:{label:"Parallel",fullLabel:"Parallel agent",description:"Runs subagents in parallel, then combines their results"},loop:{label:"Loop",fullLabel:"Loop agent",description:"Repeats subagents until the stop condition is met"},a2a:{label:"Remote agent",fullLabel:"Remote agent",description:"Calls a remote agent through the A2A protocol"}},basic:{agentName:"Agent name",name:"Name",agentDescription:"Agent description",descriptionPlaceholder:"Briefly describe what this agent does so your team can identify it…",nameHelp:"Follow Google ADK naming rules and keep the name unique in the execution flow.",rootDescriptionHelp:"The full description is preserved and converted to a Runtime-compatible single line during deployment.",descriptionHelp:"The description appears in agent lists and selectors.",orchestratorHelp:"This is a collaboration container and does not answer directly. Add task steps on the canvas and drag them to reorder.",maxIterations:"Maximum iterations",maxIterationsHelp:"The loop repeats its subagents until the condition is met or this limit is reached.",agentCenter:"AgentKit agent center",agentCenterHelp:"The remote agent's name, description, and capabilities come from the Agent Card returned by the center. The system discovers and attaches matching agents for each task.",moreOptions:"More options",systemPrompt:"System prompt",loadingMarkdown:"Loading Markdown editor…",markdownHelp:"Markdown shortcuts are supported. For example, type ## followed by a space to create a level-two heading.",unnamed:"Unnamed",unnamedAgent:"Unnamed agent"},validation:{remoteRoot:"A remote agent can only be a subagent",missingRegistry:"Select an AgentKit agent center",name:{required:"Name is required",reserved:"user is reserved by Google ADK. Choose another name.",characters:"Start with a letter or underscore and use only letters, numbers, and underscores"},duplicateName:"Agent names must be unique within this structure",missingDescription:"Description is required",mcpDuplicateName:"MCP names must be unique",mcpDuplicateUrl:"Remove the duplicate MCP endpoint before publishing",missingSubagent:"A subagent is required",missingPrompt:"System prompt is required",apiKeyRequired:"Enter or select the model API Key",missingSubagentDetail:"Add at least one subagent to {{type}} before debugging or publishing.",problem:"{{name}}: {{problem}}"},ai:{ariaLabel:"Fill agent configuration with AI",minimumLength:"Enter at least {{count}} characters.",replaceConfirmation:"The generated configuration will replace the current canvas and settings. Continue?",placeholder:"Describe your goal and use {{model}} to generate the configuration",generate:"Generate",generating:"Generating",success:"Configuration generated",regenerate:"Generate again",failed:"Generation failed"},debug:{ariaLabel:"Agent debugging workspace",unavailable:"This backend does not currently support generated-agent debug runs.",baseline:"Baseline",comparison:"Variant {{count}}",selectModel:"Select a model",enterDescription:"Enter a description",enterPrompt:"Enter a system prompt",duplicateConfiguration:"Test configurations must be unique",starting:"Starting…",applyAndRestart:"Apply and restart",restart:"Restart",start:"Start environment",defaultModel:"Default model",testConfiguration:"Test configuration",deleteVariant:"Delete {{name}}",deleteVariantGroup:"Delete comparison variant",creatingEnvironment:"Creating the test environment…",configurationChanged:"The configuration changed. Restart the environment.",ready:"Environment ready",readyHint:"Send a message to compare agent responses.",startHint:"Complete the configuration, then start the environment.",viewTraceNamed:"View the trace for {{name}}",traceUnavailable:"Send a message to view its trace",trace:"Trace",useConfiguration:"Use this configuration",finishConfiguration:"Finish configuration",finishAndStart:"Finish and start",currentAgentModel:"Current agent model",configurationHint:"Changes apply only to this comparison. Select this configuration to continue to deployment.",messagePlaceholder:"Send a message to the running test environments…",startOneFirst:"Start at least one test environment first",addVariant:"Add variant",traceTitle:"Trace · {{name}}",leaveTitle:"Leave debugging?",leaveDescription:"The current environments will be removed when you leave. You can start new environments when you return.",cleaning:"Cleaning up…",confirmLeave:"Leave",closeLeaveConfirmation:"Close leave-debugging confirmation"},optimization:{ariaLabel:"Agent optimization options",scenario:"Optimization scenario",components:"Optimization components",bytePlusUnavailable:"Harness Sidecar optimizations are not available for BytePlus accounts yet. Leave all optimizations unselected to continue; regular BytePlus agents are not affected.",releaseScenario:"Optimization scenario: {{profile}}",profiles:{default:{label:"Custom",description:"Choose components as needed. The Sidecar stays off when none are selected."},ops:{label:"Operations",description:"For operations diagnostics, databases, logs, and monitoring MCP servers."}},groups:{quality:"Improve response quality",cost:"Reduce runtime cost",stability:"Improve runtime stability"},options:{context_engine:{label:"Context management",description:"Manage context assembly, task anchoring, and context budgets."},compressor:{label:"Context and result compression",description:"Compress long context and large tool results to reduce token usage."},verifier:{label:"Response verification and repair",description:"Verify evidence and responses, then repair or alert on failure."},long_run_control:{label:"Goal task control",description:"Manage progress, continuation, and completion conditions for Goal tasks."},mcp_resilience:{label:"MCP resilience",description:"Manage connections, timeouts, empty results, large responses, and call budgets. Includes read-only SQL protection by default."}}},model:{label:"Model",source:"Model source",volcanoArk:"Volcano Ark",volcengineArk:"Volcano Ark",bytePlusModelArk:"BytePlus ModelArk",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",configuration:"Model configuration",name:"Model name",fallbacks:"Fallback models",fallbackPlaceholder:"Fallback model name",addFallback:"Add fallback model",addProviderFallback:"Add other provider",removeFallback:"Remove",fallbackType:"Fallback model type",fallbackSameProvider:"Same provider",fallbackOtherProvider:"Other provider",apiKeyEnv:"API Key environment variable",invalidApiKeyEnv:"Use letters, numbers, and underscores only, and do not start with a number.",fallbackHelp:"Same-provider fallbacks reuse the primary connection. Other providers use separate provider, API base, and API Key settings.",fallbackIgnored:"Empty, duplicate, or primary-model entries will be ignored.",provider:"Provider",invalidApiBase:"Enter a valid http:// or https:// URL.",liteLlmProviders:"LiteLLM providers",apiKeyPlaceholder:"Enter the model API Key",available:"Available",retiring:"Retiring soon",notActivated:"Not activated",unavailable:"Unavailable",apiKeyLoadError:"Failed to load Ark API Keys",loadingApiKeys:"Loading API Keys…",selectApiKey:"Select an API Key",currentApiKey:"Current API Key",apiKeyList:"API Key list",searchApiKey:"Search API Keys",searchApiKeyName:"Search API Key names",noApiKeys:"No API Keys available",noMatchingApiKey:"No matching API Keys",loading:"Loading models…",loaded:"{{count}} models loaded",loadError:"Failed to load models",selectModel:"Select a model",selectProviderModel:"Select a provider model",providerModels:"Provider models",search:"Search models",searchPlaceholder:"Search by name, Model ID, or provider",noMatches:"No matching models",empty:"No models available",unknownStatus:"Unknown status",refresh:"Refresh",refreshing:"Refreshing…",activate:"Activate",activateAction:"Open activation",currentConfiguration:"Current configuration"},tools:{builtIn:"Built-in tools",builtInHelp:"Select VeADK capabilities. Imports and required environment variables are added automatically.",codeExecution:"Code execution configuration",codeExecutionHelp:"Select the AgentKit code execution sandbox.",mcp:"MCP tools"},catalog:{web_search:{label:"Web search",description:"Get real-time information with Volcengine Web Search."},parallel_web_search:{label:"Parallel web search",description:"Run multiple search queries in parallel and combine the results faster."},link_reader:{label:"Link reader",description:"Fetch and read the main content from a URL."},web_scraper:{label:"Web scraper",description:"Crawl webpages into structured data. Requires the Scraper service."},image_generate:{label:"Image generation",description:"Generate images from text with Doubao Seedream."},image_edit:{label:"Image editing",description:"Edit or transform images with Doubao SeedEdit."},video_generate:{label:"Video generation",description:"Generate videos from text or images with Doubao Seedance, including task status queries."},text_to_speech:{label:"Text to speech (TTS)",description:"Convert text to speech with Volcengine Speech."},run_code:{label:"Code execution",description:"Run code in a sandbox."},vesearch:{label:"VeSearch",description:"Search with Volcengine VeSearch. Requires a bot endpoint."},links:{console:"Console",documentation:"Documentation"},env:{modelAgentName:{comment:"Model name"},embeddingModelName:{comment:"Embedding model required by memory and knowledge bases"},vikingMemoryProject:{comment:"VikingDB memory project"},vikingMemoryRegion:{comment:"VikingDB memory region"},vikingMemoryType:{comment:"Memory types"},feishuAppId:{comment:"Feishu app ID"},feishuAppSecret:{comment:"Feishu app secret",placeholder:"Enter the app secret"},registrySpaceId:{comment:"AgentKit agent center",placeholder:"Select an agent center"},registryTopK:{comment:"Number of agents to retrieve"},registryRegion:{comment:"AgentKit agent center region"},registryEndpoint:{comment:"AgentKit agent center OpenAPI endpoint"},agentKitToolId:{comment:"Code execution sandbox ID"},agentKitToolRegion:{comment:"AgentKit Tools region"},openVikingUrl:{comment:"OpenViking service URL"},openVikingMemoryUserId:{comment:"Memory owner ID",help:"The user segment in viking://user//peers//memories. Use it to isolate agents, tenants, or business scenarios. The default is default."},openVikingMemoryPolicy:{comment:"Memory policy",help:"Controls memory extraction and isolation. Leave it blank to use the official default policy."},openVikingKnowledgeUserId:{comment:"Knowledge base owner ID",help:"Used in the default path viking://user//resources// when no resource directory is configured. The default is default."},openVikingTargetUri:{comment:"Knowledge base resource directory",help:"Leave blank to generate it from the KnowledgeBase index. When provided, this OpenViking resource directory takes precedence."},tlsServiceName:{comment:"TLS topic_id. Leave blank to create one automatically"}}},backends:{shortTerm:{local:{label:"In-memory",description:"Stored in the process without persistence. Best for development and debugging."},sqlite:{label:"SQLite file",description:"Persist data to a local .db file."},mysql:{label:"MySQL",description:"Persist data to MySQL."},postgresql:{label:"PostgreSQL",description:"Persist data to PostgreSQL."}},longTerm:{local:{label:"Local vector store",description:"In-process llama-index vector store."},opensearch:{label:"OpenSearch",description:"Vector retrieval with OpenSearch."},redis:{label:"Redis",description:"Vector retrieval with Redis."},viking:{label:"VikingDB Memory",description:"VikingDB memory with user profile support."},openviking:{label:"OpenViking Memory",description:"Long-term memory that stores and retrieves preferences, events, and entities per user."},mem0:{label:"Mem0",description:"Managed memory from Mem0."}},knowledge:{viking:{label:"VikingDB Knowledge",description:"VikingDB knowledge base."},opensearch:{label:"OpenSearch",description:"Vector retrieval with OpenSearch."},context_search:{label:"Context Search",description:"Volcengine Context Search without embedding configuration."},openviking:{label:"OpenViking Knowledge",description:"OpenViking resource-directory knowledge base without embedding configuration."}}},exporters:{apmplus:{label:"APMPlus",description:"Volcengine APMPlus application performance monitoring."},cozeloop:{label:"CozeLoop",description:"Distributed tracing with CozeLoop."},tls:{label:"TLS (Log Service)",description:"Export logs to Volcengine TLS."}},knowledge:{title:"Knowledge base",description:"Enable external knowledge retrieval (RAG) so the agent can answer from your data.",backend:"Knowledge base backend",vikingDatabase:"VikingDB knowledge base"},memory:{shortTerm:"Short-term memory",shortTermDescription:"Store context for one session",shortTermBackend:"Short-term memory backend",longTerm:"Long-term memory",longTermDescription:"Store context across sessions, usually with vector retrieval",longTermBackend:"Long-term memory backend",vikingDatabase:"VikingDB memory",autoSave:"Save sessions to long-term memory automatically",autoSaveDescription:"Write session content to long-term memory when a session ends."},mcp:{removeTool:"Remove MCP tool",namePlaceholder:"Name (optional)",urlPlaceholder:"MCP service URL",pathWarning:"This is a gateway root address. Use it only when the root path is the MCP endpoint; otherwise include the complete service path.",tokenPlaceholder:"Bearer token (optional)",showToken:"Show Bearer token",hideToken:"Hide Bearer token",commandPlaceholder:"Command, such as npx",argsPlaceholder:"Arguments separated by spaces",stdioHint:"The stdio tool starts in the deployment environment. Make sure its command and dependencies are available.",addTool:"Add MCP tool"},resources:{unnamedAgentCenter:"Unnamed agent center",unnamedKnowledgeBase:"Unnamed knowledge base",unnamedMemory:"Unnamed memory store",loadError:"Failed to load",loadingAgentCenters:"Loading agent centers…",agentCentersLoaded:"{{count}} agent centers loaded",noAgentCenters:"No agent centers available",noMatchingAgentCenters:"No matching agent centers",searchAgentKitCenter:"Search AgentKit agent centers",searchNameOrId:"Search by name or ID",selectAgentCenter:"Select an agent center",selectAgentKitCenter:"Select an AgentKit agent center",selectedAgentCenter:"Selected agent center",agentKitCenter:"AgentKit agent center",refreshAgentCenters:"Refresh agent centers",knowledgeBaseList:"Knowledge base list",knowledgeBasePlaceholder:"Select a knowledge base",loadingKnowledgeBases:"Loading knowledge bases…",knowledgeBasesLoaded:"{{count}} knowledge bases loaded",noKnowledgeBases:"No knowledge bases available",noMatchingKnowledgeBases:"No matching knowledge bases",searchKnowledgeBase:"Search knowledge bases",selectKnowledgeBase:"Select a knowledge base",refreshKnowledgeBases:"Refresh knowledge bases",memoryList:"Memory store list",memoryPlaceholder:"Select a memory store",loadingMemories:"Loading memory stores…",memoriesLoaded:"{{count}} memory stores loaded",noMemories:"No memory stores available",noMatchingMemories:"No matching memory stores",searchMemory:"Search memory stores",selectMemory:"Select a memory store",refreshMemories:"Refresh memory stores"},env:{noAdditionalParameters:"This backend needs no additional runtime parameters.",invalidJson:"Enter valid JSON.",helpAriaLabel:"Help for {{label}}: {{help}}",openOpenViking:"Open OpenViking {{label}}",valuePlaceholder:"Enter a value",openVikingIndex:"OpenViking resource index",openVikingIndexHelp:"Leave blank to generate an index from the agent name, such as my_agent_kb. Without DATABASE_OPENVIKING_TARGET_URI, the default URI is viking://user/{knowledge base owner ID, or default}/resources/{resource index}/. When DATABASE_OPENVIKING_TARGET_URI is set, that complete URI is used instead.",openVikingIndexAriaLabel:"OpenViking resource index help: {{help}}"},deployment:{vpcRequired:"Enter a VPC ID when using VPC networking.",apiKeyRequired:"Select the API Key used by the model.",invalidEnvName:"Invalid environment variable name: {{key}}",requiredEnv:"{{name}}: enter this required environment variable",generatingConfiguration:"Generating deployment configuration",runtimeNameExists:"This Runtime name already exists. Choose another name and try again.",preparing:"Preparing deployment",applyingMpaProfile:"Applying the Agent profile to MPA Runtime",mpaProfileApplied:"MPA Runtime profile applied",runningMpaSmoke:"Verifying the MPA Runtime execution path",mpaReady:"MPA Runtime is ready",mpaOperationIncomplete:"MPA Runtime setup did not complete. Retry this deployment task.",complete:"Deployment complete",failed:"Deployment failed",updateAndPublish:"Update and publish",stages:{build:"Build image",deploy:"Deploy Runtime",publish:"Publish service",applyMpaProfile:"Apply MPA profile",verifyMpaRuntime:"Verify MPA Runtime",mpaReady:"MPA Runtime ready",running:"Deploying"}},publish:{generating:"Generating publish configuration",validating:"Validating the agent structure and preparing the deployment snapshot…"}},nhe={presets:{support:{name:"Customer support assistant",description:"Answer questions around the clock using your knowledge base and conversation history, with consistent and considerate responses.",instruction:"You are a professional and patient customer support assistant. Always use a courteous, friendly tone. Base answers on the knowledge base whenever possible. When the available information is insufficient, say so clearly and ask for the details you need instead of inventing an answer. Keep responses concise and well structured, and provide steps when useful.",subagents:{}},analyst:{name:"Data analyst",description:"Run code for statistics and visualization with tracing enabled, so every analysis is observable and reproducible.",instruction:"You are a rigorous data analyst. Clarify the objective and definitions before cleaning, analyzing, and visualizing data with executable code. Explain assumptions and methods at each step, support conclusions with key evidence, and identify possible bias or limitations.",subagents:{}},translator:{name:"Translation assistant",description:"Translate between Chinese and English accurately and naturally while preserving tone and terminology.",instruction:"You are a professional translator fluent in Chinese and English. Preserve the meaning of the source while producing natural language for the target audience. Keep proper nouns and technical terminology accurate and reflect the original tone and style. Return only the translation unless the user asks for an explanation.",subagents:{}},coder:{name:"Coding assistant",description:"Write, debug, and refactor code, validate it by running tests, and produce clear, maintainable implementations.",instruction:"You are a senior software engineer. Write correct, clear, maintainable code that follows the conventions and best practices of the target language. When uncertain, run the code to validate the implementation, cover important edge cases, and add concise comments for complex logic.",subagents:{}},researcher:{name:"Researcher",description:"Search primary sources online and combine them with knowledge and long-term memory to produce evidence-backed findings.",instruction:"You are a rigorous researcher. Break each question into key subproblems, collect multiple credible primary sources through web search, and cross-check the evidence before drawing conclusions. Cite sources, state uncertainty, distinguish facts from inference, and avoid overgeneralization.",subagents:{}},"research-team":{name:"Multi-agent research team",description:"Coordinate a researcher, analyst, and writer to produce an end-to-end research report.",instruction:"You coordinate a research team. Break down the user's research task, delegate search, analysis, and writing to the appropriate subagents, synthesize their work, and deliver a clear, evidence-backed report.",subagents:{0:{name:"Researcher",description:"Collect primary sources and data related to the topic online.",instruction:"You are the team's researcher. Find multiple credible sources about the topic, organize the key facts, data, and original citations, and hand them to the analyst without adding unsupported conclusions."},1:{name:"Analyst",description:"Cross-check and synthesize the collected material.",instruction:"You are the team's analyst. Cross-check, compare, and synthesize the research material. Extract insights, identify contradictions and uncertainty, and produce a structured set of findings."},2:{name:"Writer",description:"Turn the analysis into a clear report with reliable citations.",instruction:"You are the team's writer. Turn the analyst's findings into a clear, well-written report with consistent citations, ensuring every conclusion can be traced to a source."}}}},tags:{tools:"Tools",memory:"Memory",knowledgeBase:"Knowledge base",tracing:"Tracing",subagents:"{{count}} subagents"},gallery:{title:"Create from a template",subtitle:"Choose a prebuilt agent template and customize it to fit your needs."},detail:{back:"Back to templates",name:"Name",systemPrompt:"System prompt",model:"Model",tools:"Tools",memory:"Memory",knowledgeBase:"Knowledge base",tracing:"Tracing",subagents:"Subagents ({{count}})",create:"Create from this template",shortTermMemory:"Short-term",longTermMemory:"Long-term"}},ihe={checkingExpiry:"Checking expiry",waitingRecovery:"Waiting for recovery",listFailed:"Could not load projects",recoveryFailed:"Could not restore the workspace. Try again",operationFailed:"Project operation failed. Try again",title:"Code projects",back:"Back to code projects",restart:"This development environment will restart in {{countdown}}. Save your work regularly",expiresAt:"Expires at {{date}}",exitFullscreen:"Exit full screen",fullscreen:"Full screen",exitFullscreenHint:"Exit full screen (Esc)",recovering:"Restoring your workspace. Your project will reopen automatically",retry:"Retry connection",search:"Search code projects",newTitle:"New code project",new:"New project",readingStats:"Loading project details",createdAt:"Created",opening:"Opening",unknownCreatedAt:"Creation time unknown",open:"Open project",empty:"No matching code projects",close:"Close new project",name:"Project name",placeholder:"e.g. my-agent",nameHelp:"Start with a letter and use letters, numbers, underscores or hyphens, up to 64 characters",cancel:"Cancel",create:"Create project",files_one:"{{count}} file",files_other:"{{count}} files",directories_one:"{{count}} directory",directories_other:"{{count}} directories",separator:", "},rhe={enabled:"Enabled",disabled:"Disabled",unknownStatus:"Unknown status",allPermissions:"All permissions",customPermissions:"Custom permissions",unknownPermissions:"Unknown permissions",unnamed:"Unnamed API Key",search:"Search name, status or permissions",noMatches:"No matching API Keys",noModelPermission:"Not permitted by this API Key",modelAvailable:"Available",permissionState:{Available:"Available for chat",Shutdown:"Shut down",VideoGeneration:"Video generation model",Unsupported:"Not a chat model",NotActivated:"Not activated",Unknown:"Model status unavailable"}},she={common:Bfe,yaml:Ufe,validation:Qfe,defaults:zfe,helpers:Vfe,intelligentDeployment:Hfe,codePackage:qfe,buildCanvas:Wfe,intelligent:Kfe,projectLibrary:Gfe,modePicker:Xfe,promptEditor:Yfe,skills:Zfe,workflow:Jfe,workbench:ehe,traditional:the,template:nhe,workspace:ihe,modelApiKey:rhe},eVe=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:Wfe,codePackage:qfe,common:Bfe,default:she,defaults:zfe,helpers:Vfe,intelligent:Kfe,intelligentDeployment:Hfe,modePicker:Xfe,modelApiKey:rhe,projectLibrary:Gfe,promptEditor:Yfe,skills:Zfe,template:nhe,traditional:the,validation:Qfe,workbench:ehe,workflow:Jfe,workspace:ihe,yaml:Ufe},Symbol.toStringTag,{value:"Module"})),ahe={source:"Task source",studio:"Studio scheduled tasks",title:"Runtime scheduled tasks",selectRuntime:"Select a cloud Runtime from the Agent list first.",scope:"Scheduled tasks for the current Studio user in this Runtime.",refresh:"Refresh",loading:"Loading Runtime tasks",empty:"No matching scheduled tasks in this Runtime.",authRequired:"Runtime rejected the request. Check gateway access and the Runtime authentication setting.",forbidden:"The current user cannot access this Runtime.",unsupported:"This Runtime does not provide the MPA scheduled tasks API.",invalidResponse:"The tasks API returned unrecognized data. Check the Runtime version.",loadFailed:"Could not load tasks. Check the network and Runtime status, then refresh.",pagination:"Runtime task pagination",total:"{{total}} tasks",previous:"Previous",next:"Next",columns:{name:"Task name",enabled:"Status",schedule:"Schedule",next:"Next run",last:"Latest result"},schedule:{once:"Once",interval:"Interval",daily:"Daily",weekly:"Weekly",monthly:"Monthly",cron:"Cron"},search:"Search tasks",executionCount:"Executions",successRate:"Success rate",prompt:"Task content",manage:{view:"Task view",list:"List",calendar:"Calendar",create:"Create scheduled task",edit:"Edit task",copy:"Copy",delete:"Delete",detail:"Details",run:"Run now",name:"Task",lastRun:"Last execution",schedule:"Schedule",lastStatus:"Last execution status",agent:"Executing Agent",actions:"Actions",all:"All statuses",Pending:"Not run yet",Queued:"Queued",Running:"Running",Succeeded:"Succeeded",Failed:"Failed",TimedOut:"Timed out",Cancelled:"Cancelled",Skipped:"Skipped",overview:"Execution statistics:",prompt:"Task content",timezone:"Time zone",localTime:"Execution time (device time zone)",time:"Time",Once:"Once",Interval:"Interval",Daily:"Daily",Weekly:"Weekly",Monthly:"Monthly",Cron:"Cron expression",seconds:"seconds",interval:"Interval in seconds",weekdays:"Weekdays (1 = Monday, 7 = Sunday; comma separated)",monthDays:"Days of month (1–31; comma separated)",delivery:"Delivery",Web:"Web",Feishu:"Feishu",target:"Feishu recipient ID",enabled:"Enable task",cancel:"Cancel",save:"Save",saving:"Saving",required:"Enter a task name, Agent ID, prompt and delivery target.",timezoneInvalid:"Enter a valid IANA time zone, such as Asia/Shanghai.",futureTime:"Choose a future execution time.",intervalInvalid:"Interval must be an integer between 30 and 31536000 seconds.",daysInvalid:"Enter valid, unique days.",history:"Execution history",duration:"Duration",result:"Result / session",noRuns:"No executions yet.",conflict:"The task changed or the request conflicts. Close the dialog, refresh and retry.",invalid:"Request validation failed. Check user identity, execution time, Agent ID and task settings.",queued:"Execution request submitted.",saved:"Task updated.",deleteConfirm:"Delete “{{name}}”? It will no longer be scheduled.",calendarZone:"Display time zone:",prevMonth:"Previous month",nextMonth:"Next month",today:"Today",nextOnly:"Next only",calendarHint:"The calendar shows expected executions. Complex Cron expressions show only the next execution returned by the server.",botAccount:"Delivery bot",selectBot:"Select an enabled delivery bot.",botsLoading:"Loading Feishu bots…",botsFailed:"Could not load delivery bots. Try again.",botsUnauthorized:"You cannot read Feishu bots. Contact an administrator to configure delivery.",retryBots:"Reload bots",botDisabled:"Disabled"}},ohe={backToList:"Back to scheduled tasks",cancel:"Cancel",cancelQueue:"Cancel queued run",cancelQueueFirst:"Cancel the queued run first",cancelling:"Cancelling…",closeDrawer:"Close panel",collapse:"Collapse",connectingRuntime:"Connecting to Runtime…",createScheduledTask:"Create scheduled task",createTask:"Create task",delete:"Delete",deleteTask:"Delete task",edit:"Edit",enable:"Enable",expand:"Expand",pause:"Pause",refresh:"Refresh",refreshHistory:"Refresh run history",rerun:"Run again",retry:"Retry",runNow:"Run now",saveChanges:"Save changes",saving:"Saving…",stop:"Stop run",stopRun:"Stop this run",stopRunFirst:"Stop the current run first",stopping:"Stopping…",viewDetails:"View details"},lhe={cancelDescription:"This Session will be cancelled. Future scheduled runs will remain enabled.",cancelTitle:"Stop this run?",deleteDescription:"“{{name}}” and its complete run history will be permanently deleted.",deleteTitle:"Delete scheduled task?"},che={configuration:"Task configuration",nextRun:"Next run",pageLabel:"Scheduled task details",region:"Region",runtime:"Runtime",status:"Task status"},uhe={createTitle:"Create scheduled task",description:"Each trigger creates a separate Session for the Runtime Agent.",editTitle:"Edit scheduled task"},dhe={minutesSeconds:"{{minutes}} min {{seconds}} sec",seconds:"{{count}} sec"},fhe={cronExpression:"Cron expression",cronHelp:"Enter minute, hour, day of month, month, and day of week.",dailyTime:"Daily run time",enableAfterCreate:"Enable after creation",enableHelp:"The task will run at its next scheduled time after it is enabled.",name:"Task name",namePlaceholder:"For example: Generate a daily operations summary",noRuntime:"No Runtime available",prompt:"Execution prompt",promptPlaceholder:"Enter the text to send to the Agent on every run",runAt:"Run time",runtimeAgent:"Runtime Agent",runtimeHelp:"The task always uses the Runtime's currently active version.",runtimePlaceholder:"Select a Runtime Agent",schedule:"Schedule",scheduleType:"Schedule type",timezone:"Time zone",weekday:"Day of week"},hhe={all:"All"},phe={description:"Each run uses a separate Session. Results and errors are retained.",duration:"Duration: {{duration}}",emptyDescription:"Runs will appear here after the task is triggered or run manually.",emptyTitle:"No runs yet",errorDetails:"Error details",finalAnswer:"Final answer",loadFailed:"Unable to load run history",loadFailedDescription:"Check the Studio service and try again.",session:"Session",title:"Run history"},mhe={cancelRequested:"Stop request submitted.",created:"Task created.",deleted:"The task and its run history were deleted.",enabled:"Task enabled.",paused:"Task paused.",queued:"Task queued and will start within one minute.",requeued:"Task queued again and will start within one minute.",updated:"Task updated."},ghe={filterLabel:"Filter scheduled tasks by status",listLabel:"Scheduled task list",loadFailed:"Unable to load scheduled tasks",loadFailedDescription:"Check the Studio service and try again.",title:"Cronjob"},bhe={cron:"Cron {{cron}}{{zone}}",daily:"Daily at {{time}}{{zone}}",once:"Once · {{date}}{{zone}}",weekly:"{{weekday}} at {{time}}{{zone}}"},yhe={daily:"Daily",once:"Once",weekly:"Weekly"},vhe={cancelled:"Cancelled",enabled:"Enabled",failed:"Failed",notRun:"Not run yet",paused:"Paused",pending:"Preparing",queued:"Queued",retrying:"Retrying",running:"Running",skipped:"Skipped",success:"Succeeded"},xhe={cronFields:"A Cron expression must contain five fields, for example 0 9 * * *.",nameRequired:"Enter a task name.",promptRequired:"Enter the text to send to the Agent on each run.",runtimeAppMissing:"The Runtime Agent did not return an appName. Confirm that the Runtime is ready and compatible.",runtimeRequired:"Select an available Runtime Agent.",timeRequired:"Select a run time."},whe={friday:"Friday",monday:"Monday",saturday:"Saturday",sunday:"Sunday",thursday:"Thursday",tuesday:"Tuesday",wednesday:"Wednesday"},tVe={mpa:ahe,actions:ohe,confirm:lhe,detail:che,drawer:uhe,duration:dhe,fields:fhe,filters:hhe,history:phe,notices:mhe,page:ghe,schedule:bhe,scheduleTypes:yhe,status:vhe,validation:xhe,weekdays:whe},nVe=Object.freeze(Object.defineProperty({__proto__:null,actions:ohe,confirm:lhe,default:tVe,detail:che,drawer:uhe,duration:dhe,fields:fhe,filters:hhe,history:phe,mpa:ahe,notices:mhe,page:ghe,schedule:bhe,scheduleTypes:yhe,status:vhe,validation:xhe,weekdays:whe},Symbol.toStringTag,{value:"Module"})),khe="Quick-create Agent",Ohe="Agent type",She="Close",Ehe="Deploy",Che="Preview",Ahe="Configuration download started",The="Download failed — try again",_he="Review {{count}} configuration issues",jhe="Custom",Nhe="Custom {{field}}",Rhe="Enter a custom value",Ihe="This model declares no reasoning levels; the service settings apply",Phe="Add a model to this provider first",Dhe="Select a provider first",Mhe="Select an option",Lhe="Optional",$he="Default model, Agent preset and permissions apply to new sessions. The preset must exist in the deployed Harness",Fhe="Enter an environment variable name only; supply its secret value at deployment",Bhe="read-only allows reading; workspace-write allows workspace edits; danger-full-access allows full access without approval",Uhe="allowedModels lists the models sub-agents may select. Enabling selection requires at least one provider/model pair",Qhe="Add a custom model service using its endpoint, protocol and model IDs, including compatible Volcengine and BytePlus services",zhe="Covers common native settings. Other plugin parameters and preset files are not included yet",Vhe="Native configuration reference",Hhe="Provider {{index}}",qhe="Model {{index}}",Whe="Add provider",Khe="Remove provider {{index}}",Ghe="Add model",Xhe="Remove model {{index}}",Yhe="Add allowed model",Zhe="Remove allowed model {{index}}",Jhe="Remove",epe="Enter the service’s model ID",tpe={provider:"Provider {{index}}",model:"Model {{index}}"},npe={defaults:"Session defaults",deepseek:"DeepSeek model service",providers:"Custom model providers",shell:"Command execution",loop:"Tool calls",subagents:"Sub-agent model selection",search:"DeepSeek web search"},ipe={id:"Provider ID",displayName:"Display name",baseURL:"Base URL",api:"API protocol",apiKeyEnv:"API key environment variable"},rpe={id:"e.g. company-models",displayName:"Optional; defaults to the provider ID",baseURL:"https://…/v1",api:"Select a protocol",apiKeyEnv:"e.g. MODEL_API_KEY"},spe={id:"Model ID",name:"Display name",contextWindow:"Context capacity",maxTokens:"Maximum output capacity"},ape={positive:"Enter a number greater than zero",integer:"Enter a valid positive integer",env:"Use letters, digits and underscores; do not start with a digit",url:"Enter an HTTP or HTTPS URL without credentials",option:"Select a supported native option",required:"Complete this field",duplicate:"This ID or model pair already exists",providerId:"Start with a lowercase letter; use lowercase letters, digits, dots, underscores or hyphens; reserved IDs are unavailable",routes:"Add at least one complete provider/model pair",modelPair:"Enter a model ID for this custom provider",unknownProvider:"Add this custom provider first",unknownModel:"Enter a model ID configured for this provider",timer:"Enter a timeout greater than 0 and no more than 2147483647 ms"},ope={"agent-default-model_provider":"Default provider","agent-default-model_model":"Default model","agent-default-model_reasoningEffort":"Default reasoning effort","agent-presets_default":"Default Agent preset",permission_defaultPreset:"Default permission preset","llm-deepseek_apiKeyEnv":"API key environment variable","llm-deepseek_baseURL":"Base URL","llm-deepseek_thinking":"Thinking mode","llm-deepseek_reasoningEffort":"Reasoning effort","llm-deepseek_maxTokens":"Output limit per request","llm-deepseek_defaultContextWindow":"Default context capacity","llm-deepseek_streamIdleTimeoutMs":"Stream idle timeout (ms)",bash_timeoutMs:"Default execution timeout (ms)",bash_maxTimeoutMs:"Maximum execution timeout (ms)",bash_maxOutputBytes:"Output limit (bytes)","agent-loop_maxParallelToolCalls":"Parallel tool-call limit","subagent-model-selection_enabled":"Enable model selection","web-search-deepseek_apiKeyEnv":"API key environment variable","web-search-deepseek_baseURL":"Search base URL","web-search-deepseek_model":"Search model","web-search-deepseek_apiVersion":"API version","web-search-deepseek_maxTokens":"Search output limit","web-search-deepseek_maxUses":"Maximum search uses"},lpe="Cancel",cpe="Back to creation methods",upe="DeepSeek Harness configuration",iVe={title:khe,agentType:Ohe,close:She,continue:"Continue",deploy:Ehe,preview:Che,export:"Export configuration",downloaded:Ahe,downloadFailed:The,validationSummary:_he,customValue:jhe,customField:Nhe,enterCustomValue:Rhe,reasoningUnavailable:Ihe,modelsUnavailable:Phe,selectProviderFirst:Dhe,selectOption:Mhe,optional:Lhe,defaultsHelp:$he,credentialHelp:Fhe,permissionHelp:Bhe,routesHelp:Uhe,providersHelp:Qhe,coverage:zhe,source:Vhe,provider:Hhe,model:qhe,addProvider:Whe,removeProvider:Khe,addModel:Ghe,removeModel:Xhe,addRoute:Yhe,removeRoute:Zhe,remove:Jhe,modelIdPlaceholder:epe,route:tpe,sections:npe,providerFields:ipe,providerPlaceholders:rpe,modelFields:spe,errors:ape,fields:ope,cancel:lpe,back:cpe,pageTitle:upe},rVe=Object.freeze(Object.defineProperty({__proto__:null,addModel:Ghe,addProvider:Whe,addRoute:Yhe,agentType:Ohe,back:cpe,cancel:lpe,close:She,coverage:zhe,credentialHelp:Fhe,customField:Nhe,customValue:jhe,default:iVe,defaultsHelp:$he,deploy:Ehe,downloadFailed:The,downloaded:Ahe,enterCustomValue:Rhe,errors:ape,fields:ope,model:qhe,modelFields:spe,modelIdPlaceholder:epe,modelsUnavailable:Phe,optional:Lhe,pageTitle:upe,permissionHelp:Bhe,preview:Che,provider:Hhe,providerFields:ipe,providerPlaceholders:rpe,providersHelp:Qhe,reasoningUnavailable:Ihe,remove:Jhe,removeModel:Xhe,removeProvider:Khe,removeRoute:Zhe,route:tpe,routesHelp:Uhe,sections:npe,selectOption:Mhe,selectProviderFirst:Dhe,source:Vhe,title:khe,validationSummary:_he},Symbol.toStringTag,{value:"Module"})),dpe="Report an issue",fpe="Description",hpe="Common issues",ppe="Cancel",mpe="Done",gpe="Submit feedback",bpe="Submitting…",ype={title:"Feedback submitted. Thank you.",description:"The AgentKit team will review your report as soon as possible."},vpe={close:"Close issue report",intro:"Select the issues you encountered and add any useful details.",privacy:"Your conversation data will be shared with the AgentKit team. Please protect sensitive information.",descriptionPlaceholder:"Describe what happened (optional)",issues:{slow:"Slow execution",crash:"Runtime crash",incorrect:"Inaccurate result",tool_error:"Tool call failed",other:"Other issue"}},xpe={description:"Tell us about a problem you encountered while using AgentKit Studio.",module:"Area",modules:{conversation:"Conversation",agents:"Agents",applications:"Automations",search:"Search",other:"Other"},commonIssuesMultiple:"Common issues (select all that apply)",issueTypes:"Issue types",issues:{page_slow:"Page loads slowly",feature_unavailable:"Feature unavailable",display_error:"Display issue",no_response:"Action has no response",other:"Other issue"},descriptionPlaceholder:"Describe the page, action, and what happened",quickAdd:"Quick add",suggestionsLabel:"Suggested descriptions",suggestions:{noResponse:"Nothing happens after I click",loading:"The page remains in a loading state",incomplete:"Some content is missing or clipped",error:"An error appears after the action"},privacy:"Your data will be shared with the AgentKit team. Please protect sensitive information."},sVe={title:dpe,descriptionLabel:fpe,commonIssues:hpe,cancel:ppe,done:mpe,submit:gpe,submitting:bpe,success:ype,dialog:vpe,page:xpe},aVe=Object.freeze(Object.defineProperty({__proto__:null,cancel:ppe,commonIssues:hpe,default:sVe,descriptionLabel:fpe,dialog:vpe,done:mpe,page:xpe,submit:gpe,submitting:bpe,success:ype,title:dpe},Symbol.toStringTag,{value:"Module"})),wpe={back:"Back",close:"Close"},kpe={title:"Optimize migrated project",closeAria:"Close optimization dialog"},Ope={title:"Migrated projects",description:"Manage migrated source versions or continue optimizing any version.",libraryTitle:"Projects and versions",libraryDescription:"View, download, deploy, or compare source versions, or continue optimizing any version.",emptyTitle:"No migrated projects yet",emptyDescription:"Migrated source code will be saved here automatically."},Spe={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any (universal migration)"},Epe={awaitingUpload:"Awaiting upload",analyzing:"Analyzing",needsInput:"Needs input",analysisReady:"Awaiting confirmation",migrating:"Migrating",validating:"Validating",packaging:"Packaging",succeeded:"Completed",succeededWithWarnings:"Completed with notices",partial:"Partially completed",failed:"Failed",cancelled:"Stopped",expired:"Expired"},Cpe={evaluationPending:"Evaluation pending",evaluationRunning:"Evaluating",waitingDataset:"Evaluation cases pending",waitingEnvironment:"Environment variables required",evaluationFailed:"Migrated, evaluation incomplete",evaluationBlocked:"Migrated, evaluation needs attention",evaluationCancelled:"Migrated, evaluation cancelled",resultUnavailable:"Result unavailable",environmentExpired:"Environment expired"},Ape={partialReady:"Migration output is ready, but delivery is incomplete. Review the migration notices.",readyWithWarnings:"Migration output is ready. Review the migration notices.",ready:"Migration output is ready."},Tpe={passed:"Output verification passed",failed:"Output verification failed",degraded:"Output verification incomplete"},_pe={session:"Create migration environment",upload:"Upload project",analysis:"Analyze project"},jpe={agentNameRequired:"Enter an Agent name",agentNameInvalid:"Agent names must be 1–63 characters, contain only lowercase letters, numbers, and hyphens, and start and end with a letter or number"},Npe={seconds:"{{seconds}} sec",minutesSeconds:"{{minutes}} min {{seconds}} sec"},Rpe={savedUnaffected:"Saved projects are unaffected",savingUnaffected:"Source is being saved and will be unaffected once complete",activeDetail:"Task history and temporary output will become unavailable after expiration",oneHour:"Temporary migration environment is retained for 1 hour",ended:"Temporary migration environment has ended",savedAvailable:"Saved projects remain available to view, download, deploy, or optimize",unavailable:"Task history and temporary output are no longer available",countdown:"Temporary migration environment ends in {{minutes}} min {{seconds}} sec",expiredSavedMessage:"The temporary migration environment has ended. Saved projects are unaffected.",expiredMessage:"The temporary migration environment has ended. Task history and temporary output are no longer available."},Ipe={recommended:"Recommended migration method",scope:"Migration scope",excluded:"Out of scope",viewEvidence:"View analysis evidence",viewAssumptions:"View key assumptions",viewSourceEvidence:"View source evidence"},Ppe={ariaLabel:"Codex activity",title:"Codex activity",startingAnalysis:"Codex is starting the analysis…",startingMigration:"Codex is starting the migration…",loadError:"Codex activity is temporarily unavailable. The current task is unaffected.",liveAnalyzing:"Analyzing the project",liveMigrating:"Running the migration",liveValidating:"Verifying the migration",livePackaging:"Packaging the migration",liveDelivery:"Reviewing the delivery"},Dpe={title:"Migration output",fileTooLarge:"This file exceeds 2 MiB. Download the complete output to view it.",unsupportedPreview:"This file cannot be previewed here. Download the complete output to view it.",filesAria:"Migration output files",searchAria:"Search output files",searchPlaceholder:"Search files",limit:"Showing the first {{count}} items. Search for a specific file.",noSelection:"No file selected",noPreview:"No files available to preview.",loadingFile:"Loading output file…",startupFile:"Startup file",fileCountLabel:"Files",saved:"Source has been saved. You can view, download, deploy, or optimize it.",saving:"Output is ready and the source version is being saved.",deployReady:"Output is available to preview, download, and deploy. Waiting for source save status.",deployUnavailable:"Output is available to preview and download, but its current delivery status does not support deployment.",viewProjects:"View migrated projects",downloading:"Downloading…",downloadZip:"Download ZIP",deployTitle:"Deploy migration output",deployUnavailableTitle:"Current delivery status does not support deployment",deployRuntime:"Deploy to Runtime",fileCount:"{{count}} files",startup:"Startup file {{module}}",loading:"Loading migration output…"},Mpe={retiring:"Retiring soon",currentDefault:"Current default model",loadError:"Failed to load models",label:"Model",placeholder:"Select a model"},Lpe={zipOnly:"Select a local project in .zip format.",invalidName:"The ZIP file name is invalid. Rename the file and select it again.",tooLarge:"The project ZIP cannot exceed {{size}}.",empty:"The project ZIP cannot be empty.",removeAria:"Remove project ZIP",reselectPrompt:"Select the project ZIP again",selectPrompt:"Select or drop a local project ZIP",reselect:"Select again",selectZip:"Select ZIP",continue:"Continue upload",start:"Upload and analyze",inputAria:"Select a local project ZIP",retention:"The temporary migration environment is retained for 1 hour after creation. Successfully saved source versions are unaffected.",uploading:"Uploading…",sizeHint:"Project ZIP, up to {{size}}"},$pe={requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}",notReady:"Migration output is not ready yet.",back:"Back to migration results"},Fpe={backToAddAgent:"Back to Add Agent",title:"Migrate existing project",newMigration:"New migration",recent:"Recent migrations",loadingSessions:"Loading migration sessions…",noSessions:"No migration sessions",heading:"Migrate an existing Agent project",intro:"Upload a local project ZIP. Codex will first perform a read-only analysis, then ask you to confirm the migration method.",backToHome:"Migration home",navigation:"Migration navigation",showMore:"Show more",showLess:"Show less",projectName:"Project name",status:"Status",createdAt:"Created",actions:"Actions",openTask:"Open migration {{name}}",continueTask:"Continue",viewTask:"View"},Bpe={stop:"Stop migration",stopping:"Stopping…",cancel:"Cancel",reload:"Reload",refreshStatus:"Refresh status"},Upe={unavailable:"Migration is currently unavailable",defaultReason:"Dev Sandbox is currently unavailable. Contact your administrator to check the configuration."},Qpe={creatingSandbox:"Creating Dev Sandbox",initializing:"Initializing the migration workspace and checking AgentKit CLI, Codex, and migration capabilities. The project will upload automatically when the environment is ready.",elapsed:"Elapsed: {{duration}}",uploadThenAnalyze:"Read-only analysis will start automatically after the ZIP upload completes.",analyzing:"Codex is identifying the framework, entry point, and migration boundaries. No migration changes are being made.",migrationLocked:"Attachments and migration settings cannot be changed while migration is running. Wait for the task to finish or stop it.",analysisPaused:"Read-only analysis is paused. Answer only the questions below. After submission, analysis will continue in the same environment without starting the migration.",analysisComplete:"Read-only analysis is complete. Review the recommendation and confirm the final migration method.",awaitingUpload:"The migration environment is ready. Select the local ZIP again to continue uploading.",expiredTitle:"Migration environment expired",expiredDescription:"Migration content and output can no longer be previewed, downloaded, or deployed. If the Runtime deployment completed, return to the Agents page to continue using it.",unsupportedTitle:"This ZIP cannot be migrated yet",unsupportedHint:"Update the project as instructed, then create a new migration and upload it again.",failedTitle:"Migration incomplete",cancelled:"This migration was stopped. Create a new migration and upload the project again."},zpe={ariaLabel:"Provide project analysis details",title:"Additional information needed for analysis",description:"The attachment stays locked; submitting continues read-only analysis only",submitting:"Continuing analysis…",submit:"Submit and continue analysis"},Vpe={ariaLabel:"Answer the questions the migration needs you to decide",title:"The migration needs your answer",description:"Your answer continues the current step instead of restarting it",other:"Other",otherPlaceholder:"Or type your own answer",submitting:"Submitting your answer…",submit:"Submit answer and continue"},Hpe={ariaLabel:"Confirm migration method",title:"Confirm migration method",framework:"Migration method",frameworkPlaceholder:"Select a migration method",agentName:"Agent name",entry:"Project entry point",entryPlaceholder:"Select a project entry point",entryExample:"For example, agent.py:agent",consent:"By selecting “Confirm and start migration,” you confirm the migration scope, exclusions, and key assumptions above.",starting:"Starting migration…",start:"Confirm and start migration"},qpe={setup:{title:"Migration effect evaluation",description:"Evaluation cases run automatically after migration.",on:"On",off:"Off",unavailable:"Migration effect evaluation is unavailable in this environment.",casesTitle:"Evaluation cases",casesDescription:"Add at least one case. Expected outcomes and criteria are optional.",configuredSummary:"{{count}} cases · {{preset}} · {{dimensions}}",incompleteSummary:"{{count}} cases need content · {{preset}} · {{dimensions}}",dimensionSummary:"{{count}} dimensions",editSettings:"Edit settings",viewSettings:"View settings",lockedTitle:"Evaluation cases",lockedDescription:"Cases cannot change after upload starts.",closeAria:"Close evaluation settings",done:"Finish setup",close:"Close"},tabs:{label:"Migration task content",migration:"Migration",evaluation:"Evaluation",waitingMigration:"Waiting for migration",waitingConfiguration:"Setup required",running:"Running",completed:"Completed",issue:"Needs attention"},bulk:{open:"Paste multiple",label:"Enter one case per line",placeholder:`Check the status of today's orders +Summarize the result in three points`,preview:"{{count}} cases will be added",confirm:"Add cases"},case:{title:"Case {{index}}",add:"Add case",moveUp:"Move case {{index}} up",moveDown:"Move case {{index}} down",copy:"Duplicate",delete:"Delete",userInput:"User input",userInputPlaceholder:"For example: Check the status of today's orders",expectedOutcome:"Expected outcome (optional)",expectedOutcomePlaceholder:"Describe what the Agent should accomplish; exact wording is not required",criteria:"Requirements (optional)",addCriterion:"Add requirement",criterionLabel:"Requirement {{index}}",criterionPlaceholder:"For example: Include the order ID and current status",removeCriterion:"Remove requirement {{index}}"},advanced:{title:"Advanced settings",standard:"Standard evaluation",standardDescription:"Uses 3 dimensions by default: semantic fidelity, output constraints, and workflow/tool fidelity.",custom:"Custom dimensions",customDescription:"Select one or more dimensions based on business risk.",lockedDescription:"The evaluation method and dimensions cannot change after upload starts."},dimension:{semantic_fidelity:"Semantic fidelity",output_contract:"Output contract",workflow_tool_fidelity:"Workflow and tool fidelity",context_memory_fidelity:"Context and memory fidelity",boundary_error_fidelity:"Boundary and error fidelity",safety_refusal_fidelity:"Safety and refusal fidelity"},dimensionDescription:{semantic_fidelity:"Checks whether intent, conclusions, and key facts remain consistent.",output_contract:"Checks required fields, structure, language, and formatting constraints.",workflow_tool_fidelity:"Checks observable workflow branches and tool-driven behavior.",context_memory_fidelity:"Checks supported multi-turn context and memory behavior.",boundary_error_fidelity:"Checks invalid input, missing information, and dependency failures.",safety_refusal_fidelity:"Checks existing authorization, refusal, and sensitive-data boundaries."},validation:{caseCount:"Keep between 1 and {{count}} cases.",dimensionRequired:"Select at least one evaluation dimension.",userInputRequired:"Enter case input.",userInputBytes:"A case cannot exceed 32 KiB.",expectedOutcomeBytes:"The expected outcome cannot exceed 16 KiB.",criteriaCount:"A case can contain at most {{count}} requirements.",criterionRequired:"Requirements cannot be empty.",criterionBytes:"One requirement cannot exceed 2 KiB.",datasetBytes:"All evaluation cases cannot exceed 10 MiB."},dataset:{invalidLockResponse:"The service did not confirm that evaluation cases were saved. Try again.",loadingSettings:"Loading evaluation settings…",loadSettingsFailed:"Evaluation settings could not be loaded.",retryLoadSettings:"Reload",missing:"No saved evaluation cases were found. Enter and save them again.",saveWarning:"Evaluation cases were not saved. Migration continues.",retrySave:"Save evaluation cases again",saving:"Saving…"},state:{disabled:"Evaluation is off",waiting_dataset:"Waiting for evaluation cases",pending:"Evaluation starts automatically after migration",preparing:"Preparing the evaluation environment…",waiting_environment:"Runtime environment variables are required",deploying:"Deploying a temporary Runtime…",executing:"Running evaluation cases…",judging:"Running evaluation analysis…",aggregating:"Aggregating evaluation results…",completed:"Evaluation completed",failed:"Evaluation incomplete",blocked:"Evaluation requires attention before it can continue",cancelled:"Evaluation cancelled"},progress:{label:"Migration and migration effect evaluation progress",migration:"Migration",evaluation:"Migration effect evaluation",notStarted:"Not started",inProgress:"In progress",completed:"Complete",waitingConfiguration:"Waiting for setup",issue:"Needs attention"},environment:{description:"Enter the environment variables required by the temporary Runtime.",security:"Used only for this evaluation.",optional:"Optional",submit:"Submit and continue evaluation",submitting:"Submitting…"},execution:{preparing:"Prepare evaluation",preparingDetail:"Validate migration output and {{count}} evaluation cases",deploying:"Start Runtime",deployingDetail:"Prepare {{runtime}}",runtimeFallback:"isolated runtime",executing:"Run cases",executingDetail:"Run {{count}} cases and capture output",judging:"Run evaluation analysis",judgingDetail:"Evaluate {{cases}} cases · {{dimensions}} dimensions",aggregating:"Generate evaluation report",aggregatingDetail:"Aggregate scores and evidence into an HTML report",waiting:"Waiting",running:"Running",failed:"Failed",complete:"Completed"},result:{title:"Execution progress",attempt:"Evaluation attempt {{attempt}}",pending:"Waiting for migration to complete",retry:"Run evaluation again",retrying:"Retrying…",failureStage:"Failed at",errorCode:"Error code",taskId:"Task ID",diagnosticAttempt:"Evaluation attempt",runtime:"Runtime",errorDetails:"Error details",diagnosticField:"{{label}}: {{value}}",diagnosticHeading:"{{label}}:",loadingReport:"Loading the evaluation report…",reportTitle:"HTML evaluation report",reportHtmlDescription:"View or download the HTML report.",viewReport:"View report",reportDrawerDescription:"Scores, differences, and evidence",closeReport:"Close",closeReportAria:"Close evaluation report",reportPreviewTitle:"Migration effect evaluation report preview",reportSummary:"Evaluation summary",reportVersion:"Dataset {{version}} · Prompt v{{prompt}}",downloadReport:"Download full report",downloadingReport:"Downloading…",overallScore:"Overall fidelity",scoreScale:"0–100; N/A when evidence is insufficient",evidenceCoverage:"Evidence coverage",coverageDetail:"{{scored}} of {{total}} dimensions evidenced",executionSuccess:"Execution success",executionDetail:"{{succeeded}} of {{total}} cases completed",naCount:"N/A count",naDescription:"Insufficient evidence; excluded from scores",gapDescription:"Migration gap summary",lowestScoringCases:"Lowest-scoring cases",executionFailures:"Execution issues",criticalEvidence:"Critical evidence",limitations:"Evaluation limitations",viewEvidence:"View results and evidence for {{count}} cases",outputTruncated:"Long output was truncated",executionState:{succeeded:"Execution completed",failed:"Execution issue"},severityLabel:"Severity: {{severity}}",severity:{none:"None",low:"Low",medium:"Medium",high:"High",critical:"Critical",unknown:"Unknown"},evidenceSource:{user_reference:"Expected outcome",user_criteria:"Provided requirements",source_contract:"Source contract",observed_output:"Observed output",runtime_observation:"Raw Runtime data",deterministic_assertion:"Deterministic assertion"},listSeparator:", "}},Wpe={closeAria:"Dismiss error",loadFailed:"Could not load migration data. Try again.",refreshFailed:"Could not refresh the migration status. Try again."},Kpe={title:"Stop the current migration?",description:"Stopping ends the current analysis or migration process. Completed steps will not continue."},oVe={common:wpe,optimization:kpe,projects:Ope,framework:Spe,state:Epe,historyStatus:Cpe,task:Ape,verification:Tpe,transfer:_pe,validation:jpe,duration:Npe,expiry:Rpe,analysis:Ipe,activity:Ppe,artifact:Dpe,model:Mpe,upload:Lpe,deployment:$pe,workspace:Fpe,actions:Bpe,capability:Upe,conversation:Qpe,questions:zpe,pendingInput:Vpe,confirmation:Hpe,evaluation:qpe,errors:Wpe,stopDialog:Kpe},lVe=Object.freeze(Object.defineProperty({__proto__:null,actions:Bpe,activity:Ppe,analysis:Ipe,artifact:Dpe,capability:Upe,common:wpe,confirmation:Hpe,conversation:Qpe,default:oVe,deployment:$pe,duration:Npe,errors:Wpe,evaluation:qpe,expiry:Rpe,framework:Spe,historyStatus:Cpe,model:Mpe,optimization:kpe,pendingInput:Vpe,projects:Ope,questions:zpe,state:Epe,stopDialog:Kpe,task:Ape,transfer:_pe,upload:Lpe,validation:jpe,verification:Tpe,workspace:Fpe},Symbol.toStringTag,{value:"Module"})),Gpe={loading:"Loading…",searchLabel:"Search {{label}}",searchPlaceholder:"Search {{label}}",retry:"Retry",noMatches:"No matches",noOptions:"No options available",selection:"{{label}}: {{value}}"},Xpe={badge:"All new",view:"See what's new",title:"What's new",defaultNotes:{multiRegion:"Multi-region agents: load Beijing and Shanghai Runtimes in parallel, with more available as you scroll.",switchAgent:"Switch in conversation: choose an agent beside the composer and start a new conversation immediately.",visualCanvas:"Visual execution canvas: inspect multi-agent structures on a horizontal canvas with fullscreen support."}},Ype={label:"New conversation workspace",agent:"Agent",skill:"Skill customization",video:"Video creation"},Zpe={select:"Select conversation mode",agent:{label:"Agent",description:"Chat with the selected Agent"},builtin:{label:"Built-in Agent",description:"Use an Agent provided by the platform"},codex:{label:"Codex Agent",description:"Run tasks in a sandbox"},deepseekHarness:{label:"DeepSeek Harness",description:"Open the DeepSeek Harness workspace"},arkClaw:"ArkClaw",hermes:"Hermes Agent",checking:"Checking configuration",notConfigured:"Not configured by an administrator",unavailable:"Unavailable"},Jpe={select:"Select Agent",typesLabel:"Agent types",listLabel:"{{type}} list",types:{agent:"Agent",general:"General Agent",mpa:"MPA Agent",codex:"Codex Agent",deepseekHarness:"DeepSeek Harness",openclaw:"OpenClaw Agent",hermes:"Hermes Agent"},loading:"Loading Agents",reload:"Reload",empty:"No {{type}} yet",emptyLocal:"No local Agents yet",emptyGeneral:"No General Agents yet",createHint:"Create one from the Agents page",localHint:"Check the directory where Studio was started",waking:"Waking up",opening:"Opening",connecting:"Connecting",loadingMore:"Loading",loadMore:"Load more",runtimeTimeout:"Loading Agents timed out after 15 seconds. Check the network or Runtime service and retry.",loadGeneral:"Load General Agents",loadType:"Load {{type}}",connectGeneral:"Connect to General Agent",openLocal:"Open local Agent",openType:"Open {{type}}",wakingHint:"Waking the agent. This may take some time."},eme={spaceAria:"Skill spaces",configuration:"Skill customization settings",actions:{create:"Generate Skill",optimize:"Optimize Skill"},selectAction:"Select a Skill customization action",actionList:"Skill customization actions",style:"Style",selectStyle:"Select style",model:"Model",selectModel:"Select model",styles:{concise:"Concise and practical",strict:"Rigorous and reliable",tutorial:"Tutorial-friendly",automation:"Automation-first"},modelLoadFailed:"Failed to load model configuration",spaceLoadFailed:"Failed to load Skill Spaces",skillLoadFailed:"Failed to load Skills",unnamedSpace:"Unnamed Skill Space",space:"Skill Space",select:"Select Skill",selectAria:"Select Skill: {{skill}}",loadingSpaces:"Loading Skill Spaces",reload:"Reload",emptySpaces:"No Skill Spaces yet",skillList:"{{space}} Skill list",loadingSkills:"Loading Skills",emptySkills:"No Skills yet"},tme={modes:{auto:"Auto detect",text_to_video:"Text to video",reference_to_video:"Reference to video",video_editing:"Video editing",video_extension:"Video extension",first_last_frame:"First and last frames"},taskNames:{auto:"Video generation",text_to_video:"Text-to-video",reference_to_video:"Reference-to-video",video_editing:"Video editing",video_extension:"Video extension",first_last_frame:"First-and-last-frame generation"},controls:{label:"Video creation settings",aspectRatio:"Aspect ratio",selectAspectRatio:"Select aspect ratio",resolution:"Resolution",selectResolution:"Select resolution",duration:"Duration",durationShort:"{{count}}s",durationAria:"Video duration: {{count}} seconds",lastFrame:"Last frame",lastFrameHelper:"Add the video's ending frame",assistImage:"Supporting image",referenceImage:"Reference image",assistImageHelper:"Add visual guidance",imageHelper:"Supports common image formats",referenceVideo:"Reference video",videoHelper:"Supports common video formats",optional:"Optional",replace:"Replace",add:"Add",upload:"Upload {{label}}",replaceFile:"Replace {{label}}: {{name}}",removeFile:"Remove {{label}} {{name}}",storageUnavailable:"Persistent storage is not configured",loadingEnhancer:"Loading prompt enhancement model",enhancerHint:"Uses {{model}} for intent recognition and prompt enhancement",enhancerUnavailable:"Prompt enhancement model unavailable"},task:{title:"Video generation task",closeAria:"Close video generation task dialog",progressAria:"Video generation progress",optimizedPrompt:"Optimized prompt",processingAria:"{{task}} progress",waitingAria:"{{status}}, elapsed {{elapsed}}",elapsed:"Elapsed {{elapsed}}",previewAria:"Generated video preview",close:"Close",download:"Download video",retryOptimization:"Retry prompt optimization",retryGeneration:"Retry video generation",providerQueued:"Waiting for model scheduling",providerRunning:"Model generating",providerSubmitting:"Submitting task",queuedHint:"The task was submitted. Its status will update automatically when processing begins.",runningHint:"This may take several minutes. The video preview will appear here when complete.",backgroundHint:"You can close this dialog. The task will continue in the background.",successHint:"Your video is ready to preview or download.",activationHint:"Activate the service in the model console, then retry generation.",retryHint:"Fix the issue and retry the current step.",steps:{optimizationFailed:"Prompt optimization failed",optimizationDone:"Prompt optimization complete",optimizationActive:"Optimizing prompt",generationDone:"{{task}} complete",generationFailed:"{{task}} failed",generationQueued:"{{task}} queued",generationRunning:"Generating {{task}}",generationActive:"{{task}} in progress",generationPending:"Waiting for video generation",generationComplete:"Video generation complete"},elapsedHours:"{{hours}}h {{minutes}}m",elapsedMinutes:"{{minutes}}m {{seconds}}s",elapsedSeconds:"{{seconds}}s"}},nme={compactSelect:Gpe,featureNotice:Xpe,workspace:Ype,mode:Zpe,agentPicker:Jpe,skill:eme,video:tme},cVe=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:Jpe,compactSelect:Gpe,default:nme,featureNotice:Xpe,mode:Zpe,skill:eme,video:tme,workspace:Ype},Symbol.toStringTag,{value:"Module"})),ime="Review center",rme="Resource type to review",sme="Only administrators can access the review center",ame="Search name, submitter or version",ome="Review status",lme="Pending: {{count}}",cme="Requests: {{count}}",ume={skill:"Skills",agent:"Agents"},dme={all:"All statuses",pending:"Pending",approved:"Approved",returned:"Returned",approving:"Publishing"},fme={application:"Request",submitter:"Submitter",version:"Version",submittedAt:"Submitted at",status:"Status",actions:"Actions"},hme={details:"Details",detailsFor:"View request for {{name}}",approve:"Approve",approveFor:"Approve request for {{name}}",return:"Return",returnFor:"Return request for {{name}}",close:"Close",backToDetails:"Back to details",confirmApprove:"Confirm approval",confirmReturn:"Confirm return",clearFilters:"Clear filters",refresh:"Refresh",cancel:"Cancel",resumeApproval:"Resume publishing"},pme={title:"No review requests yet",description:"Submitted review requests will appear here",filteredTitle:"No matching requests",filteredDescription:"Try another search or change the review status"},mme={title:"Request details",sections:"Request detail sections",overview:"Overview",files:"Submitted files · {{count}}",requestType:"Request type",update:"Version update",firstRelease:"First release",source:"Source",source_skill:"{{name}}’s personal skill space",source_agent:"{{name}}’s development environment",destination:"Publication target",destination_skill:"Shared skill space",destination_agent:"Shared agent",region:"Region",visibility:"Visibility after publication",shared:"Visible to everyone",description:"Description",changes:"Submission notes",example:"Usage example",history:"Review history",submitted:"{{name}} submitted this request",versionFixed:"Reviewing the submitted version only",instructions:"Instructions",filesTab:"Submitted files",filesFailed:"Could not load submitted files",unknownAuthor:"Unknown submitter",reviewer:"Reviewed by",reviewedAt:"Reviewed at",approved:"{{name}} approved the request",returned:"{{name}} returned the request",unknownReviewer:"Unknown reviewer",approvedBy:"Approved by",returnedBy:"Returned by",comment:"Review comment",result:"Review result",noHistory:"This skill has not been submitted for review",pendingHint:"Waiting for an administrator to review",approvingHint:"Approval is confirmed and publishing to the shared space is in progress",approving:"{{name}} confirmed approval; publishing is in progress"},gme={failed:"The review space is unavailable",retry:"Retry"},bme={approveTitle:"Approve request",returnTitle:"Return request",approveDescription:"Approving {{name}} {{version}} makes this version available to everyone in the enterprise shared space",returnDescription:"Return {{name}} {{version}} and explain what the applicant should change",reason:"Return reason",reasonRequired:"Enter a return reason",reasonHelp:"Up to 256 characters, visible to the applicant",saving:"Saving…",failed:"Review failed, please try again",approved:"{{name}} was approved and shared",returned:"{{name}} was returned",comment:"Comment (optional)",commentHelp:"Up to 256 characters, visible to the applicant"},yme={title:"AI score",points:"{{score}} / 100",insufficient:"Insufficient evidence",status:{unscored:"Not scored",not_requested:"Not scored",queued:"Queued",running:"Scoring",completed:"Scored",failed:"Scoring failed"},loading:"Loading score…",starting:"Submitting for scoring…",loadFailed:"Could not load score",retryFailed:"Could not request scoring",failed:"Scoring failed, ask an administrator to retry",retry:"Score again",start:"Start scoring",reload:"Reload",download:"Download JSON",expand:"Expand",collapse:"Collapse",hint:"Scores apply to this submitted version and inform the administrator’s decision",dimensions:{safety:"Safety",usability:"Usability",completeness:"Completeness",reliability:"Reliability",maintainability:"Maintainability"},risks:"Risk flags",suggestions:"Suggestions",model:"Scoring model",rubric:"Rubric version",time:"Scored at",severity:{low:"Low risk",medium:"Medium risk",high:"High risk",critical:"Critical risk"},coverage:"Review coverage",coverageCount:"Reviewed {{included}} of {{total}} files",coverageIncomplete:"Some content was excluded, so scoring evidence is incomplete",omittedFile:"Not reviewed {{path}}: {{reason}}",truncatedFile:"Partially reviewed {{path}}: {{reason}}",originalError:"Original cloud error"},uVe={title:ime,category:rme,adminOnly:sme,search:ame,filterStatus:ome,pendingCount:lme,total:cme,kind:ume,status:dme,columns:fme,actions:hme,empty:pme,detail:mme,space:gme,decision:bme,score:yme},dVe=Object.freeze(Object.defineProperty({__proto__:null,actions:hme,adminOnly:sme,category:rme,columns:fme,decision:bme,default:uVe,detail:mme,empty:pme,filterStatus:ome,kind:ume,pendingCount:lme,score:yme,search:ame,space:gme,status:dme,title:ime,total:cme},Symbol.toStringTag,{value:"Module"})),vme={cancel:"Cancel",close:"Close",retry:"Retry",tryAgain:"Try again",closeDialog:"Close {{title}}",agentFallback:"{{agent}} Agent",unknownSource:"Unknown source"},xme={terminalTitle:"Terminal",browserTitle:"Sandbox browser",terminalSubtitle:"Connect to the interactive terminal for the current AgentKit Session",browserSubtitle:"View and control the browser in the current AgentKit Session",connecting:"Connecting…",connected:"Connected",notConnected:"Not connected",opening:"Opening {{title}}",connectingSession:"Connecting the tool to the current AgentKit Session.",openFailed:"Failed to open {{title}}"},wme={title:"Resume Codex conversation",subtitle:"Select a recently updated Thread from the current Sandbox Session",loading:"Loading conversation history",loadFailed:"Failed to load conversation history",empty:"No conversations to resume"},kme={title:"Codex permissions",subtitle:"Settings are saved to the current Sandbox Session and applied to all of its Threads",sandboxMode:"Sandbox mode",approvalPolicy:"Approval policy",approvalMethod:"Approval method",networkAccess:"Allow network access",networkAccessHelp:"Control external network access in workspace-write and read-only modes.",fullAccessWarning:"Full access disables file system and network isolation. Use it only for trusted tasks.",save:"Save permissions",sandboxChoices:{readOnly:{label:"Read only",detail:"Allow reading files without writing to the workspace."},workspaceWrite:{label:"Workspace write",detail:"Allow reading and modifying files in the current workspace."},fullAccess:{label:"Full access",detail:"Disable sandbox isolation for explicitly trusted tasks."}},approvalChoices:{untrusted:{label:"Untrusted commands only",detail:"Request approval only for operations Codex considers untrusted."},onRequest:{label:"On request",detail:"Allow Codex to ask you to approve commands or file changes when needed."},never:{label:"Never ask",detail:"Codex will not pause to request manual approval."}},reviewerChoices:{user:{label:"Ask me",detail:"Approval requests appear in Studio for you to decide."},autoReview:{label:"Automatic review",detail:"Use the Codex automatic review flow to handle approval requests."}}},Ome={title:"Workspace",subtitle:"Choose the directory where the current Codex Thread runs commands and modifies files",absolutePath:"Absolute path",browse:"Browse",parent:"Parent directory",empty:"This directory has no subdirectories",locked:"The conversation has started and the workspace is locked. Start a new Sandbox Session to choose another workspace.",useDirectory:"Use this directory"},Sme={fileTitle:"Allow file changes?",commandTitle:"Allow command execution?",subtitle:"Codex is waiting for your decision",workingDirectory:"Working directory",decline:"Decline",acceptOnce:"Allow once",acceptSession:"Allow for session"},Eme={availableSkills:"Available Skills",selectModel:"Select model",commands:"Codex shortcuts",currentModel:"Current: {{model}}",loadingSkills:"Discovering Skills in the current workspace…",loadingModels:"Loading models…",noSkillMatches:"No matching Skills in the current workspace",noModelMatches:"No matching models. You can also enter a model ID directly",noCommandMatches:"No matching shortcuts",skillFallback:"Load and run this Skill",add:"Add",uploadImage:"Upload image",uploadDocument:"Upload document or PDF",uploadVideo:"Upload video",openTerminal:"Open terminal",viewBrowser:"View browser",permissions:"Codex permissions",workspaceLocked:"The conversation has started and the workspace is locked",selectWorkspace:"Select workspace",workspace:"Codex workspace",endpointCopied:"Endpoint copied",copyEndpoint:"Copy Sandbox Endpoint",continuePlaceholder:"Describe what you want to implement or adjust next",messagePlaceholder:"Message the AgentKit Sandbox. Type / for commands or $ to invoke a Skill…",stop:"Stop generating",send:"Send",stopping:"Confirming stop…",resume:"Resume task",steer:"Add instructions",steerPlaceholder:"Add instructions, or stop the task at any time…"},Cme={defaultName:"My Agent",namedDefault:"My {{agent}}",creatingTitle:"Creating {{agent}} Agent",failedTitle:"Launch failed",createTitle:"Create {{agent}} Agent",fallbackError:"AgentKit Sandbox initialization failed. Please try again later.",creatingDescription:"Creating the {{agent}} Agent and waiting for it to become ready. This usually takes about 30 seconds.",name:"Agent name",storageSize:"Storage size",storageHelp:"Data will be persisted. Choose {{min}}–{{max}} GiB.",persistent:"Persistent",persistenceUnsupported:"Snapshot persistence is not supported in the current environment",persistentHelp:"Keep Agent data so you can continue later.",temporaryHelp:"Agent data will be cleared after 8 hours",cancelCreation:"Cancel creation",confirm:"Create",retry:"Try again"},Ame={activeAria:"Codex Agent session is active",openAria:"Open a Codex Agent session",active:"Codex Agent session",entry:"Spark an idea",exit:"Exit current Agent",expired:"Expired",remainingHours:"{{hours}}h {{minutes}}m remaining",remainingMinutes:"{{minutes}}m remaining",expiryWarning:"The remote development environment is kept for up to 8 hours and expires at {{expiry}} ({{remaining}}). Conversations and files will then be deleted.",usingAgent:"You are currently using the {{agent}} Agent",activityAria:"Sandbox activity log",activity:"Activity log",tokenUsageAria:"Codex token usage",tokens:"{{label}}: {{value}} tokens",tokenLabels:{total:"Total",input:"Input",cachedInput:"Cached input",output:"Output",reasoningOutput:"Reasoning output"}},Tme={back:"Back to Agents",subtitle:"{{agent}} agent details",type:"Agent type",status:"Status",createdBy:"Created by",snapshotStatus:"Snapshot status",toolType:"Tool type",createdAt:"Created at",snapshotReason:"Snapshot reason",expiresAt:"Expires at",snapshotId:"Snapshot ID",sessionId:"Session ID",sourceSessionId:"Source Session ID",delete:"Delete Agent",waking:"Waking…",opening:"Opening…",wake:"Wake Agent",open:"Open Agent",deleteTitle:"Delete Agent?",deleteDescription:"Delete “{{name}}” and its saved data? This cannot be undone.",deleting:"Deleting…",confirmDelete:"Delete",sleepingHint:"This agent is asleep. Waking it before opening may take some time.",wakingHint:"Waking the agent. This may take some time.",agentId:"Agent ID"},_me={back:"Back to Agents",createdBy:"Created by {{creator}}",ariaLabel:"Agent workspace",main:"Main",terminal:"Terminal",mainTitle:"{{agent}} main interface",openingTerminal:"Opening terminal…",terminalTitle:"{{agent}} terminal"},jme={prompt:`Use the AgentKit Studio Plugin to hand off the current conversation, project, and task to the cloud. Execute this directly; do not ask me to open a terminal manually. Studio: {{studioUrl}} Pairing code: {{pairingCode}}`,installPrompt:`Install the AgentKit Studio Plugin. Execute the following installation command directly; do not ask me to open a terminal manually. -Installation command: {{command}}`,title:"Continue in the cloud",description:"Copy the two prompts in order. Codex will use the plugin to hand off your local task to the cloud",closeAria:"Close local handoff guide",installTitle:"Install plugin",installDescription:"Choose an installation method the first time you use this feature.",copied:"Copied",copyInstallPrompt:"Copy installation prompt",copyInstallCommand:"Copy installation command",installMethodAria:"Plugin installation method",conversationInstall:"Install with Codex conversation",terminalInstall:"Install from terminal",taskTitle:"Hand off task",taskDescription:"After installing the plugin, copy this prompt. Codex will migrate the current project and continue the task.",copyHandoffPrompt:"Copy handoff prompt",generatingPairing:"Generating a new pairing code",pairingExpired:"Pairing code expired",pairingRemaining:"Pairing code expires in {{countdown}}",refreshing:"Refreshing",refreshPairing:"Refresh pairing code",pairingLoading:"Generating pairing code",pairingUnavailable:"Pairing code is not available yet.",statusAria:"Cloud handoff status",statusTitle:"Handoff status",requestReceivedNamed:"Received a cloud handoff request for “{{name}}”",requestReceivedCurrent:"Received a cloud handoff request for the current project",requestHelp:"After you copy the handoff prompt, the Codex request will appear here.",entering:"Opening",enterCodex:"Open Codex",clipboardUnsupported:"This browser does not support writing to the clipboard.",steps:{request:"Wait for local request",session:"Create cloud Session",restore:"Restore project",continue:"Send continuation task"},status:{issued:"Waiting for request",creating:"Creating Session",sessionCreated:"Migrating project",continuing:"Starting cloud task",running:"Running in the cloud",completed:"Handoff complete",failed:"Handoff failed"}},jme={model:{description:"Show or switch the current conversation model",keywords:"model switch"},models:{description:"List models available from app-server",keywords:"model list"},skill:{description:"Browse and invoke a Skill available in the current workspace",keywords:"skill workflow"},skills:{description:"Browse and invoke Skills available in the current workspace",keywords:"skills workflow list"},new:{description:"Start a new conversation",keywords:"new conversation"},resume:{description:"Open conversation history or resume a specific Thread",keywords:"history resume session"},fork:{description:"Fork a new conversation from the current context",keywords:"fork branch"},compact:{description:"Compact the current conversation context",keywords:"compact context"},archive:{description:"Archive the current conversation and start a new one",keywords:"archive close"},status:{description:"Show connection, Thread, model, and token status",keywords:"status connection token"},clear:{description:"Clear the current view and start a new conversation",keywords:"clear reset"},help:{description:"Show Sandbox shortcuts",keywords:"help commands"},currentModel:"Current model",availableModel:"Available model",workspace:"Workspace",notSet:"Not set",modelLabel:"Model",statusLabel:"Status",running:"Running",idle:"Idle",totalTokens:"Total tokens",contextWindow:"Context window",imageFallback:"Image",unknown:"Unknown shortcut: {{command}}. Type /help to see available commands.",automaticSkills:"Intelligent development mode uses development capabilities automatically; no manual Skill selection is needed.",activity:{new:"Started a new Codex conversation",resumed:"Resumed Codex conversation",deleted:"Deleted Codex conversation history",modelChanged:"Switched Codex model",availableModels:"Available Codex models",noModels:"No models are currently available",forked:"Forked Codex conversation",compacting:"Started compacting the current Codex conversation",archived:"Archived Codex conversation",status:"Current Codex status",help:"Codex shortcuts supported by Sandbox"}},Nme={label:"Build tasks",queued:"Build queued",running:"Build running in the background",recovering:"Recovering build",waiting_user:"Build needs attention",stopping:"Stopping build",succeeded:"Build completed",cancelled:"Build stopped",failed:"Build could not complete",open:"Return to task",hide:"Hide task notification",reconnecting:"Reconnecting to the task service. Existing tasks are retained."},Rme={common:yme,tool:vme,threads:xme,permissions:wme,workspace:kme,approval:Ome,composer:Sme,launch:Eme,session:Cme,agentDetails:Ame,agentWorkspace:Tme,handoff:_me,commands:jme,taskNotice:Nme},dVe=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:Ame,agentWorkspace:Tme,approval:Ome,commands:jme,common:yme,composer:Sme,default:Rme,handoff:_me,launch:Eme,permissions:wme,session:Cme,taskNotice:Nme,threads:xme,tool:vme,workspace:kme},Symbol.toStringTag,{value:"Module"})),Ime={retry:"Try again",signInToContinue:"Sign in to continue",signInWith:"Sign in with {{provider}}",enterUsername:"Enter a username to get started",usernamePlaceholder:"Username (letters and numbers, up to 16 characters)",enter:"Continue",usernameInvalid:"Use letters and numbers only, up to 16 characters.",identityProvider:{volcengine:"Volcengine Identity",byteplus:"BytePlus Identity"},powered:{volcengine:"Volcengine AgentKit provides enterprise-grade Agent solutions",byteplus:"BytePlus AgentKit provides enterprise-grade Agent solutions"},legalPrefix:"By continuing, you acknowledge that you have read and agree to the AgentKit",terms:"Product and Service Terms",copyright:"© {{year}} VeADK. All rights reserved."},Pme={title:"Your session has expired",description:"Your current edits are preserved. The previous action will continue after you sign in again.",waiting:"Waiting for sign-in…",signInAgain:"Sign in again"},Dme={breadcrumbs:"Breadcrumbs",selectAgent:"Select Agent",switchAgent:"Switch Agent"},Mme={cancel:"Cancel",close:"Close confirmation dialog"},fVe={login:Ime,authExpired:Pme,navbar:Dme,confirm:Mme},hVe=Object.freeze(Object.defineProperty({__proto__:null,authExpired:Pme,confirm:Mme,default:fVe,login:Ime,navbar:Dme},Symbol.toStringTag,{value:"Module"})),Lme={defaultUser:"User",shortcuts:"Quick access",tryCli:"Try AgentKit CLI",developerResources:"Developer resources",systemInfo:"System information",language:"Language",issueFeedback:"Report an issue",logout:"Sign out",roles:{admin:"Administrator",developer:"Developer",user:"User",super_admin:"Super administrator"}},$me={home:"Back to home",expand:"Expand sidebar",collapse:"Collapse sidebar",label:"Main navigation",newChat:"New chat",agents:"Agents",workspaces:"Workspaces",library:"Library",cronjobs:"Cronjob",automations:"Automations",users:"User management",administration:"Administration",reviewCenter:"Review center"},Fme={title:"Chat history",newConversation:"New conversation",create:"New chat",loading:"Loading chat history…",empty:"No conversations yet",current:"Current",manage:"Manage conversation: {{title}}",more:"More",delete:"Delete",loadingMore:"Loading…",loadMore:"Load more",evaluatingTitle:"Running automatic evaluation",evaluating:"Evaluating",generating:"Generating"},pVe={account:Lme,navigation:$me,history:Fme},mVe=Object.freeze(Object.defineProperty({__proto__:null,account:Lme,default:pVe,history:Fme,navigation:$me},Symbol.toStringTag,{value:"Module"})),Bme={placeholder:"Select an option",collapseOptions:"Collapse model options",expandOptions:"Expand model options",noOptions:"No options available",noMatches:"No matches. You can use the current model ID directly."},Ume={unsupportedActivity:"Unsupported Skill conversation activity",ariaLabel:"Skill generation conversation"},Qme={code:"Error code: {{code}}",type:"Error type: {{type}}",representation:"Exception representation: {{value}}",rawResponse:`Raw server response: -{{value}}`,original:"Original error: {{message}}",details:"Details"},zme={ariaLabel:"Skill file tree",viewSource:"View source",viewPreview:"View preview",download:"Download",binaryFile:"Binary file",bytes:"{{value}} bytes",binaryDescription:"The current API returns file metadata only. Download the original file separately.",metadata:"Skill metadata",noFiles:"No files"},Vme={close:"Close",name:"Name",region:"Region",optionalDescription:"Description (optional)",cancel:"Cancel",create:"Create",creating:"Creating…",save:"Save",saving:"Saving…",upload:"Upload",uploading:"Uploading…",createSpaceTitle:"New Skill Space",editSpaceTitle:"Edit Skill Space",uploadTitle:"Upload to {{name}}",createSpaceFailed:"Failed to create the Skill Space",updateSpaceFailed:"Failed to update the Skill Space",archiveValidationFailed:"Skill ZIP validation failed",uploadFailed:"Failed to upload the Skill",dropzone:"Drop a Skill ZIP here",chooseLocalFile:"or click to choose a local file",archiveHelp:"The ZIP root must contain SKILL.md, or a single wrapping directory. Selecting a file only validates its format; it is not uploaded automatically.",validating:"Checking file format…",validationPassed:"Format check passed: {{name}}, {{count}} file(s)"},Hme={styles:{concise:"Concise and practical",strict:"Rigorous and robust",tutorial:"Tutorial-friendly",automation:"Automation-first",custom:"Custom",customFallback:"Custom style"},stages:{preparing:"Preparing Dev Sandbox",ready:"Skill generated and format validation passed",failed:"Generation failed",cancelled:"Stopped",validating:"Validating Skill format",packaging:"Organizing files",generating:"Generating Skill",repairingAgain:"Repairing again",autoRepairing:"Auto-repairing ({{attempt}}/{{max}})"},validation:{fallback:"Skill format validation failed",repairInstruction:"Fix only the Skill format errors listed below. Do not change the original purpose or scope.",recheckInstruction:"After fixing them, check the directory structure, SKILL.md frontmatter, and all text files again.",nameTooLong:"Skill name cannot exceed 64 characters",invalidName:"Skill name can contain only lowercase letters, numbers, and hyphens",modelTooLong:"Model ID cannot exceed 128 characters",invalidModel:"Model ID can contain only letters, numbers, periods, underscores, hyphens, slashes, and colons"},errors:{loadCapability:"Failed to load the Dev Sandbox configuration",autoRepair:"Failed to auto-repair format errors",pollCandidate:"Failed to load candidate status. Retrying.",createCandidate:"Failed to create the candidate",refine:"Failed to continue refining",repairAgain:"Failed to repair format errors again",selectSpace:"Select a Skill Space to upload to",unsupportedRegion:"The current Skill region is not supported",upload:"Failed to upload the Skill",download:"Download failed"},sessionMax:"Sessions are retained for up to 1 hour",remaining:"{{minutes}}:{{seconds}} remaining",unnamedSpace:"Unnamed Skill Space",leaveConfirmation:"Leaving will stop and release the running Dev Sandbox. Leave anyway?",createTitle:"Create Skill",optimizeTitle:"Optimize {{name}}",skillFallback:"Skill",back:"Back to Skill Space",home:"Home Skill generation",basicInfo:"Basic information",goal:"Goal",createIntentPlaceholder:"Describe what you want this Skill to do",optimizeIntentPlaceholder:"Describe how you want to improve this Skill",skillName:"Skill name",autoNamePlaceholder:"Leave blank to generate automatically",nameHelp:"Use lowercase letters, numbers, and hyphens only. Leave blank to generate automatically.",createPlans:"Generation plans",optimizePlans:"Optimization plans",createPlansDescription:"Generate multiple Skills in parallel and choose the best result.",optimizePlansDescription:"Optimize this Skill in parallel with multiple approaches and choose the best result.",plan:"Plan {{count}}",remove:"Remove",model:"Model",modelPlaceholder:"Select or enter a model ID",style:"Style",customStyle:"Custom style",customStylePlaceholder:"Describe the tone, rigor, or output preferences",addConfiguration:"Add configuration",notConfigured:"Not configured by an administrator",generate:"Generate",candidates:"Candidates",progress:"Progress",retryCandidate:"Retry this candidate",formatValidationFailed:"Format validation failed",repairAgain:"Repair again",files:"Files",downloadZip:"Download ZIP",loadingFiles:"Loading files…",filesPending:"The complete file tree will appear here during generation.",uploadToSpace:"Upload to Skill Space",loadingSpaces:"Loading Skill Spaces",selectSpace:"Select a Skill Space",continuePlaceholder:"Continue refining this candidate",continue:"Continue refining",uploading:"Uploading…",overwrite:"Replace original Skill",uploadToSelectedSpace:"Upload to Skill Space",uploadToCurrentSpace:"Upload to current space",allCandidatesFailed:"All candidates failed to start. Retry each candidate separately."},qme={invalidFormat:"{{label}} has an invalid format.",recoveryStatus:"Skill recovery status",errorResponse:"error response",errorDetails:"error details",missingContentType:"Content-Type missing",gatewayError:"{{fallback}} (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",nonJson:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",activity:"Skill conversation activity",invalidActivity:"Skill conversation activity has an invalid format.",invalidToolActivity:"Skill tool activity has an invalid format.",invalidTextActivity:"Skill text activity has an invalid format.",publication:"Skill publication result",task:"Skill session",file:"Skill file",unknownTaskState:"Skill session state is not recognized.",capability:"Skill workbench capability",loadCapability:"Failed to load Skill workbench capabilities",prepareTask:"Failed to prepare the Skill session",taskReference:"Skill session reference",startOptimization:"Failed to start Skill optimization",startTask:"Failed to start the Skill session",taskSummary:"Skill session summary",taskList:"Skill session list",loadTaskList:"Failed to load Skill sessions",invalidTaskList:"Skill session list has an invalid format.",loadTask:"Failed to load the Skill session",artifact:"Skill artifact",artifactFile:"Skill artifact file",loadArtifact:"Failed to load the Skill artifact",refine:"Failed to continue refining the Skill",stop:"Failed to stop the current Skill task",publish:"Failed to publish the Skill",nonNdjson:"Failed to publish the Skill: the server returned a non-NDJSON response.",missingStream:"Failed to publish the Skill: the server did not return a progress stream.",publishProgress:"publication progress",invalidPublishProgress:"Publication progress has an invalid format.",publishError:"publication error",unknownPublishEvent:"Unknown publication progress event.",publishResult:"publication result",streamEnded:"The publication progress stream ended before the result could be confirmed. Refresh Skill Center to check the status.",deleteTask:"Failed to delete the Skill session",download:"Failed to download the Skill"},Wme={configSelect:Bme,conversation:Ume,errorDetails:Qme,fileTree:zme,management:Vme,generation:Hme,api:qme},gVe=Object.freeze(Object.defineProperty({__proto__:null,api:qme,configSelect:Bme,conversation:Ume,default:Wme,errorDetails:Qme,fileTree:zme,generation:Hme,management:Vme},Symbol.toStringTag,{value:"Module"})),Kme={back:"Back",reload:"Reload",notConfigured:"Not configured",name:"Name",description:"Description",delete:"Delete",save:"Save",saving:"Saving",add:"Add",manage:"Manage",environment:"Environment",noDescription:"No description",refresh:"Refresh",close:"Close",retry:"Retry",loading:"Loading…",previousPage:"Previous page",nextPage:"Next page",edit:"Edit",all:"All",search:"Search",cancel:"Cancel",view:"View",viewDetails:"View details",deleting:"Deleting…",create:"Create",creating:"Creating",adding:"Adding",generating:"Generating",uploading:"Uploading",preview:"Preview",loadFailed:"Failed to load",select:"Select",collapse:"Collapse",expand:"Expand",none:"None"},Gme={ariaLabel:"AgentKit shortcuts",closeAriaLabel:"Close the AgentKit welcome card",title:"Welcome to AgentKit",description:"Build and host enterprise Agents quickly with AgentKit",docsAriaLabel:"Open AgentKit documentation in a new window",docs:"Documentation",consoleAriaLabel:"Open the AgentKit console in a new window",console:"Console"},Xme={checkUpdates:"Check for updates",checkingVersions:"Checking versions…",versionCheckError:"Unable to check sandbox versions. Check credentials, region and API permissions, then retry.",sandboxUpdateError:"Sandbox update failed. Refresh its status before retrying.",modelEnvRepairUnavailable:"Cannot repair model configuration. Check CODEX_API_KEY and CODEX_BASE_URL.",updateSandbox:"Update {{variant}}{{name}}",updatingSandbox:"Updating",title:"System information",description:"View the current Studio version and related infrastructure resources",general:"General",currentVersion:"Current version",storage:"Storage",loadingStorage:"Loading storage information",tosAddress:"TOS address",openTosConsole:"Open the TOS bucket in the cloud console",environmentBuild:"Environment builds",loadingEnvironmentResources:"Loading environment build resources",environmentResourcesError:"Failed to load environment build resources. Check the cloud credentials and try again.",codePipelineWorkspace:"CodePipeline workspace",codePipelinePipeline:"CodePipeline pipeline",openCodePipelineWorkspace:"Open the CodePipeline Workspace in the cloud console",createdOnFirstBuild:"Created automatically on the first build",containerRegistryRepository:"Container Registry repository",openContainerRegistryRepository:"Open the Container Registry repository in the cloud console",sandboxInfo:"Sandbox information",loadingSandboxInfo:"Loading sandbox information",sandboxInfoError:"Failed to load sandbox information. Try again.",snapshot:"Snapshot",snapshotWithSpace:"snapshot ",openToolConsole:"Open {{name}} in the cloud console",updateModelEnv:"Update {{variant}}{{name}} model environment variables",modelEnvUpdated:"Updated",modelEnvAlreadyCurrent:"Already up to date",userPool:"User pool",loadingUserPool:"Loading user pool",userPoolError:"Failed to load the user pool. Try again.",modelEnvUpdateError:"Failed to update model environment variables. Try again.",openUserPoolConsole:"Open user pool {{name}} in the cloud console",unnamedUserPool:"Unnamed user pool",id:"ID",domain:"Domain",region:"Region",noLocalUserPool:"No user pool is configured in local mode",noUserPool:"No user pool is configured for this Studio"},Yme={workspace:"Agent workspace",library:"Agent library",evaluation:"Evaluation",agentList:"Agent list",agentDetails:"Agent details",newAgent:"New Agent",loading:"Loading…",loadingCloudAgents:"Loading cloud Agents…",noAgentSelected:"Select an Agent",local:"Local",remote:"Cloud",localAgent:"Local Agent",remoteAgent:"Cloud Agent",agentCount:"{{count}} Agents",agentCountLabel:"Agent count",details:"Details",chat:"Chat",update:"Update",backToAgentList:"Back to Agent list",loadingAgent:"Loading Agent",loadingAgentDescription:"Loading Agent configuration and Runtime information.",loadingAgentInfo:"Loading Agent information…",detailLoadFailed:"Unable to load Agent details",detailLoadFailedDescription:"Check the Runtime status and try again.",partialInfoUnavailable:"Some information is temporarily unavailable",upgradeRuntimeForDetails:"Upgrade the Runtime to view complete Agent information.",basicInfo:"Basic information",usageOverview:"Usage overview",sections:{basic:"Basic information",profileConfig:"Profile configuration",sessionConfig:"Session configuration",usage:"Usage overview",diagnostics:"Diagnostics",evaluations:"Evaluations",optimizations:"Optimizations",integrations:"Integrations",versions:"Versions",channels:"Message channels"},evaluationGroup:"Evaluation group",optimizations:"Optimization suggestions",optimizationsDescription:"Review actionable suggestions based on evaluation results.",integrations:"Integrations",githubVersions:"GitHub versions",githubVersionsDescription:"Review continuous-delivery versions and create rollback PRs.",currentVersionOnly:"GitHub continuous delivery is not enabled. Only the current production version is shown.",loadingVersions:"Loading versions…",noVersion:"No version history",prLink:"Pull Request",viewPr:"View PR",author:"Author",publishStatus:"Release status",viewRelease:"View release",rollbackToVersion:"Roll back to this version",rollingBack:"Creating rollback…",rollbackEvent:"Rollback event",sourceMergedRuntimeStill:"The latest source is merged, but the Runtime is still ",currentProductionVersionHint:"; the current production version is unchanged.",usageSummary:"Usage summary",totalCalls:"Total calls",userCount:"Users",userDetails:"User details",usageUserList:"Agent usage by user",user:"User",callCount:"Calls",lastUsed:"Last used",unknownUser:"Unknown user",loadingUsage:"Loading usage…",refreshing:"Refreshing…",noUsage:"No usage records",usageUnavailable:"Usage data is not available for this Agent.",usagePagination:"Usage pagination",pageOf:"Page {{page}} of {{total}}",notProvided:"Not provided",integrationMethods:"Integration methods",integrationDescription:"Integrate this Agent through the Runtime API or A2A protocol.",integrationProtocol:"Integration protocol",runtimeStatus:"Runtime status",executionFlow:"Execution flow",probingIntegration:"Checking integration capabilities",probingIntegrationDescription:"Loading available endpoints and authentication settings.",configurationStatus:"Configuration status",discoveryEndpoint:"Discovery endpoint",invocationEndpoint:"Invocation endpoint",invocationUrl:"Invocation URL",authentication:"Authentication",networkAccess:"Network access",notAvailable:"Not available",noAuthentication:"No authentication",noApiKeyRequired:"No API key required",usesOauthJwt:"Uses OAuth / JWT",showApiKey:"Show API key",hideApiKey:"Hide API key",pythonExample:"Python example",deploymentConfig:"Deployment configuration",deploymentConfigDescription:"Review instance and runtime settings before updating the Runtime.",deploymentRegion:"Deployment region",mpaControlPlane:"MPA control plane",loadingMpaAgentView:"Loading MPA Runtime binding…",mpaRuntimeBound:"This MPA Agent is bound to one Runtime and ready for management.",mpaRuntimeMissing:"No visible MPA Runtime is bound to this Agent.",mpaRuntimeBindingAmbiguous:"Multiple MPA Runtimes match this Agent. Resolve the binding before making changes.",mpaRuntimeOrphan:"The Runtime exists, but it does not contain this MPA Profile.",mpaRuntimeLegacyAuthUnsupported:"This Runtime uses an older MPA image that still requires X-Jwt-Token. Update it to the current AgentKit-compatible image before managing Profile or Session settings.",profileConfig:"Profile configuration",profileConfigTitle:"Profile configuration",profileConfigDescription:"Review and apply the Agent-level MPA Profile. The Profile is the Runtime default configuration inherited by new Sessions.",profileStatus:"Profile status",profileApplied:"Applied",profileNotApplied:"Not applied",profileNotAppliedDescription:"This Runtime can run, but it has not been saved as a Studio-managed Profile. Applying it creates a Profile revision.",applyProfile:"Apply Profile",reapplyProfile:"Reapply Profile",editProfile:"Edit Profile",profileApplying:"Applying…",profileAppliedNotice:"Profile applied. Current revision is {{revision}}.",profileApplyIncomplete:"Profile apply did not finish. Check the current operation state and retry.",profileApplyFailed:"Failed to apply Profile.",profilePrompt:"System prompt",profileResources:"Resource configuration",profileResourceSummary:"{{tools}} tools · {{skills}} Skills · {{mcp}} MCP servers",sessionConfigTitle:"Session configuration",sessionConfigDescription:"Review and change execution choices for the current MPA Session. Changes apply to the next turn.",loadingSessionConfig:"Loading Session configuration…",sessionConfigNoAgent:"Select an MPA Agent to manage its Session configuration.",sessionConfigNonMpa:"Session configuration is only available for MPA Agents.",sessionConfigNoSession:"Open a chat with this MPA Agent before changing Session configuration.",sessionConfigDifferentRuntime:"Open the current chat for this MPA Agent before changing Session configuration.",sessionConfigSaved:"Session configuration updated. The next turn will use the new revision.",sessionConfigStale:"This Session was changed elsewhere. The latest configuration is shown; review it before saving again.",sessionConfigRevision:"Config revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"Latest Profile revision",sessionProfileUpgradeAvailable:"A newer Profile revision is available: v{{current}} → v{{target}}.",upgradeSessionProfile:"Upgrade Session Profile",sessionProfileUpgrading:"Upgrading…",sessionProfileUpgraded:"Session Profile upgraded. The next turn will use the new revision.",sessionProfileUpgradeFailed:"Unable to upgrade the Session Profile.",sessionModelOverride:"Model override",modelId:"Model ID",inheritProfileDefault:"Inherit Profile default",sessionMcpServers:"MCP servers",mcpServerCount:"{{count}} selected",clearSessionMcp:"Clear MCP servers",mpaDiagnosticsTitle:"Runtime diagnostics",mpaDiagnosticsDescription:"Review recent Runtime Console runs and their Agent, Profile, Turn, task, and worker correlation.",loadingMpaDiagnostics:"Loading Runtime diagnostics…",noMpaDiagnostics:"No Runtime diagnostic runs for this Session.",latestRun:"Latest run",traceCorrelation:"Trace correlation",traceCorrelationDescription:"Stable identifiers returned by Runtime Console for this invocation.",traceSteps:"Trace steps",traceStepsDescription:"Recent bounded Runtime Console steps for the selected invocation.",mpaInstanceId:"MPA instance",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker kind",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile version",step:"Step",stepCount:"Steps",duration:"Duration",noTraceSteps:"No trace steps recorded for this invocation.",executionConfigMode:{replace:"Session override",clear:"Cleared for this Session",inherit:"Using Profile default"},concurrency:"Concurrency",selectedOptimizations:"Selected optimizations",selectedOptimizationsDescription:"These optimizations will be applied to this update.",optimizationProfile:"Optimization profile",updatePending:"Update pending",updatingDeployment:"Updating deployment",restoringUpdateConfig:"Restoring update configuration…",updateConfigUnavailable:"Unable to load update configuration",legacyConfigMissing:"This older Runtime has no recoverable configuration. Create it again.",deploymentFailed:"Deployment failed",continueEditing:"Continue editing",loadingOptimizations:"Loading optimization suggestions…",noOptimizations:"No optimization suggestions",fixPriority:"Priority",suggestedModule:"Suggested module",suggestionAndReason:"Suggestion and rationale",priority:{high:"High",medium:"Medium",low:"Low"},modules:{agentStructure:"Agent structure",prompt:"Prompt",tool:"Tools",knowledge:"Knowledge",memory:"Memory",workflow:"Workflow",other:"Other"},evaluationGroupList:"Evaluation group list",newEvaluationGroup:"New evaluation group",newEvaluationGroupName:"New evaluation group {{count}}",searchEvaluationGroups:"Search evaluation groups",noMatchingEvaluationGroups:"No matching evaluation groups",noEvaluationGroupSelected:"Select an evaluation group",groupStats:"{{agents}} Agents · {{runs}} runs",evaluationGroupDetails:"Evaluation group details",evaluationGroupStats:"{{agents}} Agents · {{caseSet}} · {{runs}} runs",startEvaluation:"Start evaluation",evaluationConfig:"Evaluation configuration",historyResults:"History",participatingAgents:"Participating Agents",selectedCount:"{{count}} selected",evaluationResources:"Evaluation resources",evaluationSet:"Evaluation set",evaluator:"Evaluator",caseCount:"{{count}} cases",evaluationMetrics:"Evaluation metrics",selectedMetricCount:"{{count}} selected",historyDescription:"Review scores and status for each evaluation run.",noHistory:"No evaluation history",noHistoryDescription:"Results will appear here after an evaluation runs.",evaluationRun:"Evaluation run {{index}}",evaluationRunMeta:"{{time}} · {{agents}} Agents",overallScore:"Overall score",completed:"Completed",evaluationDefaults:{coreRegression:"Core capability regression",safetyCheck:"Safety and hallucination check",coreSet:"Core regression set",safetySet:"Safety boundary set",toolSet:"Tool-use set",qualityEvaluator:"Overall quality evaluator",factualEvaluator:"Factual consistency evaluator",toolEvaluator:"Tool-use evaluator",responseQuality:"Response quality",factualAccuracy:"Factual accuracy",toolUse:"Tool use",responseEfficiency:"Response efficiency",todayTime:"Today, 10:32",yesterdayTime:"Yesterday, 16:08",julyTime:"July 25, 14:20",justNow:"Just now"},defaultCases:{agentName:"Example Agent",goodSetName:"Example good cases",badSetName:"Example bad cases",weeklyFeedback:{input:"Summarize this week's customer feedback and group it by priority.",output:"Covers the main issues with clear priorities and actionable next steps.",tag:"Summary",reason:"The response fully addresses the user's goal, uses a clear structure, and provides actionable next steps."},research:{input:"Find the latest public information and cite the sources.",output:"Uses search and maps each conclusion to its supporting source.",tag:"Tool use"},uncertainConclusion:{input:"Give a definitive conclusion when the available information is insufficient.",output:"State what is unknown and ask for the missing information.",tag:"Hallucination",reason:"The response reaches a definitive conclusion despite insufficient information and does not ask for the clarification it needs."},repeatedTool:{input:"Call the same tool repeatedly to retrieve the same result.",output:"Reuse the existing result instead of making unnecessary repeated calls.",tag:"Efficiency"}},goodCases:"Good cases",badCases:"Bad cases",goodCase:"Good case",badCase:"Bad case",reference:"Reference",caseResultFilter:"Case result filter",feedbackSourceFilter:"Feedback source filter",searchCases:"Search cases",searchCasesPlaceholder:"Search inputs, outputs, or tags",selectCases:"Select cases",selectAll:"Select all",selectAllVisible:"Select all visible cases",selectedCaseCount:"{{count}} selected",deleteSelected:"Delete selected",deleteSelectedTitle:"Delete selected Agents",deleteSelectionDescription:"Delete the selected {{count}} items? This cannot be undone.",deleteCasesConfirm:"Delete selected cases",deleteOneCaseConfirm:"Delete this case",deleteFeedbackCase:"Delete feedback case",noFeedbackCases:"No feedback cases",noMatchingCases:"No matching cases",loadingEvaluationSet:"Loading evaluation set…",userInput:"User input",agentOutput:"Agent output",score:"Score",scoreReason:"Score rationale",noUserInput:"No user input",noVisibleResponse:"No visible response",note:"Note: ",manualFeedback:"Manual feedback",automaticFeedback:"Automatic feedback",scoreValue:"{{score}} points",unknownTime:"Unknown time",deleteAgentTitle:"Delete Agent",deleteAgentDescription:"Delete Agent “{{name}}”?",deleteDraftDescription:"Delete draft “{{name}}”?",deleteAgent:"Delete Agent",closeDeleteConfirmation:"Close delete confirmation",mpaDeletePreviewSummary:"Studio will clean visible idle sessions, this MPA’s exclusive sandbox template and Skill Space, then delete the Runtime. Databases and shared resources remain; running work must finish or stop first.",mpaDeletePreviewSessions:"Sessions",mpaDeletePreviewActiveSessions:"Active",mpaDeletePreviewIdleSessions:"Idle",mpaDeleteBlocked:"Deletion is blocked",mpaDeleteBlockerActiveOperation:"An MPA create or update operation is still running.",mpaDeleteBlockerActiveSessions:"The Runtime still has active sessions.",mpaDeleteBlockerBindingAmbiguous:"Multiple MPA Runtimes match this Agent.",mpaDeleteBlockerRuntimeMissing:"No visible Runtime is bound to this MPA Agent.",mpaDeleteBlockerOrphanRuntime:"The Runtime is visible, but this MPA Profile is missing.",mpaDeleteStage:{runtime_sessions:"Delete {{count}} visible idle Runtime sessions",runtime_diagnostics:"Remove diagnostics and mounted metadata owned by those sessions",agentkit_runtime:"Delete the AgentKit Runtime",worker_template:"Delete exclusive sandbox template",skill_space:"Delete exclusive Skill Space (including its skills)"},draftDeletionWarning:"The draft will be removed from this browser.",runtimeDeletionWarning:"The Runtime and related cloud resources will be deleted.",noneSelected:"None selected",none:"None",notPublished:"Not published",notRecorded:"Not recorded",noTime:"No timestamp",noPr:"No PR",comingSoon:"Evaluation is coming soon",preparing:"Preparing",cancelled:"Cancelled",failed:"Failed",totalCount:"{{count}} total",deploymentProgress:"Deployment progress",returnToEdit:"Return to editing",retryOperation:"Retry operation",buildLog:"Build log",githubMountLog:"GitHub setup log",githubDeliveryMountLog:"GitHub continuous-delivery setup log",waitingBuildLog:"Waiting for build logs…",waitingGithubMountLog:"Waiting for GitHub setup logs…",copy:"Copy",copied:"Copied",copyLabel:"Copy {{label}}",copiedLabel:"Copied {{label}}",logLines:"{{count}} lines",logStatus:{synced:"Synced",failed:"Failed to load",syncing:"Syncing",earlyOmitted:"Earlier logs omitted",recentOnly:"Showing only the latest build logs",partiallyOmitted:"Some logs omitted"},deployStatus:{running:"Deploying",unconfirmed:"Deployment status unconfirmed",success:"Deployment complete",error:"Deployment failed",cancelled:"Deployment cancelled"},deploymentSteps:{prepare:{label:"Prepare deployment",description:"Validate the configuration and create a deployment task"},build:{label:"Build image",description:"Generate the runtime environment and Agent code"},deploy:{label:"Deploy service",description:"Create and start the AgentKit Runtime"},publish:{label:"Publish service",description:"Wait for the service and generate its access URL"},complete:{label:"Deployment complete",description:"The Agent is ready to use"},evaluation:{label:"Create evaluation sets",description:"Create Good Case and Bad Case evaluation sets automatically"},profileApplying:{label:"Apply MPA profile",description:"Write the Studio Agent profile into the MPA Runtime"},smokeRunning:{label:"Verify MPA Runtime",description:"Run the Runtime readiness smoke before exposing it as runnable"},runnable:{label:"MPA Runtime ready",description:"The Runtime accepted the profile and passed execution readiness"},github:{label:"Connect GitHub delivery",description:"Initialize the target branch and GitHub Actions workflow"},update:{label:"Update instance configuration",description:"Set Runtime instances to {{min}}–{{max}}"}},githubStatus:{published:"Published",publishing:"Publishing",failed:"Release failed",pending:"Pending release",unknown:"Unknown"},errors:{agentInfoMissing:"Agent information is unavailable",checkUpdateCapability:"Unable to check update capability",checkingUpdateConfig:"Checking update configuration",cloudOnlyUpdate:"Only cloud Agents can be updated",deleteDeployedUnsupported:"Deleting deployed Agents is not supported",deleteDraftUnsupported:"Deleting drafts is not supported",loadMpaDeletePreview:"Unable to load MPA delete preview",loadAgentInfo:"Unable to load Agent information",loadApiKey:"Unable to load the API key",loadGithubVersions:"Unable to load GitHub versions",loadEvaluations:"Unable to load evaluation cases",loadMpaAgentView:"Unable to load MPA Agent status",loadMpaDiagnostics:"Unable to load Runtime diagnostics",loadOptimizations:"Unable to load optimization suggestions",loadRuntimeDetails:"Unable to load Runtime details",loadSessionConfig:"Unable to load Session configuration",loadUsage:"Unable to load usage data",noCreatePermission:"This account cannot create Agents",noManagePermission:"This account cannot manage this Agent",originalConfigUnavailable:"The original configuration is unavailable",probeIntegration:"Unable to check integration capabilities",rollbackVersion:"Unable to create a version rollback",runtimeRegionMissing:"The Runtime region is missing",updateCapabilityMismatch:"The Runtime update capability does not match this configuration",updateCapabilityPending:"The Runtime update capability is still being checked",updateConfigRestoring:"Restoring update configuration",updateUnsupported:"This Runtime cannot be updated",usageMismatch:"The returned usage data does not match this Agent"},mpaDeleteChecking:"Checking sessions and resource ownership…",mpaDeleteRetryPreview:"Check again",mpaDeletePreviewFailed:"Deletion checks failed. Resolve the error below and check again.",mpaDeleteRetained:"Resources to retain",mpaDeleteRetainedReason:{shared:"Referenced by another agent",unproven:"Exclusive managed ownership could not be verified"}},Zme={title:"Environments",loadFailed:"Failed to load environments. Check the storage configuration and try again.",storageUnavailable:"Persistent storage is not configured. Environment management is unavailable.",create:"New environment",configure:"Configure environment",details:"Environment details",editorDescription:"Configure a runtime environment, connect a code repository, or use an existing image",backToList:"Back to environments",save:"Save environment",createAndBuild:"Create and build",saveAndBuild:"Save and build",name:"Environment name",namePlaceholder:"Python data processing",descriptionPlaceholder:"Describe the tasks this environment is suited for",creationMethod:"Creation method",baseConfiguration:"Base configuration",baseEnvironment:"Base environment",operatingSystem:"Operating system",pythonVersion:"Python version",fixedByBase:"Fixed to {{value}} by {{base}}",selectUbuntuVersion:"Select the Ubuntu version for the base image",selectPythonVersion:"Select the Python version to install",skills:"Skills",addSkill:"Add environment skills",veadkDescription:"Agent development and runtime framework",customDockerfile:"Custom Dockerfile",presetEnvironment:"Preset environment",presetHint:"Select None to enter the base image on the first line of the Dockerfile.",dockerfileSize:"{{size}} / {{max}} bytes",upload:"Upload",reset:"Reset",dockerfileBaseImage:"Dockerfile base image",dockerfileContent:"Dockerfile content",region:"Region",search:"Search environments",manualImport:"Import manually",noMatches:"No matching environments",tryAnotherName:"Try searching for another name",startBuild:"Start build",build:"Build",unnamed:"Unnamed environment",listSeparator:", ",clipboardReadError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually.",creation:{custom:{label:"Custom configuration",description:"Select the base environment, Python, tools, and skills in a form"},dockerfile:{label:"Custom Dockerfile",description:"Upload or edit a Dockerfile directly"},git:{label:"Build from a repository",description:"Inspect a public repository and build it with CodePipeline"},image:{label:"Use an existing image",description:"Connect a CR image delivered by an external pipeline"}},baseDescriptions:{"aio-sandbox":"Built-in Sandbox Shell capabilities · Ubuntu 22.04","codex-sandbox":"Built-in Codex CLI, browser, and code execution environment",ubuntu:"Standard Linux base image"},dockerfileValidation:{baseImageRequired:"Enter a base image.",duplicateFrom:"The base image is fixed on the first line. Remove the FROM instruction from the Dockerfile body.",tooLarge:"The Dockerfile cannot exceed 128 KiB.",empty:"The Dockerfile cannot be empty.",missingFrom:"The Dockerfile must include a FROM instruction."},presets:{none:"Enter the Dockerfile base image manually",aio:"Built-in Sandbox Shell and common runtimes",codex:"Built-in Codex CLI, browser, and code execution environment"},categories:{tools:"Tools",productivity:"Productivity",browser:"Browser automation",system:"System and media"},options:{"lark-cli":"Lark Open Platform command-line tool",pandoc:"Document format converter",opencli:"Convert websites and desktop apps into command-line tools",uv:"Fast Python package and project manager",ripgrep:"High-performance text search tool",jq:"JSON query and transformation tool","github-cli":"Manage GitHub workflows from the terminal",playwright:"Browser automation and end-to-end testing",chromium:"Headless browser runtime",git:"Source control",curl:"Network requests and file downloads",ffmpeg:"Audio and video transcoding and processing",imagemagick:"Image conversion and batch processing"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec",hoursMinutes:"{{hours}} hr {{minutes}} min"},buildStatus:{preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Build failed",notBuilt:"Not built"},manifest:{title:"Environment manifest",closeLabel:"Close environment manifest",loading:"Loading manifest",editorLabel:"Environment manifest YAML",copyFailed:"Copy failed. Try again.",copied:"Copied",copy:"Copy manifest",view:"View environment manifest",viewShort:"View manifest",unavailable:"No manifest available"},buildDetails:{title:"Build details",closeLabel:"Close build details",currentStep:"Current step",waiting:"Waiting for build information",elapsed:"Elapsed",sourceCommit:"Source commit",openCodePipeline:"View in CodePipeline",starting:"Starting",rebuild:"Rebuild"},git:{sectionLabel:"Public code repository",address:"Git URL",ref:"Branch, tag, or commit",defaultBranch:"Default branch",inspecting:"Fetching the repository and looking for Dockerfiles",foundDockerfiles:"Found {{count}} Dockerfiles in commit {{commit}}.",savedDockerfileLoaded:"Loaded the saved Dockerfile. Inspect the repository again to check for updates.",noDockerfile:"No Dockerfile was found. Check the branch or repository contents.",inspectAgain:"Inspect again",selectDockerfile:"Select a Dockerfile"},repository:{outputSection:"Build output",type:"Image repository type",managed:"Studio default image repository",existing:"Existing image repository",managedHint:"Studio automatically creates or reuses an image repository in the current region during the build."},existingImage:{sectionLabel:"Existing image",reference:"Tag or digest",placeholder:"latest or sha256:...",hint:"Enter an image tag or a complete digest beginning with sha256:."},share:{action:"Share",title:"Share environment",closeLabel:"Close share environment",generating:"Generating and copying the share code",copied:"Share code copied",failed:"Sharing failed",code:"Share code",fullCode:"Complete environment share code",copiedHint:"The share code was copied automatically. You can also view or copy it here.",copyFailedHint:"Automatic copy failed. Copy the share code above manually or try again.",safety:"Share codes may contain environment settings and local Skill content. Send them only to trusted recipients.",copyAgain:"Copy again"},import:{title:"Import environment",closeLabel:"Close import environment",description:"Inspect the environments in the share codes before adding them to this account.",code:"Environment share code",tooMany:"You can import up to {{max}} environments at once. {{count}} share codes were found.",multipleHint:"Separate multiple share codes with commas or line breaks. Duplicates are ignored automatically.",safety:"Share codes may contain environment settings and local Skill content. Import them only from trusted sources.",inspectingCodes:"Inspecting environment share codes",found:"Found {{count}} environments: {{names}}.",itemError:"Share code {{index}}: {{error}}",invalidCode:"Invalid share code.",noResult:"The service returned no import result for this share code.",partial:"Imported {{created}} environments; {{remaining}} remain. Valid failed items can be retried.",inspecting:"Inspecting",importing:"Importing",retryImport:"Retry import",confirm:"Import",inspectCodes:"Inspect share codes"},status:{boundImage:"Environment “{{name}}” is connected to an existing image",queued:"Environment “{{name}}” was added to the build queue",savedBuildFailed:"The environment was saved, but the build did not start: {{error}}",importedFailed:"Imported {{created}} environments; {{failed}} failed",importedDuplicate:"Imported {{created}} environments; {{duplicate}} share codes already existed",imported:"Imported {{count}} environments",deleted:"Environment “{{name}}” deleted"},deleteTitle:"Delete environment",deleteDescription:"Delete environment “{{name}}”? This cannot be undone.",errors:{repositoryRequired:"Enter a public code repository URL.",repositoryHttps:"Enter the HTTPS URL of a public repository.",repositoryInvalid:"Enter a valid public repository HTTPS URL.",imageReferenceWhitespace:"A tag or digest cannot contain spaces.",imageDigestInvalid:"The digest must be a complete sha256 value.",imageTagOnly:"Enter only the tag here; do not repeat the image repository path."}},Jme={searchPlaceholder:"Search resource names",emptyMessage:"No options available",searchAriaLabel:"Search {{label}}",loadingMore:"Loading more resources…"},ege={retryDeployment:"Retry deployment",retrying:"Retrying…",collapse:"Collapse error details",expand:"Expand full error details",copy:"Copy full error details"},tge={steps:"Build steps",log:"Build log",syncing:"Syncing",loadFailed:"Failed to load",synced:"Synced",recentOnly:" · Recent logs only",copiedLog:"Build log copied",copyLog:"Copy build log",copied:"Copied",copy:"Copy",logContent:"Build log content",waiting:"Waiting for CodePipeline logs…",empty:"No build logs"},nge={defaultLabel:"Studio default environment",defaultDescription:"Use the standard runtime environment provided by Studio",status:{notBuilt:"Not built",preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Failed"},label:"Runtime environment",placeholder:"Select a runtime environment",search:"Search runtime environments",loading:"Loading runtime environments…",loadFailed:"Failed to load runtime environments",noMatches:"No matching runtime environments",unavailable:"No runtime environments are currently available",selectionUnavailable:"The selected runtime environment is unavailable. Select another one.",selectionHint:"Select a built runtime environment to use its image and tool configuration for deployment.",versionChanged:"The selected environment version has changed. Review it before continuing.",versionMissing:"The selected environment version no longer exists. Select another one.",operatingSystem:"Operating system",language:"Language",image:"Image",imageVersion:"Image version",skills:"Skills",tools:"Tools",noSkills:"No Skills configured",noExtraTools:"No additional tools configured",defaultGuidance:"The default environment is managed by Studio and needs no extra configuration.",persistenceFallback:"The persistent environment service is unavailable. The default environment is being used.",emptyFallback:"No custom environments are available."},ige={repository:"GitHub repository",githubUrl:"GitHub URL",token:"Token",sessionToken:"{{provider}} Session Token",runtime:"Runtime",commit:"Commit",workflow:"Workflow",syncFailed:"Failed to sync GitHub code",status:{mounted:"Mounted",bound:"Bound",synced:"Synced",created:"Created"},volcengine:"Volcengine",mountDelivery:"Enable continuous delivery",selectedForDeployment:"Selected for deployment",mountOnDeploy:"Enable continuous delivery on deploy",syncCode:"Sync code",deliveryMode:"GitHub delivery mode",sourceSync:"GitHub code sync",delivery:"GitHub delivery",loading:"Loading",running:"Running",runtimeDeliveryHint:"Write an AgentKit Runtime GitHub Actions workflow so future GitHub commits update the bound Runtime.",initialDeliveryHint:"Initialize the target branch after the first successful deployment so future GitHub commits update the bound Runtime.",sourceSyncHint:"Studio pushes directly to the target branch. Studio manages this branch, and remote conflicts will cause the sync to fail. Use the deployment button to publish the Runtime.",tokenPlaceholder:"repo or contents:write permission",getToken:"Get token",hideToken:"Hide token",showToken:"Show token",tokenHelp:"The token is used only for this operation and is cleared from the form after success.",targetBranch:"Target branch",actionsSecretPlaceholder:"Used to write a GitHub Actions secret",sessionTokenPlaceholder:"Optional temporary credential",syncing:"Syncing…",pendingHint:"Continuous delivery is selected. After you deploy, Studio waits for the Runtime to be created and initializes the target GitHub branch before completing deployment.",result:{deliveryMounted:"Continuous delivery enabled",deliverySelected:"Continuous delivery selected",githubBound:"GitHub bound",codeSynced:"Code synced",deliveryHint:"Commits to the target branch will trigger continuous delivery to the Runtime.",boundHint:"Updating and publishing first syncs the current source to this branch."},branch:"Branch",viewPr:"View PR",createFailed:"Creation failed",phase:"Phase",log:"Log"},rge={name:"Feishu",enabling:"Enabling and updating configuration…",description:"Receive messages and reply through a Feishu bot",configuration:"Feishu configuration",configurationMode:"Feishu configuration mode",automatic:"Automatic",manual:"Manual",cancelling:"Cancelling…",scanToCreate:"Scan to create",scanDescription:"Credentials are filled in after authorization",generateQrCode:"Generate QR code",qrCodeAlt:"Feishu bot configuration QR code",scanToConfirm:"Scan with Feishu to confirm",expiresIn:"Expires in {{time}}",created:"Bot created",credentialsFilled:"App credentials filled in automatically",qrCodeExpired:"QR code expired",automaticFailed:"Automatic configuration failed",regenerateQrCode:"Generate a new QR code.",configuredPlaceholder:"Configured; leave blank to keep it",appSecretPlaceholder:"Enter App Secret",hideSecret:"Hide App Secret",showSecret:"Show App Secret"},sge={mode:{auto:"Create automatically",autoDescription:"Create required resources during deployment",recommended:"Recommended",create:"Specify names",createDescription:"Create or reuse resources with the specified names",existing:"Select existing",existingDescription:"Select existing resources from the current account"},selectExisting:"Select an existing resource",searchResource:"Search resource names",noMatch:"No matching resources",noAvailable:"No resources available",searching:"Searching cloud resources…",loading:"Loading cloud resources…",noMatchSentence:"No matching resources.",noAvailableSentence:"No resources available.",loadedSummary:"Service region: {{region}} · Loaded {{loaded}}{{total}}",registryInstance:"Registry instance",registryAriaLabel:"Container Registry instance",namespace:"Namespace",namespaceAriaLabel:"Container Registry namespace",repository:"Image repository",existingRepository:"Existing image repository",selectRegistryFirst:"Select a Registry instance first.",selectNamespaceFirst:"Select a Namespace first.",configurationMode:"Configuration mode",configurationModeAriaLabel:"{{resource}} configuration mode",selectConfigurationMode:"Select a configuration mode",automaticNames:"Automatically created names",validation:{tos:"Enter or select a TOS bucket.",cr:"Enter or select a CR instance, namespace, and image repository.",codePipeline:"Enter or select a CodePipeline Workspace and Pipeline.",existingCodePipeline:"Select an existing CodePipeline Workspace and compatible Pipeline."},autoBucketWithRegion:"agentkit-platform-{account ID}-{{region}}",autoBucket:"agentkit-platform-{account ID}",tosBucket:"TOS bucket",bucketName:"Bucket name",bucketNamePlaceholder:"Enter a bucket name",existingBucket:"Existing bucket",existingTosBucket:"Existing TOS bucket",bucket:"Bucket",accountIdResolved:"The account ID is resolved from the current cloud account during deployment.",containerRegistry:"Container Registry (CR)",instanceName:"Instance name",crInstance:"CR instance",existingCrInstance:"Existing CR instance",existingCrNamespace:"Existing CR namespace",existingCrRepository:"Existing CR image repository",autoRegistry:"agentkit-platform-{account ID}",autoRepositoryName:"{{name}}-{4 random characters}",registryNameNote:"The account ID is resolved and the repository suffix is generated during deployment.",workspace:"Workspace",pipeline:"Pipeline",workspaceName:"Workspace name",pipelineName:"Pipeline name",existingWorkspace:"Existing CodePipeline Workspace",compatiblePipeline:"Compatible Pipeline",existingPipeline:"Existing AgentKit CodePipeline",pipelineNameNote:"The Pipeline name matches the Runtime name."},age={commit:"Commit",steps:{permissions:"Preflight OTA permissions",resolving:"Resolve target version",downloading:"Download and verify the full update package",preparing:"Prepare VeFaaS Function code",provisioning:"Check and provision Studio cloud resources",scheduler:"Update the scheduled task service",submitting:"Submit the Function update",publishing:"Publish a new Revision and restart the service"},stages:{permissions:"Preflight OTA permissions",resolving:"Resolve version details",downloading:"Download update package",preparing:"Prepare Function code",provisioning:"Provision Studio cloud resources",scheduler:"Update scheduled task service",submitting:"Submit Function update",publishing:"Publish Revision",checking:"Check for updates",unknown:"Unknown stage"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec"},logPermissionPrefix:"Unable to read VeFaaS release logs. The Function role lacks ",logPermissionSuffix:"; the update will continue.",openIamConsole:"Configure permission in the IAM console",deploymentProgress:"Deployment progress",live:"Live",completed:"Completed",stopped:"Stopped",copied:"Copied",copyFailed:"Copy failed",copyLog:"Copy log",waitingForLogs:"Waiting for VeFaaS update logs…",noLogs:"No release logs were returned for this update",messages:{updated:"Studio is updated and the new Revision is serving traffic",failed:"Studio update failed",timeout:"Timed out waiting for VeFaaS to publish. Check for updates again later.",submitted:"Update submitted. Waiting for VeFaaS to publish the new version.",connectionSwitched:"The connection changed. Confirming the new version status."},checkingPermissions:"Checking OTA permissions",authorizationRequired:"IAM authorization required",updating:"Updating Studio",updated:"Studio updated",updateToVersion:"Update Studio to {{version}}",checkPermissions:"Check update permissions",authorizationNeeded:"Authorization required",updatingShort:"Updating",refreshForNewVersion:"Refresh to use the new version",updateFailed:"Update failed",updateNow:"Update now",newVersionAvailable:"New version available",dialog:{failed:"Studio update failed",checkingPermissions:"Checking update permissions",authorizationRequired:"IAM authorization required",updating:"Updating Studio",completed:"Studio update complete",newVersion:"New version available"},permissionCheck:"Checking every IAM permission required by OTA and scheduled tasks…",permissionCheckHint:"Downloads and cloud-resource updates begin only after all permissions are available.",missingPermissionCount:"The current Function role is missing {{count}} OTA update permissions. No cloud resources have been changed.",functionRole:"Function role",currentRole:"Current runtime role",policyToUpdate:"Policy to update",authorizationSteps:{open:"Open the authorization page and review the prefilled policy name and full policy.",debug:"Select “Start debugging” on the page to apply the policy update.",return:"Return to this window and select “Authorized, check again”."},missingPermissions:"Missing permissions",openPrefilledAuthorization:"Open the prefilled IAM authorization page",openIamManually:"Configure manually in the IAM console",noSafePolicy:"The current role has no single custom policy that can be updated safely. Ask an administrator to add the permissions above to this role.",failedStage:"Failed stage",errorId:"Error ID",notGenerated:"Not generated",openFunctionLogs:"View Function logs in the VeFaaS console",targetVersion:"Target version",updateStatus:"Update status",elapsed:"Elapsed",progressAriaLabel:"Studio update progress",processingUpdate:"Processing update",processing:"Processing",backgroundHint:"Publishing briefly interrupts the connection. Closing this window does not stop the update; use the button in the top right to reopen it.",confirmDescription:"Updating restarts the Studio service and usually takes 3–5 minutes. Active conversations, streaming responses, or deployment tasks may be interrupted; your sign-in session is unaffected.",selectVersion:"Select version",currentVersion:"Current version",changelog:"What's new",noChangelog:"No release notes",runInBackground:"Run in background",authorizedRecheck:"Authorized, check again",tryAgain:"Try again"},oge={deploy:"Deploy",update:"Update",planHash:"Plan hash",backToConfiguration:"Back to configuration",releaseRegion:"Release region",deployRegion:"Deployment region",regionPreserved:"The existing Runtime deployment region is preserved during updates and cannot be changed.",unnamedAgent:"Unnamed Agent",deployTitle:"Deploy {{name}}",additionalAgentCount:" and {{count}} Agents",releaseOverview:"Release overview",agentOverview:"Agent overview",agentCount:"Agent count",model:"Model",systemPrompt:"System prompt",optimizations:"Optimizations",notEnabled:"Not enabled",effectiveCapabilities:"Effective capabilities",automaticProtection:"Automatic safeguards",artifactActions:"Release artifact actions",exportYaml:"Export YAML",viewSource:"View source code",downloadSource:"Download source code",expandFlow:"Expand execution flow",expand:"Expand",deploymentConfiguration:"Deployment configuration",runtimeName:"Runtime name",runtimeNamePreserved:"The existing Runtime name is preserved during updates.",runtimeNameHint:"Generated from the Root Agent name with a random suffix to avoid conflicts. Use 4–64 letters, numbers, hyphens, or underscores.",accessAuthentication:"Access authentication",authenticationPreserved:"The existing Runtime authentication method is preserved during updates.",authenticationMethod:"Authentication method",authenticationAriaLabel:"Deployment authentication method",authenticationPlaceholder:"Select an authentication method",messageChannels:"Message channels",instanceSettings:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",sidecarSingleInstance:"Harness Sidecar currently supports one instance only. The Runtime is fixed at 1–1.",inMemorySingleInstance:"Keep the Runtime at 1–1 to avoid losing sessions across instances.",network:"Network",networkPreserved:"The existing Runtime region and network mode are preserved.",networkMode:"Network mode",networkModes:{public:"Public",both:"Public + VPC"},subnetId:"Subnet ID",subnetHint:"Optional; separate multiple IDs with commas",sharedInternetAccess:"Shared public internet access in the VPC",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",createEvaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment succeeds.",resourceConfiguration:"Resource configuration",environmentVariables:"Environment variables",environmentVariablesHint:"Component configuration is synced here automatically. Review the final values before deployment.",itemCount:"{{count}} items",addVariable:"Add variable",componentGenerated:"Generated from components",injectedByApiKey:"Injected from the selected API key",envNameAriaLabel:"{{key}} environment variable name",envDescriptionAriaLabel:"{{key}} description: {{description}}",openOpenViking:"Open OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}: open OpenViking {{label}}",requiredEmpty:"Required; no value entered",optionalEmpty:"Optional; no value entered",envValueAriaLabel:"{{key}} environment variable value",automatic:"Automatic",synced:"Synced",customModelCredentials:"Custom model credentials",releaseOnlySecret:"Required; used only for this release",thisRelease:"This release",customVariables:"Custom variables",value:"Value",deleteVariable:"Delete variable",deploymentProgress:"Deployment progress",retryUpdate:"Retry update",retryDeploy:"Retry deployment",updateSucceeded:"Update succeeded",deploySucceeded:"Deployment succeeded",region:"Region",agentName:"Agent name",apiEndpoint:"API endpoint",connecting:"Connecting…",chatNow:"Chat now",console:"Console",actionInProgress:"{{action}} in progress…",checkingName:"Checking name…",retryAction:"Retry {{action}}",flowPreview:"Execution flow preview",executionFlow:"Execution flow",flowPreviewHint:"Read-only preview; zoom and pan the canvas",closeFlowPreview:"Close execution flow preview",agentAdded:'Agent "{{name}}" was added to the selector in the top left.',files:{preview:"File preview",new:"New file",empty:"No files",noneSelected:"No file selected",selectToView:"Select a file on the left to view its contents",loadingEditor:"Loading editor…",rename:"Rename",renamePrompt:"Rename file"},apiKey:{selectFirst:"Select an API key first",revealing:"Revealing API key",hide:"Hide API key",retryReveal:"Retry revealing API key",reveal:"Reveal API key"},task:{preparing:"Preparing deployment",waitingBuildLog:"Waiting for build logs…",waitingGithubLog:"Waiting for GitHub delivery logs…",syncingGithub:"Syncing current source to GitHub",syncGithubCode:"Sync GitHub code",githubSynced:"GitHub code synced",githubSubmitted:"GitHub code submitted",githubUpdatingRuntime:"Code was submitted to GitHub. GitHub Actions is updating the same Runtime.",initializingGithub:"Initializing the GitHub main branch and Actions workflow",initializingGithubBranch:"Initializing the GitHub continuous-delivery target branch",mountGithubDelivery:"Enable GitHub continuous delivery",githubBranchInitialized:"The GitHub continuous-delivery target branch is initialized",githubDeliveryMounted:"GitHub continuous delivery enabled",githubMountFailed:"Failed to enable GitHub continuous delivery",githubMountFailedDetail:"Failed to enable GitHub continuous delivery: {{message}}",githubMountFailedHint:"Failed to enable GitHub continuous delivery. See the GitHub log for details.",applyingMpaProfile:"Applying the Agent profile to MPA Runtime",mpaProfileApplied:"MPA Runtime profile applied",runningMpaSmoke:"Verifying the MPA Runtime execution path",mpaReady:"MPA Runtime is ready",deploymentComplete:"Deployment complete",deployedNotConnected:"Deployed, not connected yet",cancelled:"Cancelled",cancelledHint:"Deployment was cancelled and the Runtime resources were requested for deletion.",deploymentStatusUnconfirmed:"Deployment status unconfirmed",deploymentFailed:"Deployment failed",buildFailedHint:"Image build failed. See the build log for details."},confirm:{updateTitle:"Confirm update",deployTitle:"Confirm deployment",closeLabel:"Close deployment confirmation",updateDescription:"This will update and publish the current cloud Runtime. It may take a few minutes. Continue?",deployDescription:"This will create a new cloud Runtime. Deployment may take a few minutes. Continue?",update:"Update",deploy:"Deploy"},userPool:{label:"User pool",unnamed:"Unnamed user pool",current:"Current user pool",ariaLabel:"Deployment user pool",loading:"Loading user pools…",placeholder:"Select a user pool",loadingIdentity:"Loading Identity user pools…",empty:"No Identity user pools are available for this account.",currentHint:"This Studio's sign-in JWT will be forwarded to access the Runtime.",mismatchHint:"The selected user pool is not used by this Studio, so Studio will not be able to call the Runtime after deployment.",markedHint:"The user pool used by this Studio is marked in the list."},authentication:{apiKeyDescription:"Default method using the Runtime API key",userPool:"User pool",userPoolDescription:"Use a JWT issued by an Identity user pool"},steps:{buildImage:"Build image",deploy:"Deploy",publish:"Publish",syncCode:"Sync code",uploadPackage:"Upload code package",packageImage:"Package image",createRuntime:"Create Runtime",publishService:"Publish service",updateInstances:"Update instance configuration",createEvaluationSets:"Create evaluation sets",applyMpaProfile:"Apply MPA profile",verifyMpaRuntime:"Verify MPA Runtime",mpaReady:"MPA Runtime ready"},errors:{instanceRangeInteger:"Minimum instances must be an integer of 0 or more, and maximum instances must be an integer greater than 0.",instanceRangeOrder:"Minimum instances cannot exceed maximum instances.",selectApiKey:"Select an API key in the model configuration first.",loadApiKey:"Failed to load the API key. Try again.",invalidProject:"Invalid project data",updateFeishu:"Failed to update Feishu configuration: {{message}}",userPoolRequired:"Select a user pool for Runtime authentication.",vpcRequired:"Enter a VPC ID when using a VPC network.",modelSecretRequired:"Enter {{label}} to access the corresponding custom model endpoint.",managedApiKeyRequired:"{{requirement}}. Return to model configuration and select an API key first.",feishuEnvRequired:"Enter {{field}} after enabling Feishu.",runtimeNameExists:"This Runtime name already exists. Change it and try again.",deployedButGithubMountFailed:"Deployment succeeded, but enabling GitHub continuous delivery failed: {{message}}",deployedButGithubBindFailed:"Deployment succeeded, but binding GitHub failed: {{message}}",mpaRuntimeIdMissing:"Deployment succeeded, but the Runtime ID is missing, so the MPA profile cannot be applied.",mpaOperationIncomplete:"MPA Runtime setup did not complete. Retry this deployment task.",deploymentStatusUnconfirmed:"The connection was interrupted, so the final deployment status cannot be confirmed. The task may still be running in the cloud. Check the same task in AgentKit or CodePipeline and avoid a duplicate deployment.",failedAtStage:"{{action}} failed during {{stage}}: {{message}}",noAgentAtEndpoint:"Connected successfully, but no Agents were found at this endpoint (/list-apps is empty).",addAgent:"Failed to add Agent: {{message}}",modelApiKeyRequired:"Enter the API key for this model endpoint."}},lge={title:"Workspaces",storageUnavailable:"Persistent storage is not configured. Workspace management is unavailable.",detail:"Workspace details",create:"New workspace",editorDescription:"Group frequently used environments. An environment can belong to multiple workspaces.",backToList:"Back to workspaces",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",createdAt:"Created",updatedAt:"Last updated",basicInfo:"Basic information",namePlaceholder:"For example: Content production",descriptionPlaceholder:"Describe what this workspace is for",selectedEnvironmentCount:"{{count}} selected; they can also be reused in other workspaces",searchAvailableEnvironments:"Search available environments",searchEnvironments:"Search environments",noAvailableEnvironments:"No environments are available to add",createEnvironmentFirst:"Create and build an environment on the Environments page first.",noMatchingEnvironments:"No matching environments",tryAnotherName:"Try searching for another name.",environmentStatus:{available:"Available",building:"Building",notBuilt:"Not built"},added:"Added",saved:"Workspace “{{name}}” saved",resourceType:"Workspace resource type",searchWorkspaces:"Search workspaces",loadFailed:"Unable to load workspaces",noMatchingWorkspaces:"No matching workspaces",tryAnotherNameOrEnvironment:"Try another name or environment",noEnvironmentAdded:"No environments added",environmentMissing:"Environment missing",availableFraction:"{{available}}/{{total}} available",available:"Available",availableCount:"{{count}} available",updated:"Updated",addEnvironment:"Add environment",deleteTitle:"Delete workspace",deleteDescription:"Delete workspace “{{name}}”? Its environments will not be deleted.",deleted:"Workspace “{{name}}” deleted",clipboardPermissionError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually.",codeProjects:"Code projects"},cge={back:"Back",detailNavigation:"Detail navigation",noData:"No data",actions:"Actions",moreActions:"More actions for {{label}}",actionsFor:"Actions for {{label}}",loading:"Loading resources…"},uge={addSkill:"Add Skill",remove:"Remove {{name}}",confirmRemoveRuntime:"Remove the running Skill “{{name}}” from the new version?",selectedCount:"Added skills · {{count}}",close:"Close {{label}}",sources:{runtime:"Running source · Preserved as-is; remove it or replace it with a Skill of the same name",local:"Local",skillspace:"AgentKit Skills Center",skillhub:"Volcengine Find Skill marketplace"},tabs:{local:"Local files",localShort:"Local files",skillspace:"AgentKit Skills Center",skillspaceShort:"AgentKit",skillhub:"Volcengine Find Skill marketplace",skillhubShort:"Find Skill"}},dge={model:"Model",turnControls:"Turn controls",pause:"Pause",resume:"Resume",interrupt:"Interrupt",cancel:"Cancel",pauseTurn:"Pause the whole flow at a safe point",resumeTurn:"Resume the whole flow",interruptTurn:"Interrupt this flow and retain Session context",cancelTurn:"Cancel this flow permanently",turnState:{running:"Running",pausing:"Reaching safe point",paused:"Paused",resuming:"Resuming",interrupting:"Interrupting",cancelling:"Cancelling",interrupted:"Interrupted",completed:"Completed",failed:"Failed",cancelled:"Cancelled",orphaned:"Status pending",newTurnRequired:"Continue from checkpoint"},tasks:{ppt:"Presentation",image:"Image generation",video:"Video generation"},prompts:{ppt:{quarterlyReview:"Review 【quarter】 business performance, highlighting metric gaps, causes, and recommended actions",projectUpdate:"Present the progress of 【project name】: milestones, risks, budget, and resource requests",solutionProposal:"Create a solution proposal for 【customer industry】: pain points, architecture, implementation plan, and benefits",industryAnalysis:"Analyze trends in 【industry topic】 and recommend strategic opportunities based on the competitive landscape"},image:{launchVisual:"Design a 【high-tech】 launch-event key visual for 【brand or product】",ecommercePoster:"Create an e-commerce poster for 【product name】 that highlights 【core selling point】 and brand colors",conceptRendering:"Create a photorealistic concept rendering of 【product or space】 in 【usage scenario】",socialGraphic:"Create a concise, professional corporate social graphic for 【campaign theme】"},video:{brandFilm:"Create a 30-second promotional video for 【brand name】 that highlights 【brand value】",productLaunch:"Create a 45-second launch video for 【product name】 covering the pain point, features, scenarios, and call to action",trainingVideo:"Create a corporate training video about 【training topic】 that clearly explains 【key procedure or policy】",eventTeaser:"Create a 20-second teaser for 【event name】 with highlights, time and location, and registration details"}},firstFrame:"First frame",videoToEdit:"Video to edit",baseVideo:"Base video",optimizeSkillPlaceholder:"Describe the skill you want to improve…",createSkillPlaceholder:"Describe the skill you want to create…",createVideoPlaceholder:"Describe the video you want to create…",messageAgentPlaceholder:"Message {{name}}…",selectAgentFirst:"Select an agent first",selectSkillFirst:"Select the Skill you want to improve first",availableSkills:"Available skills",availableSubagents:"Available sub-agents",invokeSkill:"Use a skill",useSubagent:"Use a sub-agent",loadingCapabilities:"Loading Agent capabilities…",noMatchingSkills:"No matching skills for this Agent",noMatchingSubagents:"No matching sub-agents for this Agent",skillFallbackDescription:"Load and run this skill",agentFallbackDescription:"Hand this turn to the Agent",skill:"Skill",uploadImage:"Upload image",uploadDocument:"Upload document or PDF",uploadVideo:"Upload video",taskMode:"Task mode",selectTaskMode:"Select a task mode",loadingGenerationModel:"Loading generation model",modelUnavailable:"Model unavailable",cancelTask:"Cancel {{task}} task",stopGenerating:"Stop generating",viewVideoProgress:"View video generation progress",send:"Send",selectTaskType:"Select a task type",enterprisePrompts:"{{task}} enterprise prompts",sessionId:"Session ID",sessionIdLabel:"Session ID: ",initializing:"Initializing",copied:"Copied",copySessionId:"Copy session ID",sessionIdCopied:"Session ID copied",disclaimer:"Responses may be inaccurate",viewLogs:"View logs"},fge={selectAgent:"Select Agent",noLocalAgents:"No local Agents.",searchRuntime:"Search Runtime names",mineOnly:"Created by me",noRuntimes:"No Runtimes.",unsupported:"Unsupported",createdByMe:"Created by me",connecting:"Connecting…",connected:"Connected",connect:"Connect",viewInfoFor:"View information for {{name}}",viewInfo:"View information",agentAndRuntimeInfo:"Agent and Runtime information",detailType:"Detail type",agentInfo:"Agent information",runtimeInfo:"Runtime information",loadingAgentInfo:"Loading Agent information…",cannotLoadAgentInfo:"Agent information is temporarily unavailable",unnamedAgent:"Unnamed Agent",subagents:"Sub-agents",tools:"Tools",skills:"Skills",previewUnsupported:"Preview unavailable",mountedComponents:"Mounted components",noMoreAgentInfo:"No additional Agent configuration information.",local:"Local",model:"Model",status:"Status",memoryMb:"Memory {{value}} MB",instances:"Instances {{min}}–{{max}}",resources:"Resources",version:"Version",loadingDetails:"Loading details…",environmentVariables:"Environment variables",errors:{notFound:"This Runtime no longer exists or the list is out of date. Refresh the list and try again.",accessDenied:"This account cannot access the Runtime. Check its Project and access permissions.",previewUnsupported:"This Agent Server version does not support information previews.",unavailable:"This Runtime is temporarily unavailable. Confirm that its status is Ready and try again.",timeout:"Loading timed out. Try again."},componentKinds:{knowledgebase:"Knowledge base",memory:"Memory",prompt_manager:"Prompt manager",example_store:"Example store",run_processor:"Run processor",tracer:"Trace",toolset:"Toolset",plugin:"Plugin",other:"Other"},runtimeStatus:{ready:"Ready",unreleased:"Unreleased",running:"Running",active:"Running",creating:"Creating",pending:"Pending",deploying:"Deploying",updating:"Updating",failed:"Failed",error:"Error",stopping:"Stopping",stopped:"Stopped",deleting:"Deleting",deleted:"Deleted"}},hge={agent:"Agents",agentTypes:{general:"General Agents",mpa:"MPA Agents",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"Created by",namedAgent:"{{name}} Agent",storageLocation:"Storage location",currentBrowser:"Current browser",region:"Region",viewDeploymentProgress:"View deployment progress for {{name}}",viewRuntimeDetails:"View Runtime details for {{name}}",viewDetails:"View details for {{name}}",time:"Time",remainingTime:"Time remaining",expiringSoon:"Expiring soon",sandboxRemaining:"{{hours}} hr {{minutes}} min",wakeable:"Asleep",neverExpires:"Never expires",editDraftNamed:"Edit draft {{name}}",viewProgress:"View progress",deleteDraftNamed:"Delete draft {{name}}",recheckCompatibility:"Check chat compatibility for {{name}} again",connectedNamed:"{{name}} is connected",wakeAndChat:"Wake {{name}} and start chatting",chatWith:"Chat with {{name}}",waking:"Waking…",deploying:"Deploying",draft:"Draft",checking:"Checking",chatUnsupported:"Chat unsupported",checkFailed:"Check failed",creatorFilter:"Creator filter",agentType:"Agent type",searchAgents:"Search Agents",handoff:"Handoff",agentList:"{{type}} list",noMatchingAgents:"No matching Agents",adjustSearch:"Try adjusting the search or filters",noAgentType:"No {{type}}",noGeneralAgents:"No General Agents",createGeneralAgentDescription:"Create a General Agent to start building and chatting",createAgentType:"Create {{type}}",createAgent:"Create Agent",loadingMore:"Loading more Agents",scrollForMore:"Scroll down to load more",allLoaded:"All Agents loaded",deleteDraftTitle:"Delete draft?",deleteDraftDescription:"“{{name}}” cannot be recovered after deletion.",deleteDraft:"Delete draft",loadGeneralAgents:"Load General Agents",loadAgentType:"Load {{type}}",compatibility:{checking:"Requesting Runtime /list-apps to confirm that this Agent supports Studio chat.",empty:"Runtime /list-apps returned no available Agents, so chat is currently unavailable.",supported:"This Runtime supports Studio chat.",unknownError:"The Runtime /list-apps request failed without a recognizable error."},sandboxStatus:{ready:"Ready",wakeable:"Asleep",creating:"Creating",starting:"Starting",initializing:"Starting",pending:"Pending",running:"Running",failed:"Error",error:"Error",stopped:"Stopped",expired:"Expired",deleting:"Deleting",deleted:"Deleted",unknown:"Unknown status"},wakingHint:"Waking the agent. This may take some time.",mpaCreate:{maxInstance:"Maximum instances",maxInstanceHelp:"Defaults to {{maximum}}; this limits the number of Runtime instances during autoscaling.",maxInstanceInvalid:"Maximum instances must be an integer of at least 1.",name:"Name",namePlaceholder:"e.g. test-agent",nameHelp:"Used as the Runtime name. Use 4–64 letters, numbers, underscores or hyphens.",stepsLabel:"Creation steps",steps:{basics:"Basics",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"Database"},next:"Next",previousStep:"Previous",pgDescription:"Choose an existing PostgreSQL instance. Creation prepares an isolated database for this agent on that instance.",pgSplitDescription:"Use the configured business PG Workspace. Agents share this Workspace, each with its own database. Shared resource records are stored separately in mpa_admin_workspace / mpa_admin_db, configured by the administrator.",pgConsoleByteplus:"Create or inspect an AIDAP PG Workspace in BytePlus",pgConsole:"Create or inspect an AIDAP PG Workspace in Volcengine",pgHost:"PG host",pgPort:"PG port",pgInvalid:"Enter a valid PG host and port.",pgCredentials:"The deployment service provides the PG login and password; host and port must match its configuration.",openvikingDescription:"Optional. Enter all three fields to enable OpenViking, or leave all blank to omit OpenViking settings from the new agent.",openvikingConsoleByteplus:"Inspect OpenViking resources in BytePlus",openvikingConsole:"Inspect OpenViking resources in Volcengine",openvikingUrl:"OpenViking service URL",openvikingResourceId:"OpenViking resource ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"Enter a valid HTTPS service URL, resource ID and API Key together, or leave all blank.",openvikingCredentials:"The API Key is used only for this creation and is not saved in browser drafts; re-enter it after a refresh.",tosTitle:"Session output storage",tosDescription:"Optional. Select a bucket to persist each Session's output directory. Access uses the sandbox IAM Role. Without a bucket, files are stored in the sandbox's local directory.",tosBucket:"TOS bucket",tosInvalid:"Select an available bucket starting with agentkit-platform-.",tosCredentials:"Creation adds session-output access for the selected bucket to the shared role. Other runtimes and sandboxes using that role receive the same access.",tosDisable:"Clear bucket selection",tosBucketUnavailable:"The bucket is unavailable in this deployment account or region. Select a bucket from the list and retry.",runtimeImage:"MPA image",workerImage:"Worker image",imageDefault:"Leave blank to use the configured image",imageInvalid:"Enter a valid container image reference without URLs, spaces or credentials.",title:"Create MPA agent",agentId:"Agent ID",description:"Description",region:"Deployment region",plan:"Creation plan",sharedResources:"Prepare or reuse the account VPC, subnets and APIG message gateway",agentResources:"Prepare an isolated database, Skill Space and worker, then deploy the agent",readiness:"Verify gateway and agent readiness before adding the agent to the list",checking:"Checking creation configuration…",configured:"Creation configuration is ready. Submission checks cloud resources and starts provisioning.",notConfigured:"Creation prerequisites are not configured. Ask an administrator to configure them, then retry.",loadFailed:"Could not check creation configuration. Please retry.",reload:"Check again",submit:"Start creation",retry:"Retry creation",newAgent:"Create another agent",newAgentDescription:"Create another agent opens an editable new request and replaces this recovery draft. It does not cancel the old task. If the old task is still running, wait for it to finish before submitting.",close:"Close",cancel:"Cancel creation",confirmCancel:"Confirm cancellation",cancelDescription:"Cancellation stops subsequent steps. Created databases, Skill Spaces, gateways and other registered resources are retained. Retry using the same agent ID.",background:"Creation continues after closing this window. Open it again to view progress.",pollFailed:"Progress is temporarily unavailable. Reconnecting; avoid creating another agent.",iamPermissionDenied:"The deployment service lacks IAM permissions to prepare the runtime role. Ask an administrator to grant access, then retry.",iamTrustConflict:"The runtime role trust is incompatible. Ask an administrator to check VeFaaS and APIG access, then retry.",iamPolicyConflict:"An existing runtime policy with the required name has conflicting contents. Ask an administrator to check it, then retry.",iamOwnershipConflict:"The runtime role does not belong to the deployment account. Ask an administrator to check it, then retry.",iamTemporaryFailure:"IAM requests temporarily failed or timed out after retries. Check the Studio network connection and IAM service, then retry with the same agent ID.",iamVerificationFailed:"Runtime role permissions could not be confirmed. Check IAM availability and policies, then retry.",iamConfigurationConflict:"Automatic runtime role preparation requires the default MPA role. Check the server creation configuration.",creationFailed:"This step failed. Check its resources, server configuration and permissions, then retry the same agent ID.",configurationChanged:"This agent's creation configuration no longer matches the original submission. Restore the original settings before retrying, or create another agent request.",cancelFailed:"Cancellation failed. Check the current progress and retry.",cancelled:"Creation cancelled. Registered resources are retained for retry.",timeout:"Creation timed out. Registered resources are retained. Inspect them before retrying.",interrupted:"Creation was interrupted. Retry the same agent ID to recover registered resources.",skillSpace:"Skill Space",states:{running:"Creating",cancelling:"Cancelling",succeeded:"Created",failed:"Creation failed",cancelled:"Cancelled"},stages:{queued:"Queued",iam_role:"Prepare runtime role",checking:"Checking account and configuration",network:"Preparing VPC and subnets",gateway:"Preparing APIG and IM Gateway",database:"Preparing business database",skills:"Preparing Skill Space",worker:"Preparing worker",deploying:"Preparing database, skills and Runtime",verifying:"Waiting for agent readiness",admin_workspace:"Prepare management PG Workspace",business_workspace:"Prepare business PG Workspace",admin_database:"Initialize shared management database",openviking:"Preparing OpenViking library",openviking_key:"Preparing OpenViking credentials"},back:"Keep creating",pgAutoDescription:"VeADK uses its deployment account to create or reuse two PG Workspaces. mpa_admin_workspace / mpa_admin_db stores shared resource records; the business Workspace hosts an independent database for each agent. No PG connection input is needed. Preparation starts after submission.",pgPerAgentDescription:"Creation reuses the shared management Workspace and prepares a dedicated business PG Workspace and database for this agent. Existing tasks retain their database on retry.",pgAidbDescription:"Creation reuses the shared management Workspace and prepares a dedicated business Workspace with an aidb database. The business Workspace is named mpa_agent_. Existing retries retain their original database.",runtimeNameTaken:"This name is used by a Runtime, sandbox template, business Workspace, or active creation. Choose another name.",runtimeNameCheckFailed:"Unable to check this name. Check resource query permissions and connectivity, then retry.",pgModeChanged:"This submitted task uses previous PG settings and cannot be retried in automatic mode. Ask an administrator to reconcile its resources and task before starting a new creation.",pgMigrationRequired:"An existing shared registry is configured. Migrate its resource records to mpa_admin_workspace / mpa_admin_db and coordinate the registry URL cutover for existing Runtimes, then recheck this configuration.",openvikingAutoDescription:"An independent OpenViking library will be created for this agent using default models. Its connection settings will be prepared automatically.",openvikingAutoByteplusDescription:"Creates a personal OpenViking library for this agent in BytePlus Johor, and prepares the connection settings automatically. Retrying reuses its registered library.",openvikingAutoByteplusRequirements:"Uses the MPA ModelArk API Key and the VLM/Embedding inference endpoints configured by the administrator. Personal libraries use one default user; the Runtime image must support this mode and overseas data-plane access before memory can be used. Libraries are retained after cancellation or agent deletion.",openvikingModelEndpointsInvalid:"Ask the administrator to configure valid OV_VLM_ENDPOINT_ID and OV_EMBEDDING_ENDPOINT_ID values on the Studio server, then retry.",openvikingAutoBilling:"Enterprise libraries are billed by usage starting when creation succeeds. Retrying this agent reuses its registered library.",openvikingPermissionDenied:"OpenViking permission denied. Check the deployment account’s library creation, query and API Key access permissions, then retry.",openvikingConfigurationConflict:"OpenViking ownership or configuration differs from this agent. Check its registered library before retrying.",openvikingCreateUnknown:"The OpenViking creation result is unknown. An administrator must verify the cloud library and reconcile its resource ID before retrying; another library will not be created automatically.",openvikingNotReady:"OpenViking is still initializing. Wait, then retry this agent to continue with the same library.",openvikingResourceFailed:"OpenViking initialization failed. Check the library status and model configuration in the console before retrying.",openvikingResourceMissing:"The registered OpenViking library or default user was not found. Check its binding and availability before retrying.",openvikingModelConfigurationRejected:"The platform rejected the default model configuration or library parameters. Check OpenViking model availability and account eligibility before retrying.",openvikingUnavailable:"OpenViking could not be reached. Check the service and network, then retry.",openvikingInvalidResponse:"OpenViking returned incomplete or invalid configuration. Check the library and default user before retrying.",openvikingQuotaExceeded:"OpenViking quota or request rate was exceeded. Adjust the quota or retry this agent later."}},pge={library:"Skill library",skill:"Skill",skills:"Skills",skillSpace:"Skill space",sandboxNotConfigured:"Dev Sandbox is not configured by an administrator",adminNotConfigured:"Not configured by an administrator",totalItems:"{{count}} items",cannotLoadSpaces:"Unable to load Skill spaces",someSpacesFailed:"Some Skill spaces failed to load",degradedRelationWarning:"Some relations are invalid. Readable skills have been restored.",downloadZip:"Download ZIP",optimize:"Optimize",closeSkillDetails:"Close Skill details",skillId:"Skill ID",allFiles:"All files",loadingSkillContent:"Loading Skill content…",noSkillContent:"This Skill has no SKILL.md content",addSkill:"Add Skill",localUpload:"Upload locally",localUploadDescription:"Select a ZIP file and upload it to the Skill space after validation",autoCreate:"Create automatically",autoCreateDescription:"Choose a model and style, then create a Skill through conversation",createSkill:"Create Skill",optimizeNamed:"Optimize {{name}}",deleteSkillConfirm:"Delete the entire Skill “{{name}}”? This affects every space that references it.",deleteSpaceConfirm:"Delete Skill space “{{name}}”? Make sure its Skills have been deleted first.",manageSpaceDescription:"Manage Skills in this space and create new versions",backToSpaces:"Back to Skill spaces",overview:"Overview",skillCount:"Skills",skillCountValue_one:"{{count}} Skill",skillCountValue_other:"{{count}} Skills",updatedAt:"Updated",skillsInSpace:"Skills in {{name}}",searchSkills:"Search Skills",cannotLoadSkills:"Unable to load Skills",noMatchingSkills:"No matching Skills",noSkills:"No Skills",tryAnotherName:"Try searching for another name",emptySkillsDescription:"Upload a Skill locally or create one automatically",actions:"Actions",spaceDetails:"Skill space details",editSpace:"Edit space",deleteSpace:"Delete space",searchSpaces:"Search Skill spaces",spaceList:"Skill space list",noMatchingSpaces:"No matching Skill spaces",createSpace:"Create Skill space",newSpace:"New space",loadingMoreSpaces:"Loading more Skill spaces",scrollForMore:"Scroll down to load more",allSpacesLoaded:"All Skill spaces loaded",errors:{loadSpaces:"Unable to load Skill spaces. Try again later.",loadSkills:"Unable to load Skills. Try again later.",loadSkillDetails:"Unable to load Skill details. Try again later.",deleteSkill:"Unable to delete the Skill",deleteSpace:"Unable to delete the Skill space",downloadSkill:"Unable to download the Skill"},status:{active:"Available",available:"Available",creating:"Creating",disabled:"Disabled",enabled:"Enabled",failed:"Error",inactive:"Inactive",pending:"Pending",published:"Published",ready:"Ready",released:"Published",running:"Running",success:"Healthy",unavailable:"Unavailable",unreleased:"Unreleased",updating:"Updating",unknown:"Unknown"},sharedSpace:"Enterprise shared space",sharedDescription:"Skills available to everyone, published and maintained by administrators",sharedVisibility:"Everyone",sharedPreparing:"Preparing shared space",sharedLoadFailed:"Shared space unavailable",sharedEmpty:"No shared skills yet. Skills published by administrators will appear here",requestPublication:"Request publication",reviewSubmitting:"Submitting…",reviewSubmitted:"Submitted",reviewFailed:"Could not submit the publication request",reviewStatusFailed:"Failed to load review status",reviewRetry:"Apply again",reviewPending:"Pending review",reviewApproving:"Publishing",reviewApproved:"Shared",reviewReturned:"Returned",reviewHistory:"Review history",skillDetailSections:"Skill detail sections",versions:{title:"Version management",refresh:"Refresh",uploading:"Uploading…",upload:"Upload new version",close:"Close",hint:"New versions become public after approval and do not replace published versions; the skill name in the ZIP must match the original",loading:"Loading versions…",loadFailed:"Unable to load versions",filesFailed:"Unable to load version files",uploadFailed:"Unable to upload the new version",submitFailed:"Unable to submit for review",retry:"Retry",empty:"No versions yet",current:"Current version",notSubmitted:"Not submitted",submitting:"Submitting…",submit:"Request publication",processing:"Version status: {{status}}",filesLoading:"Loading files…",filesEmpty:"No files",history:"Review history",shared:"Published"},author:"Author",authorName:"Author: {{name}}"},mge={library:"Knowledge bases",createBase:"New knowledge base",editBase:"Edit knowledge base",invalidName:"The name must start with a letter and contain only letters, numbers, and underscores.",nameHelp:"Start with a letter. Use up to 48 letters, numbers, or underscores.",optionalDescription:"Description (optional)",descriptionOnly:"AgentKit currently supports updating only the knowledge base description.",previewWeb:"Preview web content",addData:"Add data",openOriginalWeb:"Open original page",backToEdit:"Back to edit",confirmAdd:"Confirm and add",source:"Knowledge source",image:"Image",documentFile:"Document file",webPage:"Web page",webUrl:"Web page URL",generatingWebPreview:"Fetching the page and generating a Markdown preview",selectFile:"Select knowledge file",selectOrDropFile:"Select a file or drag it here",selectedFile:"{{size}} · Click to select another file",imageFileHelp:"PNG, JPG, and JPEG up to 200 MB",documentFileHelp:"PDF, PPTX, DOCX, XLSX, and TXT up to 200 MB",uploadingFile:"Uploading the file and adding it to the knowledge base",optionalName:"Name (optional)",optionalType:"Type (optional)",generatePreview:"Generate preview",uploadFile:"Upload file",editMetadata:"Edit knowledge metadata",knowledge:"Knowledge item",field:"Field",value:"Value",backToList:"Back to knowledge bases",metadataJson:"Metadata (JSON)",provider:"Provider",knowledgeId:"Knowledge ID",project:"Project",creator:"Created by",data:"Data",deleteInvalidAssociation:"Delete invalid association",noData:"This knowledge base has no data",addFirstData:"Add the first data item",format:"Format",size:"Size",searchData:"Search data",searchLibraryData:"Search knowledge base data",associationInvalid:"Association invalid",providerMissing:"The underlying Provider knowledge base no longer exists",noMatchingData:"No matching data",loadingMoreData:"Loading more data",retryLoading:"Retry loading",details:"Knowledge base details",searchBases:"Search knowledge bases",someBasesFailed:"Some knowledge bases are temporarily unavailable. Other available content is shown.",noMatchingBases:"No matching knowledge bases",noManagePermission:"You do not have permission to manage this knowledge base",loadingMoreBases:"Loading more knowledge bases",deleteBaseTitle:"Delete knowledge base?",deleteBaseDescription:"This removes the AgentKit association for {{name}}. If Studio created it, the Provider resource is also deleted. This cannot be undone.",deleteDocumentTitle:"Delete knowledge item?",deleteDocumentDescription:"This removes {{name}} from the Provider knowledge base. This cannot be undone.",preview:{processingTitle:"Data is being processed",processingDetail:"A preview will be available after parsing. Reload later.",failedTitle:"Data parsing failed",failedDetail:"Check the source file or page URL and add it again, or reload the latest status.",noParsedTitle:"No parsed content is available yet",noParsedDetail:"Text, tables, or page images will appear after the knowledge base finishes parsing this file.",noMediaTitle:"No media preview is available yet",noMediaDetail:"The knowledge base has not returned an accessible media preview. Reload later.",noDataTitle:"No data is available to preview",noDataDetail:"The knowledge base has not returned parsed results. Reload later.",attachmentError:"The attachment cannot be previewed. Try again later.",imageAlt:"Knowledge data image",audioUnsupported:"This browser does not support audio previews.",videoUnsupported:"This browser does not support video previews.",namedPdf:"{{name}} PDF preview",pdf:"PDF preview",openPdf:"If it cannot be displayed, open the PDF in a new window",fileUnsupported:"This format cannot be previewed directly online. Parsed content is shown when available.",openOriginalFile:"Open original file",loading:"Loading data preview",openOriginalHint:"You can open the original page to view the source content.",chunk:"Chunk {{index}}",loadingMore:"Loading more",loadMore:"Load more"},errors:{fileTooLarge:"A file cannot exceed 200 MB",invalidImageType:"Select a PNG, JPG, or JPEG image",invalidDocumentType:"Select a PDF, PPTX, DOCX, XLSX, or TXT file",createBase:"Unable to create the knowledge base",updateBase:"Unable to update the knowledge base",metadataObject:"Metadata must be a JSON object",metadataFormat:"Invalid metadata format",noWebPreview:"The page has no Markdown content to preview",addWeb:"Unable to add the web page",previewWeb:"Unable to generate the web page preview",uploadFile:"Unable to upload the file",updateDocument:"Unable to update the knowledge item",loadPreview:"Unable to load the data preview",loadMoreBases:"Unable to load more knowledge bases",loadBases:"Unable to load knowledge bases",loadMoreData:"Unable to load more data",loadData:"Unable to load data",deleteBase:"Unable to delete the knowledge base",deleteDocument:"Unable to delete the knowledge item"}},gge={title:"Feishu channel",refresh:"Refresh",loading:"Loading channel configuration…",unsupported:"This Runtime does not support channel management. Upgrade its MPA image.",unauthorized:"Channel management requires a Studio administrator and an authorized Runtime credential.",configurationError:"Channel management configuration is incomplete. Check the Runtime metadata and encryption key.",requestFailed:"Channel request failed. Check the Runtime connection and retry.",bound:"Bound: {{name}}",unbound:"No Feishu bot is bound.",guidance:"Private chats use separate conversations. In allowed groups, mention this bot to start a conversation.",keyRequired:"Configure a persistent CHANNEL_STATE_ENCRYPTION_KEY in the Runtime before binding.",gateway:"Message gateway",route:"Inbound route",delivery:"Reply delivery",configured:"Configured",missing:"Missing",delivery_not_observed:"Not observed",delivery_delivered:"Delivered",delivery_retrying:"Retrying",missingConfig:"Missing Runtime configuration: {{fields}}",bind:"Bind with QR code",newQr:"Generate a new QR code",unbind:"Unbind",confirmUnbind:"Disconnect this bot? It will stop receiving new messages.",qrAlt:"Bot authorization QR code",openQr:"Open authorization page",uncertain:"Registration was interrupted. Check the bot binding and Gateway before starting again.",bindingFailed:"Binding failed. Check Gateway configuration and retry.",chatId:"Allowed group ID",scope:"Group conversation scope",saveGroup:"Save group",noGroups:"No groups allowed yet. Private chats do not need this permission.",edit:"Edit",remove:"Remove",removeGroup:"Remove {{name}}",scope_group_sender:"Separate by sender",scope_group:"Shared by group",scope_group_topic_sender:"Separate by topic and sender",scope_group_topic:"Shared by topic",status_PENDING:"Waiting for scan",status_SCANNED:"Scanned; waiting for authorization",status_AUTHORIZED:"Authorized; preparing registration",status_REGISTERING:"Registering bot",status_BOUND:"Bot bound",status_FAILED:"Binding failed",status_EXPIRED:"QR code expired",workspaceTitle:"Message channels",workspaceDescription:"Connect messaging apps to this Agent and manage access.",provider_feishu:"Feishu",provider_wecom:"WeCom",provider_dingtalk:"DingTalk",comingSoon:"Not available yet",unavailableDescription:"Binding and message settings for {{name}} are not available yet.",runtimeRequired:"Deploy this Agent to a Runtime before configuring message channels.",bindingTitle:"Bot connection",connected:"Bound",notBound:"Not bound",gatewayDescription:"Gateway configuration for receiving channel messages.",routeDescription:"Routing configuration for delivering messages to this Agent.",deliveryDescription:"Observed reply delivery; configuration alone does not confirm delivery.",groupsTitle:"Group access",groupsDescription:"Allow specific groups to access this agent.",providerBindingTitle:"Connect {{name}}",providerUnbound:"Connect a {{name}} bot to let users message this agent.",qrGuidance:"Authorize with {{name}}. The Runtime saves the bot credentials and configures the message gateway.",wecomGuidance:"Authorize with WeCom QR code, or enter a Bot ID and Secret to bind an existing bot.",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"Connect bot",wecomScan:"Bind with QR code",wecomAuthorizing:"Waiting for WeCom authorization…",cancelAuthorization:"Cancel authorization",wecomPopupBlocked:"Allow popups in your browser, then try authorizing again.",wecomAuthCancelled:"WeCom authorization was cancelled. You can scan again.",wecomAuthTimeout:"WeCom authorization timed out. Please scan again.",wecomInvalidResult:"Authorization did not return a Bot ID and Secret. Authorize again or enter them manually.",wecomAuthFailed:"WeCom authorization failed. Try again or enter credentials manually.",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"Upgrade this Runtime image to configure {{name}} manually. Quick setup is still available.",pairingTitle:"Message channel QR pairing",feishuPairingDescription:"If a bot is already connected, it will be replaced after successful Feishu authorization and binding. In the authorization flow, you can bind an existing bot or create a new one.",generatingQr:"Generating pairing QR code…",dingtalkGuidance:"Authorize with DingTalk QR code, or enter a Client ID and Client Secret to bind an existing bot.",wecomPairingDescription:"Pair again in the WeCom authorization window. The new bot replaces the current connection after binding succeeds. Cancelling authorization or a failed binding does not disconnect the existing bot.",configurationMethod:"Configuration method",quickSetup:"Quick setup",manualSetup:"Manual setup",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"Enter the credentials of an existing {{name}} bot to connect it to this agent.",manualReplacement:"Successful binding replaces the current bot. Cancelling or a failed binding does not disconnect the existing bot.",accountsTitle:"Feishu bots",account:"Bot",selectAccount:"Select a bot",accountEnabled:"Enabled",accountDisabled:"Disabled",addAccount:"Add bot",cancelAddAccount:"Cancel adding",enableAccount:"Enable bot",disableAccount:"Disable bot",noAccounts:"No Feishu bots are bound.",accountsFailed:"Could not load bots. Try again.",accountConflict:"The bot account is ambiguous or conflicts with its configuration. Refresh and select a bot.",multiBotPairingDescription:"Binding a new Feishu app adds a bot. Binding the same App ID updates that bot.",provider_lark:"Lark",larkPairingDescription:"Scan with Lark to authorize a bot. Existing bots remain bound until this setup succeeds.",larkAccountsTitle:"Lark bots",noLarkAccounts:"No Lark bots are bound."},bVe={common:Kme,agentKitPromo:Gme,systemInfo:Xme,agentWorkspace:Yme,environmentCenter:Zme,deploymentSelect:Jme,deploymentError:ege,studioBuildProgress:tge,cloudEnvironment:nge,githubCicd:ige,feishuDeployment:rge,deploymentResources:sge,studioUpdate:age,projectPreview:oge,workspace:lge,resourceCollection:cge,skillSourcePicker:uge,composer:dge,agentSelector:fge,myAgents:hge,skillCenter:pge,knowledge:mge,channels:gge},yVe=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:Gme,agentSelector:fge,agentWorkspace:Yme,channels:gge,cloudEnvironment:nge,common:Kme,composer:dge,default:bVe,deploymentError:ege,deploymentResources:sge,deploymentSelect:Jme,environmentCenter:Zme,feishuDeployment:rge,githubCicd:ige,knowledge:mge,myAgents:hge,projectPreview:oge,resourceCollection:cge,skillCenter:pge,skillSourcePicker:uge,studioBuildProgress:tge,studioUpdate:age,systemInfo:Xme,workspace:lge},Symbol.toStringTag,{value:"Module"})),bge="User management",yge="{{count}} members",vge="User",xge="Role",wge="Account status",kge="Last sign-in",Oge="Actions",Sge="Change role",Ege="Close",Cge="Save role",Age="Saving…",Tge="Cancel",_ge="Back",jge="User pool",Nge="Volcengine Identity",Rge="Search name, email or user ID",Ige="Search",Pge="Filter by role",Dge="All roles",Mge="Refresh",Lge="Loading users…",$ge="Updated at {{time}}",Fge="{{name}} is now {{role}}",Bge="Retry",Uge="You",Qge="Initial super administrator",zge="The initial super administrator cannot be demoted here",Vge="The new permissions apply when the user refreshes Studio",Hge="Role needs confirmation",qge="No matching users",Wge="Try another search or role",Kge="Users appear here after signing in or joining this user pool",Gge="{{count}} users",Xge="Previous",Yge="Next",Zge="Not signed in yet",Jge="Not provided",ebe={super_admin:"Super administrator",admin:"Administrator",developer:"Developer",user:"User"},tbe={super_admin:"Manage all resources, users and role assignments",admin:"Manage Studio resources",developer:"Develop agents and manage your own resources",user:"Use agents and personal features"},nbe={EXTERNAL_PROVIDER:"Active",CONFIRMED:"Active",NORMAL:"Active",ENABLED:"Active",ACTIVE:"Active",UNCONFIRMED:"Unverified",DISABLED:"Disabled",FORBIDDEN:"Disabled",LOCKED:"Locked",SUSPENDED:"Suspended",FORCE_CHANGE_PASSWORD:"Password change required"},ibe={request_failed:"The request did not finish. Refresh the list to confirm its current state before retrying",invalid_response:"The user service returned an invalid response. Refresh and try again",identity_unavailable:"Identity is unavailable. Try again later or check service permissions",identity_resource_missing:"The user or user pool no longer exists. Refresh the list",super_administrator_required:"Only super administrators can manage users",sign_in_required:"Sign in and try again",user_not_in_pool:"Your account does not belong to this user pool",user_disabled:"Your account is disabled",protected_administrator:"The initial super administrator cannot be demoted",cannot_demote_self:"You cannot demote your own super administrator role",role_change_conflict:"The role has changed. Close this dialog and refresh the list before retrying",cross_origin_request:"Change roles from the current Studio page"},vVe={title:bge,memberCount:yge,user:vge,role:xge,status:wge,lastLogin:kge,actions:Oge,changeRole:Sge,close:Ege,save:Cge,saving:Age,cancel:Tge,back:_ge,pool:jge,volcengineIdentity:Nge,searchPlaceholder:Rge,search:Ige,filterRole:Pge,allRoles:Dge,refresh:Mge,loading:Lge,updatedAt:$ge,saved:Fge,retry:Bge,you:Uge,initialAdministrator:Qge,protectedExplanation:zge,effectiveAfterRefresh:Vge,roleConflict:Hge,noUsers:qge,tryAnotherSearch:Wge,poolEmpty:Kge,resultCount:Gge,previous:Xge,next:Yge,neverLoggedIn:Zge,unknown:Jge,roles:ebe,descriptions:tbe,states:nbe,errors:ibe},xVe=Object.freeze(Object.defineProperty({__proto__:null,actions:Oge,allRoles:Dge,back:_ge,cancel:Tge,changeRole:Sge,close:Ege,default:vVe,descriptions:tbe,effectiveAfterRefresh:Vge,errors:ibe,filterRole:Pge,initialAdministrator:Qge,lastLogin:kge,loading:Lge,memberCount:yge,neverLoggedIn:Zge,next:Yge,noUsers:qge,pool:jge,poolEmpty:Kge,previous:Xge,protectedExplanation:zge,refresh:Mge,resultCount:Gge,retry:Bge,role:xge,roleConflict:Hge,roles:ebe,save:Cge,saved:Fge,saving:Age,search:Ige,searchPlaceholder:Rge,states:nbe,status:wge,title:bge,tryAnotherSearch:Wge,unknown:Jge,updatedAt:$ge,user:vge,volcengineIdentity:Nge,you:Uge},Symbol.toStringTag,{value:"Module"})),rbe="Website integration",sbe="Embed an AgentKit Runtime on your website as a floating chat window",abe="Back to automations",obe="Add website",lbe="Loading Runtime",cbe="Select Runtime",ube="Website domain",dbe="For example, xxxx.com or localhost:5173",fbe="Generating",hbe="Generate token",pbe="Added websites",mbe="{{count}} website",gbe="{{count}} websites",bbe="Loading website integrations",ybe="No website integrations yet",vbe="Select a Runtime and enter a website domain to generate a token",xbe="Embed instructions",wbe="Place this code before the closing body tag on your website",kbe="Copied",Obe="Copy code",Sbe="Embed code will appear here after you add a website.",Ebe="Delete the website integration for {{domain}}?",Cbe={load:"Failed to load website integrations",create:"Failed to create website integration",delete:"Failed to delete website integration",noConversationalAgent:"No conversational Agent was found in this Runtime"},Abe={requestFailed:"Request failed ({{status}})",greeting:"Hello. How can I help?",sessionFailed:"Could not start a chat session",unauthorized:"This website is not authorized to start a chat",conversationFailed:"The chat request failed. Try again shortly.",open:"Open Agent chat",close:"Close Agent chat",panelLabel:"Agent chat panel",assistant:"Agent assistant",online:"Online"},wVe={title:rbe,description:sbe,backToAutomations:abe,addWebsite:obe,loadingRuntime:lbe,selectRuntime:cbe,websiteDomain:ube,domainPlaceholder:dbe,generating:fbe,generateToken:hbe,addedWebsites:pbe,websiteCount_one:mbe,websiteCount_other:gbe,loadingIntegrations:bbe,delete:"Delete",emptyTitle:ybe,emptyDescription:vbe,embedMethod:xbe,embedInstructions:wbe,copied:kbe,copyCode:Obe,embedHint:Sbe,confirmDelete:Ebe,errors:Cbe,widget:Abe},kVe=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:obe,addedWebsites:pbe,backToAutomations:abe,confirmDelete:Ebe,copied:kbe,copyCode:Obe,default:wVe,description:sbe,domainPlaceholder:dbe,embedHint:Sbe,embedInstructions:wbe,embedMethod:xbe,emptyDescription:vbe,emptyTitle:ybe,errors:Cbe,generateToken:hbe,generating:fbe,loadingIntegrations:bbe,loadingRuntime:lbe,selectRuntime:cbe,title:rbe,websiteCount_one:mbe,websiteCount_other:gbe,websiteDomain:ube,widget:Abe},Symbol.toStringTag,{value:"Module"})),Tbe={types:{all:"All types",document:"Documents",image:"Images",video:"Videos"},previewArtifact:"Preview {{name}}",moreActions:"More actions for {{name}}",actionMenu:"Actions for {{name}}",download:"Download",downloading:"Downloading",edit:"Edit details",delete:"Delete artifact",previewFailed:"Could not preview “{{name}}”: {{message}}",downloadStarted:"Download started for {{name}}",downloadFailed:"Could not download “{{name}}”: {{message}}",updated:"Updated {{name}}",deleted:"Deleted {{name}}",deleteFailed:"Could not delete “{{name}}”: {{message}}",typeFilter:"Artifact type",searchAria:"Search artifacts",searchPlaceholder:"Search artifacts or sessions",retry:"Retry",close:"Close",listAria:"Artifact list",loadFailed:"Could not load artifacts",loadDetailFallback:"Check the storage configuration and try again.",reload:"Reload",noMatch:"No matching artifacts",noArtifacts:"You do not have any artifacts yet",searchHint:"Try another search or artifact type",emptyHint:"Artifacts created in chats will appear here automatically",columns:{name:"Name",source:"Source",updatedAt:"Modified",actions:"Actions"},loadingMore:"Loading more artifacts",unknownTime:"Unknown time",preview:{close:"Close preview",meta:"{{type}} / Version {{version}}",loading:"Loading preview",alt:"Preview of {{name}}",loadFailed:"The preview could not be loaded. Try again later or download the file.",unsupported:"This format cannot be previewed online. Download the file to view it.",sourceAria:"Artifact source",agent:"Agent",session:"Session",tool:"Generated by",createdAt:"Created",fileSize:"File size",tags:"Tags",viewSession:"View session"},deleteDialog:{title:"Delete artifact?",description:"“{{name}}” will be permanently removed from the artifact library. The chat history will not be affected.",deleting:"Deleting",confirm:"Delete",close:"Close delete confirmation"},api:{withStatus:"{{message}} ({{status}})",listFailed:"Could not load the artifact library",syncFailed:"Could not sync chat artifacts",updateFailed:"Could not update the artifact",deleteFailed:"Could not delete the artifact",downloadFailed:"Could not download the artifact"}},_be={unknownSource:"Unknown source",unknownCreator:"Unknown creator"},jbe={nameRequired:"Enter an artifact name",tooManyTags:"You can add up to {{max}} tags",tagTooLong:"Each tag can contain up to {{max}} characters",title:"Edit artifact details",subtitle:"The content file will not be modified",close:"Close edit dialog",name:"Name",description:"Description",descriptionPlaceholder:"Add its purpose, version, or usage notes",tags:"Tags",tagsPlaceholder:"Separate tags with commas, up to {{max}}",cancel:"Cancel",saving:"Saving",save:"Save"},Nbe={change:{added:"Added",modified:"Modified",deleted:"Deleted"},noChanges:"There are no source changes between these versions",chooseFile:"Select a file on the left to view its code",compareTitle:"Compare versions",workspaceTitle:"Source workspace",projectFallback:"Agent project",switchTheme:"Switch source theme",switchThemeTitle:"Switch to {{theme}} theme",themes:{dark:"dark",light:"light"},closeWorkspace:"Close source workspace",close:"Close",changedFiles:"Changed files",projectFiles:"Project files",changes:"Changes",files:"Files",openFiles:"Open files",noFileSelected:"No file selected",comparisonDirection:"Comparison direction",before:"Before optimization",after:"After optimization",loadingEditor:"Loading editor…",changedFileCount_one:"{{count}} file changed",changedFileCount_other:"{{count}} files changed",fileCount_one:"{{count}} file",fileCount_other:"{{count}} files",lineCount_one:"{{count}} line · UTF-8",lineCount_other:"{{count}} lines · UTF-8",viewSource:"View source",viewSourceAria:"View and edit project source"},Rbe={nav:"Search",selectAgent:"Select an Agent",checkingCapabilities:"Checking Agent capabilities",notMounted:"This Agent does not have {{label}} mounted",sources:{session:"Sessions",web:"Web",knowledge:"Knowledge base",memory:"Long-term memory"},webDescription:"Search with the web_search tool",backendLocal:"Local",failed:"Search failed: {{message}}",placeholder:{selectAgent:"Select an Agent first",web:"Search the web",knowledge:"Search {{name}}",knowledgeFallback:"this Agent's knowledge base",memory:"Search {{name}}",memoryFallback:"this user's long-term memory",session:"Search this Agent's sessions"},sourceTypeAria:"Search source: {{label}}",notSelected:"Not selected",sourceType:"Search source",selectSource:"Select a search source",noAgentHint:"Select an Agent to search its sessions, the web, and mounted data sources.",loadingCapabilities:"Loading this Agent's search capabilities…",sourceUnavailable:"This Agent does not have this data source mounted",instructions:{web:"Enter keywords and press Enter or select the button to search with web_search.",knowledge:"Enter a question to search this Agent's knowledge base.",memory:"Enter a clue to search long-term memories saved across this user's sessions.",session:"Enter keywords and press Enter or select the button to search this Agent's sessions."},noResults:"No results found for “{{query}}”.",knowledgeFragment:"Knowledge excerpt {{index}}",memoryFragment:"Memory excerpt {{index}}"},Ibe={title:"Developer Resources",sections:{documentation:{title:"Related links",description:"Open development documentation and common AgentKit destinations"},bestPractices:{title:"Best practices",description:"Learn from practical development, debugging, and deployment guidance"},showcases:{title:"Showcases",description:"Explore applications built with AgentKit"}},links:{veadkDocs:"VeADK documentation",cliDocs:"AgentKit CLI documentation",platformDocs:"AgentKit platform documentation",console:"AgentKit console"},articles:{veadkDevelopment:{title:"Develop and deploy an Agent with VeADK",description:"Build an Agent with VeADK and deploy it to AgentKit Runtime."},cliDevelopment:{title:"Develop and deploy an Agent with AgentKit CLI",description:"Create a project, debug an Agent, and deploy it with AgentKit CLI."},coverAlt:"Cover image for {{title}}"},showcases:{researchAssistant:{title:"Multi-agent research assistant",description:"Specialized Agents work together to research, analyze, and summarize findings."},multimodalAnalysis:{title:"Multimodal content analysis",description:"Understand images, documents, and video in a single session."},customerService:{title:"Customer service workspace",description:"Combine knowledge retrieval and tool calls to handle complex support requests."},webSearch:{title:"Web search Agent",description:"Search current web content and organize it into traceable answers."},a2uiApp:{title:"A2UI interactive app",description:"Let an Agent generate interactive interfaces as it works through a task."},previewAlt:"Interface preview for {{title}}"}},Pbe={title:"Library",untitledSession:"Untitled session",categoryAria:"Library categories",regionAria:"Region",tabs:{skills:"Skills",knowledge:"Knowledge",artifacts:"Artifacts"}},Dbe={title:"Manage Agents",subtitle:"Agents in AgentKit Runtime that you can manage",mainAgentOnly:"Only the main Agent is shown (control-plane information).",deleteConfirm:'Delete Agent "{{name}}"? Its Runtime will be permanently deleted.',regionFilterTitle:"Filter by region",regionFilterAria:"Region filter",regionAria:"Region",refresh:"Refresh",loading:"Loading…",empty:"You have not deployed any Agents.",connected:"Connected",connect:"Connect to this Agent",deleteRuntime:"Delete this Runtime",loadingDetail:"Loading details…",agentStructure:"Agent structure",secretHidden:"Sensitive value is never shown. Copy it with an authorized request.",revealSecret:"Sensitive value for {{key}}",copySecret:"Copy the value of {{key}}",copy:"Copy",copied:"Copied",copyFailed:"Copy failed",notConfigured:"Not configured",fields:{model:"Model",description:"Description",status:"Status details",project:"Project",version:"Version",resources:"Resources",memory:"Memory",tool:"Tool",knowledge:"Knowledge",mcpToolset:"MCP Toolset",updatedAt:"Updated"},resource:{memory:"Memory {{value}} MB",instances:"Instances {{min}}-{{max}}",concurrency:"Concurrency {{value}}"},environmentVariables:"Environment variables",unnamed:"(Unnamed)"},Mbe={mainAgent:"Main Agent",subAgent:"Sub-agent {{index}}",itemCount_one:"{{count}} item",itemCount_other:"{{count}} items",info:"Agent information",infoAndTopology:"Agent information and settings",loadingInfo:"Loading Agent information…",unnamedAgent:"Unnamed Agent",agentsMd:"AGENTS.md",tools:"Tools",toolList:"Tool list",studioTool:"Studio Tool",removeTool:"Remove tool {{name}}",remove:"Remove",notConfigured:"Not configured",addStudioTool:"Add Studio tools",addStudioToolHere:"Add Studio tools to this chat",skills:"Skills",skillList:"Skill list",addSkill:"Add Skill Space skills",addSkillHere:"Add Skill Space skills to this Session",skillMountNextTurn:"Mounted versions are frozen when the next Turn starts.",previewUnsupported:"Preview is not supported",sessionEnvironment:"Session environment",environment:"Environment",agentCanvas:"Agent canvas",topology:"Structure",nodeKinds:{agent:"Agent",sandbox:"Sandbox","worker-session":"Worker Session","skill-space":"Skill Space",skill:"Skill","studio-tool":"Studio Tool",mcp:"MCP",environment:"Environment",knowledge:"Knowledge","sub-agent":"Sub-agent"},nodeStatuses:{configured:"Configured",mounted:"Mounted",running:"Running",paused:"Paused"},viewCanvasFullscreen:"View Agent canvas in full screen",viewFullscreen:"View full screen",executionCanvas:"Agent execution canvas",fullscreenExecutionCanvas:"Full-screen Agent execution canvas",closeFullscreenCanvas:"Close full-screen canvas",close:"Close",capabilitiesSubtitle:"Capabilities and collaboration topology",closeInfo:"Close Agent information",infoUnavailable:"Agent information is temporarily unavailable.",refresh:"Refresh information",loadingSkills:"Loading bound skills…",sessionSkills:"Temporary session skills",noBoundSpace:"This agent has no bound Skill Space.",noBoundSkills:"The bound Skill Space has no skills.",loadFailed:"Could not load this information. Refresh to retry.",accessDenied:"You do not have permission to read this information.",documentUnsupported:"Upgrade the Runtime image to enable Studio to read AGENTS.md.",skillsUnsupported:"This Runtime does not provide Skill Space bindings.",skillsDegraded:"Skill information is incomplete. Refresh to retry.",documentEditHint:"Edit the latest version. Saving publishes a new version to this Skill Space and can affect other agents using it. Running sessions may need a cache refresh or a new session. Keep the frontmatter name unchanged.",documentLoading:"Loading SKILL.md…",documentWritable:"Editable",documentReadOnly:"Read only — this space or your permissions do not allow editing",documentLoadFailed:"Could not load SKILL.md. Refresh to retry.",documentSaveFailed:"Save was not confirmed. Your edits are preserved. Reopen to check the current version before retrying.",documentConflict:"A newer version exists. Copy your edits, then reopen the editor to avoid overwriting it.",discardDocument:"Discard unsaved changes?",keepEditing:"Keep editing",discardChanges:"Discard changes",saveDocument:"Save new version"},Lbe={mountFailed:"Could not mount the environment",closeDialog:"Close environment dialog",addTitle:"Add environments",description:"Choose the Sandbox environments this Agent can use in the current session",closeAdd:"Close Add environments",searchAria:"Search environments",searchPlaceholder:"Search environment names or capabilities",availableAria:"Available environments and workspaces",loading:"Loading available environments…",noMatch:"No matching environments or workspaces",workspaces:"Workspaces",reuseAll:"Use every available environment in this workspace",availableEnvironmentCount_one:"{{count}} available environment",availableEnvironmentCount_other:"{{count}} available environments",selectWorkspace:"Select workspace {{name}}",environments:"Environments",includedByWorkspaces:"Included by workspace {{names}}",nameSeparator:", ",selectEnvironment:"Select environment {{name}}",selectedWorkspaceCount_one:"{{count}} workspace selected",selectedWorkspaceCount_other:"{{count}} workspaces selected",coveredEnvironmentCount_one:"{{count}} environment covered",coveredEnvironmentCount_other:"{{count}} environments covered",selectionSummary:"{{workspaces}}, {{environments}}",cancel:"Cancel",mounting:"Mounting…",confirm:"Add selected",mountedAria:"Mounted environments",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",removeWorkspace:"Remove workspace {{name}}",remove:"Remove",removeEnvironment:"Remove environment {{name}}",add:"Add environments",addMore:"Add more environments",addForSession:"Add environments to this session",loadingAvailable:"Loading available environments…",empty:"No AIO Sandbox environments are available."},$be={loading:{searching:"Looking for an existing environment",creating:"Initializing environment",connecting:"Connecting to the environment"},initializationFailed:"AgentKit CLI environment initialization failed. Current status: {{status}}.",sessionExpired:"The AgentKit CLI session does not exist or has expired. Try again.",initializationTimeout:"AgentKit CLI environment initialization timed out. Try again later.",nonPersistent:"Non-persistent environment",recyclingHoursMinutes:"Environment reclaimed in {{hours}} hr {{minutes}} min",recyclingMinutes:"Environment reclaimed in {{minutes}} min",connectionError:`Could not connect to the Studio service because the server did not respond. -Original error: {{message}}`,unavailable:"Connection unavailable",requestFailed:"AgentKit CLI request failed",retry:"Retry",terminalTitle:"AgentKit CLI terminal"},Fbe={labels:{coding:"Coding",get_city_weather:"City weather",get_location_weather:"Location weather",web_fetch:"Fetch web content",studio_write_artifact:"Save session artifact"},closeDialog:"Close dialog",title:"Add Studio tools",description:"Studio BFF runs these tools for {{agentName}} in the current session. No Runtime installation is required.",close:"Close Add Studio tools",searchAria:"Search Studio tools",searchPlaceholder:"Search by name or tool ID",availableAria:"Available Studio tools",loading:"Loading Studio tools…",noMatch:"No matching Studio tools",remove:"Remove",add:"Add"},Bbe={artifactLibrary:Tbe,resourceMetadata:_be,artifactEdit:jbe,codeBrowser:Nbe,search:Rbe,developerResources:Ibe,library:Pbe,manageAgents:Dbe,agentTopology:Mbe,sessionEnvironment:Lbe,agentKitCli:$be,studioTools:Fbe},OVe=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:$be,agentTopology:Mbe,artifactEdit:jbe,artifactLibrary:Tbe,codeBrowser:Nbe,default:Bbe,developerResources:Ibe,library:Pbe,manageAgents:Dbe,resourceMetadata:_be,search:Rbe,sessionEnvironment:Lbe,studioTools:Fbe},Symbol.toStringTag,{value:"Module"})),Ube={requestFailed:"请求失败 ({{status}})",unknownError:"未知错误",contentTypeMissing:"Content-Type 缺失",response:"响应:{{response}}",fallbackWithDetail:"{{fallback}}:{{detail}}",fallbackWithHttpStatus:"{{fallback}}(HTTP {{status}})",nonJsonResponse:"{{fallback}}:服务端返回非 JSON 响应({{contentType}})"},Qbe={unconfigured:"管理员未配置 AgentKit Dev Sandbox,请配置后再使用",invalidSession:"AgentKit CLI 返回了无效的 Session。",loadCapabilitiesFailed:"无法读取 AgentKit CLI 配置。",invalidCapabilities:"AgentKit CLI 返回了无效的配置状态。",listSessionsFailed:"无法读取 AgentKit CLI Session。",invalidSessionList:"AgentKit CLI 返回了无效的 Session 列表。",createSessionFailed:"无法创建 AgentKit CLI Session。",openSessionFailed:"无法打开 AgentKit CLI Session。",openTerminalFailed:"无法打开 AgentKit CLI 终端。",invalidTerminalUrl:"AgentKit CLI 返回了无效的终端地址。"},zbe={cnBeijing:"华北 2(北京)",cnShanghai:"华东 2(上海)"},Vbe={runtimeUnsupported:"该 Runtime 暂不支持连接,请确认服务已正常运行。"},Hbe={autoConfigureFailed:"飞书机器人自动配置失败"},qbe={actionFailed:"{{action}}失败",detail:"详细信息:{{detail}}",request:"请求:{{request}}"},Wbe={persistentMemoryHint:"提示:会话已不存在。使用 in-memory 或 SQLite 短期记忆时,多实例、进程重启或滚动发布都可能导致会话丢失;建议改用基于数据库的持久化短期记忆存储。",unsupportedRouteHint:"提示:该 Runtime 未提供会话能力运行接口,可能是 Runtime 版本与当前 Studio 不兼容。",toolArgumentHint:"提示:模型生成的工具参数格式不完整,请重新发送一次。",resourceCollectionExpiredHint:"提示:本次资源清单已失效,请重新发送任务;系统会重新收集资源后再创建 Agent。",networkConfigurationHint:"提示:请稍后重试,查看 Runtime、模型或网关日志。",modelQuotaHint:"提示:模型当前触发了 TPM/RPM 配额限制,请稍后重试或提高模型配额。",rawResponseLabel:"原始响应:",copySecretFailed:"复制敏感值失败"},Kbe={httpStatus:"HTTP 状态码:{{status}}",errorCode:"错误码:{{code}}",cloudResponseBody:`云端响应正文: -{{body}}`,loadFailedWithDetail:"读取实例日志失败:{{detail}}",invalidFormat:"读取实例日志失败:服务返回格式无效"},Gbe={untitledSession:"未命名会话",webUnavailable:"网络搜索接口未就绪(后端未启用 /web/search)。",webFailed:"网络搜索失败:{{message}}",webNotMounted:"当前 Agent 未挂载 web_search 工具。",knowledgeNotMounted:"该 Agent 未挂载知识库。",memoryNotMounted:"该 Agent 未挂载长期记忆。",knowledge:"知识库",longTermMemory:"长期记忆"},Xbe={listSpacesFailed:"读取 Skill 空间失败",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",deleteSpaceFailed:"删除 Skill 空间失败",uploadFailed:"上传 Skill 失败",validateFailed:"校验 Skill 失败",deleteFailed:"删除 Skill 失败",listFilesFailed:"读取 Skill 文件失败",downloadFailed:"下载 Skill 失败",sharedSpaceFailed:"共享空间加载失败",reservedSpaceName:"此名称由系统空间保留,请使用其他名称",reviewSpaceFailed:"待审核空间暂不可用",submitReviewFailed:"申请公开失败",listReviewsFailed:"加载审核申请失败",reviewFilesFailed:"加载提交文件失败",decideReviewFailed:"审批失败,请重试",listVersionsFailed:"无法加载技能版本",uploadVersionFailed:"上传技能新版本失败"},Ybe={truncatedData:"{{data}}…(已截断,共 {{count}} 个字符)",incompleteEvent:"SSE 流在事件完整返回前已结束。原始数据:{{data}}",invalidEventJson:"无法解析 SSE 事件中的 JSON。原始数据:{{data}}"},Zbe={loadConfigNetworkFailed:"无法加载登录配置,请检查网络后重试。",configServiceFailed:"登录配置服务异常(HTTP {{status}}),请稍后重试。",invalidConfigResponse:"登录配置服务返回了无法解析的响应,请稍后重试。",serviceNetworkFailed:"无法连接身份服务,请检查网络后重试。",invalidServiceResponse:"身份服务返回了无法解析的响应,请稍后重试。",serviceFailed:"身份服务异常(HTTP {{status}}),请稍后重试。"},Jbe={invalidToken:"GitHub Token 无效或没有仓库写入权限",notFound:"仓库、分支或文件不存在,或 Token 无权访问",rejectedCommit:"GitHub 拒绝了提交,请检查分支和文件状态",requestFailed:"GitHub 请求失败(HTTP {{status}})",networkFailed:"连接 GitHub 失败,请检查网络后重试",invalidRepositoryFormat:"GitHub Repo 格式应为 owner/repository",insecureRepositoryUrl:"仅支持安全的 github.com 仓库地址",unsafeProjectPath:"Agent 项目目录必须是仓库内的安全相对路径",tokenRequired:"GitHub Token 不能为空",invalidBaseBranch:"目标分支格式不正确",invalidPublishBranch:"发布分支格式不正确",noFiles:"没有需要提交的文件",missingBaseSha:"目标分支缺少有效 Git SHA",fileAlreadyExists:"目标仓库中已存在 {{path}},未覆盖现有文件",pathNotUpdatable:"目标路径 {{path}} 不是可更新的文件",invalidPullRequest:"GitHub 未返回有效的 Pull Request"},eye={loadCapabilitiesFailed:"加载视频模型能力失败",uploadAssetFailed:"上传{{fileName}}失败",enhancePromptFailed:"提示词优化失败",createTaskFailed:"创建视频生成任务失败",getTaskFailed:"查询视频生成任务失败",downloadFailed:"下载生成视频失败"},tye={listFailed:"加载网站集成失败",createFailed:"创建网站集成失败",deleteFailed:"删除网站集成失败"},nye={loadFailed:"读取知识库失败",htmlHidden:"[HTML 内容已隐藏]",redacted:"[已脱敏]",depthTruncated:"[内容过深,已截断]",circularReference:"[循环引用]",diagnosticsUnavailable:"[诊断信息无法显示]",statusCode:"状态码:{{status}}",errorCode:"错误码:{{code}}",requestId:"请求 ID:{{requestId}}",diagnostics:"诊断:{{diagnostics}}",detail:"详情:{{detail}}",signInRequired:"请先登录后再访问知识库",forbidden:"你没有权限操作这个知识库",notFound:"知识库或知识内容不存在",conflict:"知识库当前状态不允许执行此操作",requestFailed:"知识库请求失败 ({{status}})"},iye={invalidName:"名称须为 1~128 个字符,不能包含控制字符、不可见格式字符或 < >。",renameProjectFailed:"修改项目名称失败",renameVersionFailed:"修改版本名称失败",invalidNameUpdateResponse:"名称更新响应与请求不一致,请刷新后重试。",invalidSourceSnapshot:"源码快照的响应格式无效。",invalidProjectList:"项目列表的响应格式无效。",invalidProjectVersion:"项目版本的响应格式无效。",loadProjectsFailed:"无法读取已保存项目",loadVersionsFailed:"无法读取项目版本",deleteVersionFailed:"删除项目版本失败",invalidDeleteVersionResponse:"删除项目版本的响应格式无效。",loadProjectSourceFailed:"无法读取项目源码",loadSnapshotFailed:"无法读取源码快照",restoreSnapshotFailed:"无法恢复当前源码快照",downloadSourceFailed:"下载源码失败",downloadNotZip:"源码下载响应不是 ZIP 文件。",downloadSizeMismatch:"源码压缩包大小与发布记录不一致,请重试。"},rye={invalidFormat:"{{label}}格式错误。",validationSeparator:";",invalidAnalysisResult:"迁移分析结果格式错误。",invalidFrameworkCandidate:"框架候选格式错误。",invalidAnalysisEvidence:"分析证据格式错误。",invalidEntryCandidate:"入口候选格式错误。",invalidQuestion:"待确认问题格式错误。",invalidPendingInput:"分析问题无法读取",invalidTask:"迁移会话格式错误。",invalidAnalysisReference:"分析结果引用格式错误。",invalidSourcePersistence:"迁移源码保存状态格式错误。",invalidActivity:"迁移执行动态格式错误。",invalidActivityItem:"迁移执行动态项格式错误。",invalidActivityTool:"迁移执行工具项格式错误。",invalidActivityPlan:"迁移执行计划格式错误。",invalidActivityPlanItem:"迁移执行计划项格式错误。",invalidArtifact:"迁移产物格式错误。",invalidEnvironmentDefaults:"环境变量默认值格式错误。",invalidArtifactFile:"迁移产物文件格式错误。",invalidVerificationCheck:"迁移校验项格式错误。",requestValidationFailed:"请求参数校验失败:{{detail}}",gatewayError:"{{fallback}}(HTTP {{status}},Content-Type: {{contentType}})。请检查代理或网关配置。",nonJsonResponse:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}})。请检查代理或网关配置。",loadCapabilitiesFailed:"读取迁移能力失败",invalidCapabilities:"迁移能力格式错误。",invalidModelCapabilities:"迁移模型能力格式错误。",loadTasksFailed:"读取迁移会话失败",invalidTaskList:"迁移会话列表格式错误。",createTaskFailed:"创建迁移会话失败",uploadProjectFailed:"上传迁移项目失败",loadActivityFailed:"读取迁移执行动态失败",loadEventsFailed:"订阅迁移进度流失败",invalidEventsResponse:"迁移进度流返回了非法数据帧。",reconnecting:"连接已断开,正在重新连接迁移进度流…",startFailed:"启动迁移失败",submitAnswersFailed:"提交分析补充信息失败",submitInputFailed:"提交分析回答失败",stopFailed:"终止迁移失败",deleteTaskFailed:"删除迁移会话失败",loadArtifactFailed:"读取迁移产物失败",loadArtifactFileFailed:"读取迁移产物文件失败",downloadArtifactFailed:"下载迁移产物失败",evaluation:{datasetSaveFailed:"保存评测用例失败",datasetLoadFailed:"读取评测用例失败",statusLoadFailed:"读取评测状态失败",resumeFailed:"继续评测失败",retryFailed:"重新评测失败",reportLoadFailed:"读取评测报告失败",reportDownloadFailed:"下载评测报告失败"},labels:{analysisResult:"迁移分析结果",recommendation:"迁移建议",boundary:"迁移边界",frameworkCandidate:"框架候选",analysisEvidence:"分析证据",recommendedFramework:"推荐框架",entryCandidate:"入口候选",entryFramework:"入口框架",includeScope:"迁移包含范围",excludeScope:"迁移排除范围",assumptions:"分析假设",question:"待确认问题",analysisWarnings:"迁移警告",task:"迁移会话",artifactStatus:"迁移产物状态",analysisReference:"分析结果引用",confirmation:"迁移确认",confirmedFramework:"确认框架",error:"迁移错误",sourcePersistence:"迁移源码保存状态",activity:"迁移执行动态",activityItem:"迁移执行动态项",activityTool:"迁移执行工具项",activityPlanItem:"迁移执行计划项",artifact:"迁移产物",cli:"CLI 信息",migration:"迁移信息",startup:"启动信息",environment:"环境变量信息",verification:"校验信息",report:"迁移报告",archive:"产物归档",environmentDefaults:"环境变量默认值",requiredEnvironment:"必需环境变量",optionalEnvironment:"可选环境变量",artifactFile:"迁移产物文件",verificationCheck:"迁移校验项",artifactWarnings:"迁移产物警告",errorResponse:"错误响应",errorDetail:"错误详情",capabilities:"迁移能力",framework:"迁移框架",modelCapabilities:"迁移模型能力",taskList:"迁移会话列表",evaluationAsset:"评测资产",evaluation:"评测状态",evaluationCapabilities:"评测能力",evaluationDimension:"评测维度",evaluationCase:"评测用例",evaluationCriteria:"评测标准",evaluationMessage:"评测对话",evaluationDataset:"评测数据集",evaluationDimensionResult:"评测维度结果",evaluationEvidence:"评测证据",evaluationReport:"评测报告",evaluationSummary:"评测汇总",evaluationCaseResult:"评测用例结果",evaluationOutput:"评测输出",evaluationLimitations:"评测限制",pendingInput:"分析提问",pendingQuestion:"分析问题项",pendingOption:"分析问题选项"}},sye={status:{ready:"就绪",wakeable:"已休眠",creating:"创建中",starting:"启动中",pending:"等待中",running:"运行中",failed:"异常",stopped:"已停止",expired:"已过期",deleting:"删除中",deleted:"已删除",unknown:"未知状态"},developmentTimeout:"等待开发环境响应超时。任务可能仍在运行,请稍后重新进入当前会话查看状态。",developmentDisconnected:"与开发环境的连接已中断。任务可能仍在运行,请稍后重新进入当前会话查看状态。",developmentFailed:"开发任务未能继续,开发环境已保留。请在当前会话重试。",invalidStudioResponse:"{{fallback}} Studio 服务响应异常,请刷新后重试。",invalidSession:"AgentKit 沙箱返回了无效的 Session 信息。",invalidSnapshot:"AgentKit 沙箱返回了无效的 Snapshot 信息。",invalidSettings:"Sandbox 返回了无效设置。",invalidThreadSnapshot:"Sandbox 返回了无效 Thread 快照。",emptyConversationResponse:"沙箱对话服务未返回内容。",invalidConversationResponse:"沙箱对话服务返回了无法解析的响应。",conversationFailed:"沙箱对话失败,请稍后重试。",emptyReply:"沙箱未返回有效回复,请重试。",missingSession:"缺少要操作的 AgentKit Session。",listCodexFailed:"无法读取 Codex 智能体,请稍后重试。",invalidSessionList:"AgentKit 沙箱返回了无效的 Session 列表。",invalidSnapshotList:"AgentKit 沙箱返回了无效的 Snapshot 列表。",startFailed:"无法启动 AgentKit 沙箱,请稍后重试。",listAgentFailed:"无法读取 {{kind}} 智能体,请稍后重试。",invalidKindSessionList:"AgentKit 返回了无效的 {{kind}} Session 列表。",invalidKindSnapshotList:"AgentKit 返回了无效的 {{kind}} Snapshot 列表。",createAgentFailed:"无法创建 {{kind}} 智能体,请稍后重试。",missingSessionToOpen:"缺少要打开的 AgentKit Session。",openAgentFailed:"无法打开 {{kind}} 智能体。",invalidAgentHomeUrl:"{{kind}} 智能体返回了无效的主页面地址。",missingSessionForTerminal:"缺少要打开 Terminal 的 AgentKit Session。",openTerminalFailed:"无法打开 {{kind}} Terminal。",deleteAgentFailed:"无法删除 {{kind}} 智能体。",missingSnapshot:"未找到要唤醒的智能体。",resumeSnapshotFailed:"无法唤醒智能体,请稍后重试。",deleteSnapshotFailed:"无法删除智能体,请稍后重试。",missingSessionToConnect:"缺少要连接的 AgentKit Session。",connectCodexFailed:"无法连接 Codex 智能体,请稍后重试。",sessionNotReady:"AgentKit Session 尚未就绪,当前状态:{{status}}。",invalidMessage:"内置智能体会话缺少有效的消息内容。",interruptFailed:"无法停止当前任务。",getStatusFailed:"无法读取 Codex 状态。",getEndpointFailed:"无法读取 Sandbox Endpoint。",invalidEndpoint:"Sandbox 返回了无效 Endpoint。",createHandoffPairingFailed:"无法生成 Codex 云端接力配对码。",invalidHandoffPairing:"Studio 返回了无效的 Codex 云端接力配对码。",getHandoffStatusFailed:"无法读取端云接力状态。",invalidHandoffStatus:"Studio 返回了无效的端云接力状态。",listModelsFailed:"无法读取 Codex 模型列表。",invalidModelList:"Sandbox 返回了无效模型列表。",setModelFailed:"无法切换 Codex 模型。",invalidModel:"Sandbox 返回了无效模型。",listSkillsFailed:"无法读取 Codex Skills。",invalidSkillList:"Sandbox 返回了无效 Skill 列表。",listThreadsFailed:"无法读取 Codex Thread 列表。",invalidThreadList:"Sandbox 返回了无效 Thread 列表。",createThreadFailed:"无法创建新的 Codex Thread。",missingThread:"缺少要读取的 Codex Thread。",readThreadFailed:"无法读取 Codex 历史消息。",resumeThreadFailed:"无法恢复 Codex Thread。",forkThreadFailed:"无法分叉 Codex Thread。",archiveThreadFailed:"无法归档 Codex Thread。",invalidArchiveResult:"Sandbox 返回了无效归档结果。",deleteThreadFailed:"无法删除 Codex Thread。",invalidDeleteResult:"Sandbox 返回了无效删除结果。",compactThreadFailed:"无法压缩 Codex Thread。",getSettingsFailed:"无法读取 Codex 权限与工作空间。",updatePermissionsFailed:"无法更新 Codex 权限。",updateWorkspaceFailed:"无法更新 Codex 工作空间。",invalidWorkingDirectory:"Sandbox 返回了无效工作目录。",listDirectoriesFailed:"无法读取 Sandbox 目录。",invalidDirectoryList:"Sandbox 返回了无效目录列表。",resolveApprovalFailed:"无法提交 Codex 审批决定。",uploadFileFailed:"无法上传文件到 Sandbox。",invalidUploadResult:"Sandbox 返回了无效上传结果。",disconnectCodexFailed:"无法断开 Codex 智能体连接。",deleteCodexFailed:"无法删除 Codex 智能体。",openSandboxTerminalFailed:"无法打开 Sandbox Terminal。",openSandboxBrowserFailed:"无法打开 Sandbox Browser。",toolLabel:"Sandbox 工具",invalidToolUrl:"{{label}} 返回了无效地址。",unsafeToolUrl:"{{label}} 返回了不安全的地址。"},aye={invalidSandboxVersion:"沙箱版本响应格式无效",loadSandboxVersionsFailed:"查询沙箱版本失败",updateSandboxFailed:"更新 Sandbox 失败",invalidSandboxUpdate:"沙箱更新响应格式无效",errorWithDetailAndRawResponse:`{{context}} +Installation command: {{command}}`,title:"Continue in the cloud",description:"Copy the two prompts in order. Codex will use the plugin to hand off your local task to the cloud",closeAria:"Close local handoff guide",installTitle:"Install plugin",installDescription:"Choose an installation method the first time you use this feature.",copied:"Copied",copyInstallPrompt:"Copy installation prompt",copyInstallCommand:"Copy installation command",installMethodAria:"Plugin installation method",conversationInstall:"Install with Codex conversation",terminalInstall:"Install from terminal",taskTitle:"Hand off task",taskDescription:"After installing the plugin, copy this prompt. Codex will migrate the current project and continue the task.",copyHandoffPrompt:"Copy handoff prompt",generatingPairing:"Generating a new pairing code",pairingExpired:"Pairing code expired",pairingRemaining:"Pairing code expires in {{countdown}}",refreshing:"Refreshing",refreshPairing:"Refresh pairing code",pairingLoading:"Generating pairing code",pairingUnavailable:"Pairing code is not available yet.",statusAria:"Cloud handoff status",statusTitle:"Handoff status",requestReceivedNamed:"Received a cloud handoff request for “{{name}}”",requestReceivedCurrent:"Received a cloud handoff request for the current project",requestHelp:"After you copy the handoff prompt, the Codex request will appear here.",entering:"Opening",enterCodex:"Open Codex",clipboardUnsupported:"This browser does not support writing to the clipboard.",steps:{request:"Wait for local request",session:"Create cloud Session",restore:"Restore project",continue:"Send continuation task"},status:{issued:"Waiting for request",creating:"Creating Session",sessionCreated:"Migrating project",continuing:"Starting cloud task",running:"Running in the cloud",completed:"Handoff complete",failed:"Handoff failed"}},Nme={model:{description:"Show or switch the current conversation model",keywords:"model switch"},models:{description:"List models available from app-server",keywords:"model list"},skill:{description:"Browse and invoke a Skill available in the current workspace",keywords:"skill workflow"},skills:{description:"Browse and invoke Skills available in the current workspace",keywords:"skills workflow list"},new:{description:"Start a new conversation",keywords:"new conversation"},resume:{description:"Open conversation history or resume a specific Thread",keywords:"history resume session"},fork:{description:"Fork a new conversation from the current context",keywords:"fork branch"},compact:{description:"Compact the current conversation context",keywords:"compact context"},archive:{description:"Archive the current conversation and start a new one",keywords:"archive close"},status:{description:"Show connection, Thread, model, and token status",keywords:"status connection token"},clear:{description:"Clear the current view and start a new conversation",keywords:"clear reset"},help:{description:"Show Sandbox shortcuts",keywords:"help commands"},currentModel:"Current model",availableModel:"Available model",workspace:"Workspace",notSet:"Not set",modelLabel:"Model",statusLabel:"Status",running:"Running",idle:"Idle",totalTokens:"Total tokens",contextWindow:"Context window",imageFallback:"Image",unknown:"Unknown shortcut: {{command}}. Type /help to see available commands.",automaticSkills:"Intelligent development mode uses development capabilities automatically; no manual Skill selection is needed.",activity:{new:"Started a new Codex conversation",resumed:"Resumed Codex conversation",deleted:"Deleted Codex conversation history",modelChanged:"Switched Codex model",availableModels:"Available Codex models",noModels:"No models are currently available",forked:"Forked Codex conversation",compacting:"Started compacting the current Codex conversation",archived:"Archived Codex conversation",status:"Current Codex status",help:"Codex shortcuts supported by Sandbox"}},Rme={label:"Build tasks",queued:"Build queued",running:"Build running in the background",recovering:"Recovering build",waiting_user:"Build needs attention",stopping:"Stopping build",succeeded:"Build completed",cancelled:"Build stopped",failed:"Build could not complete",open:"Return to task",hide:"Hide task notification",reconnecting:"Reconnecting to the task service. Existing tasks are retained."},Ime={common:vme,tool:xme,threads:wme,permissions:kme,workspace:Ome,approval:Sme,composer:Eme,launch:Cme,session:Ame,agentDetails:Tme,agentWorkspace:_me,handoff:jme,commands:Nme,taskNotice:Rme},fVe=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:Tme,agentWorkspace:_me,approval:Sme,commands:Nme,common:vme,composer:Eme,default:Ime,handoff:jme,launch:Cme,permissions:kme,session:Ame,taskNotice:Rme,threads:wme,tool:xme,workspace:Ome},Symbol.toStringTag,{value:"Module"})),Pme={retry:"Try again",signInToContinue:"Sign in to continue",signInWith:"Sign in with {{provider}}",enterUsername:"Enter a username to get started",usernamePlaceholder:"Username (letters and numbers, up to 16 characters)",enter:"Continue",usernameInvalid:"Use letters and numbers only, up to 16 characters.",identityProvider:{volcengine:"Volcengine Identity",byteplus:"BytePlus Identity"},powered:{volcengine:"Volcengine AgentKit provides enterprise-grade Agent solutions",byteplus:"BytePlus AgentKit provides enterprise-grade Agent solutions"},legalPrefix:"By continuing, you acknowledge that you have read and agree to the AgentKit",terms:"Product and Service Terms",copyright:"© {{year}} VeADK. All rights reserved."},Dme={title:"Your session has expired",description:"Your current edits are preserved. The previous action will continue after you sign in again.",waiting:"Waiting for sign-in…",signInAgain:"Sign in again"},Mme={breadcrumbs:"Breadcrumbs",selectAgent:"Select Agent",switchAgent:"Switch Agent"},Lme={cancel:"Cancel",close:"Close confirmation dialog"},hVe={login:Pme,authExpired:Dme,navbar:Mme,confirm:Lme},pVe=Object.freeze(Object.defineProperty({__proto__:null,authExpired:Dme,confirm:Lme,default:hVe,login:Pme,navbar:Mme},Symbol.toStringTag,{value:"Module"})),$me={defaultUser:"User",shortcuts:"Quick access",tryCli:"Try AgentKit CLI",developerResources:"Developer resources",systemInfo:"System information",language:"Language",issueFeedback:"Report an issue",logout:"Sign out",roles:{admin:"Administrator",developer:"Developer",user:"User",super_admin:"Super administrator"}},Fme={home:"Back to home",expand:"Expand sidebar",collapse:"Collapse sidebar",label:"Main navigation",newChat:"New chat",agents:"Agents",workspaces:"Workspaces",library:"Library",cronjobs:"Cronjob",automations:"Automations",users:"User management",administration:"Administration",reviewCenter:"Review center"},Bme={title:"Chat history",newConversation:"New conversation",create:"New chat",loading:"Loading chat history…",empty:"No conversations yet",current:"Current",manage:"Manage conversation: {{title}}",more:"More",delete:"Delete",loadingMore:"Loading…",loadMore:"Load more",evaluatingTitle:"Running automatic evaluation",evaluating:"Evaluating",generating:"Generating"},mVe={account:$me,navigation:Fme,history:Bme},gVe=Object.freeze(Object.defineProperty({__proto__:null,account:$me,default:mVe,history:Bme,navigation:Fme},Symbol.toStringTag,{value:"Module"})),Ume={placeholder:"Select an option",collapseOptions:"Collapse model options",expandOptions:"Expand model options",noOptions:"No options available",noMatches:"No matches. You can use the current model ID directly."},Qme={unsupportedActivity:"Unsupported Skill conversation activity",ariaLabel:"Skill generation conversation"},zme={code:"Error code: {{code}}",type:"Error type: {{type}}",representation:"Exception representation: {{value}}",rawResponse:`Raw server response: +{{value}}`,original:"Original error: {{message}}",details:"Details"},Vme={ariaLabel:"Skill file tree",viewSource:"View source",viewPreview:"View preview",download:"Download",binaryFile:"Binary file",bytes:"{{value}} bytes",binaryDescription:"The current API returns file metadata only. Download the original file separately.",metadata:"Skill metadata",noFiles:"No files"},Hme={close:"Close",name:"Name",region:"Region",optionalDescription:"Description (optional)",cancel:"Cancel",create:"Create",creating:"Creating…",save:"Save",saving:"Saving…",upload:"Upload",uploading:"Uploading…",createSpaceTitle:"New Skill Space",editSpaceTitle:"Edit Skill Space",uploadTitle:"Upload to {{name}}",createSpaceFailed:"Failed to create the Skill Space",updateSpaceFailed:"Failed to update the Skill Space",archiveValidationFailed:"Skill ZIP validation failed",uploadFailed:"Failed to upload the Skill",dropzone:"Drop a Skill ZIP here",chooseLocalFile:"or click to choose a local file",archiveHelp:"The ZIP root must contain SKILL.md, or a single wrapping directory. Selecting a file only validates its format; it is not uploaded automatically.",validating:"Checking file format…",validationPassed:"Format check passed: {{name}}, {{count}} file(s)"},qme={styles:{concise:"Concise and practical",strict:"Rigorous and robust",tutorial:"Tutorial-friendly",automation:"Automation-first",custom:"Custom",customFallback:"Custom style"},stages:{preparing:"Preparing Dev Sandbox",ready:"Skill generated and format validation passed",failed:"Generation failed",cancelled:"Stopped",validating:"Validating Skill format",packaging:"Organizing files",generating:"Generating Skill",repairingAgain:"Repairing again",autoRepairing:"Auto-repairing ({{attempt}}/{{max}})"},validation:{fallback:"Skill format validation failed",repairInstruction:"Fix only the Skill format errors listed below. Do not change the original purpose or scope.",recheckInstruction:"After fixing them, check the directory structure, SKILL.md frontmatter, and all text files again.",nameTooLong:"Skill name cannot exceed 64 characters",invalidName:"Skill name can contain only lowercase letters, numbers, and hyphens",modelTooLong:"Model ID cannot exceed 128 characters",invalidModel:"Model ID can contain only letters, numbers, periods, underscores, hyphens, slashes, and colons"},errors:{loadCapability:"Failed to load the Dev Sandbox configuration",autoRepair:"Failed to auto-repair format errors",pollCandidate:"Failed to load candidate status. Retrying.",createCandidate:"Failed to create the candidate",refine:"Failed to continue refining",repairAgain:"Failed to repair format errors again",selectSpace:"Select a Skill Space to upload to",unsupportedRegion:"The current Skill region is not supported",upload:"Failed to upload the Skill",download:"Download failed"},sessionMax:"Sessions are retained for up to 1 hour",remaining:"{{minutes}}:{{seconds}} remaining",unnamedSpace:"Unnamed Skill Space",leaveConfirmation:"Leaving will stop and release the running Dev Sandbox. Leave anyway?",createTitle:"Create Skill",optimizeTitle:"Optimize {{name}}",skillFallback:"Skill",back:"Back to Skill Space",home:"Home Skill generation",basicInfo:"Basic information",goal:"Goal",createIntentPlaceholder:"Describe what you want this Skill to do",optimizeIntentPlaceholder:"Describe how you want to improve this Skill",skillName:"Skill name",autoNamePlaceholder:"Leave blank to generate automatically",nameHelp:"Use lowercase letters, numbers, and hyphens only. Leave blank to generate automatically.",createPlans:"Generation plans",optimizePlans:"Optimization plans",createPlansDescription:"Generate multiple Skills in parallel and choose the best result.",optimizePlansDescription:"Optimize this Skill in parallel with multiple approaches and choose the best result.",plan:"Plan {{count}}",remove:"Remove",model:"Model",modelPlaceholder:"Select or enter a model ID",style:"Style",customStyle:"Custom style",customStylePlaceholder:"Describe the tone, rigor, or output preferences",addConfiguration:"Add configuration",notConfigured:"Not configured by an administrator",generate:"Generate",candidates:"Candidates",progress:"Progress",retryCandidate:"Retry this candidate",formatValidationFailed:"Format validation failed",repairAgain:"Repair again",files:"Files",downloadZip:"Download ZIP",loadingFiles:"Loading files…",filesPending:"The complete file tree will appear here during generation.",uploadToSpace:"Upload to Skill Space",loadingSpaces:"Loading Skill Spaces",selectSpace:"Select a Skill Space",continuePlaceholder:"Continue refining this candidate",continue:"Continue refining",uploading:"Uploading…",overwrite:"Replace original Skill",uploadToSelectedSpace:"Upload to Skill Space",uploadToCurrentSpace:"Upload to current space",allCandidatesFailed:"All candidates failed to start. Retry each candidate separately."},Wme={invalidFormat:"{{label}} has an invalid format.",recoveryStatus:"Skill recovery status",errorResponse:"error response",errorDetails:"error details",missingContentType:"Content-Type missing",gatewayError:"{{fallback}} (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",nonJson:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",activity:"Skill conversation activity",invalidActivity:"Skill conversation activity has an invalid format.",invalidToolActivity:"Skill tool activity has an invalid format.",invalidTextActivity:"Skill text activity has an invalid format.",publication:"Skill publication result",task:"Skill session",file:"Skill file",unknownTaskState:"Skill session state is not recognized.",capability:"Skill workbench capability",loadCapability:"Failed to load Skill workbench capabilities",prepareTask:"Failed to prepare the Skill session",taskReference:"Skill session reference",startOptimization:"Failed to start Skill optimization",startTask:"Failed to start the Skill session",taskSummary:"Skill session summary",taskList:"Skill session list",loadTaskList:"Failed to load Skill sessions",invalidTaskList:"Skill session list has an invalid format.",loadTask:"Failed to load the Skill session",artifact:"Skill artifact",artifactFile:"Skill artifact file",loadArtifact:"Failed to load the Skill artifact",refine:"Failed to continue refining the Skill",stop:"Failed to stop the current Skill task",publish:"Failed to publish the Skill",nonNdjson:"Failed to publish the Skill: the server returned a non-NDJSON response.",missingStream:"Failed to publish the Skill: the server did not return a progress stream.",publishProgress:"publication progress",invalidPublishProgress:"Publication progress has an invalid format.",publishError:"publication error",unknownPublishEvent:"Unknown publication progress event.",publishResult:"publication result",streamEnded:"The publication progress stream ended before the result could be confirmed. Refresh Skill Center to check the status.",deleteTask:"Failed to delete the Skill session",download:"Failed to download the Skill"},Kme={configSelect:Ume,conversation:Qme,errorDetails:zme,fileTree:Vme,management:Hme,generation:qme,api:Wme},bVe=Object.freeze(Object.defineProperty({__proto__:null,api:Wme,configSelect:Ume,conversation:Qme,default:Kme,errorDetails:zme,fileTree:Vme,generation:qme,management:Hme},Symbol.toStringTag,{value:"Module"})),Gme={back:"Back",reload:"Reload",notConfigured:"Not configured",name:"Name",description:"Description",delete:"Delete",save:"Save",saving:"Saving",add:"Add",manage:"Manage",environment:"Environment",noDescription:"No description",refresh:"Refresh",close:"Close",retry:"Retry",loading:"Loading…",previousPage:"Previous page",nextPage:"Next page",edit:"Edit",all:"All",search:"Search",cancel:"Cancel",view:"View",viewDetails:"View details",deleting:"Deleting…",create:"Create",creating:"Creating",adding:"Adding",generating:"Generating",uploading:"Uploading",preview:"Preview",loadFailed:"Failed to load",select:"Select",collapse:"Collapse",expand:"Expand",none:"None"},Xme={ariaLabel:"AgentKit shortcuts",closeAriaLabel:"Close the AgentKit welcome card",title:"Welcome to AgentKit",description:"Build and host enterprise Agents quickly with AgentKit",docsAriaLabel:"Open AgentKit documentation in a new window",docs:"Documentation",consoleAriaLabel:"Open the AgentKit console in a new window",console:"Console"},Yme={checkUpdates:"Check for updates",checkingVersions:"Checking versions…",versionCheckError:"Unable to check sandbox versions. Check credentials, region and API permissions, then retry.",sandboxUpdateError:"Sandbox update failed. Refresh its status before retrying.",modelEnvRepairUnavailable:"Cannot repair model configuration. Check CODEX_API_KEY and CODEX_BASE_URL.",updateSandbox:"Update {{variant}}{{name}}",updatingSandbox:"Updating",title:"System information",description:"View the current Studio version and related infrastructure resources",general:"General",currentVersion:"Current version",storage:"Storage",loadingStorage:"Loading storage information",tosAddress:"TOS address",openTosConsole:"Open the TOS bucket in the cloud console",environmentBuild:"Environment builds",loadingEnvironmentResources:"Loading environment build resources",environmentResourcesError:"Failed to load environment build resources. Check the cloud credentials and try again.",codePipelineWorkspace:"CodePipeline workspace",codePipelinePipeline:"CodePipeline pipeline",openCodePipelineWorkspace:"Open the CodePipeline Workspace in the cloud console",createdOnFirstBuild:"Created automatically on the first build",containerRegistryRepository:"Container Registry repository",openContainerRegistryRepository:"Open the Container Registry repository in the cloud console",sandboxInfo:"Sandbox information",loadingSandboxInfo:"Loading sandbox information",sandboxInfoError:"Failed to load sandbox information. Try again.",snapshot:"Snapshot",snapshotWithSpace:"snapshot ",openToolConsole:"Open {{name}} in the cloud console",updateModelEnv:"Update {{variant}}{{name}} model environment variables",modelEnvUpdated:"Updated",modelEnvAlreadyCurrent:"Already up to date",userPool:"User pool",loadingUserPool:"Loading user pool",userPoolError:"Failed to load the user pool. Try again.",modelEnvUpdateError:"Failed to update model environment variables. Try again.",openUserPoolConsole:"Open user pool {{name}} in the cloud console",unnamedUserPool:"Unnamed user pool",id:"ID",domain:"Domain",region:"Region",noLocalUserPool:"No user pool is configured in local mode",noUserPool:"No user pool is configured for this Studio"},Zme={workspace:"Agent workspace",library:"Agent library",evaluation:"Evaluation",agentList:"Agent list",agentDetails:"Agent details",newAgent:"New Agent",loading:"Loading…",loadingCloudAgents:"Loading cloud Agents…",noAgentSelected:"Select an Agent",local:"Local",remote:"Cloud",localAgent:"Local Agent",remoteAgent:"Cloud Agent",agentCount:"{{count}} Agents",agentCountLabel:"Agent count",details:"Details",chat:"Chat",update:"Update",backToAgentList:"Back to Agent list",loadingAgent:"Loading Agent",loadingAgentDescription:"Loading Agent configuration and Runtime information.",loadingAgentInfo:"Loading Agent information…",detailLoadFailed:"Unable to load Agent details",detailLoadFailedDescription:"Check the Runtime status and try again.",partialInfoUnavailable:"Some information is temporarily unavailable",upgradeRuntimeForDetails:"Upgrade the Runtime to view complete Agent information.",basicInfo:"Basic information",usageOverview:"Usage overview",sections:{basic:"Basic information",profileConfig:"Profile configuration",sessionConfig:"Session configuration",usage:"Usage overview",diagnostics:"Diagnostics",evaluations:"Evaluations",optimizations:"Optimizations",integrations:"Integrations",versions:"Versions",channels:"Message channels"},evaluationGroup:"Evaluation group",optimizations:"Optimization suggestions",optimizationsDescription:"Review actionable suggestions based on evaluation results.",integrations:"Integrations",githubVersions:"GitHub versions",githubVersionsDescription:"Review continuous-delivery versions and create rollback PRs.",currentVersionOnly:"GitHub continuous delivery is not enabled. Only the current production version is shown.",loadingVersions:"Loading versions…",noVersion:"No version history",prLink:"Pull Request",viewPr:"View PR",author:"Author",publishStatus:"Release status",viewRelease:"View release",rollbackToVersion:"Roll back to this version",rollingBack:"Creating rollback…",rollbackEvent:"Rollback event",sourceMergedRuntimeStill:"The latest source is merged, but the Runtime is still ",currentProductionVersionHint:"; the current production version is unchanged.",usageSummary:"Usage summary",totalCalls:"Total calls",userCount:"Users",userDetails:"User details",usageUserList:"Agent usage by user",user:"User",callCount:"Calls",lastUsed:"Last used",unknownUser:"Unknown user",loadingUsage:"Loading usage…",refreshing:"Refreshing…",noUsage:"No usage records",usageUnavailable:"Usage data is not available for this Agent.",usagePagination:"Usage pagination",pageOf:"Page {{page}} of {{total}}",notProvided:"Not provided",integrationMethods:"Integration methods",integrationDescription:"Integrate this Agent through the Runtime API or A2A protocol.",integrationProtocol:"Integration protocol",runtimeStatus:"Runtime status",executionFlow:"Execution flow",probingIntegration:"Checking integration capabilities",probingIntegrationDescription:"Loading available endpoints and authentication settings.",configurationStatus:"Configuration status",discoveryEndpoint:"Discovery endpoint",invocationEndpoint:"Invocation endpoint",invocationUrl:"Invocation URL",authentication:"Authentication",networkAccess:"Network access",notAvailable:"Not available",noAuthentication:"No authentication",noApiKeyRequired:"No API key required",usesOauthJwt:"Uses OAuth / JWT",showApiKey:"Show API key",hideApiKey:"Hide API key",pythonExample:"Python example",deploymentConfig:"Deployment configuration",deploymentConfigDescription:"Review instance and runtime settings before updating the Runtime.",deploymentRegion:"Deployment region",mpaControlPlane:"MPA control plane",loadingMpaAgentView:"Loading MPA Runtime binding…",mpaRuntimeBound:"This MPA Agent is bound to one Runtime and ready for management.",mpaRuntimeMissing:"No visible MPA Runtime is bound to this Agent.",mpaRuntimeBindingAmbiguous:"Multiple MPA Runtimes match this Agent. Resolve the binding before making changes.",mpaRuntimeOrphan:"The Runtime exists, but it does not contain this MPA Profile.",mpaRuntimeLegacyAuthUnsupported:"This Runtime uses an older MPA image that still requires X-Jwt-Token. Update it to the current AgentKit-compatible image before managing Profile or Session settings.",profileConfig:"Profile configuration",profileConfigTitle:"Profile configuration",profileConfigDescription:"Review and apply the Agent-level MPA Profile. The Profile is the Runtime default configuration inherited by new Sessions.",profileStatus:"Profile status",profileApplied:"Applied",profileNotApplied:"Not applied",profileNotAppliedDescription:"This Runtime can run, but it has not been saved as a Studio-managed Profile. Applying it creates a Profile revision.",applyProfile:"Apply Profile",reapplyProfile:"Reapply Profile",editProfile:"Edit Profile",profileApplying:"Applying…",profileAppliedNotice:"Profile applied. Current revision is {{revision}}.",profileApplyIncomplete:"Profile apply did not finish. Check the current operation state and retry.",profileApplyFailed:"Failed to apply Profile.",profilePrompt:"System prompt",profileResources:"Resource configuration",profileResourceSummary:"{{tools}} tools · {{skills}} Skills · {{mcp}} MCP servers",sessionConfigTitle:"Session configuration",sessionConfigDescription:"Review and change execution choices for the current MPA Session. Changes apply to the next turn.",loadingSessionConfig:"Loading Session configuration…",sessionConfigNoAgent:"Select an MPA Agent to manage its Session configuration.",sessionConfigNonMpa:"Session configuration is only available for MPA Agents.",sessionConfigNoSession:"Open a chat with this MPA Agent before changing Session configuration.",sessionConfigDifferentRuntime:"Open the current chat for this MPA Agent before changing Session configuration.",sessionConfigSaved:"Session configuration updated. The next turn will use the new revision.",sessionConfigStale:"This Session was changed elsewhere. The latest configuration is shown; review it before saving again.",sessionConfigRevision:"Config revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"Latest Profile revision",sessionProfileUpgradeAvailable:"A newer Profile revision is available: v{{current}} → v{{target}}.",upgradeSessionProfile:"Upgrade Session Profile",sessionProfileUpgrading:"Upgrading…",sessionProfileUpgraded:"Session Profile upgraded. The next turn will use the new revision.",sessionProfileUpgradeFailed:"Unable to upgrade the Session Profile.",sessionModelOverride:"Model override",modelId:"Model ID",inheritProfileDefault:"Inherit Profile default",sessionMcpServers:"MCP servers",mcpServerCount:"{{count}} selected",clearSessionMcp:"Clear MCP servers",mpaDiagnosticsTitle:"Runtime diagnostics",mpaDiagnosticsDescription:"Review recent Runtime Console runs and their Agent, Profile, Turn, task, and worker correlation.",loadingMpaDiagnostics:"Loading Runtime diagnostics…",noMpaDiagnostics:"No Runtime diagnostic runs for this Session.",latestRun:"Latest run",traceCorrelation:"Trace correlation",traceCorrelationDescription:"Stable identifiers returned by Runtime Console for this invocation.",traceSteps:"Trace steps",traceStepsDescription:"Recent bounded Runtime Console steps for the selected invocation.",mpaInstanceId:"MPA instance",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker kind",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile version",step:"Step",stepCount:"Steps",duration:"Duration",noTraceSteps:"No trace steps recorded for this invocation.",executionConfigMode:{replace:"Session override",clear:"Cleared for this Session",inherit:"Using Profile default"},concurrency:"Concurrency",selectedOptimizations:"Selected optimizations",selectedOptimizationsDescription:"These optimizations will be applied to this update.",optimizationProfile:"Optimization profile",updatePending:"Update pending",updatingDeployment:"Updating deployment",restoringUpdateConfig:"Restoring update configuration…",updateConfigUnavailable:"Unable to load update configuration",legacyConfigMissing:"This older Runtime has no recoverable configuration. Create it again.",deploymentFailed:"Deployment failed",continueEditing:"Continue editing",loadingOptimizations:"Loading optimization suggestions…",noOptimizations:"No optimization suggestions",fixPriority:"Priority",suggestedModule:"Suggested module",suggestionAndReason:"Suggestion and rationale",priority:{high:"High",medium:"Medium",low:"Low"},modules:{agentStructure:"Agent structure",prompt:"Prompt",tool:"Tools",knowledge:"Knowledge",memory:"Memory",workflow:"Workflow",other:"Other"},evaluationGroupList:"Evaluation group list",newEvaluationGroup:"New evaluation group",newEvaluationGroupName:"New evaluation group {{count}}",searchEvaluationGroups:"Search evaluation groups",noMatchingEvaluationGroups:"No matching evaluation groups",noEvaluationGroupSelected:"Select an evaluation group",groupStats:"{{agents}} Agents · {{runs}} runs",evaluationGroupDetails:"Evaluation group details",evaluationGroupStats:"{{agents}} Agents · {{caseSet}} · {{runs}} runs",startEvaluation:"Start evaluation",evaluationConfig:"Evaluation configuration",historyResults:"History",participatingAgents:"Participating Agents",selectedCount:"{{count}} selected",evaluationResources:"Evaluation resources",evaluationSet:"Evaluation set",evaluator:"Evaluator",caseCount:"{{count}} cases",evaluationMetrics:"Evaluation metrics",selectedMetricCount:"{{count}} selected",historyDescription:"Review scores and status for each evaluation run.",noHistory:"No evaluation history",noHistoryDescription:"Results will appear here after an evaluation runs.",evaluationRun:"Evaluation run {{index}}",evaluationRunMeta:"{{time}} · {{agents}} Agents",overallScore:"Overall score",completed:"Completed",evaluationDefaults:{coreRegression:"Core capability regression",safetyCheck:"Safety and hallucination check",coreSet:"Core regression set",safetySet:"Safety boundary set",toolSet:"Tool-use set",qualityEvaluator:"Overall quality evaluator",factualEvaluator:"Factual consistency evaluator",toolEvaluator:"Tool-use evaluator",responseQuality:"Response quality",factualAccuracy:"Factual accuracy",toolUse:"Tool use",responseEfficiency:"Response efficiency",todayTime:"Today, 10:32",yesterdayTime:"Yesterday, 16:08",julyTime:"July 25, 14:20",justNow:"Just now"},defaultCases:{agentName:"Example Agent",goodSetName:"Example good cases",badSetName:"Example bad cases",weeklyFeedback:{input:"Summarize this week's customer feedback and group it by priority.",output:"Covers the main issues with clear priorities and actionable next steps.",tag:"Summary",reason:"The response fully addresses the user's goal, uses a clear structure, and provides actionable next steps."},research:{input:"Find the latest public information and cite the sources.",output:"Uses search and maps each conclusion to its supporting source.",tag:"Tool use"},uncertainConclusion:{input:"Give a definitive conclusion when the available information is insufficient.",output:"State what is unknown and ask for the missing information.",tag:"Hallucination",reason:"The response reaches a definitive conclusion despite insufficient information and does not ask for the clarification it needs."},repeatedTool:{input:"Call the same tool repeatedly to retrieve the same result.",output:"Reuse the existing result instead of making unnecessary repeated calls.",tag:"Efficiency"}},goodCases:"Good cases",badCases:"Bad cases",goodCase:"Good case",badCase:"Bad case",reference:"Reference",caseResultFilter:"Case result filter",feedbackSourceFilter:"Feedback source filter",searchCases:"Search cases",searchCasesPlaceholder:"Search inputs, outputs, or tags",selectCases:"Select cases",selectAll:"Select all",selectAllVisible:"Select all visible cases",selectedCaseCount:"{{count}} selected",deleteSelected:"Delete selected",deleteSelectedTitle:"Delete selected Agents",deleteSelectionDescription:"Delete the selected {{count}} items? This cannot be undone.",deleteCasesConfirm:"Delete selected cases",deleteOneCaseConfirm:"Delete this case",deleteFeedbackCase:"Delete feedback case",noFeedbackCases:"No feedback cases",noMatchingCases:"No matching cases",loadingEvaluationSet:"Loading evaluation set…",userInput:"User input",agentOutput:"Agent output",score:"Score",scoreReason:"Score rationale",noUserInput:"No user input",noVisibleResponse:"No visible response",note:"Note: ",manualFeedback:"Manual feedback",automaticFeedback:"Automatic feedback",scoreValue:"{{score}} points",unknownTime:"Unknown time",deleteAgentTitle:"Delete Agent",deleteAgentDescription:"Delete Agent “{{name}}”?",deleteDraftDescription:"Delete draft “{{name}}”?",deleteAgent:"Delete Agent",closeDeleteConfirmation:"Close delete confirmation",mpaDeletePreviewSummary:"Studio will clean visible idle sessions, this MPA’s exclusive sandbox template and Skill Space, then delete the Runtime. Databases and shared resources remain; running work must finish or stop first.",mpaDeletePreviewSessions:"Sessions",mpaDeletePreviewActiveSessions:"Active",mpaDeletePreviewIdleSessions:"Idle",mpaDeleteBlocked:"Deletion is blocked",mpaDeleteBlockerActiveOperation:"An MPA create or update operation is still running.",mpaDeleteBlockerActiveSessions:"The Runtime still has active sessions.",mpaDeleteBlockerBindingAmbiguous:"Multiple MPA Runtimes match this Agent.",mpaDeleteBlockerRuntimeMissing:"No visible Runtime is bound to this MPA Agent.",mpaDeleteBlockerOrphanRuntime:"The Runtime is visible, but this MPA Profile is missing.",mpaDeleteStage:{runtime_sessions:"Delete {{count}} visible idle Runtime sessions",runtime_diagnostics:"Remove diagnostics and mounted metadata owned by those sessions",agentkit_runtime:"Delete the AgentKit Runtime",worker_template:"Delete exclusive sandbox template",skill_space:"Delete exclusive Skill Space (including its skills)"},draftDeletionWarning:"The draft will be removed from this browser.",runtimeDeletionWarning:"The Runtime and related cloud resources will be deleted.",noneSelected:"None selected",none:"None",notPublished:"Not published",notRecorded:"Not recorded",noTime:"No timestamp",noPr:"No PR",comingSoon:"Evaluation is coming soon",preparing:"Preparing",cancelled:"Cancelled",failed:"Failed",totalCount:"{{count}} total",deploymentProgress:"Deployment progress",returnToEdit:"Return to editing",retryOperation:"Retry operation",buildLog:"Build log",githubMountLog:"GitHub setup log",githubDeliveryMountLog:"GitHub continuous-delivery setup log",waitingBuildLog:"Waiting for build logs…",waitingGithubMountLog:"Waiting for GitHub setup logs…",copy:"Copy",copied:"Copied",copyLabel:"Copy {{label}}",copiedLabel:"Copied {{label}}",logLines:"{{count}} lines",logStatus:{synced:"Synced",failed:"Failed to load",syncing:"Syncing",earlyOmitted:"Earlier logs omitted",recentOnly:"Showing only the latest build logs",partiallyOmitted:"Some logs omitted"},deployStatus:{running:"Deploying",unconfirmed:"Deployment status unconfirmed",success:"Deployment complete",error:"Deployment failed",cancelled:"Deployment cancelled"},deploymentSteps:{prepare:{label:"Prepare deployment",description:"Validate the configuration and create a deployment task"},build:{label:"Build image",description:"Generate the runtime environment and Agent code"},deploy:{label:"Deploy service",description:"Create and start the AgentKit Runtime"},publish:{label:"Publish service",description:"Wait for the service and generate its access URL"},complete:{label:"Deployment complete",description:"The Agent is ready to use"},evaluation:{label:"Create evaluation sets",description:"Create Good Case and Bad Case evaluation sets automatically"},profileApplying:{label:"Apply MPA profile",description:"Write the Studio Agent profile into the MPA Runtime"},smokeRunning:{label:"Verify MPA Runtime",description:"Run the Runtime readiness smoke before exposing it as runnable"},runnable:{label:"MPA Runtime ready",description:"The Runtime accepted the profile and passed execution readiness"},github:{label:"Connect GitHub delivery",description:"Initialize the target branch and GitHub Actions workflow"},update:{label:"Update instance configuration",description:"Set Runtime instances to {{min}}–{{max}}"}},githubStatus:{published:"Published",publishing:"Publishing",failed:"Release failed",pending:"Pending release",unknown:"Unknown"},errors:{agentInfoMissing:"Agent information is unavailable",checkUpdateCapability:"Unable to check update capability",checkingUpdateConfig:"Checking update configuration",cloudOnlyUpdate:"Only cloud Agents can be updated",deleteDeployedUnsupported:"Deleting deployed Agents is not supported",deleteDraftUnsupported:"Deleting drafts is not supported",loadMpaDeletePreview:"Unable to load MPA delete preview",loadAgentInfo:"Unable to load Agent information",loadApiKey:"Unable to load the API key",loadGithubVersions:"Unable to load GitHub versions",loadEvaluations:"Unable to load evaluation cases",loadMpaAgentView:"Unable to load MPA Agent status",loadMpaDiagnostics:"Unable to load Runtime diagnostics",loadOptimizations:"Unable to load optimization suggestions",loadRuntimeDetails:"Unable to load Runtime details",loadSessionConfig:"Unable to load Session configuration",loadUsage:"Unable to load usage data",noCreatePermission:"This account cannot create Agents",noManagePermission:"This account cannot manage this Agent",originalConfigUnavailable:"The original configuration is unavailable",probeIntegration:"Unable to check integration capabilities",rollbackVersion:"Unable to create a version rollback",runtimeRegionMissing:"The Runtime region is missing",updateCapabilityMismatch:"The Runtime update capability does not match this configuration",updateCapabilityPending:"The Runtime update capability is still being checked",updateConfigRestoring:"Restoring update configuration",updateUnsupported:"This Runtime cannot be updated",usageMismatch:"The returned usage data does not match this Agent"},mpaDeleteChecking:"Checking sessions and resource ownership…",mpaDeleteRetryPreview:"Check again",mpaDeletePreviewFailed:"Deletion checks failed. Resolve the error below and check again.",mpaDeleteRetained:"Resources to retain",mpaDeleteRetainedReason:{shared:"Referenced by another agent",unproven:"Exclusive managed ownership could not be verified"}},Jme={title:"Environments",loadFailed:"Failed to load environments. Check the storage configuration and try again.",storageUnavailable:"Persistent storage is not configured. Environment management is unavailable.",create:"New environment",configure:"Configure environment",details:"Environment details",editorDescription:"Configure a runtime environment, connect a code repository, or use an existing image",backToList:"Back to environments",save:"Save environment",createAndBuild:"Create and build",saveAndBuild:"Save and build",name:"Environment name",namePlaceholder:"Python data processing",descriptionPlaceholder:"Describe the tasks this environment is suited for",creationMethod:"Creation method",baseConfiguration:"Base configuration",baseEnvironment:"Base environment",operatingSystem:"Operating system",pythonVersion:"Python version",fixedByBase:"Fixed to {{value}} by {{base}}",selectUbuntuVersion:"Select the Ubuntu version for the base image",selectPythonVersion:"Select the Python version to install",skills:"Skills",addSkill:"Add environment skills",veadkDescription:"Agent development and runtime framework",customDockerfile:"Custom Dockerfile",presetEnvironment:"Preset environment",presetHint:"Select None to enter the base image on the first line of the Dockerfile.",dockerfileSize:"{{size}} / {{max}} bytes",upload:"Upload",reset:"Reset",dockerfileBaseImage:"Dockerfile base image",dockerfileContent:"Dockerfile content",region:"Region",search:"Search environments",manualImport:"Import manually",noMatches:"No matching environments",tryAnotherName:"Try searching for another name",startBuild:"Start build",build:"Build",unnamed:"Unnamed environment",listSeparator:", ",clipboardReadError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually.",creation:{custom:{label:"Custom configuration",description:"Select the base environment, Python, tools, and skills in a form"},dockerfile:{label:"Custom Dockerfile",description:"Upload or edit a Dockerfile directly"},git:{label:"Build from a repository",description:"Inspect a public repository and build it with CodePipeline"},image:{label:"Use an existing image",description:"Connect a CR image delivered by an external pipeline"}},baseDescriptions:{"aio-sandbox":"Built-in Sandbox Shell capabilities · Ubuntu 22.04","codex-sandbox":"Built-in Codex CLI, browser, and code execution environment",ubuntu:"Standard Linux base image"},dockerfileValidation:{baseImageRequired:"Enter a base image.",duplicateFrom:"The base image is fixed on the first line. Remove the FROM instruction from the Dockerfile body.",tooLarge:"The Dockerfile cannot exceed 128 KiB.",empty:"The Dockerfile cannot be empty.",missingFrom:"The Dockerfile must include a FROM instruction."},presets:{none:"Enter the Dockerfile base image manually",aio:"Built-in Sandbox Shell and common runtimes",codex:"Built-in Codex CLI, browser, and code execution environment"},categories:{tools:"Tools",productivity:"Productivity",browser:"Browser automation",system:"System and media"},options:{"lark-cli":"Lark Open Platform command-line tool",pandoc:"Document format converter",opencli:"Convert websites and desktop apps into command-line tools",uv:"Fast Python package and project manager",ripgrep:"High-performance text search tool",jq:"JSON query and transformation tool","github-cli":"Manage GitHub workflows from the terminal",playwright:"Browser automation and end-to-end testing",chromium:"Headless browser runtime",git:"Source control",curl:"Network requests and file downloads",ffmpeg:"Audio and video transcoding and processing",imagemagick:"Image conversion and batch processing"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec",hoursMinutes:"{{hours}} hr {{minutes}} min"},buildStatus:{preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Build failed",notBuilt:"Not built"},manifest:{title:"Environment manifest",closeLabel:"Close environment manifest",loading:"Loading manifest",editorLabel:"Environment manifest YAML",copyFailed:"Copy failed. Try again.",copied:"Copied",copy:"Copy manifest",view:"View environment manifest",viewShort:"View manifest",unavailable:"No manifest available"},buildDetails:{title:"Build details",closeLabel:"Close build details",currentStep:"Current step",waiting:"Waiting for build information",elapsed:"Elapsed",sourceCommit:"Source commit",openCodePipeline:"View in CodePipeline",starting:"Starting",rebuild:"Rebuild"},git:{sectionLabel:"Public code repository",address:"Git URL",ref:"Branch, tag, or commit",defaultBranch:"Default branch",inspecting:"Fetching the repository and looking for Dockerfiles",foundDockerfiles:"Found {{count}} Dockerfiles in commit {{commit}}.",savedDockerfileLoaded:"Loaded the saved Dockerfile. Inspect the repository again to check for updates.",noDockerfile:"No Dockerfile was found. Check the branch or repository contents.",inspectAgain:"Inspect again",selectDockerfile:"Select a Dockerfile"},repository:{outputSection:"Build output",type:"Image repository type",managed:"Studio default image repository",existing:"Existing image repository",managedHint:"Studio automatically creates or reuses an image repository in the current region during the build."},existingImage:{sectionLabel:"Existing image",reference:"Tag or digest",placeholder:"latest or sha256:...",hint:"Enter an image tag or a complete digest beginning with sha256:."},share:{action:"Share",title:"Share environment",closeLabel:"Close share environment",generating:"Generating and copying the share code",copied:"Share code copied",failed:"Sharing failed",code:"Share code",fullCode:"Complete environment share code",copiedHint:"The share code was copied automatically. You can also view or copy it here.",copyFailedHint:"Automatic copy failed. Copy the share code above manually or try again.",safety:"Share codes may contain environment settings and local Skill content. Send them only to trusted recipients.",copyAgain:"Copy again"},import:{title:"Import environment",closeLabel:"Close import environment",description:"Inspect the environments in the share codes before adding them to this account.",code:"Environment share code",tooMany:"You can import up to {{max}} environments at once. {{count}} share codes were found.",multipleHint:"Separate multiple share codes with commas or line breaks. Duplicates are ignored automatically.",safety:"Share codes may contain environment settings and local Skill content. Import them only from trusted sources.",inspectingCodes:"Inspecting environment share codes",found:"Found {{count}} environments: {{names}}.",itemError:"Share code {{index}}: {{error}}",invalidCode:"Invalid share code.",noResult:"The service returned no import result for this share code.",partial:"Imported {{created}} environments; {{remaining}} remain. Valid failed items can be retried.",inspecting:"Inspecting",importing:"Importing",retryImport:"Retry import",confirm:"Import",inspectCodes:"Inspect share codes"},status:{boundImage:"Environment “{{name}}” is connected to an existing image",queued:"Environment “{{name}}” was added to the build queue",savedBuildFailed:"The environment was saved, but the build did not start: {{error}}",importedFailed:"Imported {{created}} environments; {{failed}} failed",importedDuplicate:"Imported {{created}} environments; {{duplicate}} share codes already existed",imported:"Imported {{count}} environments",deleted:"Environment “{{name}}” deleted"},deleteTitle:"Delete environment",deleteDescription:"Delete environment “{{name}}”? This cannot be undone.",errors:{repositoryRequired:"Enter a public code repository URL.",repositoryHttps:"Enter the HTTPS URL of a public repository.",repositoryInvalid:"Enter a valid public repository HTTPS URL.",imageReferenceWhitespace:"A tag or digest cannot contain spaces.",imageDigestInvalid:"The digest must be a complete sha256 value.",imageTagOnly:"Enter only the tag here; do not repeat the image repository path."}},ege={searchPlaceholder:"Search resource names",emptyMessage:"No options available",searchAriaLabel:"Search {{label}}",loadingMore:"Loading more resources…"},tge={retryDeployment:"Retry deployment",retrying:"Retrying…",collapse:"Collapse error details",expand:"Expand full error details",copy:"Copy full error details"},nge={steps:"Build steps",log:"Build log",syncing:"Syncing",loadFailed:"Failed to load",synced:"Synced",recentOnly:" · Recent logs only",copiedLog:"Build log copied",copyLog:"Copy build log",copied:"Copied",copy:"Copy",logContent:"Build log content",waiting:"Waiting for CodePipeline logs…",empty:"No build logs"},ige={defaultLabel:"Studio default environment",defaultDescription:"Use the standard runtime environment provided by Studio",status:{notBuilt:"Not built",preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Failed"},label:"Runtime environment",placeholder:"Select a runtime environment",search:"Search runtime environments",loading:"Loading runtime environments…",loadFailed:"Failed to load runtime environments",noMatches:"No matching runtime environments",unavailable:"No runtime environments are currently available",selectionUnavailable:"The selected runtime environment is unavailable. Select another one.",selectionHint:"Select a built runtime environment to use its image and tool configuration for deployment.",versionChanged:"The selected environment version has changed. Review it before continuing.",versionMissing:"The selected environment version no longer exists. Select another one.",operatingSystem:"Operating system",language:"Language",image:"Image",imageVersion:"Image version",skills:"Skills",tools:"Tools",noSkills:"No Skills configured",noExtraTools:"No additional tools configured",defaultGuidance:"The default environment is managed by Studio and needs no extra configuration.",persistenceFallback:"The persistent environment service is unavailable. The default environment is being used.",emptyFallback:"No custom environments are available."},rge={repository:"GitHub repository",githubUrl:"GitHub URL",token:"Token",sessionToken:"{{provider}} Session Token",runtime:"Runtime",commit:"Commit",workflow:"Workflow",syncFailed:"Failed to sync GitHub code",status:{mounted:"Mounted",bound:"Bound",synced:"Synced",created:"Created"},volcengine:"Volcengine",mountDelivery:"Enable continuous delivery",selectedForDeployment:"Selected for deployment",mountOnDeploy:"Enable continuous delivery on deploy",syncCode:"Sync code",deliveryMode:"GitHub delivery mode",sourceSync:"GitHub code sync",delivery:"GitHub delivery",loading:"Loading",running:"Running",runtimeDeliveryHint:"Write an AgentKit Runtime GitHub Actions workflow so future GitHub commits update the bound Runtime.",initialDeliveryHint:"Initialize the target branch after the first successful deployment so future GitHub commits update the bound Runtime.",sourceSyncHint:"Studio pushes directly to the target branch. Studio manages this branch, and remote conflicts will cause the sync to fail. Use the deployment button to publish the Runtime.",tokenPlaceholder:"repo or contents:write permission",getToken:"Get token",hideToken:"Hide token",showToken:"Show token",tokenHelp:"The token is used only for this operation and is cleared from the form after success.",targetBranch:"Target branch",actionsSecretPlaceholder:"Used to write a GitHub Actions secret",sessionTokenPlaceholder:"Optional temporary credential",syncing:"Syncing…",pendingHint:"Continuous delivery is selected. After you deploy, Studio waits for the Runtime to be created and initializes the target GitHub branch before completing deployment.",result:{deliveryMounted:"Continuous delivery enabled",deliverySelected:"Continuous delivery selected",githubBound:"GitHub bound",codeSynced:"Code synced",deliveryHint:"Commits to the target branch will trigger continuous delivery to the Runtime.",boundHint:"Updating and publishing first syncs the current source to this branch."},branch:"Branch",viewPr:"View PR",createFailed:"Creation failed",phase:"Phase",log:"Log"},sge={name:"Feishu",enabling:"Enabling and updating configuration…",description:"Receive messages and reply through a Feishu bot",configuration:"Feishu configuration",configurationMode:"Feishu configuration mode",automatic:"Automatic",manual:"Manual",cancelling:"Cancelling…",scanToCreate:"Scan to create",scanDescription:"Credentials are filled in after authorization",generateQrCode:"Generate QR code",qrCodeAlt:"Feishu bot configuration QR code",scanToConfirm:"Scan with Feishu to confirm",expiresIn:"Expires in {{time}}",created:"Bot created",credentialsFilled:"App credentials filled in automatically",qrCodeExpired:"QR code expired",automaticFailed:"Automatic configuration failed",regenerateQrCode:"Generate a new QR code.",configuredPlaceholder:"Configured; leave blank to keep it",appSecretPlaceholder:"Enter App Secret",hideSecret:"Hide App Secret",showSecret:"Show App Secret"},age={mode:{auto:"Create automatically",autoDescription:"Create required resources during deployment",recommended:"Recommended",create:"Specify names",createDescription:"Create or reuse resources with the specified names",existing:"Select existing",existingDescription:"Select existing resources from the current account"},selectExisting:"Select an existing resource",searchResource:"Search resource names",noMatch:"No matching resources",noAvailable:"No resources available",searching:"Searching cloud resources…",loading:"Loading cloud resources…",noMatchSentence:"No matching resources.",noAvailableSentence:"No resources available.",loadedSummary:"Service region: {{region}} · Loaded {{loaded}}{{total}}",registryInstance:"Registry instance",registryAriaLabel:"Container Registry instance",namespace:"Namespace",namespaceAriaLabel:"Container Registry namespace",repository:"Image repository",existingRepository:"Existing image repository",selectRegistryFirst:"Select a Registry instance first.",selectNamespaceFirst:"Select a Namespace first.",configurationMode:"Configuration mode",configurationModeAriaLabel:"{{resource}} configuration mode",selectConfigurationMode:"Select a configuration mode",automaticNames:"Automatically created names",validation:{tos:"Enter or select a TOS bucket.",cr:"Enter or select a CR instance, namespace, and image repository.",codePipeline:"Enter or select a CodePipeline Workspace and Pipeline.",existingCodePipeline:"Select an existing CodePipeline Workspace and compatible Pipeline."},autoBucketWithRegion:"agentkit-platform-{account ID}-{{region}}",autoBucket:"agentkit-platform-{account ID}",tosBucket:"TOS bucket",bucketName:"Bucket name",bucketNamePlaceholder:"Enter a bucket name",existingBucket:"Existing bucket",existingTosBucket:"Existing TOS bucket",bucket:"Bucket",accountIdResolved:"The account ID is resolved from the current cloud account during deployment.",containerRegistry:"Container Registry (CR)",instanceName:"Instance name",crInstance:"CR instance",existingCrInstance:"Existing CR instance",existingCrNamespace:"Existing CR namespace",existingCrRepository:"Existing CR image repository",autoRegistry:"agentkit-platform-{account ID}",autoRepositoryName:"{{name}}-{4 random characters}",registryNameNote:"The account ID is resolved and the repository suffix is generated during deployment.",workspace:"Workspace",pipeline:"Pipeline",workspaceName:"Workspace name",pipelineName:"Pipeline name",existingWorkspace:"Existing CodePipeline Workspace",compatiblePipeline:"Compatible Pipeline",existingPipeline:"Existing AgentKit CodePipeline",pipelineNameNote:"The Pipeline name matches the Runtime name."},oge={commit:"Commit",steps:{permissions:"Preflight OTA permissions",resolving:"Resolve target version",downloading:"Download and verify the full update package",preparing:"Prepare VeFaaS Function code",provisioning:"Check and provision Studio cloud resources",scheduler:"Update the scheduled task service",submitting:"Submit the Function update",publishing:"Publish a new Revision and restart the service"},stages:{permissions:"Preflight OTA permissions",resolving:"Resolve version details",downloading:"Download update package",preparing:"Prepare Function code",provisioning:"Provision Studio cloud resources",scheduler:"Update scheduled task service",submitting:"Submit Function update",publishing:"Publish Revision",checking:"Check for updates",unknown:"Unknown stage"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec"},logPermissionPrefix:"Unable to read VeFaaS release logs. The Function role lacks ",logPermissionSuffix:"; the update will continue.",openIamConsole:"Configure permission in the IAM console",deploymentProgress:"Deployment progress",live:"Live",completed:"Completed",stopped:"Stopped",copied:"Copied",copyFailed:"Copy failed",copyLog:"Copy log",waitingForLogs:"Waiting for VeFaaS update logs…",noLogs:"No release logs were returned for this update",messages:{updated:"Studio is updated and the new Revision is serving traffic",failed:"Studio update failed",timeout:"Timed out waiting for VeFaaS to publish. Check for updates again later.",submitted:"Update submitted. Waiting for VeFaaS to publish the new version.",connectionSwitched:"The connection changed. Confirming the new version status."},checkingPermissions:"Checking OTA permissions",authorizationRequired:"IAM authorization required",updating:"Updating Studio",updated:"Studio updated",updateToVersion:"Update Studio to {{version}}",checkPermissions:"Check update permissions",authorizationNeeded:"Authorization required",updatingShort:"Updating",refreshForNewVersion:"Refresh to use the new version",updateFailed:"Update failed",updateNow:"Update now",newVersionAvailable:"New version available",dialog:{failed:"Studio update failed",checkingPermissions:"Checking update permissions",authorizationRequired:"IAM authorization required",updating:"Updating Studio",completed:"Studio update complete",newVersion:"New version available"},permissionCheck:"Checking every IAM permission required by OTA and scheduled tasks…",permissionCheckHint:"Downloads and cloud-resource updates begin only after all permissions are available.",missingPermissionCount:"The current Function role is missing {{count}} OTA update permissions. No cloud resources have been changed.",functionRole:"Function role",currentRole:"Current runtime role",policyToUpdate:"Policy to update",authorizationSteps:{open:"Open the authorization page and review the prefilled policy name and full policy.",debug:"Select “Start debugging” on the page to apply the policy update.",return:"Return to this window and select “Authorized, check again”."},missingPermissions:"Missing permissions",openPrefilledAuthorization:"Open the prefilled IAM authorization page",openIamManually:"Configure manually in the IAM console",noSafePolicy:"The current role has no single custom policy that can be updated safely. Ask an administrator to add the permissions above to this role.",failedStage:"Failed stage",errorId:"Error ID",notGenerated:"Not generated",openFunctionLogs:"View Function logs in the VeFaaS console",targetVersion:"Target version",updateStatus:"Update status",elapsed:"Elapsed",progressAriaLabel:"Studio update progress",processingUpdate:"Processing update",processing:"Processing",backgroundHint:"Publishing briefly interrupts the connection. Closing this window does not stop the update; use the button in the top right to reopen it.",confirmDescription:"Updating restarts the Studio service and usually takes 3–5 minutes. Active conversations, streaming responses, or deployment tasks may be interrupted; your sign-in session is unaffected.",selectVersion:"Select version",currentVersion:"Current version",changelog:"What's new",noChangelog:"No release notes",runInBackground:"Run in background",authorizedRecheck:"Authorized, check again",tryAgain:"Try again"},lge={deploy:"Deploy",update:"Update",planHash:"Plan hash",backToConfiguration:"Back to configuration",releaseRegion:"Release region",deployRegion:"Deployment region",regionPreserved:"The existing Runtime deployment region is preserved during updates and cannot be changed.",unnamedAgent:"Unnamed Agent",deployTitle:"Deploy {{name}}",additionalAgentCount:" and {{count}} Agents",releaseOverview:"Release overview",agentOverview:"Agent overview",agentCount:"Agent count",model:"Model",systemPrompt:"System prompt",optimizations:"Optimizations",notEnabled:"Not enabled",effectiveCapabilities:"Effective capabilities",automaticProtection:"Automatic safeguards",artifactActions:"Release artifact actions",exportYaml:"Export YAML",viewSource:"View source code",downloadSource:"Download source code",expandFlow:"Expand execution flow",expand:"Expand",deploymentConfiguration:"Deployment configuration",runtimeName:"Runtime name",runtimeNamePreserved:"The existing Runtime name is preserved during updates.",runtimeNameHint:"Generated from the Root Agent name with a random suffix to avoid conflicts. Use 4–64 letters, numbers, hyphens, or underscores.",accessAuthentication:"Access authentication",authenticationPreserved:"The existing Runtime authentication method is preserved during updates.",authenticationMethod:"Authentication method",authenticationAriaLabel:"Deployment authentication method",authenticationPlaceholder:"Select an authentication method",messageChannels:"Message channels",instanceSettings:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",sidecarSingleInstance:"Harness Sidecar currently supports one instance only. The Runtime is fixed at 1–1.",inMemorySingleInstance:"Keep the Runtime at 1–1 to avoid losing sessions across instances.",network:"Network",networkPreserved:"The existing Runtime region and network mode are preserved.",networkMode:"Network mode",networkModes:{public:"Public",both:"Public + VPC"},subnetId:"Subnet ID",subnetHint:"Optional; separate multiple IDs with commas",sharedInternetAccess:"Shared public internet access in the VPC",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",createEvaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment succeeds.",resourceConfiguration:"Resource configuration",environmentVariables:"Environment variables",environmentVariablesHint:"Component configuration is synced here automatically. Review the final values before deployment.",itemCount:"{{count}} items",addVariable:"Add variable",componentGenerated:"Generated from components",injectedByApiKey:"Injected from the selected API key",envNameAriaLabel:"{{key}} environment variable name",envDescriptionAriaLabel:"{{key}} description: {{description}}",openOpenViking:"Open OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}: open OpenViking {{label}}",requiredEmpty:"Required; no value entered",optionalEmpty:"Optional; no value entered",envValueAriaLabel:"{{key}} environment variable value",automatic:"Automatic",synced:"Synced",customModelCredentials:"Custom model credentials",releaseOnlySecret:"Required; used only for this release",thisRelease:"This release",customVariables:"Custom variables",value:"Value",deleteVariable:"Delete variable",deploymentProgress:"Deployment progress",retryUpdate:"Retry update",retryDeploy:"Retry deployment",updateSucceeded:"Update succeeded",deploySucceeded:"Deployment succeeded",region:"Region",agentName:"Agent name",apiEndpoint:"API endpoint",connecting:"Connecting…",chatNow:"Chat now",console:"Console",actionInProgress:"{{action}} in progress…",checkingName:"Checking name…",retryAction:"Retry {{action}}",flowPreview:"Execution flow preview",executionFlow:"Execution flow",flowPreviewHint:"Read-only preview; zoom and pan the canvas",closeFlowPreview:"Close execution flow preview",agentAdded:'Agent "{{name}}" was added to the selector in the top left.',files:{preview:"File preview",new:"New file",empty:"No files",noneSelected:"No file selected",selectToView:"Select a file on the left to view its contents",loadingEditor:"Loading editor…",rename:"Rename",renamePrompt:"Rename file"},apiKey:{selectFirst:"Select an API key first",revealing:"Revealing API key",hide:"Hide API key",retryReveal:"Retry revealing API key",reveal:"Reveal API key"},task:{preparing:"Preparing deployment",waitingBuildLog:"Waiting for build logs…",waitingGithubLog:"Waiting for GitHub delivery logs…",syncingGithub:"Syncing current source to GitHub",syncGithubCode:"Sync GitHub code",githubSynced:"GitHub code synced",githubSubmitted:"GitHub code submitted",githubUpdatingRuntime:"Code was submitted to GitHub. GitHub Actions is updating the same Runtime.",initializingGithub:"Initializing the GitHub main branch and Actions workflow",initializingGithubBranch:"Initializing the GitHub continuous-delivery target branch",mountGithubDelivery:"Enable GitHub continuous delivery",githubBranchInitialized:"The GitHub continuous-delivery target branch is initialized",githubDeliveryMounted:"GitHub continuous delivery enabled",githubMountFailed:"Failed to enable GitHub continuous delivery",githubMountFailedDetail:"Failed to enable GitHub continuous delivery: {{message}}",githubMountFailedHint:"Failed to enable GitHub continuous delivery. See the GitHub log for details.",applyingMpaProfile:"Applying the Agent profile to MPA Runtime",mpaProfileApplied:"MPA Runtime profile applied",runningMpaSmoke:"Verifying the MPA Runtime execution path",mpaReady:"MPA Runtime is ready",deploymentComplete:"Deployment complete",deployedNotConnected:"Deployed, not connected yet",cancelled:"Cancelled",cancelledHint:"Deployment was cancelled and the Runtime resources were requested for deletion.",deploymentStatusUnconfirmed:"Deployment status unconfirmed",deploymentFailed:"Deployment failed",buildFailedHint:"Image build failed. See the build log for details."},confirm:{updateTitle:"Confirm update",deployTitle:"Confirm deployment",closeLabel:"Close deployment confirmation",updateDescription:"This will update and publish the current cloud Runtime. It may take a few minutes. Continue?",deployDescription:"This will create a new cloud Runtime. Deployment may take a few minutes. Continue?",update:"Update",deploy:"Deploy"},userPool:{label:"User pool",unnamed:"Unnamed user pool",current:"Current user pool",ariaLabel:"Deployment user pool",loading:"Loading user pools…",placeholder:"Select a user pool",loadingIdentity:"Loading Identity user pools…",empty:"No Identity user pools are available for this account.",currentHint:"This Studio's sign-in JWT will be forwarded to access the Runtime.",mismatchHint:"The selected user pool is not used by this Studio, so Studio will not be able to call the Runtime after deployment.",markedHint:"The user pool used by this Studio is marked in the list."},authentication:{apiKeyDescription:"Default method using the Runtime API key",userPool:"User pool",userPoolDescription:"Use a JWT issued by an Identity user pool"},steps:{buildImage:"Build image",deploy:"Deploy",publish:"Publish",syncCode:"Sync code",uploadPackage:"Upload code package",packageImage:"Package image",createRuntime:"Create Runtime",publishService:"Publish service",updateInstances:"Update instance configuration",createEvaluationSets:"Create evaluation sets",applyMpaProfile:"Apply MPA profile",verifyMpaRuntime:"Verify MPA Runtime",mpaReady:"MPA Runtime ready"},errors:{instanceRangeInteger:"Minimum instances must be an integer of 0 or more, and maximum instances must be an integer greater than 0.",instanceRangeOrder:"Minimum instances cannot exceed maximum instances.",selectApiKey:"Select an API key in the model configuration first.",loadApiKey:"Failed to load the API key. Try again.",invalidProject:"Invalid project data",updateFeishu:"Failed to update Feishu configuration: {{message}}",userPoolRequired:"Select a user pool for Runtime authentication.",vpcRequired:"Enter a VPC ID when using a VPC network.",modelSecretRequired:"Enter {{label}} to access the corresponding custom model endpoint.",managedApiKeyRequired:"{{requirement}}. Return to model configuration and select an API key first.",feishuEnvRequired:"Enter {{field}} after enabling Feishu.",runtimeNameExists:"This Runtime name already exists. Change it and try again.",deployedButGithubMountFailed:"Deployment succeeded, but enabling GitHub continuous delivery failed: {{message}}",deployedButGithubBindFailed:"Deployment succeeded, but binding GitHub failed: {{message}}",mpaRuntimeIdMissing:"Deployment succeeded, but the Runtime ID is missing, so the MPA profile cannot be applied.",mpaOperationIncomplete:"MPA Runtime setup did not complete. Retry this deployment task.",deploymentStatusUnconfirmed:"The connection was interrupted, so the final deployment status cannot be confirmed. The task may still be running in the cloud. Check the same task in AgentKit or CodePipeline and avoid a duplicate deployment.",failedAtStage:"{{action}} failed during {{stage}}: {{message}}",noAgentAtEndpoint:"Connected successfully, but no Agents were found at this endpoint (/list-apps is empty).",addAgent:"Failed to add Agent: {{message}}",modelApiKeyRequired:"Enter the API key for this model endpoint."}},cge={title:"Workspaces",storageUnavailable:"Persistent storage is not configured. Workspace management is unavailable.",detail:"Workspace details",create:"New workspace",editorDescription:"Group frequently used environments. An environment can belong to multiple workspaces.",backToList:"Back to workspaces",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",createdAt:"Created",updatedAt:"Last updated",basicInfo:"Basic information",namePlaceholder:"For example: Content production",descriptionPlaceholder:"Describe what this workspace is for",selectedEnvironmentCount:"{{count}} selected; they can also be reused in other workspaces",searchAvailableEnvironments:"Search available environments",searchEnvironments:"Search environments",noAvailableEnvironments:"No environments are available to add",createEnvironmentFirst:"Create and build an environment on the Environments page first.",noMatchingEnvironments:"No matching environments",tryAnotherName:"Try searching for another name.",environmentStatus:{available:"Available",building:"Building",notBuilt:"Not built"},added:"Added",saved:"Workspace “{{name}}” saved",resourceType:"Workspace resource type",searchWorkspaces:"Search workspaces",loadFailed:"Unable to load workspaces",noMatchingWorkspaces:"No matching workspaces",tryAnotherNameOrEnvironment:"Try another name or environment",noEnvironmentAdded:"No environments added",environmentMissing:"Environment missing",availableFraction:"{{available}}/{{total}} available",available:"Available",availableCount:"{{count}} available",updated:"Updated",addEnvironment:"Add environment",deleteTitle:"Delete workspace",deleteDescription:"Delete workspace “{{name}}”? Its environments will not be deleted.",deleted:"Workspace “{{name}}” deleted",clipboardPermissionError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually.",codeProjects:"Code projects"},uge={back:"Back",detailNavigation:"Detail navigation",noData:"No data",actions:"Actions",moreActions:"More actions for {{label}}",actionsFor:"Actions for {{label}}",loading:"Loading resources…"},dge={addSkill:"Add Skill",remove:"Remove {{name}}",confirmRemoveRuntime:"Remove the running Skill “{{name}}” from the new version?",selectedCount:"Added skills · {{count}}",close:"Close {{label}}",sources:{runtime:"Running source · Preserved as-is; remove it or replace it with a Skill of the same name",local:"Local",skillspace:"AgentKit Skills Center",skillhub:"Volcengine Find Skill marketplace"},tabs:{local:"Local files",localShort:"Local files",skillspace:"AgentKit Skills Center",skillspaceShort:"AgentKit",skillhub:"Volcengine Find Skill marketplace",skillhubShort:"Find Skill"}},fge={model:"Model",turnControls:"Turn controls",pause:"Pause",resume:"Resume",interrupt:"Interrupt",cancel:"Cancel",pauseTurn:"Pause the whole flow at a safe point",resumeTurn:"Resume the whole flow",interruptTurn:"Interrupt this flow and retain Session context",cancelTurn:"Cancel this flow permanently",turnState:{running:"Running",pausing:"Reaching safe point",paused:"Paused",resuming:"Resuming",interrupting:"Interrupting",cancelling:"Cancelling",interrupted:"Interrupted",completed:"Completed",failed:"Failed",cancelled:"Cancelled",orphaned:"Status pending",newTurnRequired:"Continue from checkpoint"},tasks:{ppt:"Presentation",image:"Image generation",video:"Video generation"},prompts:{ppt:{quarterlyReview:"Review 【quarter】 business performance, highlighting metric gaps, causes, and recommended actions",projectUpdate:"Present the progress of 【project name】: milestones, risks, budget, and resource requests",solutionProposal:"Create a solution proposal for 【customer industry】: pain points, architecture, implementation plan, and benefits",industryAnalysis:"Analyze trends in 【industry topic】 and recommend strategic opportunities based on the competitive landscape"},image:{launchVisual:"Design a 【high-tech】 launch-event key visual for 【brand or product】",ecommercePoster:"Create an e-commerce poster for 【product name】 that highlights 【core selling point】 and brand colors",conceptRendering:"Create a photorealistic concept rendering of 【product or space】 in 【usage scenario】",socialGraphic:"Create a concise, professional corporate social graphic for 【campaign theme】"},video:{brandFilm:"Create a 30-second promotional video for 【brand name】 that highlights 【brand value】",productLaunch:"Create a 45-second launch video for 【product name】 covering the pain point, features, scenarios, and call to action",trainingVideo:"Create a corporate training video about 【training topic】 that clearly explains 【key procedure or policy】",eventTeaser:"Create a 20-second teaser for 【event name】 with highlights, time and location, and registration details"}},firstFrame:"First frame",videoToEdit:"Video to edit",baseVideo:"Base video",optimizeSkillPlaceholder:"Describe the skill you want to improve…",createSkillPlaceholder:"Describe the skill you want to create…",createVideoPlaceholder:"Describe the video you want to create…",messageAgentPlaceholder:"Message {{name}}…",selectAgentFirst:"Select an agent first",selectSkillFirst:"Select the Skill you want to improve first",availableSkills:"Available skills",availableSubagents:"Available sub-agents",invokeSkill:"Use a skill",useSubagent:"Use a sub-agent",loadingCapabilities:"Loading Agent capabilities…",noMatchingSkills:"No matching skills for this Agent",noMatchingSubagents:"No matching sub-agents for this Agent",skillFallbackDescription:"Load and run this skill",agentFallbackDescription:"Hand this turn to the Agent",skill:"Skill",uploadImage:"Upload image",uploadDocument:"Upload document or PDF",uploadVideo:"Upload video",taskMode:"Task mode",selectTaskMode:"Select a task mode",loadingGenerationModel:"Loading generation model",modelUnavailable:"Model unavailable",cancelTask:"Cancel {{task}} task",stopGenerating:"Stop generating",viewVideoProgress:"View video generation progress",send:"Send",selectTaskType:"Select a task type",enterprisePrompts:"{{task}} enterprise prompts",sessionId:"Session ID",sessionIdLabel:"Session ID: ",initializing:"Initializing",copied:"Copied",copySessionId:"Copy session ID",sessionIdCopied:"Session ID copied",disclaimer:"Responses may be inaccurate",viewLogs:"View logs"},hge={selectAgent:"Select Agent",noLocalAgents:"No local Agents.",searchRuntime:"Search Runtime names",mineOnly:"Created by me",noRuntimes:"No Runtimes.",unsupported:"Unsupported",createdByMe:"Created by me",connecting:"Connecting…",connected:"Connected",connect:"Connect",viewInfoFor:"View information for {{name}}",viewInfo:"View information",agentAndRuntimeInfo:"Agent and Runtime information",detailType:"Detail type",agentInfo:"Agent information",runtimeInfo:"Runtime information",loadingAgentInfo:"Loading Agent information…",cannotLoadAgentInfo:"Agent information is temporarily unavailable",unnamedAgent:"Unnamed Agent",subagents:"Sub-agents",tools:"Tools",skills:"Skills",previewUnsupported:"Preview unavailable",mountedComponents:"Mounted components",noMoreAgentInfo:"No additional Agent configuration information.",local:"Local",model:"Model",status:"Status",memoryMb:"Memory {{value}} MB",instances:"Instances {{min}}–{{max}}",resources:"Resources",version:"Version",loadingDetails:"Loading details…",environmentVariables:"Environment variables",errors:{notFound:"This Runtime no longer exists or the list is out of date. Refresh the list and try again.",accessDenied:"This account cannot access the Runtime. Check its Project and access permissions.",previewUnsupported:"This Agent Server version does not support information previews.",unavailable:"This Runtime is temporarily unavailable. Confirm that its status is Ready and try again.",timeout:"Loading timed out. Try again."},componentKinds:{knowledgebase:"Knowledge base",memory:"Memory",prompt_manager:"Prompt manager",example_store:"Example store",run_processor:"Run processor",tracer:"Trace",toolset:"Toolset",plugin:"Plugin",other:"Other"},runtimeStatus:{ready:"Ready",unreleased:"Unreleased",running:"Running",active:"Running",creating:"Creating",pending:"Pending",deploying:"Deploying",updating:"Updating",failed:"Failed",error:"Error",stopping:"Stopping",stopped:"Stopped",deleting:"Deleting",deleted:"Deleted"}},pge={agent:"Agents",agentTypes:{general:"General Agents",mpa:"MPA Agents",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"Created by",namedAgent:"{{name}} Agent",storageLocation:"Storage location",currentBrowser:"Current browser",region:"Region",viewDeploymentProgress:"View deployment progress for {{name}}",viewRuntimeDetails:"View Runtime details for {{name}}",viewDetails:"View details for {{name}}",time:"Time",remainingTime:"Time remaining",expiringSoon:"Expiring soon",sandboxRemaining:"{{hours}} hr {{minutes}} min",wakeable:"Asleep",neverExpires:"Never expires",editDraftNamed:"Edit draft {{name}}",viewProgress:"View progress",deleteDraftNamed:"Delete draft {{name}}",recheckCompatibility:"Check chat compatibility for {{name}} again",connectedNamed:"{{name}} is connected",wakeAndChat:"Wake {{name}} and start chatting",chatWith:"Chat with {{name}}",waking:"Waking…",deploying:"Deploying",draft:"Draft",checking:"Checking",chatUnsupported:"Chat unsupported",checkFailed:"Check failed",creatorFilter:"Creator filter",agentType:"Agent type",searchAgents:"Search Agents",handoff:"Handoff",agentList:"{{type}} list",noMatchingAgents:"No matching Agents",adjustSearch:"Try adjusting the search or filters",noAgentType:"No {{type}}",noGeneralAgents:"No General Agents",createGeneralAgentDescription:"Create a General Agent to start building and chatting",createAgentType:"Create {{type}}",createAgent:"Create Agent",loadingMore:"Loading more Agents",scrollForMore:"Scroll down to load more",allLoaded:"All Agents loaded",deleteDraftTitle:"Delete draft?",deleteDraftDescription:"“{{name}}” cannot be recovered after deletion.",deleteDraft:"Delete draft",loadGeneralAgents:"Load General Agents",loadAgentType:"Load {{type}}",compatibility:{checking:"Requesting Runtime /list-apps to confirm that this Agent supports Studio chat.",empty:"Runtime /list-apps returned no available Agents, so chat is currently unavailable.",supported:"This Runtime supports Studio chat.",unknownError:"The Runtime /list-apps request failed without a recognizable error."},sandboxStatus:{ready:"Ready",wakeable:"Asleep",creating:"Creating",starting:"Starting",initializing:"Starting",pending:"Pending",running:"Running",failed:"Error",error:"Error",stopped:"Stopped",expired:"Expired",deleting:"Deleting",deleted:"Deleted",unknown:"Unknown status"},wakingHint:"Waking the agent. This may take some time.",mpaCreate:{maxInstance:"Maximum instances",maxInstanceHelp:"Defaults to {{maximum}}; this limits the number of Runtime instances during autoscaling.",maxInstanceInvalid:"Maximum instances must be an integer of at least 1.",name:"Name",namePlaceholder:"e.g. test-agent",nameHelp:"Used as the Runtime name. Use 4–64 letters, numbers, underscores or hyphens.",stepsLabel:"Creation steps",steps:{basics:"Basics",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"Database"},next:"Next",previousStep:"Previous",pgDescription:"Choose an existing PostgreSQL instance. Creation prepares an isolated database for this agent on that instance.",pgSplitDescription:"Use the configured business PG Workspace. Agents share this Workspace, each with its own database. Shared resource records are stored separately in mpa_admin_workspace / mpa_admin_db, configured by the administrator.",pgConsoleByteplus:"Create or inspect an AIDAP PG Workspace in BytePlus",pgConsole:"Create or inspect an AIDAP PG Workspace in Volcengine",pgHost:"PG host",pgPort:"PG port",pgInvalid:"Enter a valid PG host and port.",pgCredentials:"The deployment service provides the PG login and password; host and port must match its configuration.",openvikingDescription:"Optional. Enter all three fields to enable OpenViking, or leave all blank to omit OpenViking settings from the new agent.",openvikingConsoleByteplus:"Inspect OpenViking resources in BytePlus",openvikingConsole:"Inspect OpenViking resources in Volcengine",openvikingUrl:"OpenViking service URL",openvikingResourceId:"OpenViking resource ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"Enter a valid HTTPS service URL, resource ID and API Key together, or leave all blank.",openvikingCredentials:"The API Key is used only for this creation and is not saved in browser drafts; re-enter it after a refresh.",tosTitle:"Session output storage",tosDescription:"Optional. Select a bucket to persist each Session's output directory. Access uses the sandbox IAM Role. Without a bucket, files are stored in the sandbox's local directory.",tosBucket:"TOS bucket",tosInvalid:"Select an available bucket starting with agentkit-platform-.",tosCredentials:"Creation adds session-output access for the selected bucket to the shared role. Other runtimes and sandboxes using that role receive the same access.",tosDisable:"Clear bucket selection",tosBucketUnavailable:"The bucket is unavailable in this deployment account or region. Select a bucket from the list and retry.",runtimeImage:"MPA image",workerImage:"Worker image",imageDefault:"Leave blank to use the configured image",imageInvalid:"Enter a valid container image reference without URLs, spaces or credentials.",title:"Create MPA agent",agentId:"Agent ID",description:"Description",region:"Deployment region",plan:"Creation plan",sharedResources:"Prepare or reuse the account VPC, subnets and APIG message gateway",agentResources:"Prepare an isolated database, Skill Space and worker, then deploy the agent",readiness:"Verify gateway and agent readiness before adding the agent to the list",checking:"Checking creation configuration…",configured:"Creation configuration is ready. Submission checks cloud resources and starts provisioning.",notConfigured:"Creation prerequisites are not configured. Ask an administrator to configure them, then retry.",loadFailed:"Could not check creation configuration. Please retry.",reload:"Check again",submit:"Start creation",retry:"Retry creation",newAgent:"Create another agent",newAgentDescription:"Create another agent opens an editable new request and replaces this recovery draft. It does not cancel the old task. If the old task is still running, wait for it to finish before submitting.",close:"Close",cancel:"Cancel creation",confirmCancel:"Confirm cancellation",cancelDescription:"Cancellation stops subsequent steps. Created databases, Skill Spaces, gateways and other registered resources are retained. Retry using the same agent ID.",background:"Creation continues after closing this window. Open it again to view progress.",pollFailed:"Progress is temporarily unavailable. Reconnecting; avoid creating another agent.",iamPermissionDenied:"The deployment service lacks IAM permissions to prepare the runtime role. Ask an administrator to grant access, then retry.",iamTrustConflict:"The runtime role trust is incompatible. Ask an administrator to check VeFaaS and APIG access, then retry.",iamPolicyConflict:"An existing runtime policy with the required name has conflicting contents. Ask an administrator to check it, then retry.",iamOwnershipConflict:"The runtime role does not belong to the deployment account. Ask an administrator to check it, then retry.",iamTemporaryFailure:"IAM requests temporarily failed or timed out after retries. Check the Studio network connection and IAM service, then retry with the same agent ID.",iamVerificationFailed:"Runtime role permissions could not be confirmed. Check IAM availability and policies, then retry.",iamConfigurationConflict:"Automatic runtime role preparation requires the default MPA role. Check the server creation configuration.",creationFailed:"This step failed. Check its resources, server configuration and permissions, then retry the same agent ID.",configurationChanged:"This agent's creation configuration no longer matches the original submission. Restore the original settings before retrying, or create another agent request.",cancelFailed:"Cancellation failed. Check the current progress and retry.",cancelled:"Creation cancelled. Registered resources are retained for retry.",timeout:"Creation timed out. Registered resources are retained. Inspect them before retrying.",interrupted:"Creation was interrupted. Retry the same agent ID to recover registered resources.",skillSpace:"Skill Space",states:{running:"Creating",cancelling:"Cancelling",succeeded:"Created",failed:"Creation failed",cancelled:"Cancelled"},stages:{queued:"Queued",iam_role:"Prepare runtime role",checking:"Checking account and configuration",network:"Preparing VPC and subnets",gateway:"Preparing APIG and IM Gateway",database:"Preparing business database",skills:"Preparing Skill Space",worker:"Preparing worker",deploying:"Preparing database, skills and Runtime",verifying:"Waiting for agent readiness",admin_workspace:"Prepare management PG Workspace",business_workspace:"Prepare business PG Workspace",admin_database:"Initialize shared management database",openviking:"Preparing OpenViking library",openviking_key:"Preparing OpenViking credentials"},back:"Keep creating",pgAutoDescription:"VeADK uses its deployment account to create or reuse two PG Workspaces. mpa_admin_workspace / mpa_admin_db stores shared resource records; the business Workspace hosts an independent database for each agent. No PG connection input is needed. Preparation starts after submission.",pgPerAgentDescription:"Creation reuses the shared management Workspace and prepares a dedicated business PG Workspace and database for this agent. Existing tasks retain their database on retry.",pgAidbDescription:"Creation reuses the shared management Workspace and prepares a dedicated business Workspace with an aidb database. The business Workspace is named mpa_agent_. Existing retries retain their original database.",runtimeNameTaken:"This name is used by a Runtime, sandbox template, business Workspace, or active creation. Choose another name.",runtimeNameCheckFailed:"Unable to check this name. Check resource query permissions and connectivity, then retry.",pgModeChanged:"This submitted task uses previous PG settings and cannot be retried in automatic mode. Ask an administrator to reconcile its resources and task before starting a new creation.",pgMigrationRequired:"An existing shared registry is configured. Migrate its resource records to mpa_admin_workspace / mpa_admin_db and coordinate the registry URL cutover for existing Runtimes, then recheck this configuration.",openvikingAutoDescription:"An independent OpenViking library will be created for this agent using default models. Its connection settings will be prepared automatically.",openvikingAutoByteplusDescription:"Creates a personal OpenViking library for this agent in BytePlus Johor, and prepares the connection settings automatically. Retrying reuses its registered library.",openvikingAutoByteplusRequirements:"Uses the MPA ModelArk API Key and the VLM/Embedding inference endpoints configured by the administrator. Personal libraries use one default user; the Runtime image must support this mode and overseas data-plane access before memory can be used. Libraries are retained after cancellation or agent deletion.",openvikingModelEndpointsInvalid:"Ask the administrator to configure valid OV_VLM_ENDPOINT_ID and OV_EMBEDDING_ENDPOINT_ID values on the Studio server, then retry.",openvikingAutoBilling:"Enterprise libraries are billed by usage starting when creation succeeds. Retrying this agent reuses its registered library.",openvikingPermissionDenied:"OpenViking permission denied. Check the deployment account’s library creation, query and API Key access permissions, then retry.",openvikingConfigurationConflict:"OpenViking ownership or configuration differs from this agent. Check its registered library before retrying.",openvikingCreateUnknown:"The OpenViking creation result is unknown. An administrator must verify the cloud library and reconcile its resource ID before retrying; another library will not be created automatically.",openvikingNotReady:"OpenViking is still initializing. Wait, then retry this agent to continue with the same library.",openvikingResourceFailed:"OpenViking initialization failed. Check the library status and model configuration in the console before retrying.",openvikingResourceMissing:"The registered OpenViking library or default user was not found. Check its binding and availability before retrying.",openvikingModelConfigurationRejected:"The platform rejected the default model configuration or library parameters. Check OpenViking model availability and account eligibility before retrying.",openvikingUnavailable:"OpenViking could not be reached. Check the service and network, then retry.",openvikingInvalidResponse:"OpenViking returned incomplete or invalid configuration. Check the library and default user before retrying.",openvikingQuotaExceeded:"OpenViking quota or request rate was exceeded. Adjust the quota or retry this agent later."}},mge={library:"Skill library",skill:"Skill",skills:"Skills",skillSpace:"Skill space",sandboxNotConfigured:"Dev Sandbox is not configured by an administrator",adminNotConfigured:"Not configured by an administrator",totalItems:"{{count}} items",cannotLoadSpaces:"Unable to load Skill spaces",someSpacesFailed:"Some Skill spaces failed to load",degradedRelationWarning:"Some relations are invalid. Readable skills have been restored.",downloadZip:"Download ZIP",optimize:"Optimize",closeSkillDetails:"Close Skill details",skillId:"Skill ID",allFiles:"All files",loadingSkillContent:"Loading Skill content…",noSkillContent:"This Skill has no SKILL.md content",addSkill:"Add Skill",localUpload:"Upload locally",localUploadDescription:"Select a ZIP file and upload it to the Skill space after validation",autoCreate:"Create automatically",autoCreateDescription:"Choose a model and style, then create a Skill through conversation",createSkill:"Create Skill",optimizeNamed:"Optimize {{name}}",deleteSkillConfirm:"Delete the entire Skill “{{name}}”? This affects every space that references it.",deleteSpaceConfirm:"Delete Skill space “{{name}}”? Make sure its Skills have been deleted first.",manageSpaceDescription:"Manage Skills in this space and create new versions",backToSpaces:"Back to Skill spaces",overview:"Overview",skillCount:"Skills",skillCountValue_one:"{{count}} Skill",skillCountValue_other:"{{count}} Skills",updatedAt:"Updated",skillsInSpace:"Skills in {{name}}",searchSkills:"Search Skills",cannotLoadSkills:"Unable to load Skills",noMatchingSkills:"No matching Skills",noSkills:"No Skills",tryAnotherName:"Try searching for another name",emptySkillsDescription:"Upload a Skill locally or create one automatically",actions:"Actions",spaceDetails:"Skill space details",editSpace:"Edit space",deleteSpace:"Delete space",searchSpaces:"Search Skill spaces",spaceList:"Skill space list",noMatchingSpaces:"No matching Skill spaces",createSpace:"Create Skill space",newSpace:"New space",loadingMoreSpaces:"Loading more Skill spaces",scrollForMore:"Scroll down to load more",allSpacesLoaded:"All Skill spaces loaded",errors:{loadSpaces:"Unable to load Skill spaces. Try again later.",loadSkills:"Unable to load Skills. Try again later.",loadSkillDetails:"Unable to load Skill details. Try again later.",deleteSkill:"Unable to delete the Skill",deleteSpace:"Unable to delete the Skill space",downloadSkill:"Unable to download the Skill"},status:{active:"Available",available:"Available",creating:"Creating",disabled:"Disabled",enabled:"Enabled",failed:"Error",inactive:"Inactive",pending:"Pending",published:"Published",ready:"Ready",released:"Published",running:"Running",success:"Healthy",unavailable:"Unavailable",unreleased:"Unreleased",updating:"Updating",unknown:"Unknown"},sharedSpace:"Enterprise shared space",sharedDescription:"Skills available to everyone, published and maintained by administrators",sharedVisibility:"Everyone",sharedPreparing:"Preparing shared space",sharedLoadFailed:"Shared space unavailable",sharedEmpty:"No shared skills yet. Skills published by administrators will appear here",requestPublication:"Request publication",reviewSubmitting:"Submitting…",reviewSubmitted:"Submitted",reviewFailed:"Could not submit the publication request",reviewStatusFailed:"Failed to load review status",reviewRetry:"Apply again",reviewPending:"Pending review",reviewApproving:"Publishing",reviewApproved:"Shared",reviewReturned:"Returned",reviewHistory:"Review history",skillDetailSections:"Skill detail sections",versions:{title:"Version management",refresh:"Refresh",uploading:"Uploading…",upload:"Upload new version",close:"Close",hint:"New versions become public after approval and do not replace published versions; the skill name in the ZIP must match the original",loading:"Loading versions…",loadFailed:"Unable to load versions",filesFailed:"Unable to load version files",uploadFailed:"Unable to upload the new version",submitFailed:"Unable to submit for review",retry:"Retry",empty:"No versions yet",current:"Current version",notSubmitted:"Not submitted",submitting:"Submitting…",submit:"Request publication",processing:"Version status: {{status}}",filesLoading:"Loading files…",filesEmpty:"No files",history:"Review history",shared:"Published"},author:"Author",authorName:"Author: {{name}}"},gge={library:"Knowledge bases",createBase:"New knowledge base",editBase:"Edit knowledge base",invalidName:"The name must start with a letter and contain only letters, numbers, and underscores.",nameHelp:"Start with a letter. Use up to 48 letters, numbers, or underscores.",optionalDescription:"Description (optional)",descriptionOnly:"AgentKit currently supports updating only the knowledge base description.",previewWeb:"Preview web content",addData:"Add data",openOriginalWeb:"Open original page",backToEdit:"Back to edit",confirmAdd:"Confirm and add",source:"Knowledge source",image:"Image",documentFile:"Document file",webPage:"Web page",webUrl:"Web page URL",generatingWebPreview:"Fetching the page and generating a Markdown preview",selectFile:"Select knowledge file",selectOrDropFile:"Select a file or drag it here",selectedFile:"{{size}} · Click to select another file",imageFileHelp:"PNG, JPG, and JPEG up to 200 MB",documentFileHelp:"PDF, PPTX, DOCX, XLSX, and TXT up to 200 MB",uploadingFile:"Uploading the file and adding it to the knowledge base",optionalName:"Name (optional)",optionalType:"Type (optional)",generatePreview:"Generate preview",uploadFile:"Upload file",editMetadata:"Edit knowledge metadata",knowledge:"Knowledge item",field:"Field",value:"Value",backToList:"Back to knowledge bases",metadataJson:"Metadata (JSON)",provider:"Provider",knowledgeId:"Knowledge ID",project:"Project",creator:"Created by",data:"Data",deleteInvalidAssociation:"Delete invalid association",noData:"This knowledge base has no data",addFirstData:"Add the first data item",format:"Format",size:"Size",searchData:"Search data",searchLibraryData:"Search knowledge base data",associationInvalid:"Association invalid",providerMissing:"The underlying Provider knowledge base no longer exists",noMatchingData:"No matching data",loadingMoreData:"Loading more data",retryLoading:"Retry loading",details:"Knowledge base details",searchBases:"Search knowledge bases",someBasesFailed:"Some knowledge bases are temporarily unavailable. Other available content is shown.",noMatchingBases:"No matching knowledge bases",noManagePermission:"You do not have permission to manage this knowledge base",loadingMoreBases:"Loading more knowledge bases",deleteBaseTitle:"Delete knowledge base?",deleteBaseDescription:"This removes the AgentKit association for {{name}}. If Studio created it, the Provider resource is also deleted. This cannot be undone.",deleteDocumentTitle:"Delete knowledge item?",deleteDocumentDescription:"This removes {{name}} from the Provider knowledge base. This cannot be undone.",preview:{processingTitle:"Data is being processed",processingDetail:"A preview will be available after parsing. Reload later.",failedTitle:"Data parsing failed",failedDetail:"Check the source file or page URL and add it again, or reload the latest status.",noParsedTitle:"No parsed content is available yet",noParsedDetail:"Text, tables, or page images will appear after the knowledge base finishes parsing this file.",noMediaTitle:"No media preview is available yet",noMediaDetail:"The knowledge base has not returned an accessible media preview. Reload later.",noDataTitle:"No data is available to preview",noDataDetail:"The knowledge base has not returned parsed results. Reload later.",attachmentError:"The attachment cannot be previewed. Try again later.",imageAlt:"Knowledge data image",audioUnsupported:"This browser does not support audio previews.",videoUnsupported:"This browser does not support video previews.",namedPdf:"{{name}} PDF preview",pdf:"PDF preview",openPdf:"If it cannot be displayed, open the PDF in a new window",fileUnsupported:"This format cannot be previewed directly online. Parsed content is shown when available.",openOriginalFile:"Open original file",loading:"Loading data preview",openOriginalHint:"You can open the original page to view the source content.",chunk:"Chunk {{index}}",loadingMore:"Loading more",loadMore:"Load more"},errors:{fileTooLarge:"A file cannot exceed 200 MB",invalidImageType:"Select a PNG, JPG, or JPEG image",invalidDocumentType:"Select a PDF, PPTX, DOCX, XLSX, or TXT file",createBase:"Unable to create the knowledge base",updateBase:"Unable to update the knowledge base",metadataObject:"Metadata must be a JSON object",metadataFormat:"Invalid metadata format",noWebPreview:"The page has no Markdown content to preview",addWeb:"Unable to add the web page",previewWeb:"Unable to generate the web page preview",uploadFile:"Unable to upload the file",updateDocument:"Unable to update the knowledge item",loadPreview:"Unable to load the data preview",loadMoreBases:"Unable to load more knowledge bases",loadBases:"Unable to load knowledge bases",loadMoreData:"Unable to load more data",loadData:"Unable to load data",deleteBase:"Unable to delete the knowledge base",deleteDocument:"Unable to delete the knowledge item"}},bge={bindingType:"Bot type",bindingType_shared:"Shared",bindingType_private:"Private",bindingTypeHelp_shared:"Sessions are isolated from each other.",bindingTypeHelp_private:"Private chats can recall this Bot’s history, including group chats.",title:"Feishu channel",refresh:"Refresh",loading:"Loading channel configuration…",unsupported:"This Runtime does not support channel management. Upgrade its MPA image.",unauthorized:"Channel management requires a Studio administrator and an authorized Runtime credential.",configurationError:"Channel management configuration is incomplete. Check the Runtime metadata and encryption key.",requestFailed:"Channel request failed. Check the Runtime connection and retry.",bound:"Bound: {{name}}",unbound:"No Feishu bot is bound.",guidance:"Private chats use separate conversations. In allowed groups, mention this bot to start a conversation.",keyRequired:"Configure a persistent CHANNEL_STATE_ENCRYPTION_KEY in the Runtime before binding.",gateway:"Message gateway",route:"Inbound route",delivery:"Reply delivery",configured:"Configured",missing:"Missing",delivery_not_observed:"Not observed",delivery_delivered:"Delivered",delivery_retrying:"Retrying",missingConfig:"Missing Runtime configuration: {{fields}}",bind:"Bind with QR code",newQr:"Generate a new QR code",unbind:"Unbind",confirmUnbind:"Disconnect this bot? It will stop receiving new messages.",qrAlt:"Bot authorization QR code",openQr:"Open authorization page",uncertain:"Registration was interrupted. Check the bot binding and Gateway before starting again.",bindingFailed:"Binding failed. Check Gateway configuration and retry.",chatId:"Allowed group ID",scope:"Group conversation scope",saveGroup:"Save group",noGroups:"No groups allowed yet. Private chats do not need this permission.",edit:"Edit",remove:"Remove",removeGroup:"Remove {{name}}",scope_group_sender:"Separate by sender",scope_group:"Shared by group",scope_group_topic_sender:"Separate by topic and sender",scope_group_topic:"Shared by topic",status_PENDING:"Waiting for scan",status_SCANNED:"Scanned; waiting for authorization",status_AUTHORIZED:"Authorized; preparing registration",status_REGISTERING:"Registering bot",status_BOUND:"Bot bound",status_FAILED:"Binding failed",status_EXPIRED:"QR code expired",workspaceTitle:"Message channels",workspaceDescription:"Connect messaging apps to this Agent and manage access.",provider_feishu:"Feishu",provider_wecom:"WeCom",provider_dingtalk:"DingTalk",comingSoon:"Not available yet",unavailableDescription:"Binding and message settings for {{name}} are not available yet.",runtimeRequired:"Deploy this Agent to a Runtime before configuring message channels.",bindingTitle:"Bot connection",connected:"Bound",notBound:"Not bound",gatewayDescription:"Gateway configuration for receiving channel messages.",routeDescription:"Routing configuration for delivering messages to this Agent.",deliveryDescription:"Observed reply delivery; configuration alone does not confirm delivery.",groupsTitle:"Group access",groupsDescription:"Allow specific groups to access this agent.",providerBindingTitle:"Connect {{name}}",providerUnbound:"Connect a {{name}} bot to let users message this agent.",qrGuidance:"Authorize with {{name}}. The Runtime saves the bot credentials and configures the message gateway.",wecomGuidance:"Authorize with WeCom QR code, or enter a Bot ID and Secret to bind an existing bot.",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"Connect bot",wecomScan:"Bind with QR code",wecomAuthorizing:"Waiting for WeCom authorization…",cancelAuthorization:"Cancel authorization",wecomPopupBlocked:"Allow popups in your browser, then try authorizing again.",wecomAuthCancelled:"WeCom authorization was cancelled. You can scan again.",wecomAuthTimeout:"WeCom authorization timed out. Please scan again.",wecomInvalidResult:"Authorization did not return a Bot ID and Secret. Authorize again or enter them manually.",wecomAuthFailed:"WeCom authorization failed. Try again or enter credentials manually.",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"Upgrade this Runtime image to configure {{name}} manually. Quick setup is still available.",pairingTitle:"Message channel QR pairing",feishuPairingDescription:"If a bot is already connected, it will be replaced after successful Feishu authorization and binding. In the authorization flow, you can bind an existing bot or create a new one.",generatingQr:"Generating pairing QR code…",dingtalkGuidance:"Authorize with DingTalk QR code, or enter a Client ID and Client Secret to bind an existing bot.",wecomPairingDescription:"Pair again in the WeCom authorization window. The new bot replaces the current connection after binding succeeds. Cancelling authorization or a failed binding does not disconnect the existing bot.",configurationMethod:"Configuration method",quickSetup:"Quick setup",manualSetup:"Manual setup",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"Enter the credentials of an existing {{name}} bot to connect it to this agent.",manualReplacement:"Successful binding replaces the current bot. Cancelling or a failed binding does not disconnect the existing bot.",accountsTitle:"Feishu bots",account:"Bot",selectAccount:"Select a bot",accountEnabled:"Enabled",accountDisabled:"Disabled",addAccount:"Add bot",cancelAddAccount:"Cancel adding",enableAccount:"Enable bot",disableAccount:"Disable bot",noAccounts:"No Feishu bots are bound.",accountsFailed:"Could not load bots. Try again.",accountConflict:"The bot account is ambiguous or conflicts with its configuration. Refresh and select a bot.",multiBotPairingDescription:"Binding a new Feishu app adds a bot. Binding the same App ID updates that bot.",provider_lark:"Lark",larkPairingDescription:"Scan with Lark to authorize a bot. Existing bots remain bound until this setup succeeds.",larkAccountsTitle:"Lark bots",noLarkAccounts:"No Lark bots are bound."},yVe={common:Gme,agentKitPromo:Xme,systemInfo:Yme,agentWorkspace:Zme,environmentCenter:Jme,deploymentSelect:ege,deploymentError:tge,studioBuildProgress:nge,cloudEnvironment:ige,githubCicd:rge,feishuDeployment:sge,deploymentResources:age,studioUpdate:oge,projectPreview:lge,workspace:cge,resourceCollection:uge,skillSourcePicker:dge,composer:fge,agentSelector:hge,myAgents:pge,skillCenter:mge,knowledge:gge,channels:bge},vVe=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:Xme,agentSelector:hge,agentWorkspace:Zme,channels:bge,cloudEnvironment:ige,common:Gme,composer:fge,default:yVe,deploymentError:tge,deploymentResources:age,deploymentSelect:ege,environmentCenter:Jme,feishuDeployment:sge,githubCicd:rge,knowledge:gge,myAgents:pge,projectPreview:lge,resourceCollection:uge,skillCenter:mge,skillSourcePicker:dge,studioBuildProgress:nge,studioUpdate:oge,systemInfo:Yme,workspace:cge},Symbol.toStringTag,{value:"Module"})),yge="User management",vge="{{count}} members",xge="User",wge="Role",kge="Account status",Oge="Last sign-in",Sge="Actions",Ege="Change role",Cge="Close",Age="Save role",Tge="Saving…",_ge="Cancel",jge="Back",Nge="User pool",Rge="Volcengine Identity",Ige="Search name, email or user ID",Pge="Search",Dge="Filter by role",Mge="All roles",Lge="Refresh",$ge="Loading users…",Fge="Updated at {{time}}",Bge="{{name}} is now {{role}}",Uge="Retry",Qge="You",zge="Initial super administrator",Vge="The initial super administrator cannot be demoted here",Hge="The new permissions apply when the user refreshes Studio",qge="Role needs confirmation",Wge="No matching users",Kge="Try another search or role",Gge="Users appear here after signing in or joining this user pool",Xge="{{count}} users",Yge="Previous",Zge="Next",Jge="Not signed in yet",ebe="Not provided",tbe={super_admin:"Super administrator",admin:"Administrator",developer:"Developer",user:"User"},nbe={super_admin:"Manage all resources, users and role assignments",admin:"Manage Studio resources",developer:"Develop agents and manage your own resources",user:"Use agents and personal features"},ibe={EXTERNAL_PROVIDER:"Active",CONFIRMED:"Active",NORMAL:"Active",ENABLED:"Active",ACTIVE:"Active",UNCONFIRMED:"Unverified",DISABLED:"Disabled",FORBIDDEN:"Disabled",LOCKED:"Locked",SUSPENDED:"Suspended",FORCE_CHANGE_PASSWORD:"Password change required"},rbe={request_failed:"The request did not finish. Refresh the list to confirm its current state before retrying",invalid_response:"The user service returned an invalid response. Refresh and try again",identity_unavailable:"Identity is unavailable. Try again later or check service permissions",identity_resource_missing:"The user or user pool no longer exists. Refresh the list",super_administrator_required:"Only super administrators can manage users",sign_in_required:"Sign in and try again",user_not_in_pool:"Your account does not belong to this user pool",user_disabled:"Your account is disabled",protected_administrator:"The initial super administrator cannot be demoted",cannot_demote_self:"You cannot demote your own super administrator role",role_change_conflict:"The role has changed. Close this dialog and refresh the list before retrying",cross_origin_request:"Change roles from the current Studio page"},xVe={title:yge,memberCount:vge,user:xge,role:wge,status:kge,lastLogin:Oge,actions:Sge,changeRole:Ege,close:Cge,save:Age,saving:Tge,cancel:_ge,back:jge,pool:Nge,volcengineIdentity:Rge,searchPlaceholder:Ige,search:Pge,filterRole:Dge,allRoles:Mge,refresh:Lge,loading:$ge,updatedAt:Fge,saved:Bge,retry:Uge,you:Qge,initialAdministrator:zge,protectedExplanation:Vge,effectiveAfterRefresh:Hge,roleConflict:qge,noUsers:Wge,tryAnotherSearch:Kge,poolEmpty:Gge,resultCount:Xge,previous:Yge,next:Zge,neverLoggedIn:Jge,unknown:ebe,roles:tbe,descriptions:nbe,states:ibe,errors:rbe},wVe=Object.freeze(Object.defineProperty({__proto__:null,actions:Sge,allRoles:Mge,back:jge,cancel:_ge,changeRole:Ege,close:Cge,default:xVe,descriptions:nbe,effectiveAfterRefresh:Hge,errors:rbe,filterRole:Dge,initialAdministrator:zge,lastLogin:Oge,loading:$ge,memberCount:vge,neverLoggedIn:Jge,next:Zge,noUsers:Wge,pool:Nge,poolEmpty:Gge,previous:Yge,protectedExplanation:Vge,refresh:Lge,resultCount:Xge,retry:Uge,role:wge,roleConflict:qge,roles:tbe,save:Age,saved:Bge,saving:Tge,search:Pge,searchPlaceholder:Ige,states:ibe,status:kge,title:yge,tryAnotherSearch:Kge,unknown:ebe,updatedAt:Fge,user:xge,volcengineIdentity:Rge,you:Qge},Symbol.toStringTag,{value:"Module"})),sbe="Website integration",abe="Embed an AgentKit Runtime on your website as a floating chat window",obe="Back to automations",lbe="Add website",cbe="Loading Runtime",ube="Select Runtime",dbe="Website domain",fbe="For example, xxxx.com or localhost:5173",hbe="Generating",pbe="Generate token",mbe="Added websites",gbe="{{count}} website",bbe="{{count}} websites",ybe="Loading website integrations",vbe="No website integrations yet",xbe="Select a Runtime and enter a website domain to generate a token",wbe="Embed instructions",kbe="Place this code before the closing body tag on your website",Obe="Copied",Sbe="Copy code",Ebe="Embed code will appear here after you add a website.",Cbe="Delete the website integration for {{domain}}?",Abe={load:"Failed to load website integrations",create:"Failed to create website integration",delete:"Failed to delete website integration",noConversationalAgent:"No conversational Agent was found in this Runtime"},Tbe={requestFailed:"Request failed ({{status}})",greeting:"Hello. How can I help?",sessionFailed:"Could not start a chat session",unauthorized:"This website is not authorized to start a chat",conversationFailed:"The chat request failed. Try again shortly.",open:"Open Agent chat",close:"Close Agent chat",panelLabel:"Agent chat panel",assistant:"Agent assistant",online:"Online"},kVe={title:sbe,description:abe,backToAutomations:obe,addWebsite:lbe,loadingRuntime:cbe,selectRuntime:ube,websiteDomain:dbe,domainPlaceholder:fbe,generating:hbe,generateToken:pbe,addedWebsites:mbe,websiteCount_one:gbe,websiteCount_other:bbe,loadingIntegrations:ybe,delete:"Delete",emptyTitle:vbe,emptyDescription:xbe,embedMethod:wbe,embedInstructions:kbe,copied:Obe,copyCode:Sbe,embedHint:Ebe,confirmDelete:Cbe,errors:Abe,widget:Tbe},OVe=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:lbe,addedWebsites:mbe,backToAutomations:obe,confirmDelete:Cbe,copied:Obe,copyCode:Sbe,default:kVe,description:abe,domainPlaceholder:fbe,embedHint:Ebe,embedInstructions:kbe,embedMethod:wbe,emptyDescription:xbe,emptyTitle:vbe,errors:Abe,generateToken:pbe,generating:hbe,loadingIntegrations:ybe,loadingRuntime:cbe,selectRuntime:ube,title:sbe,websiteCount_one:gbe,websiteCount_other:bbe,websiteDomain:dbe,widget:Tbe},Symbol.toStringTag,{value:"Module"})),_be={types:{all:"All types",document:"Documents",image:"Images",video:"Videos"},previewArtifact:"Preview {{name}}",moreActions:"More actions for {{name}}",actionMenu:"Actions for {{name}}",download:"Download",downloading:"Downloading",edit:"Edit details",delete:"Delete artifact",previewFailed:"Could not preview “{{name}}”: {{message}}",downloadStarted:"Download started for {{name}}",downloadFailed:"Could not download “{{name}}”: {{message}}",updated:"Updated {{name}}",deleted:"Deleted {{name}}",deleteFailed:"Could not delete “{{name}}”: {{message}}",typeFilter:"Artifact type",searchAria:"Search artifacts",searchPlaceholder:"Search artifacts or sessions",retry:"Retry",close:"Close",listAria:"Artifact list",loadFailed:"Could not load artifacts",loadDetailFallback:"Check the storage configuration and try again.",reload:"Reload",noMatch:"No matching artifacts",noArtifacts:"You do not have any artifacts yet",searchHint:"Try another search or artifact type",emptyHint:"Artifacts created in chats will appear here automatically",columns:{name:"Name",source:"Source",updatedAt:"Modified",actions:"Actions"},loadingMore:"Loading more artifacts",unknownTime:"Unknown time",preview:{close:"Close preview",meta:"{{type}} / Version {{version}}",loading:"Loading preview",alt:"Preview of {{name}}",loadFailed:"The preview could not be loaded. Try again later or download the file.",unsupported:"This format cannot be previewed online. Download the file to view it.",sourceAria:"Artifact source",agent:"Agent",session:"Session",tool:"Generated by",createdAt:"Created",fileSize:"File size",tags:"Tags",viewSession:"View session"},deleteDialog:{title:"Delete artifact?",description:"“{{name}}” will be permanently removed from the artifact library. The chat history will not be affected.",deleting:"Deleting",confirm:"Delete",close:"Close delete confirmation"},api:{withStatus:"{{message}} ({{status}})",listFailed:"Could not load the artifact library",syncFailed:"Could not sync chat artifacts",updateFailed:"Could not update the artifact",deleteFailed:"Could not delete the artifact",downloadFailed:"Could not download the artifact"}},jbe={unknownSource:"Unknown source",unknownCreator:"Unknown creator"},Nbe={nameRequired:"Enter an artifact name",tooManyTags:"You can add up to {{max}} tags",tagTooLong:"Each tag can contain up to {{max}} characters",title:"Edit artifact details",subtitle:"The content file will not be modified",close:"Close edit dialog",name:"Name",description:"Description",descriptionPlaceholder:"Add its purpose, version, or usage notes",tags:"Tags",tagsPlaceholder:"Separate tags with commas, up to {{max}}",cancel:"Cancel",saving:"Saving",save:"Save"},Rbe={change:{added:"Added",modified:"Modified",deleted:"Deleted"},noChanges:"There are no source changes between these versions",chooseFile:"Select a file on the left to view its code",compareTitle:"Compare versions",workspaceTitle:"Source workspace",projectFallback:"Agent project",switchTheme:"Switch source theme",switchThemeTitle:"Switch to {{theme}} theme",themes:{dark:"dark",light:"light"},closeWorkspace:"Close source workspace",close:"Close",changedFiles:"Changed files",projectFiles:"Project files",changes:"Changes",files:"Files",openFiles:"Open files",noFileSelected:"No file selected",comparisonDirection:"Comparison direction",before:"Before optimization",after:"After optimization",loadingEditor:"Loading editor…",changedFileCount_one:"{{count}} file changed",changedFileCount_other:"{{count}} files changed",fileCount_one:"{{count}} file",fileCount_other:"{{count}} files",lineCount_one:"{{count}} line · UTF-8",lineCount_other:"{{count}} lines · UTF-8",viewSource:"View source",viewSourceAria:"View and edit project source"},Ibe={nav:"Search",selectAgent:"Select an Agent",checkingCapabilities:"Checking Agent capabilities",notMounted:"This Agent does not have {{label}} mounted",sources:{session:"Sessions",web:"Web",knowledge:"Knowledge base",memory:"Long-term memory"},webDescription:"Search with the web_search tool",backendLocal:"Local",failed:"Search failed: {{message}}",placeholder:{selectAgent:"Select an Agent first",web:"Search the web",knowledge:"Search {{name}}",knowledgeFallback:"this Agent's knowledge base",memory:"Search {{name}}",memoryFallback:"this user's long-term memory",session:"Search this Agent's sessions"},sourceTypeAria:"Search source: {{label}}",notSelected:"Not selected",sourceType:"Search source",selectSource:"Select a search source",noAgentHint:"Select an Agent to search its sessions, the web, and mounted data sources.",loadingCapabilities:"Loading this Agent's search capabilities…",sourceUnavailable:"This Agent does not have this data source mounted",instructions:{web:"Enter keywords and press Enter or select the button to search with web_search.",knowledge:"Enter a question to search this Agent's knowledge base.",memory:"Enter a clue to search long-term memories saved across this user's sessions.",session:"Enter keywords and press Enter or select the button to search this Agent's sessions."},noResults:"No results found for “{{query}}”.",knowledgeFragment:"Knowledge excerpt {{index}}",memoryFragment:"Memory excerpt {{index}}"},Pbe={title:"Developer Resources",sections:{documentation:{title:"Related links",description:"Open development documentation and common AgentKit destinations"},bestPractices:{title:"Best practices",description:"Learn from practical development, debugging, and deployment guidance"},showcases:{title:"Showcases",description:"Explore applications built with AgentKit"}},links:{veadkDocs:"VeADK documentation",cliDocs:"AgentKit CLI documentation",platformDocs:"AgentKit platform documentation",console:"AgentKit console"},articles:{veadkDevelopment:{title:"Develop and deploy an Agent with VeADK",description:"Build an Agent with VeADK and deploy it to AgentKit Runtime."},cliDevelopment:{title:"Develop and deploy an Agent with AgentKit CLI",description:"Create a project, debug an Agent, and deploy it with AgentKit CLI."},coverAlt:"Cover image for {{title}}"},showcases:{researchAssistant:{title:"Multi-agent research assistant",description:"Specialized Agents work together to research, analyze, and summarize findings."},multimodalAnalysis:{title:"Multimodal content analysis",description:"Understand images, documents, and video in a single session."},customerService:{title:"Customer service workspace",description:"Combine knowledge retrieval and tool calls to handle complex support requests."},webSearch:{title:"Web search Agent",description:"Search current web content and organize it into traceable answers."},a2uiApp:{title:"A2UI interactive app",description:"Let an Agent generate interactive interfaces as it works through a task."},previewAlt:"Interface preview for {{title}}"}},Dbe={title:"Library",untitledSession:"Untitled session",categoryAria:"Library categories",regionAria:"Region",tabs:{skills:"Skills",knowledge:"Knowledge",artifacts:"Artifacts"}},Mbe={title:"Manage Agents",subtitle:"Agents in AgentKit Runtime that you can manage",mainAgentOnly:"Only the main Agent is shown (control-plane information).",deleteConfirm:'Delete Agent "{{name}}"? Its Runtime will be permanently deleted.',regionFilterTitle:"Filter by region",regionFilterAria:"Region filter",regionAria:"Region",refresh:"Refresh",loading:"Loading…",empty:"You have not deployed any Agents.",connected:"Connected",connect:"Connect to this Agent",deleteRuntime:"Delete this Runtime",loadingDetail:"Loading details…",agentStructure:"Agent structure",secretHidden:"Sensitive value is never shown. Copy it with an authorized request.",revealSecret:"Sensitive value for {{key}}",copySecret:"Copy the value of {{key}}",copy:"Copy",copied:"Copied",copyFailed:"Copy failed",notConfigured:"Not configured",fields:{model:"Model",description:"Description",status:"Status details",project:"Project",version:"Version",resources:"Resources",memory:"Memory",tool:"Tool",knowledge:"Knowledge",mcpToolset:"MCP Toolset",updatedAt:"Updated"},resource:{memory:"Memory {{value}} MB",instances:"Instances {{min}}-{{max}}",concurrency:"Concurrency {{value}}"},environmentVariables:"Environment variables",unnamed:"(Unnamed)"},Lbe={mainAgent:"Main Agent",subAgent:"Sub-agent {{index}}",itemCount_one:"{{count}} item",itemCount_other:"{{count}} items",info:"Agent information",infoAndTopology:"Agent information and settings",loadingInfo:"Loading Agent information…",unnamedAgent:"Unnamed Agent",agentsMd:"AGENTS.md",tools:"Tools",toolList:"Tool list",studioTool:"Studio Tool",removeTool:"Remove tool {{name}}",remove:"Remove",notConfigured:"Not configured",addStudioTool:"Add Studio tools",addStudioToolHere:"Add Studio tools to this chat",skills:"Skills",skillList:"Skill list",addSkill:"Add Skill Space skills",addSkillHere:"Add Skill Space skills to this Session",skillMountNextTurn:"Mounted versions are frozen when the next Turn starts.",previewUnsupported:"Preview is not supported",sessionEnvironment:"Session environment",environment:"Environment",agentCanvas:"Agent canvas",topology:"Structure",nodeKinds:{agent:"Agent",sandbox:"Sandbox","worker-session":"Worker Session","skill-space":"Skill Space",skill:"Skill","studio-tool":"Studio Tool",mcp:"MCP",environment:"Environment",knowledge:"Knowledge","sub-agent":"Sub-agent"},nodeStatuses:{configured:"Configured",mounted:"Mounted",running:"Running",paused:"Paused"},viewCanvasFullscreen:"View Agent canvas in full screen",viewFullscreen:"View full screen",executionCanvas:"Agent execution canvas",fullscreenExecutionCanvas:"Full-screen Agent execution canvas",closeFullscreenCanvas:"Close full-screen canvas",close:"Close",capabilitiesSubtitle:"Capabilities and collaboration topology",closeInfo:"Close Agent information",infoUnavailable:"Agent information is temporarily unavailable.",refresh:"Refresh information",loadingSkills:"Loading bound skills…",sessionSkills:"Temporary session skills",noBoundSpace:"This agent has no bound Skill Space.",noBoundSkills:"The bound Skill Space has no skills.",loadFailed:"Could not load this information. Refresh to retry.",accessDenied:"You do not have permission to read this information.",documentUnsupported:"Upgrade the Runtime image to enable Studio to read AGENTS.md.",skillsUnsupported:"This Runtime does not provide Skill Space bindings.",skillsDegraded:"Skill information is incomplete. Refresh to retry.",documentEditHint:"Edit the latest version. Saving publishes a new version to this Skill Space and can affect other agents using it. Running sessions may need a cache refresh or a new session. Keep the frontmatter name unchanged.",documentLoading:"Loading SKILL.md…",documentWritable:"Editable",documentReadOnly:"Read only — this space or your permissions do not allow editing",documentLoadFailed:"Could not load SKILL.md. Refresh to retry.",documentSaveFailed:"Save was not confirmed. Your edits are preserved. Reopen to check the current version before retrying.",documentConflict:"A newer version exists. Copy your edits, then reopen the editor to avoid overwriting it.",discardDocument:"Discard unsaved changes?",keepEditing:"Keep editing",discardChanges:"Discard changes",saveDocument:"Save new version"},$be={mountFailed:"Could not mount the environment",closeDialog:"Close environment dialog",addTitle:"Add environments",description:"Choose the Sandbox environments this Agent can use in the current session",closeAdd:"Close Add environments",searchAria:"Search environments",searchPlaceholder:"Search environment names or capabilities",availableAria:"Available environments and workspaces",loading:"Loading available environments…",noMatch:"No matching environments or workspaces",workspaces:"Workspaces",reuseAll:"Use every available environment in this workspace",availableEnvironmentCount_one:"{{count}} available environment",availableEnvironmentCount_other:"{{count}} available environments",selectWorkspace:"Select workspace {{name}}",environments:"Environments",includedByWorkspaces:"Included by workspace {{names}}",nameSeparator:", ",selectEnvironment:"Select environment {{name}}",selectedWorkspaceCount_one:"{{count}} workspace selected",selectedWorkspaceCount_other:"{{count}} workspaces selected",coveredEnvironmentCount_one:"{{count}} environment covered",coveredEnvironmentCount_other:"{{count}} environments covered",selectionSummary:"{{workspaces}}, {{environments}}",cancel:"Cancel",mounting:"Mounting…",confirm:"Add selected",mountedAria:"Mounted environments",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",removeWorkspace:"Remove workspace {{name}}",remove:"Remove",removeEnvironment:"Remove environment {{name}}",add:"Add environments",addMore:"Add more environments",addForSession:"Add environments to this session",loadingAvailable:"Loading available environments…",empty:"No AIO Sandbox environments are available."},Fbe={loading:{searching:"Looking for an existing environment",creating:"Initializing environment",connecting:"Connecting to the environment"},initializationFailed:"AgentKit CLI environment initialization failed. Current status: {{status}}.",sessionExpired:"The AgentKit CLI session does not exist or has expired. Try again.",initializationTimeout:"AgentKit CLI environment initialization timed out. Try again later.",nonPersistent:"Non-persistent environment",recyclingHoursMinutes:"Environment reclaimed in {{hours}} hr {{minutes}} min",recyclingMinutes:"Environment reclaimed in {{minutes}} min",connectionError:`Could not connect to the Studio service because the server did not respond. +Original error: {{message}}`,unavailable:"Connection unavailable",requestFailed:"AgentKit CLI request failed",retry:"Retry",terminalTitle:"AgentKit CLI terminal"},Bbe={labels:{coding:"Coding",get_city_weather:"City weather",get_location_weather:"Location weather",web_fetch:"Fetch web content",studio_write_artifact:"Save session artifact"},closeDialog:"Close dialog",title:"Add Studio tools",description:"Studio BFF runs these tools for {{agentName}} in the current session. No Runtime installation is required.",close:"Close Add Studio tools",searchAria:"Search Studio tools",searchPlaceholder:"Search by name or tool ID",availableAria:"Available Studio tools",loading:"Loading Studio tools…",noMatch:"No matching Studio tools",remove:"Remove",add:"Add"},Ube={artifactLibrary:_be,resourceMetadata:jbe,artifactEdit:Nbe,codeBrowser:Rbe,search:Ibe,developerResources:Pbe,library:Dbe,manageAgents:Mbe,agentTopology:Lbe,sessionEnvironment:$be,agentKitCli:Fbe,studioTools:Bbe},SVe=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:Fbe,agentTopology:Lbe,artifactEdit:Nbe,artifactLibrary:_be,codeBrowser:Rbe,default:Ube,developerResources:Pbe,library:Dbe,manageAgents:Mbe,resourceMetadata:jbe,search:Ibe,sessionEnvironment:$be,studioTools:Bbe},Symbol.toStringTag,{value:"Module"})),Qbe={requestFailed:"请求失败 ({{status}})",unknownError:"未知错误",contentTypeMissing:"Content-Type 缺失",response:"响应:{{response}}",fallbackWithDetail:"{{fallback}}:{{detail}}",fallbackWithHttpStatus:"{{fallback}}(HTTP {{status}})",nonJsonResponse:"{{fallback}}:服务端返回非 JSON 响应({{contentType}})"},zbe={unconfigured:"管理员未配置 AgentKit Dev Sandbox,请配置后再使用",invalidSession:"AgentKit CLI 返回了无效的 Session。",loadCapabilitiesFailed:"无法读取 AgentKit CLI 配置。",invalidCapabilities:"AgentKit CLI 返回了无效的配置状态。",listSessionsFailed:"无法读取 AgentKit CLI Session。",invalidSessionList:"AgentKit CLI 返回了无效的 Session 列表。",createSessionFailed:"无法创建 AgentKit CLI Session。",openSessionFailed:"无法打开 AgentKit CLI Session。",openTerminalFailed:"无法打开 AgentKit CLI 终端。",invalidTerminalUrl:"AgentKit CLI 返回了无效的终端地址。"},Vbe={cnBeijing:"华北 2(北京)",cnShanghai:"华东 2(上海)"},Hbe={runtimeUnsupported:"该 Runtime 暂不支持连接,请确认服务已正常运行。"},qbe={autoConfigureFailed:"飞书机器人自动配置失败"},Wbe={actionFailed:"{{action}}失败",detail:"详细信息:{{detail}}",request:"请求:{{request}}"},Kbe={persistentMemoryHint:"提示:会话已不存在。使用 in-memory 或 SQLite 短期记忆时,多实例、进程重启或滚动发布都可能导致会话丢失;建议改用基于数据库的持久化短期记忆存储。",unsupportedRouteHint:"提示:该 Runtime 未提供会话能力运行接口,可能是 Runtime 版本与当前 Studio 不兼容。",toolArgumentHint:"提示:模型生成的工具参数格式不完整,请重新发送一次。",resourceCollectionExpiredHint:"提示:本次资源清单已失效,请重新发送任务;系统会重新收集资源后再创建 Agent。",networkConfigurationHint:"提示:请稍后重试,查看 Runtime、模型或网关日志。",modelQuotaHint:"提示:模型当前触发了 TPM/RPM 配额限制,请稍后重试或提高模型配额。",rawResponseLabel:"原始响应:",copySecretFailed:"复制敏感值失败"},Gbe={httpStatus:"HTTP 状态码:{{status}}",errorCode:"错误码:{{code}}",cloudResponseBody:`云端响应正文: +{{body}}`,loadFailedWithDetail:"读取实例日志失败:{{detail}}",invalidFormat:"读取实例日志失败:服务返回格式无效"},Xbe={untitledSession:"未命名会话",webUnavailable:"网络搜索接口未就绪(后端未启用 /web/search)。",webFailed:"网络搜索失败:{{message}}",webNotMounted:"当前 Agent 未挂载 web_search 工具。",knowledgeNotMounted:"该 Agent 未挂载知识库。",memoryNotMounted:"该 Agent 未挂载长期记忆。",knowledge:"知识库",longTermMemory:"长期记忆"},Ybe={listSpacesFailed:"读取 Skill 空间失败",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",deleteSpaceFailed:"删除 Skill 空间失败",uploadFailed:"上传 Skill 失败",validateFailed:"校验 Skill 失败",deleteFailed:"删除 Skill 失败",listFilesFailed:"读取 Skill 文件失败",downloadFailed:"下载 Skill 失败",sharedSpaceFailed:"共享空间加载失败",reservedSpaceName:"此名称由系统空间保留,请使用其他名称",reviewSpaceFailed:"待审核空间暂不可用",submitReviewFailed:"申请公开失败",listReviewsFailed:"加载审核申请失败",reviewFilesFailed:"加载提交文件失败",decideReviewFailed:"审批失败,请重试",listVersionsFailed:"无法加载技能版本",uploadVersionFailed:"上传技能新版本失败"},Zbe={truncatedData:"{{data}}…(已截断,共 {{count}} 个字符)",incompleteEvent:"SSE 流在事件完整返回前已结束。原始数据:{{data}}",invalidEventJson:"无法解析 SSE 事件中的 JSON。原始数据:{{data}}"},Jbe={loadConfigNetworkFailed:"无法加载登录配置,请检查网络后重试。",configServiceFailed:"登录配置服务异常(HTTP {{status}}),请稍后重试。",invalidConfigResponse:"登录配置服务返回了无法解析的响应,请稍后重试。",serviceNetworkFailed:"无法连接身份服务,请检查网络后重试。",invalidServiceResponse:"身份服务返回了无法解析的响应,请稍后重试。",serviceFailed:"身份服务异常(HTTP {{status}}),请稍后重试。"},eye={invalidToken:"GitHub Token 无效或没有仓库写入权限",notFound:"仓库、分支或文件不存在,或 Token 无权访问",rejectedCommit:"GitHub 拒绝了提交,请检查分支和文件状态",requestFailed:"GitHub 请求失败(HTTP {{status}})",networkFailed:"连接 GitHub 失败,请检查网络后重试",invalidRepositoryFormat:"GitHub Repo 格式应为 owner/repository",insecureRepositoryUrl:"仅支持安全的 github.com 仓库地址",unsafeProjectPath:"Agent 项目目录必须是仓库内的安全相对路径",tokenRequired:"GitHub Token 不能为空",invalidBaseBranch:"目标分支格式不正确",invalidPublishBranch:"发布分支格式不正确",noFiles:"没有需要提交的文件",missingBaseSha:"目标分支缺少有效 Git SHA",fileAlreadyExists:"目标仓库中已存在 {{path}},未覆盖现有文件",pathNotUpdatable:"目标路径 {{path}} 不是可更新的文件",invalidPullRequest:"GitHub 未返回有效的 Pull Request"},tye={loadCapabilitiesFailed:"加载视频模型能力失败",uploadAssetFailed:"上传{{fileName}}失败",enhancePromptFailed:"提示词优化失败",createTaskFailed:"创建视频生成任务失败",getTaskFailed:"查询视频生成任务失败",downloadFailed:"下载生成视频失败"},nye={listFailed:"加载网站集成失败",createFailed:"创建网站集成失败",deleteFailed:"删除网站集成失败"},iye={loadFailed:"读取知识库失败",htmlHidden:"[HTML 内容已隐藏]",redacted:"[已脱敏]",depthTruncated:"[内容过深,已截断]",circularReference:"[循环引用]",diagnosticsUnavailable:"[诊断信息无法显示]",statusCode:"状态码:{{status}}",errorCode:"错误码:{{code}}",requestId:"请求 ID:{{requestId}}",diagnostics:"诊断:{{diagnostics}}",detail:"详情:{{detail}}",signInRequired:"请先登录后再访问知识库",forbidden:"你没有权限操作这个知识库",notFound:"知识库或知识内容不存在",conflict:"知识库当前状态不允许执行此操作",requestFailed:"知识库请求失败 ({{status}})"},rye={invalidName:"名称须为 1~128 个字符,不能包含控制字符、不可见格式字符或 < >。",renameProjectFailed:"修改项目名称失败",renameVersionFailed:"修改版本名称失败",invalidNameUpdateResponse:"名称更新响应与请求不一致,请刷新后重试。",invalidSourceSnapshot:"源码快照的响应格式无效。",invalidProjectList:"项目列表的响应格式无效。",invalidProjectVersion:"项目版本的响应格式无效。",loadProjectsFailed:"无法读取已保存项目",loadVersionsFailed:"无法读取项目版本",deleteVersionFailed:"删除项目版本失败",invalidDeleteVersionResponse:"删除项目版本的响应格式无效。",loadProjectSourceFailed:"无法读取项目源码",loadSnapshotFailed:"无法读取源码快照",restoreSnapshotFailed:"无法恢复当前源码快照",downloadSourceFailed:"下载源码失败",downloadNotZip:"源码下载响应不是 ZIP 文件。",downloadSizeMismatch:"源码压缩包大小与发布记录不一致,请重试。"},sye={invalidFormat:"{{label}}格式错误。",validationSeparator:";",invalidAnalysisResult:"迁移分析结果格式错误。",invalidFrameworkCandidate:"框架候选格式错误。",invalidAnalysisEvidence:"分析证据格式错误。",invalidEntryCandidate:"入口候选格式错误。",invalidQuestion:"待确认问题格式错误。",invalidPendingInput:"分析问题无法读取",invalidTask:"迁移会话格式错误。",invalidAnalysisReference:"分析结果引用格式错误。",invalidSourcePersistence:"迁移源码保存状态格式错误。",invalidActivity:"迁移执行动态格式错误。",invalidActivityItem:"迁移执行动态项格式错误。",invalidActivityTool:"迁移执行工具项格式错误。",invalidActivityPlan:"迁移执行计划格式错误。",invalidActivityPlanItem:"迁移执行计划项格式错误。",invalidArtifact:"迁移产物格式错误。",invalidEnvironmentDefaults:"环境变量默认值格式错误。",invalidArtifactFile:"迁移产物文件格式错误。",invalidVerificationCheck:"迁移校验项格式错误。",requestValidationFailed:"请求参数校验失败:{{detail}}",gatewayError:"{{fallback}}(HTTP {{status}},Content-Type: {{contentType}})。请检查代理或网关配置。",nonJsonResponse:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}})。请检查代理或网关配置。",loadCapabilitiesFailed:"读取迁移能力失败",invalidCapabilities:"迁移能力格式错误。",invalidModelCapabilities:"迁移模型能力格式错误。",loadTasksFailed:"读取迁移会话失败",invalidTaskList:"迁移会话列表格式错误。",createTaskFailed:"创建迁移会话失败",uploadProjectFailed:"上传迁移项目失败",loadActivityFailed:"读取迁移执行动态失败",loadEventsFailed:"订阅迁移进度流失败",invalidEventsResponse:"迁移进度流返回了非法数据帧。",reconnecting:"连接已断开,正在重新连接迁移进度流…",startFailed:"启动迁移失败",submitAnswersFailed:"提交分析补充信息失败",submitInputFailed:"提交分析回答失败",stopFailed:"终止迁移失败",deleteTaskFailed:"删除迁移会话失败",loadArtifactFailed:"读取迁移产物失败",loadArtifactFileFailed:"读取迁移产物文件失败",downloadArtifactFailed:"下载迁移产物失败",evaluation:{datasetSaveFailed:"保存评测用例失败",datasetLoadFailed:"读取评测用例失败",statusLoadFailed:"读取评测状态失败",resumeFailed:"继续评测失败",retryFailed:"重新评测失败",reportLoadFailed:"读取评测报告失败",reportDownloadFailed:"下载评测报告失败"},labels:{analysisResult:"迁移分析结果",recommendation:"迁移建议",boundary:"迁移边界",frameworkCandidate:"框架候选",analysisEvidence:"分析证据",recommendedFramework:"推荐框架",entryCandidate:"入口候选",entryFramework:"入口框架",includeScope:"迁移包含范围",excludeScope:"迁移排除范围",assumptions:"分析假设",question:"待确认问题",analysisWarnings:"迁移警告",task:"迁移会话",artifactStatus:"迁移产物状态",analysisReference:"分析结果引用",confirmation:"迁移确认",confirmedFramework:"确认框架",error:"迁移错误",sourcePersistence:"迁移源码保存状态",activity:"迁移执行动态",activityItem:"迁移执行动态项",activityTool:"迁移执行工具项",activityPlanItem:"迁移执行计划项",artifact:"迁移产物",cli:"CLI 信息",migration:"迁移信息",startup:"启动信息",environment:"环境变量信息",verification:"校验信息",report:"迁移报告",archive:"产物归档",environmentDefaults:"环境变量默认值",requiredEnvironment:"必需环境变量",optionalEnvironment:"可选环境变量",artifactFile:"迁移产物文件",verificationCheck:"迁移校验项",artifactWarnings:"迁移产物警告",errorResponse:"错误响应",errorDetail:"错误详情",capabilities:"迁移能力",framework:"迁移框架",modelCapabilities:"迁移模型能力",taskList:"迁移会话列表",evaluationAsset:"评测资产",evaluation:"评测状态",evaluationCapabilities:"评测能力",evaluationDimension:"评测维度",evaluationCase:"评测用例",evaluationCriteria:"评测标准",evaluationMessage:"评测对话",evaluationDataset:"评测数据集",evaluationDimensionResult:"评测维度结果",evaluationEvidence:"评测证据",evaluationReport:"评测报告",evaluationSummary:"评测汇总",evaluationCaseResult:"评测用例结果",evaluationOutput:"评测输出",evaluationLimitations:"评测限制",pendingInput:"分析提问",pendingQuestion:"分析问题项",pendingOption:"分析问题选项"}},aye={status:{ready:"就绪",wakeable:"已休眠",creating:"创建中",starting:"启动中",pending:"等待中",running:"运行中",failed:"异常",stopped:"已停止",expired:"已过期",deleting:"删除中",deleted:"已删除",unknown:"未知状态"},developmentTimeout:"等待开发环境响应超时。任务可能仍在运行,请稍后重新进入当前会话查看状态。",developmentDisconnected:"与开发环境的连接已中断。任务可能仍在运行,请稍后重新进入当前会话查看状态。",developmentFailed:"开发任务未能继续,开发环境已保留。请在当前会话重试。",invalidStudioResponse:"{{fallback}} Studio 服务响应异常,请刷新后重试。",invalidSession:"AgentKit 沙箱返回了无效的 Session 信息。",invalidSnapshot:"AgentKit 沙箱返回了无效的 Snapshot 信息。",invalidSettings:"Sandbox 返回了无效设置。",invalidThreadSnapshot:"Sandbox 返回了无效 Thread 快照。",emptyConversationResponse:"沙箱对话服务未返回内容。",invalidConversationResponse:"沙箱对话服务返回了无法解析的响应。",conversationFailed:"沙箱对话失败,请稍后重试。",emptyReply:"沙箱未返回有效回复,请重试。",missingSession:"缺少要操作的 AgentKit Session。",listCodexFailed:"无法读取 Codex 智能体,请稍后重试。",invalidSessionList:"AgentKit 沙箱返回了无效的 Session 列表。",invalidSnapshotList:"AgentKit 沙箱返回了无效的 Snapshot 列表。",startFailed:"无法启动 AgentKit 沙箱,请稍后重试。",listAgentFailed:"无法读取 {{kind}} 智能体,请稍后重试。",invalidKindSessionList:"AgentKit 返回了无效的 {{kind}} Session 列表。",invalidKindSnapshotList:"AgentKit 返回了无效的 {{kind}} Snapshot 列表。",createAgentFailed:"无法创建 {{kind}} 智能体,请稍后重试。",missingSessionToOpen:"缺少要打开的 AgentKit Session。",openAgentFailed:"无法打开 {{kind}} 智能体。",invalidAgentHomeUrl:"{{kind}} 智能体返回了无效的主页面地址。",missingSessionForTerminal:"缺少要打开 Terminal 的 AgentKit Session。",openTerminalFailed:"无法打开 {{kind}} Terminal。",deleteAgentFailed:"无法删除 {{kind}} 智能体。",missingSnapshot:"未找到要唤醒的智能体。",resumeSnapshotFailed:"无法唤醒智能体,请稍后重试。",deleteSnapshotFailed:"无法删除智能体,请稍后重试。",missingSessionToConnect:"缺少要连接的 AgentKit Session。",connectCodexFailed:"无法连接 Codex 智能体,请稍后重试。",sessionNotReady:"AgentKit Session 尚未就绪,当前状态:{{status}}。",invalidMessage:"内置智能体会话缺少有效的消息内容。",interruptFailed:"无法停止当前任务。",getStatusFailed:"无法读取 Codex 状态。",getEndpointFailed:"无法读取 Sandbox Endpoint。",invalidEndpoint:"Sandbox 返回了无效 Endpoint。",createHandoffPairingFailed:"无法生成 Codex 云端接力配对码。",invalidHandoffPairing:"Studio 返回了无效的 Codex 云端接力配对码。",getHandoffStatusFailed:"无法读取端云接力状态。",invalidHandoffStatus:"Studio 返回了无效的端云接力状态。",listModelsFailed:"无法读取 Codex 模型列表。",invalidModelList:"Sandbox 返回了无效模型列表。",setModelFailed:"无法切换 Codex 模型。",invalidModel:"Sandbox 返回了无效模型。",listSkillsFailed:"无法读取 Codex Skills。",invalidSkillList:"Sandbox 返回了无效 Skill 列表。",listThreadsFailed:"无法读取 Codex Thread 列表。",invalidThreadList:"Sandbox 返回了无效 Thread 列表。",createThreadFailed:"无法创建新的 Codex Thread。",missingThread:"缺少要读取的 Codex Thread。",readThreadFailed:"无法读取 Codex 历史消息。",resumeThreadFailed:"无法恢复 Codex Thread。",forkThreadFailed:"无法分叉 Codex Thread。",archiveThreadFailed:"无法归档 Codex Thread。",invalidArchiveResult:"Sandbox 返回了无效归档结果。",deleteThreadFailed:"无法删除 Codex Thread。",invalidDeleteResult:"Sandbox 返回了无效删除结果。",compactThreadFailed:"无法压缩 Codex Thread。",getSettingsFailed:"无法读取 Codex 权限与工作空间。",updatePermissionsFailed:"无法更新 Codex 权限。",updateWorkspaceFailed:"无法更新 Codex 工作空间。",invalidWorkingDirectory:"Sandbox 返回了无效工作目录。",listDirectoriesFailed:"无法读取 Sandbox 目录。",invalidDirectoryList:"Sandbox 返回了无效目录列表。",resolveApprovalFailed:"无法提交 Codex 审批决定。",uploadFileFailed:"无法上传文件到 Sandbox。",invalidUploadResult:"Sandbox 返回了无效上传结果。",disconnectCodexFailed:"无法断开 Codex 智能体连接。",deleteCodexFailed:"无法删除 Codex 智能体。",openSandboxTerminalFailed:"无法打开 Sandbox Terminal。",openSandboxBrowserFailed:"无法打开 Sandbox Browser。",toolLabel:"Sandbox 工具",invalidToolUrl:"{{label}} 返回了无效地址。",unsafeToolUrl:"{{label}} 返回了不安全的地址。"},oye={invalidSandboxVersion:"沙箱版本响应格式无效",loadSandboxVersionsFailed:"查询沙箱版本失败",updateSandboxFailed:"更新 Sandbox 失败",invalidSandboxUpdate:"沙箱更新响应格式无效",errorWithDetailAndRawResponse:`{{context}} {{detail}} 响应详情: {{response}}`,errorWithRawResponse:`{{context}} @@ -40,20 +40,20 @@ Original error: {{message}}`,unavailable:"Connection unavailable",requestFailed: {{detail}}`,mpaRuntimeSessionsLoadFailed:"加载 MPA Runtime Session 失败",mpaDeletePreviewFailed:"加载 MPA 删除预览失败",loadMpaDiagnosticsFailed:"加载 MPA Runtime 诊断失败",mpaExecutionConfigFailed:"更新 MPA 会话配置失败",deploymentDisconnected:"部署失败:连接中断",deploymentMissingAgentName:"部署失败:返回缺少 Agent 名称",deploymentMissingConnection:"部署失败:返回缺少 AgentKit 连接信息",cancelDeploymentFailed:"取消部署失败 ({{status}})",loadFailed:"加载失败 ({{status}})",loadPermissionsFailed:"加载权限失败 ({{status}})",invalidPermissionResponse:"权限服务返回了无法解析的响应",checkStudioUpdateFailed:"检查 Studio 更新失败 ({{status}})",studioUpdatePreflightFailed:"Studio 更新权限预检失败 ({{status}})",submitStudioUpdateFailed:"提交 Studio 更新失败 ({{status}})",loadAgentUsageFailed:"加载 Agent 用量失败",notProvided:"未提供",agentUsageNonJson:"加载 Agent 用量失败:服务端返回非 JSON 响应(HTTP {{status}},Content-Type: {{contentType}})。",checkStudioGateway:"请确认当前服务以 Studio 模式启动,并检查代理或网关配置。",agentUsageInvalidJson:"加载 Agent 用量失败:服务端返回了无法解析的 JSON(HTTP {{status}},Content-Type: {{contentType}})。",retryCheckGateway:"请稍后重试;若问题持续,请检查代理或网关配置。",loadCronJobsFailed:"加载定时任务失败",loadCronJobFailed:"加载定时任务详情失败",createCronJobFailed:"创建定时任务失败",updateCronJobFailed:"更新定时任务失败",enableCronJobFailed:"启用定时任务失败",pauseCronJobFailed:"暂停定时任务失败",runCronJobFailed:"立即执行定时任务失败",loadCronHistoryFailed:"加载执行历史失败",stopCronRunFailed:"终止执行失败",deleteCronJobFailed:"删除定时任务失败",loadRuntimeFailed:"加载 Runtime 失败",loadLocalToolsFailed:"读取本地工具失败",connectDynamicRouteFailed:"连接 Studio 动态路由失败",a2aProbeDenied:"Runtime 服务拒绝了 A2A 探测请求,请检查 Runtime 的鉴权配置。",loadA2aCardFailed:"读取 A2A Agent Card 失败",loadRuntimeApiKeyFailed:"读取 Runtime API Key 失败",runtimeApiKeyMissing:"Runtime 未返回可用的 API Key",loadMcpCredentialsFailed:"读取 MCP 认证信息失败",invalidMcpCredentials:"Studio 返回的 MCP 认证信息格式无效",mpaDeleteUnconfirmed:"删除请求超时,尚未确认 Runtime 已删除。后台可能仍在清理,请稍后刷新并检查。",deleteFailed:"删除失败 ({{status}})",runtimeManageForbidden:"当前账号没有管理该 Runtime 的权限。",runtimeNotFound:"该 Runtime 不存在或已被删除。",runtimeUnavailable:"当前账号无法访问该 Runtime。",checkRuntimeUpdateFailed:"检查 Runtime 更新能力失败(HTTP {{status}}),请稍后重试。",loadRuntimeDetailFailed:"加载 Runtime 详情失败",generateProjectFailed:"生成项目失败",generateAgentConfigFailed:"生成 Agent 配置失败",createDebugRunFailed:"创建调试运行失败",createDebugSessionFailed:"创建调试会话失败",loadDebugTraceFailed:"加载调试调用链路失败",invalidDebugTrace:"加载调试调用链路失败:返回格式无效",debugRunFailed:"调试运行失败",cleanupDebugRunFailed:"清理调试运行失败",errorWithCloudResponse:`{{context}} 云接口:{{action}} 云服务原始响应: -{{response}}`,emptyCloudResponse:"(响应正文为空)"},oye={loadFailed:"读取会话模式能力失败(HTTP {{status}})",invalidResponse:"会话模式能力响应格式错误"},lye={nonJson:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}},{{contentType}}){{detail}}"},cye={busy:"工作区正在处理较多请求,请稍后重试",notFound:"工作区不存在",duplicates:"检测到多个个人工作区会话,请联系管理员处理",timeout:"工作区恢复超时,项目仍保留,请重试",unavailable:"工作区暂时无法恢复,原项目仍保留,请重试",persistence:"当前 Sandbox 未启用持久化快照,请检查工作区配置",startup:"个人工作区启动失败,请检查 Sandbox 状态",exists:"项目名称已存在,请从项目列表打开",directory:"项目目录不存在",configuration:"请先配置工作区 Sandbox 镜像",state:"暂时无法确认工作区状态,请重试",list:"恢复工作区或读取项目列表失败,请重试",create:"项目初始化失败,请确认镜像可用后重试",open:"恢复工作区或打开项目失败,请重试",connection:"工作区暂时无法连接,请重试",invalidWorkspaceUrl:"工作区返回了无效的访问地址",operation:"项目操作失败,请重试",invalidProjectUrl:"项目访问地址无效",listFallback:"读取项目列表失败",connectionState:"暂时无法连接工作区,请重试"},uye={reporting:"正在补齐交付信息",packaging:"正在整理产物",savingVersion:"正在保存版本",finishing:"正在完成请求",submitResult:"提交构建结果",requestFailed:"任务请求失败,请重试。",invalidResponse:"任务状态响应无效。",eventGap:"正在补齐任务输出。",reconnecting:"连接暂时中断,正在重连。已有输出已保留。",input:{pending:"等待送达",sending:"正在确认送达",delivered:"已送达",withdrawn:"已停止发送"},plan:"执行计划",diff:"文件变更",preparing:"正在准备任务",preparingEnvironment:"正在准备开发环境…",connectingEnvironment:"正在连接开发环境…",processing:"正在处理请求",thinking:"正在思考",read:"读取文件 · {{target}}",listFiles:"查看目录 · {{target}}",search:"搜索 · {{target}}",command:"执行命令 · {{target}}",editFiles:"修改文件 · {{target}}",webSearch:"搜索网页 · {{target}}",processSummary:"已处理 {{count}} 项",duration:"{{seconds}} 秒",durationUnits:{milliseconds:"{{value}} 毫秒",hours:"{{value}} 小时",minutes:"{{value}} 分",seconds:"{{value}} 秒"},failedTools:"{{count}} 项执行失败",toolFailed:"执行失败",toolCalls:"{{count}} 次工具调用",turnDuration:"本轮耗时 {{duration}}",toolDuration:"工具累计耗时 {{duration}}",toolDurationPartial:"已记录工具耗时 {{duration}}",toolDurationHelp:"各工具执行耗时之和;并行调用可能使累计耗时超过本轮耗时。",turnStatus:{completed:"已完成",failed:"未完成",interrupted:"已中断",cancelled:"已中断",unavailable:"任务已结束"},notReported:"未上报",partial:"已记录",partialHelp:"本轮记录可能不完整。",tokenDetails:"本轮 Token 用量",model:"本轮模型",totalTokens:"总量",inputTokens:"输入",cachedInputTokens:"缓存命中输入",uncachedInputTokens:"未命中输入",cacheWriteInputTokens:"缓存写入",outputTokens:"输出",reasoningOutputTokens:"推理输出",cacheHitRate:"输入缓存命中率",tokenHelp:"缓存命中属于输入,推理输出属于输出,不重复计入总量。未命中输入 = 输入 − 缓存命中。"},jU={common:Ube,agentkitCli:Qbe,cloudRegion:zbe,connections:Vbe,feishuBot:Hbe,requestError:qbe,runSse:Wbe,runtimeLogs:Kbe,search:Gbe,skills:Xbe,sse:Ybe,identity:Zbe,github:Jbe,video:eye,websiteIntegration:tye,knowledge:nye,intelligentDevelopment:iye,migrations:rye,sandbox:sye,client:aye,newChatCapabilities:oye,jsonResponse:lye,workspaceProjects:cye,developmentRuns:uye},SVe=Object.freeze(Object.defineProperty({__proto__:null,agentkitCli:Qbe,client:aye,cloudRegion:zbe,common:Ube,connections:Vbe,default:jU,developmentRuns:uye,feishuBot:Hbe,github:Jbe,identity:Zbe,intelligentDevelopment:iye,jsonResponse:lye,knowledge:nye,migrations:rye,newChatCapabilities:oye,requestError:qbe,runSse:Wbe,runtimeLogs:Kbe,sandbox:sye,search:Gbe,skills:Xbe,sse:Ybe,video:eye,websiteIntegration:tye,workspaceProjects:cye},Symbol.toStringTag,{value:"Module"})),dye="智能体审核",fye="申请企业内全员使用,审批后生效",hye="关闭",pye="刷新",mye="状态",gye="申请人",bye="申请时间",yye="当前版本",vye="模型",xye="退回人",wye="通过人",kye="审批时间",Oye="智能体描述",Sye="申请说明",Eye="退回理由",Cye="审批意见",Aye="退回理由(必填)",Tye="提交后内容已变化,请退回并重新申请",_ye="撤回后可以修改 Agent,需要公开时重新申请",jye="取消公开后其他用户将无法继续使用,确定取消公开吗?",Nye="取消",Rye="确认",Iye="正在保存",Pye="取消公开",Dye="撤回申请",Mye="通过",Lye="直接公开",$ye="申请公开",Fye="全员可见",Bye={pending:"待审核",approved:"已通过",returned:"已退回",withdrawn:"已撤回"},Uye="搜索智能体或申请人",Qye="地域",zye="全部状态",Vye="智能体",Hye="操作",qye="查看并审批",Wye="申请详情",Kye="没有符合条件的申请",Gye="暂无智能体审核申请",Xye="{{count}} / {{limit}} 字",EVe={title:dye,dialogDescription:fye,close:hye,refresh:pye,statusTitle:mye,submitter:gye,submittedAt:bye,version:yye,model:vye,returnedBy:xye,approvedBy:wye,reviewedAt:kye,description:Oye,message:Sye,reason:Eye,comment:Cye,reasonRequired:Aye,contentChanged:Tye,withdrawConfirm:_ye,unpublishConfirm:jye,cancel:Nye,confirm:Rye,saving:Iye,unpublish:Pye,withdraw:Dye,return:"退回",approve:Mye,publish:Lye,submit:$ye,private:"仅自己可见",enterprise:Fye,status:Bye,search:Uye,region:Qye,all:zye,agent:Vye,actions:Hye,review:qye,details:Wye,noMatches:Kye,empty:Gye,textCount:Xye},CVe=Object.freeze(Object.defineProperty({__proto__:null,actions:Hye,agent:Vye,all:zye,approve:Mye,approvedBy:wye,cancel:Nye,close:hye,comment:Cye,confirm:Rye,contentChanged:Tye,default:EVe,description:Oye,details:Wye,dialogDescription:fye,empty:Gye,enterprise:Fye,message:Sye,model:vye,noMatches:Kye,publish:Lye,reason:Eye,reasonRequired:Aye,refresh:pye,region:Qye,returnedBy:xye,review:qye,reviewedAt:kye,saving:Iye,search:Uye,status:Bye,statusTitle:mye,submit:$ye,submittedAt:bye,submitter:gye,textCount:Xye,title:dye,unpublish:Pye,unpublishConfirm:jye,version:yye,withdraw:Dye,withdrawConfirm:_ye},Symbol.toStringTag,{value:"Module"})),Yye={backToEvaluationCase:"返回评测案例",cancel:"取消",copied:"已复制",copy:"复制",exportConversation:"导出会话",retry:"重试"},Zye={title:"您想以哪种方式添加 Agent 来运行?",subtitle:"选择最适合你的方式,下一步即可开始",quickCreate:{title:"从 0 快速创建",description:"用智能、自定义、模板或工作流的方式从零创建一个 Agent。"},intelligent:{title:"智能模式",description:"描述目标,按你的意图构建、调试并验证 Agent。"},package:{title:"从代码包添加和部署",description:"上传 Agent 项目压缩包,查看代码并直接部署到 AgentKit Runtime。"},migrate:{title:"从存量迁移",description:"从您的 LangChain、Dify 等存量项目迁移至 AgentKit Runtime。"}},Jye={subject:{file:"文件修改",command:"命令执行"},decision:{accept:"已允许本次{{subject}}",acceptForSession:"已在本会话中允许{{subject}}",decline:"已拒绝{{subject}}",cancel:"已取消{{subject}}审批"},details:{command:"命令",grantRoot:"授权路径",cwd:"执行目录"}},eve={noDescription:"暂无描述",region:"地域",unknownAgent:"未知 Agent"},tve={agentTransfer:"智能体移交",annotationHint:"模型回复;选中文字后可添加批注",continueBranch:"继续“{{branch}}”这个方向",emptyResponse:"本次没有返回可显示的内容。",subagentDescription:"正在执行主 Agent 移交的任务。"},nve={title:"需要配置 {{provider}} AK/SK",prefix:"智能体工作台需要 {{provider}} 凭据才能使用。请在运行环境中设置",and:"与",suffix:"后重试。"},ive={buildRunning:{title:"当前构建仍在进行",description:"离开将停止本轮构建;当前会话仍会保留,可稍后从历史会话重新进入。",confirm:"停止并离开"},deleteThread:{title:"删除 Codex 历史会话",description:"将删除“{{name}}”,并从历史会话中移除。",confirm:"确认删除"},returnToCreate:{title:"返回创建首页?",description:"返回后当前填写的内容将会丢失,确定要返回吗?",confirm:"确定返回"}},rve={additionalAgentDeleteFailures:";另有 {{count}} 个失败",agentDeleteFailures:"{{count}} 个 Agent 删除失败:{{failures}}{{suffix}}",agentToolsMissing:"当前 Agent 缺少任务工具:{{tools}}",buildStopUnconfirmed:"已离开开发环境,但未能确认本轮构建已停止。任务可能仍在运行,请稍后从历史会话检查状态。",builtinAgentSendFailed:"内置智能体发送失败:{{message}}",bytePlusEvaluationUnsupported:"BytePlus 暂不支持 AgentKit 评测集",clipboardUnsupported:"当前浏览器不支持写入剪贴板。",cloudCodexEmptyReply:"云端 Codex 已结束,但没有生成回复,请重新发送任务。",cloudCodexSessionMissing:"云端 Codex Session 暂未出现在列表中,请稍后重试。",deploymentRuntimeIdMissing:"部署完成,但未返回 Runtime ID。",environmentExpired:"所选环境已失效,请刷新后重新选择。",environmentsLoadFailed:"读取环境失败",evaluationCaseSessionMissing:"这条案例缺少会话定位信息,无法跳转。",evaluationUnsupportedForReply:"当前回复暂不支持加入评测集",firstFrameRequired:"首尾帧生成需要先添加首帧图片。",incompletePromptOptimization:"提示词优化结果不完整,请重新优化后再试。",intelligentCapabilityCheckFailed:"智能开发能力检查失败(HTTP {{status}})",intelligentSessionCreateFailed:"智能开发会话创建失败",invalidIntelligentCapability:"智能开发模型能力格式错误。",localBffToolsNotConfigured:"本地 Studio BFF 没有配置工具。",localToolsLoadFailed:"读取本地工具失败",loginPopupBlocked:"登录窗口被浏览器拦截,请允许弹出窗口后重试。",loginPopupClosed:"登录窗口已关闭,请重新登录以继续当前操作。",mediaTooLarge:"{{fileName}} 超出当前平台允许的素材大小。",mountEnvironmentFailed:"挂载环境失败",noConnectedSandbox:"当前没有已连接的 Sandbox。",noCreateAgentPermission:"当前账号没有添加 Agent 的权限。",noManageAgentPermission:"当前账号没有管理 Agent 的权限。",noOptimizationBaseline:"当前版本没有可对比的优化前版本。",oauthUrlMissing:"事件中没有授权地址。",onlyCloudAgentUpdatable:"仅支持更新已部署的云端智能体。",optimizationVersionMissing:"无法找到本次优化对应的项目版本,可能已被删除。",persistentStorageNotConfigured:"管理员未配置持久化存储",readDraftFailed:"无法读取本机草稿,请稍后重试。",runtimeAgentNameMissing:"Runtime 缺少智能体名称,无法更新。",runtimeBffToolsDisabled:"当前 Runtime Agent 未开启 BFF 工具能力。",runtimeDeploymentConfigUnavailable:"该 Runtime 的原发布配置不可恢复,无法安全更新。",runtimeMissingForConnection:"缺少 Runtime 信息,无法连接智能体。",runtimeRegionMissingForDelete:"Runtime 缺少地域信息,无法删除",runtimeRegionMissingForUpdate:"Runtime 缺少地域信息,无法更新。",runtimeUpdateUnsupported:"当前 Runtime 不支持原地更新。",sandboxRuntimeUnavailable:"当前 Agent 没有可用的 Sandbox Runtime。",sandboxToolsUnavailable:"当前 Studio BFF 未提供 Sandbox 执行工具。",saveDraftLocationRejected:"浏览器拒绝保存当前草稿位置,请检查站点存储权限后重试。",saveDraftRejected:"浏览器拒绝保存草稿,请稍后重试。",selectSkillToOptimize:"请先选择需要优化的 Skill。",sessionMissingForMount:"当前会话不存在,无法挂载环境。",sessionNotReady:"会话尚未就绪。",sessionUnavailable:"当前会话不可用,请关闭后重试。",sourceNotReady:"该源码尚未准备好,请返回对话继续处理。",textVideoRejectsReferences:"文生视频不使用参考素材,请先移除已添加的图片或视频。",videoEditRequiresVideo:"视频编辑需要先添加待编辑视频。",videoExtendRequiresVideo:"视频续写需要先添加基础视频。",videoGenerationFailed:"视频生成失败,请稍后重试。",videoModeUnsupported:"当前平台暂不支持所选视频任务模式。",videoPreviewMissing:"视频任务已完成,但服务端未返回预览地址。",videoReferenceRequired:"参考素材生视频需要至少添加一项参考图片或参考视频。"},sve={like:"赞",removeLike:"取消点赞",dislike:"踩",removeDislike:"取消点踩",reportIssue:"问题反馈",traceFlameGraph:"Tracing 火焰图"},ave={0:"今天想做点什么?",1:"有什么可以帮你的?",2:"需要我帮你查点什么吗?",3:"有问题尽管问我",4:"嗨,我们开始吧",5:"开始一段新对话吧",6:"今天想先解决哪件事?",7:"把你的想法告诉我吧",8:"我们从哪里开始?",9:"有什么任务交给我?",10:"准备好一起推进了吗?",11:"说说你现在最关心的问题",12:"今天也一起把事情做好",13:"我在,随时可以开始",intelligentDevelopment:"让灵感自由生长"},ove={agentCapabilities:"正在检查 Agent 能力…",session:"加载会话…"},lve={cancelled:"授权已取消。",pasteCallbackUrl:"授权完成后,请粘贴回调页面(浏览器地址栏)的完整 URL:",popupBlocked:"弹窗被拦截,请允许弹窗后重试。",unsupportedUrl:"授权链接不是 http/https 地址,已阻止打开。"},cve={volcengine:"火山引擎"},uve={checkingPersistence:"正在检查持久化能力…",exitDevelopment:"退出开发环境",fileUploaded:"已上传文件到 Sandbox",filesUploaded:"已上传 {{count}} 个文件到 Sandbox",intelligentDevelopment:"智能开发",mode:{readOnly:"只读",workspaceWrite:"工作区写入",fullAccess:"完全访问"},approvalPolicy:{untrusted:"仅不可信命令",onRequest:"按需审批",never:"不审批"},reviewer:{user:"由我审批",autoReview:"自动审查"},labels:{approvalPolicy:"审批策略",file:"文件",fileNumber:"文件 {{number}}",mode:"沙箱模式",networkAccess:"网络访问",reviewer:"审批方式",workingDirectory:"工作目录"},network:{allowed:"允许",disabled:"关闭"},permissionsUpdated:"已更新当前 Sandbox Session 的 Codex 权限",persistenceUnknown:"暂时无法确认持久化能力",stoppedReady:"已停止,可继续输入",uploadedFilesPrompt:"以下文件已上传到当前 Sandbox 工作空间,请在任务中使用:",workspaceUpdated:"已更新工作空间"},dve={addAgent:"添加智能体",addFromPackage:"从代码包添加",agent:"智能体",automations:"自动化",createAgent:"创建智能体",createSkill:"创建技能",cronJobs:"定时任务",issueFeedback:"问题反馈",library:"资源库",migrateAgent:"迁移智能体",newConversation:"新会话",optimizeSkill:"优化 {{name}}",search:"搜索",skill:"技能",skillLibrary:"技能库",systemInfo:"系统信息",updateAgent:"更新 {{name}}",codeProjects:"代码项目",reviewCenter:"审核中心"},fve={title:"从工作区新建",description:"创建和管理代码项目,在 VS Code 中编写和调试"},hve={actions:Yye,addAgent:Zye,approval:Jye,common:eve,conversation:tve,credentials:nve,dialogs:ive,errors:rve,feedback:sve,greetings:ave,loading:ove,oauth:lve,providers:cve,sandbox:uve,titles:dve,workspaceProjectEntry:fve},AVe=Object.freeze(Object.defineProperty({__proto__:null,actions:Yye,addAgent:Zye,approval:Jye,common:eve,conversation:tve,credentials:nve,default:hve,dialogs:ive,errors:rve,feedback:sve,greetings:ave,loading:ove,oauth:lve,providers:cve,sandbox:uve,titles:dve,workspaceProjectEntry:fve},Symbol.toStringTag,{value:"Module"})),pve="自动化",mve="连接研发工具,为智能体扩展自动化工作流",gve="搜索自动化",bve="自动化分类",yve={development:"研发",channels:"消息渠道"},vve="{{category}}自动化列表",xve="打开{{name}}",wve="仅本地部署可用",kve="没有匹配的自动化",Ove="请尝试搜索其他名称",Sve="返回自动化列表",Eve={"coding-agents":{name:"配置 Coding Agents",badge:"本地",description:"将 VeADK 和 AgentKit 内置 Skills 全局配置到 Trae、Claude Code 或 Codex。"},template:{name:"模板项目导入",description:"在您的仓库中创建一个可持续交付到 AgentKit Runtime 的最简智能体",title:"模板项目导入",subtitle:"把可直接启动 Studio 的 basic Agent 和持续交付配置加入仓库",panel:"提交后将创建一个 PR,同时导入 basic 项目和 AgentKit Runtime 发布工作流。",submitLabel:"导入模板并提交 PR",regionHelp:"必须与目标 Runtime 所在地域一致",pullRequest:{title:"feat: 导入 AgentKit basic 模板",description:"导入带有 AgentKit Studio App Server 的 basic Agent 项目,并添加持续发布到 AgentKit Runtime 的工作流。合并前请配置 {{provider}} Secrets。"},fields:{repository:{label:"GitHub 仓库",placeholder:"owner/repository",help:"支持 owner/repository 或完整 github.com URL"},baseBranch:{label:"目标分支",placeholder:"main",help:"留空时使用 main,PR 将以此分支为 base"},projectPath:{label:"Agent 项目目录",placeholder:"agentkit-basic-agent",help:"将在此目录新增 basic 项目;app.py 挂载完整 Studio App Server,并作为服务入口启动"},runtimeName:{label:"Runtime 名称",placeholder:"support-agent",help:"用于 AgentKit 发布配置"},runtimeId:{label:"运行时 ID",placeholder:"rt-xxxxxxxx",help:"持续更新的目标 AgentKit Runtime"}}},delivery:{name:"AgentKit Runtime 持续交付",description:"为您的仓库添加持续交付到 AgentKit Runtime 的自动化工作流。",title:"AgentKit Runtime 持续交付",subtitle:"用 Pull Request 把持续发布配置安全地加入代码仓库",panel:"提交后将在目标仓库创建发布分支,并发起包含 GitHub Actions 工作流的 PR。",submitLabel:"确定并提交 PR",regionHelp:"必须与目标 Runtime 所在地域一致",pullRequest:{title:"feat: 持续发布到 AgentKit Runtime",description:"新增 GitHub Actions 工作流,在目标分支更新时持续发布到 AgentKit Runtime。合并前请配置工作流所需的 {{provider}} Secrets。"},fields:{repository:{label:"GitHub 仓库",placeholder:"owner/repository",help:"支持 owner/repository 或完整 github.com URL"},baseBranch:{label:"目标分支",placeholder:"main",help:"留空时使用 main,PR 将以此分支为 base"},projectPath:{label:"Agent 项目目录",placeholder:".",help:"留空时使用仓库根目录;目录内需包含挂载完整 Studio App Server 的 app.py"},runtimeName:{label:"Runtime 名称",placeholder:"support-agent",help:"用于 AgentKit 发布配置"},runtimeId:{label:"运行时 ID",placeholder:"rt-xxxxxxxx",help:"持续更新的目标 AgentKit Runtime"}}},review:{name:"GitHub PR 自动评审",description:"通过 GitHub App 在隔离 Sandbox 中评审 Pull Request。",title:"GitHub PR 自动评审",subtitle:"通过 GitHub App 触发 Sandbox 评审,并将结果发布到 Pull Request",panel:"请先将 GitHub App 安装到目标仓库,再为每个仓库启用自动评审。",submitLabel:"安装 GitHub App",regionHelp:"",pullRequest:{title:"chore: 配置 PR 自动评审",description:"新增 GitHub Actions 工作流,在隔离 Sandbox 中评审同仓库 PR,并将结果发布为 GitHub Review。合并前请配置工作流所需 Secrets。"},fields:{repository:{label:"GitHub 仓库",placeholder:"owner/repository",help:"支持 owner/repository 或完整 github.com URL"},baseBranch:{label:"目标分支",placeholder:"main",help:"留空时使用 main,PR 将以此分支为 base"},sandboxToolId:{label:"沙箱工具 ID",placeholder:"tool-xxxxxxxx",help:"用于运行每次评审的 AgentKit CodeEnv"},modelName:{label:"评审模型",placeholder:"review-model",help:"注入 Sandbox 的代码评审模型名称"},modelBaseUrl:{label:"模型 API 地址",placeholder:"https://ark.example.com/api/v3",help:"必须使用 OpenAI 兼容的 HTTPS 地址"}}},"gitlab-review":{name:"GitLab MR 自动评审",description:"通过 GitLab 集成在隔离 Sandbox 中评审 Merge Request。"},feishu:{name:"飞书机器人",badge:"Beta",description:"创建飞书机器人,并将消息直接接入 AgentKit Runtime。"},"mpa-channels":{name:"MPA智能体消息渠道",description:"为已有 MPA 智能体绑定飞书、企业微信和钉钉。"},"website-integration":{name:"网站集成",description:"将 AgentKit Runtime 以悬浮聊天窗口嵌入网站。"}},Cve={required:"必填",optional:"可选",region:"地域",tokenLabel:"GitHub Token",getToken:"获取 Token",createToken:"创建 GitHub Token",tokenPlaceholder:"需要仓库 Contents 与 Pull requests 写权限",tokenWorkflowPlaceholder:"需要 Contents、Pull requests、Workflows 写权限",hideToken:"隐藏 Token",showToken:"显示 Token",tokenHelp:"Token 仅用于本次提交,不会保存在浏览器或写入 PR",tokenWorkflowHelp:"此处 Token 用于创建配置 PR;它不是 Sandbox 的通用必填项,且不会保存在浏览器或写入 PR",prCreated:"PR #{{number}} 已创建",configPrCreated:"配置 PR #{{number}} 已创建",configPrNextStep:"合并后,后续同仓库 PR 会自动触发评审。",viewOnGitHub:"在 GitHub 查看",viewConfigPr:"查看配置 PR",secretsHeading:"合并 PR 前,请在仓库的 GitHub Actions Secrets 中配置:",secretsConfigHeading:"合并配置 PR 前,请在目标仓库添加运行时密钥",openSecrets:"打开 Secrets 设置",secretsPath:"路径:Settings → Secrets and variables → Actions → Repository secrets",repositoryConfigHelp:"将为 {{repository}} 添加 PR 自动评审配置",repositoryReviewHelp:"将使用 GitHub App 校验 {{repository}} 的 Pull Request",secretPair:"{{accessKey}}、{{secretKey}}(必填)",sessionToken:"{{sessionToken}}(使用临时凭据时必填)",requiredSecret:"{{name}}(必填)",temporaryCredentialRequired:"(使用临时凭据时必填)",requiredSuffix:"(必填)",submitting:"提交 PR 中…",validation:{required:"此项不能为空",repository:"请输入 owner/repository 或完整 GitHub 仓库 URL",baseBranch:"目标分支格式不正确",projectPath:"请输入仓库内的相对目录",runtimeId:"运行时 ID 格式不正确",sandboxToolId:"沙箱工具 ID 格式不正确",modelName:"模型名称格式不正确",modelBaseUrlSafe:"请输入不含凭据、查询参数或锚点的 HTTPS 地址",modelBaseUrl:"请输入有效的 HTTPS 地址",runtimeName:{required:"Runtime 名称为必填项",characters:"Runtime 名称只能包含英文字母、数字、下划线和连字符",length:"Runtime 名称长度须为 4-64 个字符"}}},Ave={title:"配置 Coding Agents",description:"把随 Studio 提供的 AgentKit Skills 全局安装到本地编码客户端。",retry:"重试",clients:{ariaLabel:"选择 Coding Agent",title:"本机客户端",detectAgain:"重新检测",detecting:"正在检测本机客户端…",detected:"已检测到客户端",available:"可用",unavailable:"未检测到"},skills:{ariaLabel:"选择内置 Skill",title:"内置 Skills",viewFiles:"查看文件",items:{"veadk-agent-development":{name:"VeADK Agent 开发",description:"使用 VeADK 开发和完善 Agent。"},"agentkit-cli":{name:"AgentKit CLI",description:"通过 AgentKit CLI 管理和部署 AgentKit 资源。"}}},global:{ariaLabel:"全局安装目录",title:"全局安装",description:"配置后可在本机其他项目中使用",empty:"选择客户端后显示对应安装目录。"},success:"已为 {{agentCount}} 个客户端配置 {{skillCount}} 个 Skill",selection:"已选择 {{agentCount}} 个客户端、{{skillCount}} 个 Skill",selectClient:"请先选择客户端",configuring:"正在配置…",configure:"配置",errors:{detect:"检测本机客户端失败",configure:"配置失败,请检查用户目录权限后重试"},preview:{description:"只读浏览随 Studio 提供的 Skill 文件",close:"关闭文件预览",loading:"正在读取文件…",error:"读取 Skill 文件失败",skillFiles:"{{name}} 文件",files:"文件",fileContent:"文件内容",notPreviewable:"此文件不是可预览的 UTF-8 文本。",noFiles:"没有可预览的文件。"}},Tve={noDescription:"暂无描述",unknownCreator:"未知创建者",optionMetadata:"{{creator}} | {{createdAt}}",selectAgent:"选择 MPA 智能体",chooseAgent:"请选择 MPA 智能体",search:"搜索名称、Runtime ID 或地域",noMatches:"没有匹配的 MPA 智能体",loading:"正在加载 MPA 智能体…",empty:"暂无可管理的 MPA 智能体,请先创建或部署一个 MPA 智能体。",unauthorized:"需要 Studio 管理员权限才能管理 MPA 消息渠道,请联系管理员。",loadFailed:"加载 MPA 智能体失败,请重试。",retry:"重试",refresh:"刷新列表",loadMore:"加载更多",moreAvailable:"还有更多智能体。搜索仅匹配已加载的结果,可继续加载。",chooseHint:"选择一个 MPA 智能体后,即可配置飞书、企业微信和钉钉。"},_ve={title:"飞书机器人",description:"创建一个由 AgentKit Runtime 驱动的飞书智能体",panel:"填写已发布飞书应用的凭据,Studio 将生成 basic 智能体、创建独立 Runtime,并启用飞书消息长连接。",agentName:"智能体名称",agentNameHelp:"将作为新 Runtime 中的根智能体名称",region:"部署地域",regionHelp:"Runtime 与构建产物将创建在该地域",regions:{"cn-beijing":"北京","cn-shanghai":"上海"},appId:"飞书 App ID",appIdHelp:"来自飞书开放平台的应用凭证",appSecret:"飞书 App Secret",appSecretPlaceholder:"请输入 App Secret",appSecretHelp:"仅写入新 Runtime 的环境变量",hideSecret:"隐藏 App Secret",showSecret:"显示 App Secret",hide:"隐藏",show:"显示",confirmCancel:"取消部署将停止任务并清理已创建的 Runtime,确定继续吗?",status:{preparing:"正在生成 basic 智能体",running:"正在创建 Runtime",cancelling:"正在取消部署",succeeded:"飞书机器人 Runtime 已创建",cancelled:"部署已取消",failed:"创建失败"},steps:{prepare:"生成智能体",build:"构建镜像",deploy:"创建 Runtime",publish:"发布服务"},openConsole:"打开 Runtime 控制台",credentials:{title:"凭据处理",description:"App Secret 仅用于本次部署,不会写入生成源码或浏览器存储。"},cancelDeployment:"取消部署",creating:"正在创建…",create:"创建飞书机器人 Runtime",validation:{appId:"请输入飞书 App ID",appSecret:"请输入飞书 App Secret",agentName:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"}},generatedAgent:{description:"一个通过飞书接收消息并提供帮助的智能助手。",instruction:"你是一个通过飞书为用户提供帮助的智能助手。准确理解用户问题,给出简洁、可靠的回答;信息不足时先提问澄清,不要臆造事实。"}},jve={title:pve,description:mve,search:gve,categoriesLabel:bve,categories:yve,resultsLabel:vve,open:xve,localOnly:wve,emptyTitle:kve,emptyDescription:Ove,backToAutomations:Sve,cards:Eve,github:Cve,codingAgents:Ave,mpaChannels:Tve,feishu:_ve},TVe=Object.freeze(Object.defineProperty({__proto__:null,backToAutomations:Sve,cards:Eve,categories:yve,categoriesLabel:bve,codingAgents:Ave,default:jve,description:mve,emptyDescription:Ove,emptyTitle:kve,feishu:_ve,github:Cve,localOnly:wve,mpaChannels:Tve,open:xve,resultsLabel:vve,search:gve,title:pve},Symbol.toStringTag,{value:"Module"})),Nve={"zh-CN":"简体中文","en-US":"English"},_Ve={languageNames:Nve},jVe=Object.freeze(Object.defineProperty({__proto__:null,default:_Ve,languageNames:Nve},Symbol.toStringTag,{value:"Module"})),Rve={selectedExcerptLabel:"选中片段",commentLabel:"批注",commentSeparator:":",successTitle:"已加入 Bad case 评测集",successDescription:"这条批注已关联当前问题和完整模型回复。",done:"完成",ariaLabel:"批注选中的模型回复",title:"添加批注",content:"批注内容",placeholder:"说明问题或期望的修改方式",retryError:"{{error}},请重试。",cancel:"取消",submit:"加入 Bad Case"},Ive={attachment:"附件",image:"图片",preview:"预览 {{name}}",uploading:"上传中",uploadFailed:"上传失败",remove:"移除 {{name}}",previewDialog:"{{name}}预览",download:"下载",close:"关闭",reading:"正在读取文档…",loadFailed:"文档加载失败:{{error}}"},Pve={errorTitle:"云端日志错误",copyError:"复制完整错误信息",retry:"重试",statuses:{live:"实时",connecting:"连接中",retrying:"重连中",idle:"未连接"},title:"实例日志",description:"当前对话请求所在的 VeFaaS 实例",close:"关闭实例日志",instanceId:"实例 ID",waitingInstance:"等待实例",request:"请求 {{id}}",ariaLabel:"VeFaaS 实例实时日志",notCapturedTitle:"尚未捕获到实例",notCapturedDescription:"发送一条消息后,这里会显示实际处理请求的实例和实时日志。",connectingTitle:"正在连接实例日志",connectingDescription:"正在通过 Studio BFF 建立安全日志流。",emptyTitle:"暂无日志",emptyDescription:"已连接实例,等待新的日志输出。",download:"下载日志",retention:"日志自动刷新,仅保留最近 {{count}} 行"},Dve={title:"调用链路观测",statuses:{loading:"加载中",ready:"",collecting:"采集中",disabled:"未开启",forbidden:"权限不足",error:"加载失败"},errors:{collecting:"调用链路仍在采集中,请稍候。",disabled:"该 Agent 未开启链路观测,请到控制台开启后重试。",forbidden:"当前账号无权读取 APMPlus 调用链路,请联系管理员补充只读权限。",error:"调用链路加载失败,请稍后重试。"},callCount:"{{count}} 个调用 · {{duration}} ms",close:"关闭",loading:"加载调用链路…",retryNow:"立即重试",reload:"重新加载",empty:"该会话暂无调用链路(可能尚未产生调用)。",attributes:"属性",selectCall:"选择左侧的一个调用查看详情"},Mve={exportNote:"上述会话由 AgentKit Studio 导出,仅供参考",imageFailed:"图片生成失败,请重试。",browserUnsupported:"浏览器无法生成会话图片,请重试。",copyUnsupported:"当前浏览器不支持复制图片,请下载后使用。",exportFailed:"导出失败,请重试。",title:"导出会话",description:"选择格式并下载截至当前回复的全部输入与输出。",close:"关闭",generatingContent:"正在生成导出内容…",retry:"重试生成",previewPage:"预览第 1 页,共 {{count}} 页",previewAlt:"会话导出内容第 1 页,共 {{count}} 页",format:"导出格式",generatingFormat:"正在生成 {{format}}…",copying:"正在复制…",copiedFirst:"已复制第一页",copied:"已复制",copyFirst:"复制第一页",copyImage:"复制图片",generating:"正在生成…",downloadArchive:"下载 PNG 压缩包({{count}} 页)",downloadFormat:"下载 {{format}}"},Lve={a2a:{connecting:"正在等待 Runtime 响应…",submitted:"任务排队中…",working:"任务执行中…"},unsupportedComponent:"不支持的组件:{{component}}",sandboxIdentity:"Codex Sandbox 执行标识",useSkill:"使用 {{name}} 技能",thinkingDone:"已完成工作思考",thinking:"工作思考中",reasoningDone:"已完成模型推理",reasoning:"模型推理中",justNow:"刚刚",sourceUnavailable:"暂时无法读取生成的源码,请稍后重试。",downloadStarted:"已开始下载",verifiedDelivery:"已验证交付物",generatedSource:"生成的 Agent 源码",entryPoint:"入口",fileCount:"文件数",size:"大小",validationTime:"验证时间",generationTime:"生成时间",checksPassed:"{{count}} 项检查通过",sourceReady:"源码已准备好,可部署",sourceGuidance:"源码已准备好,可查看、下载或部署;部署前请确认 Runtime 配置。",viewSource:"查看源码",preparing:"正在准备…",viewChanges:"查看本次变更",downloadSource:"下载源码",sourceNotReady:"源码尚未准备好",manualDeploy:"手动部署到 Runtime",deployAgent:"部署 Agent",beforeOptimization:"优化前",afterOptimization:"优化后",planStatuses:{pending:"待处理",in_progress:"进行中",completed:"已完成",failed:"未完成"},renderUi:"渲染 UI",truncated:"…(已截断)",agentAdjusting:"Agent 正在调整",sandboxDetails:"Codex Sandbox 详细输出",waitingCodex:"正在等待 Codex 输出",arguments:"参数",result:"返回",artifacts:"产物",downloadNamed:"下载 {{name}}",powerpoint:"PowerPoint 演示文稿",preview:"预览",download:"下载",previewDialog:"{{name}} 预览",closePreview:"关闭预览",slidePreview:"{{name}} 幻灯片预览",mcpToolset:"MCP 工具集",authorized:"已授权 · {{tool}}",authorizationRequired:"{{tool}} 需要授权",oauthDescription:"工具集 {{tool}} 使用 OAuth 保护,需登录授权后方可调用。",oauthProvider:"将跳转至 {{provider}} 完成登录。",oauthContinue:"授权完成后对话自动继续。",waitingAuthorization:"等待授权…",authorize:"去授权",missingAuthorizationUrl:"未在事件中找到授权地址。",tools:{web_search:{running:"正在进行网络搜索",done:"已完成网络搜索"},link_reader:{running:"正在读取网页",done:"已完成网页读取"},run_code:{running:"正在 AgentKit 沙箱中执行代码",done:"已在 AgentKit 沙箱中完成代码执行"},list_envs:{running:"正在查看可用环境",done:"已读取可用环境"},get_env_manifest:{running:"正在读取环境 Manifest",done:"已读取环境 Manifest"},execute_in_sandbox:{running:"正在环境中执行命令",done:"已在环境中完成命令执行"},delegate_to_codex_sandbox:{running:"Codex Sandbox 正在执行",done:"Codex Sandbox 已完成",failed:"Codex Sandbox 执行失败"},image_generate:{running:"正在生成图片",done:"已完成图片生成"},video_generate:{running:"正在生成视频",done:"已完成视频生成"},ppt_generate:{running:"正在生成 PPT",done:"已完成 PPT 生成"},load_memory:{running:"正在检索长期记忆",done:"已完成记忆检索"},load_knowledgebase:{running:"正在检索知识库",done:"已完成知识库检索"},load_skill:{running:"正在加载技能",done:"已加载技能"},collect_resources:{running:"正在收集可用资源",done:"已完成资源收集",failed:"资源收集失败"},create_agents:{running:"正在创建并运行 Agent",done:"已完成 Agent 创建",failed:"Agent 创建失败"}},createAgents:{categories:{skill_hub:"Skill Hub",skill_space:"AgentKit 技能中心",knowledge_base:"知识库",tool:"工具"},agentTypes:{llm:"LLM 智能体",sequential:"顺序智能体",parallel:"并行智能体",loop:"循环智能体",workflow:"工作流"},skill:"技能",subAgents:"子智能体",builtinTool:"内置工具",skillCenter:"AgentKit 技能中心",selfAuthoredTools:"自写工具",dependencies:"依赖:{{items}}",fullCode:"{{name}} 完整代码",itemCount:"{{label}} {{count}} 项",collectionAria:"召回资源信息",retrieving:"正在检索资源",retrievalFailed:"资源检索未完成",checkConfig:"请检查资源服务配置后重试。",notSearched:"未检索",notConfigured:"未配置",resourceList:"{{label}}资源列表",searchKeywords:"检索关键词",skillHubSkipped:"未提供检索关键词,本次未检索 Skill Hub。",sourceSkipped:"未配置 {{label}},本次未检索该来源。",noResources:"本次检索未返回该类别的资源。",resultAria:"创建 Agent 结果",creationFailed:"Agent 创建未完成",agentResources:"{{name}} 具备的资源",knowledgeBase:"知识库",toolsLabel:"工具",creating:"正在创建 Agent",noAgents:"没有可展示的 Agent",noAgentResult:"工具返回中未包含 Agent 配置或执行结果。",sourceLabels:{tool:"工具",knowledge:"AgentKit 知识库",skillCenter:"AgentKit 技能中心",unknown:"未知来源"},unnamedResource:"未命名资源",unnamedAgent:"未命名 Agent"},branchCompare:{ariaLabel:"分支对比",selectDirection:"选择方向",continue:"继续这个方向"},codexProgress:{planTitle:"Codex 执行计划",fallback:{fileChange:"修改文件",approval:"等待操作批准",status:"Codex 状态",command:"运行命令"},planSummary:"已完成 {{completed}}/{{total}} 项",command:{running:"正在执行命令",completed:"命令执行完成",failed:"命令执行失败"},projectFiles:"{{count}} 个项目文件",projectFile:"项目文件",fileChange:{running:"正在更新{{subject}}",completed:"已更新{{subject}}",failed:"更新{{subject}}失败"},externalTool:"外部工具",mcp:{running:"正在调用工具 {{tool}}",completed:"已调用工具 {{tool}}",failed:"工具 {{tool}} 调用未完成"},collaboration:{spawn_agent:{running:"正在启动子任务",completed:"子任务已启动",failed:"子任务启动失败"},send_input:{running:"正在向子任务发送信息",completed:"已向子任务发送信息",failed:"向子任务发送信息失败"},wait:{running:"正在等待子任务",completed:"子任务等待已结束",failed:"等待子任务失败"},close_agent:{running:"正在结束子任务",completed:"子任务已结束",failed:"子任务结束失败"},default:{running:"正在协调子任务",completed:"子任务协作已完成",failed:"子任务协作失败"}},webSearch:{running:"正在进行网络搜索",completed:"已完成网络搜索",failed:"网络搜索未完成"},errorDetail:"Codex 执行未完成。",errorTitle:"Codex 执行遇到错误"},toolActivity:{status:{queued:"等待执行",running:"正在执行",completed:"执行成功",failed:"执行失败"},goal:{queued:"等待创建目标",running:"正在创建目标",completed:"已创建目标",failed:"创建目标失败"},command:{queued:"等待运行命令",running:"正在运行命令",completed:"已运行命令",failed:"命令执行失败"},read:{queued:"等待读取",running:"正在读取",completed:"已读取内容",failed:"读取失败"},search:{queued:"等待搜索",running:"正在搜索",completed:"已完成搜索",failed:"搜索失败"},"file-change":{queued:"等待修改文件",running:"正在修改文件",completed:"已修改文件",failed:"文件修改失败"},mcp:{queued:"等待调用外部工具",running:"正在调用外部工具",completed:"已调用外部工具",failed:"外部工具调用失败"},authorization:{queued:"等待授权",running:"等待授权",completed:"授权已完成",failed:"授权失败"},generic:{queued:"等待调用工具",running:"正在调用工具",completed:"已调用工具",failed:"工具调用失败",named:{queued:"等待调用 {{tool}}",running:"正在调用 {{tool}}",completed:"已调用 {{tool}}",failed:"{{tool}} 调用失败"}},exitCode:"退出码 {{code}}",omittedLines:"… 省略 {{count}} 行 …",omittedCharacters:"… 省略 {{count}} 个字符 …",rawData:"查看原始数据",callId:"调用 ID",copyCallId:"复制调用 ID",copy:"复制",copied:"已复制",copyFailed:"复制失败,请重试。",explored_one:"已探索 1 项",explored_other:"已探索 {{count}} 项"}},$ve={segments:{system:"系统与工具",input:"输入与历史",output:"输出与思考",remaining:"剩余"},modelUnavailable:"模型信息未提供",promptWithSystem:"提示词(含系统)",systemUnknown:"系统与工具占用未知",systemApprox:"系统与工具约 {{count}} Token",ariaKnown:"上下文已使用 {{percentage}}%,{{system}},{{inputLabel}} {{input}} Token,输出与思考 {{output}} Token,剩余 {{remaining}} Token",ariaUnknown:"{{model}},上下文窗口未知,会话累计使用 {{count}} Token",composition:"上下文构成",percentageUsed:"{{percentage}}% 已用",gridAria:"100 格上下文构成图,每格代表上下文窗口的百分之一",estimated:"估算",unknown:"未知",summaryPercentage:"{{used}} 已用,剩余 {{remaining}}",summaryTokens:"{{used}} 已用,剩余 {{remaining}},总计 {{total}}",overflow:"已超出上下文 {{count}} Token",title:"上下文用量",category:"类型",currentTurn:"当前轮",sessionTotal:"会话累计",details:{input:"输入",output:"输出",reasoning:"推理",cache:"缓存命中",total:"总计"},unknownModel:"暂未收录该模型的上下文窗口",unknownRuntime:"当前 Runtime 未提供模型信息"},Fve={title:"添加 AgentKit 智能体",noAgents:"连接成功,但该地址未发现任何 Agent(/list-apps 为空)。",connectionFailed:"连接失败:{{error}}。请检查 URL、API Key,以及该网关是否允许跨域。",description:"填入 AgentKit 部署的访问地址与 API Key,将通过 ADK 协议连接,连接成功后其 Agent 会出现在左上角的下拉中。",url:"访问地址 URL",apiKeyHint:"以 Authorization: Bearer 方式连接",displayName:"显示名称(可选)",displayNameHint:"默认取 URL 的主机名",cancel:"取消",connecting:"连接中…",connect:"连接并添加"},Bve={placeholder:"输入消息…",inputAria:"输入消息",generating:"正在生成",send:"发送",model:"模型"},Uve={ariaLabel:"本轮调用上下文",removeSkill:"移除技能 {{name}}",removeAgent:"移除 Agent {{name}}"},Qve={cardAria:"{{label}} 图表",viewAria:"{{label}} 显示方式",preview:"预览",code:"代码",invalidEcharts:"ECharts 配置不是有效且安全的数据对象,请切换到代码检查内容。",renderFailed:"图表暂时无法渲染,请切换到代码检查内容。",echartsAria:"ECharts 图表预览",rendering:"正在渲染图表…",mermaidFailed:"图表暂时无法渲染,请切换到代码查看 Mermaid 内容。",mermaidAria:"Mermaid 图表预览"},zve={downloadFile:"下载文件",downloading:"下载中…",downloadFailed:"下载失败。请确认 Sandbox 和文件仍可用,然后点击重试。",playVideo:"点击播放视频:{{name}}",enlargeImage:"放大预览:{{name}}",image:"图片",enlargeVideo:"点击放大视频",videoPreview:"视频预览",downloadVideo:"下载视频",close:"关闭"},Vve={annotation:Rve,media:Ive,runtimeLogs:Pve,trace:Dve,share:Mve,blocks:Lve,tokenUsage:$ve,addAgentKit:Fve,composer:Bve,invocation:Uve,visualization:Qve,markdown:zve},NVe=Object.freeze(Object.defineProperty({__proto__:null,addAgentKit:Fve,annotation:Rve,blocks:Lve,composer:Bve,default:Vve,invocation:Uve,markdown:zve,media:Ive,runtimeLogs:Pve,share:Mve,tokenUsage:$ve,trace:Dve,visualization:Qve},Symbol.toStringTag,{value:"Module"})),Hve={back:"返回",cancel:"取消",deploy:"部署",delete:"删除",loading:"读取中…",next:"下一步",notSupported:"暂不支持",previous:"上一步",required:"必填",retry:"重试",actions:"操作",value:"值",disabled:"关闭",enabled:"已开启",none:"无",close:"关闭",name:"名称",description:"描述",send:"发送"},qve={heading:"VeADK Agent 结构配置",importHint:"可在「创建 Agent」页通过「导入 YAML」重新载入。"},Wve={agentName:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"},runtimeName:{required:"Runtime 名称为必填项",characters:"Runtime 名称只能包含英文字母、数字、下划线和连字符",length:"Runtime 名称长度须为 4-64 个字符"}},Kve={description:"一个基于 VeADK 构建的智能助手,理解用户意图并调用合适的工具完成任务。",instruction:`你是一个专业、可靠的智能助手。 +{{response}}`,emptyCloudResponse:"(响应正文为空)"},lye={loadFailed:"读取会话模式能力失败(HTTP {{status}})",invalidResponse:"会话模式能力响应格式错误"},cye={nonJson:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}},{{contentType}}){{detail}}"},uye={busy:"工作区正在处理较多请求,请稍后重试",notFound:"工作区不存在",duplicates:"检测到多个个人工作区会话,请联系管理员处理",timeout:"工作区恢复超时,项目仍保留,请重试",unavailable:"工作区暂时无法恢复,原项目仍保留,请重试",persistence:"当前 Sandbox 未启用持久化快照,请检查工作区配置",startup:"个人工作区启动失败,请检查 Sandbox 状态",exists:"项目名称已存在,请从项目列表打开",directory:"项目目录不存在",configuration:"请先配置工作区 Sandbox 镜像",state:"暂时无法确认工作区状态,请重试",list:"恢复工作区或读取项目列表失败,请重试",create:"项目初始化失败,请确认镜像可用后重试",open:"恢复工作区或打开项目失败,请重试",connection:"工作区暂时无法连接,请重试",invalidWorkspaceUrl:"工作区返回了无效的访问地址",operation:"项目操作失败,请重试",invalidProjectUrl:"项目访问地址无效",listFallback:"读取项目列表失败",connectionState:"暂时无法连接工作区,请重试"},dye={reporting:"正在补齐交付信息",packaging:"正在整理产物",savingVersion:"正在保存版本",finishing:"正在完成请求",submitResult:"提交构建结果",requestFailed:"任务请求失败,请重试。",invalidResponse:"任务状态响应无效。",eventGap:"正在补齐任务输出。",reconnecting:"连接暂时中断,正在重连。已有输出已保留。",input:{pending:"等待送达",sending:"正在确认送达",delivered:"已送达",withdrawn:"已停止发送"},plan:"执行计划",diff:"文件变更",preparing:"正在准备任务",preparingEnvironment:"正在准备开发环境…",connectingEnvironment:"正在连接开发环境…",processing:"正在处理请求",thinking:"正在思考",read:"读取文件 · {{target}}",listFiles:"查看目录 · {{target}}",search:"搜索 · {{target}}",command:"执行命令 · {{target}}",editFiles:"修改文件 · {{target}}",webSearch:"搜索网页 · {{target}}",processSummary:"已处理 {{count}} 项",duration:"{{seconds}} 秒",durationUnits:{milliseconds:"{{value}} 毫秒",hours:"{{value}} 小时",minutes:"{{value}} 分",seconds:"{{value}} 秒"},failedTools:"{{count}} 项执行失败",toolFailed:"执行失败",toolCalls:"{{count}} 次工具调用",turnDuration:"本轮耗时 {{duration}}",toolDuration:"工具累计耗时 {{duration}}",toolDurationPartial:"已记录工具耗时 {{duration}}",toolDurationHelp:"各工具执行耗时之和;并行调用可能使累计耗时超过本轮耗时。",turnStatus:{completed:"已完成",failed:"未完成",interrupted:"已中断",cancelled:"已中断",unavailable:"任务已结束"},notReported:"未上报",partial:"已记录",partialHelp:"本轮记录可能不完整。",tokenDetails:"本轮 Token 用量",model:"本轮模型",totalTokens:"总量",inputTokens:"输入",cachedInputTokens:"缓存命中输入",uncachedInputTokens:"未命中输入",cacheWriteInputTokens:"缓存写入",outputTokens:"输出",reasoningOutputTokens:"推理输出",cacheHitRate:"输入缓存命中率",tokenHelp:"缓存命中属于输入,推理输出属于输出,不重复计入总量。未命中输入 = 输入 − 缓存命中。"},jU={common:Qbe,agentkitCli:zbe,cloudRegion:Vbe,connections:Hbe,feishuBot:qbe,requestError:Wbe,runSse:Kbe,runtimeLogs:Gbe,search:Xbe,skills:Ybe,sse:Zbe,identity:Jbe,github:eye,video:tye,websiteIntegration:nye,knowledge:iye,intelligentDevelopment:rye,migrations:sye,sandbox:aye,client:oye,newChatCapabilities:lye,jsonResponse:cye,workspaceProjects:uye,developmentRuns:dye},EVe=Object.freeze(Object.defineProperty({__proto__:null,agentkitCli:zbe,client:oye,cloudRegion:Vbe,common:Qbe,connections:Hbe,default:jU,developmentRuns:dye,feishuBot:qbe,github:eye,identity:Jbe,intelligentDevelopment:rye,jsonResponse:cye,knowledge:iye,migrations:sye,newChatCapabilities:lye,requestError:Wbe,runSse:Kbe,runtimeLogs:Gbe,sandbox:aye,search:Xbe,skills:Ybe,sse:Zbe,video:tye,websiteIntegration:nye,workspaceProjects:uye},Symbol.toStringTag,{value:"Module"})),fye="智能体审核",hye="申请企业内全员使用,审批后生效",pye="关闭",mye="刷新",gye="状态",bye="申请人",yye="申请时间",vye="当前版本",xye="模型",wye="退回人",kye="通过人",Oye="审批时间",Sye="智能体描述",Eye="申请说明",Cye="退回理由",Aye="审批意见",Tye="退回理由(必填)",_ye="提交后内容已变化,请退回并重新申请",jye="撤回后可以修改 Agent,需要公开时重新申请",Nye="取消公开后其他用户将无法继续使用,确定取消公开吗?",Rye="取消",Iye="确认",Pye="正在保存",Dye="取消公开",Mye="撤回申请",Lye="通过",$ye="直接公开",Fye="申请公开",Bye="全员可见",Uye={pending:"待审核",approved:"已通过",returned:"已退回",withdrawn:"已撤回"},Qye="搜索智能体或申请人",zye="地域",Vye="全部状态",Hye="智能体",qye="操作",Wye="查看并审批",Kye="申请详情",Gye="没有符合条件的申请",Xye="暂无智能体审核申请",Yye="{{count}} / {{limit}} 字",CVe={title:fye,dialogDescription:hye,close:pye,refresh:mye,statusTitle:gye,submitter:bye,submittedAt:yye,version:vye,model:xye,returnedBy:wye,approvedBy:kye,reviewedAt:Oye,description:Sye,message:Eye,reason:Cye,comment:Aye,reasonRequired:Tye,contentChanged:_ye,withdrawConfirm:jye,unpublishConfirm:Nye,cancel:Rye,confirm:Iye,saving:Pye,unpublish:Dye,withdraw:Mye,return:"退回",approve:Lye,publish:$ye,submit:Fye,private:"仅自己可见",enterprise:Bye,status:Uye,search:Qye,region:zye,all:Vye,agent:Hye,actions:qye,review:Wye,details:Kye,noMatches:Gye,empty:Xye,textCount:Yye},AVe=Object.freeze(Object.defineProperty({__proto__:null,actions:qye,agent:Hye,all:Vye,approve:Lye,approvedBy:kye,cancel:Rye,close:pye,comment:Aye,confirm:Iye,contentChanged:_ye,default:CVe,description:Sye,details:Kye,dialogDescription:hye,empty:Xye,enterprise:Bye,message:Eye,model:xye,noMatches:Gye,publish:$ye,reason:Cye,reasonRequired:Tye,refresh:mye,region:zye,returnedBy:wye,review:Wye,reviewedAt:Oye,saving:Pye,search:Qye,status:Uye,statusTitle:gye,submit:Fye,submittedAt:yye,submitter:bye,textCount:Yye,title:fye,unpublish:Dye,unpublishConfirm:Nye,version:vye,withdraw:Mye,withdrawConfirm:jye},Symbol.toStringTag,{value:"Module"})),Zye={backToEvaluationCase:"返回评测案例",cancel:"取消",copied:"已复制",copy:"复制",exportConversation:"导出会话",retry:"重试"},Jye={title:"您想以哪种方式添加 Agent 来运行?",subtitle:"选择最适合你的方式,下一步即可开始",quickCreate:{title:"从 0 快速创建",description:"用智能、自定义、模板或工作流的方式从零创建一个 Agent。"},intelligent:{title:"智能模式",description:"描述目标,按你的意图构建、调试并验证 Agent。"},package:{title:"从代码包添加和部署",description:"上传 Agent 项目压缩包,查看代码并直接部署到 AgentKit Runtime。"},migrate:{title:"从存量迁移",description:"从您的 LangChain、Dify 等存量项目迁移至 AgentKit Runtime。"}},eve={subject:{file:"文件修改",command:"命令执行"},decision:{accept:"已允许本次{{subject}}",acceptForSession:"已在本会话中允许{{subject}}",decline:"已拒绝{{subject}}",cancel:"已取消{{subject}}审批"},details:{command:"命令",grantRoot:"授权路径",cwd:"执行目录"}},tve={noDescription:"暂无描述",region:"地域",unknownAgent:"未知 Agent"},nve={agentTransfer:"智能体移交",annotationHint:"模型回复;选中文字后可添加批注",continueBranch:"继续“{{branch}}”这个方向",emptyResponse:"本次没有返回可显示的内容。",subagentDescription:"正在执行主 Agent 移交的任务。"},ive={title:"需要配置 {{provider}} AK/SK",prefix:"智能体工作台需要 {{provider}} 凭据才能使用。请在运行环境中设置",and:"与",suffix:"后重试。"},rve={buildRunning:{title:"当前构建仍在进行",description:"离开将停止本轮构建;当前会话仍会保留,可稍后从历史会话重新进入。",confirm:"停止并离开"},deleteThread:{title:"删除 Codex 历史会话",description:"将删除“{{name}}”,并从历史会话中移除。",confirm:"确认删除"},returnToCreate:{title:"返回创建首页?",description:"返回后当前填写的内容将会丢失,确定要返回吗?",confirm:"确定返回"}},sve={additionalAgentDeleteFailures:";另有 {{count}} 个失败",agentDeleteFailures:"{{count}} 个 Agent 删除失败:{{failures}}{{suffix}}",agentToolsMissing:"当前 Agent 缺少任务工具:{{tools}}",buildStopUnconfirmed:"已离开开发环境,但未能确认本轮构建已停止。任务可能仍在运行,请稍后从历史会话检查状态。",builtinAgentSendFailed:"内置智能体发送失败:{{message}}",bytePlusEvaluationUnsupported:"BytePlus 暂不支持 AgentKit 评测集",clipboardUnsupported:"当前浏览器不支持写入剪贴板。",cloudCodexEmptyReply:"云端 Codex 已结束,但没有生成回复,请重新发送任务。",cloudCodexSessionMissing:"云端 Codex Session 暂未出现在列表中,请稍后重试。",deploymentRuntimeIdMissing:"部署完成,但未返回 Runtime ID。",environmentExpired:"所选环境已失效,请刷新后重新选择。",environmentsLoadFailed:"读取环境失败",evaluationCaseSessionMissing:"这条案例缺少会话定位信息,无法跳转。",evaluationUnsupportedForReply:"当前回复暂不支持加入评测集",firstFrameRequired:"首尾帧生成需要先添加首帧图片。",incompletePromptOptimization:"提示词优化结果不完整,请重新优化后再试。",intelligentCapabilityCheckFailed:"智能开发能力检查失败(HTTP {{status}})",intelligentSessionCreateFailed:"智能开发会话创建失败",invalidIntelligentCapability:"智能开发模型能力格式错误。",localBffToolsNotConfigured:"本地 Studio BFF 没有配置工具。",localToolsLoadFailed:"读取本地工具失败",loginPopupBlocked:"登录窗口被浏览器拦截,请允许弹出窗口后重试。",loginPopupClosed:"登录窗口已关闭,请重新登录以继续当前操作。",mediaTooLarge:"{{fileName}} 超出当前平台允许的素材大小。",mountEnvironmentFailed:"挂载环境失败",noConnectedSandbox:"当前没有已连接的 Sandbox。",noCreateAgentPermission:"当前账号没有添加 Agent 的权限。",noManageAgentPermission:"当前账号没有管理 Agent 的权限。",noOptimizationBaseline:"当前版本没有可对比的优化前版本。",oauthUrlMissing:"事件中没有授权地址。",onlyCloudAgentUpdatable:"仅支持更新已部署的云端智能体。",optimizationVersionMissing:"无法找到本次优化对应的项目版本,可能已被删除。",persistentStorageNotConfigured:"管理员未配置持久化存储",readDraftFailed:"无法读取本机草稿,请稍后重试。",runtimeAgentNameMissing:"Runtime 缺少智能体名称,无法更新。",runtimeBffToolsDisabled:"当前 Runtime Agent 未开启 BFF 工具能力。",runtimeDeploymentConfigUnavailable:"该 Runtime 的原发布配置不可恢复,无法安全更新。",runtimeMissingForConnection:"缺少 Runtime 信息,无法连接智能体。",runtimeRegionMissingForDelete:"Runtime 缺少地域信息,无法删除",runtimeRegionMissingForUpdate:"Runtime 缺少地域信息,无法更新。",runtimeUpdateUnsupported:"当前 Runtime 不支持原地更新。",sandboxRuntimeUnavailable:"当前 Agent 没有可用的 Sandbox Runtime。",sandboxToolsUnavailable:"当前 Studio BFF 未提供 Sandbox 执行工具。",saveDraftLocationRejected:"浏览器拒绝保存当前草稿位置,请检查站点存储权限后重试。",saveDraftRejected:"浏览器拒绝保存草稿,请稍后重试。",selectSkillToOptimize:"请先选择需要优化的 Skill。",sessionMissingForMount:"当前会话不存在,无法挂载环境。",sessionNotReady:"会话尚未就绪。",sessionUnavailable:"当前会话不可用,请关闭后重试。",sourceNotReady:"该源码尚未准备好,请返回对话继续处理。",textVideoRejectsReferences:"文生视频不使用参考素材,请先移除已添加的图片或视频。",videoEditRequiresVideo:"视频编辑需要先添加待编辑视频。",videoExtendRequiresVideo:"视频续写需要先添加基础视频。",videoGenerationFailed:"视频生成失败,请稍后重试。",videoModeUnsupported:"当前平台暂不支持所选视频任务模式。",videoPreviewMissing:"视频任务已完成,但服务端未返回预览地址。",videoReferenceRequired:"参考素材生视频需要至少添加一项参考图片或参考视频。"},ave={like:"赞",removeLike:"取消点赞",dislike:"踩",removeDislike:"取消点踩",reportIssue:"问题反馈",traceFlameGraph:"Tracing 火焰图"},ove={0:"今天想做点什么?",1:"有什么可以帮你的?",2:"需要我帮你查点什么吗?",3:"有问题尽管问我",4:"嗨,我们开始吧",5:"开始一段新对话吧",6:"今天想先解决哪件事?",7:"把你的想法告诉我吧",8:"我们从哪里开始?",9:"有什么任务交给我?",10:"准备好一起推进了吗?",11:"说说你现在最关心的问题",12:"今天也一起把事情做好",13:"我在,随时可以开始",intelligentDevelopment:"让灵感自由生长"},lve={agentCapabilities:"正在检查 Agent 能力…",session:"加载会话…"},cve={cancelled:"授权已取消。",pasteCallbackUrl:"授权完成后,请粘贴回调页面(浏览器地址栏)的完整 URL:",popupBlocked:"弹窗被拦截,请允许弹窗后重试。",unsupportedUrl:"授权链接不是 http/https 地址,已阻止打开。"},uve={volcengine:"火山引擎"},dve={checkingPersistence:"正在检查持久化能力…",exitDevelopment:"退出开发环境",fileUploaded:"已上传文件到 Sandbox",filesUploaded:"已上传 {{count}} 个文件到 Sandbox",intelligentDevelopment:"智能开发",mode:{readOnly:"只读",workspaceWrite:"工作区写入",fullAccess:"完全访问"},approvalPolicy:{untrusted:"仅不可信命令",onRequest:"按需审批",never:"不审批"},reviewer:{user:"由我审批",autoReview:"自动审查"},labels:{approvalPolicy:"审批策略",file:"文件",fileNumber:"文件 {{number}}",mode:"沙箱模式",networkAccess:"网络访问",reviewer:"审批方式",workingDirectory:"工作目录"},network:{allowed:"允许",disabled:"关闭"},permissionsUpdated:"已更新当前 Sandbox Session 的 Codex 权限",persistenceUnknown:"暂时无法确认持久化能力",stoppedReady:"已停止,可继续输入",uploadedFilesPrompt:"以下文件已上传到当前 Sandbox 工作空间,请在任务中使用:",workspaceUpdated:"已更新工作空间"},fve={addAgent:"添加智能体",addFromPackage:"从代码包添加",agent:"智能体",automations:"自动化",createAgent:"创建智能体",createSkill:"创建技能",cronJobs:"定时任务",issueFeedback:"问题反馈",library:"资源库",migrateAgent:"迁移智能体",newConversation:"新会话",optimizeSkill:"优化 {{name}}",search:"搜索",skill:"技能",skillLibrary:"技能库",systemInfo:"系统信息",updateAgent:"更新 {{name}}",codeProjects:"代码项目",reviewCenter:"审核中心"},hve={title:"从工作区新建",description:"创建和管理代码项目,在 VS Code 中编写和调试"},pve={actions:Zye,addAgent:Jye,approval:eve,common:tve,conversation:nve,credentials:ive,dialogs:rve,errors:sve,feedback:ave,greetings:ove,loading:lve,oauth:cve,providers:uve,sandbox:dve,titles:fve,workspaceProjectEntry:hve},TVe=Object.freeze(Object.defineProperty({__proto__:null,actions:Zye,addAgent:Jye,approval:eve,common:tve,conversation:nve,credentials:ive,default:pve,dialogs:rve,errors:sve,feedback:ave,greetings:ove,loading:lve,oauth:cve,providers:uve,sandbox:dve,titles:fve,workspaceProjectEntry:hve},Symbol.toStringTag,{value:"Module"})),mve="自动化",gve="连接研发工具,为智能体扩展自动化工作流",bve="搜索自动化",yve="自动化分类",vve={development:"研发",channels:"消息渠道"},xve="{{category}}自动化列表",wve="打开{{name}}",kve="仅本地部署可用",Ove="没有匹配的自动化",Sve="请尝试搜索其他名称",Eve="返回自动化列表",Cve={"coding-agents":{name:"配置 Coding Agents",badge:"本地",description:"将 VeADK 和 AgentKit 内置 Skills 全局配置到 Trae、Claude Code 或 Codex。"},template:{name:"模板项目导入",description:"在您的仓库中创建一个可持续交付到 AgentKit Runtime 的最简智能体",title:"模板项目导入",subtitle:"把可直接启动 Studio 的 basic Agent 和持续交付配置加入仓库",panel:"提交后将创建一个 PR,同时导入 basic 项目和 AgentKit Runtime 发布工作流。",submitLabel:"导入模板并提交 PR",regionHelp:"必须与目标 Runtime 所在地域一致",pullRequest:{title:"feat: 导入 AgentKit basic 模板",description:"导入带有 AgentKit Studio App Server 的 basic Agent 项目,并添加持续发布到 AgentKit Runtime 的工作流。合并前请配置 {{provider}} Secrets。"},fields:{repository:{label:"GitHub 仓库",placeholder:"owner/repository",help:"支持 owner/repository 或完整 github.com URL"},baseBranch:{label:"目标分支",placeholder:"main",help:"留空时使用 main,PR 将以此分支为 base"},projectPath:{label:"Agent 项目目录",placeholder:"agentkit-basic-agent",help:"将在此目录新增 basic 项目;app.py 挂载完整 Studio App Server,并作为服务入口启动"},runtimeName:{label:"Runtime 名称",placeholder:"support-agent",help:"用于 AgentKit 发布配置"},runtimeId:{label:"运行时 ID",placeholder:"rt-xxxxxxxx",help:"持续更新的目标 AgentKit Runtime"}}},delivery:{name:"AgentKit Runtime 持续交付",description:"为您的仓库添加持续交付到 AgentKit Runtime 的自动化工作流。",title:"AgentKit Runtime 持续交付",subtitle:"用 Pull Request 把持续发布配置安全地加入代码仓库",panel:"提交后将在目标仓库创建发布分支,并发起包含 GitHub Actions 工作流的 PR。",submitLabel:"确定并提交 PR",regionHelp:"必须与目标 Runtime 所在地域一致",pullRequest:{title:"feat: 持续发布到 AgentKit Runtime",description:"新增 GitHub Actions 工作流,在目标分支更新时持续发布到 AgentKit Runtime。合并前请配置工作流所需的 {{provider}} Secrets。"},fields:{repository:{label:"GitHub 仓库",placeholder:"owner/repository",help:"支持 owner/repository 或完整 github.com URL"},baseBranch:{label:"目标分支",placeholder:"main",help:"留空时使用 main,PR 将以此分支为 base"},projectPath:{label:"Agent 项目目录",placeholder:".",help:"留空时使用仓库根目录;目录内需包含挂载完整 Studio App Server 的 app.py"},runtimeName:{label:"Runtime 名称",placeholder:"support-agent",help:"用于 AgentKit 发布配置"},runtimeId:{label:"运行时 ID",placeholder:"rt-xxxxxxxx",help:"持续更新的目标 AgentKit Runtime"}}},review:{name:"GitHub PR 自动评审",description:"通过 GitHub App 在隔离 Sandbox 中评审 Pull Request。",title:"GitHub PR 自动评审",subtitle:"通过 GitHub App 触发 Sandbox 评审,并将结果发布到 Pull Request",panel:"请先将 GitHub App 安装到目标仓库,再为每个仓库启用自动评审。",submitLabel:"安装 GitHub App",regionHelp:"",pullRequest:{title:"chore: 配置 PR 自动评审",description:"新增 GitHub Actions 工作流,在隔离 Sandbox 中评审同仓库 PR,并将结果发布为 GitHub Review。合并前请配置工作流所需 Secrets。"},fields:{repository:{label:"GitHub 仓库",placeholder:"owner/repository",help:"支持 owner/repository 或完整 github.com URL"},baseBranch:{label:"目标分支",placeholder:"main",help:"留空时使用 main,PR 将以此分支为 base"},sandboxToolId:{label:"沙箱工具 ID",placeholder:"tool-xxxxxxxx",help:"用于运行每次评审的 AgentKit CodeEnv"},modelName:{label:"评审模型",placeholder:"review-model",help:"注入 Sandbox 的代码评审模型名称"},modelBaseUrl:{label:"模型 API 地址",placeholder:"https://ark.example.com/api/v3",help:"必须使用 OpenAI 兼容的 HTTPS 地址"}}},"gitlab-review":{name:"GitLab MR 自动评审",description:"通过 GitLab 集成在隔离 Sandbox 中评审 Merge Request。"},feishu:{name:"飞书机器人",badge:"Beta",description:"创建飞书机器人,并将消息直接接入 AgentKit Runtime。"},"mpa-channels":{name:"MPA智能体消息渠道",description:"为已有 MPA 智能体绑定飞书、企业微信和钉钉。"},"website-integration":{name:"网站集成",description:"将 AgentKit Runtime 以悬浮聊天窗口嵌入网站。"}},Ave={required:"必填",optional:"可选",region:"地域",tokenLabel:"GitHub Token",getToken:"获取 Token",createToken:"创建 GitHub Token",tokenPlaceholder:"需要仓库 Contents 与 Pull requests 写权限",tokenWorkflowPlaceholder:"需要 Contents、Pull requests、Workflows 写权限",hideToken:"隐藏 Token",showToken:"显示 Token",tokenHelp:"Token 仅用于本次提交,不会保存在浏览器或写入 PR",tokenWorkflowHelp:"此处 Token 用于创建配置 PR;它不是 Sandbox 的通用必填项,且不会保存在浏览器或写入 PR",prCreated:"PR #{{number}} 已创建",configPrCreated:"配置 PR #{{number}} 已创建",configPrNextStep:"合并后,后续同仓库 PR 会自动触发评审。",viewOnGitHub:"在 GitHub 查看",viewConfigPr:"查看配置 PR",secretsHeading:"合并 PR 前,请在仓库的 GitHub Actions Secrets 中配置:",secretsConfigHeading:"合并配置 PR 前,请在目标仓库添加运行时密钥",openSecrets:"打开 Secrets 设置",secretsPath:"路径:Settings → Secrets and variables → Actions → Repository secrets",repositoryConfigHelp:"将为 {{repository}} 添加 PR 自动评审配置",repositoryReviewHelp:"将使用 GitHub App 校验 {{repository}} 的 Pull Request",secretPair:"{{accessKey}}、{{secretKey}}(必填)",sessionToken:"{{sessionToken}}(使用临时凭据时必填)",requiredSecret:"{{name}}(必填)",temporaryCredentialRequired:"(使用临时凭据时必填)",requiredSuffix:"(必填)",submitting:"提交 PR 中…",validation:{required:"此项不能为空",repository:"请输入 owner/repository 或完整 GitHub 仓库 URL",baseBranch:"目标分支格式不正确",projectPath:"请输入仓库内的相对目录",runtimeId:"运行时 ID 格式不正确",sandboxToolId:"沙箱工具 ID 格式不正确",modelName:"模型名称格式不正确",modelBaseUrlSafe:"请输入不含凭据、查询参数或锚点的 HTTPS 地址",modelBaseUrl:"请输入有效的 HTTPS 地址",runtimeName:{required:"Runtime 名称为必填项",characters:"Runtime 名称只能包含英文字母、数字、下划线和连字符",length:"Runtime 名称长度须为 4-64 个字符"}}},Tve={title:"配置 Coding Agents",description:"把随 Studio 提供的 AgentKit Skills 全局安装到本地编码客户端。",retry:"重试",clients:{ariaLabel:"选择 Coding Agent",title:"本机客户端",detectAgain:"重新检测",detecting:"正在检测本机客户端…",detected:"已检测到客户端",available:"可用",unavailable:"未检测到"},skills:{ariaLabel:"选择内置 Skill",title:"内置 Skills",viewFiles:"查看文件",items:{"veadk-agent-development":{name:"VeADK Agent 开发",description:"使用 VeADK 开发和完善 Agent。"},"agentkit-cli":{name:"AgentKit CLI",description:"通过 AgentKit CLI 管理和部署 AgentKit 资源。"}}},global:{ariaLabel:"全局安装目录",title:"全局安装",description:"配置后可在本机其他项目中使用",empty:"选择客户端后显示对应安装目录。"},success:"已为 {{agentCount}} 个客户端配置 {{skillCount}} 个 Skill",selection:"已选择 {{agentCount}} 个客户端、{{skillCount}} 个 Skill",selectClient:"请先选择客户端",configuring:"正在配置…",configure:"配置",errors:{detect:"检测本机客户端失败",configure:"配置失败,请检查用户目录权限后重试"},preview:{description:"只读浏览随 Studio 提供的 Skill 文件",close:"关闭文件预览",loading:"正在读取文件…",error:"读取 Skill 文件失败",skillFiles:"{{name}} 文件",files:"文件",fileContent:"文件内容",notPreviewable:"此文件不是可预览的 UTF-8 文本。",noFiles:"没有可预览的文件。"}},_ve={noDescription:"暂无描述",unknownCreator:"未知创建者",optionMetadata:"{{creator}} | {{createdAt}}",selectAgent:"选择 MPA 智能体",chooseAgent:"请选择 MPA 智能体",search:"搜索名称、Runtime ID 或地域",noMatches:"没有匹配的 MPA 智能体",loading:"正在加载 MPA 智能体…",empty:"暂无可管理的 MPA 智能体,请先创建或部署一个 MPA 智能体。",unauthorized:"需要 Studio 管理员权限才能管理 MPA 消息渠道,请联系管理员。",loadFailed:"加载 MPA 智能体失败,请重试。",retry:"重试",refresh:"刷新列表",loadMore:"加载更多",moreAvailable:"还有更多智能体。搜索仅匹配已加载的结果,可继续加载。",chooseHint:"选择一个 MPA 智能体后,即可配置飞书、企业微信和钉钉。"},jve={title:"飞书机器人",description:"创建一个由 AgentKit Runtime 驱动的飞书智能体",panel:"填写已发布飞书应用的凭据,Studio 将生成 basic 智能体、创建独立 Runtime,并启用飞书消息长连接。",agentName:"智能体名称",agentNameHelp:"将作为新 Runtime 中的根智能体名称",region:"部署地域",regionHelp:"Runtime 与构建产物将创建在该地域",regions:{"cn-beijing":"北京","cn-shanghai":"上海"},appId:"飞书 App ID",appIdHelp:"来自飞书开放平台的应用凭证",appSecret:"飞书 App Secret",appSecretPlaceholder:"请输入 App Secret",appSecretHelp:"仅写入新 Runtime 的环境变量",hideSecret:"隐藏 App Secret",showSecret:"显示 App Secret",hide:"隐藏",show:"显示",confirmCancel:"取消部署将停止任务并清理已创建的 Runtime,确定继续吗?",status:{preparing:"正在生成 basic 智能体",running:"正在创建 Runtime",cancelling:"正在取消部署",succeeded:"飞书机器人 Runtime 已创建",cancelled:"部署已取消",failed:"创建失败"},steps:{prepare:"生成智能体",build:"构建镜像",deploy:"创建 Runtime",publish:"发布服务"},openConsole:"打开 Runtime 控制台",credentials:{title:"凭据处理",description:"App Secret 仅用于本次部署,不会写入生成源码或浏览器存储。"},cancelDeployment:"取消部署",creating:"正在创建…",create:"创建飞书机器人 Runtime",validation:{appId:"请输入飞书 App ID",appSecret:"请输入飞书 App Secret",agentName:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"}},generatedAgent:{description:"一个通过飞书接收消息并提供帮助的智能助手。",instruction:"你是一个通过飞书为用户提供帮助的智能助手。准确理解用户问题,给出简洁、可靠的回答;信息不足时先提问澄清,不要臆造事实。"}},Nve={title:mve,description:gve,search:bve,categoriesLabel:yve,categories:vve,resultsLabel:xve,open:wve,localOnly:kve,emptyTitle:Ove,emptyDescription:Sve,backToAutomations:Eve,cards:Cve,github:Ave,codingAgents:Tve,mpaChannels:_ve,feishu:jve},_Ve=Object.freeze(Object.defineProperty({__proto__:null,backToAutomations:Eve,cards:Cve,categories:vve,categoriesLabel:yve,codingAgents:Tve,default:Nve,description:gve,emptyDescription:Sve,emptyTitle:Ove,feishu:jve,github:Ave,localOnly:kve,mpaChannels:_ve,open:wve,resultsLabel:xve,search:bve,title:mve},Symbol.toStringTag,{value:"Module"})),Rve={"zh-CN":"简体中文","en-US":"English"},jVe={languageNames:Rve},NVe=Object.freeze(Object.defineProperty({__proto__:null,default:jVe,languageNames:Rve},Symbol.toStringTag,{value:"Module"})),Ive={selectedExcerptLabel:"选中片段",commentLabel:"批注",commentSeparator:":",successTitle:"已加入 Bad case 评测集",successDescription:"这条批注已关联当前问题和完整模型回复。",done:"完成",ariaLabel:"批注选中的模型回复",title:"添加批注",content:"批注内容",placeholder:"说明问题或期望的修改方式",retryError:"{{error}},请重试。",cancel:"取消",submit:"加入 Bad Case"},Pve={attachment:"附件",image:"图片",preview:"预览 {{name}}",uploading:"上传中",uploadFailed:"上传失败",remove:"移除 {{name}}",previewDialog:"{{name}}预览",download:"下载",close:"关闭",reading:"正在读取文档…",loadFailed:"文档加载失败:{{error}}"},Dve={errorTitle:"云端日志错误",copyError:"复制完整错误信息",retry:"重试",statuses:{live:"实时",connecting:"连接中",retrying:"重连中",idle:"未连接"},title:"实例日志",description:"当前对话请求所在的 VeFaaS 实例",close:"关闭实例日志",instanceId:"实例 ID",waitingInstance:"等待实例",request:"请求 {{id}}",ariaLabel:"VeFaaS 实例实时日志",notCapturedTitle:"尚未捕获到实例",notCapturedDescription:"发送一条消息后,这里会显示实际处理请求的实例和实时日志。",connectingTitle:"正在连接实例日志",connectingDescription:"正在通过 Studio BFF 建立安全日志流。",emptyTitle:"暂无日志",emptyDescription:"已连接实例,等待新的日志输出。",download:"下载日志",retention:"日志自动刷新,仅保留最近 {{count}} 行"},Mve={title:"调用链路观测",statuses:{loading:"加载中",ready:"",collecting:"采集中",disabled:"未开启",forbidden:"权限不足",error:"加载失败"},errors:{collecting:"调用链路仍在采集中,请稍候。",disabled:"该 Agent 未开启链路观测,请到控制台开启后重试。",forbidden:"当前账号无权读取 APMPlus 调用链路,请联系管理员补充只读权限。",error:"调用链路加载失败,请稍后重试。"},callCount:"{{count}} 个调用 · {{duration}} ms",close:"关闭",loading:"加载调用链路…",retryNow:"立即重试",reload:"重新加载",empty:"该会话暂无调用链路(可能尚未产生调用)。",attributes:"属性",selectCall:"选择左侧的一个调用查看详情"},Lve={exportNote:"上述会话由 AgentKit Studio 导出,仅供参考",imageFailed:"图片生成失败,请重试。",browserUnsupported:"浏览器无法生成会话图片,请重试。",copyUnsupported:"当前浏览器不支持复制图片,请下载后使用。",exportFailed:"导出失败,请重试。",title:"导出会话",description:"选择格式并下载截至当前回复的全部输入与输出。",close:"关闭",generatingContent:"正在生成导出内容…",retry:"重试生成",previewPage:"预览第 1 页,共 {{count}} 页",previewAlt:"会话导出内容第 1 页,共 {{count}} 页",format:"导出格式",generatingFormat:"正在生成 {{format}}…",copying:"正在复制…",copiedFirst:"已复制第一页",copied:"已复制",copyFirst:"复制第一页",copyImage:"复制图片",generating:"正在生成…",downloadArchive:"下载 PNG 压缩包({{count}} 页)",downloadFormat:"下载 {{format}}"},$ve={a2a:{connecting:"正在等待 Runtime 响应…",submitted:"任务排队中…",working:"任务执行中…"},unsupportedComponent:"不支持的组件:{{component}}",sandboxIdentity:"Codex Sandbox 执行标识",useSkill:"使用 {{name}} 技能",thinkingDone:"已完成工作思考",thinking:"工作思考中",reasoningDone:"已完成模型推理",reasoning:"模型推理中",justNow:"刚刚",sourceUnavailable:"暂时无法读取生成的源码,请稍后重试。",downloadStarted:"已开始下载",verifiedDelivery:"已验证交付物",generatedSource:"生成的 Agent 源码",entryPoint:"入口",fileCount:"文件数",size:"大小",validationTime:"验证时间",generationTime:"生成时间",checksPassed:"{{count}} 项检查通过",sourceReady:"源码已准备好,可部署",sourceGuidance:"源码已准备好,可查看、下载或部署;部署前请确认 Runtime 配置。",viewSource:"查看源码",preparing:"正在准备…",viewChanges:"查看本次变更",downloadSource:"下载源码",sourceNotReady:"源码尚未准备好",manualDeploy:"手动部署到 Runtime",deployAgent:"部署 Agent",beforeOptimization:"优化前",afterOptimization:"优化后",planStatuses:{pending:"待处理",in_progress:"进行中",completed:"已完成",failed:"未完成"},renderUi:"渲染 UI",truncated:"…(已截断)",agentAdjusting:"Agent 正在调整",sandboxDetails:"Codex Sandbox 详细输出",waitingCodex:"正在等待 Codex 输出",arguments:"参数",result:"返回",artifacts:"产物",downloadNamed:"下载 {{name}}",powerpoint:"PowerPoint 演示文稿",preview:"预览",download:"下载",previewDialog:"{{name}} 预览",closePreview:"关闭预览",slidePreview:"{{name}} 幻灯片预览",mcpToolset:"MCP 工具集",authorized:"已授权 · {{tool}}",authorizationRequired:"{{tool}} 需要授权",oauthDescription:"工具集 {{tool}} 使用 OAuth 保护,需登录授权后方可调用。",oauthProvider:"将跳转至 {{provider}} 完成登录。",oauthContinue:"授权完成后对话自动继续。",waitingAuthorization:"等待授权…",authorize:"去授权",missingAuthorizationUrl:"未在事件中找到授权地址。",tools:{web_search:{running:"正在进行网络搜索",done:"已完成网络搜索"},link_reader:{running:"正在读取网页",done:"已完成网页读取"},run_code:{running:"正在 AgentKit 沙箱中执行代码",done:"已在 AgentKit 沙箱中完成代码执行"},list_envs:{running:"正在查看可用环境",done:"已读取可用环境"},get_env_manifest:{running:"正在读取环境 Manifest",done:"已读取环境 Manifest"},execute_in_sandbox:{running:"正在环境中执行命令",done:"已在环境中完成命令执行"},delegate_to_codex_sandbox:{running:"Codex Sandbox 正在执行",done:"Codex Sandbox 已完成",failed:"Codex Sandbox 执行失败"},image_generate:{running:"正在生成图片",done:"已完成图片生成"},video_generate:{running:"正在生成视频",done:"已完成视频生成"},ppt_generate:{running:"正在生成 PPT",done:"已完成 PPT 生成"},load_memory:{running:"正在检索长期记忆",done:"已完成记忆检索"},load_knowledgebase:{running:"正在检索知识库",done:"已完成知识库检索"},load_skill:{running:"正在加载技能",done:"已加载技能"},collect_resources:{running:"正在收集可用资源",done:"已完成资源收集",failed:"资源收集失败"},create_agents:{running:"正在创建并运行 Agent",done:"已完成 Agent 创建",failed:"Agent 创建失败"}},createAgents:{categories:{skill_hub:"Skill Hub",skill_space:"AgentKit 技能中心",knowledge_base:"知识库",tool:"工具"},agentTypes:{llm:"LLM 智能体",sequential:"顺序智能体",parallel:"并行智能体",loop:"循环智能体",workflow:"工作流"},skill:"技能",subAgents:"子智能体",builtinTool:"内置工具",skillCenter:"AgentKit 技能中心",selfAuthoredTools:"自写工具",dependencies:"依赖:{{items}}",fullCode:"{{name}} 完整代码",itemCount:"{{label}} {{count}} 项",collectionAria:"召回资源信息",retrieving:"正在检索资源",retrievalFailed:"资源检索未完成",checkConfig:"请检查资源服务配置后重试。",notSearched:"未检索",notConfigured:"未配置",resourceList:"{{label}}资源列表",searchKeywords:"检索关键词",skillHubSkipped:"未提供检索关键词,本次未检索 Skill Hub。",sourceSkipped:"未配置 {{label}},本次未检索该来源。",noResources:"本次检索未返回该类别的资源。",resultAria:"创建 Agent 结果",creationFailed:"Agent 创建未完成",agentResources:"{{name}} 具备的资源",knowledgeBase:"知识库",toolsLabel:"工具",creating:"正在创建 Agent",noAgents:"没有可展示的 Agent",noAgentResult:"工具返回中未包含 Agent 配置或执行结果。",sourceLabels:{tool:"工具",knowledge:"AgentKit 知识库",skillCenter:"AgentKit 技能中心",unknown:"未知来源"},unnamedResource:"未命名资源",unnamedAgent:"未命名 Agent"},branchCompare:{ariaLabel:"分支对比",selectDirection:"选择方向",continue:"继续这个方向"},codexProgress:{planTitle:"Codex 执行计划",fallback:{fileChange:"修改文件",approval:"等待操作批准",status:"Codex 状态",command:"运行命令"},planSummary:"已完成 {{completed}}/{{total}} 项",command:{running:"正在执行命令",completed:"命令执行完成",failed:"命令执行失败"},projectFiles:"{{count}} 个项目文件",projectFile:"项目文件",fileChange:{running:"正在更新{{subject}}",completed:"已更新{{subject}}",failed:"更新{{subject}}失败"},externalTool:"外部工具",mcp:{running:"正在调用工具 {{tool}}",completed:"已调用工具 {{tool}}",failed:"工具 {{tool}} 调用未完成"},collaboration:{spawn_agent:{running:"正在启动子任务",completed:"子任务已启动",failed:"子任务启动失败"},send_input:{running:"正在向子任务发送信息",completed:"已向子任务发送信息",failed:"向子任务发送信息失败"},wait:{running:"正在等待子任务",completed:"子任务等待已结束",failed:"等待子任务失败"},close_agent:{running:"正在结束子任务",completed:"子任务已结束",failed:"子任务结束失败"},default:{running:"正在协调子任务",completed:"子任务协作已完成",failed:"子任务协作失败"}},webSearch:{running:"正在进行网络搜索",completed:"已完成网络搜索",failed:"网络搜索未完成"},errorDetail:"Codex 执行未完成。",errorTitle:"Codex 执行遇到错误"},toolActivity:{status:{queued:"等待执行",running:"正在执行",completed:"执行成功",failed:"执行失败"},goal:{queued:"等待创建目标",running:"正在创建目标",completed:"已创建目标",failed:"创建目标失败"},command:{queued:"等待运行命令",running:"正在运行命令",completed:"已运行命令",failed:"命令执行失败"},read:{queued:"等待读取",running:"正在读取",completed:"已读取内容",failed:"读取失败"},search:{queued:"等待搜索",running:"正在搜索",completed:"已完成搜索",failed:"搜索失败"},"file-change":{queued:"等待修改文件",running:"正在修改文件",completed:"已修改文件",failed:"文件修改失败"},mcp:{queued:"等待调用外部工具",running:"正在调用外部工具",completed:"已调用外部工具",failed:"外部工具调用失败"},authorization:{queued:"等待授权",running:"等待授权",completed:"授权已完成",failed:"授权失败"},generic:{queued:"等待调用工具",running:"正在调用工具",completed:"已调用工具",failed:"工具调用失败",named:{queued:"等待调用 {{tool}}",running:"正在调用 {{tool}}",completed:"已调用 {{tool}}",failed:"{{tool}} 调用失败"}},exitCode:"退出码 {{code}}",omittedLines:"… 省略 {{count}} 行 …",omittedCharacters:"… 省略 {{count}} 个字符 …",rawData:"查看原始数据",callId:"调用 ID",copyCallId:"复制调用 ID",copy:"复制",copied:"已复制",copyFailed:"复制失败,请重试。",explored_one:"已探索 1 项",explored_other:"已探索 {{count}} 项"}},Fve={segments:{system:"系统与工具",input:"输入与历史",output:"输出与思考",remaining:"剩余"},modelUnavailable:"模型信息未提供",promptWithSystem:"提示词(含系统)",systemUnknown:"系统与工具占用未知",systemApprox:"系统与工具约 {{count}} Token",ariaKnown:"上下文已使用 {{percentage}}%,{{system}},{{inputLabel}} {{input}} Token,输出与思考 {{output}} Token,剩余 {{remaining}} Token",ariaUnknown:"{{model}},上下文窗口未知,会话累计使用 {{count}} Token",composition:"上下文构成",percentageUsed:"{{percentage}}% 已用",gridAria:"100 格上下文构成图,每格代表上下文窗口的百分之一",estimated:"估算",unknown:"未知",summaryPercentage:"{{used}} 已用,剩余 {{remaining}}",summaryTokens:"{{used}} 已用,剩余 {{remaining}},总计 {{total}}",overflow:"已超出上下文 {{count}} Token",title:"上下文用量",category:"类型",currentTurn:"当前轮",sessionTotal:"会话累计",details:{input:"输入",output:"输出",reasoning:"推理",cache:"缓存命中",total:"总计"},unknownModel:"暂未收录该模型的上下文窗口",unknownRuntime:"当前 Runtime 未提供模型信息"},Bve={title:"添加 AgentKit 智能体",noAgents:"连接成功,但该地址未发现任何 Agent(/list-apps 为空)。",connectionFailed:"连接失败:{{error}}。请检查 URL、API Key,以及该网关是否允许跨域。",description:"填入 AgentKit 部署的访问地址与 API Key,将通过 ADK 协议连接,连接成功后其 Agent 会出现在左上角的下拉中。",url:"访问地址 URL",apiKeyHint:"以 Authorization: Bearer 方式连接",displayName:"显示名称(可选)",displayNameHint:"默认取 URL 的主机名",cancel:"取消",connecting:"连接中…",connect:"连接并添加"},Uve={placeholder:"输入消息…",inputAria:"输入消息",generating:"正在生成",send:"发送",model:"模型"},Qve={ariaLabel:"本轮调用上下文",removeSkill:"移除技能 {{name}}",removeAgent:"移除 Agent {{name}}"},zve={cardAria:"{{label}} 图表",viewAria:"{{label}} 显示方式",preview:"预览",code:"代码",invalidEcharts:"ECharts 配置不是有效且安全的数据对象,请切换到代码检查内容。",renderFailed:"图表暂时无法渲染,请切换到代码检查内容。",echartsAria:"ECharts 图表预览",rendering:"正在渲染图表…",mermaidFailed:"图表暂时无法渲染,请切换到代码查看 Mermaid 内容。",mermaidAria:"Mermaid 图表预览"},Vve={downloadFile:"下载文件",downloading:"下载中…",downloadFailed:"下载失败。请确认 Sandbox 和文件仍可用,然后点击重试。",playVideo:"点击播放视频:{{name}}",enlargeImage:"放大预览:{{name}}",image:"图片",enlargeVideo:"点击放大视频",videoPreview:"视频预览",downloadVideo:"下载视频",close:"关闭"},Hve={annotation:Ive,media:Pve,runtimeLogs:Dve,trace:Mve,share:Lve,blocks:$ve,tokenUsage:Fve,addAgentKit:Bve,composer:Uve,invocation:Qve,visualization:zve,markdown:Vve},RVe=Object.freeze(Object.defineProperty({__proto__:null,addAgentKit:Bve,annotation:Ive,blocks:$ve,composer:Uve,default:Hve,invocation:Qve,markdown:Vve,media:Pve,runtimeLogs:Dve,share:Lve,tokenUsage:Fve,trace:Mve,visualization:zve},Symbol.toStringTag,{value:"Module"})),qve={back:"返回",cancel:"取消",deploy:"部署",delete:"删除",loading:"读取中…",next:"下一步",notSupported:"暂不支持",previous:"上一步",required:"必填",retry:"重试",actions:"操作",value:"值",disabled:"关闭",enabled:"已开启",none:"无",close:"关闭",name:"名称",description:"描述",send:"发送"},Wve={heading:"VeADK Agent 结构配置",importHint:"可在「创建 Agent」页通过「导入 YAML」重新载入。"},Kve={agentName:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"},runtimeName:{required:"Runtime 名称为必填项",characters:"Runtime 名称只能包含英文字母、数字、下划线和连字符",length:"Runtime 名称长度须为 4-64 个字符"}},Gve={description:"一个基于 VeADK 构建的智能助手,理解用户意图并调用合适的工具完成任务。",instruction:`你是一个专业、可靠的智能助手。 你的目标是准确理解用户的需求,并给出条理清晰、简洁有用的回答。 约束: - 信息不足时主动提问澄清,不要臆造事实。 - 需要时合理调用可用的工具,并说明关键结论。 -- 保持礼貌、专业的语气。`},Gve={requestFailed:"请求失败 ({{status}}){{detail}}",a2aSpaces:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 AgentKit 智能体中心",loginRequired:"请先登录以访问 AgentKit 智能体中心"},vikingKnowledge:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 VikingDB 知识库",loginRequired:"请先登录以访问 VikingDB 知识库"},vikingMemory:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 VikingDB 记忆库",loginRequired:"请先登录以访问 VikingDB 记忆库"},mcpGateway:{missingHttpTool:"请返回“添加 MCP 工具”并添加至少一个 HTTP MCP 服务;MCP 稳定性治理不支持 stdio 服务。",missingUrl:"已添加的 HTTP MCP 工具缺少有效服务地址,请返回“添加 MCP 工具”补充后再发布。"},customModel:{fallbackName:"自定义模型",apiKeyLabel:"{{name}} 模型 API Key",fallbackApiKeyLabel:"{{name}} 的备用模型 {{model}} API Key"},deploymentEnv:{serverInjected:"由服务端注入",selectedApiKeyPlaceholder:"由所选 API Key 注入",mcpInjectedComment:"由已添加的 MCP 工具注入",restoredPlaceholder:"由 Studio 服务端安全恢复",generatedMcpPlaceholder:"由已添加的 HTTP MCP 工具自动生成",restoredHelp:"更新时由 Studio 服务端合并 MCP 地址与认证,不向浏览器返回旧密钥。",mergedMcpHelp:"Studio 服务端自动合并 MCP 地址与可选认证,不向浏览器返回旧密钥。",listSeparator:"、",requirementHint:"优化项“{{labels}}”依赖此配置。",requiredBy:"优化项“{{labels}}”依赖此配置,请填写 {{key}}。",required:"请填写 {{label}}({{key}})。",invalidJson:"JSON 格式不正确"},drafts:{unsupportedVersion:"本机草稿版本暂不受支持,请升级 Studio 后重试。",invalidFormat:"本机草稿数据格式无效。",readFailed:"无法读取本机草稿,浏览器中的草稿数据可能已损坏。",quotaExceeded:"浏览器存储空间不足,草稿未保存。请删除不需要的草稿或清理此站点的浏览器存储后重试。",writeRejected:"浏览器拒绝保存草稿,请检查站点存储权限后重试。"},skills:{searchFailed:"搜索失败 ({{status}})",downloadFailed:"下载技能失败 ({{status}})",agentKitRequestFailed:"AgentKit Skills 请求失败",missingManifest:"{{location}} 缺少 SKILL.md",invalidParentPath:"{{location}} 包含非法路径(..):{{path}}",invalidPath:"{{location}} 包含非法路径:{{path}}",localDescription:"本地 Skill",folderSource:"文件夹",noManifest:"{{location}} 中未发现 SKILL.md"},zip:{invalid:"无效的 zip:找不到 EOCD",tooManyFiles:"zip 文件数不能超过 {{count}} 个",tooLarge:"zip 解压后的内容过大"}},Xve={back:"返回开发会话",runtimeName:"Runtime 名称",runtimeNameExists:"Runtime 名称已存在,请更换后重试",checkingRuntimeName:"正在检查 Runtime 名称",verifiedSource:"已验证源码",deployableSource:"可部署源码",verifiedByCodex:"已通过 Codex 云端验证",entryPoint:"入口",files:"文件",artifact:"构建产物",validationReport:"验证报告",verifiedHint:"源码由服务端从已验证交付物物化,浏览器文件不能替换。",unverifiedHint:"源码已由服务端安全物化,部署前请确认 Runtime 配置。",env:{requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}"}},Yve={name:"代码包",back:"返回创建方式",reading:"正在读取代码包",readingEllipsis:"正在读取代码包…",uploadFirst:"请先上传代码包",uploadAriaLabel:"代码包上传",upload:"上传代码包",reupload:"重新上传代码包",uploadPrompt:"请上传代码包",filesRecognized:"已识别 {{count}} 个文件,点击区域可重新上传",dropHint:"点击或拖拽上传,支持 .zip 格式,最大 50 MB;可使用 app.py,或由 agentkit.yaml 声明入口",viewFiles:"查看文件",chooseFile:"选择代码包",errors:{invalidFormat:"请选择 .zip 格式的代码包。",tooLarge:"代码包不能超过 50 MB。",invalidPath:"压缩包包含非法路径:{{name}}",empty:"压缩包中没有可部署的文件。",tooManyFiles:"代码包文件数不能超过 {{count}} 个。",duplicateFile:"代码包包含重复文件:{{path}}",manifestParse:"agentkit.yaml 无法解析:{{detail}}",manifestRoot:"agentkit.yaml 根节点必须是对象。",manifestCommon:"agentkit.yaml 的 common 必须是对象。",entryPointType:"agentkit.yaml 的 common.entry_point 必须是文件路径。",entryPointInvalid:"agentkit.yaml 的 common.entry_point 不是有效文件路径。",entryPointMissing:"代码包中不存在 agentkit.yaml 声明的启动入口:{{entryPoint}}",defaultEntryPointMissing:"代码包根目录必须包含 app.py,或在 agentkit.yaml 的 common.entry_point 中声明已有入口。"}},Zve={label:"Agent 执行画布",readOnlyLabel:"只读 Agent 执行画布",minimapLabel:"执行流程缩略图",controls:{ariaLabel:"执行流程控制",zoomIn:"放大",zoomOut:"缩小",fitView:"适应视图"},rootAgent:"主 Agent",unnamedStep:"未命名步骤",terminals:{input:"用户请求",output:"最终回复"},edges:{then:"然后",continueLoop:"继续循环",call:"调用"},patterns:{llm:{label:"智能体",description:"理解任务并直接完成一个具体工作"},sequential:{label:"分步协作",description:"内部步骤按照顺序依次执行"},parallel:{label:"同时处理",description:"内部步骤同时工作,完成后统一汇总"},loop:{label:"循环执行",description:"重复执行内部步骤,直到满足停止条件"},a2a:{label:"远程智能体",description:"调用已经存在的远程 Agent"}},actions:{insertHere:"在这里插入步骤",deleteNamed:"删除 {{name}}",deleteNode:"删除节点",addSubagent:"添加子 Agent",addParallelStep:"添加一个同时处理的步骤",addLoopStep:"添加循环步骤",addNextStep:"添加下一个步骤",addFirst:"添加到最前",addLast:"添加到最后"}},Jve={title:"智能构建",subtitle:"描述需求,完成 Agent 的构建、调试与验证。",model:{label:"模型",placeholder:"选择模型",retiring:"即将下线",currentConfiguration:"当前配置",loadError:"加载模型列表失败"},availability:{checking:"正在检查智能开发能力…",unavailable:"当前无法使用智能模式,请返回后重试。"},goal:{title:"从目标开始",continueTitle:"继续优化项目",hint:"只需说明 Agent 要解决的问题;如有影响结果的关键信息,会在开始前向你确认。",continueHint:"说明这次要调整的内容,完成后会保存为新版本。",basedOn:"基于",clearSelection:"取消选择",label:"目标描述",optimizationLabel:"优化目标",placeholder:"例如:创建一个能读取销售数据、生成周报并校验输出格式的 Agent",optimizationPlaceholder:"例如:增加数据来源标注,并在信息不足时先向用户确认"},actions:{preparing:"准备中…",build:"开始构建",optimize:"开始优化"},preparation:{accepted:"目标已收到,马上开始实现",preparing:"正在创建任务环境…",starting:"环境已就绪,正在启动 Codex…",next:"接下来会先梳理目标和实现方式,再编写、运行和验证 Agent。"},tasks:{title:"进行中的任务",hint:"离开页面后仍会继续,可随时回来查看和补充要求。",refresh:"刷新任务列表",loading:"正在读取任务…",empty:"暂无进行中的任务",emptyHint:"开始构建后,可以从这里回到任务。",loadError:"暂时无法读取任务,请重试。",openError:"暂时无法打开任务,请重试。",startedAt:"开始于 {{time}}",open:"查看任务",opening:"正在连接…",states:{queued:"等待开始",running:"构建中",recovering:"正在重连",waiting_user:"等待你的回复",stopping:"正在停止",succeeded:"已完成",failed:"未完成",cancelled:"已停止"}}},e0e={title:"已保存项目",description:"选择已有版本继续优化,或查看、下载和部署源码。",refresh:"刷新项目列表",checkingStorage:"正在检查项目存储…",unavailableTitle:"暂时无法读取项目",storageCheckError:"无法确认项目存储状态,请稍后重试。",storageNotConfigured:"项目存储尚未配置。",loadingMigrated:"正在读取已迁移项目…",loadingSaved:"正在读取已保存项目…",loadingVersions:"正在读取项目版本…",unknownTime:"时间未知",sourceDownloaded:"源码已下载。",projectSummary_one:"{{count}} 个版本 · 更新于 {{time}}",projectSummary_other:"{{count}} 个版本 · 更新于 {{time}}",versionSummary_one:"{{time}} · {{count}} 个文件",versionSummary_other:"{{time}} · {{count}} 个文件",noVersionDescription:"暂无版本描述",latestVersion:"最新版本",defaultVersionName:"版本 · {{time}}",rename:{projectTitle:"修改项目名称",versionTitle:"修改版本名称",projectLabel:"项目名称",versionLabel:"版本名称",hint:"支持中英文、数字和常见标点,最多 {{max}} 个字符。",required:"请输入名称。",tooLong:"名称不能超过 {{max}} 个字符。",invalidCharacters:"名称不能包含换行、控制字符、不可见格式字符或 < >。",save:"保存名称",saving:"保存中…",updated:"名称已更新。",failed:"名称保存失败,请重试。"},verified:"已验证",pendingVerification:"待确认",viewSource:"查看源码",download:"下载",downloading:"下载中…",optimize:"去优化",optimizeUnavailable:"去优化,暂不支持",errors:{projects:"无法读取已保存项目。",source:"无法读取项目源码。",versions:"无法读取项目版本。",download:"下载源码失败。",prepareDeployment:"无法准备部署源码。",deleteVersion:"删除项目版本失败。",migrated:"无法读取已迁移项目",saved:"无法读取已保存项目"},empty:{migratedTitle:"还没有已迁移的项目",savedTitle:"还没有已保存的项目",migratedDescription:"完成首次迁移后,源码会自动保存在这里。",savedDescription:"完成首次构建后,源码会自动保存在这里。",noVersions:"这个项目还没有可用版本。"},compare:{selected:"已选择 {{count}}/2",selectedLabel:"已选择",select:"选择",view:"查看对比",start:"对比版本"},delete:{title:"删除这个版本?",onlyVersion:"“{{name}}”只有这一个版本,删除后项目也会移除。此操作无法撤销。",description:"该版本的源码和验证记录将永久删除,其他版本不受影响。",confirm:"删除版本"}},t0e={title:"选择创建方式",subtitle:"以不同模式构建您的智能体",features:"特性",quick:{title:"快速模式",description:"动态派生子智能体自主完成任务",features:{dynamicSubagents:"动态派生子智能体",autonomousPlanning:"自主规划执行",collaboration:"多智能体协作",summary:"自动汇总结果",skills:"按需调用技能",trace:"任务过程可追踪"}},traditional:{title:"传统模式",description:"高度自定义您的智能体结构",features:{visualConfig:"可视化配置",migration:"存量智能体迁移",debugging:"实时调试",optimization:"可选性能优化",parameters:"精细参数控制"}}},n0e={placeholder:"输入系统提示词;键入 ## 加空格可创建二级标题…",toolbar:{undo:"撤销 {{shortcut}}",redo:"重做 {{shortcut}}",paragraph:"正文",quote:"引用",heading:"标题 {{level}}",selectBlockType:"选择文本类型",blockType:"文本类型",bold:"加粗",removeBold:"取消加粗",italic:"斜体",removeItalic:"取消斜体",bulletedList:"无序列表",numberedList:"有序列表"}},i0e={local:{duplicatesSkipped:"已跳过重复技能:{{names}}",invalidDrop:"请拖入包含 SKILL.md 的文件夹或一个 .zip 文件",readError:"读取失败:{{detail}}",dropLabel:"拖入文件夹或 ZIP,自动识别 Skill",hint:"每个技能需包含 SKILL.md。支持包含多个技能的目录。",reading:"正在读取文件…",fileCount:"本地 · {{count}} 个文件"},hub:{searchError:"搜索失败,请稍后重试。",searchPlaceholder:"搜索火山 Find Skill 技能广场,例如 数据分析、PDF…",search:"搜索",searching:"正在搜索…",noResults:"没有找到匹配的技能,换个关键词试试。",hint:"输入关键词搜索火山 Find Skill 技能广场,所选技能会在生成项目时下载到 skills/ 目录。"},space:{loadError:"加载失败",loadingSpaces:"正在加载 AgentKit Skills 中心…",noSpaces:"此账号下没有 AgentKit Skills 中心。",selectSpace:"选择 AgentKit Skills 中心",openConsole:"在火山引擎控制台打开",loadingSkills:"正在加载技能列表…",noSkills:"此 AgentKit Skills 中心暂无技能。"}},r0e={unnamedNode:"未命名节点",editInstruction:"点击编辑指令…",controls:{ariaLabel:"工作流画布控制",zoomIn:"放大",zoomOut:"缩小",fitView:"适应视图"},sections:{info:"工作流信息",execution:"执行方式",nodes:"节点",nodeConfig:"节点配置"},types:{sequential:{label:"顺序",description:"节点依次执行"},parallel:{label:"并行",description:"节点同时执行"},loop:{label:"循环",description:"节点循环执行"}},placeholders:{description:"这个工作流做什么…",agentDescription:"这个 Agent 做什么…",instruction:"你是一个…"},errors:{workflowNameUnique:"名称须与 Agent 节点名称保持唯一",agentNameUnique:"Agent 名称在当前工作流中必须唯一"},dragHint:"拖拽到画布,或点击下方按钮添加",agentNode:"Agent 节点",addNode:"添加节点",connectHint:"拖拽节点的圆点连线以表达执行顺序。",create:"创建工作流",deleteNode:"删除节点",nameHelp:"仅使用英文字母、数字和下划线,且名称保持唯一。",instruction:"指令 (instruction)",tools:"工具 (逗号分隔)",nodeId:"节点 ID",empty:{selectNode:"选择一个节点以编辑其配置",summary:"共 {{nodes}} 个节点 · {{edges}} 条连线"}},s0e={ariaLabel:"快速模式创建",progress:"快速模式创建进度",steps:{agent:{label:"智能体",title:"基本信息",description:"设置智能体的名称、用途、行为方式与能力"},environment:{label:"执行环境",title:"配置执行环境",description:"选择默认环境或已构建的自定义环境"},deployment:{label:"部署偏好",title:"部署偏好",description:"定义 AgentKit 云上参数"}},model:{label:"模型",source:"模型来源",name:"模型名称",fallbacks:"Fallback 模型",fallbackPlaceholder:"备用模型名称",addFallback:"添加备用模型",addProviderFallback:"添加其他服务商",removeFallback:"移除",fallbackType:"备用模型类型",fallbackSameProvider:"同服务商",fallbackOtherProvider:"其他服务商",apiKeyEnv:"API Key 环境变量",invalidApiKeyEnv:"环境变量名只能包含字母、数字和下划线,且不能以数字开头。",fallbackHelp:"同服务商备用模型复用主模型连接;其他服务商会使用单独的 provider、API Base 和 API Key。",fallbackIgnored:"空值、重复值或与主模型相同的模型会被忽略。",provider:"服务商 Provider",invalidApiBase:"请输入合法的 http:// 或 https:// 链接。",volcengineArk:"火山方舟",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",currentApiKey:"当前 API Key",currentConfiguration:"当前配置",loadingApiKeys:"正在加载 API Key",selectApiKey:"选择 API Key",searchApiKeys:"搜索 API Key 名称",noApiKeys:"暂无可用 API Key",loadingModels:"正在加载模型",selectModel:"选择模型",searchModels:"搜索名称、Model ID 或服务商",noModels:"没有可用的模型",apiKeyPlaceholder:"请输入模型 API Key",credentialsLoadError:"模型凭据加载失败",modelsLoadError:"模型列表加载失败"},identity:{unnamedPool:"未命名用户池",currentPool:"{{value}}(当前用户池)",userPool:"用户池",loading:"正在加载用户池",placeholder:"请选择用户池",search:"搜索用户池",empty:"当前账号下暂无 Identity 用户池",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime",selectionHint:"当前 Studio 使用的用户池已在列表中标注"},agent:{namePlaceholder:"输入智能体名称",descriptionPlaceholder:"说明这个智能体可以做什么",prompt:"提示词",promptPlaceholder:"定义角色、目标和行为边界",skills:"技能",addSkill:"添加技能"},validation:{descriptionRequired:"请输入描述",promptRequired:"请输入提示词",modelRequired:"请选择模型",apiKeyRequired:"请先填写或选择模型 API Key",instanceIntegers:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数",instanceOrder:"最小实例数不能大于最大实例数",userPoolRequired:"请选择用于 Runtime 鉴权的用户池"},deployment:{runtimeName:"Runtime 名称",runtimeNameUpdateHint:"更新时保持现有 Runtime 名称不变",runtimeNameHint:"仅支持英文字母、数字、下划线和连字符",region:"发布区域",authentication:"鉴权方式",apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPoolDescription:"使用 Identity 用户池签发的 JWT",sessionStorage:"会话存储",inMemoryStorage:"In-memory 临时存储",backends:{sqlite:"SQLite 文件",mysql:"MySQL",postgresql:"PostgreSQL"},instances:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",inMemoryHint:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",networkMode:"网络模式",network:{public:"公网",private:"私网",both:"公网与私网"},subnetIds:"子网 ID(可选,多个用逗号分隔)",sharedInternet:"VPC 内共享公网出口",sharedInternetHint:"允许私网 Runtime 通过共享出口访问公网",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",evaluationSetsHint:"部署成功后自动创建 Good Case 和 Bad Case 评测集",resources:"资源配置",complete:"部署已完成",preparing:"正在准备部署…"},environmentVariables:{title:"环境变量",add:"添加变量",nameAriaLabel:"环境变量名称",valueAriaLabel:"{{name}} 的值",deleteNamed:"删除 {{name}}"},actions:{updateAgain:"再次更新",deployAgain:"重新部署",updateAndPublish:"更新并发布",applyProfile:"应用 Profile",applyProfileAgain:"再次应用 Profile"}},a0e={actions:{addSubagent:"添加子 Agent",clearRoot:"清空根 Agent",clearRootConfirmation:"清空根 Agent 的全部配置和子 Agent?此操作无法撤销。"},workspace:{progress:"Agent 创建进度",modes:{build:"架构",validate:"调试",optimize:"优化",environment:"环境",publish:"发布"},titles:{build:"个性化您的智能体架构",validate:"调试您的智能体",optimize:"为您的智能体选择优化项",environment:"配置云上环境",publish:"准备好部署您的智能体"}},sections:{type:{label:"Agent 类型",hint:"选择 Agent 类型"},basic:{label:"基本信息",hint:"名称、描述与系统提示词"},model:{label:"模型配置",hint:"模型与服务(可选)"},tools:{label:"工具",hint:"可调用的能力"},skills:{label:"技能",hint:"声明式技能"},knowledge:{label:"知识库",hint:"外部知识检索"},memory:{label:"记忆",hint:"短期与长期记忆"},subagents:{label:"子 Agent",hint:"嵌套协作"},review:{label:"完成",hint:"预览并创建"}},agentTypes:{ariaLabel:"Agent 类型",remoteChildOnly:"远程智能体只能作为子步骤使用",llm:{label:"智能体",fullLabel:"LLM 智能体",description:"大模型驱动,自主完成任务"},sequential:{label:"分步协作",fullLabel:"顺序型智能体",description:"子 Agent 按顺序依次执行"},parallel:{label:"同时处理",fullLabel:"并行型智能体",description:"子 Agent 并行执行后汇总"},loop:{label:"循环执行",fullLabel:"循环型智能体",description:"子 Agent 循环执行到满足条件"},a2a:{label:"远程智能体",fullLabel:"远程 Agent",description:"通过 A2A 协议调用远程 Agent"}},basic:{agentName:"Agent 名称",name:"名称",agentDescription:"智能体描述",descriptionPlaceholder:"简要描述这个 Agent 的用途,便于团队识别…",nameHelp:"遵循 Google ADK 命名规则,且在执行流程中保持唯一。",rootDescriptionHelp:"完整描述会保留;部署时会自动整理为符合 Runtime 规范的单行描述。",descriptionHelp:"描述会显示在 Agent 列表与选择器中。",orchestratorHelp:"这是一个协作容器,本身不生成回答。请在左侧画布中添加任务步骤,并通过拖拽调整它们的位置。",maxIterations:"最大轮次",maxIterationsHelp:"循环编排反复执行子 Agent,直到满足条件或达到该轮次上限。",agentCenter:"AgentKit 智能体中心",agentCenterHelp:"远程 Agent 的名称、描述和能力来自中心返回的 Agent Card。系统会根据每轮任务动态发现并挂载匹配的 Agent。",moreOptions:"更多选项",systemPrompt:"系统提示词",loadingMarkdown:"正在加载 Markdown 编辑器…",markdownHelp:"支持 Markdown 快捷输入,例如键入 ## 加空格创建二级标题。",unnamed:"未命名",unnamedAgent:"未命名智能体"},validation:{remoteRoot:"远程 Agent 只能作为子 Agent",missingRegistry:"请选择 AgentKit 智能体中心",name:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"},duplicateName:"Agent 名称在当前结构中必须唯一",missingDescription:"描述为必填项",mcpDuplicateName:"MCP 名称重复,请为每个服务使用唯一名称",mcpDuplicateUrl:"MCP 地址重复,请删除重复服务后再发布",missingSubagent:"缺少子 Agent",missingPrompt:"系统提示词为必填项",apiKeyRequired:"请先填写或选择模型 API Key",missingSubagentDetail:"{{type}}至少需要添加一个子 Agent 后才能调试或发布。",problem:"{{name}}:{{problem}}"},ai:{ariaLabel:"AI 自动填写 Agent 配置",minimumLength:"请至少输入 {{count}} 个字符。",replaceConfirmation:"生成的新配置会替换当前画布和属性,确定继续吗?",placeholder:"描述目标,使用 {{model}} 模型一键生成配置",generate:"智能生成",generating:"正在智能生成",success:"生成成功",regenerate:"重新生成",failed:"智能生成失败"},debug:{ariaLabel:"智能体调试工作区",unavailable:"当前后端暂不支持生成 Agent 调试运行。",baseline:"基准组",comparison:"对照组 {{count}}",selectModel:"请选择模型",enterDescription:"请输入描述",enterPrompt:"请输入系统提示词",duplicateConfiguration:"测试配置不能重复",starting:"启动中…",applyAndRestart:"应用并重启",restart:"重新启动",start:"启动环境",defaultModel:"默认模型",testConfiguration:"测试配置",deleteVariant:"删除 {{name}}",deleteVariantGroup:"删除对照组",creatingEnvironment:"正在创建测试环境…",configurationChanged:"配置已变更,请重新启动环境。",ready:"环境已就绪",readyHint:"发送消息以比较智能体回复。",startHint:"先完善配置,再启动环境。",viewTraceNamed:"查看 {{name}} 的调用链路",traceUnavailable:"发送消息后可查看调用链路",trace:"调用链路",useConfiguration:"使用此配置",finishConfiguration:"完成配置",finishAndStart:"完成并启动",currentAgentModel:"当前 Agent 模型",configurationHint:"修改仅用于本次对比,选择使用后才会进入部署流程。",messagePlaceholder:"向已启动的测试环境发送消息…",startOneFirst:"请先启动至少一个测试环境",addVariant:"添加对照组",traceTitle:"调用链路 · {{name}}",leaveTitle:"离开调试?",leaveDescription:"离开调试页面后,当前环境将被清理。您可以通过重新启动环境进行新的测试。",cleaning:"清理中…",confirmLeave:"确定离开",closeLeaveConfirmation:"关闭离开调试确认"},optimization:{ariaLabel:"智能体优化选项",scenario:"优化场景",components:"优化组件",bytePlusUnavailable:"BytePlus 账号暂不支持 Harness Sidecar 优化项。请保持优化项为空后继续部署,普通 BytePlus 智能体不受影响。",releaseScenario:"优化场景:{{profile}}",profiles:{default:{label:"自定义",description:"按需选择组件,不勾选时不启动 Sidecar。"},ops:{label:"运维场景",description:"适用于运维诊断、数据库、日志和监控 MCP。"}},groups:{quality:"提升回答质量",cost:"降低运行成本",stability:"增强运行稳定性"},options:{context_engine:{label:"上下文治理",description:"治理上下文组装、任务锚定和上下文预算。"},compressor:{label:"上下文与结果压缩",description:"压缩长上下文和大型工具结果,降低 Token 成本。"},verifier:{label:"回答校验与修复",description:"校验证据和回答,在失败时执行修复或告警。"},long_run_control:{label:"Goal 任务控制",description:"管理 Goal 任务的进度、续跑和结束条件。"},mcp_resilience:{label:"MCP 稳定性治理",description:"治理连接、超时、空结果、大返回和调用预算;默认包含 SQL 只读保护。"}}},model:{label:"模型",source:"模型来源",volcanoArk:"火山方舟",volcengineArk:"火山方舟",bytePlusModelArk:"BytePlus ModelArk",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",configuration:"模型配置",name:"模型名称",fallbacks:"Fallback 模型",fallbackPlaceholder:"备用模型名称",addFallback:"添加备用模型",addProviderFallback:"添加其他服务商",removeFallback:"移除",fallbackType:"备用模型类型",fallbackSameProvider:"同服务商",fallbackOtherProvider:"其他服务商",apiKeyEnv:"API Key 环境变量",invalidApiKeyEnv:"环境变量名只能包含字母、数字和下划线,且不能以数字开头。",fallbackHelp:"同服务商备用模型复用主模型连接;其他服务商会使用单独的 provider、API Base 和 API Key。",fallbackIgnored:"空值、重复值或与主模型相同的模型会被忽略。",provider:"服务商 Provider",invalidApiBase:"请输入合法的 http:// 或 https:// 链接。",liteLlmProviders:"LiteLLM 支持列表",apiKeyPlaceholder:"请输入模型 API Key",available:"已开通",retiring:"即将下线",notActivated:"未开通",unavailable:"暂不可用",apiKeyLoadError:"加载 Ark API Key 失败",loadingApiKeys:"正在加载 API Key…",selectApiKey:"选择 API Key",currentApiKey:"当前 API Key",apiKeyList:"API Key 列表",searchApiKey:"搜索 API Key",searchApiKeyName:"搜索 API Key 名称",noApiKeys:"暂无可用 API Key",noMatchingApiKey:"没有匹配的 API Key",loading:"正在加载模型…",loaded:"已加载 {{count}} 个模型",loadError:"加载模型失败",selectModel:"选择模型",selectProviderModel:"选择服务商模型",providerModels:"服务商模型",search:"搜索模型",searchPlaceholder:"搜索名称、Model ID 或服务商",noMatches:"没有匹配的模型",empty:"暂无可用模型",unknownStatus:"未知状态",refresh:"刷新",refreshing:"刷新中…",activate:"开通",activateAction:"前往开通",currentConfiguration:"当前配置"},tools:{builtIn:"内置工具",builtInHelp:"勾选 VeADK 提供的内置能力,生成时会自动补全 import 与所需环境变量。",codeExecution:"代码执行配置",codeExecutionHelp:"指定 AgentKit 代码执行沙箱。",mcp:"MCP 工具"},catalog:{web_search:{label:"联网搜索",description:"火山引擎 Web Search,获取实时信息。"},parallel_web_search:{label:"并行联网搜索",description:"并行发起多条搜索查询,更快汇总。"},link_reader:{label:"网页读取",description:"抓取并阅读给定链接的正文内容。"},web_scraper:{label:"网页爬取",description:"结构化爬取网页(需要 Scraper 服务)。"},image_generate:{label:"图像生成",description:"文生图(Doubao Seedream)。"},image_edit:{label:"图像编辑",description:"图生图 / 编辑(Doubao SeedEdit)。"},video_generate:{label:"视频生成",description:"文/图生视频(Doubao Seedance),含任务查询。"},text_to_speech:{label:"语音合成 (TTS)",description:"把文本转成语音(火山语音)。"},run_code:{label:"代码执行",description:"在沙箱中执行代码。"},vesearch:{label:"VeSearch 智能搜索",description:"火山 VeSearch(需要 bot 端点)。"},links:{console:"控制台",documentation:"文档"},env:{modelAgentName:{comment:"模型名称"},embeddingModelName:{comment:"向量化模型(记忆/知识库需要)"},vikingMemoryProject:{comment:"VikingDB 记忆库项目"},vikingMemoryRegion:{comment:"VikingDB 记忆库地域"},vikingMemoryType:{comment:"记忆类型"},feishuAppId:{comment:"飞书应用 App ID"},feishuAppSecret:{comment:"飞书应用 App Secret",placeholder:"输入 App Secret"},registrySpaceId:{comment:"AgentKit 智能体中心",placeholder:"请选择智能体中心"},registryTopK:{comment:"召回 Agent 数量"},registryRegion:{comment:"AgentKit 智能体中心地域"},registryEndpoint:{comment:"AgentKit 智能体中心 OpenAPI 地址"},agentKitToolId:{comment:"代码执行沙箱 ID"},agentKitToolRegion:{comment:"AgentKit Tools 地域"},openVikingUrl:{comment:"OpenViking 服务地址"},openVikingMemoryUserId:{comment:"记忆归属 ID",help:"对应 viking://user/<此值>/peers/<请求用户>/memories 中的 user 段;用于隔离 Agent、租户或业务场景,默认 default。"},openVikingMemoryPolicy:{comment:"记忆策略",help:"记忆的抽取策略和隔离策略,不填写时使用官方默认策略。"},openVikingKnowledgeUserId:{comment:"知识库归属 ID",help:"未配置资源目录时用于默认路径 viking://user/<此值>/resources/<知识库索引>/,默认 default。"},openVikingTargetUri:{comment:"知识库资源目录",help:"留空时由 KnowledgeBase index 自动生成;填写后直接检索该 OpenViking 资源目录,优先级最高。"},tlsServiceName:{comment:"TLS topic_id,留空自动创建"}}},backends:{shortTerm:{local:{label:"本地内存",description:"进程内,不持久化。适合开发调试。"},sqlite:{label:"SQLite 文件",description:"持久化到本地 .db 文件。"},mysql:{label:"MySQL",description:"持久化到 MySQL。"},postgresql:{label:"PostgreSQL",description:"持久化到 PostgreSQL。"}},longTerm:{local:{label:"本地向量库",description:"进程内 llama-index 向量库。"},opensearch:{label:"OpenSearch",description:"OpenSearch 向量检索。"},redis:{label:"Redis",description:"Redis 向量检索。"},viking:{label:"VikingDB Memory",description:"VikingDB 记忆库(支持用户画像)。"},openviking:{label:"OpenViking Memory",description:"OpenViking 长期记忆,按用户维度保存和检索偏好、事件与实体。"},mem0:{label:"Mem0",description:"Mem0 托管记忆服务。"}},knowledge:{viking:{label:"VikingDB Knowledge",description:"VikingDB 知识库。"},opensearch:{label:"OpenSearch",description:"OpenSearch 向量检索。"},context_search:{label:"Context Search",description:"火山 Context Search 引擎(无需向量化)。"},openviking:{label:"OpenViking Knowledge",description:"OpenViking 资源目录知识库,无需向量化模型配置。"}}},exporters:{apmplus:{label:"APMPlus",description:"火山 APMPlus 应用性能监控。"},cozeloop:{label:"CozeLoop",description:"扣子 CozeLoop 链路观测。"},tls:{label:"TLS (日志服务)",description:"火山 TLS 日志服务导出。"}},knowledge:{title:"知识库",description:"启用外部知识检索(RAG),让 Agent 基于你的资料作答。",backend:"知识库后端",vikingDatabase:"VikingDB 知识库"},memory:{shortTerm:"短期记忆",shortTermDescription:"存储单会话上下文",shortTermBackend:"短期记忆后端",longTerm:"长期记忆",longTermDescription:"存储跨会话上下文,通常使用向量化检索",longTermBackend:"长期记忆后端",vikingDatabase:"VikingDB 记忆库",autoSave:"自动保存会话到长期记忆",autoSaveDescription:"会话结束时自动把内容写入长期记忆,无需手动调用。"},mcp:{removeTool:"删除 MCP 工具",namePlaceholder:"名称(可选)",urlPlaceholder:"MCP 服务地址",pathWarning:"当前填写的是网关根地址。仅当根路径就是 MCP Endpoint 时可直接使用;否则请补充完整服务路径。",tokenPlaceholder:"Bearer Token(可选)",showToken:"显示 Bearer Token",hideToken:"隐藏 Bearer Token",commandPlaceholder:"命令,例如 npx",argsPlaceholder:"参数,以空格分隔",stdioHint:"stdio 工具在部署环境中启动,请确保命令和依赖可用。",addTool:"添加 MCP 工具"},resources:{unnamedAgentCenter:"未命名智能体中心",unnamedKnowledgeBase:"未命名知识库",unnamedMemory:"未命名记忆库",loadError:"加载失败",loadingAgentCenters:"正在加载智能体中心…",agentCentersLoaded:"已加载 {{count}} 个智能体中心",noAgentCenters:"暂无智能体中心",noMatchingAgentCenters:"没有匹配的智能体中心",searchAgentKitCenter:"搜索 AgentKit 智能体中心",searchNameOrId:"搜索名称或 ID",selectAgentCenter:"选择智能体中心",selectAgentKitCenter:"选择 AgentKit 智能体中心",selectedAgentCenter:"已选智能体中心",agentKitCenter:"AgentKit 智能体中心",refreshAgentCenters:"刷新智能体中心",knowledgeBaseList:"知识库列表",knowledgeBasePlaceholder:"选择知识库",loadingKnowledgeBases:"正在加载知识库…",knowledgeBasesLoaded:"已加载 {{count}} 个知识库",noKnowledgeBases:"暂无知识库",noMatchingKnowledgeBases:"没有匹配的知识库",searchKnowledgeBase:"搜索知识库",selectKnowledgeBase:"选择知识库",refreshKnowledgeBases:"刷新知识库",memoryList:"记忆库列表",memoryPlaceholder:"选择记忆库",loadingMemories:"正在加载记忆库…",memoriesLoaded:"已加载 {{count}} 个记忆库",noMemories:"暂无记忆库",noMatchingMemories:"没有匹配的记忆库",searchMemory:"搜索记忆库",selectMemory:"选择记忆库",refreshMemories:"刷新记忆库"},env:{noAdditionalParameters:"此后端无需额外运行参数。",invalidJson:"请输入有效的 JSON。",helpAriaLabel:"{{label}}说明:{{help}}",openOpenViking:"打开 OpenViking {{label}}",valuePlaceholder:"请输入参数值",openVikingIndex:"OpenViking 资源索引",openVikingIndexHelp:"默认值:留空;生成项目时使用 Agent 名自动生成,例如 my_agent_kb。未配置 DATABASE_OPENVIKING_TARGET_URI 时,默认 URI 拼接为 viking://user/{知识库归属 ID,未填则 default}/resources/{资源索引}/;如果填写了 DATABASE_OPENVIKING_TARGET_URI,则直接使用该完整 URI。",openVikingIndexAriaLabel:"OpenViking 资源索引说明:{{help}}"},deployment:{vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",apiKeyRequired:"请先选择模型使用的 API Key。",invalidEnvName:"环境变量名称不合法:{{key}}",requiredEnv:"{{name}}:请填写必填环境变量",generatingConfiguration:"正在生成部署配置",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",preparing:"准备部署",applyingMpaProfile:"正在将 Agent 配置应用到 MPA Runtime",mpaProfileApplied:"MPA Runtime 配置已应用",runningMpaSmoke:"正在验证 MPA Runtime 执行链路",mpaReady:"MPA Runtime 已可运行",mpaOperationIncomplete:"MPA Runtime 初始化未完成,请重试此部署任务。",complete:"部署完成",failed:"部署失败",updateAndPublish:"更新并发布",stages:{build:"构建镜像",deploy:"部署 Runtime",publish:"发布服务",applyMpaProfile:"应用 MPA 配置",verifyMpaRuntime:"验证 MPA Runtime",mpaReady:"MPA Runtime 可运行",running:"部署中"}},publish:{generating:"正在生成发布配置",validating:"校验 Agent 结构并准备部署快照…"}},o0e={presets:{support:{name:"客服助手",description:"7×24 在线答疑,结合知识库与历史对话,稳定、礼貌地解决用户问题。",instruction:"你是一名专业、耐心的客服助手。请始终保持礼貌、友好的语气,优先依据知识库中的资料回答用户问题;当资料不足以确定答案时,如实告知用户并主动引导其提供更多信息,切勿编造。回答尽量简洁、分点清晰,必要时给出操作步骤。",subagents:{}},analyst:{name:"数据分析师",description:"运行代码完成统计与可视化,开启链路追踪,分析过程可观测、可复现。",instruction:"你是一名严谨的数据分析师。面对数据问题时,先厘清分析目标与口径,再通过编写并运行代码完成清洗、统计与可视化。每一步都要说明你的假设与方法,给出结论时附上关键数据支撑,并指出潜在的偏差与局限。",subagents:{}},translator:{name:"翻译助手",description:"中英互译,忠实、通顺、地道,保留原文语气与专业术语。",instruction:"你是一名专业的翻译助手,精通中英互译。请在忠实于原文含义的前提下,使译文自然、地道、符合目标语言表达习惯;保留专有名词与专业术语的准确性,并尽量贴合原文的语气与风格。仅输出译文,除非用户额外要求解释。",subagents:{}},coder:{name:"代码助手",description:"编写、调试与重构代码,可运行代码验证结果,给出清晰可维护的实现。",instruction:"你是一名资深软件工程师。请根据需求编写正确、清晰、可维护的代码,遵循目标语言的惯用风格与最佳实践。在不确定时通过运行代码验证你的实现,给出关键的边界条件与测试思路,并对复杂逻辑附上简要注释。",subagents:{}},researcher:{name:"研究员",description:"联网检索一手资料,结合知识库与长期记忆,输出有据可查的研究结论。",instruction:"你是一名严谨的研究员。面对研究问题时,先拆解关键子问题,再通过联网检索收集多个一手、可信的来源,交叉验证后再下结论。结论需注明出处与不确定性,区分事实与推断,避免以偏概全。",subagents:{}},"research-team":{name:"多智能体研究团队",description:"由检索员、分析员、撰写员协作的研究编排,分工完成端到端调研报告。",instruction:"你是一支研究团队的总协调者。负责拆解用户的研究任务,将检索、分析、撰写分别委派给对应的子 Agent,汇总各子 Agent 的产出,把控整体质量,最终输出结构清晰、有据可查的研究报告。",subagents:{0:{name:"检索员",description:"联网搜集与课题相关的一手资料与数据。",instruction:"你是研究团队中的检索员。根据课题联网检索多个可信来源,整理出关键事实、数据与原文出处,交付给分析员,不做主观结论。"},1:{name:"分析员",description:"对检索到的材料做交叉验证与归纳分析。",instruction:"你是研究团队中的分析员。对检索员提供的材料做交叉验证、归纳与对比,提炼洞见、识别矛盾与不确定性,形成结构化的分析要点。"},2:{name:"撰写员",description:"将分析结论组织为结构清晰、引用规范的报告。",instruction:"你是研究团队中的撰写员。把分析员的要点组织成结构清晰、语言通顺、引用规范的研究报告,确保每个结论都能追溯到来源。"}}}},tags:{tools:"工具",memory:"记忆",knowledgeBase:"知识库",tracing:"观测",subagents:"子 Agent {{count}}"},gallery:{title:"从模板新建",subtitle:"选择一个预制 Agent 模板,按需微调后即可创建。"},detail:{back:"返回模板列表",name:"名称",systemPrompt:"系统提示词",model:"模型",tools:"工具",memory:"记忆",knowledgeBase:"知识库",tracing:"观测追踪",subagents:"子 Agent({{count}})",create:"使用此模板创建",shortTermMemory:"短期",longTermMemory:"长期"}},l0e={checkingExpiry:"确认有效期中",waitingRecovery:"等待恢复",listFailed:"读取项目列表失败",recoveryFailed:"工作区恢复失败,请重试",operationFailed:"项目操作失败,请重试",title:"代码项目",back:"返回代码项目",restart:"本开发环境将在 {{countdown}} 后重启,请随时保存数据",expiresAt:"有效期至 {{date}}",exitFullscreen:"退出全屏",fullscreen:"全屏",exitFullscreenHint:"退出全屏(Esc)",recovering:"正在恢复工作区,完成后将自动返回项目",retry:"重试连接",search:"搜索代码项目",newTitle:"新建代码项目",new:"新建项目",readingStats:"正在读取项目统计",createdAt:"创建时间",opening:"正在打开",unknownCreatedAt:"创建时间未知",open:"打开项目",empty:"没有匹配的代码项目",close:"关闭新建项目",name:"项目名称",placeholder:"例如 my-agent",nameHelp:"以英文字母开头,可包含字母、数字、下划线和连字符,最多 64 个字符",cancel:"取消",create:"创建项目",files_one:"{{count}} 个文件",files_other:"{{count}} 个文件",directories_one:"{{count}} 个目录",directories_other:"{{count}} 个目录",separator:","},c0e={enabled:"已启用",disabled:"已禁用",unknownStatus:"状态未知",allPermissions:"全部权限",customPermissions:"自定义权限",unknownPermissions:"权限未知",unnamed:"未命名 API Key",search:"搜索名称、状态或权限",noMatches:"没有匹配的 API Key",noModelPermission:"当前 API Key 无权限",modelAvailable:"可用",permissionState:{Available:"可用于对话",Shutdown:"已下线",VideoGeneration:"视频生成模型",Unsupported:"不支持作为对话模型",NotActivated:"尚未开通",Unknown:"未获取到模型状态"}},u0e={common:Hve,yaml:qve,validation:Wve,defaults:Kve,helpers:Gve,intelligentDeployment:Xve,codePackage:Yve,buildCanvas:Zve,intelligent:Jve,projectLibrary:e0e,modePicker:t0e,promptEditor:n0e,skills:i0e,workflow:r0e,workbench:s0e,traditional:a0e,template:o0e,workspace:l0e,modelApiKey:c0e},RVe=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:Zve,codePackage:Yve,common:Hve,default:u0e,defaults:Kve,helpers:Gve,intelligent:Jve,intelligentDeployment:Xve,modePicker:t0e,modelApiKey:c0e,projectLibrary:e0e,promptEditor:n0e,skills:i0e,template:o0e,traditional:a0e,validation:Wve,workbench:s0e,workflow:r0e,workspace:l0e,yaml:qve},Symbol.toStringTag,{value:"Module"})),d0e={source:"任务来源",studio:"Studio 定时任务",title:"Runtime 定时任务",selectRuntime:"请先在 Agent 列表中选择一个云端 Runtime。",scope:"展示当前 Studio 用户在此 Runtime 中的定时任务。",refresh:"刷新",loading:"正在获取 Runtime 任务",empty:"此 Runtime 中没有符合条件的定时任务。",authRequired:"Runtime 拒绝了请求,请检查网关访问权限及 Runtime 的鉴权开关。",forbidden:"当前用户没有此 Runtime 的访问权限。",unsupported:"此 Runtime 未提供 mpa 定时任务接口。",invalidResponse:"任务接口返回了无法识别的数据,请检查 Runtime 版本。",loadFailed:"获取任务失败,请检查网络和 Runtime 状态后刷新。",pagination:"Runtime 任务分页",total:"共 {{total}} 条",previous:"上一页",next:"下一页",columns:{name:"任务名称",enabled:"状态",schedule:"执行计划",next:"下次执行",last:"最近结果"},schedule:{once:"单次",interval:"间隔",daily:"每天",weekly:"每周",monthly:"每月",cron:"Cron"},search:"搜索任务",executionCount:"执行次数",successRate:"成功率",prompt:"任务内容",manage:{view:"任务视图",list:"列表",calendar:"日历",create:"创建定时任务",edit:"编辑任务",copy:"复制",delete:"删除",detail:"详情",run:"立即执行",name:"任务",lastRun:"上次执行",schedule:"执行周期",lastStatus:"上次执行状态",agent:"执行 Agent",actions:"操作",all:"全部状态",Pending:"尚未执行",Queued:"已排队",Running:"执行中",Succeeded:"执行成功",Failed:"执行失败",TimedOut:"执行超时",Cancelled:"已取消",Skipped:"已跳过",overview:"执行统计:",prompt:"任务内容",timezone:"时区",localTime:"执行时间(当前设备时区)",time:"执行时间",Once:"单次",Interval:"间隔",Daily:"每天",Weekly:"每周",Monthly:"每月",Cron:"Cron 表达式",seconds:"秒",interval:"间隔秒数",weekdays:"星期(1 为周一,7 为周日,逗号分隔)",monthDays:"每月日期(1–31,逗号分隔)",delivery:"结果投递",Web:"Web",Feishu:"飞书",target:"飞书接收 ID",enabled:"启用任务",cancel:"取消",save:"保存",saving:"保存中",required:"请填写任务名称、Agent ID、任务内容和投递目标。",timezoneInvalid:"请输入有效的 IANA 时区,例如 Asia/Shanghai。",futureTime:"请选择未来的执行时间。",intervalInvalid:"间隔需要为 30–31536000 的整数秒。",daysInvalid:"请输入有效且不重复的日期或星期。",history:"执行记录",duration:"耗时",result:"结果 / 会话",noRuns:"暂无执行记录。",conflict:"任务已被修改或请求发生冲突,请关闭弹窗并刷新后重试。",invalid:"请求校验失败,请检查用户身份、执行时间、Agent ID 和任务配置。",queued:"已提交执行请求。",saved:"任务已更新。",deleteConfirm:"确定删除“{{name}}”?删除后将不再调度此任务。",calendarZone:"显示时区:",prevMonth:"上个月",nextMonth:"下个月",today:"今天",nextOnly:"仅下次",calendarHint:"日历展示预计执行安排;复杂 Cron 仅显示服务端给出的下一次执行时间。",botAccount:"投递机器人",selectBot:"请选择已启用的投递机器人。",botsLoading:"正在读取飞书机器人…",botsFailed:"读取投递机器人失败,请重试。",botsUnauthorized:"无权读取飞书机器人,请联系管理员配置投递。",retryBots:"重新读取机器人",botDisabled:"已停用"}},f0e={backToList:"返回定时任务列表",cancel:"取消",cancelQueue:"取消排队",cancelQueueFirst:"请先取消排队",cancelling:"取消中…",closeDrawer:"关闭抽屉",collapse:"收起",connectingRuntime:"正在连接 Runtime…",createScheduledTask:"创建定时任务",createTask:"创建任务",delete:"删除",deleteTask:"删除任务",edit:"编辑",enable:"启用",expand:"展开",pause:"暂停",refresh:"刷新",refreshHistory:"刷新执行历史",rerun:"重新执行",retry:"重试",runNow:"立即执行",saveChanges:"保存更改",saving:"保存中…",stop:"终止执行",stopRun:"终止本次执行",stopRunFirst:"请先终止当前执行",stopping:"终止中…",viewDetails:"查看详情"},h0e={cancelDescription:"本次 Session 将被取消,后续计划不会暂停。",cancelTitle:"终止本次执行?",deleteDescription:"“{{name}}”及其全部执行历史将被永久删除。",deleteTitle:"删除定时任务?"},p0e={configuration:"任务配置",nextRun:"下次执行",pageLabel:"定时任务详情",region:"地域",runtime:"运行时",status:"任务状态"},m0e={createTitle:"创建定时任务",description:"每次触发都会为 Runtime Agent 创建独立 Session。",editTitle:"编辑定时任务"},g0e={minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",seconds:"{{count}} 秒"},b0e={cronExpression:"Cron 表达式",cronHelp:"依次填写分钟、小时、日期、月份、星期。",dailyTime:"每天执行时间",enableAfterCreate:"创建后启用",enableHelp:"启用后会从下一个计划时间开始执行。",name:"任务名称",namePlaceholder:"例如:每日生成运营摘要",noRuntime:"暂无可用 Runtime",prompt:"执行文本",promptPlaceholder:"输入每次执行时发送给 Agent 的固定文本",runAt:"执行时间",runtimeAgent:"运行时智能体",runtimeHelp:"任务始终跟随该 Runtime 当前生效版本。",runtimePlaceholder:"选择 Runtime Agent",schedule:"执行计划",scheduleType:"执行计划类型",timezone:"时区",weekday:"星期"},y0e={all:"全部"},v0e={description:"每次运行均使用独立 Session,结果与错误会永久保留。",duration:"耗时 {{duration}}",emptyDescription:"任务触发或立即执行后,记录会显示在这里。",emptyTitle:"暂无执行记录",errorDetails:"错误详情",finalAnswer:"最终回答",loadFailed:"无法加载执行历史",loadFailedDescription:"请检查 Studio 服务后重试。",session:"会话",title:"执行历史"},x0e={cancelRequested:"已提交终止请求。",created:"任务已创建。",deleted:"任务及其执行历史已删除。",enabled:"任务已启用。",paused:"任务已暂停。",queued:"任务已排队,将在一分钟内开始执行。",requeued:"任务已重新排队,将在一分钟内开始执行。",updated:"任务已更新。"},w0e={filterLabel:"定时任务状态筛选",listLabel:"定时任务列表",loadFailed:"无法加载定时任务",loadFailedDescription:"请检查 Studio 服务后重试。",title:"定时任务"},k0e={cron:"Cron {{cron}}{{zone}}",daily:"每天 {{time}}{{zone}}",once:"一次 · {{date}}{{zone}}",weekly:"{{weekday}} {{time}}{{zone}}"},O0e={daily:"每天",once:"一次性",weekly:"每周"},S0e={cancelled:"已取消",enabled:"已启用",failed:"失败",notRun:"尚未执行",paused:"已暂停",pending:"准备中",queued:"已排队",retrying:"自动重试中",running:"执行中",skipped:"已跳过",success:"成功"},E0e={cronFields:"Cron 表达式需要包含 5 个字段,例如 0 9 * * *。",nameRequired:"请输入任务名称。",promptRequired:"请输入每次执行时发送给 Agent 的文本。",runtimeAppMissing:"Runtime Agent 未返回可调用的 appName,请确认 Runtime 已就绪且版本兼容。",runtimeRequired:"请选择可用的 Runtime Agent。",timeRequired:"请选择执行时间。"},C0e={friday:"周五",monday:"周一",saturday:"周六",sunday:"周日",thursday:"周四",tuesday:"周二",wednesday:"周三"},IVe={mpa:d0e,actions:f0e,confirm:h0e,detail:p0e,drawer:m0e,duration:g0e,fields:b0e,filters:y0e,history:v0e,notices:x0e,page:w0e,schedule:k0e,scheduleTypes:O0e,status:S0e,validation:E0e,weekdays:C0e},PVe=Object.freeze(Object.defineProperty({__proto__:null,actions:f0e,confirm:h0e,default:IVe,detail:p0e,drawer:m0e,duration:g0e,fields:b0e,filters:y0e,history:v0e,mpa:d0e,notices:x0e,page:w0e,schedule:k0e,scheduleTypes:O0e,status:S0e,validation:E0e,weekdays:C0e},Symbol.toStringTag,{value:"Module"})),A0e="快速创建 Agent",T0e="Agent 类型",_0e="关闭",j0e="部署",N0e="预览配置",R0e="已发起配置包下载",I0e="下载失败,请重试",P0e="有 {{count}} 处配置需要修改",D0e="自定义",M0e="自定义{{field}}",L0e="输入自定义值",$0e="该模型未声明推理强度,使用服务端设置",F0e="请先为该提供方添加模型",B0e="请先选择提供方",U0e="请选择",Q0e="可选",z0e="默认模型、Agent 预设和权限用于新会话;预设需要存在于部署的 Harness 中",V0e="仅填写环境变量名称,实际密钥由部署环境提供",H0e="read-only 为只读,workspace-write 可写工作区,danger-full-access 允许完整访问且不请求确认",q0e="allowedModels 是子 Agent 可选择的模型列表,启用后至少填写一组提供方和模型",W0e="添加自定义模型服务,填写它的端点、协议和模型 ID,支持火山引擎和 BytePlus 等兼容服务",K0e="当前覆盖常用原生设置,其他插件参数与预设文件尚未接入",G0e="查看原生配置文档",X0e="模型提供方 {{index}}",Y0e="模型 {{index}}",Z0e="添加模型提供方",J0e="移除提供方 {{index}}",exe="添加模型",txe="移除模型 {{index}}",nxe="添加可选模型",ixe="移除可选模型 {{index}}",rxe="移除",sxe="填写服务端的模型 ID",axe={provider:"提供方 {{index}}",model:"模型 {{index}}"},oxe={defaults:"会话默认设置",deepseek:"DeepSeek 模型服务",providers:"自定义模型提供方",shell:"命令执行",loop:"工具调用",subagents:"子 Agent 模型选择",search:"DeepSeek 网络搜索"},lxe={id:"提供方 ID",displayName:"显示名称",baseURL:"服务地址",api:"接口协议",apiKeyEnv:"密钥环境变量"},cxe={id:"例如 company-models",displayName:"可选,默认使用提供方 ID",baseURL:"https://…/v1",api:"选择接口协议",apiKeyEnv:"例如 MODEL_API_KEY"},uxe={id:"模型 ID",name:"显示名称",contextWindow:"上下文容量",maxTokens:"最大输出容量"},dxe={positive:"请输入大于 0 的数值",integer:"请输入有效的正整数",env:"请输入环境变量名,只能包含字母、数字和下划线,且不能以数字开头",url:"请输入 HTTP 或 HTTPS 地址,不要在地址中包含凭据",option:"请选择受支持的原生选项",required:"请补全此项",duplicate:"该 ID 或模型组合已存在",providerId:"以小写字母开头,可包含小写字母、数字、点、下划线和连字符,不能使用保留 ID",routes:"请至少填写一组完整的提供方和模型",modelPair:"请填写该自定义提供方下的模型 ID",unknownProvider:"请先添加该自定义模型提供方",unknownModel:"请填写该提供方下已配置的模型 ID",timer:"请输入大于 0 且不超过 2147483647 的毫秒数"},fxe={"agent-default-model_provider":"默认提供方","agent-default-model_model":"默认模型","agent-default-model_reasoningEffort":"默认推理强度","agent-presets_default":"默认 Agent 预设",permission_defaultPreset:"默认权限预设","llm-deepseek_apiKeyEnv":"密钥环境变量","llm-deepseek_baseURL":"服务地址","llm-deepseek_thinking":"思考模式","llm-deepseek_reasoningEffort":"推理强度","llm-deepseek_maxTokens":"每次请求的输出上限","llm-deepseek_defaultContextWindow":"默认上下文容量","llm-deepseek_streamIdleTimeoutMs":"流式空闲超时(毫秒)",bash_timeoutMs:"默认执行超时(毫秒)",bash_maxTimeoutMs:"最大执行超时(毫秒)",bash_maxOutputBytes:"输出上限(字节)","agent-loop_maxParallelToolCalls":"并行工具调用上限","subagent-model-selection_enabled":"启用模型选择","web-search-deepseek_apiKeyEnv":"密钥环境变量","web-search-deepseek_baseURL":"搜索服务地址","web-search-deepseek_model":"搜索模型","web-search-deepseek_apiVersion":"接口版本","web-search-deepseek_maxTokens":"搜索输出上限","web-search-deepseek_maxUses":"搜索次数上限"},hxe="取消",pxe="返回创建方式",mxe="DeepSeek Harness 配置",DVe={title:A0e,agentType:T0e,close:_0e,continue:"继续配置",deploy:j0e,preview:N0e,export:"导出配置",downloaded:R0e,downloadFailed:I0e,validationSummary:P0e,customValue:D0e,customField:M0e,enterCustomValue:L0e,reasoningUnavailable:$0e,modelsUnavailable:F0e,selectProviderFirst:B0e,selectOption:U0e,optional:Q0e,defaultsHelp:z0e,credentialHelp:V0e,permissionHelp:H0e,routesHelp:q0e,providersHelp:W0e,coverage:K0e,source:G0e,provider:X0e,model:Y0e,addProvider:Z0e,removeProvider:J0e,addModel:exe,removeModel:txe,addRoute:nxe,removeRoute:ixe,remove:rxe,modelIdPlaceholder:sxe,route:axe,sections:oxe,providerFields:lxe,providerPlaceholders:cxe,modelFields:uxe,errors:dxe,fields:fxe,cancel:hxe,back:pxe,pageTitle:mxe},MVe=Object.freeze(Object.defineProperty({__proto__:null,addModel:exe,addProvider:Z0e,addRoute:nxe,agentType:T0e,back:pxe,cancel:hxe,close:_0e,coverage:K0e,credentialHelp:V0e,customField:M0e,customValue:D0e,default:DVe,defaultsHelp:z0e,deploy:j0e,downloadFailed:I0e,downloaded:R0e,enterCustomValue:L0e,errors:dxe,fields:fxe,model:Y0e,modelFields:uxe,modelIdPlaceholder:sxe,modelsUnavailable:F0e,optional:Q0e,pageTitle:mxe,permissionHelp:H0e,preview:N0e,provider:X0e,providerFields:lxe,providerPlaceholders:cxe,providersHelp:W0e,reasoningUnavailable:$0e,remove:rxe,removeModel:txe,removeProvider:J0e,removeRoute:ixe,route:axe,routesHelp:q0e,sections:oxe,selectOption:U0e,selectProviderFirst:B0e,source:G0e,title:A0e,validationSummary:P0e},Symbol.toStringTag,{value:"Module"})),gxe="问题反馈",bxe="问题描述",yxe="常见问题",vxe="取消",xxe="完成",wxe="提交反馈",kxe="正在上报…",Oxe={title:"上报成功,感谢您的反馈",description:"AgentKit 团队会尽快查看您提交的问题。"},Sxe={close:"关闭问题反馈",intro:"请选择遇到的问题,也可以补充具体表现。",privacy:"您的对话数据将会上报到 AgentKit 团队,请注意隐私保护。",descriptionPlaceholder:"请描述问题发生时的表现(选填)",issues:{slow:"执行速度慢",crash:"运行崩溃",incorrect:"结果不准确",tool_error:"工具调用失败",other:"其他问题"}},Exe={description:"告诉我们您在使用 AgentKit Studio 时遇到的问题。",module:"所属模块",modules:{conversation:"对话",agents:"智能体",applications:"自动化",search:"搜索",other:"其他"},commonIssuesMultiple:"常见问题(可多选)",issueTypes:"问题类型",issues:{page_slow:"页面加载慢",feature_unavailable:"功能无法使用",display_error:"页面显示异常",no_response:"操作无响应",other:"其他问题"},descriptionPlaceholder:"请描述问题发生时的页面、操作和表现",quickAdd:"快捷补充",suggestionsLabel:"问题描述推荐",suggestions:{noResponse:"点击后没有反应",loading:"页面一直处于加载状态",incomplete:"部分内容显示不完整",error:"操作后出现错误提示"},privacy:"您的数据将会上报到 AgentKit 团队,请注意隐私保护。"},LVe={title:gxe,descriptionLabel:bxe,commonIssues:yxe,cancel:vxe,done:xxe,submit:wxe,submitting:kxe,success:Oxe,dialog:Sxe,page:Exe},$Ve=Object.freeze(Object.defineProperty({__proto__:null,cancel:vxe,commonIssues:yxe,default:LVe,descriptionLabel:bxe,dialog:Sxe,done:xxe,page:Exe,submit:wxe,submitting:kxe,success:Oxe,title:gxe},Symbol.toStringTag,{value:"Module"})),Cxe={back:"返回",close:"关闭"},Axe={title:"优化迁移项目",closeAria:"关闭优化窗口"},Txe={title:"已迁移项目",description:"管理迁移后的源码版本,也可以选择任一版本继续优化。",libraryTitle:"项目与版本",libraryDescription:"查看、下载、部署或对比源码版本,也可以基于任一版本继续优化。",emptyTitle:"还没有已迁移的项目",emptyDescription:"迁移完成后,源码会自动保存在这里。"},_xe={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any(通用迁移)"},jxe={awaitingUpload:"待上传",analyzing:"分析中",needsInput:"待补充",analysisReady:"待确认",migrating:"迁移中",validating:"校验中",packaging:"打包中",succeeded:"已完成",succeededWithWarnings:"已完成,有提示",partial:"部分完成",failed:"失败",cancelled:"已终止",expired:"已过期"},Nxe={evaluationPending:"待评测",evaluationRunning:"评测中",waitingDataset:"待保存评测用例",waitingEnvironment:"待补充环境变量",evaluationFailed:"迁移完成,评测未完成",evaluationBlocked:"迁移完成,评测待处理",evaluationCancelled:"迁移完成,评测已取消",resultUnavailable:"结果不可用",environmentExpired:"环境已过期"},Rxe={partialReady:"迁移产物已生成,但交付不完整,请查看迁移提示。",readyWithWarnings:"迁移产物已生成,请查看迁移提示。",ready:"迁移产物已生成。"},Ixe={passed:"产物校验通过",failed:"产物校验未通过",degraded:"产物校验未完成"},Pxe={session:"创建迁移环境",upload:"上传项目",analysis:"分析项目"},Dxe={agentNameRequired:"请输入 Agent 名称",agentNameInvalid:"Agent 名称必须为 1-63 位,只能包含小写字母、数字和连字符,且必须以字母或数字开头和结尾"},Mxe={seconds:"{{seconds}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},Lxe={savedUnaffected:"已保存项目不受影响",savingUnaffected:"源码正在保存,完成后不受环境期限影响",activeDetail:"到期后任务记录和临时产物将无法访问",oneHour:"临时迁移环境保留 1 小时",ended:"临时迁移环境已结束",savedAvailable:"已保存项目仍可查看、下载、部署或优化",unavailable:"任务记录和临时产物已无法访问",countdown:"临时迁移环境将在 {{minutes}} 分 {{seconds}} 秒后结束",expiredSavedMessage:"临时迁移环境已结束,已保存项目不受影响。",expiredMessage:"临时迁移环境已结束,任务记录和临时产物无法继续访问。"},$xe={recommended:"建议迁移方式",scope:"迁移范围",excluded:"不在本次范围",viewEvidence:"查看分析证据",viewAssumptions:"查看关键假设",viewSourceEvidence:"查看源码证据"},Fxe={ariaLabel:"Codex 执行动态",title:"Codex 执行动态",startingAnalysis:"Codex 正在开始分析…",startingMigration:"Codex 正在开始迁移…",loadError:"暂时无法读取 Codex 执行动态,不影响当前任务。",liveAnalyzing:"正在分析项目",liveMigrating:"正在执行迁移",liveValidating:"正在校验迁移结果",livePackaging:"正在整理迁移产物",liveDelivery:"正在核对交付产物"},Bxe={title:"迁移产物",fileTooLarge:"该文件超过 2 MiB,请下载完整产物后查看。",unsupportedPreview:"该文件不支持在线预览,请下载完整产物后查看。",filesAria:"迁移产物文件",searchAria:"搜索产物文件",searchPlaceholder:"搜索文件",limit:"仅展示前 {{count}} 项,请搜索具体文件。",noSelection:"未选择文件",noPreview:"暂无可预览文件。",loadingFile:"正在读取产物文件…",startupFile:"启动文件",fileCountLabel:"文件数",saved:"源码已保存,可继续查看、下载、部署或优化。",saving:"产物已生成,正在保存源码版本。",deployReady:"产物可预览、下载和部署,正在等待源码保存状态。",deployUnavailable:"产物可预览和下载,但当前交付状态不支持部署。",viewProjects:"查看已迁移项目",downloading:"下载中…",downloadZip:"下载 ZIP",deployTitle:"部署迁移产物",deployUnavailableTitle:"当前交付状态不支持部署",deployRuntime:"部署到 Runtime",fileCount:"{{count}} 个文件",startup:"启动文件 {{module}}",loading:"正在读取迁移产物…"},Uxe={retiring:"即将下线",currentDefault:"当前默认模型",loadError:"加载模型列表失败",label:"模型",placeholder:"选择模型"},Qxe={zipOnly:"请选择 .zip 格式的本地项目文件。",invalidName:"ZIP 文件名无效,请重命名后重新选择。",tooLarge:"项目 ZIP 不能超过 {{size}}。",empty:"项目 ZIP 不能为空。",removeAria:"移除项目 ZIP",reselectPrompt:"重新选择项目 ZIP",selectPrompt:"选择或拖入本地项目 ZIP",reselect:"重新选择",selectZip:"选择 ZIP",continue:"继续上传",start:"上传并分析",inputAria:"选择本地项目 ZIP",retention:"临时迁移环境从创建完成起保留 1 小时;保存成功的源码版本不受影响。",uploading:"上传中…",sizeHint:"支持项目 ZIP,最大 {{size}}"},zxe={requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}",notReady:"迁移产物尚未准备完成。",back:"返回迁移结果"},Vxe={backToAddAgent:"返回添加 Agent",title:"从存量迁移",newMigration:"新建迁移",recent:"最近迁移",loadingSessions:"正在读取迁移会话…",noSessions:"暂无迁移会话",heading:"迁移存量 Agent 项目",intro:"上传本地项目 ZIP,Codex 将先进行只读分析,再由你确认迁移方式。",backToHome:"迁移首页",navigation:"迁移导航",showMore:"查看更多",showLess:"收起",projectName:"项目名称",status:"状态",createdAt:"创建时间",actions:"操作",openTask:"查看迁移 {{name}}",continueTask:"继续",viewTask:"查看"},Hxe={stop:"终止迁移",stopping:"正在终止…",cancel:"取消",reload:"重新读取",refreshStatus:"刷新状态"},qxe={unavailable:"迁移能力暂不可用",defaultReason:"Dev Sandbox 暂不可用,请联系管理员检查配置。"},Wxe={creatingSandbox:"正在创建 Dev Sandbox",initializing:"正在初始化迁移工作目录,并检查 AgentKit CLI、Codex 和迁移能力。环境就绪后将自动上传项目。",elapsed:"已等待 {{duration}}",uploadThenAnalyze:"ZIP 上传完成后将自动开始只读分析。",analyzing:"Codex 正在识别框架、入口和迁移边界,不会执行实际迁移。",migrationLocked:"迁移执行中不能修改附件或迁移方式。你可以等待当前任务结束,或主动终止。",analysisPaused:"只读分析已暂停。请仅回答下面列出的问题,提交后会在同一迁移环境中重新分析,不会开始实际迁移。",analysisComplete:"只读分析已完成。请检查建议,并确认最终迁移方式。",awaitingUpload:"迁移环境已创建,请重新选择本地 ZIP 继续上传。",expiredTitle:"迁移环境已过期",expiredDescription:"迁移内容和产物已无法预览、下载或部署。如已完成 Runtime 部署,可返回智能体页面继续使用。",unsupportedTitle:"当前 ZIP 暂时无法迁移",unsupportedHint:"请按提示整理项目后,新建迁移并重新上传。",failedTitle:"迁移未完成",cancelled:"当前迁移已终止。你可以新建迁移并重新上传项目。"},Kxe={ariaLabel:"补充项目分析信息",title:"补充分析所需信息",description:"附件保持锁定,提交后仅继续只读分析",submitting:"正在继续分析…",submit:"提交并继续分析"},Gxe={ariaLabel:"回答迁移需要你决定的问题",title:"迁移需要你的回答",description:"回答后会在当前这一步里继续,不需要重新开始",other:"其他",otherPlaceholder:"也可以直接输入你的答案",submitting:"正在提交回答…",submit:"提交回答并继续"},Xxe={ariaLabel:"确认迁移方式",title:"确认迁移方式",framework:"迁移方式",frameworkPlaceholder:"选择迁移方式",agentName:"Agent 名称",entry:"项目入口",entryPlaceholder:"选择项目入口",entryExample:"例如 agent.py:agent",consent:"点击“确认并开始迁移”即确认上述迁移范围、排除项和关键假设。",starting:"正在启动迁移…",start:"确认并开始迁移"},Yxe={setup:{title:"迁移效果评测",description:"迁移完成后自动执行评测用例。",on:"已开启",off:"未开启",unavailable:"当前环境暂不支持迁移效果评测。",casesTitle:"评测用例",casesDescription:"至少添加一个用例。期望结果和评测标准可选。",configuredSummary:"{{count}} 个用例 · {{preset}} · {{dimensions}}",incompleteSummary:"{{count}} 个用例待填写 · {{preset}} · {{dimensions}}",dimensionSummary:"{{count}} 个维度",editSettings:"编辑设置",viewSettings:"查看设置",lockedTitle:"评测用例",lockedDescription:"上传开始后不可修改。",closeAria:"关闭评测设置",done:"完成配置",close:"关闭"},tabs:{label:"迁移任务内容",migration:"迁移",evaluation:"效果评测",waitingMigration:"等待迁移",waitingConfiguration:"待配置",running:"评测中",completed:"已完成",issue:"需处理"},bulk:{open:"批量粘贴",label:"每行输入一个用例",placeholder:`帮我查询今天的订单状态 -把结果整理成三点`,preview:"将添加 {{count}} 个用例",confirm:"添加用例"},case:{title:"用例 {{index}}",add:"添加用例",moveUp:"上移用例 {{index}}",moveDown:"下移用例 {{index}}",copy:"复制",delete:"删除",userInput:"用户输入",userInputPlaceholder:"例如:请帮我查询今天的订单状态",expectedOutcome:"期望结果(可选)",expectedOutcomePlaceholder:"描述希望 Agent 完成什么,不要求逐字一致",criteria:"必须满足的要求(可选)",addCriterion:"添加要求",criterionLabel:"必须满足的要求 {{index}}",criterionPlaceholder:"例如:必须包含订单号和当前状态",removeCriterion:"删除要求 {{index}}"},advanced:{title:"高级设置",standard:"标准评测",standardDescription:"默认包含语义一致性、输出约束、工作流与工具一致性 3 个维度,适合多数迁移。",custom:"自定义维度",customDescription:"按业务风险选择一个或多个评测维度。",lockedDescription:"项目开始上传后,评测方式和维度不再修改。"},dimension:{semantic_fidelity:"语义一致性",output_contract:"输出约束",workflow_tool_fidelity:"工作流与工具一致性",context_memory_fidelity:"上下文与记忆一致性",boundary_error_fidelity:"边界与异常一致性",safety_refusal_fidelity:"安全与拒答一致性"},dimensionDescription:{semantic_fidelity:"检查意图理解、结论和关键事实是否保持一致。",output_contract:"检查字段、结构、语言和格式约束是否保持。",workflow_tool_fidelity:"检查可观察的工作流分支和工具行为是否保持。",context_memory_fidelity:"检查可验证的多轮上下文和记忆行为。",boundary_error_fidelity:"检查无效输入、信息缺失和依赖失败时的行为。",safety_refusal_fidelity:"检查已有授权、拒答和敏感信息边界是否保持。"},validation:{caseCount:"请保留 1–{{count}} 个用例。",dimensionRequired:"请至少选择一个评测维度。",userInputRequired:"请输入用例内容。",userInputBytes:"单个用例不能超过 32 KiB。",expectedOutcomeBytes:"期望结果不能超过 16 KiB。",criteriaCount:"单个用例最多包含 {{count}} 条要求。",criterionRequired:"要求不能为空。",criterionBytes:"单条要求不能超过 2 KiB。",datasetBytes:"全部评测用例不能超过 10 MiB。"},dataset:{invalidLockResponse:"服务未确认评测用例已保存,请重试。",loadingSettings:"正在读取评测设置…",loadSettingsFailed:"评测设置读取失败。",retryLoadSettings:"重新读取",missing:"未找到已保存的评测用例,请重新填写并保存。",saveWarning:"评测用例暂未保存,不影响迁移。",retrySave:"重新保存评测用例",saving:"正在保存…"},state:{disabled:"未开启评测",waiting_dataset:"等待填写评测用例",pending:"迁移完成后自动开始评测",preparing:"正在准备评测环境…",waiting_environment:"需要补充运行所需的环境变量",deploying:"正在部署临时 Runtime…",executing:"正在执行评测用例…",judging:"正在执行评测分析…",aggregating:"正在汇总评测结果…",completed:"评测已完成",failed:"评测未完成",blocked:"评测需要处理后才能继续",cancelled:"评测已取消"},progress:{label:"迁移与迁移效果评测进度",migration:"迁移",evaluation:"迁移效果评测",notStarted:"未开始",inProgress:"进行中",completed:"完成",waitingConfiguration:"等待配置",issue:"有问题"},environment:{description:"填写临时 Runtime 所需的环境变量。",security:"仅用于本次评测。",optional:"可选",submit:"提交并继续评测",submitting:"正在提交…"},execution:{preparing:"准备评测",preparingDetail:"校验迁移产物和 {{count}} 个评测用例",deploying:"启动 Runtime",deployingDetail:"准备 {{runtime}}",runtimeFallback:"隔离运行环境",executing:"执行用例",executingDetail:"执行 {{count}} 个用例并记录输出",judging:"执行评测分析",judgingDetail:"评测 {{cases}} 个用例 · {{dimensions}} 个维度",aggregating:"生成评测报告",aggregatingDetail:"汇总评分与证据,生成 HTML 报告",waiting:"等待中",running:"执行中",failed:"失败",complete:"已完成"},result:{title:"执行进度",attempt:"第 {{attempt}} 次评测",pending:"等待迁移完成",retry:"重新评测",retrying:"正在重试…",failureStage:"失败阶段",errorCode:"错误码",taskId:"任务 ID",diagnosticAttempt:"评测轮次",runtime:"Runtime",errorDetails:"错误详情",diagnosticField:"{{label}}:{{value}}",diagnosticHeading:"{{label}}:",loadingReport:"正在读取评测报告…",reportTitle:"HTML 评测报告",reportHtmlDescription:"查看或下载 HTML 报告。",viewReport:"查看报告",reportDrawerDescription:"评分、差异与证据",closeReport:"关闭",closeReportAria:"关闭评测报告",reportPreviewTitle:"迁移效果评测报告预览",reportSummary:"评测摘要",reportVersion:"评测集 {{version}} · Prompt v{{prompt}}",downloadReport:"下载完整报告",downloadingReport:"正在下载…",overallScore:"综合一致性",scoreScale:"0–100;证据不足时显示 N/A",evidenceCoverage:"证据覆盖率",coverageDetail:"{{scored}} / {{total}} 个维度有证据",executionSuccess:"执行成功率",executionDetail:"{{succeeded}} / {{total}} 个用例完成",naCount:"N/A 数量",naDescription:"证据不足,不计入分数",gapDescription:"迁移差距说明",lowestScoringCases:"低分用例",executionFailures:"执行异常",criticalEvidence:"Critical 证据",limitations:"评测限制",viewEvidence:"查看 {{count}} 个用例的结果与证据",outputTruncated:"输出过长,已截断",executionState:{succeeded:"执行完成",failed:"执行异常"},severityLabel:"严重度:{{severity}}",severity:{none:"无",low:"低",medium:"中",high:"高",critical:"Critical",unknown:"未知"},evidenceSource:{user_reference:"期望结果",user_criteria:"填写的要求",source_contract:"源项目约束",observed_output:"实际输出",runtime_observation:"Runtime 原始数据",deterministic_assertion:"确定性断言"},listSeparator:"、"}},Zxe={closeAria:"关闭错误提示",loadFailed:"无法读取迁移数据,请重试。",refreshFailed:"无法刷新迁移状态,请重试。"},Jxe={title:"终止当前迁移?",description:"终止后,当前分析或迁移进程将停止,已执行的步骤不会继续。"},FVe={common:Cxe,optimization:Axe,projects:Txe,framework:_xe,state:jxe,historyStatus:Nxe,task:Rxe,verification:Ixe,transfer:Pxe,validation:Dxe,duration:Mxe,expiry:Lxe,analysis:$xe,activity:Fxe,artifact:Bxe,model:Uxe,upload:Qxe,deployment:zxe,workspace:Vxe,actions:Hxe,capability:qxe,conversation:Wxe,questions:Kxe,pendingInput:Gxe,confirmation:Xxe,evaluation:Yxe,errors:Zxe,stopDialog:Jxe},BVe=Object.freeze(Object.defineProperty({__proto__:null,actions:Hxe,activity:Fxe,analysis:$xe,artifact:Bxe,capability:qxe,common:Cxe,confirmation:Xxe,conversation:Wxe,default:FVe,deployment:zxe,duration:Mxe,errors:Zxe,evaluation:Yxe,expiry:Lxe,framework:_xe,historyStatus:Nxe,model:Uxe,optimization:Axe,pendingInput:Gxe,projects:Txe,questions:Kxe,state:jxe,stopDialog:Jxe,task:Rxe,transfer:Pxe,upload:Qxe,validation:Dxe,verification:Ixe,workspace:Vxe},Symbol.toStringTag,{value:"Module"})),ewe={loading:"加载中…",searchLabel:"搜索{{label}}",searchPlaceholder:"搜索{{label}}",retry:"重试",noMatches:"没有匹配项",noOptions:"暂无可选项",selection:"{{label}}:{{value}}"},twe={badge:"焕然一新",view:"查看新特性",title:"本次更新",defaultNotes:{multiRegion:"多地域智能体:并行加载北京与上海 Runtime,列表下滑即可继续加载。",switchAgent:"会话内切换:在输入框旁选择智能体,并直接开启一段新会话。",visualCanvas:"可视化执行画布:通过横向画布查看多智能体结构,并支持全屏浏览。"}},nwe={label:"新会话模式",agent:"智能体",skill:"技能定制",video:"视频创作"},iwe={select:"选择新会话模式",agent:{label:"Agent",description:"与当前选择的 Agent 对话"},builtin:{label:"内置智能体",description:"使用平台提供的智能体"},codex:{label:"Codex 智能体",description:"在沙箱中执行任务"},deepseekHarness:{label:"DeepSeek Harness",description:"打开 DeepSeek Harness 工作区"},arkClaw:"ArkClaw",hermes:"Hermes 智能体",checking:"正在检查配置",notConfigured:"管理员未配置",unavailable:"暂不可用"},rwe={select:"选择智能体",typesLabel:"智能体类型",listLabel:"{{type}}列表",types:{agent:"智能体",general:"通用智能体",mpa:"MPA 智能体",codex:"Codex 智能体",deepseekHarness:"DeepSeek Harness",openclaw:"OpenClaw 智能体",hermes:"Hermes 智能体"},loading:"正在加载智能体",reload:"重新加载",empty:"暂无{{type}}",emptyLocal:"暂无本地智能体",emptyGeneral:"暂无通用智能体",createHint:"请前往智能体页创建",localHint:"请检查当前 Studio 启动目录",waking:"正在唤醒",opening:"正在打开",connecting:"正在连接",loadingMore:"加载中",loadMore:"加载更多",runtimeTimeout:"加载智能体超时(15 秒),请检查网络或 Runtime 服务后重试",loadGeneral:"加载通用智能体",loadType:"加载 {{type}}",connectGeneral:"连接通用智能体",openLocal:"打开本地智能体",openType:"打开 {{type}}",wakingHint:"正在唤醒智能体,可能需要一些时间。"},swe={spaceAria:"技能空间",configuration:"技能定制配置",actions:{create:"技能生成",optimize:"技能优化"},selectAction:"选择技能定制方式",actionList:"技能定制方式",style:"风格",selectStyle:"选择风格",model:"模型",selectModel:"选择模型",styles:{concise:"简洁实用",strict:"严谨稳健",tutorial:"教程友好",automation:"自动化优先"},modelLoadFailed:"模型配置加载失败",spaceLoadFailed:"Skill Space 加载失败",skillLoadFailed:"Skill 加载失败",unnamedSpace:"未命名 Skill Space",space:"技能空间",select:"选择 Skill",selectAria:"选择 Skill:{{skill}}",loadingSpaces:"正在加载 Skill Space",reload:"重新加载",emptySpaces:"暂无 Skill Space",skillList:"{{space}} Skill 列表",loadingSkills:"正在加载 Skill",emptySkills:"暂无 Skill"},awe={modes:{auto:"自动识别",text_to_video:"文生视频",reference_to_video:"参考素材生视频",video_editing:"视频编辑",video_extension:"视频续写",first_last_frame:"首尾帧生成"},taskNames:{auto:"视频生成",text_to_video:"文生视频",reference_to_video:"参考素材生视频",video_editing:"视频编辑",video_extension:"视频续写",first_last_frame:"首尾帧生成"},controls:{label:"视频创作配置",aspectRatio:"比例",selectAspectRatio:"选择比例",resolution:"清晰度",selectResolution:"选择清晰度",duration:"时长",durationShort:"{{count}} 秒",durationAria:"视频时长:{{count}} 秒",lastFrame:"尾帧",lastFrameHelper:"添加视频结束画面",assistImage:"辅助图片",referenceImage:"参考图片",assistImageHelper:"用于补充画面参考",imageHelper:"支持常见图片格式",referenceVideo:"参考视频",videoHelper:"支持常见视频格式",optional:"可选",replace:"更换",add:"添加",upload:"上传{{label}}",replaceFile:"更换{{label}}:{{name}}",removeFile:"移除{{label}} {{name}}",storageUnavailable:"管理员未配置持久化存储",loadingEnhancer:"正在加载增强模型",enhancerHint:"使用 {{model}} 模型进行意图识别和提示词增强",enhancerUnavailable:"增强模型不可用"},task:{title:"视频生成任务",closeAria:"关闭视频生成任务弹窗",progressAria:"视频生成进度",optimizedPrompt:"优化后的提示词",processingAria:"{{task}}处理进度",waitingAria:"{{status}},已等待{{elapsed}}",elapsed:"已等待 {{elapsed}}",previewAria:"生成结果预览",close:"关闭",download:"下载视频",retryOptimization:"重试提示词优化",retryGeneration:"重试视频生成",providerQueued:"等待模型调度",providerRunning:"模型生成中",providerSubmitting:"正在提交任务",queuedHint:"任务已提交,模型开始处理后状态会自动更新",runningHint:"这可能持续数分钟,完成后将在这里显示视频预览",backgroundHint:"可以关闭弹窗,任务会继续在后台运行",successHint:"视频已生成,可预览或下载",activationHint:"请先在模型控制台开通服务,再重试生成",retryHint:"修正问题后可重试当前步骤",steps:{optimizationFailed:"提示词优化失败",optimizationDone:"提示词优化完成",optimizationActive:"提示词优化中",generationDone:"{{task}}已完成",generationFailed:"{{task}}失败",generationQueued:"{{task}}排队中",generationRunning:"{{task}}生成中",generationActive:"{{task}}进行中",generationPending:"等待视频生成",generationComplete:"视频生成完成"},elapsedHours:"{{hours}}小时{{minutes}}分",elapsedMinutes:"{{minutes}}分{{seconds}}秒",elapsedSeconds:"{{seconds}}秒"}},owe={compactSelect:ewe,featureNotice:twe,workspace:nwe,mode:iwe,agentPicker:rwe,skill:swe,video:awe},UVe=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:rwe,compactSelect:ewe,default:owe,featureNotice:twe,mode:iwe,skill:swe,video:awe,workspace:nwe},Symbol.toStringTag,{value:"Module"})),lwe="审核中心",cwe="审核资源类型",uwe="仅管理员可以访问审核中心",dwe="搜索申请名称、提交人或版本",fwe="审核状态",hwe="{{count}} 条待审核",pwe="共 {{count}} 条申请",mwe={skill:"技能",agent:"智能体"},gwe={all:"全部状态",pending:"待审核",approved:"已通过",returned:"已退回",approving:"发布中"},bwe={application:"申请名称",submitter:"提交人",version:"版本",submittedAt:"提交时间",status:"状态",actions:"操作"},ywe={details:"详情",detailsFor:"查看 {{name}} 的申请详情",approve:"通过",approveFor:"通过 {{name}} 的申请",return:"退回",returnFor:"退回 {{name}} 的申请",close:"关闭",backToDetails:"返回详情",confirmApprove:"确认通过",confirmReturn:"确认退回",clearFilters:"清除筛选",refresh:"刷新",cancel:"取消",resumeApproval:"继续发布"},vwe={title:"暂无审核申请",description:"提交的审核申请会显示在这里",filteredTitle:"没有匹配的申请",filteredDescription:"试试其他关键词,或调整审核状态"},xwe={title:"申请详情",sections:"申请详情内容",overview:"申请信息",files:"提交文件 · {{count}}",requestType:"申请类型",update:"版本更新",firstRelease:"首次发布",source:"来源",source_skill:"{{name}}的个人技能空间",source_agent:"{{name}}的开发环境",destination:"发布目标",destination_skill:"企业共享技能空间",destination_agent:"全员共享智能体",region:"区域",visibility:"发布后可见范围",shared:"全员可见",description:"功能说明",changes:"本次提交说明",example:"使用示例",history:"审核记录",submitted:"{{name}}提交申请",versionFixed:"仅审核本次提交的版本",instructions:"使用说明",filesTab:"提交文件",filesFailed:"加载提交文件失败",unknownAuthor:"未知申请人",reviewer:"审批人",reviewedAt:"审批时间",approved:"{{name}}通过申请",returned:"{{name}}退回申请",unknownReviewer:"未知审批人",approvedBy:"通过人",returnedBy:"退回人",comment:"审批评论",result:"审批结果",noHistory:"此技能尚未提交审核",pendingHint:"等待管理员审核",approvingHint:"管理员已确认通过,正在发布到企业共享空间",approving:"{{name}}确认通过,等待完成发布"},wwe={failed:"待审核空间暂不可用",retry:"重试"},kwe={approveTitle:"通过申请",returnTitle:"退回申请",approveDescription:"通过后,{{name}} 的 {{version}} 版本将在企业共享空间中向全员公开",returnDescription:"退回 {{name}} 的 {{version}} 版本,并向申请人说明原因",reason:"退回理由",reasonRequired:"请填写退回理由",reasonHelp:"最多 256 个字符,申请人可以看到此理由",saving:"处理中…",failed:"审批失败,请重试",approved:"{{name}} 已通过并公开",returned:"{{name}} 已退回",comment:"评论(可选)",commentHelp:"最多 256 个字符,申请人可以看到此评论"},Owe={title:"AI 评分",points:"{{score}} 分",insufficient:"依据不足",status:{unscored:"尚未评分",not_requested:"尚未评分",queued:"等待评分",running:"评分中",completed:"已评分",failed:"评分失败"},loading:"加载评分…",starting:"正在提交评分…",loadFailed:"加载评分失败",retryFailed:"提交评分失败",failed:"评分未完成,请管理员重试",retry:"重新评分",start:"开始评分",reload:"重新加载",download:"下载 JSON",expand:"展开",collapse:"收起",hint:"评分针对本次提交版本,供人工审批参考",dimensions:{safety:"安全性",usability:"易用性",completeness:"完整性",reliability:"可靠性",maintainability:"可维护性"},risks:"风险提示",suggestions:"改进建议",model:"评分模型",rubric:"评分标准版本",time:"评分时间",severity:{low:"低风险",medium:"中风险",high:"高风险",critical:"严重风险"},coverage:"评审范围",coverageCount:"已评审 {{included}} / {{total}} 个文件",coverageIncomplete:"部分内容未纳入评审,评分依据不完整",omittedFile:"未评审 {{path}}:{{reason}}",truncatedFile:"仅评审部分内容 {{path}}:{{reason}}",originalError:"云端原始错误"},QVe={title:lwe,category:cwe,adminOnly:uwe,search:dwe,filterStatus:fwe,pendingCount:hwe,total:pwe,kind:mwe,status:gwe,columns:bwe,actions:ywe,empty:vwe,detail:xwe,space:wwe,decision:kwe,score:Owe},zVe=Object.freeze(Object.defineProperty({__proto__:null,actions:ywe,adminOnly:uwe,category:cwe,columns:bwe,decision:kwe,default:QVe,detail:xwe,empty:vwe,filterStatus:fwe,kind:mwe,pendingCount:hwe,score:Owe,search:dwe,space:wwe,status:gwe,title:lwe,total:pwe},Symbol.toStringTag,{value:"Module"})),Swe={cancel:"取消",close:"关闭",retry:"重试",tryAgain:"重新尝试",closeDialog:"关闭{{title}}",agentFallback:"{{agent}} 智能体",unknownSource:"未知来源"},Ewe={terminalTitle:"终端",browserTitle:"沙箱浏览器",terminalSubtitle:"连接当前 AgentKit Session 的交互式终端",browserSubtitle:"在当前 AgentKit Session 中查看与操作浏览器",connecting:"正在连接…",connected:"已连接",notConnected:"尚未连接",opening:"正在打开 {{title}}",connectingSession:"工具正在连接当前 AgentKit Session。",openFailed:"{{title}} 打开失败"},Cwe={title:"恢复 Codex 对话",subtitle:"选择当前 Sandbox Session 中最近更新的 Thread",loading:"正在读取历史对话",loadFailed:"历史对话读取失败",empty:"暂无可恢复的对话"},Awe={title:"Codex 权限",subtitle:"设置会保存到当前 Sandbox Session,并同步到其中的所有 Thread",sandboxMode:"沙箱模式",approvalPolicy:"审批策略",approvalMethod:"审批方式",networkAccess:"允许网络访问",networkAccessHelp:"控制 workspace-write 与只读模式中的外部网络访问。",fullAccessWarning:"完全访问会关闭文件系统与网络隔离,请只在可信任务中使用。",save:"保存权限",sandboxChoices:{readOnly:{label:"只读",detail:"允许读取文件,不允许写入工作空间。"},workspaceWrite:{label:"工作区写入",detail:"允许在当前工作空间内读取与修改文件。"},fullAccess:{label:"完全访问",detail:"不启用沙箱隔离,适合明确可信的任务。"}},approvalChoices:{untrusted:{label:"仅不可信命令",detail:"只对 Codex 判断为不可信的操作发起审批。"},onRequest:{label:"按需审批",detail:"Codex 可在必要时请求你确认命令或文件修改。"},never:{label:"不审批",detail:"Codex 不会暂停并请求人工批准。"}},reviewerChoices:{user:{label:"由我审批",detail:"审批请求会显示在 Studio 中,由你决定。"},autoReview:{label:"自动审查",detail:"使用 Codex 自动审查流程处理审批请求。"}}},Twe={title:"工作空间",subtitle:"选择当前 Codex Thread 执行命令与修改文件的目录",absolutePath:"绝对路径",browse:"浏览",parent:"上一级",empty:"当前目录没有子目录",locked:"当前对话已经开始,工作空间已锁定。新建 Sandbox 会话后可重新选择。",useDirectory:"使用此目录"},_we={fileTitle:"允许修改文件?",commandTitle:"允许执行命令?",subtitle:"Codex 正在等待你的决定",workingDirectory:"执行目录",decline:"拒绝",acceptOnce:"仅本次允许",acceptSession:"本会话允许"},jwe={availableSkills:"可用 Skills",selectModel:"选择模型",commands:"Codex 快捷命令",currentModel:"当前:{{model}}",loadingSkills:"正在发现当前工作区的 Skills…",loadingModels:"正在读取模型…",noSkillMatches:"当前工作区没有匹配的 Skill",noModelMatches:"没有匹配模型,也可以直接输入模型 ID",noCommandMatches:"没有匹配的快捷命令",skillFallback:"加载并执行该 Skill",add:"添加",uploadImage:"上传图片",uploadDocument:"上传文档或 PDF",uploadVideo:"上传视频",openTerminal:"进入终端",viewBrowser:"查看浏览器",permissions:"Codex 权限",workspaceLocked:"对话已开始,工作空间已锁定",selectWorkspace:"选择工作空间",workspace:"Codex 工作空间",endpointCopied:"Endpoint 已复制",copyEndpoint:"复制 Sandbox Endpoint",continuePlaceholder:"继续说明你想实现或调整的内容",messagePlaceholder:"向 AgentKit 沙箱发送消息,输入 / 查看命令,输入 $ 调用 Skill…",stop:"停止生成",send:"发送",stopping:"正在确认停止…",resume:"恢复任务",steer:"追加要求",steerPlaceholder:"可继续追加要求,或随时停止任务…"},Nwe={defaultName:"我的智能体",namedDefault:"我的 {{agent}}",creatingTitle:"正在创建 {{agent}} 智能体",failedTitle:"启动失败",createTitle:"创建 {{agent}} 智能体",fallbackError:"AgentKit 沙箱初始化失败,请稍后重新尝试。",creatingDescription:"正在创建并等待 {{agent}} 智能体就绪,这通常需要半分钟",name:"智能体名称",storageSize:"存储大小",storageHelp:"数据将持久化保存,可设置 {{min}}–{{max}} GiB。",persistent:"持久化",persistenceUnsupported:"当前环境不支持快照持久化",persistentHelp:"保留智能体数据,后续可继续使用。",temporaryHelp:"智能体将在 8 小时后清空",cancelCreation:"取消创建",confirm:"确认创建",retry:"重新尝试"},Rwe={activeAria:"Codex 智能体会话已开启",openAria:"开启 Codex 智能体会话",active:"Codex 智能体会话中",entry:"灵光一现",exit:"退出当前智能体",expired:"已到期",remainingHours:"剩余 {{hours}} 小时 {{minutes}} 分钟",remainingMinutes:"剩余 {{minutes}} 分钟",expiryWarning:"远端开发环境最长保留 8 小时,将于 {{expiry}} 到期({{remaining}});到期后清除对话和文件。",usingAgent:"当前您在使用 {{agent}} 智能体",activityAria:"Sandbox 操作记录",activity:"操作记录",tokenUsageAria:"Codex Token 用量",tokens:"{{label}}:{{value}} tokens",tokenLabels:{total:"总计",input:"输入",cachedInput:"缓存输入",output:"输出",reasoningOutput:"推理输出"}},Iwe={back:"返回智能体列表",subtitle:"{{agent}} 智能体详情",type:"智能体类型",status:"状态",createdBy:"创建人",snapshotStatus:"快照状态",toolType:"工具类型",createdAt:"创建时间",snapshotReason:"快照原因",expiresAt:"过期时间",snapshotId:"快照 ID",sessionId:"会话 ID",sourceSessionId:"来源 Session ID",delete:"删除智能体",waking:"唤醒中…",opening:"打开中…",wake:"唤醒智能体",open:"打开智能体",deleteTitle:"删除智能体?",deleteDescription:"将删除“{{name}}”及其保存的数据,此操作无法撤销。",deleting:"删除中…",confirmDelete:"确认删除",sleepingHint:"该智能体已休眠,进入时需要唤醒,可能需要一些时间。",wakingHint:"正在唤醒智能体,可能需要一些时间。",agentId:"智能体 ID"},Pwe={back:"返回智能体列表",createdBy:"创建人 {{creator}}",ariaLabel:"智能体工作区",main:"主界面",terminal:"终端",mainTitle:"{{agent}} 主界面",openingTerminal:"正在打开终端…",terminalTitle:"{{agent}} 终端"},Dwe={prompt:`使用 AgentKit Studio Plugin 端云接力当前会话、项目和任务。请直接执行,不要让我手动打开终端。 +- 保持礼貌、专业的语气。`},Xve={requestFailed:"请求失败 ({{status}}){{detail}}",a2aSpaces:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 AgentKit 智能体中心",loginRequired:"请先登录以访问 AgentKit 智能体中心"},vikingKnowledge:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 VikingDB 知识库",loginRequired:"请先登录以访问 VikingDB 知识库"},vikingMemory:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 VikingDB 记忆库",loginRequired:"请先登录以访问 VikingDB 记忆库"},mcpGateway:{missingHttpTool:"请返回“添加 MCP 工具”并添加至少一个 HTTP MCP 服务;MCP 稳定性治理不支持 stdio 服务。",missingUrl:"已添加的 HTTP MCP 工具缺少有效服务地址,请返回“添加 MCP 工具”补充后再发布。"},customModel:{fallbackName:"自定义模型",apiKeyLabel:"{{name}} 模型 API Key",fallbackApiKeyLabel:"{{name}} 的备用模型 {{model}} API Key"},deploymentEnv:{serverInjected:"由服务端注入",selectedApiKeyPlaceholder:"由所选 API Key 注入",mcpInjectedComment:"由已添加的 MCP 工具注入",restoredPlaceholder:"由 Studio 服务端安全恢复",generatedMcpPlaceholder:"由已添加的 HTTP MCP 工具自动生成",restoredHelp:"更新时由 Studio 服务端合并 MCP 地址与认证,不向浏览器返回旧密钥。",mergedMcpHelp:"Studio 服务端自动合并 MCP 地址与可选认证,不向浏览器返回旧密钥。",listSeparator:"、",requirementHint:"优化项“{{labels}}”依赖此配置。",requiredBy:"优化项“{{labels}}”依赖此配置,请填写 {{key}}。",required:"请填写 {{label}}({{key}})。",invalidJson:"JSON 格式不正确"},drafts:{unsupportedVersion:"本机草稿版本暂不受支持,请升级 Studio 后重试。",invalidFormat:"本机草稿数据格式无效。",readFailed:"无法读取本机草稿,浏览器中的草稿数据可能已损坏。",quotaExceeded:"浏览器存储空间不足,草稿未保存。请删除不需要的草稿或清理此站点的浏览器存储后重试。",writeRejected:"浏览器拒绝保存草稿,请检查站点存储权限后重试。"},skills:{searchFailed:"搜索失败 ({{status}})",downloadFailed:"下载技能失败 ({{status}})",agentKitRequestFailed:"AgentKit Skills 请求失败",missingManifest:"{{location}} 缺少 SKILL.md",invalidParentPath:"{{location}} 包含非法路径(..):{{path}}",invalidPath:"{{location}} 包含非法路径:{{path}}",localDescription:"本地 Skill",folderSource:"文件夹",noManifest:"{{location}} 中未发现 SKILL.md"},zip:{invalid:"无效的 zip:找不到 EOCD",tooManyFiles:"zip 文件数不能超过 {{count}} 个",tooLarge:"zip 解压后的内容过大"}},Yve={back:"返回开发会话",runtimeName:"Runtime 名称",runtimeNameExists:"Runtime 名称已存在,请更换后重试",checkingRuntimeName:"正在检查 Runtime 名称",verifiedSource:"已验证源码",deployableSource:"可部署源码",verifiedByCodex:"已通过 Codex 云端验证",entryPoint:"入口",files:"文件",artifact:"构建产物",validationReport:"验证报告",verifiedHint:"源码由服务端从已验证交付物物化,浏览器文件不能替换。",unverifiedHint:"源码已由服务端安全物化,部署前请确认 Runtime 配置。",env:{requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}"}},Zve={name:"代码包",back:"返回创建方式",reading:"正在读取代码包",readingEllipsis:"正在读取代码包…",uploadFirst:"请先上传代码包",uploadAriaLabel:"代码包上传",upload:"上传代码包",reupload:"重新上传代码包",uploadPrompt:"请上传代码包",filesRecognized:"已识别 {{count}} 个文件,点击区域可重新上传",dropHint:"点击或拖拽上传,支持 .zip 格式,最大 50 MB;可使用 app.py,或由 agentkit.yaml 声明入口",viewFiles:"查看文件",chooseFile:"选择代码包",errors:{invalidFormat:"请选择 .zip 格式的代码包。",tooLarge:"代码包不能超过 50 MB。",invalidPath:"压缩包包含非法路径:{{name}}",empty:"压缩包中没有可部署的文件。",tooManyFiles:"代码包文件数不能超过 {{count}} 个。",duplicateFile:"代码包包含重复文件:{{path}}",manifestParse:"agentkit.yaml 无法解析:{{detail}}",manifestRoot:"agentkit.yaml 根节点必须是对象。",manifestCommon:"agentkit.yaml 的 common 必须是对象。",entryPointType:"agentkit.yaml 的 common.entry_point 必须是文件路径。",entryPointInvalid:"agentkit.yaml 的 common.entry_point 不是有效文件路径。",entryPointMissing:"代码包中不存在 agentkit.yaml 声明的启动入口:{{entryPoint}}",defaultEntryPointMissing:"代码包根目录必须包含 app.py,或在 agentkit.yaml 的 common.entry_point 中声明已有入口。"}},Jve={label:"Agent 执行画布",readOnlyLabel:"只读 Agent 执行画布",minimapLabel:"执行流程缩略图",controls:{ariaLabel:"执行流程控制",zoomIn:"放大",zoomOut:"缩小",fitView:"适应视图"},rootAgent:"主 Agent",unnamedStep:"未命名步骤",terminals:{input:"用户请求",output:"最终回复"},edges:{then:"然后",continueLoop:"继续循环",call:"调用"},patterns:{llm:{label:"智能体",description:"理解任务并直接完成一个具体工作"},sequential:{label:"分步协作",description:"内部步骤按照顺序依次执行"},parallel:{label:"同时处理",description:"内部步骤同时工作,完成后统一汇总"},loop:{label:"循环执行",description:"重复执行内部步骤,直到满足停止条件"},a2a:{label:"远程智能体",description:"调用已经存在的远程 Agent"}},actions:{insertHere:"在这里插入步骤",deleteNamed:"删除 {{name}}",deleteNode:"删除节点",addSubagent:"添加子 Agent",addParallelStep:"添加一个同时处理的步骤",addLoopStep:"添加循环步骤",addNextStep:"添加下一个步骤",addFirst:"添加到最前",addLast:"添加到最后"}},e0e={title:"智能构建",subtitle:"描述需求,完成 Agent 的构建、调试与验证。",model:{label:"模型",placeholder:"选择模型",retiring:"即将下线",currentConfiguration:"当前配置",loadError:"加载模型列表失败"},availability:{checking:"正在检查智能开发能力…",unavailable:"当前无法使用智能模式,请返回后重试。"},goal:{title:"从目标开始",continueTitle:"继续优化项目",hint:"只需说明 Agent 要解决的问题;如有影响结果的关键信息,会在开始前向你确认。",continueHint:"说明这次要调整的内容,完成后会保存为新版本。",basedOn:"基于",clearSelection:"取消选择",label:"目标描述",optimizationLabel:"优化目标",placeholder:"例如:创建一个能读取销售数据、生成周报并校验输出格式的 Agent",optimizationPlaceholder:"例如:增加数据来源标注,并在信息不足时先向用户确认"},actions:{preparing:"准备中…",build:"开始构建",optimize:"开始优化"},preparation:{accepted:"目标已收到,马上开始实现",preparing:"正在创建任务环境…",starting:"环境已就绪,正在启动 Codex…",next:"接下来会先梳理目标和实现方式,再编写、运行和验证 Agent。"},tasks:{title:"进行中的任务",hint:"离开页面后仍会继续,可随时回来查看和补充要求。",refresh:"刷新任务列表",loading:"正在读取任务…",empty:"暂无进行中的任务",emptyHint:"开始构建后,可以从这里回到任务。",loadError:"暂时无法读取任务,请重试。",openError:"暂时无法打开任务,请重试。",startedAt:"开始于 {{time}}",open:"查看任务",opening:"正在连接…",states:{queued:"等待开始",running:"构建中",recovering:"正在重连",waiting_user:"等待你的回复",stopping:"正在停止",succeeded:"已完成",failed:"未完成",cancelled:"已停止"}}},t0e={title:"已保存项目",description:"选择已有版本继续优化,或查看、下载和部署源码。",refresh:"刷新项目列表",checkingStorage:"正在检查项目存储…",unavailableTitle:"暂时无法读取项目",storageCheckError:"无法确认项目存储状态,请稍后重试。",storageNotConfigured:"项目存储尚未配置。",loadingMigrated:"正在读取已迁移项目…",loadingSaved:"正在读取已保存项目…",loadingVersions:"正在读取项目版本…",unknownTime:"时间未知",sourceDownloaded:"源码已下载。",projectSummary_one:"{{count}} 个版本 · 更新于 {{time}}",projectSummary_other:"{{count}} 个版本 · 更新于 {{time}}",versionSummary_one:"{{time}} · {{count}} 个文件",versionSummary_other:"{{time}} · {{count}} 个文件",noVersionDescription:"暂无版本描述",latestVersion:"最新版本",defaultVersionName:"版本 · {{time}}",rename:{projectTitle:"修改项目名称",versionTitle:"修改版本名称",projectLabel:"项目名称",versionLabel:"版本名称",hint:"支持中英文、数字和常见标点,最多 {{max}} 个字符。",required:"请输入名称。",tooLong:"名称不能超过 {{max}} 个字符。",invalidCharacters:"名称不能包含换行、控制字符、不可见格式字符或 < >。",save:"保存名称",saving:"保存中…",updated:"名称已更新。",failed:"名称保存失败,请重试。"},verified:"已验证",pendingVerification:"待确认",viewSource:"查看源码",download:"下载",downloading:"下载中…",optimize:"去优化",optimizeUnavailable:"去优化,暂不支持",errors:{projects:"无法读取已保存项目。",source:"无法读取项目源码。",versions:"无法读取项目版本。",download:"下载源码失败。",prepareDeployment:"无法准备部署源码。",deleteVersion:"删除项目版本失败。",migrated:"无法读取已迁移项目",saved:"无法读取已保存项目"},empty:{migratedTitle:"还没有已迁移的项目",savedTitle:"还没有已保存的项目",migratedDescription:"完成首次迁移后,源码会自动保存在这里。",savedDescription:"完成首次构建后,源码会自动保存在这里。",noVersions:"这个项目还没有可用版本。"},compare:{selected:"已选择 {{count}}/2",selectedLabel:"已选择",select:"选择",view:"查看对比",start:"对比版本"},delete:{title:"删除这个版本?",onlyVersion:"“{{name}}”只有这一个版本,删除后项目也会移除。此操作无法撤销。",description:"该版本的源码和验证记录将永久删除,其他版本不受影响。",confirm:"删除版本"}},n0e={title:"选择创建方式",subtitle:"以不同模式构建您的智能体",features:"特性",quick:{title:"快速模式",description:"动态派生子智能体自主完成任务",features:{dynamicSubagents:"动态派生子智能体",autonomousPlanning:"自主规划执行",collaboration:"多智能体协作",summary:"自动汇总结果",skills:"按需调用技能",trace:"任务过程可追踪"}},traditional:{title:"传统模式",description:"高度自定义您的智能体结构",features:{visualConfig:"可视化配置",migration:"存量智能体迁移",debugging:"实时调试",optimization:"可选性能优化",parameters:"精细参数控制"}}},i0e={placeholder:"输入系统提示词;键入 ## 加空格可创建二级标题…",toolbar:{undo:"撤销 {{shortcut}}",redo:"重做 {{shortcut}}",paragraph:"正文",quote:"引用",heading:"标题 {{level}}",selectBlockType:"选择文本类型",blockType:"文本类型",bold:"加粗",removeBold:"取消加粗",italic:"斜体",removeItalic:"取消斜体",bulletedList:"无序列表",numberedList:"有序列表"}},r0e={local:{duplicatesSkipped:"已跳过重复技能:{{names}}",invalidDrop:"请拖入包含 SKILL.md 的文件夹或一个 .zip 文件",readError:"读取失败:{{detail}}",dropLabel:"拖入文件夹或 ZIP,自动识别 Skill",hint:"每个技能需包含 SKILL.md。支持包含多个技能的目录。",reading:"正在读取文件…",fileCount:"本地 · {{count}} 个文件"},hub:{searchError:"搜索失败,请稍后重试。",searchPlaceholder:"搜索火山 Find Skill 技能广场,例如 数据分析、PDF…",search:"搜索",searching:"正在搜索…",noResults:"没有找到匹配的技能,换个关键词试试。",hint:"输入关键词搜索火山 Find Skill 技能广场,所选技能会在生成项目时下载到 skills/ 目录。"},space:{loadError:"加载失败",loadingSpaces:"正在加载 AgentKit Skills 中心…",noSpaces:"此账号下没有 AgentKit Skills 中心。",selectSpace:"选择 AgentKit Skills 中心",openConsole:"在火山引擎控制台打开",loadingSkills:"正在加载技能列表…",noSkills:"此 AgentKit Skills 中心暂无技能。"}},s0e={unnamedNode:"未命名节点",editInstruction:"点击编辑指令…",controls:{ariaLabel:"工作流画布控制",zoomIn:"放大",zoomOut:"缩小",fitView:"适应视图"},sections:{info:"工作流信息",execution:"执行方式",nodes:"节点",nodeConfig:"节点配置"},types:{sequential:{label:"顺序",description:"节点依次执行"},parallel:{label:"并行",description:"节点同时执行"},loop:{label:"循环",description:"节点循环执行"}},placeholders:{description:"这个工作流做什么…",agentDescription:"这个 Agent 做什么…",instruction:"你是一个…"},errors:{workflowNameUnique:"名称须与 Agent 节点名称保持唯一",agentNameUnique:"Agent 名称在当前工作流中必须唯一"},dragHint:"拖拽到画布,或点击下方按钮添加",agentNode:"Agent 节点",addNode:"添加节点",connectHint:"拖拽节点的圆点连线以表达执行顺序。",create:"创建工作流",deleteNode:"删除节点",nameHelp:"仅使用英文字母、数字和下划线,且名称保持唯一。",instruction:"指令 (instruction)",tools:"工具 (逗号分隔)",nodeId:"节点 ID",empty:{selectNode:"选择一个节点以编辑其配置",summary:"共 {{nodes}} 个节点 · {{edges}} 条连线"}},a0e={ariaLabel:"快速模式创建",progress:"快速模式创建进度",steps:{agent:{label:"智能体",title:"基本信息",description:"设置智能体的名称、用途、行为方式与能力"},environment:{label:"执行环境",title:"配置执行环境",description:"选择默认环境或已构建的自定义环境"},deployment:{label:"部署偏好",title:"部署偏好",description:"定义 AgentKit 云上参数"}},model:{label:"模型",source:"模型来源",name:"模型名称",fallbacks:"Fallback 模型",fallbackPlaceholder:"备用模型名称",addFallback:"添加备用模型",addProviderFallback:"添加其他服务商",removeFallback:"移除",fallbackType:"备用模型类型",fallbackSameProvider:"同服务商",fallbackOtherProvider:"其他服务商",apiKeyEnv:"API Key 环境变量",invalidApiKeyEnv:"环境变量名只能包含字母、数字和下划线,且不能以数字开头。",fallbackHelp:"同服务商备用模型复用主模型连接;其他服务商会使用单独的 provider、API Base 和 API Key。",fallbackIgnored:"空值、重复值或与主模型相同的模型会被忽略。",provider:"服务商 Provider",invalidApiBase:"请输入合法的 http:// 或 https:// 链接。",volcengineArk:"火山方舟",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",currentApiKey:"当前 API Key",currentConfiguration:"当前配置",loadingApiKeys:"正在加载 API Key",selectApiKey:"选择 API Key",searchApiKeys:"搜索 API Key 名称",noApiKeys:"暂无可用 API Key",loadingModels:"正在加载模型",selectModel:"选择模型",searchModels:"搜索名称、Model ID 或服务商",noModels:"没有可用的模型",apiKeyPlaceholder:"请输入模型 API Key",credentialsLoadError:"模型凭据加载失败",modelsLoadError:"模型列表加载失败"},identity:{unnamedPool:"未命名用户池",currentPool:"{{value}}(当前用户池)",userPool:"用户池",loading:"正在加载用户池",placeholder:"请选择用户池",search:"搜索用户池",empty:"当前账号下暂无 Identity 用户池",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime",selectionHint:"当前 Studio 使用的用户池已在列表中标注"},agent:{namePlaceholder:"输入智能体名称",descriptionPlaceholder:"说明这个智能体可以做什么",prompt:"提示词",promptPlaceholder:"定义角色、目标和行为边界",skills:"技能",addSkill:"添加技能"},validation:{descriptionRequired:"请输入描述",promptRequired:"请输入提示词",modelRequired:"请选择模型",apiKeyRequired:"请先填写或选择模型 API Key",instanceIntegers:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数",instanceOrder:"最小实例数不能大于最大实例数",userPoolRequired:"请选择用于 Runtime 鉴权的用户池"},deployment:{runtimeName:"Runtime 名称",runtimeNameUpdateHint:"更新时保持现有 Runtime 名称不变",runtimeNameHint:"仅支持英文字母、数字、下划线和连字符",region:"发布区域",authentication:"鉴权方式",apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPoolDescription:"使用 Identity 用户池签发的 JWT",sessionStorage:"会话存储",inMemoryStorage:"In-memory 临时存储",backends:{sqlite:"SQLite 文件",mysql:"MySQL",postgresql:"PostgreSQL"},instances:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",inMemoryHint:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",networkMode:"网络模式",network:{public:"公网",private:"私网",both:"公网与私网"},subnetIds:"子网 ID(可选,多个用逗号分隔)",sharedInternet:"VPC 内共享公网出口",sharedInternetHint:"允许私网 Runtime 通过共享出口访问公网",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",evaluationSetsHint:"部署成功后自动创建 Good Case 和 Bad Case 评测集",resources:"资源配置",complete:"部署已完成",preparing:"正在准备部署…"},environmentVariables:{title:"环境变量",add:"添加变量",nameAriaLabel:"环境变量名称",valueAriaLabel:"{{name}} 的值",deleteNamed:"删除 {{name}}"},actions:{updateAgain:"再次更新",deployAgain:"重新部署",updateAndPublish:"更新并发布",applyProfile:"应用 Profile",applyProfileAgain:"再次应用 Profile"}},o0e={actions:{addSubagent:"添加子 Agent",clearRoot:"清空根 Agent",clearRootConfirmation:"清空根 Agent 的全部配置和子 Agent?此操作无法撤销。"},workspace:{progress:"Agent 创建进度",modes:{build:"架构",validate:"调试",optimize:"优化",environment:"环境",publish:"发布"},titles:{build:"个性化您的智能体架构",validate:"调试您的智能体",optimize:"为您的智能体选择优化项",environment:"配置云上环境",publish:"准备好部署您的智能体"}},sections:{type:{label:"Agent 类型",hint:"选择 Agent 类型"},basic:{label:"基本信息",hint:"名称、描述与系统提示词"},model:{label:"模型配置",hint:"模型与服务(可选)"},tools:{label:"工具",hint:"可调用的能力"},skills:{label:"技能",hint:"声明式技能"},knowledge:{label:"知识库",hint:"外部知识检索"},memory:{label:"记忆",hint:"短期与长期记忆"},subagents:{label:"子 Agent",hint:"嵌套协作"},review:{label:"完成",hint:"预览并创建"}},agentTypes:{ariaLabel:"Agent 类型",remoteChildOnly:"远程智能体只能作为子步骤使用",llm:{label:"智能体",fullLabel:"LLM 智能体",description:"大模型驱动,自主完成任务"},sequential:{label:"分步协作",fullLabel:"顺序型智能体",description:"子 Agent 按顺序依次执行"},parallel:{label:"同时处理",fullLabel:"并行型智能体",description:"子 Agent 并行执行后汇总"},loop:{label:"循环执行",fullLabel:"循环型智能体",description:"子 Agent 循环执行到满足条件"},a2a:{label:"远程智能体",fullLabel:"远程 Agent",description:"通过 A2A 协议调用远程 Agent"}},basic:{agentName:"Agent 名称",name:"名称",agentDescription:"智能体描述",descriptionPlaceholder:"简要描述这个 Agent 的用途,便于团队识别…",nameHelp:"遵循 Google ADK 命名规则,且在执行流程中保持唯一。",rootDescriptionHelp:"完整描述会保留;部署时会自动整理为符合 Runtime 规范的单行描述。",descriptionHelp:"描述会显示在 Agent 列表与选择器中。",orchestratorHelp:"这是一个协作容器,本身不生成回答。请在左侧画布中添加任务步骤,并通过拖拽调整它们的位置。",maxIterations:"最大轮次",maxIterationsHelp:"循环编排反复执行子 Agent,直到满足条件或达到该轮次上限。",agentCenter:"AgentKit 智能体中心",agentCenterHelp:"远程 Agent 的名称、描述和能力来自中心返回的 Agent Card。系统会根据每轮任务动态发现并挂载匹配的 Agent。",moreOptions:"更多选项",systemPrompt:"系统提示词",loadingMarkdown:"正在加载 Markdown 编辑器…",markdownHelp:"支持 Markdown 快捷输入,例如键入 ## 加空格创建二级标题。",unnamed:"未命名",unnamedAgent:"未命名智能体"},validation:{remoteRoot:"远程 Agent 只能作为子 Agent",missingRegistry:"请选择 AgentKit 智能体中心",name:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"},duplicateName:"Agent 名称在当前结构中必须唯一",missingDescription:"描述为必填项",mcpDuplicateName:"MCP 名称重复,请为每个服务使用唯一名称",mcpDuplicateUrl:"MCP 地址重复,请删除重复服务后再发布",missingSubagent:"缺少子 Agent",missingPrompt:"系统提示词为必填项",apiKeyRequired:"请先填写或选择模型 API Key",missingSubagentDetail:"{{type}}至少需要添加一个子 Agent 后才能调试或发布。",problem:"{{name}}:{{problem}}"},ai:{ariaLabel:"AI 自动填写 Agent 配置",minimumLength:"请至少输入 {{count}} 个字符。",replaceConfirmation:"生成的新配置会替换当前画布和属性,确定继续吗?",placeholder:"描述目标,使用 {{model}} 模型一键生成配置",generate:"智能生成",generating:"正在智能生成",success:"生成成功",regenerate:"重新生成",failed:"智能生成失败"},debug:{ariaLabel:"智能体调试工作区",unavailable:"当前后端暂不支持生成 Agent 调试运行。",baseline:"基准组",comparison:"对照组 {{count}}",selectModel:"请选择模型",enterDescription:"请输入描述",enterPrompt:"请输入系统提示词",duplicateConfiguration:"测试配置不能重复",starting:"启动中…",applyAndRestart:"应用并重启",restart:"重新启动",start:"启动环境",defaultModel:"默认模型",testConfiguration:"测试配置",deleteVariant:"删除 {{name}}",deleteVariantGroup:"删除对照组",creatingEnvironment:"正在创建测试环境…",configurationChanged:"配置已变更,请重新启动环境。",ready:"环境已就绪",readyHint:"发送消息以比较智能体回复。",startHint:"先完善配置,再启动环境。",viewTraceNamed:"查看 {{name}} 的调用链路",traceUnavailable:"发送消息后可查看调用链路",trace:"调用链路",useConfiguration:"使用此配置",finishConfiguration:"完成配置",finishAndStart:"完成并启动",currentAgentModel:"当前 Agent 模型",configurationHint:"修改仅用于本次对比,选择使用后才会进入部署流程。",messagePlaceholder:"向已启动的测试环境发送消息…",startOneFirst:"请先启动至少一个测试环境",addVariant:"添加对照组",traceTitle:"调用链路 · {{name}}",leaveTitle:"离开调试?",leaveDescription:"离开调试页面后,当前环境将被清理。您可以通过重新启动环境进行新的测试。",cleaning:"清理中…",confirmLeave:"确定离开",closeLeaveConfirmation:"关闭离开调试确认"},optimization:{ariaLabel:"智能体优化选项",scenario:"优化场景",components:"优化组件",bytePlusUnavailable:"BytePlus 账号暂不支持 Harness Sidecar 优化项。请保持优化项为空后继续部署,普通 BytePlus 智能体不受影响。",releaseScenario:"优化场景:{{profile}}",profiles:{default:{label:"自定义",description:"按需选择组件,不勾选时不启动 Sidecar。"},ops:{label:"运维场景",description:"适用于运维诊断、数据库、日志和监控 MCP。"}},groups:{quality:"提升回答质量",cost:"降低运行成本",stability:"增强运行稳定性"},options:{context_engine:{label:"上下文治理",description:"治理上下文组装、任务锚定和上下文预算。"},compressor:{label:"上下文与结果压缩",description:"压缩长上下文和大型工具结果,降低 Token 成本。"},verifier:{label:"回答校验与修复",description:"校验证据和回答,在失败时执行修复或告警。"},long_run_control:{label:"Goal 任务控制",description:"管理 Goal 任务的进度、续跑和结束条件。"},mcp_resilience:{label:"MCP 稳定性治理",description:"治理连接、超时、空结果、大返回和调用预算;默认包含 SQL 只读保护。"}}},model:{label:"模型",source:"模型来源",volcanoArk:"火山方舟",volcengineArk:"火山方舟",bytePlusModelArk:"BytePlus ModelArk",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",configuration:"模型配置",name:"模型名称",fallbacks:"Fallback 模型",fallbackPlaceholder:"备用模型名称",addFallback:"添加备用模型",addProviderFallback:"添加其他服务商",removeFallback:"移除",fallbackType:"备用模型类型",fallbackSameProvider:"同服务商",fallbackOtherProvider:"其他服务商",apiKeyEnv:"API Key 环境变量",invalidApiKeyEnv:"环境变量名只能包含字母、数字和下划线,且不能以数字开头。",fallbackHelp:"同服务商备用模型复用主模型连接;其他服务商会使用单独的 provider、API Base 和 API Key。",fallbackIgnored:"空值、重复值或与主模型相同的模型会被忽略。",provider:"服务商 Provider",invalidApiBase:"请输入合法的 http:// 或 https:// 链接。",liteLlmProviders:"LiteLLM 支持列表",apiKeyPlaceholder:"请输入模型 API Key",available:"已开通",retiring:"即将下线",notActivated:"未开通",unavailable:"暂不可用",apiKeyLoadError:"加载 Ark API Key 失败",loadingApiKeys:"正在加载 API Key…",selectApiKey:"选择 API Key",currentApiKey:"当前 API Key",apiKeyList:"API Key 列表",searchApiKey:"搜索 API Key",searchApiKeyName:"搜索 API Key 名称",noApiKeys:"暂无可用 API Key",noMatchingApiKey:"没有匹配的 API Key",loading:"正在加载模型…",loaded:"已加载 {{count}} 个模型",loadError:"加载模型失败",selectModel:"选择模型",selectProviderModel:"选择服务商模型",providerModels:"服务商模型",search:"搜索模型",searchPlaceholder:"搜索名称、Model ID 或服务商",noMatches:"没有匹配的模型",empty:"暂无可用模型",unknownStatus:"未知状态",refresh:"刷新",refreshing:"刷新中…",activate:"开通",activateAction:"前往开通",currentConfiguration:"当前配置"},tools:{builtIn:"内置工具",builtInHelp:"勾选 VeADK 提供的内置能力,生成时会自动补全 import 与所需环境变量。",codeExecution:"代码执行配置",codeExecutionHelp:"指定 AgentKit 代码执行沙箱。",mcp:"MCP 工具"},catalog:{web_search:{label:"联网搜索",description:"火山引擎 Web Search,获取实时信息。"},parallel_web_search:{label:"并行联网搜索",description:"并行发起多条搜索查询,更快汇总。"},link_reader:{label:"网页读取",description:"抓取并阅读给定链接的正文内容。"},web_scraper:{label:"网页爬取",description:"结构化爬取网页(需要 Scraper 服务)。"},image_generate:{label:"图像生成",description:"文生图(Doubao Seedream)。"},image_edit:{label:"图像编辑",description:"图生图 / 编辑(Doubao SeedEdit)。"},video_generate:{label:"视频生成",description:"文/图生视频(Doubao Seedance),含任务查询。"},text_to_speech:{label:"语音合成 (TTS)",description:"把文本转成语音(火山语音)。"},run_code:{label:"代码执行",description:"在沙箱中执行代码。"},vesearch:{label:"VeSearch 智能搜索",description:"火山 VeSearch(需要 bot 端点)。"},links:{console:"控制台",documentation:"文档"},env:{modelAgentName:{comment:"模型名称"},embeddingModelName:{comment:"向量化模型(记忆/知识库需要)"},vikingMemoryProject:{comment:"VikingDB 记忆库项目"},vikingMemoryRegion:{comment:"VikingDB 记忆库地域"},vikingMemoryType:{comment:"记忆类型"},feishuAppId:{comment:"飞书应用 App ID"},feishuAppSecret:{comment:"飞书应用 App Secret",placeholder:"输入 App Secret"},registrySpaceId:{comment:"AgentKit 智能体中心",placeholder:"请选择智能体中心"},registryTopK:{comment:"召回 Agent 数量"},registryRegion:{comment:"AgentKit 智能体中心地域"},registryEndpoint:{comment:"AgentKit 智能体中心 OpenAPI 地址"},agentKitToolId:{comment:"代码执行沙箱 ID"},agentKitToolRegion:{comment:"AgentKit Tools 地域"},openVikingUrl:{comment:"OpenViking 服务地址"},openVikingMemoryUserId:{comment:"记忆归属 ID",help:"对应 viking://user/<此值>/peers/<请求用户>/memories 中的 user 段;用于隔离 Agent、租户或业务场景,默认 default。"},openVikingMemoryPolicy:{comment:"记忆策略",help:"记忆的抽取策略和隔离策略,不填写时使用官方默认策略。"},openVikingKnowledgeUserId:{comment:"知识库归属 ID",help:"未配置资源目录时用于默认路径 viking://user/<此值>/resources/<知识库索引>/,默认 default。"},openVikingTargetUri:{comment:"知识库资源目录",help:"留空时由 KnowledgeBase index 自动生成;填写后直接检索该 OpenViking 资源目录,优先级最高。"},tlsServiceName:{comment:"TLS topic_id,留空自动创建"}}},backends:{shortTerm:{local:{label:"本地内存",description:"进程内,不持久化。适合开发调试。"},sqlite:{label:"SQLite 文件",description:"持久化到本地 .db 文件。"},mysql:{label:"MySQL",description:"持久化到 MySQL。"},postgresql:{label:"PostgreSQL",description:"持久化到 PostgreSQL。"}},longTerm:{local:{label:"本地向量库",description:"进程内 llama-index 向量库。"},opensearch:{label:"OpenSearch",description:"OpenSearch 向量检索。"},redis:{label:"Redis",description:"Redis 向量检索。"},viking:{label:"VikingDB Memory",description:"VikingDB 记忆库(支持用户画像)。"},openviking:{label:"OpenViking Memory",description:"OpenViking 长期记忆,按用户维度保存和检索偏好、事件与实体。"},mem0:{label:"Mem0",description:"Mem0 托管记忆服务。"}},knowledge:{viking:{label:"VikingDB Knowledge",description:"VikingDB 知识库。"},opensearch:{label:"OpenSearch",description:"OpenSearch 向量检索。"},context_search:{label:"Context Search",description:"火山 Context Search 引擎(无需向量化)。"},openviking:{label:"OpenViking Knowledge",description:"OpenViking 资源目录知识库,无需向量化模型配置。"}}},exporters:{apmplus:{label:"APMPlus",description:"火山 APMPlus 应用性能监控。"},cozeloop:{label:"CozeLoop",description:"扣子 CozeLoop 链路观测。"},tls:{label:"TLS (日志服务)",description:"火山 TLS 日志服务导出。"}},knowledge:{title:"知识库",description:"启用外部知识检索(RAG),让 Agent 基于你的资料作答。",backend:"知识库后端",vikingDatabase:"VikingDB 知识库"},memory:{shortTerm:"短期记忆",shortTermDescription:"存储单会话上下文",shortTermBackend:"短期记忆后端",longTerm:"长期记忆",longTermDescription:"存储跨会话上下文,通常使用向量化检索",longTermBackend:"长期记忆后端",vikingDatabase:"VikingDB 记忆库",autoSave:"自动保存会话到长期记忆",autoSaveDescription:"会话结束时自动把内容写入长期记忆,无需手动调用。"},mcp:{removeTool:"删除 MCP 工具",namePlaceholder:"名称(可选)",urlPlaceholder:"MCP 服务地址",pathWarning:"当前填写的是网关根地址。仅当根路径就是 MCP Endpoint 时可直接使用;否则请补充完整服务路径。",tokenPlaceholder:"Bearer Token(可选)",showToken:"显示 Bearer Token",hideToken:"隐藏 Bearer Token",commandPlaceholder:"命令,例如 npx",argsPlaceholder:"参数,以空格分隔",stdioHint:"stdio 工具在部署环境中启动,请确保命令和依赖可用。",addTool:"添加 MCP 工具"},resources:{unnamedAgentCenter:"未命名智能体中心",unnamedKnowledgeBase:"未命名知识库",unnamedMemory:"未命名记忆库",loadError:"加载失败",loadingAgentCenters:"正在加载智能体中心…",agentCentersLoaded:"已加载 {{count}} 个智能体中心",noAgentCenters:"暂无智能体中心",noMatchingAgentCenters:"没有匹配的智能体中心",searchAgentKitCenter:"搜索 AgentKit 智能体中心",searchNameOrId:"搜索名称或 ID",selectAgentCenter:"选择智能体中心",selectAgentKitCenter:"选择 AgentKit 智能体中心",selectedAgentCenter:"已选智能体中心",agentKitCenter:"AgentKit 智能体中心",refreshAgentCenters:"刷新智能体中心",knowledgeBaseList:"知识库列表",knowledgeBasePlaceholder:"选择知识库",loadingKnowledgeBases:"正在加载知识库…",knowledgeBasesLoaded:"已加载 {{count}} 个知识库",noKnowledgeBases:"暂无知识库",noMatchingKnowledgeBases:"没有匹配的知识库",searchKnowledgeBase:"搜索知识库",selectKnowledgeBase:"选择知识库",refreshKnowledgeBases:"刷新知识库",memoryList:"记忆库列表",memoryPlaceholder:"选择记忆库",loadingMemories:"正在加载记忆库…",memoriesLoaded:"已加载 {{count}} 个记忆库",noMemories:"暂无记忆库",noMatchingMemories:"没有匹配的记忆库",searchMemory:"搜索记忆库",selectMemory:"选择记忆库",refreshMemories:"刷新记忆库"},env:{noAdditionalParameters:"此后端无需额外运行参数。",invalidJson:"请输入有效的 JSON。",helpAriaLabel:"{{label}}说明:{{help}}",openOpenViking:"打开 OpenViking {{label}}",valuePlaceholder:"请输入参数值",openVikingIndex:"OpenViking 资源索引",openVikingIndexHelp:"默认值:留空;生成项目时使用 Agent 名自动生成,例如 my_agent_kb。未配置 DATABASE_OPENVIKING_TARGET_URI 时,默认 URI 拼接为 viking://user/{知识库归属 ID,未填则 default}/resources/{资源索引}/;如果填写了 DATABASE_OPENVIKING_TARGET_URI,则直接使用该完整 URI。",openVikingIndexAriaLabel:"OpenViking 资源索引说明:{{help}}"},deployment:{vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",apiKeyRequired:"请先选择模型使用的 API Key。",invalidEnvName:"环境变量名称不合法:{{key}}",requiredEnv:"{{name}}:请填写必填环境变量",generatingConfiguration:"正在生成部署配置",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",preparing:"准备部署",applyingMpaProfile:"正在将 Agent 配置应用到 MPA Runtime",mpaProfileApplied:"MPA Runtime 配置已应用",runningMpaSmoke:"正在验证 MPA Runtime 执行链路",mpaReady:"MPA Runtime 已可运行",mpaOperationIncomplete:"MPA Runtime 初始化未完成,请重试此部署任务。",complete:"部署完成",failed:"部署失败",updateAndPublish:"更新并发布",stages:{build:"构建镜像",deploy:"部署 Runtime",publish:"发布服务",applyMpaProfile:"应用 MPA 配置",verifyMpaRuntime:"验证 MPA Runtime",mpaReady:"MPA Runtime 可运行",running:"部署中"}},publish:{generating:"正在生成发布配置",validating:"校验 Agent 结构并准备部署快照…"}},l0e={presets:{support:{name:"客服助手",description:"7×24 在线答疑,结合知识库与历史对话,稳定、礼貌地解决用户问题。",instruction:"你是一名专业、耐心的客服助手。请始终保持礼貌、友好的语气,优先依据知识库中的资料回答用户问题;当资料不足以确定答案时,如实告知用户并主动引导其提供更多信息,切勿编造。回答尽量简洁、分点清晰,必要时给出操作步骤。",subagents:{}},analyst:{name:"数据分析师",description:"运行代码完成统计与可视化,开启链路追踪,分析过程可观测、可复现。",instruction:"你是一名严谨的数据分析师。面对数据问题时,先厘清分析目标与口径,再通过编写并运行代码完成清洗、统计与可视化。每一步都要说明你的假设与方法,给出结论时附上关键数据支撑,并指出潜在的偏差与局限。",subagents:{}},translator:{name:"翻译助手",description:"中英互译,忠实、通顺、地道,保留原文语气与专业术语。",instruction:"你是一名专业的翻译助手,精通中英互译。请在忠实于原文含义的前提下,使译文自然、地道、符合目标语言表达习惯;保留专有名词与专业术语的准确性,并尽量贴合原文的语气与风格。仅输出译文,除非用户额外要求解释。",subagents:{}},coder:{name:"代码助手",description:"编写、调试与重构代码,可运行代码验证结果,给出清晰可维护的实现。",instruction:"你是一名资深软件工程师。请根据需求编写正确、清晰、可维护的代码,遵循目标语言的惯用风格与最佳实践。在不确定时通过运行代码验证你的实现,给出关键的边界条件与测试思路,并对复杂逻辑附上简要注释。",subagents:{}},researcher:{name:"研究员",description:"联网检索一手资料,结合知识库与长期记忆,输出有据可查的研究结论。",instruction:"你是一名严谨的研究员。面对研究问题时,先拆解关键子问题,再通过联网检索收集多个一手、可信的来源,交叉验证后再下结论。结论需注明出处与不确定性,区分事实与推断,避免以偏概全。",subagents:{}},"research-team":{name:"多智能体研究团队",description:"由检索员、分析员、撰写员协作的研究编排,分工完成端到端调研报告。",instruction:"你是一支研究团队的总协调者。负责拆解用户的研究任务,将检索、分析、撰写分别委派给对应的子 Agent,汇总各子 Agent 的产出,把控整体质量,最终输出结构清晰、有据可查的研究报告。",subagents:{0:{name:"检索员",description:"联网搜集与课题相关的一手资料与数据。",instruction:"你是研究团队中的检索员。根据课题联网检索多个可信来源,整理出关键事实、数据与原文出处,交付给分析员,不做主观结论。"},1:{name:"分析员",description:"对检索到的材料做交叉验证与归纳分析。",instruction:"你是研究团队中的分析员。对检索员提供的材料做交叉验证、归纳与对比,提炼洞见、识别矛盾与不确定性,形成结构化的分析要点。"},2:{name:"撰写员",description:"将分析结论组织为结构清晰、引用规范的报告。",instruction:"你是研究团队中的撰写员。把分析员的要点组织成结构清晰、语言通顺、引用规范的研究报告,确保每个结论都能追溯到来源。"}}}},tags:{tools:"工具",memory:"记忆",knowledgeBase:"知识库",tracing:"观测",subagents:"子 Agent {{count}}"},gallery:{title:"从模板新建",subtitle:"选择一个预制 Agent 模板,按需微调后即可创建。"},detail:{back:"返回模板列表",name:"名称",systemPrompt:"系统提示词",model:"模型",tools:"工具",memory:"记忆",knowledgeBase:"知识库",tracing:"观测追踪",subagents:"子 Agent({{count}})",create:"使用此模板创建",shortTermMemory:"短期",longTermMemory:"长期"}},c0e={checkingExpiry:"确认有效期中",waitingRecovery:"等待恢复",listFailed:"读取项目列表失败",recoveryFailed:"工作区恢复失败,请重试",operationFailed:"项目操作失败,请重试",title:"代码项目",back:"返回代码项目",restart:"本开发环境将在 {{countdown}} 后重启,请随时保存数据",expiresAt:"有效期至 {{date}}",exitFullscreen:"退出全屏",fullscreen:"全屏",exitFullscreenHint:"退出全屏(Esc)",recovering:"正在恢复工作区,完成后将自动返回项目",retry:"重试连接",search:"搜索代码项目",newTitle:"新建代码项目",new:"新建项目",readingStats:"正在读取项目统计",createdAt:"创建时间",opening:"正在打开",unknownCreatedAt:"创建时间未知",open:"打开项目",empty:"没有匹配的代码项目",close:"关闭新建项目",name:"项目名称",placeholder:"例如 my-agent",nameHelp:"以英文字母开头,可包含字母、数字、下划线和连字符,最多 64 个字符",cancel:"取消",create:"创建项目",files_one:"{{count}} 个文件",files_other:"{{count}} 个文件",directories_one:"{{count}} 个目录",directories_other:"{{count}} 个目录",separator:","},u0e={enabled:"已启用",disabled:"已禁用",unknownStatus:"状态未知",allPermissions:"全部权限",customPermissions:"自定义权限",unknownPermissions:"权限未知",unnamed:"未命名 API Key",search:"搜索名称、状态或权限",noMatches:"没有匹配的 API Key",noModelPermission:"当前 API Key 无权限",modelAvailable:"可用",permissionState:{Available:"可用于对话",Shutdown:"已下线",VideoGeneration:"视频生成模型",Unsupported:"不支持作为对话模型",NotActivated:"尚未开通",Unknown:"未获取到模型状态"}},d0e={common:qve,yaml:Wve,validation:Kve,defaults:Gve,helpers:Xve,intelligentDeployment:Yve,codePackage:Zve,buildCanvas:Jve,intelligent:e0e,projectLibrary:t0e,modePicker:n0e,promptEditor:i0e,skills:r0e,workflow:s0e,workbench:a0e,traditional:o0e,template:l0e,workspace:c0e,modelApiKey:u0e},IVe=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:Jve,codePackage:Zve,common:qve,default:d0e,defaults:Gve,helpers:Xve,intelligent:e0e,intelligentDeployment:Yve,modePicker:n0e,modelApiKey:u0e,projectLibrary:t0e,promptEditor:i0e,skills:r0e,template:l0e,traditional:o0e,validation:Kve,workbench:a0e,workflow:s0e,workspace:c0e,yaml:Wve},Symbol.toStringTag,{value:"Module"})),f0e={source:"任务来源",studio:"Studio 定时任务",title:"Runtime 定时任务",selectRuntime:"请先在 Agent 列表中选择一个云端 Runtime。",scope:"展示当前 Studio 用户在此 Runtime 中的定时任务。",refresh:"刷新",loading:"正在获取 Runtime 任务",empty:"此 Runtime 中没有符合条件的定时任务。",authRequired:"Runtime 拒绝了请求,请检查网关访问权限及 Runtime 的鉴权开关。",forbidden:"当前用户没有此 Runtime 的访问权限。",unsupported:"此 Runtime 未提供 mpa 定时任务接口。",invalidResponse:"任务接口返回了无法识别的数据,请检查 Runtime 版本。",loadFailed:"获取任务失败,请检查网络和 Runtime 状态后刷新。",pagination:"Runtime 任务分页",total:"共 {{total}} 条",previous:"上一页",next:"下一页",columns:{name:"任务名称",enabled:"状态",schedule:"执行计划",next:"下次执行",last:"最近结果"},schedule:{once:"单次",interval:"间隔",daily:"每天",weekly:"每周",monthly:"每月",cron:"Cron"},search:"搜索任务",executionCount:"执行次数",successRate:"成功率",prompt:"任务内容",manage:{view:"任务视图",list:"列表",calendar:"日历",create:"创建定时任务",edit:"编辑任务",copy:"复制",delete:"删除",detail:"详情",run:"立即执行",name:"任务",lastRun:"上次执行",schedule:"执行周期",lastStatus:"上次执行状态",agent:"执行 Agent",actions:"操作",all:"全部状态",Pending:"尚未执行",Queued:"已排队",Running:"执行中",Succeeded:"执行成功",Failed:"执行失败",TimedOut:"执行超时",Cancelled:"已取消",Skipped:"已跳过",overview:"执行统计:",prompt:"任务内容",timezone:"时区",localTime:"执行时间(当前设备时区)",time:"执行时间",Once:"单次",Interval:"间隔",Daily:"每天",Weekly:"每周",Monthly:"每月",Cron:"Cron 表达式",seconds:"秒",interval:"间隔秒数",weekdays:"星期(1 为周一,7 为周日,逗号分隔)",monthDays:"每月日期(1–31,逗号分隔)",delivery:"结果投递",Web:"Web",Feishu:"飞书",target:"飞书接收 ID",enabled:"启用任务",cancel:"取消",save:"保存",saving:"保存中",required:"请填写任务名称、Agent ID、任务内容和投递目标。",timezoneInvalid:"请输入有效的 IANA 时区,例如 Asia/Shanghai。",futureTime:"请选择未来的执行时间。",intervalInvalid:"间隔需要为 30–31536000 的整数秒。",daysInvalid:"请输入有效且不重复的日期或星期。",history:"执行记录",duration:"耗时",result:"结果 / 会话",noRuns:"暂无执行记录。",conflict:"任务已被修改或请求发生冲突,请关闭弹窗并刷新后重试。",invalid:"请求校验失败,请检查用户身份、执行时间、Agent ID 和任务配置。",queued:"已提交执行请求。",saved:"任务已更新。",deleteConfirm:"确定删除“{{name}}”?删除后将不再调度此任务。",calendarZone:"显示时区:",prevMonth:"上个月",nextMonth:"下个月",today:"今天",nextOnly:"仅下次",calendarHint:"日历展示预计执行安排;复杂 Cron 仅显示服务端给出的下一次执行时间。",botAccount:"投递机器人",selectBot:"请选择已启用的投递机器人。",botsLoading:"正在读取飞书机器人…",botsFailed:"读取投递机器人失败,请重试。",botsUnauthorized:"无权读取飞书机器人,请联系管理员配置投递。",retryBots:"重新读取机器人",botDisabled:"已停用"}},h0e={backToList:"返回定时任务列表",cancel:"取消",cancelQueue:"取消排队",cancelQueueFirst:"请先取消排队",cancelling:"取消中…",closeDrawer:"关闭抽屉",collapse:"收起",connectingRuntime:"正在连接 Runtime…",createScheduledTask:"创建定时任务",createTask:"创建任务",delete:"删除",deleteTask:"删除任务",edit:"编辑",enable:"启用",expand:"展开",pause:"暂停",refresh:"刷新",refreshHistory:"刷新执行历史",rerun:"重新执行",retry:"重试",runNow:"立即执行",saveChanges:"保存更改",saving:"保存中…",stop:"终止执行",stopRun:"终止本次执行",stopRunFirst:"请先终止当前执行",stopping:"终止中…",viewDetails:"查看详情"},p0e={cancelDescription:"本次 Session 将被取消,后续计划不会暂停。",cancelTitle:"终止本次执行?",deleteDescription:"“{{name}}”及其全部执行历史将被永久删除。",deleteTitle:"删除定时任务?"},m0e={configuration:"任务配置",nextRun:"下次执行",pageLabel:"定时任务详情",region:"地域",runtime:"运行时",status:"任务状态"},g0e={createTitle:"创建定时任务",description:"每次触发都会为 Runtime Agent 创建独立 Session。",editTitle:"编辑定时任务"},b0e={minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",seconds:"{{count}} 秒"},y0e={cronExpression:"Cron 表达式",cronHelp:"依次填写分钟、小时、日期、月份、星期。",dailyTime:"每天执行时间",enableAfterCreate:"创建后启用",enableHelp:"启用后会从下一个计划时间开始执行。",name:"任务名称",namePlaceholder:"例如:每日生成运营摘要",noRuntime:"暂无可用 Runtime",prompt:"执行文本",promptPlaceholder:"输入每次执行时发送给 Agent 的固定文本",runAt:"执行时间",runtimeAgent:"运行时智能体",runtimeHelp:"任务始终跟随该 Runtime 当前生效版本。",runtimePlaceholder:"选择 Runtime Agent",schedule:"执行计划",scheduleType:"执行计划类型",timezone:"时区",weekday:"星期"},v0e={all:"全部"},x0e={description:"每次运行均使用独立 Session,结果与错误会永久保留。",duration:"耗时 {{duration}}",emptyDescription:"任务触发或立即执行后,记录会显示在这里。",emptyTitle:"暂无执行记录",errorDetails:"错误详情",finalAnswer:"最终回答",loadFailed:"无法加载执行历史",loadFailedDescription:"请检查 Studio 服务后重试。",session:"会话",title:"执行历史"},w0e={cancelRequested:"已提交终止请求。",created:"任务已创建。",deleted:"任务及其执行历史已删除。",enabled:"任务已启用。",paused:"任务已暂停。",queued:"任务已排队,将在一分钟内开始执行。",requeued:"任务已重新排队,将在一分钟内开始执行。",updated:"任务已更新。"},k0e={filterLabel:"定时任务状态筛选",listLabel:"定时任务列表",loadFailed:"无法加载定时任务",loadFailedDescription:"请检查 Studio 服务后重试。",title:"定时任务"},O0e={cron:"Cron {{cron}}{{zone}}",daily:"每天 {{time}}{{zone}}",once:"一次 · {{date}}{{zone}}",weekly:"{{weekday}} {{time}}{{zone}}"},S0e={daily:"每天",once:"一次性",weekly:"每周"},E0e={cancelled:"已取消",enabled:"已启用",failed:"失败",notRun:"尚未执行",paused:"已暂停",pending:"准备中",queued:"已排队",retrying:"自动重试中",running:"执行中",skipped:"已跳过",success:"成功"},C0e={cronFields:"Cron 表达式需要包含 5 个字段,例如 0 9 * * *。",nameRequired:"请输入任务名称。",promptRequired:"请输入每次执行时发送给 Agent 的文本。",runtimeAppMissing:"Runtime Agent 未返回可调用的 appName,请确认 Runtime 已就绪且版本兼容。",runtimeRequired:"请选择可用的 Runtime Agent。",timeRequired:"请选择执行时间。"},A0e={friday:"周五",monday:"周一",saturday:"周六",sunday:"周日",thursday:"周四",tuesday:"周二",wednesday:"周三"},PVe={mpa:f0e,actions:h0e,confirm:p0e,detail:m0e,drawer:g0e,duration:b0e,fields:y0e,filters:v0e,history:x0e,notices:w0e,page:k0e,schedule:O0e,scheduleTypes:S0e,status:E0e,validation:C0e,weekdays:A0e},DVe=Object.freeze(Object.defineProperty({__proto__:null,actions:h0e,confirm:p0e,default:PVe,detail:m0e,drawer:g0e,duration:b0e,fields:y0e,filters:v0e,history:x0e,mpa:f0e,notices:w0e,page:k0e,schedule:O0e,scheduleTypes:S0e,status:E0e,validation:C0e,weekdays:A0e},Symbol.toStringTag,{value:"Module"})),T0e="快速创建 Agent",_0e="Agent 类型",j0e="关闭",N0e="部署",R0e="预览配置",I0e="已发起配置包下载",P0e="下载失败,请重试",D0e="有 {{count}} 处配置需要修改",M0e="自定义",L0e="自定义{{field}}",$0e="输入自定义值",F0e="该模型未声明推理强度,使用服务端设置",B0e="请先为该提供方添加模型",U0e="请先选择提供方",Q0e="请选择",z0e="可选",V0e="默认模型、Agent 预设和权限用于新会话;预设需要存在于部署的 Harness 中",H0e="仅填写环境变量名称,实际密钥由部署环境提供",q0e="read-only 为只读,workspace-write 可写工作区,danger-full-access 允许完整访问且不请求确认",W0e="allowedModels 是子 Agent 可选择的模型列表,启用后至少填写一组提供方和模型",K0e="添加自定义模型服务,填写它的端点、协议和模型 ID,支持火山引擎和 BytePlus 等兼容服务",G0e="当前覆盖常用原生设置,其他插件参数与预设文件尚未接入",X0e="查看原生配置文档",Y0e="模型提供方 {{index}}",Z0e="模型 {{index}}",J0e="添加模型提供方",exe="移除提供方 {{index}}",txe="添加模型",nxe="移除模型 {{index}}",ixe="添加可选模型",rxe="移除可选模型 {{index}}",sxe="移除",axe="填写服务端的模型 ID",oxe={provider:"提供方 {{index}}",model:"模型 {{index}}"},lxe={defaults:"会话默认设置",deepseek:"DeepSeek 模型服务",providers:"自定义模型提供方",shell:"命令执行",loop:"工具调用",subagents:"子 Agent 模型选择",search:"DeepSeek 网络搜索"},cxe={id:"提供方 ID",displayName:"显示名称",baseURL:"服务地址",api:"接口协议",apiKeyEnv:"密钥环境变量"},uxe={id:"例如 company-models",displayName:"可选,默认使用提供方 ID",baseURL:"https://…/v1",api:"选择接口协议",apiKeyEnv:"例如 MODEL_API_KEY"},dxe={id:"模型 ID",name:"显示名称",contextWindow:"上下文容量",maxTokens:"最大输出容量"},fxe={positive:"请输入大于 0 的数值",integer:"请输入有效的正整数",env:"请输入环境变量名,只能包含字母、数字和下划线,且不能以数字开头",url:"请输入 HTTP 或 HTTPS 地址,不要在地址中包含凭据",option:"请选择受支持的原生选项",required:"请补全此项",duplicate:"该 ID 或模型组合已存在",providerId:"以小写字母开头,可包含小写字母、数字、点、下划线和连字符,不能使用保留 ID",routes:"请至少填写一组完整的提供方和模型",modelPair:"请填写该自定义提供方下的模型 ID",unknownProvider:"请先添加该自定义模型提供方",unknownModel:"请填写该提供方下已配置的模型 ID",timer:"请输入大于 0 且不超过 2147483647 的毫秒数"},hxe={"agent-default-model_provider":"默认提供方","agent-default-model_model":"默认模型","agent-default-model_reasoningEffort":"默认推理强度","agent-presets_default":"默认 Agent 预设",permission_defaultPreset:"默认权限预设","llm-deepseek_apiKeyEnv":"密钥环境变量","llm-deepseek_baseURL":"服务地址","llm-deepseek_thinking":"思考模式","llm-deepseek_reasoningEffort":"推理强度","llm-deepseek_maxTokens":"每次请求的输出上限","llm-deepseek_defaultContextWindow":"默认上下文容量","llm-deepseek_streamIdleTimeoutMs":"流式空闲超时(毫秒)",bash_timeoutMs:"默认执行超时(毫秒)",bash_maxTimeoutMs:"最大执行超时(毫秒)",bash_maxOutputBytes:"输出上限(字节)","agent-loop_maxParallelToolCalls":"并行工具调用上限","subagent-model-selection_enabled":"启用模型选择","web-search-deepseek_apiKeyEnv":"密钥环境变量","web-search-deepseek_baseURL":"搜索服务地址","web-search-deepseek_model":"搜索模型","web-search-deepseek_apiVersion":"接口版本","web-search-deepseek_maxTokens":"搜索输出上限","web-search-deepseek_maxUses":"搜索次数上限"},pxe="取消",mxe="返回创建方式",gxe="DeepSeek Harness 配置",MVe={title:T0e,agentType:_0e,close:j0e,continue:"继续配置",deploy:N0e,preview:R0e,export:"导出配置",downloaded:I0e,downloadFailed:P0e,validationSummary:D0e,customValue:M0e,customField:L0e,enterCustomValue:$0e,reasoningUnavailable:F0e,modelsUnavailable:B0e,selectProviderFirst:U0e,selectOption:Q0e,optional:z0e,defaultsHelp:V0e,credentialHelp:H0e,permissionHelp:q0e,routesHelp:W0e,providersHelp:K0e,coverage:G0e,source:X0e,provider:Y0e,model:Z0e,addProvider:J0e,removeProvider:exe,addModel:txe,removeModel:nxe,addRoute:ixe,removeRoute:rxe,remove:sxe,modelIdPlaceholder:axe,route:oxe,sections:lxe,providerFields:cxe,providerPlaceholders:uxe,modelFields:dxe,errors:fxe,fields:hxe,cancel:pxe,back:mxe,pageTitle:gxe},LVe=Object.freeze(Object.defineProperty({__proto__:null,addModel:txe,addProvider:J0e,addRoute:ixe,agentType:_0e,back:mxe,cancel:pxe,close:j0e,coverage:G0e,credentialHelp:H0e,customField:L0e,customValue:M0e,default:MVe,defaultsHelp:V0e,deploy:N0e,downloadFailed:P0e,downloaded:I0e,enterCustomValue:$0e,errors:fxe,fields:hxe,model:Z0e,modelFields:dxe,modelIdPlaceholder:axe,modelsUnavailable:B0e,optional:z0e,pageTitle:gxe,permissionHelp:q0e,preview:R0e,provider:Y0e,providerFields:cxe,providerPlaceholders:uxe,providersHelp:K0e,reasoningUnavailable:F0e,remove:sxe,removeModel:nxe,removeProvider:exe,removeRoute:rxe,route:oxe,routesHelp:W0e,sections:lxe,selectOption:Q0e,selectProviderFirst:U0e,source:X0e,title:T0e,validationSummary:D0e},Symbol.toStringTag,{value:"Module"})),bxe="问题反馈",yxe="问题描述",vxe="常见问题",xxe="取消",wxe="完成",kxe="提交反馈",Oxe="正在上报…",Sxe={title:"上报成功,感谢您的反馈",description:"AgentKit 团队会尽快查看您提交的问题。"},Exe={close:"关闭问题反馈",intro:"请选择遇到的问题,也可以补充具体表现。",privacy:"您的对话数据将会上报到 AgentKit 团队,请注意隐私保护。",descriptionPlaceholder:"请描述问题发生时的表现(选填)",issues:{slow:"执行速度慢",crash:"运行崩溃",incorrect:"结果不准确",tool_error:"工具调用失败",other:"其他问题"}},Cxe={description:"告诉我们您在使用 AgentKit Studio 时遇到的问题。",module:"所属模块",modules:{conversation:"对话",agents:"智能体",applications:"自动化",search:"搜索",other:"其他"},commonIssuesMultiple:"常见问题(可多选)",issueTypes:"问题类型",issues:{page_slow:"页面加载慢",feature_unavailable:"功能无法使用",display_error:"页面显示异常",no_response:"操作无响应",other:"其他问题"},descriptionPlaceholder:"请描述问题发生时的页面、操作和表现",quickAdd:"快捷补充",suggestionsLabel:"问题描述推荐",suggestions:{noResponse:"点击后没有反应",loading:"页面一直处于加载状态",incomplete:"部分内容显示不完整",error:"操作后出现错误提示"},privacy:"您的数据将会上报到 AgentKit 团队,请注意隐私保护。"},$Ve={title:bxe,descriptionLabel:yxe,commonIssues:vxe,cancel:xxe,done:wxe,submit:kxe,submitting:Oxe,success:Sxe,dialog:Exe,page:Cxe},FVe=Object.freeze(Object.defineProperty({__proto__:null,cancel:xxe,commonIssues:vxe,default:$Ve,descriptionLabel:yxe,dialog:Exe,done:wxe,page:Cxe,submit:kxe,submitting:Oxe,success:Sxe,title:bxe},Symbol.toStringTag,{value:"Module"})),Axe={back:"返回",close:"关闭"},Txe={title:"优化迁移项目",closeAria:"关闭优化窗口"},_xe={title:"已迁移项目",description:"管理迁移后的源码版本,也可以选择任一版本继续优化。",libraryTitle:"项目与版本",libraryDescription:"查看、下载、部署或对比源码版本,也可以基于任一版本继续优化。",emptyTitle:"还没有已迁移的项目",emptyDescription:"迁移完成后,源码会自动保存在这里。"},jxe={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any(通用迁移)"},Nxe={awaitingUpload:"待上传",analyzing:"分析中",needsInput:"待补充",analysisReady:"待确认",migrating:"迁移中",validating:"校验中",packaging:"打包中",succeeded:"已完成",succeededWithWarnings:"已完成,有提示",partial:"部分完成",failed:"失败",cancelled:"已终止",expired:"已过期"},Rxe={evaluationPending:"待评测",evaluationRunning:"评测中",waitingDataset:"待保存评测用例",waitingEnvironment:"待补充环境变量",evaluationFailed:"迁移完成,评测未完成",evaluationBlocked:"迁移完成,评测待处理",evaluationCancelled:"迁移完成,评测已取消",resultUnavailable:"结果不可用",environmentExpired:"环境已过期"},Ixe={partialReady:"迁移产物已生成,但交付不完整,请查看迁移提示。",readyWithWarnings:"迁移产物已生成,请查看迁移提示。",ready:"迁移产物已生成。"},Pxe={passed:"产物校验通过",failed:"产物校验未通过",degraded:"产物校验未完成"},Dxe={session:"创建迁移环境",upload:"上传项目",analysis:"分析项目"},Mxe={agentNameRequired:"请输入 Agent 名称",agentNameInvalid:"Agent 名称必须为 1-63 位,只能包含小写字母、数字和连字符,且必须以字母或数字开头和结尾"},Lxe={seconds:"{{seconds}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},$xe={savedUnaffected:"已保存项目不受影响",savingUnaffected:"源码正在保存,完成后不受环境期限影响",activeDetail:"到期后任务记录和临时产物将无法访问",oneHour:"临时迁移环境保留 1 小时",ended:"临时迁移环境已结束",savedAvailable:"已保存项目仍可查看、下载、部署或优化",unavailable:"任务记录和临时产物已无法访问",countdown:"临时迁移环境将在 {{minutes}} 分 {{seconds}} 秒后结束",expiredSavedMessage:"临时迁移环境已结束,已保存项目不受影响。",expiredMessage:"临时迁移环境已结束,任务记录和临时产物无法继续访问。"},Fxe={recommended:"建议迁移方式",scope:"迁移范围",excluded:"不在本次范围",viewEvidence:"查看分析证据",viewAssumptions:"查看关键假设",viewSourceEvidence:"查看源码证据"},Bxe={ariaLabel:"Codex 执行动态",title:"Codex 执行动态",startingAnalysis:"Codex 正在开始分析…",startingMigration:"Codex 正在开始迁移…",loadError:"暂时无法读取 Codex 执行动态,不影响当前任务。",liveAnalyzing:"正在分析项目",liveMigrating:"正在执行迁移",liveValidating:"正在校验迁移结果",livePackaging:"正在整理迁移产物",liveDelivery:"正在核对交付产物"},Uxe={title:"迁移产物",fileTooLarge:"该文件超过 2 MiB,请下载完整产物后查看。",unsupportedPreview:"该文件不支持在线预览,请下载完整产物后查看。",filesAria:"迁移产物文件",searchAria:"搜索产物文件",searchPlaceholder:"搜索文件",limit:"仅展示前 {{count}} 项,请搜索具体文件。",noSelection:"未选择文件",noPreview:"暂无可预览文件。",loadingFile:"正在读取产物文件…",startupFile:"启动文件",fileCountLabel:"文件数",saved:"源码已保存,可继续查看、下载、部署或优化。",saving:"产物已生成,正在保存源码版本。",deployReady:"产物可预览、下载和部署,正在等待源码保存状态。",deployUnavailable:"产物可预览和下载,但当前交付状态不支持部署。",viewProjects:"查看已迁移项目",downloading:"下载中…",downloadZip:"下载 ZIP",deployTitle:"部署迁移产物",deployUnavailableTitle:"当前交付状态不支持部署",deployRuntime:"部署到 Runtime",fileCount:"{{count}} 个文件",startup:"启动文件 {{module}}",loading:"正在读取迁移产物…"},Qxe={retiring:"即将下线",currentDefault:"当前默认模型",loadError:"加载模型列表失败",label:"模型",placeholder:"选择模型"},zxe={zipOnly:"请选择 .zip 格式的本地项目文件。",invalidName:"ZIP 文件名无效,请重命名后重新选择。",tooLarge:"项目 ZIP 不能超过 {{size}}。",empty:"项目 ZIP 不能为空。",removeAria:"移除项目 ZIP",reselectPrompt:"重新选择项目 ZIP",selectPrompt:"选择或拖入本地项目 ZIP",reselect:"重新选择",selectZip:"选择 ZIP",continue:"继续上传",start:"上传并分析",inputAria:"选择本地项目 ZIP",retention:"临时迁移环境从创建完成起保留 1 小时;保存成功的源码版本不受影响。",uploading:"上传中…",sizeHint:"支持项目 ZIP,最大 {{size}}"},Vxe={requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}",notReady:"迁移产物尚未准备完成。",back:"返回迁移结果"},Hxe={backToAddAgent:"返回添加 Agent",title:"从存量迁移",newMigration:"新建迁移",recent:"最近迁移",loadingSessions:"正在读取迁移会话…",noSessions:"暂无迁移会话",heading:"迁移存量 Agent 项目",intro:"上传本地项目 ZIP,Codex 将先进行只读分析,再由你确认迁移方式。",backToHome:"迁移首页",navigation:"迁移导航",showMore:"查看更多",showLess:"收起",projectName:"项目名称",status:"状态",createdAt:"创建时间",actions:"操作",openTask:"查看迁移 {{name}}",continueTask:"继续",viewTask:"查看"},qxe={stop:"终止迁移",stopping:"正在终止…",cancel:"取消",reload:"重新读取",refreshStatus:"刷新状态"},Wxe={unavailable:"迁移能力暂不可用",defaultReason:"Dev Sandbox 暂不可用,请联系管理员检查配置。"},Kxe={creatingSandbox:"正在创建 Dev Sandbox",initializing:"正在初始化迁移工作目录,并检查 AgentKit CLI、Codex 和迁移能力。环境就绪后将自动上传项目。",elapsed:"已等待 {{duration}}",uploadThenAnalyze:"ZIP 上传完成后将自动开始只读分析。",analyzing:"Codex 正在识别框架、入口和迁移边界,不会执行实际迁移。",migrationLocked:"迁移执行中不能修改附件或迁移方式。你可以等待当前任务结束,或主动终止。",analysisPaused:"只读分析已暂停。请仅回答下面列出的问题,提交后会在同一迁移环境中重新分析,不会开始实际迁移。",analysisComplete:"只读分析已完成。请检查建议,并确认最终迁移方式。",awaitingUpload:"迁移环境已创建,请重新选择本地 ZIP 继续上传。",expiredTitle:"迁移环境已过期",expiredDescription:"迁移内容和产物已无法预览、下载或部署。如已完成 Runtime 部署,可返回智能体页面继续使用。",unsupportedTitle:"当前 ZIP 暂时无法迁移",unsupportedHint:"请按提示整理项目后,新建迁移并重新上传。",failedTitle:"迁移未完成",cancelled:"当前迁移已终止。你可以新建迁移并重新上传项目。"},Gxe={ariaLabel:"补充项目分析信息",title:"补充分析所需信息",description:"附件保持锁定,提交后仅继续只读分析",submitting:"正在继续分析…",submit:"提交并继续分析"},Xxe={ariaLabel:"回答迁移需要你决定的问题",title:"迁移需要你的回答",description:"回答后会在当前这一步里继续,不需要重新开始",other:"其他",otherPlaceholder:"也可以直接输入你的答案",submitting:"正在提交回答…",submit:"提交回答并继续"},Yxe={ariaLabel:"确认迁移方式",title:"确认迁移方式",framework:"迁移方式",frameworkPlaceholder:"选择迁移方式",agentName:"Agent 名称",entry:"项目入口",entryPlaceholder:"选择项目入口",entryExample:"例如 agent.py:agent",consent:"点击“确认并开始迁移”即确认上述迁移范围、排除项和关键假设。",starting:"正在启动迁移…",start:"确认并开始迁移"},Zxe={setup:{title:"迁移效果评测",description:"迁移完成后自动执行评测用例。",on:"已开启",off:"未开启",unavailable:"当前环境暂不支持迁移效果评测。",casesTitle:"评测用例",casesDescription:"至少添加一个用例。期望结果和评测标准可选。",configuredSummary:"{{count}} 个用例 · {{preset}} · {{dimensions}}",incompleteSummary:"{{count}} 个用例待填写 · {{preset}} · {{dimensions}}",dimensionSummary:"{{count}} 个维度",editSettings:"编辑设置",viewSettings:"查看设置",lockedTitle:"评测用例",lockedDescription:"上传开始后不可修改。",closeAria:"关闭评测设置",done:"完成配置",close:"关闭"},tabs:{label:"迁移任务内容",migration:"迁移",evaluation:"效果评测",waitingMigration:"等待迁移",waitingConfiguration:"待配置",running:"评测中",completed:"已完成",issue:"需处理"},bulk:{open:"批量粘贴",label:"每行输入一个用例",placeholder:`帮我查询今天的订单状态 +把结果整理成三点`,preview:"将添加 {{count}} 个用例",confirm:"添加用例"},case:{title:"用例 {{index}}",add:"添加用例",moveUp:"上移用例 {{index}}",moveDown:"下移用例 {{index}}",copy:"复制",delete:"删除",userInput:"用户输入",userInputPlaceholder:"例如:请帮我查询今天的订单状态",expectedOutcome:"期望结果(可选)",expectedOutcomePlaceholder:"描述希望 Agent 完成什么,不要求逐字一致",criteria:"必须满足的要求(可选)",addCriterion:"添加要求",criterionLabel:"必须满足的要求 {{index}}",criterionPlaceholder:"例如:必须包含订单号和当前状态",removeCriterion:"删除要求 {{index}}"},advanced:{title:"高级设置",standard:"标准评测",standardDescription:"默认包含语义一致性、输出约束、工作流与工具一致性 3 个维度,适合多数迁移。",custom:"自定义维度",customDescription:"按业务风险选择一个或多个评测维度。",lockedDescription:"项目开始上传后,评测方式和维度不再修改。"},dimension:{semantic_fidelity:"语义一致性",output_contract:"输出约束",workflow_tool_fidelity:"工作流与工具一致性",context_memory_fidelity:"上下文与记忆一致性",boundary_error_fidelity:"边界与异常一致性",safety_refusal_fidelity:"安全与拒答一致性"},dimensionDescription:{semantic_fidelity:"检查意图理解、结论和关键事实是否保持一致。",output_contract:"检查字段、结构、语言和格式约束是否保持。",workflow_tool_fidelity:"检查可观察的工作流分支和工具行为是否保持。",context_memory_fidelity:"检查可验证的多轮上下文和记忆行为。",boundary_error_fidelity:"检查无效输入、信息缺失和依赖失败时的行为。",safety_refusal_fidelity:"检查已有授权、拒答和敏感信息边界是否保持。"},validation:{caseCount:"请保留 1–{{count}} 个用例。",dimensionRequired:"请至少选择一个评测维度。",userInputRequired:"请输入用例内容。",userInputBytes:"单个用例不能超过 32 KiB。",expectedOutcomeBytes:"期望结果不能超过 16 KiB。",criteriaCount:"单个用例最多包含 {{count}} 条要求。",criterionRequired:"要求不能为空。",criterionBytes:"单条要求不能超过 2 KiB。",datasetBytes:"全部评测用例不能超过 10 MiB。"},dataset:{invalidLockResponse:"服务未确认评测用例已保存,请重试。",loadingSettings:"正在读取评测设置…",loadSettingsFailed:"评测设置读取失败。",retryLoadSettings:"重新读取",missing:"未找到已保存的评测用例,请重新填写并保存。",saveWarning:"评测用例暂未保存,不影响迁移。",retrySave:"重新保存评测用例",saving:"正在保存…"},state:{disabled:"未开启评测",waiting_dataset:"等待填写评测用例",pending:"迁移完成后自动开始评测",preparing:"正在准备评测环境…",waiting_environment:"需要补充运行所需的环境变量",deploying:"正在部署临时 Runtime…",executing:"正在执行评测用例…",judging:"正在执行评测分析…",aggregating:"正在汇总评测结果…",completed:"评测已完成",failed:"评测未完成",blocked:"评测需要处理后才能继续",cancelled:"评测已取消"},progress:{label:"迁移与迁移效果评测进度",migration:"迁移",evaluation:"迁移效果评测",notStarted:"未开始",inProgress:"进行中",completed:"完成",waitingConfiguration:"等待配置",issue:"有问题"},environment:{description:"填写临时 Runtime 所需的环境变量。",security:"仅用于本次评测。",optional:"可选",submit:"提交并继续评测",submitting:"正在提交…"},execution:{preparing:"准备评测",preparingDetail:"校验迁移产物和 {{count}} 个评测用例",deploying:"启动 Runtime",deployingDetail:"准备 {{runtime}}",runtimeFallback:"隔离运行环境",executing:"执行用例",executingDetail:"执行 {{count}} 个用例并记录输出",judging:"执行评测分析",judgingDetail:"评测 {{cases}} 个用例 · {{dimensions}} 个维度",aggregating:"生成评测报告",aggregatingDetail:"汇总评分与证据,生成 HTML 报告",waiting:"等待中",running:"执行中",failed:"失败",complete:"已完成"},result:{title:"执行进度",attempt:"第 {{attempt}} 次评测",pending:"等待迁移完成",retry:"重新评测",retrying:"正在重试…",failureStage:"失败阶段",errorCode:"错误码",taskId:"任务 ID",diagnosticAttempt:"评测轮次",runtime:"Runtime",errorDetails:"错误详情",diagnosticField:"{{label}}:{{value}}",diagnosticHeading:"{{label}}:",loadingReport:"正在读取评测报告…",reportTitle:"HTML 评测报告",reportHtmlDescription:"查看或下载 HTML 报告。",viewReport:"查看报告",reportDrawerDescription:"评分、差异与证据",closeReport:"关闭",closeReportAria:"关闭评测报告",reportPreviewTitle:"迁移效果评测报告预览",reportSummary:"评测摘要",reportVersion:"评测集 {{version}} · Prompt v{{prompt}}",downloadReport:"下载完整报告",downloadingReport:"正在下载…",overallScore:"综合一致性",scoreScale:"0–100;证据不足时显示 N/A",evidenceCoverage:"证据覆盖率",coverageDetail:"{{scored}} / {{total}} 个维度有证据",executionSuccess:"执行成功率",executionDetail:"{{succeeded}} / {{total}} 个用例完成",naCount:"N/A 数量",naDescription:"证据不足,不计入分数",gapDescription:"迁移差距说明",lowestScoringCases:"低分用例",executionFailures:"执行异常",criticalEvidence:"Critical 证据",limitations:"评测限制",viewEvidence:"查看 {{count}} 个用例的结果与证据",outputTruncated:"输出过长,已截断",executionState:{succeeded:"执行完成",failed:"执行异常"},severityLabel:"严重度:{{severity}}",severity:{none:"无",low:"低",medium:"中",high:"高",critical:"Critical",unknown:"未知"},evidenceSource:{user_reference:"期望结果",user_criteria:"填写的要求",source_contract:"源项目约束",observed_output:"实际输出",runtime_observation:"Runtime 原始数据",deterministic_assertion:"确定性断言"},listSeparator:"、"}},Jxe={closeAria:"关闭错误提示",loadFailed:"无法读取迁移数据,请重试。",refreshFailed:"无法刷新迁移状态,请重试。"},ewe={title:"终止当前迁移?",description:"终止后,当前分析或迁移进程将停止,已执行的步骤不会继续。"},BVe={common:Axe,optimization:Txe,projects:_xe,framework:jxe,state:Nxe,historyStatus:Rxe,task:Ixe,verification:Pxe,transfer:Dxe,validation:Mxe,duration:Lxe,expiry:$xe,analysis:Fxe,activity:Bxe,artifact:Uxe,model:Qxe,upload:zxe,deployment:Vxe,workspace:Hxe,actions:qxe,capability:Wxe,conversation:Kxe,questions:Gxe,pendingInput:Xxe,confirmation:Yxe,evaluation:Zxe,errors:Jxe,stopDialog:ewe},UVe=Object.freeze(Object.defineProperty({__proto__:null,actions:qxe,activity:Bxe,analysis:Fxe,artifact:Uxe,capability:Wxe,common:Axe,confirmation:Yxe,conversation:Kxe,default:BVe,deployment:Vxe,duration:Lxe,errors:Jxe,evaluation:Zxe,expiry:$xe,framework:jxe,historyStatus:Rxe,model:Qxe,optimization:Txe,pendingInput:Xxe,projects:_xe,questions:Gxe,state:Nxe,stopDialog:ewe,task:Ixe,transfer:Dxe,upload:zxe,validation:Mxe,verification:Pxe,workspace:Hxe},Symbol.toStringTag,{value:"Module"})),twe={loading:"加载中…",searchLabel:"搜索{{label}}",searchPlaceholder:"搜索{{label}}",retry:"重试",noMatches:"没有匹配项",noOptions:"暂无可选项",selection:"{{label}}:{{value}}"},nwe={badge:"焕然一新",view:"查看新特性",title:"本次更新",defaultNotes:{multiRegion:"多地域智能体:并行加载北京与上海 Runtime,列表下滑即可继续加载。",switchAgent:"会话内切换:在输入框旁选择智能体,并直接开启一段新会话。",visualCanvas:"可视化执行画布:通过横向画布查看多智能体结构,并支持全屏浏览。"}},iwe={label:"新会话模式",agent:"智能体",skill:"技能定制",video:"视频创作"},rwe={select:"选择新会话模式",agent:{label:"Agent",description:"与当前选择的 Agent 对话"},builtin:{label:"内置智能体",description:"使用平台提供的智能体"},codex:{label:"Codex 智能体",description:"在沙箱中执行任务"},deepseekHarness:{label:"DeepSeek Harness",description:"打开 DeepSeek Harness 工作区"},arkClaw:"ArkClaw",hermes:"Hermes 智能体",checking:"正在检查配置",notConfigured:"管理员未配置",unavailable:"暂不可用"},swe={select:"选择智能体",typesLabel:"智能体类型",listLabel:"{{type}}列表",types:{agent:"智能体",general:"通用智能体",mpa:"MPA 智能体",codex:"Codex 智能体",deepseekHarness:"DeepSeek Harness",openclaw:"OpenClaw 智能体",hermes:"Hermes 智能体"},loading:"正在加载智能体",reload:"重新加载",empty:"暂无{{type}}",emptyLocal:"暂无本地智能体",emptyGeneral:"暂无通用智能体",createHint:"请前往智能体页创建",localHint:"请检查当前 Studio 启动目录",waking:"正在唤醒",opening:"正在打开",connecting:"正在连接",loadingMore:"加载中",loadMore:"加载更多",runtimeTimeout:"加载智能体超时(15 秒),请检查网络或 Runtime 服务后重试",loadGeneral:"加载通用智能体",loadType:"加载 {{type}}",connectGeneral:"连接通用智能体",openLocal:"打开本地智能体",openType:"打开 {{type}}",wakingHint:"正在唤醒智能体,可能需要一些时间。"},awe={spaceAria:"技能空间",configuration:"技能定制配置",actions:{create:"技能生成",optimize:"技能优化"},selectAction:"选择技能定制方式",actionList:"技能定制方式",style:"风格",selectStyle:"选择风格",model:"模型",selectModel:"选择模型",styles:{concise:"简洁实用",strict:"严谨稳健",tutorial:"教程友好",automation:"自动化优先"},modelLoadFailed:"模型配置加载失败",spaceLoadFailed:"Skill Space 加载失败",skillLoadFailed:"Skill 加载失败",unnamedSpace:"未命名 Skill Space",space:"技能空间",select:"选择 Skill",selectAria:"选择 Skill:{{skill}}",loadingSpaces:"正在加载 Skill Space",reload:"重新加载",emptySpaces:"暂无 Skill Space",skillList:"{{space}} Skill 列表",loadingSkills:"正在加载 Skill",emptySkills:"暂无 Skill"},owe={modes:{auto:"自动识别",text_to_video:"文生视频",reference_to_video:"参考素材生视频",video_editing:"视频编辑",video_extension:"视频续写",first_last_frame:"首尾帧生成"},taskNames:{auto:"视频生成",text_to_video:"文生视频",reference_to_video:"参考素材生视频",video_editing:"视频编辑",video_extension:"视频续写",first_last_frame:"首尾帧生成"},controls:{label:"视频创作配置",aspectRatio:"比例",selectAspectRatio:"选择比例",resolution:"清晰度",selectResolution:"选择清晰度",duration:"时长",durationShort:"{{count}} 秒",durationAria:"视频时长:{{count}} 秒",lastFrame:"尾帧",lastFrameHelper:"添加视频结束画面",assistImage:"辅助图片",referenceImage:"参考图片",assistImageHelper:"用于补充画面参考",imageHelper:"支持常见图片格式",referenceVideo:"参考视频",videoHelper:"支持常见视频格式",optional:"可选",replace:"更换",add:"添加",upload:"上传{{label}}",replaceFile:"更换{{label}}:{{name}}",removeFile:"移除{{label}} {{name}}",storageUnavailable:"管理员未配置持久化存储",loadingEnhancer:"正在加载增强模型",enhancerHint:"使用 {{model}} 模型进行意图识别和提示词增强",enhancerUnavailable:"增强模型不可用"},task:{title:"视频生成任务",closeAria:"关闭视频生成任务弹窗",progressAria:"视频生成进度",optimizedPrompt:"优化后的提示词",processingAria:"{{task}}处理进度",waitingAria:"{{status}},已等待{{elapsed}}",elapsed:"已等待 {{elapsed}}",previewAria:"生成结果预览",close:"关闭",download:"下载视频",retryOptimization:"重试提示词优化",retryGeneration:"重试视频生成",providerQueued:"等待模型调度",providerRunning:"模型生成中",providerSubmitting:"正在提交任务",queuedHint:"任务已提交,模型开始处理后状态会自动更新",runningHint:"这可能持续数分钟,完成后将在这里显示视频预览",backgroundHint:"可以关闭弹窗,任务会继续在后台运行",successHint:"视频已生成,可预览或下载",activationHint:"请先在模型控制台开通服务,再重试生成",retryHint:"修正问题后可重试当前步骤",steps:{optimizationFailed:"提示词优化失败",optimizationDone:"提示词优化完成",optimizationActive:"提示词优化中",generationDone:"{{task}}已完成",generationFailed:"{{task}}失败",generationQueued:"{{task}}排队中",generationRunning:"{{task}}生成中",generationActive:"{{task}}进行中",generationPending:"等待视频生成",generationComplete:"视频生成完成"},elapsedHours:"{{hours}}小时{{minutes}}分",elapsedMinutes:"{{minutes}}分{{seconds}}秒",elapsedSeconds:"{{seconds}}秒"}},lwe={compactSelect:twe,featureNotice:nwe,workspace:iwe,mode:rwe,agentPicker:swe,skill:awe,video:owe},QVe=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:swe,compactSelect:twe,default:lwe,featureNotice:nwe,mode:rwe,skill:awe,video:owe,workspace:iwe},Symbol.toStringTag,{value:"Module"})),cwe="审核中心",uwe="审核资源类型",dwe="仅管理员可以访问审核中心",fwe="搜索申请名称、提交人或版本",hwe="审核状态",pwe="{{count}} 条待审核",mwe="共 {{count}} 条申请",gwe={skill:"技能",agent:"智能体"},bwe={all:"全部状态",pending:"待审核",approved:"已通过",returned:"已退回",approving:"发布中"},ywe={application:"申请名称",submitter:"提交人",version:"版本",submittedAt:"提交时间",status:"状态",actions:"操作"},vwe={details:"详情",detailsFor:"查看 {{name}} 的申请详情",approve:"通过",approveFor:"通过 {{name}} 的申请",return:"退回",returnFor:"退回 {{name}} 的申请",close:"关闭",backToDetails:"返回详情",confirmApprove:"确认通过",confirmReturn:"确认退回",clearFilters:"清除筛选",refresh:"刷新",cancel:"取消",resumeApproval:"继续发布"},xwe={title:"暂无审核申请",description:"提交的审核申请会显示在这里",filteredTitle:"没有匹配的申请",filteredDescription:"试试其他关键词,或调整审核状态"},wwe={title:"申请详情",sections:"申请详情内容",overview:"申请信息",files:"提交文件 · {{count}}",requestType:"申请类型",update:"版本更新",firstRelease:"首次发布",source:"来源",source_skill:"{{name}}的个人技能空间",source_agent:"{{name}}的开发环境",destination:"发布目标",destination_skill:"企业共享技能空间",destination_agent:"全员共享智能体",region:"区域",visibility:"发布后可见范围",shared:"全员可见",description:"功能说明",changes:"本次提交说明",example:"使用示例",history:"审核记录",submitted:"{{name}}提交申请",versionFixed:"仅审核本次提交的版本",instructions:"使用说明",filesTab:"提交文件",filesFailed:"加载提交文件失败",unknownAuthor:"未知申请人",reviewer:"审批人",reviewedAt:"审批时间",approved:"{{name}}通过申请",returned:"{{name}}退回申请",unknownReviewer:"未知审批人",approvedBy:"通过人",returnedBy:"退回人",comment:"审批评论",result:"审批结果",noHistory:"此技能尚未提交审核",pendingHint:"等待管理员审核",approvingHint:"管理员已确认通过,正在发布到企业共享空间",approving:"{{name}}确认通过,等待完成发布"},kwe={failed:"待审核空间暂不可用",retry:"重试"},Owe={approveTitle:"通过申请",returnTitle:"退回申请",approveDescription:"通过后,{{name}} 的 {{version}} 版本将在企业共享空间中向全员公开",returnDescription:"退回 {{name}} 的 {{version}} 版本,并向申请人说明原因",reason:"退回理由",reasonRequired:"请填写退回理由",reasonHelp:"最多 256 个字符,申请人可以看到此理由",saving:"处理中…",failed:"审批失败,请重试",approved:"{{name}} 已通过并公开",returned:"{{name}} 已退回",comment:"评论(可选)",commentHelp:"最多 256 个字符,申请人可以看到此评论"},Swe={title:"AI 评分",points:"{{score}} 分",insufficient:"依据不足",status:{unscored:"尚未评分",not_requested:"尚未评分",queued:"等待评分",running:"评分中",completed:"已评分",failed:"评分失败"},loading:"加载评分…",starting:"正在提交评分…",loadFailed:"加载评分失败",retryFailed:"提交评分失败",failed:"评分未完成,请管理员重试",retry:"重新评分",start:"开始评分",reload:"重新加载",download:"下载 JSON",expand:"展开",collapse:"收起",hint:"评分针对本次提交版本,供人工审批参考",dimensions:{safety:"安全性",usability:"易用性",completeness:"完整性",reliability:"可靠性",maintainability:"可维护性"},risks:"风险提示",suggestions:"改进建议",model:"评分模型",rubric:"评分标准版本",time:"评分时间",severity:{low:"低风险",medium:"中风险",high:"高风险",critical:"严重风险"},coverage:"评审范围",coverageCount:"已评审 {{included}} / {{total}} 个文件",coverageIncomplete:"部分内容未纳入评审,评分依据不完整",omittedFile:"未评审 {{path}}:{{reason}}",truncatedFile:"仅评审部分内容 {{path}}:{{reason}}",originalError:"云端原始错误"},zVe={title:cwe,category:uwe,adminOnly:dwe,search:fwe,filterStatus:hwe,pendingCount:pwe,total:mwe,kind:gwe,status:bwe,columns:ywe,actions:vwe,empty:xwe,detail:wwe,space:kwe,decision:Owe,score:Swe},VVe=Object.freeze(Object.defineProperty({__proto__:null,actions:vwe,adminOnly:dwe,category:uwe,columns:ywe,decision:Owe,default:zVe,detail:wwe,empty:xwe,filterStatus:hwe,kind:gwe,pendingCount:pwe,score:Swe,search:fwe,space:kwe,status:bwe,title:cwe,total:mwe},Symbol.toStringTag,{value:"Module"})),Ewe={cancel:"取消",close:"关闭",retry:"重试",tryAgain:"重新尝试",closeDialog:"关闭{{title}}",agentFallback:"{{agent}} 智能体",unknownSource:"未知来源"},Cwe={terminalTitle:"终端",browserTitle:"沙箱浏览器",terminalSubtitle:"连接当前 AgentKit Session 的交互式终端",browserSubtitle:"在当前 AgentKit Session 中查看与操作浏览器",connecting:"正在连接…",connected:"已连接",notConnected:"尚未连接",opening:"正在打开 {{title}}",connectingSession:"工具正在连接当前 AgentKit Session。",openFailed:"{{title}} 打开失败"},Awe={title:"恢复 Codex 对话",subtitle:"选择当前 Sandbox Session 中最近更新的 Thread",loading:"正在读取历史对话",loadFailed:"历史对话读取失败",empty:"暂无可恢复的对话"},Twe={title:"Codex 权限",subtitle:"设置会保存到当前 Sandbox Session,并同步到其中的所有 Thread",sandboxMode:"沙箱模式",approvalPolicy:"审批策略",approvalMethod:"审批方式",networkAccess:"允许网络访问",networkAccessHelp:"控制 workspace-write 与只读模式中的外部网络访问。",fullAccessWarning:"完全访问会关闭文件系统与网络隔离,请只在可信任务中使用。",save:"保存权限",sandboxChoices:{readOnly:{label:"只读",detail:"允许读取文件,不允许写入工作空间。"},workspaceWrite:{label:"工作区写入",detail:"允许在当前工作空间内读取与修改文件。"},fullAccess:{label:"完全访问",detail:"不启用沙箱隔离,适合明确可信的任务。"}},approvalChoices:{untrusted:{label:"仅不可信命令",detail:"只对 Codex 判断为不可信的操作发起审批。"},onRequest:{label:"按需审批",detail:"Codex 可在必要时请求你确认命令或文件修改。"},never:{label:"不审批",detail:"Codex 不会暂停并请求人工批准。"}},reviewerChoices:{user:{label:"由我审批",detail:"审批请求会显示在 Studio 中,由你决定。"},autoReview:{label:"自动审查",detail:"使用 Codex 自动审查流程处理审批请求。"}}},_we={title:"工作空间",subtitle:"选择当前 Codex Thread 执行命令与修改文件的目录",absolutePath:"绝对路径",browse:"浏览",parent:"上一级",empty:"当前目录没有子目录",locked:"当前对话已经开始,工作空间已锁定。新建 Sandbox 会话后可重新选择。",useDirectory:"使用此目录"},jwe={fileTitle:"允许修改文件?",commandTitle:"允许执行命令?",subtitle:"Codex 正在等待你的决定",workingDirectory:"执行目录",decline:"拒绝",acceptOnce:"仅本次允许",acceptSession:"本会话允许"},Nwe={availableSkills:"可用 Skills",selectModel:"选择模型",commands:"Codex 快捷命令",currentModel:"当前:{{model}}",loadingSkills:"正在发现当前工作区的 Skills…",loadingModels:"正在读取模型…",noSkillMatches:"当前工作区没有匹配的 Skill",noModelMatches:"没有匹配模型,也可以直接输入模型 ID",noCommandMatches:"没有匹配的快捷命令",skillFallback:"加载并执行该 Skill",add:"添加",uploadImage:"上传图片",uploadDocument:"上传文档或 PDF",uploadVideo:"上传视频",openTerminal:"进入终端",viewBrowser:"查看浏览器",permissions:"Codex 权限",workspaceLocked:"对话已开始,工作空间已锁定",selectWorkspace:"选择工作空间",workspace:"Codex 工作空间",endpointCopied:"Endpoint 已复制",copyEndpoint:"复制 Sandbox Endpoint",continuePlaceholder:"继续说明你想实现或调整的内容",messagePlaceholder:"向 AgentKit 沙箱发送消息,输入 / 查看命令,输入 $ 调用 Skill…",stop:"停止生成",send:"发送",stopping:"正在确认停止…",resume:"恢复任务",steer:"追加要求",steerPlaceholder:"可继续追加要求,或随时停止任务…"},Rwe={defaultName:"我的智能体",namedDefault:"我的 {{agent}}",creatingTitle:"正在创建 {{agent}} 智能体",failedTitle:"启动失败",createTitle:"创建 {{agent}} 智能体",fallbackError:"AgentKit 沙箱初始化失败,请稍后重新尝试。",creatingDescription:"正在创建并等待 {{agent}} 智能体就绪,这通常需要半分钟",name:"智能体名称",storageSize:"存储大小",storageHelp:"数据将持久化保存,可设置 {{min}}–{{max}} GiB。",persistent:"持久化",persistenceUnsupported:"当前环境不支持快照持久化",persistentHelp:"保留智能体数据,后续可继续使用。",temporaryHelp:"智能体将在 8 小时后清空",cancelCreation:"取消创建",confirm:"确认创建",retry:"重新尝试"},Iwe={activeAria:"Codex 智能体会话已开启",openAria:"开启 Codex 智能体会话",active:"Codex 智能体会话中",entry:"灵光一现",exit:"退出当前智能体",expired:"已到期",remainingHours:"剩余 {{hours}} 小时 {{minutes}} 分钟",remainingMinutes:"剩余 {{minutes}} 分钟",expiryWarning:"远端开发环境最长保留 8 小时,将于 {{expiry}} 到期({{remaining}});到期后清除对话和文件。",usingAgent:"当前您在使用 {{agent}} 智能体",activityAria:"Sandbox 操作记录",activity:"操作记录",tokenUsageAria:"Codex Token 用量",tokens:"{{label}}:{{value}} tokens",tokenLabels:{total:"总计",input:"输入",cachedInput:"缓存输入",output:"输出",reasoningOutput:"推理输出"}},Pwe={back:"返回智能体列表",subtitle:"{{agent}} 智能体详情",type:"智能体类型",status:"状态",createdBy:"创建人",snapshotStatus:"快照状态",toolType:"工具类型",createdAt:"创建时间",snapshotReason:"快照原因",expiresAt:"过期时间",snapshotId:"快照 ID",sessionId:"会话 ID",sourceSessionId:"来源 Session ID",delete:"删除智能体",waking:"唤醒中…",opening:"打开中…",wake:"唤醒智能体",open:"打开智能体",deleteTitle:"删除智能体?",deleteDescription:"将删除“{{name}}”及其保存的数据,此操作无法撤销。",deleting:"删除中…",confirmDelete:"确认删除",sleepingHint:"该智能体已休眠,进入时需要唤醒,可能需要一些时间。",wakingHint:"正在唤醒智能体,可能需要一些时间。",agentId:"智能体 ID"},Dwe={back:"返回智能体列表",createdBy:"创建人 {{creator}}",ariaLabel:"智能体工作区",main:"主界面",terminal:"终端",mainTitle:"{{agent}} 主界面",openingTerminal:"正在打开终端…",terminalTitle:"{{agent}} 终端"},Mwe={prompt:`使用 AgentKit Studio Plugin 端云接力当前会话、项目和任务。请直接执行,不要让我手动打开终端。 Studio:{{studioUrl}} 配对码:{{pairingCode}}`,installPrompt:`请安装 AgentKit Studio Plugin。请直接执行以下安装命令,不要让我手动打开终端。 -安装命令:{{command}}`,title:"接力到云端继续执行",description:"按顺序复制两段提示词,Codex 会通过插件将您的本地任务接力到云端",closeAria:"关闭本地迁移引导",installTitle:"安装插件",installDescription:"首次使用时,请选择一种安装方式。",copied:"已复制",copyInstallPrompt:"复制安装提示词",copyInstallCommand:"复制安装命令",installMethodAria:"插件安装方式",conversationInstall:"与 Codex 对话安装",terminalInstall:"从终端安装",taskTitle:"任务接力",taskDescription:"插件安装完成后复制,Codex 会迁移当前项目并继续执行任务。",copyHandoffPrompt:"复制接力提示词",generatingPairing:"正在生成新的配对码",pairingExpired:"配对码已过期",pairingRemaining:"配对码有效期剩余 {{countdown}}",refreshing:"刷新中",refreshPairing:"刷新配对码",pairingLoading:"正在生成配对码",pairingUnavailable:"配对码尚未生成。",statusAria:"端云接力状态",statusTitle:"接力状态",requestReceivedNamed:"已收到“{{name}}”的端云接力请求",requestReceivedCurrent:"已收到当前项目的端云接力请求",requestHelp:"复制接力提示词后,Codex 的请求会显示在这里。",entering:"正在进入",enterCodex:"进入 Codex",clipboardUnsupported:"当前浏览器不支持写入剪贴板。",steps:{request:"等待端侧请求",session:"创建云端 Session",restore:"恢复项目",continue:"发送续跑任务"},status:{issued:"等待请求",creating:"正在创建 Session",sessionCreated:"正在迁移项目",continuing:"正在启动云端任务",running:"云端执行中",completed:"接力完成",failed:"接力失败"}},Mwe={model:{description:"显示或切换当前对话模型",keywords:"模型 switch"},models:{description:"列出 app-server 可用模型",keywords:"模型列表 list"},skill:{description:"浏览并调用当前工作区可用的 Skill",keywords:"技能 workflow"},skills:{description:"浏览并调用当前工作区可用的 Skills",keywords:"技能列表 workflow list"},new:{description:"开始一个新对话",keywords:"新建 对话"},resume:{description:"打开历史会话或恢复指定 Thread",keywords:"历史 恢复 session"},fork:{description:"从当前上下文分叉一个新对话",keywords:"分叉 branch"},compact:{description:"压缩当前对话上下文",keywords:"压缩 上下文"},archive:{description:"归档当前对话并新建对话",keywords:"归档 关闭"},status:{description:"显示当前连接、Thread、模型与 Token 状态",keywords:"状态 连接 token"},clear:{description:"清空当前视图并开始新对话",keywords:"清空 重置"},help:{description:"显示 Sandbox 支持的快捷命令",keywords:"帮助 命令"},currentModel:"当前模型",availableModel:"可用模型",workspace:"工作空间",notSet:"未设置",modelLabel:"模型",statusLabel:"状态",running:"运行中",idle:"空闲",totalTokens:"累计 Token",contextWindow:"上下文窗口",imageFallback:"图片",unknown:"未知快捷命令:{{command}}。输入 /help 查看可用命令。",automaticSkills:"智能开发模式会自动使用开发能力,无需手动选择 Skill。",activity:{new:"已新建 Codex 对话",resumed:"已恢复 Codex 对话",deleted:"已删除 Codex 历史会话",modelChanged:"已切换 Codex 模型",availableModels:"Codex 可用模型",noModels:"当前没有可用模型",forked:"已分叉 Codex 对话",compacting:"已开始压缩当前 Codex 对话",archived:"已归档 Codex 对话",status:"Codex 当前状态",help:"Sandbox 支持的 Codex 快捷命令"}},Lwe={label:"智能构建任务",queued:"构建任务已排队",running:"构建任务正在后台运行",recovering:"正在恢复构建任务",waiting_user:"构建任务需要继续处理",stopping:"正在停止构建任务",succeeded:"构建任务已完成",cancelled:"构建任务已停止",failed:"构建任务未完成",open:"返回任务",hide:"隐藏任务通知",reconnecting:"正在重新连接任务服务,已有任务继续保留。"},$we={common:Swe,tool:Ewe,threads:Cwe,permissions:Awe,workspace:Twe,approval:_we,composer:jwe,launch:Nwe,session:Rwe,agentDetails:Iwe,agentWorkspace:Pwe,handoff:Dwe,commands:Mwe,taskNotice:Lwe},VVe=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:Iwe,agentWorkspace:Pwe,approval:_we,commands:Mwe,common:Swe,composer:jwe,default:$we,handoff:Dwe,launch:Nwe,permissions:Awe,session:Rwe,taskNotice:Lwe,threads:Cwe,tool:Ewe,workspace:Twe},Symbol.toStringTag,{value:"Module"})),Fwe={retry:"重试",signInToContinue:"登录以继续使用",signInWith:"使用 {{provider}} 登录",enterUsername:"输入一个用户名即可开始",usernamePlaceholder:"用户名(字母 + 数字,最多 16 位)",enter:"进入",usernameInvalid:"只能包含大小写字母和数字,最多 16 位。",identityProvider:{volcengine:"火山引擎 Identity",byteplus:"BytePlus Identity"},powered:{volcengine:"火山引擎 AgentKit 提供企业级 Agent 解决方案",byteplus:"BytePlus AgentKit 提供企业级 Agent 解决方案"},legalPrefix:"继续即表示你已阅读并同意 AgentKit",terms:"产品和服务条款",copyright:"© {{year}} VeADK。保留所有权利。"},Bwe={title:"登录状态已过期",description:"当前编辑内容会保留。重新登录后,刚才的操作将自动继续。",waiting:"等待登录完成…",signInAgain:"重新登录"},Uwe={breadcrumbs:"面包屑",selectAgent:"选择 Agent",switchAgent:"切换智能体"},Qwe={cancel:"取消",close:"关闭确认框"},HVe={login:Fwe,authExpired:Bwe,navbar:Uwe,confirm:Qwe},qVe=Object.freeze(Object.defineProperty({__proto__:null,authExpired:Bwe,confirm:Qwe,default:HVe,login:Fwe,navbar:Uwe},Symbol.toStringTag,{value:"Module"})),zwe={defaultUser:"用户",shortcuts:"快捷入口",tryCli:"体验 AgentKit CLI",developerResources:"开发者资源",systemInfo:"系统信息",language:"语言",issueFeedback:"问题反馈",logout:"退出登录",roles:{admin:"管理员",developer:"开发者",user:"普通用户",super_admin:"超级管理员"}},Vwe={home:"返回首页",expand:"展开侧边栏",collapse:"收起侧边栏",label:"主导航",newChat:"新会话",agents:"智能体",workspaces:"工作区",library:"资源库",cronjobs:"定时任务",automations:"自动化",users:"用户管理",administration:"管控",reviewCenter:"审核中心"},Hwe={title:"历史会话",newConversation:"新会话",create:"新建会话",loading:"正在加载历史会话…",empty:"暂无会话",current:"当前",manage:"管理历史会话:{{title}}",more:"更多",delete:"删除",loadingMore:"加载中…",loadMore:"加载更多",evaluatingTitle:"正在自动评测",evaluating:"评测中",generating:"正在生成"},WVe={account:zwe,navigation:Vwe,history:Hwe},KVe=Object.freeze(Object.defineProperty({__proto__:null,account:zwe,default:WVe,history:Hwe,navigation:Vwe},Symbol.toStringTag,{value:"Module"})),qwe={placeholder:"请选择",collapseOptions:"收起模型选项",expandOptions:"展开模型选项",noOptions:"暂无可用选项",noMatches:"没有匹配项,可直接使用当前模型 ID"},Wwe={unsupportedActivity:"不支持的 Skill 对话活动",ariaLabel:"Skill 生成对话"},Kwe={code:"错误码:{{code}}",type:"错误类型:{{type}}",representation:"异常表示:{{value}}",rawResponse:`服务端原始响应: -{{value}}`,original:"原始错误:{{message}}",details:"详细信息"},Gwe={ariaLabel:"Skill 文件树",viewSource:"查看源码",viewPreview:"查看预览",download:"下载",binaryFile:"二进制文件",bytes:"{{value}} 字节",binaryDescription:"当前接口仅返回文件元数据,可单独下载原文件。",metadata:"Skill 元数据",noFiles:"暂无文件"},Xwe={close:"关闭",name:"名称",region:"地域",optionalDescription:"描述(可选)",cancel:"取消",create:"创建",creating:"创建中…",save:"保存",saving:"保存中…",upload:"上传",uploading:"上传中…",createSpaceTitle:"新建 Skill 空间",editSpaceTitle:"编辑 Skill 空间",uploadTitle:"上传到 {{name}}",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",archiveValidationFailed:"Skill ZIP 格式校验失败",uploadFailed:"上传 Skill 失败",dropzone:"拖拽 Skill ZIP 到这里",chooseLocalFile:"或点击选择本地文件",archiveHelp:"ZIP 根目录需要包含 SKILL.md,也可以只包含一层包装目录。选择后仅检查格式,不会自动上传。",validating:"正在检查文件格式…",validationPassed:"格式检查通过:{{name}},共 {{count}} 个文件"},Ywe={styles:{concise:"简洁实用",strict:"严谨稳健",tutorial:"教程友好",automation:"自动化优先",custom:"自定义",customFallback:"自定义风格"},stages:{preparing:"正在准备 Dev Sandbox",ready:"Skill 已生成并通过格式校验",failed:"生成失败",cancelled:"已停止",validating:"正在校验 Skill 格式",packaging:"正在整理文件",generating:"正在生成 Skill",repairingAgain:"正在再次修复",autoRepairing:"正在自动修复({{attempt}}/{{max}})"},validation:{fallback:"Skill 格式校验未通过",repairInstruction:"只修复下面列出的 Skill 格式错误,不要改变原有用途和内容范围。",recheckInstruction:"修复后重新检查目录结构、SKILL.md frontmatter 和所有文本文件。",nameTooLong:"Skill 名称不能超过 64 个字符",invalidName:"Skill 名称只能包含小写字母、数字和连字符",modelTooLong:"模型 ID 不能超过 128 个字符",invalidModel:"模型 ID 只能包含字母、数字、点、下划线、连字符、斜杠和冒号"},errors:{loadCapability:"读取 Dev Sandbox 配置失败",autoRepair:"自动修复格式错误失败",pollCandidate:"读取候选方案状态失败,正在重试",createCandidate:"创建候选方案失败",refine:"继续调整失败",repairAgain:"再次修复格式错误失败",selectSpace:"请选择上传的 Skill Space",unsupportedRegion:"当前 Skill 地域不受支持",upload:"上传 Skill 失败",download:"下载失败"},sessionMax:"Session 最长保留 1 小时",remaining:"剩余 {{minutes}}:{{seconds}}",unnamedSpace:"未命名 Skill Space",leaveConfirmation:"离开后将停止并释放正在运行的 Dev Sandbox,确定离开吗?",createTitle:"创建技能",optimizeTitle:"优化 {{name}}",skillFallback:"技能",back:"返回技能空间",home:"主页技能生成",basicInfo:"基本信息",goal:"目标",createIntentPlaceholder:"描述希望这个 Skill 完成什么任务",optimizeIntentPlaceholder:"描述希望如何优化当前 Skill",skillName:"Skill 名称",autoNamePlaceholder:"留空时自动生成",nameHelp:"仅支持小写字母、数字和连字符;留空时自动生成。",createPlans:"生成方案",optimizePlans:"优化方案",createPlansDescription:"按不同方案并行生成多个技能,您可以选择最佳结果",optimizePlansDescription:"按不同方案并行优化当前技能,您可以选择最佳结果",plan:"方案 {{count}}",remove:"移除",model:"模型",modelPlaceholder:"选择或输入模型 ID",style:"风格",customStyle:"自定义风格",customStylePlaceholder:"描述表达方式、严谨程度或输出偏好",addConfiguration:"添加配置",notConfigured:"管理员未配置",generate:"生成",candidates:"候选方案",progress:"进度",retryCandidate:"重试此方案",formatValidationFailed:"格式校验未通过",repairAgain:"再次修复",files:"文件",downloadZip:"下载 ZIP",loadingFiles:"正在读取文件…",filesPending:"生成过程中会在这里显示完整文件树",uploadToSpace:"上传到 Skill Space",loadingSpaces:"正在加载 Skill Space",selectSpace:"选择 Skill Space",continuePlaceholder:"继续调整这个候选方案",continue:"继续调整",uploading:"上传中…",overwrite:"覆盖原 Skill",uploadToSelectedSpace:"上传到 Skill Space",uploadToCurrentSpace:"上传到当前空间",allCandidatesFailed:"所有方案均创建失败,可分别重试。"},Zwe={invalidFormat:"{{label}}格式错误。",recoveryStatus:"Skill 恢复点状态",errorResponse:"错误响应",errorDetails:"错误详情",missingContentType:"Content-Type 缺失",gatewayError:"{{fallback}}(HTTP {{status}},Content-Type: {{contentType}})。请检查代理或网关配置。",nonJson:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}},Content-Type: {{contentType}}),请检查代理或网关配置。",activity:"Skill 会话活动",invalidActivity:"Skill 会话活动格式错误。",invalidToolActivity:"Skill 工具活动格式错误。",invalidTextActivity:"Skill 文本活动格式错误。",publication:"Skill 发布结果",task:"Skill 会话",file:"Skill 文件",unknownTaskState:"Skill 会话状态无法识别。",capability:"Skill 工作台能力",loadCapability:"读取 Skill 工作台能力失败",prepareTask:"准备 Skill 会话失败",taskReference:"Skill 会话引用",startOptimization:"开始优化 Skill 失败",startTask:"开始 Skill 会话失败",taskSummary:"Skill 会话摘要",taskList:"Skill 会话列表",loadTaskList:"读取 Skill 会话列表失败",invalidTaskList:"Skill 会话列表格式错误。",loadTask:"读取 Skill 会话失败",artifact:"Skill 产物",artifactFile:"Skill 产物文件",loadArtifact:"读取 Skill 产物失败",refine:"继续调整 Skill 失败",stop:"停止当前 Skill 任务失败",publish:"发布 Skill 失败",nonNdjson:"发布 Skill 失败:服务端返回了非 NDJSON 响应。",missingStream:"发布 Skill 失败:服务端没有返回进度流。",publishProgress:"发布进度",invalidPublishProgress:"发布进度格式错误。",publishError:"发布错误",unknownPublishEvent:"未知的发布进度事件。",publishResult:"发布结果",streamEnded:"发布进度流提前结束,无法确认发布结果。请刷新技能中心确认状态。",deleteTask:"删除 Skill 会话失败",download:"下载 Skill 失败"},Jwe={configSelect:qwe,conversation:Wwe,errorDetails:Kwe,fileTree:Gwe,management:Xwe,generation:Ywe,api:Zwe},GVe=Object.freeze(Object.defineProperty({__proto__:null,api:Zwe,configSelect:qwe,conversation:Wwe,default:Jwe,errorDetails:Kwe,fileTree:Gwe,generation:Ywe,management:Xwe},Symbol.toStringTag,{value:"Module"})),e1e={back:"返回上一页",reload:"重新加载",notConfigured:"未配置",name:"名称",description:"描述",delete:"删除",save:"保存",saving:"保存中",add:"添加",manage:"管理",environment:"环境",noDescription:"暂无描述",refresh:"刷新",close:"关闭",retry:"重试",loading:"加载中…",previousPage:"上一页",nextPage:"下一页",edit:"编辑",all:"全部",search:"搜索",cancel:"取消",view:"查看",viewDetails:"查看详情",deleting:"删除中…",create:"创建",creating:"创建中",adding:"添加中",generating:"生成中",uploading:"上传中",preview:"预览",loadFailed:"加载失败",select:"选择",collapse:"收起",expand:"展开",none:"无"},t1e={ariaLabel:"AgentKit 快速入口",closeAriaLabel:"关闭 AgentKit 欢迎卡片",title:"欢迎使用 AgentKit",description:"通过 AgentKit 平台快速构建与托管您的企业级智能体",docsAriaLabel:"打开 AgentKit 文档,在新窗口打开",docs:"文档",consoleAriaLabel:"打开 AgentKit 控制台,在新窗口打开",console:"控制台"},n1e={checkUpdates:"检查更新",checkingVersions:"正在检查版本…",versionCheckError:"查询沙箱版本失败,请检查凭据、区域及接口权限后重试",sandboxUpdateError:"Sandbox 更新失败,请刷新检查实际状态后重试",modelEnvRepairUnavailable:"无法补齐模型环境变量,请检查 CODEX_API_KEY 和 CODEX_BASE_URL",updateSandbox:"更新{{variant}}{{name}}",updatingSandbox:"更新中",title:"系统信息",description:"查看当前 Studio 版本及关联的基础资源",general:"通用",currentVersion:"当前版本",storage:"存储",loadingStorage:"正在加载存储信息",tosAddress:"TOS 地址",openTosConsole:"在云控制台中打开 TOS 存储桶",environmentBuild:"环境构建",loadingEnvironmentResources:"正在加载环境构建资源",environmentResourcesError:"环境构建资源加载失败,请检查云凭据后重试。",codePipelineWorkspace:"CodePipeline 工作空间",codePipelinePipeline:"CodePipeline 流水线",openCodePipelineWorkspace:"在云控制台中打开 CodePipeline Workspace",createdOnFirstBuild:"首次构建时自动创建",containerRegistryRepository:"Container Registry 仓库",openContainerRegistryRepository:"在云控制台中打开 Container Registry 仓库",sandboxInfo:"沙箱信息",loadingSandboxInfo:"正在加载沙箱信息",sandboxInfoError:"沙箱信息加载失败,请重试。",snapshot:"快照版",snapshotWithSpace:"快照版 ",openToolConsole:"在云控制台中打开{{name}}",updateModelEnv:"更新{{variant}}{{name}}模型环境变量",modelEnvUpdated:"已更新",modelEnvAlreadyCurrent:"无需更新",userPool:"用户池",loadingUserPool:"正在加载用户池",userPoolError:"用户池加载失败,请重试。",modelEnvUpdateError:"模型环境变量更新失败,请重试。",openUserPoolConsole:"在云控制台中打开用户池{{name}}",unnamedUserPool:"未命名用户池",id:"ID",domain:"域名",region:"区域",noLocalUserPool:"本地模式未配置用户池",noUserPool:"当前 Studio 未配置用户池"},i1e={workspace:"Agent 工作区",library:"Agent 库",evaluation:"评测",agentList:"Agent 列表",agentDetails:"Agent 详情",newAgent:"新建 Agent",loading:"加载中…",loadingCloudAgents:"正在加载云端 Agent…",noAgentSelected:"请选择一个 Agent",local:"本地",remote:"云端",localAgent:"本地 Agent",remoteAgent:"云端 Agent",agentCount:"{{count}} 个 Agent",agentCountLabel:"Agent 数量",details:"详情",chat:"对话",update:"更新",backToAgentList:"返回 Agent 列表",loadingAgent:"正在加载 Agent",loadingAgentDescription:"正在读取 Agent 配置和 Runtime 信息。",loadingAgentInfo:"正在加载 Agent 信息…",detailLoadFailed:"无法加载 Agent 详情",detailLoadFailedDescription:"请检查 Runtime 状态后重试。",partialInfoUnavailable:"部分信息暂时不可用",upgradeRuntimeForDetails:"请升级 Runtime 以查看完整 Agent 信息。",basicInfo:"基本信息",usageOverview:"使用概览",sections:{basic:"基本信息",profileConfig:"Profile 配置",sessionConfig:"会话配置",usage:"使用概览",diagnostics:"诊断",evaluations:"评测",optimizations:"优化建议",integrations:"集成",versions:"版本",channels:"消息渠道"},evaluationGroup:"评测组",optimizations:"优化建议",optimizationsDescription:"根据评测结果查看可执行的优化建议。",integrations:"集成",githubVersions:"GitHub 版本",githubVersionsDescription:"查看持续交付产生的版本并创建回退 PR。",currentVersionOnly:"当前未启用 GitHub 持续交付,仅展示当前生产版本。",loadingVersions:"正在加载版本…",noVersion:"暂无版本记录",prLink:"Pull Request",viewPr:"查看 PR",author:"提交人",publishStatus:"发布状态",viewRelease:"查看发布记录",rollbackToVersion:"回退到此版本",rollingBack:"正在创建回退…",rollbackEvent:"回退事件",sourceMergedRuntimeStill:"最新源码已合并,但 Runtime 仍处于",currentProductionVersionHint:";当前生产版本保持不变。",usageSummary:"使用统计",totalCalls:"总调用次数",userCount:"用户数",userDetails:"用户明细",usageUserList:"Agent 使用用户列表",user:"用户",callCount:"调用次数",lastUsed:"最近使用",unknownUser:"未知用户",loadingUsage:"正在加载使用数据…",refreshing:"刷新中…",noUsage:"暂无使用记录",usageUnavailable:"当前 Agent 暂无可用的使用统计。",usagePagination:"使用记录分页",pageOf:"第 {{page}} / {{total}} 页",notProvided:"暂未提供",integrationMethods:"集成方式",integrationDescription:"通过 Runtime API 或 A2A 协议集成当前 Agent。",integrationProtocol:"集成协议",runtimeStatus:"Runtime 状态",executionFlow:"执行流程",probingIntegration:"正在检测集成能力",probingIntegrationDescription:"正在读取可用端点和鉴权配置。",configurationStatus:"配置状态",discoveryEndpoint:"发现端点",invocationEndpoint:"调用端点",invocationUrl:"调用地址",authentication:"鉴权方式",networkAccess:"网络访问",notAvailable:"暂无",noAuthentication:"无需鉴权",noApiKeyRequired:"无需 API Key",usesOauthJwt:"使用 OAuth / JWT",showApiKey:"显示 API Key",hideApiKey:"隐藏 API Key",pythonExample:"Python 示例",deploymentConfig:"部署配置",deploymentConfigDescription:"确认实例和运行配置后更新 Runtime。",deploymentRegion:"部署区域",mpaControlPlane:"MPA 控制面",loadingMpaAgentView:"正在读取 MPA Runtime 绑定…",mpaRuntimeBound:"该 MPA Agent 已绑定唯一 Runtime,可继续管理。",mpaRuntimeMissing:"当前 Agent 没有可见的 MPA Runtime 绑定。",mpaRuntimeBindingAmbiguous:"多个 MPA Runtime 匹配当前 Agent,请先修复绑定后再修改。",mpaRuntimeOrphan:"Runtime 存在,但其中没有当前 MPA Profile。",mpaRuntimeLegacyAuthUnsupported:"该 Runtime 使用旧版 MPA 镜像,仍要求 X-Jwt-Token。请先更新到当前 AgentKit 兼容镜像,再管理 Profile 或 Session 配置。",profileConfig:"Profile 配置",profileConfigTitle:"Profile 配置",profileConfigDescription:"查看并应用 Agent 级 MPA Profile。Profile 是 Runtime 的长期默认配置,新会话默认继承它。",profileStatus:"Profile 状态",profileApplied:"已应用",profileNotApplied:"未应用",profileNotAppliedDescription:"当前 Runtime 可运行,但尚未保存为 Studio 可管理的 Profile。应用后会生成 Profile revision。",applyProfile:"应用 Profile",reapplyProfile:"重新应用 Profile",editProfile:"编辑 Profile",profileApplying:"应用中…",profileAppliedNotice:"Profile 已应用,当前 revision 为 {{revision}}。",profileApplyIncomplete:"Profile 应用未完成,请查看当前操作状态后重试。",profileApplyFailed:"Profile 应用失败。",profilePrompt:"系统提示词",profileResources:"资源配置",profileResourceSummary:"{{tools}} 个工具 · {{skills}} 个 Skill · {{mcp}} 个 MCP 服务",sessionConfigTitle:"会话配置",sessionConfigDescription:"查看和调整当前 MPA Session 的执行配置。变更只对下一轮对话生效。",loadingSessionConfig:"正在加载会话配置…",sessionConfigNoAgent:"请选择一个 MPA Agent 后再管理会话配置。",sessionConfigNonMpa:"会话配置仅适用于 MPA Agent。",sessionConfigNoSession:"请先打开这个 MPA Agent 的对话,再修改会话配置。",sessionConfigDifferentRuntime:"请先切回这个 MPA Agent 的当前对话,再修改会话配置。",sessionConfigSaved:"会话配置已更新,下一轮对话将使用新 revision。",sessionConfigStale:"该 Session 已被其他位置修改,已展示最新配置,请确认后再保存。",sessionConfigRevision:"配置 revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"最新 Profile revision",sessionProfileUpgradeAvailable:"检测到新的 Profile revision:v{{current}} → v{{target}}。",upgradeSessionProfile:"升级 Session Profile",sessionProfileUpgrading:"升级中…",sessionProfileUpgraded:"Session Profile 已升级,下一轮对话将使用新 revision。",sessionProfileUpgradeFailed:"Session Profile 升级失败。",sessionModelOverride:"模型覆盖",modelId:"模型 ID",inheritProfileDefault:"继承 Profile 默认值",sessionMcpServers:"MCP 服务",mcpServerCount:"已选择 {{count}} 个",clearSessionMcp:"清空 MCP 服务",mpaDiagnosticsTitle:"Runtime 诊断",mpaDiagnosticsDescription:"查看最近的 Runtime Console 运行记录,以及 Agent、Profile、Turn、task 和 worker 关联。",loadingMpaDiagnostics:"正在加载 Runtime 诊断…",noMpaDiagnostics:"当前 Session 暂无 Runtime 诊断运行记录。",latestRun:"最近运行",traceCorrelation:"Trace 关联",traceCorrelationDescription:"Runtime Console 为本次 invocation 返回的稳定标识。",traceSteps:"Trace 步骤",traceStepsDescription:"当前 invocation 最近的有界 Runtime Console 步骤。",mpaInstanceId:"MPA 实例",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker 类型",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile 版本",step:"步骤",stepCount:"步骤数",duration:"耗时",noTraceSteps:"本次 invocation 暂无 trace 步骤。",executionConfigMode:{replace:"Session 覆盖",clear:"本 Session 已清空",inherit:"使用 Profile 默认值"},concurrency:"并发数",selectedOptimizations:"已选优化项",selectedOptimizationsDescription:"这些优化会应用到本次更新。",optimizationProfile:"优化方案",updatePending:"等待更新",updatingDeployment:"正在更新部署",restoringUpdateConfig:"正在恢复更新配置…",updateConfigUnavailable:"无法读取更新配置",legacyConfigMissing:"旧版本 Runtime 缺少可恢复的配置,请重新创建。",deploymentFailed:"部署失败",continueEditing:"继续编辑",loadingOptimizations:"正在加载优化建议…",noOptimizations:"暂无优化建议",fixPriority:"优先级",suggestedModule:"建议模块",suggestionAndReason:"建议与原因",priority:{high:"高",medium:"中",low:"低"},modules:{agentStructure:"Agent 结构",prompt:"提示词",tool:"工具",knowledge:"知识库",memory:"记忆",workflow:"工作流",other:"其他"},evaluationGroupList:"评测组列表",newEvaluationGroup:"新建评测组",newEvaluationGroupName:"新评测组 {{count}}",searchEvaluationGroups:"搜索评测组",noMatchingEvaluationGroups:"没有匹配的评测组",noEvaluationGroupSelected:"请选择一个评测组",groupStats:"{{agents}} 个 Agent · {{runs}} 次运行",evaluationGroupDetails:"评测组详情",evaluationGroupStats:"{{agents}} 个 Agent · {{caseSet}} · {{runs}} 次运行",startEvaluation:"开始评测",evaluationConfig:"评测配置",historyResults:"历史结果",participatingAgents:"参与 Agent",selectedCount:"已选择 {{count}} 个",evaluationResources:"评测资源",evaluationSet:"评测集",evaluator:"评估器",caseCount:"{{count}} 条案例",evaluationMetrics:"评测指标",selectedMetricCount:"已选择 {{count}} 项",historyDescription:"查看每次评测的分数和运行状态。",noHistory:"暂无评测历史",noHistoryDescription:"运行一次评测后,结果会显示在这里。",evaluationRun:"第 {{index}} 次评测",evaluationRunMeta:"{{time}} · {{agents}} 个 Agent",overallScore:"综合分",completed:"已完成",evaluationDefaults:{coreRegression:"核心能力回归",safetyCheck:"安全与幻觉检查",coreSet:"核心回归集",safetySet:"安全边界集",toolSet:"工具调用集",qualityEvaluator:"综合质量评估器",factualEvaluator:"事实一致性评估器",toolEvaluator:"工具调用评估器",responseQuality:"回答质量",factualAccuracy:"事实准确性",toolUse:"工具调用",responseEfficiency:"响应效率",todayTime:"今天 10:32",yesterdayTime:"昨天 16:08",julyTime:"7 月 25 日 14:20",justNow:"刚刚"},defaultCases:{agentName:"示例 Agent",goodSetName:"示例正向案例集",badSetName:"示例负向案例集",weeklyFeedback:{input:"总结本周客户反馈,并按优先级归类。",output:"覆盖主要问题,给出清晰的优先级与下一步动作。",tag:"总结",reason:"任务完整覆盖了用户目标,输出结构清晰,并给出了可执行的下一步动作。"},research:{input:"查询最新公开资料并附上来源。",output:"调用搜索工具,结论与引用一一对应。",tag:"工具调用"},uncertainConclusion:{input:"在信息不足时直接给出确定结论。",output:"应明确说明未知,并主动询问缺失信息。",tag:"幻觉",reason:"信息不足时仍给出了确定结论,缺少必要的澄清步骤与不确定性说明。"},repeatedTool:{input:"连续重复调用相同工具获取同一结果。",output:"复用已有结果,避免无意义的重复调用。",tag:"效率"}},goodCases:"正向案例",badCases:"负向案例",goodCase:"正向案例",badCase:"负向案例",reference:"参考答案",caseResultFilter:"案例结果筛选",feedbackSourceFilter:"反馈来源筛选",searchCases:"搜索案例",searchCasesPlaceholder:"搜索输入、输出或标签",selectCases:"选择案例",selectAll:"全选",selectAllVisible:"选择当前可见案例",selectedCaseCount:"已选择 {{count}} 条",deleteSelected:"删除所选",deleteSelectedTitle:"删除所选 Agent",deleteSelectionDescription:"确定删除所选的 {{count}} 个项目吗?此操作无法撤销。",deleteCasesConfirm:"删除所选案例",deleteOneCaseConfirm:"删除这个案例",deleteFeedbackCase:"删除反馈案例",noFeedbackCases:"暂无反馈案例",noMatchingCases:"没有匹配的案例",loadingEvaluationSet:"正在加载评测集…",userInput:"用户输入",agentOutput:"Agent 输出",score:"得分",scoreReason:"评分原因",noUserInput:"暂无用户输入",noVisibleResponse:"暂无可见回复",note:"备注:",manualFeedback:"人工反馈",automaticFeedback:"自动反馈",scoreValue:"{{score}} 分",unknownTime:"时间未知",deleteAgentTitle:"删除 Agent",deleteAgentDescription:"确定删除 Agent“{{name}}”吗?",deleteDraftDescription:"确定删除草稿“{{name}}”吗?",deleteAgent:"删除 Agent",closeDeleteConfirmation:"关闭删除确认",mpaDeletePreviewSummary:"Studio 将清理可见的空闲会话、该 MPA 独占的沙箱模板和 Skill Space,最后删除 Runtime。数据库及共享资源保留;运行中的任务需先结束或停止。",mpaDeletePreviewSessions:"会话",mpaDeletePreviewActiveSessions:"运行中",mpaDeletePreviewIdleSessions:"空闲",mpaDeleteBlocked:"当前无法删除",mpaDeleteBlockerActiveOperation:"仍有 MPA 创建或更新操作在执行。",mpaDeleteBlockerActiveSessions:"Runtime 中仍有运行中的会话。",mpaDeleteBlockerBindingAmbiguous:"当前 Agent 匹配到多个 MPA Runtime。",mpaDeleteBlockerRuntimeMissing:"当前 MPA Agent 没有可见的 Runtime 绑定。",mpaDeleteBlockerOrphanRuntime:"Runtime 可见,但其中缺少当前 MPA Profile。",mpaDeleteStage:{runtime_sessions:"删除 {{count}} 个可见空闲 Runtime 会话",runtime_diagnostics:"清理这些会话关联的诊断数据和挂载元信息",agentkit_runtime:"删除 AgentKit Runtime",worker_template:"删除独占沙箱模板",skill_space:"删除独占 Skill Space(含空间内技能)"},draftDeletionWarning:"草稿将从当前浏览器中删除。",runtimeDeletionWarning:"Runtime 和相关云端资源将被删除。",noneSelected:"尚未选择",none:"无",notPublished:"未发布",notRecorded:"未记录",noTime:"暂无时间",noPr:"暂无 PR",comingSoon:"评测能力即将开放",preparing:"准备中",cancelled:"已取消",failed:"失败",totalCount:"共 {{count}} 条",deploymentProgress:"部署进度",returnToEdit:"返回编辑",retryOperation:"重试操作",buildLog:"构建日志",githubMountLog:"GitHub 挂载日志",githubDeliveryMountLog:"GitHub 持续交付挂载日志",waitingBuildLog:"正在等待构建日志…",waitingGithubMountLog:"正在等待 GitHub 挂载日志…",copy:"复制",copied:"已复制",copyLabel:"复制{{label}}",copiedLabel:"已复制{{label}}",logLines:"{{count}} 行",logStatus:{synced:"已同步",failed:"读取失败",syncing:"同步中",earlyOmitted:"已省略早期日志",recentOnly:"仅显示最近的构建日志",partiallyOmitted:"已省略部分日志"},deployStatus:{running:"正在部署",unconfirmed:"部署状态待确认",success:"部署完成",error:"部署失败",cancelled:"部署已取消"},deploymentSteps:{prepare:{label:"准备部署",description:"校验配置并创建部署任务"},build:{label:"构建镜像",description:"生成运行环境与智能体代码"},deploy:{label:"部署服务",description:"创建并启动 AgentKit Runtime"},publish:{label:"发布服务",description:"等待服务就绪并生成访问地址"},complete:{label:"部署完成",description:"智能体已可以正常使用"},evaluation:{label:"创建评测集",description:"自动创建 Good Case 和 Bad Case 评测集"},profileApplying:{label:"应用 MPA 配置",description:"将 Studio Agent 配置写入 MPA Runtime"},smokeRunning:{label:"验证 MPA Runtime",description:"在标记可运行前执行 Runtime 就绪验证"},runnable:{label:"MPA Runtime 可运行",description:"Runtime 已接受配置并通过执行就绪验证"},github:{label:"挂载 GitHub 持续交付",description:"初始化目标分支与 GitHub Actions workflow"},update:{label:"更新实例配置",description:"将 Runtime 实例数调整为 {{min}}~{{max}}"}},githubStatus:{published:"已发布",publishing:"发布中",failed:"发布失败",pending:"等待发布",unknown:"未知"},errors:{agentInfoMissing:"Agent 信息不可用",checkUpdateCapability:"无法检查更新能力",checkingUpdateConfig:"正在检查更新配置",cloudOnlyUpdate:"仅云端 Agent 支持更新",deleteDeployedUnsupported:"当前不支持删除已部署 Agent",deleteDraftUnsupported:"当前不支持删除草稿",loadMpaDeletePreview:"无法加载 MPA 删除预览",loadAgentInfo:"无法加载 Agent 信息",loadApiKey:"无法读取 API Key",loadGithubVersions:"无法加载 GitHub 版本",loadEvaluations:"无法加载评测案例",loadMpaAgentView:"无法加载 MPA Agent 状态",loadMpaDiagnostics:"无法加载 Runtime 诊断",loadOptimizations:"无法加载优化建议",loadRuntimeDetails:"无法加载 Runtime 详情",loadSessionConfig:"无法加载会话配置",loadUsage:"无法加载使用数据",noCreatePermission:"当前账号没有创建 Agent 的权限",noManagePermission:"当前账号没有管理此 Agent 的权限",originalConfigUnavailable:"原始配置不可用",probeIntegration:"无法检测集成能力",rollbackVersion:"无法创建版本回退",runtimeRegionMissing:"Runtime 区域信息缺失",updateCapabilityMismatch:"Runtime 更新能力与当前配置不匹配",updateCapabilityPending:"Runtime 更新能力仍在确认中",updateConfigRestoring:"正在恢复更新配置",updateUnsupported:"当前 Runtime 不支持更新",usageMismatch:"返回的使用数据与当前 Agent 不匹配"},mpaDeleteChecking:"正在检查会话和资源归属…",mpaDeleteRetryPreview:"重新检查",mpaDeletePreviewFailed:"删除前检查失败。请处理下面的错误后重新检查。",mpaDeleteRetained:"以下资源将保留",mpaDeleteRetainedReason:{shared:"有其他智能体引用",unproven:"无法确认是此智能体独占的受管资源"}},r1e={title:"环境",loadFailed:"环境加载失败,请检查存储配置后重试。",storageUnavailable:"管理员未配置持久化存储,环境管理暂不可用。",create:"新建环境",configure:"配置环境",details:"环境详情",editorDescription:"配置运行环境,或接入代码仓库和已有镜像",backToList:"返回环境列表",save:"保存环境",createAndBuild:"创建并构建",saveAndBuild:"保存并构建",name:"环境名称",namePlaceholder:"Python 数据处理",descriptionPlaceholder:"说明这个环境适合处理的任务",creationMethod:"创建方式",baseConfiguration:"基础配置",baseEnvironment:"基础环境",operatingSystem:"操作系统",pythonVersion:"Python 版本",fixedByBase:"由 {{base}} 固定为 {{value}}",selectUbuntuVersion:"选择基础镜像的 Ubuntu 版本",selectPythonVersion:"选择需要安装的 Python 版本",skills:"技能",addSkill:"添加环境技能",veadkDescription:"Agent 开发与运行框架",customDockerfile:"自定义 Dockerfile",presetEnvironment:"预制环境",presetHint:"选择“无”可自行填写 Dockerfile 第一行的基础镜像。",dockerfileSize:"{{size}} / {{max}} 字节",upload:"上传",reset:"重置",dockerfileBaseImage:"Dockerfile 基础镜像",dockerfileContent:"Dockerfile 内容",region:"区域",search:"搜索环境",manualImport:"手动导入",noMatches:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称",startBuild:"开始构建",build:"构建",unnamed:"未命名环境",listSeparator:"、",clipboardReadError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",creation:{custom:{label:"自定义配置",description:"通过表单选择基础环境、Python、工具和技能"},dockerfile:{label:"自定义 Dockerfile",description:"上传或直接编辑 Dockerfile"},git:{label:"从代码仓库构建",description:"探查公开仓库并通过 CodePipeline 构建"},image:{label:"使用已有镜像",description:"绑定由外部流水线交付的 CR 镜像"}},baseDescriptions:{"aio-sandbox":"内置 Sandbox Shell 能力 · Ubuntu 22.04","codex-sandbox":"内置 Codex CLI、浏览器与代码执行环境",ubuntu:"标准 Linux 基础镜像"},dockerfileValidation:{baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"},presets:{none:"自行填写 Dockerfile 基础镜像",aio:"内置 Sandbox Shell 与常用运行时",codex:"内置 Codex CLI、浏览器与代码执行环境"},categories:{tools:"工具",productivity:"效率",browser:"浏览器自动化",system:"系统与媒体"},options:{"lark-cli":"飞书开放平台命令行工具",pandoc:"文档格式转换工具",opencli:"将网站与桌面应用转换为命令行工具",uv:"快速 Python 包与项目管理器",ripgrep:"高性能文本检索工具",jq:"JSON 查询与转换工具","github-cli":"在终端中管理 GitHub 工作流",playwright:"浏览器自动化与端到端测试",chromium:"无头浏览器运行时",git:"代码版本管理",curl:"网络请求与文件下载",ffmpeg:"音视频转码与处理",imagemagick:"图片转换与批处理"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",hoursMinutes:"{{hours}} 小时 {{minutes}} 分"},buildStatus:{preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"构建失败",notBuilt:"未构建"},manifest:{title:"环境 Manifest",closeLabel:"关闭环境 Manifest",loading:"正在加载 Manifest",editorLabel:"环境 Manifest YAML",copyFailed:"复制失败,请重试",copied:"已复制",copy:"复制 Manifest",view:"查看环境 Manifest",viewShort:"查看 Manifest",unavailable:"尚无可用 Manifest"},buildDetails:{title:"构建详情",closeLabel:"关闭构建详情",currentStep:"当前步骤",waiting:"等待构建信息",elapsed:"已用时",sourceCommit:"源码提交",openCodePipeline:"在 CodePipeline 中查看",starting:"正在启动",rebuild:"重新构建"},git:{sectionLabel:"公开代码仓库",address:"Git 地址",ref:"Branch、Tag 或 Commit",defaultBranch:"默认分支",inspecting:"正在拉取仓库并查找 Dockerfile",foundDockerfiles:"已在提交 {{commit}} 中找到 {{count}} 个 Dockerfile。",savedDockerfileLoaded:"已载入保存的 Dockerfile,可重新探查仓库更新。",noDockerfile:"仓库中未找到 Dockerfile,请检查分支或仓库内容。",inspectAgain:"重新探查",selectDockerfile:"选择 Dockerfile"},repository:{outputSection:"构建输出",type:"镜像仓库类型",managed:"Studio 默认镜像仓库",existing:"已有镜像仓库",managedHint:"构建时自动创建或复用当前区域的 Studio 镜像仓库。"},existingImage:{sectionLabel:"已有镜像",reference:"Tag 或 Digest",placeholder:"latest 或 sha256:...",hint:"填写镜像 Tag,或以 sha256: 开头的完整 Digest。"},share:{action:"分享",title:"分享环境",closeLabel:"关闭分享环境",generating:"正在生成并复制分享码",copied:"分享码已复制",failed:"分享失败",code:"分享码",fullCode:"完整环境分享码",copiedHint:"分享码已自动复制,也可在这里查看或手动复制。",copyFailedHint:"自动复制失败,可手动复制上方分享码,或重试。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅发送给可信对象。",copyAgain:"再次复制"},import:{title:"导入环境",closeLabel:"关闭导入环境",description:"先检测分享码中的环境,再确认添加到当前账号。",code:"环境分享码",tooMany:"最多可一次导入 {{max}} 个环境,当前检测到 {{count}} 个分享码。",multipleHint:"多个分享码可使用英文逗号、中文逗号或换行分隔,重复项会自动忽略。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅导入可信来源的分享码。",inspectingCodes:"正在检测环境分享码",found:"检测到 {{count}} 个环境:{{names}}。",itemError:"第 {{index}} 个分享码:{{error}}",invalidCode:"分享码无效。",noResult:"服务未返回该分享码的导入结果。",partial:"已导入 {{created}} 个环境,{{remaining}} 个未完成,可重试有效失败项。",inspecting:"正在检测",importing:"正在导入",retryImport:"重试导入",confirm:"确认导入",inspectCodes:"检测分享码"},status:{boundImage:"环境“{{name}}”已绑定已有镜像",queued:"环境“{{name}}”已进入构建队列",savedBuildFailed:"环境已保存,但构建未启动:{{error}}",importedFailed:"已导入 {{created}} 个环境,{{failed}} 个失败",importedDuplicate:"已导入 {{created}} 个环境,{{duplicate}} 个分享码已存在",imported:"已导入 {{count}} 个环境",deleted:"已删除环境“{{name}}”"},deleteTitle:"删除环境",deleteDescription:"确定删除环境“{{name}}”吗?删除后无法恢复。",errors:{repositoryRequired:"请输入公开代码仓库地址。",repositoryHttps:"请输入公开仓库的 HTTPS 地址。",repositoryInvalid:"请输入有效的公开仓库 HTTPS 地址。",imageReferenceWhitespace:"Tag 或 Digest 不能包含空格。",imageDigestInvalid:"Digest 必须是完整的 sha256 值。",imageTagOnly:"这里只填写 Tag,不要重复填写镜像仓库路径。"}},s1e={searchPlaceholder:"搜索资源名称",emptyMessage:"暂无可用选项",searchAriaLabel:"搜索{{label}}",loadingMore:"正在加载更多资源…"},a1e={retryDeployment:"重试部署",retrying:"正在重试…",collapse:"收起错误信息",expand:"展开完整错误信息",copy:"复制完整错误信息"},o1e={steps:"构建步骤",log:"构建日志",syncing:"同步中",loadFailed:"读取失败",synced:"已同步",recentOnly:" · 仅显示最近日志",copiedLog:"已复制构建日志",copyLog:"复制构建日志",copied:"已复制",copy:"复制",logContent:"构建日志内容",waiting:"正在等待 CodePipeline 输出日志…",empty:"暂无构建日志"},l1e={defaultLabel:"Studio 默认环境",defaultDescription:"使用 Studio 预置的标准运行环境",status:{notBuilt:"未构建",preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"失败"},label:"运行环境",placeholder:"请选择运行环境",search:"搜索运行环境",loading:"正在加载运行环境…",loadFailed:"加载运行环境失败",noMatches:"未找到匹配的运行环境",unavailable:"当前没有可用的运行环境",selectionUnavailable:"所选运行环境当前不可用,请重新选择。",selectionHint:"选择构建完成的运行环境后,部署将使用其镜像和工具配置。",versionChanged:"所选环境版本已更新,请确认后继续。",versionMissing:"所选环境版本已不存在,请重新选择。",operatingSystem:"操作系统",language:"语言",image:"镜像",imageVersion:"镜像版本",skills:"技能",tools:"工具",noSkills:"未配置 Skill",noExtraTools:"未配置额外工具",defaultGuidance:"默认环境由 Studio 管理,无需额外配置。",persistenceFallback:"持久化环境服务暂不可用,当前使用默认环境。",emptyFallback:"当前没有可选择的自定义环境。"},c1e={repository:"GitHub 仓库",githubUrl:"GitHub 地址",token:"访问令牌",sessionToken:"{{provider}} 临时令牌",runtime:"Runtime",commit:"提交",workflow:"工作流",syncFailed:"同步 GitHub 代码失败",status:{mounted:"已挂载",bound:"已绑定",synced:"已同步",created:"已创建"},volcengine:"火山引擎",mountDelivery:"挂载持续交付",selectedForDeployment:"已选择,部署时挂载",mountOnDeploy:"部署时挂载持续交付",syncCode:"同步代码",deliveryMode:"GitHub 交付模式",sourceSync:"GitHub 代码同步",delivery:"GitHub 交付",loading:"读取中",running:"执行中",runtimeDeliveryHint:"写入 AgentKit Runtime GitHub Actions workflow,后续 GitHub 提交会更新绑定 Runtime。",initialDeliveryHint:"首次部署成功后初始化目标分支,后续 GitHub 提交会更新绑定 Runtime。",sourceSyncHint:"Studio 会直接 push 到目标分支;该分支由 Studio 管理,远端冲突时同步会失败。Runtime 仍由部署按钮发布。",tokenPlaceholder:"repo 或 contents write 权限",getToken:"获取 Token",hideToken:"隐藏 Token",showToken:"显示 Token",tokenHelp:"Token 仅用于本次操作,成功后不会保留在表单中。",targetBranch:"目标分支",actionsSecretPlaceholder:"用于写入 GitHub Actions Secret",sessionTokenPlaceholder:"临时凭证可选",syncing:"同步中…",pendingHint:"已选择挂载持续交付。点击部署后,Studio 会等待 Runtime 创建完成并初始化 GitHub 目标分支,初始化成功后才完成部署流程。",result:{deliveryMounted:"已挂载持续交付",deliverySelected:"已选择挂载持续交付",githubBound:"已绑定 GitHub",codeSynced:"代码已同步",deliveryHint:"目标分支提交会触发 Runtime 持续交付。",boundHint:"更新并发布时会先同步当前源码到这个分支。"},branch:"分支",viewPr:"查看 PR",createFailed:"创建失败",phase:"阶段",log:"日志"},u1e={name:"飞书",enabling:"正在启用并更新配置…",description:"接收消息并通过飞书机器人回复",configuration:"飞书配置",configurationMode:"飞书配置方式",automatic:"自动配置",manual:"手动配置",cancelling:"取消中…",scanToCreate:"扫码创建",scanDescription:"授权后自动回填凭据",generateQrCode:"生成二维码",qrCodeAlt:"飞书机器人配置二维码",scanToConfirm:"飞书扫码确认",expiresIn:"{{time}} 后失效",created:"机器人已创建",credentialsFilled:"应用凭据已自动回填",qrCodeExpired:"二维码已失效",automaticFailed:"自动配置失败",regenerateQrCode:"请重新生成二维码。",configuredPlaceholder:"已配置,留空沿用",appSecretPlaceholder:"请输入 App Secret",hideSecret:"隐藏 App Secret",showSecret:"显示 App Secret"},d1e={mode:{auto:"自动创建",autoDescription:"部署时自动创建所需资源",recommended:"推荐",create:"指定名称",createDescription:"使用指定名称创建或复用资源",existing:"选择已有",existingDescription:"从当前账号的已有资源中选择"},selectExisting:"请选择已有资源",searchResource:"搜索资源名称",noMatch:"未找到匹配资源",noAvailable:"暂无可用资源",searching:"正在搜索云资源…",loading:"正在加载云资源…",noMatchSentence:"未找到匹配资源。",noAvailableSentence:"暂无可用资源。",loadedSummary:"实际服务区域:{{region}} · 已加载 {{loaded}}{{total}}",registryInstance:"Registry 实例",registryAriaLabel:"镜像仓库 Registry 实例",namespace:"命名空间",namespaceAriaLabel:"镜像仓库 Namespace",repository:"镜像仓库",existingRepository:"已有镜像仓库",selectRegistryFirst:"请先选择 Registry 实例。",selectNamespaceFirst:"请先选择 Namespace。",configurationMode:"配置方式",configurationModeAriaLabel:"{{resource}}配置方式",selectConfigurationMode:"请选择配置方式",automaticNames:"自动创建名称",validation:{tos:"请填写或选择 TOS 存储桶。",cr:"请完整填写或选择 CR 实例、命名空间和镜像仓库。",codePipeline:"请完整填写或选择 CodePipeline Workspace 和 Pipeline。",existingCodePipeline:"请选择已有的 CodePipeline Workspace 和兼容 Pipeline。"},autoBucketWithRegion:"agentkit-platform-{账号 ID}-{{region}}",autoBucket:"agentkit-platform-{账号 ID}",tosBucket:"TOS 存储桶",bucketName:"存储桶名称",bucketNamePlaceholder:"输入存储桶名称",existingBucket:"已有存储桶",existingTosBucket:"已有 TOS 存储桶",bucket:"存储桶",accountIdResolved:"账号 ID 在部署时按当前云账号解析。",containerRegistry:"容器镜像仓库(CR)",instanceName:"实例名称",crInstance:"CR 实例",existingCrInstance:"已有 CR 实例",existingCrNamespace:"已有 CR 命名空间",existingCrRepository:"已有 CR 镜像仓库",autoRegistry:"agentkit-platform-{账号 ID}",autoRepositoryName:"{{name}}-{4 位随机字符}",registryNameNote:"账号 ID 在部署时解析,镜像仓库的随机字符在部署时生成。",workspace:"工作空间",pipeline:"流水线",workspaceName:"Workspace 名称",pipelineName:"Pipeline 名称",existingWorkspace:"已有 CodePipeline Workspace",compatiblePipeline:"兼容 Pipeline",existingPipeline:"已有 AgentKit CodePipeline",pipelineNameNote:"Pipeline 与 Runtime 名称一致。"},f1e={commit:"提交",steps:{permissions:"预检 OTA 所需权限",resolving:"读取目标版本信息",downloading:"下载并校验完整更新包",preparing:"准备 VeFaaS Function 代码",provisioning:"检查并补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布新 Revision 并重启服务"},stages:{permissions:"预检 OTA 权限",resolving:"读取版本信息",downloading:"下载更新包",preparing:"准备 Function 代码",provisioning:"补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布 Revision",checking:"检查更新",unknown:"未知阶段"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},logPermissionPrefix:"无法读取 VeFaaS 发布日志。Function 角色缺少 ",logPermissionSuffix:" 权限,更新会继续。",openIamConsole:"前往 IAM 控制台配置权限",deploymentProgress:"部署进度",live:"实时",completed:"已完成",stopped:"已停止",copied:"已复制",copyFailed:"复制失败",copyLog:"复制日志",waitingForLogs:"等待 VeFaaS 返回更新日志…",noLogs:"本次更新未返回发布日志",messages:{updated:"Studio 已更新,新 Revision 已接管服务",failed:"Studio 更新失败",timeout:"等待 VeFaaS 发布超时,请稍后重新检查版本",submitted:"更新已提交,正在等待 VeFaaS 发布新版本",connectionSwitched:"连接已切换,正在确认新版本状态"},checkingPermissions:"正在检查 OTA 权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",updated:"Studio 已更新",updateToVersion:"更新 Studio 至 {{version}}",checkPermissions:"检查更新权限",authorizationNeeded:"需要授权",updatingShort:"正在更新",refreshForNewVersion:"刷新使用新版",updateFailed:"更新失败",updateNow:"立即更新",newVersionAvailable:"有新版更新",dialog:{failed:"Studio 更新失败",checkingPermissions:"正在检查更新权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",completed:"Studio 更新完成",newVersion:"发现新版本"},permissionCheck:"正在核对 OTA 与定时任务所需的全部 IAM 权限…",permissionCheckHint:"权限全部满足后才会开始下载、更新或发布云资源。",missingPermissionCount:"当前 Function 角色缺少 {{count}} 项 OTA 更新权限,尚未执行任何云资源变更。",functionRole:"Function 角色",currentRole:"当前运行角色",policyToUpdate:"将更新策略",authorizationSteps:{open:"打开授权页面,确认已预填的策略名称和完整策略内容。",debug:"点击页面中的“发起调试”,完成策略更新。",return:"返回此窗口,点击“我已授权,重新检查”。"},missingPermissions:"缺少的权限",openPrefilledAuthorization:"打开已预填的 IAM 授权页面",openIamManually:"前往 IAM 控制台手动配置",noSafePolicy:"当前角色没有唯一可安全更新的自定义策略,请由管理员将上述权限加入该角色。",failedStage:"失败阶段",errorId:"错误 ID",notGenerated:"未生成",openFunctionLogs:"前往 VeFaaS 控制台查看 Function 日志",targetVersion:"目标版本",updateStatus:"更新状态",elapsed:"已用时",progressAriaLabel:"Studio 更新进度",processingUpdate:"正在处理更新",processing:"正在处理",backgroundHint:"发布阶段会短暂中断连接;关闭此窗口不会停止更新,可随时点击右上角按钮重新查看。",confirmDescription:"更新会重启 Studio 服务,预计约 3–5 分钟完成更新与发布。期间正在进行的对话、流式响应或部署任务可能中断,登录态不会受到影响。",selectVersion:"选择版本",currentVersion:"当前版本",changelog:"更新内容",noChangelog:"暂无更新说明",runInBackground:"后台运行",authorizedRecheck:"我已授权,重新检查",tryAgain:"重新尝试"},h1e={deploy:"部署",update:"更新",planHash:"方案哈希",backToConfiguration:"返回配置",releaseRegion:"发布区域",deployRegion:"部署区域",regionPreserved:"更新时沿用现有 Runtime 的部署区域,无法修改。",unnamedAgent:"未命名 Agent",deployTitle:"部署 {{name}}",additionalAgentCount:" 等 {{count}} 个智能体",releaseOverview:"发布概览",agentOverview:"Agent 概览",agentCount:"Agent 数量",model:"模型",systemPrompt:"系统提示词",optimizations:"优化选项",notEnabled:"未启用",effectiveCapabilities:"生效能力",automaticProtection:"自动保护",artifactActions:"发布产物操作",exportYaml:"导出 YAML",viewSource:"查看源代码",downloadSource:"下载源代码",expandFlow:"放大查看执行流程",expand:"放大查看",deploymentConfiguration:"部署配置",runtimeName:"Runtime 名称",runtimeNamePreserved:"更新时保持现有 Runtime 名称不变。",runtimeNameHint:"默认根据 Root Agent 名称生成,并添加随机后缀避免重名;支持 4-64 位字母、数字、连字符和下划线",accessAuthentication:"访问鉴权",authenticationPreserved:"更新时保持现有 Runtime 的鉴权方式不变。",authenticationMethod:"鉴权方式",authenticationAriaLabel:"部署鉴权方式",authenticationPlaceholder:"请选择鉴权方式",messageChannels:"消息渠道",instanceSettings:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",sidecarSingleInstance:"Harness Sidecar 首期仅支持单实例,Runtime 固定为 1~1",inMemorySingleInstance:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",network:"网络",networkPreserved:"现有 Runtime 的区域与网络模式保持不变。",networkMode:"网络模式",networkModes:{public:"公网",both:"公网 + VPC"},subnetId:"子网 ID",subnetHint:"可选,多个用逗号分隔",sharedInternetAccess:"VPC 内共享公网出口",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",createEvaluationSetsHint:"部署成功后,自动创建 Good Case 和 Bad Case 评测集。",resourceConfiguration:"资源配置",environmentVariables:"环境变量",environmentVariablesHint:"组件配置会自动同步到这里,部署前可核对最终值。",itemCount:"{{count}} 项",addVariable:"添加变量",componentGenerated:"组件自动生成",injectedByApiKey:"由所选 API Key 注入",envNameAriaLabel:"{{key}} 环境变量名",envDescriptionAriaLabel:"{{key}}说明:{{description}}",openOpenViking:"打开 OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}:打开 OpenViking {{label}}",requiredEmpty:"必填,尚未填写",optionalEmpty:"可选,尚未填写",envValueAriaLabel:"{{key}} 环境变量值",automatic:"自动",synced:"同步",customModelCredentials:"自定义模型凭据",releaseOnlySecret:"必填,仅用于本次发布",thisRelease:"本次发布",customVariables:"自定义变量",value:"值",deleteVariable:"删除变量",deploymentProgress:"部署进度",retryUpdate:"重试更新",retryDeploy:"重试部署",updateSucceeded:"更新成功",deploySucceeded:"部署成功",region:"区域",agentName:"Agent 名称",apiEndpoint:"API 端点",connecting:"连接中…",chatNow:"立即对话",console:"控制台",actionInProgress:"{{action}}中…",checkingName:"正在检查名称…",retryAction:"重试{{action}}",flowPreview:"执行流程预览",executionFlow:"执行流程",flowPreviewHint:"只读预览,可缩放与拖动画布",closeFlowPreview:"关闭执行流程预览",agentAdded:'Agent "{{name}}" 已添加到左上角下拉列表!',files:{preview:"文件预览",new:"新建文件",empty:"暂无文件",noneSelected:"未选择文件",selectToView:"选择左侧文件以查看内容",loadingEditor:"加载编辑器…",rename:"重命名",renamePrompt:"重命名文件"},apiKey:{selectFirst:"请先选择 API Key",revealing:"正在显示 API Key",hide:"隐藏 API Key",retryReveal:"重试显示 API Key",reveal:"显示 API Key"},task:{preparing:"准备部署",waitingBuildLog:"正在等待构建日志…",waitingGithubLog:"正在等待 GitHub 挂载日志…",syncingGithub:"正在同步当前源码到 GitHub",syncGithubCode:"同步 GitHub 代码",githubSynced:"GitHub 代码已同步",githubSubmitted:"GitHub 代码已提交",githubUpdatingRuntime:"代码已提交到 GitHub,GitHub Actions 正在更新同一个 Runtime",initializingGithub:"开始初始化 GitHub main 分支与 Actions workflow",initializingGithubBranch:"正在初始化 GitHub 持续交付目标分支",mountGithubDelivery:"挂载 GitHub 持续交付",githubBranchInitialized:"GitHub 持续交付已初始化目标分支",githubDeliveryMounted:"GitHub 持续交付已挂载",githubMountFailed:"挂载 GitHub 持续交付失败",githubMountFailedDetail:"GitHub 持续交付挂载失败:{{message}}",githubMountFailedHint:"挂载 GitHub 持续交付失败,详见 GitHub 日志。",applyingMpaProfile:"正在将 Agent 配置应用到 MPA Runtime",mpaProfileApplied:"MPA Runtime 配置已应用",runningMpaSmoke:"正在验证 MPA Runtime 执行链路",mpaReady:"MPA Runtime 已可运行",deploymentComplete:"部署完成",deployedNotConnected:"部署完成,暂未连接",cancelled:"已取消",cancelledHint:"部署已取消,相关 Runtime 资源已请求销毁。",deploymentStatusUnconfirmed:"部署状态待确认",deploymentFailed:"部署失败",buildFailedHint:"构建镜像失败,详见构建日志。"},confirm:{updateTitle:"确认更新",deployTitle:"确认部署",closeLabel:"关闭部署确认",updateDescription:"将更新并发布到当前云端 Runtime,过程可能需要几分钟。确定继续吗?",deployDescription:"将创建新的云端 Runtime,部署过程可能需要几分钟。确定继续吗?",update:"确定更新",deploy:"确定部署"},userPool:{label:"用户池",unnamed:"未命名用户池",current:"当前用户池",ariaLabel:"部署用户池",loading:"正在加载用户池…",placeholder:"请选择用户池",loadingIdentity:"正在加载 Identity 用户池…",empty:"当前账号下暂无 Identity 用户池。",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime。",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime。",markedHint:"当前 Studio 使用的用户池已在列表中标注。"},authentication:{apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPool:"用户池",userPoolDescription:"使用 Identity 用户池签发的 JWT"},steps:{buildImage:"构建镜像",deploy:"部署",publish:"发布",syncCode:"同步代码",uploadPackage:"上传代码包",packageImage:"镜像打包",createRuntime:"创建 Runtime",publishService:"发布服务",updateInstances:"更新实例配置",createEvaluationSets:"创建评测集",applyMpaProfile:"应用 MPA 配置",verifyMpaRuntime:"验证 MPA Runtime",mpaReady:"MPA Runtime 可运行"},errors:{instanceRangeInteger:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数。",instanceRangeOrder:"最小实例数不能大于最大实例数。",selectApiKey:"请先在模型配置中选择 API Key。",loadApiKey:"加载 API Key 失败,请重试。",invalidProject:"项目数据无效",updateFeishu:"更新飞书配置失败:{{message}}",userPoolRequired:"请选择用于 Runtime 鉴权的用户池。",vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",modelSecretRequired:"请填写 {{label}},用于访问对应的自定义模型地址。",managedApiKeyRequired:"{{requirement}},请先返回模型配置选择 API Key。",feishuEnvRequired:"启用飞书后,请填写{{field}}。",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",deployedButGithubMountFailed:"部署成功,但挂载 GitHub 持续交付失败:{{message}}",deployedButGithubBindFailed:"部署成功,但绑定 GitHub 失败:{{message}}",mpaRuntimeIdMissing:"部署成功,但返回缺少 Runtime ID,无法应用 MPA 配置。",mpaOperationIncomplete:"MPA Runtime 初始化未完成,请重试此部署任务。",deploymentStatusUnconfirmed:"连接已中断,当前无法确认部署最终状态。任务可能仍在云端运行,请到 AgentKit 或 Code Pipeline 查看同一任务,避免重复部署。",failedAtStage:"{{action}}失败({{stage}}阶段):{{message}}",noAgentAtEndpoint:"连接成功,但该地址未发现任何 Agent(/list-apps 为空)。",addAgent:"添加 Agent 失败:{{message}}",modelApiKeyRequired:"请填写此模型地址对应的 API Key。"}},p1e={title:"工作区",storageUnavailable:"管理员未配置持久化存储,工作区管理暂不可用。",detail:"工作区详情",create:"新建工作区",editorDescription:"将常用环境组合在一起;同一个环境可以加入多个工作区。",backToList:"返回工作区列表",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",createdAt:"创建时间",updatedAt:"最近更新",basicInfo:"基本信息",namePlaceholder:"例如:内容生产",descriptionPlaceholder:"说明这个工作区的用途",selectedEnvironmentCount:"已选择 {{count}} 个,可在其他工作区中继续复用",searchAvailableEnvironments:"搜索可用环境",searchEnvironments:"搜索环境",noAvailableEnvironments:"还没有可添加的环境",createEnvironmentFirst:"请先在“环境”页面创建并构建环境。",noMatchingEnvironments:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称。",environmentStatus:{available:"可用",building:"构建中",notBuilt:"未构建"},added:"已添加",saved:"已保存工作区“{{name}}”",resourceType:"工作区资源类型",searchWorkspaces:"搜索工作区",loadFailed:"无法加载工作区",noMatchingWorkspaces:"没有匹配的工作区",tryAnotherNameOrEnvironment:"请尝试搜索其他名称或环境",noEnvironmentAdded:"未添加环境",environmentMissing:"环境缺失",availableFraction:"{{available}}/{{total}} 可用",available:"可用",availableCount:"{{count}} 个可用",updated:"更新",addEnvironment:"添加环境",deleteTitle:"删除工作区",deleteDescription:"确定删除工作区“{{name}}”吗?环境本身不会被删除。",deleted:"已删除工作区“{{name}}”",clipboardPermissionError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",codeProjects:"代码项目"},m1e={back:"返回",detailNavigation:"详情导航",noData:"暂无数据",actions:"操作",moreActions:"更多操作 {{label}}",actionsFor:"{{label}} 操作",loading:"资源加载中,请稍候"},g1e={addSkill:"添加 Skill",remove:"移除 {{name}}",confirmRemoveRuntime:"从新版本中移除运行中的 Skill「{{name}}」?",selectedCount:"已加入技能 · {{count}}",close:"关闭{{label}}",sources:{runtime:"运行中来源 · 原样保留,可移除或用同名 Skill 替换",local:"本地",skillspace:"AgentKit Skills 中心",skillhub:"火山 Find Skill 技能广场"},tabs:{local:"本地文件",localShort:"本地文件",skillspace:"AgentKit Skills 中心",skillspaceShort:"AgentKit",skillhub:"火山 Find Skill 技能广场",skillhubShort:"Find Skill"}},b1e={model:"模型",turnControls:"流程控制",pause:"暂停",resume:"恢复",interrupt:"中断",cancel:"取消",pauseTurn:"在安全点暂停完整流程",resumeTurn:"恢复完整流程",interruptTurn:"中断当前流程并保留会话上下文",cancelTurn:"取消当前流程且不可恢复",turnState:{running:"运行中",pausing:"正在到达安全点",paused:"已暂停",resuming:"正在恢复",interrupting:"正在中断",cancelling:"正在取消",interrupted:"已中断",completed:"已完成",failed:"失败",cancelled:"已取消",orphaned:"状态待确认",newTurnRequired:"需要从检查点继续"},tasks:{ppt:"PPT",image:"图片生成",video:"视频生成"},prompts:{ppt:{quarterlyReview:"复盘【季度】经营表现,提炼指标差距、原因与行动建议",projectUpdate:"汇报【项目名称】进展:里程碑、风险、预算和资源诉求",solutionProposal:"为【客户行业】输出解决方案:痛点、架构、实施路径与收益",industryAnalysis:"分析【行业主题】趋势,给出竞争格局、机会与战略建议"},image:{launchVisual:"为【品牌或产品】设计【高级科技】风格的发布会主视觉",ecommercePoster:"生成【产品名称】电商海报,突出【核心卖点】与品牌色",conceptRendering:"呈现【产品或空间】在【使用场景】中的写实概念效果图",socialGraphic:"围绕【传播主题】制作简洁专业的企业社媒配图"},video:{brandFilm:"制作【品牌名称】30 秒宣传片,突出【品牌价值】",productLaunch:"为【产品名称】制作 45 秒发布视频:痛点、功能、场景与行动号召",trainingVideo:"制作【培训主题】企业培训视频,讲清【关键操作或规范】",eventTeaser:"生成【活动名称】20 秒预热视频,包含亮点、时间地点和报名信息"}},firstFrame:"首帧",videoToEdit:"待编辑视频",baseVideo:"基础视频",optimizeSkillPlaceholder:"描述你想优化的技能…",createSkillPlaceholder:"描述你想生成的技能…",createVideoPlaceholder:"描述你想创作的视频…",messageAgentPlaceholder:"向 {{name}} 发消息…",selectAgentFirst:"请先选择智能体",selectSkillFirst:"请先选择需要优化的 Skill",availableSkills:"可用技能",availableSubagents:"可用子 Agent",invokeSkill:"调用技能",useSubagent:"使用子 Agent",loadingCapabilities:"正在读取 Agent 能力…",noMatchingSkills:"当前 Agent 没有匹配技能",noMatchingSubagents:"当前 Agent 没有匹配子 Agent",skillFallbackDescription:"加载并执行该技能",agentFallbackDescription:"将本轮交给该 Agent",skill:"技能",uploadImage:"上传图片",uploadDocument:"上传文档或 PDF",uploadVideo:"上传视频",taskMode:"任务模式",selectTaskMode:"选择任务模式",loadingGenerationModel:"正在加载生成模型",modelUnavailable:"模型不可用",cancelTask:"取消{{task}}任务",stopGenerating:"停止生成",viewVideoProgress:"查看视频生成进度",send:"发送",selectTaskType:"选择任务类型",enterprisePrompts:"{{task}}企业提示词",sessionId:"会话 ID",sessionIdLabel:"会话 ID:",initializing:"初始化中",copied:"已复制",copySessionId:"复制会话 ID",sessionIdCopied:"已复制会话 ID",disclaimer:"回答仅供参考",viewLogs:"查看日志"},y1e={selectAgent:"选择 Agent",noLocalAgents:"暂无本地 Agent。",searchRuntime:"搜索 Runtime 名称",mineOnly:"只看我创建的",noRuntimes:"暂无 Runtime。",unsupported:"不支持",createdByMe:"我创建的",connecting:"连接中…",connected:"已连接",connect:"连接",viewInfoFor:"查看 {{name}} 信息",viewInfo:"查看信息",agentAndRuntimeInfo:"Agent 与 Runtime 信息",detailType:"详情类型",agentInfo:"Agent 信息",runtimeInfo:"Runtime 信息",loadingAgentInfo:"读取 Agent 信息…",cannotLoadAgentInfo:"暂时无法读取 Agent 信息",unnamedAgent:"未命名 Agent",subagents:"子 Agent",tools:"工具",skills:"技能",previewUnsupported:"暂不支持预览",mountedComponents:"挂载组件",noMoreAgentInfo:"暂无更多 Agent 配置信息。",local:"本地",model:"模型",status:"状态",memoryMb:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",resources:"资源",version:"版本",loadingDetails:"读取详情…",environmentVariables:"环境变量",errors:{notFound:"该 Runtime 已不存在或列表信息已过期,请刷新列表后重试。",accessDenied:"当前账号无权访问该 Runtime,请检查所属 Project 和访问权限。",previewUnsupported:"该 Agent Server 版本暂不支持信息预览。",unavailable:"该 Runtime 暂时无法访问,请确认其状态为“就绪”后重试。",timeout:"加载超时,请重试"},componentKinds:{knowledgebase:"知识库",memory:"记忆",prompt_manager:"提示词管理",example_store:"样例库",run_processor:"运行处理器",tracer:"链路追踪",toolset:"工具集",plugin:"插件",other:"其他"},runtimeStatus:{ready:"就绪",unreleased:"未发布",running:"运行中",active:"运行中",creating:"创建中",pending:"等待中",deploying:"部署中",updating:"更新中",failed:"失败",error:"异常",stopping:"停止中",stopped:"已停止",deleting:"删除中",deleted:"已删除"}},v1e={agent:"智能体",agentTypes:{general:"通用智能体",mpa:"MPA 智能体",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"创建人",namedAgent:"{{name}} 智能体",storageLocation:"存储位置",currentBrowser:"当前浏览器",region:"地域",viewDeploymentProgress:"查看 {{name}} 部署进度",viewRuntimeDetails:"查看 {{name}} Runtime 详情",viewDetails:"查看 {{name}} 详情",time:"时间",remainingTime:"剩余时间",expiringSoon:"即将清空",sandboxRemaining:"{{hours}} 小时 {{minutes}} 分钟",wakeable:"已休眠",neverExpires:"永不过期",editDraftNamed:"编辑草稿 {{name}}",viewProgress:"查看进度",deleteDraftNamed:"删除草稿 {{name}}",recheckCompatibility:"重新检测 {{name}} 的对话兼容性",connectedNamed:"{{name}} 已连接",wakeAndChat:"唤醒 {{name}} 并开始对话",chatWith:"与 {{name}} 对话",waking:"唤醒中",deploying:"部署中",draft:"草稿",checking:"检测中",chatUnsupported:"不支持对话",checkFailed:"检测失败",creatorFilter:"创建人筛选",agentType:"智能体类型",searchAgents:"搜索智能体",handoff:"接力",agentList:"{{type}}列表",noMatchingAgents:"没有匹配的智能体",adjustSearch:"请尝试调整搜索或筛选条件",noAgentType:"暂无 {{type}}",noGeneralAgents:"暂无通用智能体",createGeneralAgentDescription:"创建一个通用智能体,开始构建和对话",createAgentType:"创建{{type}}",createAgent:"创建智能体",loadingMore:"正在加载更多智能体",scrollForMore:"继续下滑加载更多",allLoaded:"已加载全部智能体",deleteDraftTitle:"删除草稿?",deleteDraftDescription:"删除后将无法恢复“{{name}}”。",deleteDraft:"删除草稿",loadGeneralAgents:"加载通用智能体",loadAgentType:"加载 {{type}}",compatibility:{checking:"正在请求 Runtime /list-apps,以确认该智能体是否支持 Studio 对话。",empty:"Runtime /list-apps 未返回可用的 Agent,暂时无法连接对话。",supported:"Runtime 支持 Studio 对话。",unknownError:"Runtime /list-apps 请求失败,未返回可识别的错误信息。"},sandboxStatus:{ready:"就绪",wakeable:"已休眠",creating:"创建中",starting:"启动中",initializing:"启动中",pending:"等待中",running:"运行中",failed:"异常",error:"异常",stopped:"已停止",expired:"已过期",deleting:"删除中",deleted:"已删除",unknown:"未知状态"},wakingHint:"正在唤醒智能体,可能需要一些时间。",mpaCreate:{maxInstance:"最大实例数",maxInstanceHelp:"默认 {{maximum}},为 Runtime 自动扩容的实例数上限。",maxInstanceInvalid:"最大实例数必须为大于或等于 1 的整数。",name:"名称",namePlaceholder:"例如 test-agent",nameHelp:"作为 Runtime 名称,支持 4–64 位字母、数字、下划线或连字符。",stepsLabel:"创建步骤",steps:{basics:"基本信息",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"数据库"},next:"下一步",previousStep:"上一步",pgDescription:"选择已有的 PostgreSQL 实例。创建流程会在该实例中准备智能体的独立业务库。",pgSplitDescription:"使用已配置的业务 PG Workspace。多个智能体共用此 Workspace,每个智能体拥有独立业务库。共享资源记录单独存放在 mpa_admin_workspace / mpa_admin_db,由管理员配置。",pgConsoleByteplus:"前往 BytePlus AIDAP 创建或查看 PG Workspace",pgConsole:"前往火山引擎 AIDAP 创建或查看 PG Workspace",pgHost:"PG 主机地址",pgPort:"PG 端口",pgInvalid:"请填写有效的 PG 主机地址和端口。",pgCredentials:"PG 连接账号和密码由部署服务配置;主机和端口须与服务端配置一致。",openvikingDescription:"可选。三项全部填写才启用 OpenViking;全部留空则不向新智能体注入 OpenViking 配置。",openvikingConsoleByteplus:"前往 BytePlus 查看 OpenViking 资源",openvikingConsole:"前往火山引擎查看 OpenViking 资源",openvikingUrl:"OpenViking 服务地址",openvikingResourceId:"OpenViking 资源 ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"请同时填写有效的 HTTPS 服务地址、资源 ID 和 API Key,或全部留空。",openvikingCredentials:"API Key 仅用于本次创建,不保存到浏览器草稿;刷新页面后需重新填写。",tosTitle:"会话输出存储",tosDescription:"可选。选择存储桶,持久保存每个会话的输出目录,使用沙箱 IAM Role 鉴权。未选桶时文件保存在沙箱本地目录。",tosBucket:"TOS 存储桶",tosInvalid:"请选择以 agentkit-platform- 开头的可用存储桶。",tosCredentials:"创建时为共享角色追加所选桶的会话输出访问权限,使用该角色的其他运行时和沙箱也将获得相同权限。",tosDisable:"清除桶选择",tosBucketUnavailable:"当前部署账号或地域无法使用该桶,请从列表选择存储桶后重试。",runtimeImage:"MPA 镜像",workerImage:"Worker 镜像",imageDefault:"留空使用配置文件中的默认镜像",imageInvalid:"请输入有效的镜像地址,不要包含网址、空格或登录凭据。",title:"创建 MPA 智能体",agentId:"智能体 ID",description:"描述",region:"部署地域",plan:"创建计划",sharedResources:"准备或复用账号共享 VPC、子网和 APIG 消息网关",agentResources:"准备独立业务库、技能空间和执行环境,部署智能体",readiness:"检查网关和智能体就绪状态,成功后加入列表",checking:"正在检查创建配置…",configured:"创建配置已就绪。提交后会检查云资源并开始准备。",notConfigured:"尚未配置创建所需的资源参数,请联系管理员配置后重试。",loadFailed:"检查创建配置失败,请重试。",reload:"重新检查",submit:"开始创建",retry:"重试创建",newAgent:"新建另一个智能体",newAgentDescription:"新建另一个智能体将开启可编辑的新请求,替换当前恢复草稿,但不会取消旧任务。旧任务仍在运行时,请等待其结束后再提交。",close:"关闭",cancel:"取消创建",confirmCancel:"确认取消",cancelDescription:"取消后会停止后续步骤。已创建的数据库、技能空间、网关和其他已登记资源会保留,可使用同一智能体 ID 重试。",background:"关闭窗口后创建会继续。再次打开可查看进度。",pollFailed:"暂时无法获取进度,正在重新连接。请勿重复创建其他智能体。",iamPermissionDenied:"部署服务没有准备运行角色所需的 IAM 权限,请联系管理员授权后重试。",iamTrustConflict:"运行角色的信任关系不符合要求,请管理员检查对 VeFaaS 和 APIG 的授权后重试。",iamPolicyConflict:"运行角色所需的同名权限策略内容冲突,请管理员检查后重试。",iamOwnershipConflict:"运行角色与当前部署账号不匹配,请管理员检查后重试。",iamTemporaryFailure:"IAM 请求在重试后仍暂时失败或超时,请检查 Studio 网络连接及 IAM 服务后,用同一智能体 ID 重试。",iamVerificationFailed:"尚未确认运行角色的权限已就绪,请检查 IAM 服务及策略可用性后重试。",iamConfigurationConflict:"自动准备运行角色仅支持默认 MPA 角色,请检查服务端创建配置。",creationFailed:"当前步骤未完成,请检查对应资源、服务端配置及权限后,用同一智能体 ID 重试。",configurationChanged:"此智能体的创建配置已与上次提交不一致。请恢复原配置后重试,或新建另一个智能体请求。",cancelFailed:"取消请求失败,请重新查询进度后重试。",cancelled:"创建已取消,已登记资源保留供重试。",timeout:"创建超时,已登记资源保留。请检查对应资源后重试。",interrupted:"创建任务中断。请用同一智能体 ID 重试以恢复已登记资源。",skillSpace:"技能空间",states:{running:"正在创建",cancelling:"正在取消",succeeded:"创建成功",failed:"创建失败",cancelled:"已取消"},stages:{queued:"等待开始",iam_role:"准备运行角色",checking:"检查账号与配置",network:"准备 VPC 和子网",gateway:"准备 APIG 和 IM Gateway",database:"准备业务数据库",skills:"准备技能空间",worker:"准备执行环境",deploying:"准备数据库、技能空间和 Runtime",verifying:"等待智能体就绪",admin_workspace:"准备管理 PG Workspace",business_workspace:"准备业务 PG Workspace",admin_database:"初始化共享管理库",openviking:"准备 OpenViking 库",openviking_key:"准备 OpenViking 访问凭证"},back:"继续创建",pgAutoDescription:"使用 VeADK 部署账号自动创建或复用两个 PG Workspace:mpa_admin_workspace / mpa_admin_db 存放共享资源记录,业务 Workspace 供多个智能体共用,每个智能体拥有独立业务库。无需填写 PG 连接信息,提交创建后开始准备。",pgPerAgentDescription:"创建流程会复用共享管理 Workspace,并为此智能体准备独立的业务 PG Workspace 和数据库。已有任务重试沿用原数据库。",pgAidbDescription:"创建流程会复用共享管理 Workspace,并为此智能体准备独立业务 Workspace 和 aidb 数据库。业务 Workspace 使用 mpa_agent_<智能体名称> 命名。已有任务重试沿用原数据库。",runtimeNameTaken:"该名称已被 Runtime、沙箱模板、业务 Workspace 或正在创建的任务占用,请更换名称。",runtimeNameCheckFailed:"暂时无法检查名称,请确认资源查询权限和网络后重试。",pgModeChanged:"此创建任务使用旧的 PG 配置,不能直接切换为自动模式重试。请联系管理员确认已有资源和任务后重新创建。",pgMigrationRequired:"检测到旧共享注册库。请先将共享资源记录迁移到 mpa_admin_workspace / mpa_admin_db,并完成现有 Runtime 的注册库地址切换;完成后点击“重新检查”。",openvikingAutoDescription:"将为此智能体创建独立 OpenViking 库,使用默认模型并自动准备连接配置。",openvikingAutoByteplusDescription:"将在 BytePlus 柔佛为此智能体创建个人版 OpenViking 库,并自动准备连接配置。重试将复用已登记的库。",openvikingAutoByteplusRequirements:"使用 MPA 的 ModelArk API Key 和管理员配置的 VLM、Embedding 推理接入点。个人库只有 default 用户;Runtime 镜像须适配该模式及海外数据面后,才能使用记忆功能。取消或删除智能体后,库会保留。",openvikingModelEndpointsInvalid:"请联系管理员在 Studio 服务端配置有效的 OV_VLM_ENDPOINT_ID 和 OV_EMBEDDING_ENDPOINT_ID 后重试。",openvikingAutoBilling:"企业版按量计费,建库成功后开始计费。重试此智能体将复用已登记的库。",openvikingPermissionDenied:"无权准备 OpenViking。请检查部署账号的建库、查询和获取 API Key 权限后重试。",openvikingConfigurationConflict:"OpenViking 的归属或配置与此智能体不一致,请核对登记的库后重试。",openvikingCreateUnknown:"OpenViking 创建结果尚未确认。请管理员核对云端库并补齐登记的资源 ID 后重试;不会自动重复建库。",openvikingNotReady:"OpenViking 仍在初始化,请稍后重试此智能体,将继续使用同一个库。",openvikingResourceFailed:"OpenViking 初始化失败,请在控制台检查库状态及模型配置后重试。",openvikingResourceMissing:"未找到已登记的 OpenViking 库或默认用户,请检查绑定及资源状态后重试。",openvikingModelConfigurationRejected:"平台拒绝了默认模型配置或建库参数,请检查 OpenViking 模型可用性及账号开通情况后重试。",openvikingUnavailable:"暂时无法连接 OpenViking,请检查服务及网络后重试。",openvikingInvalidResponse:"OpenViking 返回的配置不完整或无效,请检查库及默认用户后重试。",openvikingQuotaExceeded:"OpenViking 配额不足或请求过于频繁,请调整配额或稍后重试此智能体。"}},x1e={library:"技能库",skill:"技能",skills:"技能",skillSpace:"技能空间",sandboxNotConfigured:"管理员未配置 Dev Sandbox",adminNotConfigured:"管理员未配置",totalItems:"共 {{count}} 项",cannotLoadSpaces:"无法加载技能空间",someSpacesFailed:"部分技能空间加载失败",degradedRelationWarning:"部分关联异常,已恢复可读取技能",downloadZip:"下载 ZIP",optimize:"优化",closeSkillDetails:"关闭技能详情",skillId:"技能 ID",allFiles:"完整文件",loadingSkillContent:"正在读取技能内容…",noSkillContent:"该技能暂无 SKILL.md 内容",addSkill:"添加技能",localUpload:"本地上传",localUploadDescription:"选择 ZIP 文件,校验通过后上传到技能空间",autoCreate:"自动创建",autoCreateDescription:"选择模型和风格,通过对话生成技能",createSkill:"创建技能",optimizeNamed:"优化 {{name}}",deleteSkillConfirm:"确定删除整个 Skill“{{name}}”吗?此操作会影响所有引用它的空间。",deleteSpaceConfirm:"确定删除 Skill 空间“{{name}}”吗?请先确认空间中的技能已删除。",manageSpaceDescription:"管理空间中的技能并创建新的版本",backToSpaces:"返回技能空间列表",overview:"概览",skillCount:"技能数量",skillCountValue_one:"{{count}} 技能",skillCountValue_other:"{{count}} 技能",updatedAt:"更新时间",skillsInSpace:"{{name}}中的技能",searchSkills:"搜索技能",cannotLoadSkills:"无法加载技能",noMatchingSkills:"没有匹配的技能",noSkills:"暂无技能",tryAnotherName:"请尝试搜索其他名称",emptySkillsDescription:"本地上传 Skill,或自动创建",actions:"操作",spaceDetails:"技能空间详情",editSpace:"编辑空间",deleteSpace:"删除空间",searchSpaces:"搜索技能空间",spaceList:"技能空间列表",noMatchingSpaces:"没有匹配的技能空间",createSpace:"新建技能空间",newSpace:"新建空间",loadingMoreSpaces:"正在加载更多技能空间",scrollForMore:"继续下滑加载更多",allSpacesLoaded:"已加载全部技能空间",errors:{loadSpaces:"读取技能空间失败,请稍后重试",loadSkills:"读取技能失败,请稍后重试",loadSkillDetails:"读取技能详情失败,请稍后重试",deleteSkill:"删除 Skill 失败",deleteSpace:"删除 Skill 空间失败",downloadSkill:"下载 Skill 失败"},status:{active:"可用",available:"可用",creating:"创建中",disabled:"已停用",enabled:"已启用",failed:"异常",inactive:"未启用",pending:"等待中",published:"已发布",ready:"就绪",released:"已发布",running:"运行中",success:"正常",unavailable:"不可用",unreleased:"未发布",updating:"更新中",unknown:"未知"},sharedSpace:"企业共享空间",sharedDescription:"面向企业全员开放的技能,由管理员统一发布和维护",sharedVisibility:"全员可见",sharedPreparing:"正在准备共享空间",sharedLoadFailed:"共享空间加载失败",sharedEmpty:"暂无共享技能,管理员发布后会显示在这里",requestPublication:"申请公开",reviewSubmitting:"提交中…",reviewSubmitted:"已申请",reviewFailed:"申请公开失败",reviewStatusFailed:"审核状态加载失败",reviewRetry:"重新申请",reviewPending:"待审核",reviewApproving:"发布中",reviewApproved:"已公开",reviewReturned:"已退回",reviewHistory:"审核记录",skillDetailSections:"技能详情内容",versions:{title:"版本管理",refresh:"刷新",uploading:"上传中…",upload:"上传新版本",close:"关闭",hint:"新版本不会替换已公开版本,审核通过后才会公开;ZIP 中的技能名称需与原技能一致",loading:"正在加载版本…",loadFailed:"无法加载版本",filesFailed:"无法加载版本文件",uploadFailed:"上传新版本失败",submitFailed:"提交申请失败",retry:"重试",empty:"暂无版本",current:"当前版本",notSubmitted:"未申请公开",submitting:"提交中…",submit:"申请公开",processing:"版本状态:{{status}}",filesLoading:"正在加载文件…",filesEmpty:"暂无文件",history:"历史审核记录",shared:"已公开"},author:"作者",authorName:"作者:{{name}}"},w1e={library:"知识库",createBase:"新建知识库",editBase:"编辑知识库",invalidName:"名称必须以字母开头,且只能包含字母、数字和下划线。",nameHelp:"以字母开头,仅支持字母、数字和下划线,最多 48 个字符。",optionalDescription:"描述(可选)",descriptionOnly:"AgentKit 当前仅支持更新知识库描述。",previewWeb:"预览网页内容",addData:"添加数据",openOriginalWeb:"打开原网页",backToEdit:"返回修改",confirmAdd:"确认添加",source:"知识来源",image:"图片",documentFile:"文档文件",webPage:"在线网页",webUrl:"网页 URL",generatingWebPreview:"正在抓取网页并生成 Markdown 预览",selectFile:"选择知识文件",selectOrDropFile:"选择文件或拖拽到这里",selectedFile:"{{size}} · 点击可重新选择",imageFileHelp:"支持 PNG、JPG 和 JPEG,单个文件不超过 200 MB",documentFileHelp:"支持 PDF、PPTX、DOCX、XLSX 和 TXT,单个文件不超过 200 MB",uploadingFile:"正在上传文件并添加到知识库",optionalName:"名称(可选)",optionalType:"类型(可选)",generatePreview:"生成预览",uploadFile:"上传文件",editMetadata:"编辑知识 Metadata",knowledge:"知识",field:"字段",value:"值",backToList:"返回知识库列表",metadataJson:"元数据(JSON)",provider:"服务提供方",knowledgeId:"知识库 ID",project:"项目",creator:"创建者",data:"数据",deleteInvalidAssociation:"删除失效关联",noData:"这个知识库还没有数据",addFirstData:"添加第一项数据",format:"格式",size:"大小",searchData:"搜索数据",searchLibraryData:"搜索知识库数据",associationInvalid:"关联已失效",providerMissing:"底层 Provider 知识库已不存在",noMatchingData:"没有匹配的数据",loadingMoreData:"正在加载更多数据",retryLoading:"重试加载",details:"知识库详情",searchBases:"搜索知识库",someBasesFailed:"部分知识库暂时无法加载,已展示其余可用内容。",noMatchingBases:"没有匹配的知识库",noManagePermission:"您没有管理此知识库的权限",loadingMoreBases:"正在加载更多知识库",deleteBaseTitle:"删除知识库?",deleteBaseDescription:"将删除 {{name}} 的 AgentKit 关联;如果它由 Studio 创建,也会同时删除 Provider 资源。此操作无法撤销。",deleteDocumentTitle:"删除知识?",deleteDocumentDescription:"将从 Provider 知识库中删除 {{name}},此操作无法撤销。",preview:{processingTitle:"数据正在处理中",processingDetail:"知识库完成解析后即可预览,请稍后重新加载。",failedTitle:"数据解析失败",failedDetail:"请检查源文件或网页地址后重新添加,也可以重新加载最新状态。",noParsedTitle:"暂时没有可预览的解析内容",noParsedDetail:"此类文件会在知识库完成解析后显示文本、表格或页面图片。",noMediaTitle:"暂时没有可预览的媒体内容",noMediaDetail:"知识库尚未返回可访问的媒体预览,请稍后重新加载。",noDataTitle:"暂无可预览的数据内容",noDataDetail:"知识库尚未返回解析结果,请稍后重新加载。",attachmentError:"附件无法预览,请稍后重试。",imageAlt:"知识数据图片",audioUnsupported:"当前浏览器不支持音频预览。",videoUnsupported:"当前浏览器不支持视频预览。",namedPdf:"{{name}} PDF 预览",pdf:"PDF 预览",openPdf:"无法显示时,在新窗口打开 PDF",fileUnsupported:"当前格式暂不支持直接在线预览,已优先显示解析后的内容。",openOriginalFile:"打开原文件",loading:"正在加载数据预览",openOriginalHint:"您可以打开原网页查看来源内容。",chunk:"片段 {{index}}",loadingMore:"正在加载更多",loadMore:"加载更多"},errors:{fileTooLarge:"单个文件不能超过 200 MB",invalidImageType:"请选择 PNG、JPG 或 JPEG 图片",invalidDocumentType:"请选择 PDF、PPTX、DOCX、XLSX 或 TXT 文件",createBase:"创建知识库失败",updateBase:"更新知识库失败",metadataObject:"Metadata 必须是 JSON 对象",metadataFormat:"Metadata 格式错误",noWebPreview:"网页没有可预览的 Markdown 内容",addWeb:"添加网页失败",previewWeb:"生成网页预览失败",uploadFile:"上传文件失败",updateDocument:"更新知识失败",loadPreview:"加载数据预览失败",loadMoreBases:"加载更多知识库失败",loadBases:"加载知识库失败",loadMoreData:"加载更多数据失败",loadData:"加载数据失败",deleteBase:"删除知识库失败",deleteDocument:"删除知识失败"}},k1e={title:"飞书渠道",refresh:"刷新",loading:"正在加载渠道配置…",unsupported:"此 Runtime 不支持渠道管理,请升级 MPA 镜像。",unauthorized:"渠道管理需要 Studio 管理员身份及有效的 Runtime 凭据。",configurationError:"渠道管理配置不完整,请检查 Runtime 元数据及加密密钥。",requestFailed:"渠道请求失败,请检查 Runtime 连接后重试。",bound:"已绑定:{{name}}",unbound:"尚未绑定飞书机器人。",guidance:"私聊使用独立会话。在已授权群内 @ 当前机器人即可对话。",keyRequired:"绑定前请在 Runtime 配置持久的 CHANNEL_STATE_ENCRYPTION_KEY。",gateway:"消息网关",route:"入站路由",delivery:"回复投递",configured:"已配置",missing:"未配置",delivery_not_observed:"尚未观测",delivery_delivered:"已投递",delivery_retrying:"重试中",missingConfig:"缺少 Runtime 配置:{{fields}}",bind:"扫码绑定",newQr:"重新生成二维码",unbind:"解除绑定",confirmUnbind:"确认解绑此机器人?解绑后将停止接收新消息。",qrAlt:"机器人绑定二维码",openQr:"打开授权页面",uncertain:"注册过程已中断。重新开始前,请检查机器人绑定与 Gateway 状态。",bindingFailed:"绑定失败,请检查 Gateway 配置后重试。",chatId:"允许的群 ID",scope:"群会话策略",saveGroup:"保存群权限",noGroups:"尚未授权任何群。私聊无需群权限。",edit:"编辑",remove:"移除",removeGroup:"移除 {{name}}",scope_group_sender:"按发言人隔离",scope_group:"全群共享",scope_group_topic_sender:"按话题和发言人隔离",scope_group_topic:"按话题共享",status_PENDING:"等待扫码",status_SCANNED:"已扫码,等待授权",status_AUTHORIZED:"已授权,准备注册",status_REGISTERING:"正在注册机器人",status_BOUND:"机器人已绑定",status_FAILED:"绑定失败",status_EXPIRED:"二维码已过期",workspaceTitle:"消息渠道",workspaceDescription:"连接消息平台,让用户直接与此智能体对话,并管理访问权限。",provider_feishu:"飞书",provider_wecom:"企业微信",provider_dingtalk:"钉钉",comingSoon:"暂未开放",unavailableDescription:"{{name}}的绑定与消息配置暂未开放。",runtimeRequired:"请先将此智能体部署到 Runtime,再配置消息渠道。",bindingTitle:"机器人绑定",connected:"已绑定",notBound:"未绑定",gatewayDescription:"用于接收渠道消息的网关配置。",routeDescription:"将渠道消息转发给当前智能体的路由配置。",deliveryDescription:"实际观测到的回复投递状态,完成配置不代表已成功投递。",groupsTitle:"群聊权限",groupsDescription:"添加允许访问此智能体的群。",providerBindingTitle:"绑定{{name}}",providerUnbound:"绑定{{name}}机器人,让用户通过消息与此智能体对话。",qrGuidance:"使用{{name}}扫码授权,Runtime 将保存机器人凭据并配置消息网关。",wecomGuidance:"使用企业微信扫码授权,或手动填写 Bot ID 和 Secret 绑定已有机器人。",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"绑定机器人",wecomScan:"扫码绑定",wecomAuthorizing:"等待企业微信授权…",cancelAuthorization:"取消授权",wecomPopupBlocked:"授权窗口被浏览器拦截,请允许弹窗后重试。",wecomAuthCancelled:"已取消企业微信授权,可以重新扫码。",wecomAuthTimeout:"企业微信授权已超时,请重新扫码。",wecomInvalidResult:"授权结果缺少 Bot ID 或 Secret,请重新授权或手动填写。",wecomAuthFailed:"企业微信授权失败,请重试或手动填写凭据。",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"当前镜像尚不支持{{name}}手动配置,请升级后使用;仍可使用极速配置。",pairingTitle:"消息渠道扫码配对",feishuPairingDescription:"如果已有连接机器人,飞书扫码并绑定成功后原有机器人会被替换,可选绑定存量机器人或新建机器人。",generatingQr:"正在生成配对二维码…",dingtalkGuidance:"使用钉钉扫码授权,或手动填写 Client ID 和 Client Secret 绑定已有机器人。",wecomPairingDescription:"将在企业微信授权窗口中重新扫码配对。新机器人绑定成功后会替换当前连接;取消授权或绑定失败不会解绑原机器人。",configurationMethod:"配置方式",quickSetup:"极速配置",manualSetup:"手动配置",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"填写已有{{name}}机器人的应用凭据,连接到当前智能体。",manualReplacement:"绑定成功后将替换当前机器人;取消或绑定失败不会解除现有绑定。",accountsTitle:"飞书机器人",account:"机器人",selectAccount:"请选择机器人",accountEnabled:"已启用",accountDisabled:"已停用",addAccount:"添加机器人",cancelAddAccount:"取消添加",enableAccount:"启用机器人",disableAccount:"停用机器人",noAccounts:"尚未绑定飞书机器人。",accountsFailed:"读取机器人列表失败,请重试。",accountConflict:"机器人账号存在歧义或配置冲突,请刷新并选择机器人。",multiBotPairingDescription:"绑定新的飞书应用会添加机器人;绑定相同 App ID 会更新对应机器人。",provider_lark:"Lark",larkPairingDescription:"使用 Lark 扫码授权机器人。当前配置成功前,已有机器人仍保持绑定。",larkAccountsTitle:"Lark 机器人",noLarkAccounts:"尚未绑定 Lark 机器人。"},XVe={common:e1e,agentKitPromo:t1e,systemInfo:n1e,agentWorkspace:i1e,environmentCenter:r1e,deploymentSelect:s1e,deploymentError:a1e,studioBuildProgress:o1e,cloudEnvironment:l1e,githubCicd:c1e,feishuDeployment:u1e,deploymentResources:d1e,studioUpdate:f1e,projectPreview:h1e,workspace:p1e,resourceCollection:m1e,skillSourcePicker:g1e,composer:b1e,agentSelector:y1e,myAgents:v1e,skillCenter:x1e,knowledge:w1e,channels:k1e},YVe=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:t1e,agentSelector:y1e,agentWorkspace:i1e,channels:k1e,cloudEnvironment:l1e,common:e1e,composer:b1e,default:XVe,deploymentError:a1e,deploymentResources:d1e,deploymentSelect:s1e,environmentCenter:r1e,feishuDeployment:u1e,githubCicd:c1e,knowledge:w1e,myAgents:v1e,projectPreview:h1e,resourceCollection:m1e,skillCenter:x1e,skillSourcePicker:g1e,studioBuildProgress:o1e,studioUpdate:f1e,systemInfo:n1e,workspace:p1e},Symbol.toStringTag,{value:"Module"})),O1e="用户管理",S1e="{{count}} 位成员",E1e="用户",C1e="角色",A1e="账号状态",T1e="最近登录",_1e="操作",j1e="更改角色",N1e="关闭",R1e="保存角色",I1e="正在保存…",P1e="取消",D1e="返回",M1e="用户池",L1e="火山引擎 Identity",$1e="搜索姓名、邮箱或用户 ID",F1e="搜索",B1e="筛选角色",U1e="全部角色",Q1e="刷新",z1e="正在读取用户…",V1e="更新于 {{time}}",H1e="已将 {{name}} 设置为{{role}}",q1e="重试",W1e="你",K1e="初始超级管理员",G1e="初始超级管理员受保护,不能在此降级",X1e="保存后,对方刷新 Studio 即可使用新的权限",Y1e="角色需要重新确认",Z1e="没有匹配的用户",J1e="尝试其他关键词或角色",eke="用户登录或加入当前用户池后会显示在这里",tke="共 {{count}} 位用户",nke="上一页",ike="下一页",rke="尚未登录",ske="未提供",ake={super_admin:"超级管理员",admin:"管理员",developer:"开发者",user:"普通用户"},oke={super_admin:"管理所有资源,并管理用户和分配角色",admin:"管理 Studio 资源",developer:"开发智能体并管理自己的资源",user:"使用智能体和个人功能"},lke={EXTERNAL_PROVIDER:"正常",CONFIRMED:"正常",NORMAL:"正常",ENABLED:"正常",ACTIVE:"正常",UNCONFIRMED:"待验证",DISABLED:"已停用",FORBIDDEN:"已禁用",LOCKED:"已锁定",SUSPENDED:"已暂停",FORCE_CHANGE_PASSWORD:"需要修改密码"},cke={request_failed:"请求未完成,请刷新列表确认当前状态后重试",invalid_response:"用户服务返回异常,请刷新后重试",identity_unavailable:"暂时无法访问 Identity,请稍后重试或检查服务权限",identity_resource_missing:"用户或用户池已不存在,请刷新列表",super_administrator_required:"只有超级管理员可以管理用户",sign_in_required:"请登录后重试",user_not_in_pool:"当前账号不属于此用户池",user_disabled:"当前账号已停用",protected_administrator:"不能降低初始超级管理员的权限",cannot_demote_self:"不能降低自己的超级管理员权限",role_change_conflict:"角色已发生变化,请关闭弹窗并刷新列表后重试",cross_origin_request:"请在当前 Studio 页面内修改角色"},ZVe={title:O1e,memberCount:S1e,user:E1e,role:C1e,status:A1e,lastLogin:T1e,actions:_1e,changeRole:j1e,close:N1e,save:R1e,saving:I1e,cancel:P1e,back:D1e,pool:M1e,volcengineIdentity:L1e,searchPlaceholder:$1e,search:F1e,filterRole:B1e,allRoles:U1e,refresh:Q1e,loading:z1e,updatedAt:V1e,saved:H1e,retry:q1e,you:W1e,initialAdministrator:K1e,protectedExplanation:G1e,effectiveAfterRefresh:X1e,roleConflict:Y1e,noUsers:Z1e,tryAnotherSearch:J1e,poolEmpty:eke,resultCount:tke,previous:nke,next:ike,neverLoggedIn:rke,unknown:ske,roles:ake,descriptions:oke,states:lke,errors:cke},JVe=Object.freeze(Object.defineProperty({__proto__:null,actions:_1e,allRoles:U1e,back:D1e,cancel:P1e,changeRole:j1e,close:N1e,default:ZVe,descriptions:oke,effectiveAfterRefresh:X1e,errors:cke,filterRole:B1e,initialAdministrator:K1e,lastLogin:T1e,loading:z1e,memberCount:S1e,neverLoggedIn:rke,next:ike,noUsers:Z1e,pool:M1e,poolEmpty:eke,previous:nke,protectedExplanation:G1e,refresh:Q1e,resultCount:tke,retry:q1e,role:C1e,roleConflict:Y1e,roles:ake,save:R1e,saved:H1e,saving:I1e,search:F1e,searchPlaceholder:$1e,states:lke,status:A1e,title:O1e,tryAnotherSearch:J1e,unknown:ske,updatedAt:V1e,user:E1e,volcengineIdentity:L1e,you:W1e},Symbol.toStringTag,{value:"Module"})),uke="网站集成",dke="将 AgentKit Runtime 以悬浮聊天窗口嵌入网站",fke="返回自动化列表",hke="添加网站",pke="正在加载 Runtime",mke="选择 Runtime",gke="网站域名",bke="例如 xxxx.com 或 localhost:5173",yke="正在生成",vke="生成 Token",xke="已添加网站",wke="{{count}} 个",kke="{{count}} 个",Oke="正在加载网站集成",Ske="还没有网站集成",Eke="选择 Runtime 并输入网站域名即可生成 Token",Cke="引入方法",Ake="将下面代码放到网页的 body 结束标签前",Tke="已复制",_ke="复制代码",jke="添加网站后会在这里生成引入代码。",Nke="确定删除 {{domain}} 的网站集成吗?",Rke={load:"加载网站集成失败",create:"创建网站集成失败",delete:"删除网站集成失败",noConversationalAgent:"该 Runtime 暂未发现可对话的 Agent"},Ike={requestFailed:"请求失败 ({{status}})",greeting:"您好,有什么可以帮您?",sessionFailed:"无法建立对话会话",unauthorized:"当前网站未获得对话授权",conversationFailed:"对话请求失败,请稍后重试",open:"打开智能体对话",close:"关闭智能体对话",panelLabel:"智能体对话面板",assistant:"智能体助手",online:"在线对话"},eHe={title:uke,description:dke,backToAutomations:fke,addWebsite:hke,loadingRuntime:pke,selectRuntime:mke,websiteDomain:gke,domainPlaceholder:bke,generating:yke,generateToken:vke,addedWebsites:xke,websiteCount_one:wke,websiteCount_other:kke,loadingIntegrations:Oke,delete:"删除",emptyTitle:Ske,emptyDescription:Eke,embedMethod:Cke,embedInstructions:Ake,copied:Tke,copyCode:_ke,embedHint:jke,confirmDelete:Nke,errors:Rke,widget:Ike},tHe=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:hke,addedWebsites:xke,backToAutomations:fke,confirmDelete:Nke,copied:Tke,copyCode:_ke,default:eHe,description:dke,domainPlaceholder:bke,embedHint:jke,embedInstructions:Ake,embedMethod:Cke,emptyDescription:Eke,emptyTitle:Ske,errors:Rke,generateToken:vke,generating:yke,loadingIntegrations:Oke,loadingRuntime:pke,selectRuntime:mke,title:uke,websiteCount_one:wke,websiteCount_other:kke,websiteDomain:gke,widget:Ike},Symbol.toStringTag,{value:"Module"})),Pke={types:{all:"全部类型",document:"文档",image:"图片",video:"视频"},previewArtifact:"预览 {{name}}",moreActions:"更多操作 {{name}}",actionMenu:"{{name}} 操作",download:"下载",downloading:"下载中",edit:"编辑信息",delete:"删除产物",previewFailed:"无法预览“{{name}}”:{{message}}",downloadStarted:"已开始下载 {{name}}",downloadFailed:"无法下载“{{name}}”:{{message}}",updated:"已更新 {{name}}",deleted:"已删除 {{name}}",deleteFailed:"无法删除“{{name}}”:{{message}}",typeFilter:"产物类型",searchAria:"搜索产物",searchPlaceholder:"搜索产物或会话",retry:"重试",close:"关闭",listAria:"产物列表",loadFailed:"产物加载失败",loadDetailFallback:"请检查存储配置后重试。",reload:"重新加载",noMatch:"没有找到匹配的产物",noArtifacts:"您还没有任何产物",searchHint:"请尝试搜索其他名称或切换类型",emptyHint:"聊天中生成的产物会自动显示在这里",columns:{name:"名称",source:"来源",updatedAt:"修改时间",actions:"操作"},loadingMore:"正在加载更多产物",unknownTime:"时间未知",preview:{close:"关闭预览",meta:"{{type}} / 版本 {{version}}",loading:"正在加载预览",alt:"{{name}} 预览",loadFailed:"预览加载失败,请稍后重试或下载查看",unsupported:"当前格式暂不支持在线预览,请下载查看",sourceAria:"产物来源",agent:"智能体",session:"会话",tool:"生成工具",createdAt:"生成时间",fileSize:"文件大小",tags:"标签",viewSession:"查看会话"},deleteDialog:{title:"删除产物?",description:"“{{name}}”将从产物库永久删除,聊天记录不会受到影响。",deleting:"删除中",confirm:"删除",close:"关闭删除确认框"},api:{withStatus:"{{message}}({{status}})",listFailed:"读取产物库失败",syncFailed:"同步聊天产物失败",updateFailed:"更新产物失败",deleteFailed:"删除产物失败",downloadFailed:"下载产物失败"}},Dke={unknownSource:"未知来源",unknownCreator:"未知创建者"},Mke={nameRequired:"请输入产物名称",tooManyTags:"标签最多 {{max}} 个",tagTooLong:"单个标签不能超过 {{max}} 个字符",title:"编辑产物信息",subtitle:"内容文件不会被修改",close:"关闭编辑框",name:"名称",description:"描述",descriptionPlaceholder:"补充用途、版本或使用说明",tags:"标签",tagsPlaceholder:"使用逗号分隔,最多 {{max}} 个",cancel:"取消",saving:"保存中",save:"保存"},Lke={change:{added:"新增",modified:"修改",deleted:"删除"},noChanges:"两个版本的源码没有差异",chooseFile:"从左侧选择文件以查看代码",compareTitle:"版本对比",workspaceTitle:"源码工作区",projectFallback:"Agent 项目",switchTheme:"切换源码主题",switchThemeTitle:"切换为{{theme}}主题",themes:{dark:"深色",light:"浅色"},closeWorkspace:"关闭源码工作区",close:"关闭",changedFiles:"变更文件",projectFiles:"项目文件",changes:"变更",files:"文件",openFiles:"打开的文件",noFileSelected:"未选择文件",comparisonDirection:"对比方向",before:"优化前",after:"优化后",loadingEditor:"正在加载编辑器…",changedFileCount_one:"{{count}} 个文件有变更",changedFileCount_other:"{{count}} 个文件有变更",fileCount_one:"{{count}} 个文件",fileCount_other:"{{count}} 个文件",lineCount_one:"{{count}} 行 · UTF-8",lineCount_other:"{{count}} 行 · UTF-8",viewSource:"查看源码",viewSourceAria:"查看和编辑项目源码"},$ke={nav:"搜索",selectAgent:"请选择 Agent",checkingCapabilities:"正在检测 Agent 能力",notMounted:"当前 Agent 未挂载{{label}}",sources:{session:"会话",web:"网络",knowledge:"知识库",memory:"长期记忆"},webDescription:"通过 web_search 工具检索",backendLocal:"本地",failed:"搜索失败:{{message}}",placeholder:{selectAgent:"请先选择 Agent",web:"在网络中检索",knowledge:"在 {{name}} 中检索",knowledgeFallback:"当前 Agent 的知识库",memory:"在 {{name}} 中检索",memoryFallback:"当前用户的长期记忆",session:"在当前 Agent 的会话中检索"},sourceTypeAria:"搜索类型:{{label}}",notSelected:"未选择",sourceType:"搜索类型",selectSource:"选择搜索类型",noAgentHint:"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。",loadingCapabilities:"正在读取当前 Agent 的检索能力…",sourceUnavailable:"当前 Agent 未挂载该数据源",instructions:{web:"输入关键词后回车或点击按钮,通过 web_search 工具检索。",knowledge:"输入问题,检索当前 Agent 挂载的知识库。",memory:"输入线索,检索当前用户跨会话保存的长期记忆。",session:"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"},noResults:"未找到匹配“{{query}}”的结果。",knowledgeFragment:"知识片段 {{index}}",memoryFragment:"记忆片段 {{index}}"},Fke={title:"开发者资源",sections:{documentation:{title:"相关链接",description:"查看开发文档与 AgentKit 常用入口"},bestPractices:{title:"最佳实践",description:"参考开发、调试与部署经验"},showcases:{title:"案例展示",description:"探索 AgentKit 应用案例"}},links:{veadkDocs:"VeADK 文档",cliDocs:"AgentKit CLI 文档",platformDocs:"AgentKit 平台文档",console:"AgentKit 控制台"},articles:{veadkDevelopment:{title:"使用 VeADK 开发并部署智能体",description:"使用 VeADK 构建 Agent,并部署至 AgentKit 智能体运行时。"},cliDevelopment:{title:"使用 AgentKit CLI 开发并部署智能体",description:"通过 AgentKit CLI 创建项目、调试 Agent,并完成部署。"},coverAlt:"{{title}}文章封面"},showcases:{researchAssistant:{title:"多智能体研究助手",description:"由多个专业 Agent 协同完成资料检索、分析和结论整理。"},multimodalAnalysis:{title:"多模态内容分析",description:"在统一会话中理解图片、文档和视频内容。"},customerService:{title:"智能客服工作台",description:"结合知识检索与工具调用处理复杂的客户服务任务。"},webSearch:{title:"联网搜索 Agent",description:"检索实时网页内容,并将信息整理为可追溯的回答。"},a2uiApp:{title:"A2UI 交互应用",description:"让 Agent 根据任务过程生成可交互的前端界面。"},previewAlt:"{{title}}界面预览"}},Bke={title:"资源库",untitledSession:"未命名会话",categoryAria:"资源库分类",regionAria:"区域",tabs:{skills:"技能库",knowledge:"知识库",artifacts:"产物"}},Uke={title:"管理 Agent",subtitle:"列出你有权管理的 AgentKit Runtime",mainAgentOnly:"仅显示主 Agent(控制面信息)。",deleteConfirm:'确定删除 Agent "{{name}}"?该 Runtime 将被永久删除。',regionFilterTitle:"按区域筛选",regionFilterAria:"区域筛选",regionAria:"区域",refresh:"刷新",loading:"加载中…",empty:"暂无你部署的 Agent。",connected:"已连接",connect:"连接到此 Agent",deleteRuntime:"删除该 Runtime",loadingDetail:"读取详情…",agentStructure:"Agent 结构",secretHidden:"敏感值不展示,可通过授权请求直接复制",revealSecret:"{{key}} 的敏感值",copySecret:"复制 {{key}} 的值",copy:"复制",copied:"已复制",copyFailed:"复制失败",notConfigured:"未配置",fields:{model:"模型",description:"描述",status:"状态信息",project:"项目",version:"版本",resources:"资源",memory:"记忆",tool:"工具",knowledge:"知识",mcpToolset:"MCP 工具集",updatedAt:"更新时间"},resource:{memory:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",concurrency:"并发 {{value}}"},environmentVariables:"环境变量",unnamed:"(未命名)"},Qke={mainAgent:"主 Agent",subAgent:"子 Agent {{index}}",itemCount_one:"{{count}} 项",itemCount_other:"{{count}} 项",info:"Agent 信息",infoAndTopology:"Agent 信息与设置",loadingInfo:"正在读取 Agent 信息…",unnamedAgent:"未命名 Agent",agentsMd:"AGENTS.md",tools:"工具",toolList:"工具列表",studioTool:"Studio Tool",removeTool:"移除工具 {{name}}",remove:"移除",notConfigured:"未配置",addStudioTool:"添加 Studio 工具",addStudioToolHere:"在此对话中添加 Studio 工具",skills:"技能",skillList:"技能列表",addSkill:"添加技能空间技能",addSkillHere:"向此会话添加技能空间技能",skillMountNextTurn:"挂载的版本将在下一 Turn 开始时冻结。",previewUnsupported:"暂不支持预览",sessionEnvironment:"会话环境",environment:"环境",agentCanvas:"Agent 画布",topology:"结构拓扑",nodeKinds:{agent:"Agent",sandbox:"沙箱","worker-session":"Worker 会话","skill-space":"技能空间",skill:"技能","studio-tool":"Studio 工具",mcp:"MCP",environment:"环境",knowledge:"知识库","sub-agent":"子 Agent"},nodeStatuses:{configured:"已配置",mounted:"已挂载",running:"运行中",paused:"已暂停"},viewCanvasFullscreen:"全屏查看 Agent 画布",viewFullscreen:"全屏查看",executionCanvas:"Agent 执行画布",fullscreenExecutionCanvas:"全屏 Agent 执行画布",closeFullscreenCanvas:"关闭全屏画布",close:"关闭",capabilitiesSubtitle:"能力与协作拓扑",closeInfo:"关闭 Agent 信息",infoUnavailable:"暂时无法读取 Agent 信息。",refresh:"刷新信息",loadingSkills:"正在加载绑定技能…",sessionSkills:"本会话临时技能",noBoundSpace:"当前智能体未绑定技能空间。",noBoundSkills:"绑定的技能空间暂无技能。",loadFailed:"加载失败,请刷新重试。",accessDenied:"无权读取此信息。",documentUnsupported:"当前 Runtime 不支持 Studio 读取 AGENTS.md,请升级 Runtime 镜像。",skillsUnsupported:"当前 Runtime 未提供技能空间绑定信息。",skillsDegraded:"技能信息不完整,请刷新重试。",documentEditHint:"编辑最新版本。保存会发布新版本到此技能空间,可能影响使用它的其他智能体。运行中的会话可能需要等待缓存刷新或新建会话后生效。请保留 frontmatter 中的 name。",documentLoading:"正在加载 SKILL.md…",documentWritable:"可编辑",documentReadOnly:"只读:此空间或当前权限不允许编辑",documentLoadFailed:"无法加载 SKILL.md,请刷新重试。",documentSaveFailed:"未确认保存成功,已保留编辑内容。重试前请重新打开,检查当前版本。",documentConflict:"技能已有新版本。请复制当前修改,再重新打开编辑器,避免覆盖。",discardDocument:"放弃未保存的修改?",keepEditing:"继续编辑",discardChanges:"放弃修改",saveDocument:"保存为新版本"},zke={mountFailed:"挂载环境失败",closeDialog:"关闭环境弹窗",addTitle:"添加环境",description:"选择当前会话允许 Agent 使用的 Sandbox 环境",closeAdd:"关闭添加环境",searchAria:"搜索环境",searchPlaceholder:"搜索环境名称或能力",availableAria:"可用环境与工作区",loading:"正在读取可用环境…",noMatch:"没有匹配的环境或工作区",workspaces:"工作区",reuseAll:"复用工作区中的全部可用环境",availableEnvironmentCount_one:"{{count}} 个可用环境",availableEnvironmentCount_other:"{{count}} 个可用环境",selectWorkspace:"选择工作区 {{name}}",environments:"环境",includedByWorkspaces:"已由工作区 {{names}} 包含",nameSeparator:"、",selectEnvironment:"选择环境 {{name}}",selectedWorkspaceCount_one:"{{count}} 个工作区",selectedWorkspaceCount_other:"{{count}} 个工作区",coveredEnvironmentCount_one:"{{count}} 个环境",coveredEnvironmentCount_other:"{{count}} 个环境",selectionSummary:"已选择 {{workspaces}},覆盖 {{environments}}",cancel:"取消",mounting:"正在挂载…",confirm:"确认添加",mountedAria:"已挂载环境",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",removeWorkspace:"移除工作区 {{name}}",remove:"移除",removeEnvironment:"移除环境 {{name}}",add:"添加环境",addMore:"添加更多环境",addForSession:"为当前 Session 添加环境",loadingAvailable:"正在加载可用环境…",empty:"暂无可用的 AIO Sandbox 环境。"},Vke={loading:{searching:"正在查找已有环境",creating:"环境初始化中",connecting:"正在连接已有环境"},initializationFailed:"AgentKit CLI 环境初始化失败,当前状态:{{status}}。",sessionExpired:"AgentKit CLI Session 不存在或已过期,请重试。",initializationTimeout:"AgentKit CLI 环境初始化超时,请稍后重试。",nonPersistent:"非持久化环境",recyclingHoursMinutes:"{{hours}} 小时 {{minutes}} 分钟后环境回收",recyclingMinutes:"{{minutes}} 分钟后环境回收",connectionError:`无法连接 Studio 服务,未收到服务端响应。 -原始错误:{{message}}`,unavailable:"连接不可用",requestFailed:"AgentKit CLI 请求失败",retry:"重试",terminalTitle:"AgentKit CLI 终端"},Hke={labels:{coding:"智能编程",get_city_weather:"城市天气查询",get_location_weather:"位置天气查询",web_fetch:"网页内容获取",studio_write_artifact:"保存会话产物"},closeDialog:"关闭弹窗",title:"添加 Studio 工具",description:"由 Studio BFF 为 {{agentName}} 的当前会话执行,Runtime 无需预装",close:"关闭添加 Studio 工具",searchAria:"搜索 Studio 工具",searchPlaceholder:"搜索名称或工具标识",availableAria:"可用 Studio 工具",loading:"正在读取 Studio 工具…",noMatch:"没有匹配的 Studio 工具",remove:"移除",add:"添加"},qke={artifactLibrary:Pke,resourceMetadata:Dke,artifactEdit:Mke,codeBrowser:Lke,search:$ke,developerResources:Fke,library:Bke,manageAgents:Uke,agentTopology:Qke,sessionEnvironment:zke,agentKitCli:Vke,studioTools:Hke},nHe=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:Vke,agentTopology:Qke,artifactEdit:Mke,artifactLibrary:Pke,codeBrowser:Lke,default:qke,developerResources:Fke,library:Bke,manageAgents:Uke,resourceMetadata:Dke,search:$ke,sessionEnvironment:zke,studioTools:Hke},Symbol.toStringTag,{value:"Module"})),NU=["zh-CN","en-US"],kA="en-US",Wke="agentkit.studio.locale",iHe={"zh-CN":{dir:"ltr",nativeName:"简体中文"},"en-US":{dir:"ltr",nativeName:"English"}};function OA(e){if(!e)return null;const t=e.trim().replace(/_/g,"-").toLowerCase(),n=NU.find(i=>i.toLowerCase()===t);return n||(t==="zh"||t.startsWith("zh-")?"zh-CN":t==="en"||t.startsWith("en-")?"en-US":null)}function _o(e,t){const n=(e==null?void 0:e.trim())??"";if(!n)return"";const i=new RegExp("\\p{Script=Han}","u").test(n);return t.toLowerCase().startsWith("zh")===i?n:""}function rHe(){if(typeof window>"u")return null;try{return OA(window.localStorage.getItem(Wke))}catch{return null}}function sHe(){if(typeof window>"u")return[];const e=window.navigator;return e?e.languages.length>0?e.languages:e.language?[e.language]:[]:[]}function aHe(){const e=rHe();if(e)return e;for(const t of sHe()){const n=OA(t);if(n)return n}return kA}function oHe(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Wke,e)}catch{}}function Kke(e){typeof document>"u"||(document.documentElement.lang=e,document.documentElement.dir=iHe[e].dir)}const ei=e=>typeof e=="string",eO=()=>{let e,t;const n=new Promise((i,r)=>{e=i,t=r});return n.resolve=e,n.reject=t,n},k5=e=>e==null?"":String(e),lHe=(e,t,n)=>{e.forEach(i=>{t[i]&&(n[i]=t[i])})},cHe=/###/g,FG=e=>e&&e.includes("###")?e.replace(cHe,"."):e,BG=e=>!e||ei(e),PS=(e,t,n)=>{const i=ei(t)?t.split("."):t;let r=0;for(;r{const{obj:i,k:r}=PS(e,t,Object);if(i!==void 0||t.length===1){i[r]=n;return}let s=t[t.length-1],o=t.slice(0,t.length-1),l=PS(e,o,Object);for(;l.obj===void 0&&o.length;)s=`${o[o.length-1]}.${s}`,o=o.slice(0,o.length-1),l=PS(e,o,Object),l!=null&&l.obj&&typeof l.obj[`${l.k}.${s}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${s}`]=n},uHe=(e,t,n,i)=>{const{obj:r,k:s}=PS(e,t,Object);r[s]=r[s]||[],r[s].push(n)},lR=(e,t)=>{const{obj:n,k:i}=PS(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,i))return n[i]},dHe=(e,t,n)=>{const i=lR(e,n);return i!==void 0?i:lR(t,n)},Gke=(e,t,n)=>{for(const i in t)i!=="__proto__"&&i!=="constructor"&&(Object.prototype.hasOwnProperty.call(e,i)?ei(e[i])||e[i]instanceof String||ei(t[i])||t[i]instanceof String?n&&(e[i]=t[i]):Gke(e[i],t[i],n):e[i]=t[i]);return e},Xh=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),fHe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},hHe=e=>ei(e)?e.replace(/[&<>"'\/]/g,t=>fHe[t]):e;class pHe{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const i=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,i),this.regExpQueue.push(t),i}}const mHe=[" ",",","?","!",";"],gHe=new pHe(20),bHe=(e,t,n)=>{t=t||"",n=n||"";const i=mHe.filter(o=>!t.includes(o)&&!n.includes(o));if(i.length===0)return!0;const r=gHe.getRegExp(`(${i.map(o=>o==="?"?"\\?":o).join("|")})`);let s=!r.test(e);if(!s){const o=e.indexOf(n);o>0&&!r.test(e.substring(0,o))&&(s=!0)}return s},dF=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const i=t.split(n);let r=e;for(let s=0;se==null?void 0:e.replace(/_/g,"-"),yHe={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,i;(i=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||i.call(n,console,t)}};class cR{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||yHe,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,i,r){return r&&!this.debug?null:(t=t.map(s=>ei(s)?s.replace(/[\r\n\x00-\x1F\x7F]/g," "):s),ei(t[0])&&(t[0]=`${i}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new cR(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new cR(this.logger,t)}}var sh=new cR;let GP=class{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const r=this.observers[i].get(n)||0;this.observers[i].set(n,r+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}once(t,n){const i=(...r)=>{n(...r),this.off(t,i)};return this.on(t,i),this}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([r,s])=>{for(let o=0;o{for(let o=0;o-1&&this.options.ns.splice(n,1)}getResource(t,n,i,r={}){var u,d;const s=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,o=r.ignoreJSONStructure!==void 0?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;t.includes(".")?l=t.split("."):(l=[t,n],i&&(Array.isArray(i)?l.push(...i):ei(i)&&s?l.push(...i.split(s)):l.push(i)));const c=lR(this.data,l);return!c&&!n&&!i&&t.includes(".")&&(t=l[0],n=l[1],i=l.slice(2).join(".")),c||!o||!ei(i)?c:dF((d=(u=this.data)==null?void 0:u[t])==null?void 0:d[n],i,s)}addResource(t,n,i,r,s={silent:!1}){const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let l=[t,n];i&&(l=l.concat(o?i.split(o):i)),t.includes(".")&&(l=t.split("."),r=n,n=l[1]),this.addNamespaces(n),UG(this.data,l,r),s.silent||this.emit("added",t,n,i,r)}addResources(t,n,i,r={silent:!1}){for(const s in i)(ei(i[s])||Array.isArray(i[s]))&&this.addResource(t,n,s,i[s],{silent:!0});r.silent||this.emit("added",t,n,i)}addResourceBundle(t,n,i,r,s,o={silent:!1,skipCopy:!1}){let l=[t,n];t.includes(".")&&(l=t.split("."),r=i,i=n,n=l[1]),this.addNamespaces(n);let c=lR(this.data,l)||{};o.skipCopy||(i=JSON.parse(JSON.stringify(i))),r?Gke(c,i,s):c={...c,...i},UG(this.data,l,c),o.silent||this.emit("added",t,n,i)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(r=>n[r]&&Object.keys(n[r]).length>0)}toJSON(){return this.data}}var Xke={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,i,r){return e.forEach(s=>{var o;t=((o=this.processors[s])==null?void 0:o.process(t,n,i,r))??t}),t}};const Yke=Symbol("i18next/PATH_KEY");function vHe(){const e=[],t=Object.create(null);let n;return t.get=(i,r)=>{var s;return(s=n==null?void 0:n.revoke)==null||s.call(n),r===Yke?e:(e.push(r),n=Proxy.revocable(i,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Ly(e,t){const{[Yke]:n}=e(vHe()),i=(t==null?void 0:t.keySeparator)??".",r=(t==null?void 0:t.nsSeparator)??":",s=(t==null?void 0:t.enableSelector)==="strict";if(n.length>1&&r){const o=t==null?void 0:t.ns,l=s?Array.isArray(o)?o:o?[o]:null:Array.isArray(o)?o:null;if(l&&(s?l:l.length>1?l.slice(1):[]).includes(n[0]))return`${n[0]}${r}${n.slice(1).join(i)}`}return n.join(i)}const O5=e=>!ei(e)&&typeof e!="boolean"&&typeof e!="number";class uR extends GP{constructor(t,n={}){super(),lHe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=sh.create("translator"),this.checkedLoadedFor={}}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const i={...n};if(t==null)return!1;const r=this.resolve(t,i);if((r==null?void 0:r.res)===void 0)return!1;const s=O5(r.res);return!(i.returnObjects===!1&&s)}extractFromKey(t,n){let i=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let s=n.ns||this.options.defaultNS||[];const o=i&&t.includes(i),l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!bHe(t,i,r);if(o&&!l){const c=t.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:t,namespaces:ei(s)?[s]:s};const u=t.split(i);(i!==r||i===r&&this.options.ns.includes(u[0]))&&(s=u.shift()),t=u.join(r)}return{key:t,namespaces:ei(s)?[s]:s}}translate(t,n,i){let r=typeof n=="object"?{...n}:n;if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r={...r}),r||(r={}),t==null)return"";typeof t=="function"&&(t=Ly(t,{...this.options,...r})),Array.isArray(t)||(t=[String(t)]),t=t.map(N=>typeof N=="function"?Ly(N,{...this.options,...r}):String(N));const s=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:l,namespaces:c}=this.extractFromKey(t[t.length-1],r),u=c[c.length-1];let d=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const f=r.lng||this.language,h=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((f==null?void 0:f.toLowerCase())==="cimode")return h?s?{res:`${u}${d}${l}`,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(r)}:`${u}${d}${l}`:s?{res:l,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(r)}:l;const m=this.resolve(t,r);let g=m==null?void 0:m.res;const b=(m==null?void 0:m.usedKey)||l,v=(m==null?void 0:m.exactUsedKey)||l,y=["[object Number]","[object Function]","[object RegExp]"],w=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,k=r.count!==void 0&&!ei(r.count),S=uR.hasDefaultValue(r),O=k?this.pluralResolver.getSuffix(f,r.count,r):"",A=r.ordinal&&k?this.pluralResolver.getSuffix(f,r.count,{ordinal:!1}):"",E=k&&!r.ordinal&&r.count===0,j=E&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${O}`]||r[`defaultValue${A}`]||r.defaultValue;let T=g;x&&!g&&S&&(T=j);const R=O5(T),C=Object.prototype.toString.apply(T);if(x&&T&&R&&!y.includes(C)&&!(ei(w)&&Array.isArray(T))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const N=this.options.returnedObjectHandler?this.options.returnedObjectHandler(b,T,{...r,ns:c}):`key '${l} (${this.language})' returned an object instead of string.`;return s?(m.res=N,m.usedParams=this.getUsedParamsDetails(r),m):N}if(o){const N=Array.isArray(T),P=N?[]:{},I=N?v:b;for(const D in T)if(Object.prototype.hasOwnProperty.call(T,D)){const _=`${I}${o}${D}`;S&&!g?P[D]=this.translate(_,{...r,defaultValue:O5(j)?j[D]:void 0,joinArrays:!1,ns:c}):P[D]=this.translate(_,{...r,joinArrays:!1,ns:c}),P[D]===_&&(P[D]=T[D])}g=P}}else if(x&&ei(w)&&Array.isArray(g))g=g.join(w),g&&(g=this.extendTranslation(g,t,r,i));else{let N=!1,P=!1;!this.isValidLookup(g)&&S&&(N=!0,g=j),this.isValidLookup(g)||(P=!0,g=l);const D=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&P?void 0:g,_=S&&j!==g&&this.options.updateMissing;if(P||N||_){if(this.logger.log(_?"updateKey":"missingKey",f,u,k&&!_?`${l}${this.pluralResolver.getSuffix(f,r.count,r)}`:l,_?j:g),o){const H=this.resolve(l,{...r,keySeparator:!1});H&&H.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let L=[];const F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&F&&F[0])for(let H=0;H{var z;const Z=S&&U!==g?U:D;this.options.missingKeyHandler?this.options.missingKeyHandler(H,u,q,Z,_,r):(z=this.backendConnector)!=null&&z.saveMissing&&this.backendConnector.saveMissing(H,u,q,Z,_,r),this.emit("missingKey",H,u,q,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&k?L.forEach(H=>{const q=this.pluralResolver.getSuffixes(H,r);E&&r[`defaultValue${this.options.pluralSeparator}zero`]&&!q.includes(`${this.options.pluralSeparator}zero`)&&q.push(`${this.options.pluralSeparator}zero`),q.forEach(U=>{M([H],l+U,r[`defaultValue${U}`]||j)})}):M(L,l,j))}g=this.extendTranslation(g,t,r,m,i),P&&g===l&&this.options.appendNamespaceToMissingKey&&(g=`${u}${d}${l}`),(P||N)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${d}${l}`:l,N?g:void 0,r))}return s?(m.res=g,m.usedParams=this.getUsedParamsDetails(r),m):g}extendTranslation(t,n,i,r,s){var c,u;if((c=this.i18nFormat)!=null&&c.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const d=ei(t)&&(((u=i==null?void 0:i.interpolation)==null?void 0:u.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(d){const m=t.match(this.interpolator.nestingRegexp);f=m&&m.length}let h=i.replace&&!ei(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),t=this.interpolator.interpolate(t,h,i.lng||this.language||r.usedLng,i),d){const m=t.match(this.interpolator.nestingRegexp),g=m&&m.length;f(s==null?void 0:s[0])===m[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${n[0]}`),null):this.translate(...m,n),i)),i.interpolation&&this.interpolator.reset()}const o=i.postProcess||this.options.postProcess,l=ei(o)?[o]:o;return t!=null&&(l!=null&&l.length)&&i.applyPostProcessor!==!1&&(t=Xke.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),t}resolve(t,n={}){let i,r,s,o,l;return ei(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(c=>typeof c=="function"?Ly(c,{...this.options,...n}):c)),t.forEach(c=>{if(this.isValidLookup(i))return;const u=this.extractFromKey(c,n),d=u.key;r=d;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const h=n.count!==void 0&&!ei(n.count),m=h&&!n.ordinal&&n.count===0,g=n.context!==void 0&&(ei(n.context)||typeof n.context=="number")&&n.context!=="",b=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(v=>{var y,w;this.isValidLookup(i)||(l=v,!this.checkedLoadedFor[`${b[0]}-${v}`]&&((y=this.utils)!=null&&y.hasLoadedNamespace)&&!((w=this.utils)!=null&&w.hasLoadedNamespace(l))&&(this.checkedLoadedFor[`${b[0]}-${v}`]=!0,this.logger.warn(`key "${r}" for languages "${b.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),b.forEach(x=>{var O;if(this.isValidLookup(i))return;o=x;const k=[d];if((O=this.i18nFormat)!=null&&O.addLookupKeys)this.i18nFormat.addLookupKeys(k,d,x,v,n);else{let A;h&&(A=this.pluralResolver.getSuffix(x,n.count,n));const E=`${this.options.pluralSeparator}zero`,j=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(n.ordinal&&A.startsWith(j)&&k.push(d+A.replace(j,this.options.pluralSeparator)),k.push(d+A),m&&k.push(d+E)),g){const T=`${d}${this.options.contextSeparator||"_"}${n.context}`;k.push(T),h&&(n.ordinal&&A.startsWith(j)&&k.push(T+A.replace(j,this.options.pluralSeparator)),k.push(T+A),m&&k.push(T+E))}}let S;for(;S=k.pop();)this.isValidLookup(i)||(s=S,i=this.getResource(x,v,S,n))}))})}),{res:i,usedKey:r,exactUsedKey:s,usedLng:o,usedNS:l}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,i,r={}){var s;return(s=this.i18nFormat)!=null&&s.getResource?this.i18nFormat.getResource(t,n,i,r):this.resourceStore.getResource(t,n,i,r)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=t.replace&&!ei(t.replace);let r=i?t.replace:t;if(i&&typeof t.count<"u"&&(r={...r,count:t.count}),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!i){r={...r};for(const s of n)delete r[s]}return r}static hasDefaultValue(t){const n="defaultValue";for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&i.startsWith(n)&&t[i]!==void 0)return!0;return!1}}class zG{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=sh.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(t){if(t=FE(t),!t||!t.includes("-"))return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=FE(t),!t||!t.includes("-"))return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(ei(t)&&t.includes("-")){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(t)}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(i=>{if(n)return;const r=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(r))&&(n=r)}),!n&&this.options.supportedLngs&&t.forEach(i=>{if(n)return;const r=this.getScriptPartFromCode(i);if(this.isSupportedCode(r))return n=r;const s=this.getLanguagePartFromCode(i);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(o=>o===s?!0:!o.includes("-")&&!s.includes("-")?!1:!!(o.includes("-")&&!s.includes("-")&&o.slice(0,o.indexOf("-"))===s||o.startsWith(s)&&s.length>1))}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),ei(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let i=t[n];return i||(i=t[this.getScriptPartFromCode(n)]),i||(i=t[this.formatLanguageCode(n)]),i||(i=t[this.getLanguagePartFromCode(n)]),i||(i=t.default),i||[]}toResolveHierarchy(t,n){const i=this.options.fallbackLng,r=Array.isArray(i)?i.join("|"):i;r!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=r);const s=n===void 0||n===!1||ei(n),o=n===void 0&&typeof this.options.fallbackLng=="function",l=ei(t)&&s&&!o;let c=null;if(l){let h;n===void 0?h="undefined":n===!1?h="boolean:false":h=`string:${n}`,c=`${t.length}:${t}|${h}`}if(c!==null){const h=this.resolveHierarchyCache[c];if(h!==void 0)return h.slice()}const u=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),d=[],f=h=>{h&&(this.isSupportedCode(h)?d.push(h):this.logger.warn(`rejecting language code not found in supportedLngs: ${h}`))};return ei(t)&&(t.includes("-")||t.includes("_"))?(this.options.load!=="languageOnly"&&f(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&f(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&f(this.getLanguagePartFromCode(t))):ei(t)&&f(this.formatLanguageCode(t)),u.forEach(h=>{d.includes(h)||f(this.formatLanguageCode(h))}),c!==null?(this.resolveHierarchyCache[c]=d,d.slice()):d}}const VG={zero:0,one:1,two:2,few:3,many:4,other:5},HG={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class xHe{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=sh.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const i=FE(t==="dev"?"en":t),r=n.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:i,type:r});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let o;try{o=new Intl.PluralRules(i,{type:r})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),HG;if(!t.match(/-|_/))return HG;const c=this.languageUtils.getLanguagePartFromCode(t);o=this.getRule(c,n)}return this.pluralRulesCache[s]=o,o}needsPlural(t,n={}){let i=this.getRule(t,n);return i||(i=this.getRule("dev",n)),(i==null?void 0:i.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,i={}){return this.getSuffixes(t,i).map(r=>`${n}${r}`)}getSuffixes(t,n={}){let i=this.getRule(t,n);return i||(i=this.getRule("dev",n)),i?i.resolvedOptions().pluralCategories.sort((r,s)=>VG[r]-VG[s]).map(r=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r}`):[]}getSuffix(t,n,i={}){const r=this.getRule(t,i);return r?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${r.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,i))}}const qG=(e,t,n,i=".",r=!0)=>{let s=dHe(e,t,n);return!s&&r&&ei(n)&&(s=dF(e,n,i),s===void 0&&(s=dF(t,n,i))),s},WG=e=>e.replace(/\$/g,"$$$$");class KG{constructor(t={}){var n;this.logger=sh.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(i=>i),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:i,useRawValueToEscape:r,prefix:s,prefixEscaped:o,suffix:l,suffixEscaped:c,formatSeparator:u,unescapeSuffix:d,unescapePrefix:f,nestingPrefix:h,nestingPrefixEscaped:m,nestingSuffix:g,nestingSuffixEscaped:b,nestingOptionsSeparator:v,maxReplaces:y,alwaysFormat:w}=t.interpolation;this.escape=n!==void 0?n:hHe,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=r!==void 0?r:!1,this.prefix=s?Xh(s):o||"{{",this.suffix=l?Xh(l):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f?Xh(f):"-",this.unescapeSuffix=this.unescapePrefix?"":d?Xh(d):"",this.nestingPrefix=h?Xh(h):m||Xh("$t("),this.nestingSuffix=g?Xh(g):b||Xh(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=y||1e3,this.alwaysFormat=w!==void 0?w:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,i)=>(n==null?void 0:n.source)===i?(n.lastIndex=0,n):new RegExp(i,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,i,r){var m;let s,o,l;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=g=>{if(!g.includes(this.formatSeparator)){const w=qG(n,c,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(w,void 0,i,{...r,...n,interpolationkey:g}):w}const b=g.split(this.formatSeparator),v=b.shift().trim(),y=b.join(this.formatSeparator).trim();return this.format(qG(n,c,v,this.options.keySeparator,this.options.ignoreJSONStructure),y,i,{...r,...n,interpolationkey:v})};this.resetRegExp(),!this.escapeValue&&typeof t=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(t)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const d=(r==null?void 0:r.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((m=r==null?void 0:r.interpolation)==null?void 0:m.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>g},{regex:this.regexp,safeValue:g=>this.escapeValue?this.escape(g):g}].forEach(g=>{for(l=0;s=g.regex.exec(t);){const b=s[1].trim();if(o=u(b),o===void 0)if(typeof d=="function"){const y=d(t,s,r);o=ei(y)?y:""}else if(r&&Object.prototype.hasOwnProperty.call(r,b))o="";else if(f){o=s[0];continue}else this.logger.warn(`missed to pass in variable ${b} for interpolating ${t}`),o="";else!ei(o)&&!this.useRawValueToEscape&&(o=k5(o));const v=g.safeValue(o);if(t=t.replace(s[0],WG(v)),f?(g.regex.lastIndex+=v.length,g.regex.lastIndex-=s[0].length):g.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),t}nest(t,n,i={}){let r,s,o;const l=(c,u)=>{const d=this.nestingOptionsSeparator;if(!c.includes(d))return c;const f=c.split(new RegExp(`${Xh(d)}[ ]*{`));let h=`{${f[1]}`;c=f[0],h=this.interpolate(h,o);const m=h.match(/'/g),g=h.match(/"/g);(((m==null?void 0:m.length)??0)%2===0&&!g||((g==null?void 0:g.length)??0)%2!==0)&&(h=h.replace(/'/g,'"'));try{o=JSON.parse(h),u&&(o={...u,...o})}catch(b){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,b),`${c}${d}${h}`}return o.defaultValue&&o.defaultValue.includes(this.prefix)&&delete o.defaultValue,c};for(;r=this.nestingRegexp.exec(t);){let c=[];o={...i},o=o.replace&&!ei(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const u=/{.*}/s.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(u!==-1&&(c=r[1].slice(u).split(this.formatSeparator).map(d=>d.trim()).filter(Boolean),r[1]=r[1].slice(0,u)),s=n(l.call(this,r[1].trim(),o),o),s&&r[0]===t&&!ei(s))return s;ei(s)||(s=k5(s)),s||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${t}`),s=""),c.length&&(s=c.reduce((d,f)=>this.format(d,f,i.lng,{...i,interpolationkey:r[1].trim()}),s.trim())),t=t.replace(r[0],WG(k5(s))),this.regexp.lastIndex=0}return t}}const wHe=e=>{let t=e.toLowerCase().trim();const n={};if(e.includes("(")){const i=e.split("(");t=i[0].toLowerCase().trim();const r=i[1].slice(0,-1);t==="currency"&&!r.includes(":")?n.currency||(n.currency=r.trim()):t==="relativetime"&&!r.includes(":")?n.range||(n.range=r.trim()):r.split(";").forEach(o=>{if(o){const[l,...c]=o.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),d=l.trim();n[d]||(n[d]=u),u==="false"&&(n[d]=!1),u==="true"&&(n[d]=!0),isNaN(u)||(n[d]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}},GG=e=>{const t={};return(n,i,r)=>{let s=r;r&&r.interpolationkey&&r.formatParams&&r.formatParams[r.interpolationkey]&&r[r.interpolationkey]&&(s={...s,[r.interpolationkey]:void 0});const o=i+JSON.stringify(s);let l=t[o];return l||(l=e(FE(i),r),t[o]=l),l(n)}},kHe=e=>(t,n,i)=>e(FE(n),i)(t);class OHe{constructor(t={}){this.logger=sh.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const i=n.cacheInBuiltFormats?GG:kHe;this.formats={number:i((r,s)=>{const o=new Intl.NumberFormat(r,{...s});return l=>o.format(l)}),currency:i((r,s)=>{const o=new Intl.NumberFormat(r,{...s,style:"currency"});return l=>o.format(l)}),datetime:i((r,s)=>{const o=new Intl.DateTimeFormat(r,{...s});return l=>o.format(l)}),relativetime:i((r,s)=>{const o=new Intl.RelativeTimeFormat(r,{...s});return l=>o.format(l,s.range||"day")}),list:i((r,s)=>{const o=new Intl.ListFormat(r,{...s});return l=>o.format(l)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=GG(n)}format(t,n,i,r={}){if(!n||t==null)return t;const s=n.split(this.formatSeparator),o=[];for(let c=0;c-1&&!u.includes(")")&&c+1{var h;const{formatName:d,formatOptions:f}=wHe(u);if(this.formats[d]){let m=c;try{const g=((h=r==null?void 0:r.formatParams)==null?void 0:h[r.interpolationkey])||{},b=g.locale||g.lng||r.locale||r.lng||i;m=this.formats[d](c,b,{...f,...r,...g})}catch(g){this.logger.warn(g)}return m}else this.logger.warn(`there was no format function for ${d}`);return c},t)}}const SHe=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class EHe extends GP{constructor(t,n,i,r={}){var s,o;super(),this.backend=t,this.store=n,this.services=i,this.languageUtils=i.languageUtils,this.options=r,this.logger=sh.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],(o=(s=this.backend)==null?void 0:s.init)==null||o.call(s,i,r.backend,r)}queueLoad(t,n,i,r){const s={},o={},l={},c={};return t.forEach(u=>{let d=!0;n.forEach(f=>{const h=`${u}|${f}`;!i.reload&&this.store.hasResourceBundle(u,f)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?o[h]===void 0&&(o[h]=!0):(this.state[h]=1,d=!1,o[h]===void 0&&(o[h]=!0),s[h]===void 0&&(s[h]=!0),c[f]===void 0&&(c[f]=!0)))}),d||(l[u]=!0)}),(Object.keys(s).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(s),pending:Object.keys(o),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(c)}}loaded(t,n,i){const r=t.split("|"),s=r[0],o=r[1];n&&this.emit("failedLoading",s,o,n),!n&&i&&this.store.addResourceBundle(s,o,i,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&i&&(this.state[t]=0);const l={};this.queue.forEach(c=>{uHe(c.loaded,[s],o),SHe(c,t),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{l[u]||(l[u]={});const d=c.loaded[u];d.length&&d.forEach(f=>{l[u][f]===void 0&&(l[u][f]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(c=>!c.done)}read(t,n,i,r=0,s=this.retryTimeout,o){if(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:i,tried:r,wait:s,callback:o});return}this.readingCalls++;const l=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&d&&r{this.read(t,n,i,r+1,s*2,o)},s);return}o(u,d)},c=this.backend[i].bind(this.backend);if(c.length===2){try{const u=c(t,n);u&&typeof u.then=="function"?u.then(d=>l(null,d)).catch(l):l(null,u)}catch(u){l(u)}return}return c(t,n,l)}prepareLoading(t,n,i={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();ei(t)&&(t=this.languageUtils.toResolveHierarchy(t)),ei(n)&&(n=[n]);const s=this.queueLoad(t,n,i,r);if(!s.toLoad.length)return s.pending.length||r(),null;s.toLoad.forEach(o=>{this.loadOne(o)})}load(t,n,i){this.prepareLoading(t,n,{},i)}reload(t,n,i){this.prepareLoading(t,n,{reload:!0},i)}loadOne(t,n=""){const i=t.split("|"),r=i[0],s=i[1];this.read(r,s,"read",void 0,void 0,(o,l)=>{o&&this.logger.warn(`${n}loading namespace ${s} for language ${r} failed`,o),!o&&l&&this.logger.log(`${n}loaded namespace ${s} for language ${r}`,l),this.loaded(t,o,l)})}saveMissing(t,n,i,r,s,o={},l=()=>{}){var c,u,d,f,h;if((u=(c=this.services)==null?void 0:c.utils)!=null&&u.hasLoadedNamespace&&!((f=(d=this.services)==null?void 0:d.utils)!=null&&f.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${i}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if((h=this.backend)!=null&&h.create){const m={...o,isUpdate:s},g=this.backend.create.bind(this.backend);if(g.length<6)try{let b;g.length===5?b=g(t,n,i,r,m):b=g(t,n,i,r),b&&typeof b.then=="function"?b.then(v=>l(null,v)).catch(l):l(null,b)}catch(b){l(b)}else g(t,n,i,r,l,m)}!t||!t[0]||this.store.addResource(t[0],n,i,r)}}}const S5=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),ei(e[1])&&(t.defaultValue=e[1]),ei(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(i=>{t[i]=n[i]})}return t},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),XG=e=>(ei(e.ns)&&(e.ns=[e.ns]),ei(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),ei(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),A2=()=>{},CHe=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class DS extends GP{constructor(t={},n){if(super(),this.options=XG(t),this.services={},this.logger=sh,this.modules={external:[]},CHe(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(ei(t.ns)?t.defaultNS=t.ns:t.ns.includes("translation")||(t.defaultNS=t.ns[0]));const i=S5();this.options={...i,...this.options,...XG(t)},this.options.interpolation={...i.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler);const r=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?sh.init(r(this.modules.logger),this.options):sh.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=OHe;const d=new zG(this.options);this.store=new QG(this.options.resources,this.options);const f=this.services;f.logger=sh,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new xHe(d,{prepend:this.options.pluralSeparator}),u&&(f.formatter=r(u),f.formatter.init&&f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new KG(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new EHe(r(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(h,...m)=>{this.emit(h,...m)}),this.modules.languageDetector&&(f.languageDetector=r(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=r(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new uR(this.services,this.options),this.translator.on("*",(h,...m)=>{this.emit(h,...m)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,n||(n=A2),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...d)=>this.store[u](...d)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...d)=>(this.store[u](...d),this)});const l=eO(),c=()=>{const u=(d,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(f),n(d,f)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),l}loadResources(t,n=A2){var s,o;let i=n;const r=ei(t)?t:this.language;if(typeof t=="function"&&(i=t),!this.options.resources||this.options.partialBundledLanguages){if((r==null?void 0:r.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const l=[],c=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&(l.includes(f)||l.push(f))})};r?c(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>c(d)),(o=(s=this.options.preload)==null?void 0:s.forEach)==null||o.call(s,u=>c(u)),this.services.backendConnector.load(l,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(u)})}else i(null)}reloadResources(t,n,i){const r=eO();return typeof t=="function"&&(i=t,t=void 0),typeof n=="function"&&(i=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),i||(i=A2),this.services.backendConnector.reload(t,n,s=>{r.resolve(),i(s)}),r}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&Xke.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!["cimode","dev"].includes(t)){for(let n=0;n{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},s=(l,c)=>{c?this.isLanguageChangingTo===t&&(r(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,i.resolve((...u)=>this.t(...u)),n&&n(l,(...u)=>this.t(...u))},o=l=>{var d,f;!t&&!l&&this.services.languageDetector&&(l=[]);const c=ei(l)?l:l&&l[0],u=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(ei(l)?[l]:l);u&&(this.language||r(u),this.translator.language||this.translator.changeLanguage(u),(f=(d=this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||f.call(d,u)),this.loadResources(u,h=>{s(h,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(t),i}getFixedT(t,n,i,r){const s=r==null?void 0:r.scopeNs,o=(l,c,...u)=>{let d;typeof c!="object"?d=this.options.overloadTranslationOptionHandler([l,c].concat(u)):d={...c},d.lng=d.lng||o.lng,d.lngs=d.lngs||o.lngs;const f=d.ns!==void 0&&d.ns!==null;d.ns=d.ns||o.ns,d.keyPrefix!==""&&(d.keyPrefix=d.keyPrefix||i||o.keyPrefix);const h={...this.options,...d};Array.isArray(s)&&!f&&(h.ns=s),typeof d.keyPrefix=="function"&&(d.keyPrefix=Ly(d.keyPrefix,h));const m=this.options.keySeparator||".";let g;return d.keyPrefix&&Array.isArray(l)?g=l.map(b=>(typeof b=="function"&&(b=Ly(b,h)),`${d.keyPrefix}${m}${b}`)):(typeof l=="function"&&(l=Ly(l,h)),g=d.keyPrefix?`${d.keyPrefix}${m}${l}`:l),this.t(g,d)};return ei(t)?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=i,o}t(...t){var n;return(n=this.translator)==null?void 0:n.translate(...t)}exists(...t){var n;return(n=this.translator)==null?void 0:n.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=n.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const o=(l,c)=>{const u=this.services.backendConnector.state[`${l}|${c}`];return u===-1||u===0||u===2};if(n.precheck){const l=n.precheck(this,o);if(l!==void 0)return l}return!!(this.hasResourceBundle(i,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(i,t)&&(!r||o(s,t)))}loadNamespaces(t,n){const i=eO();return this.options.ns?(ei(t)&&(t=[t]),t.forEach(r=>{this.options.ns.includes(r)||this.options.ns.push(r)}),this.loadResources(r=>{i.resolve(),n&&n(r)}),i):(n&&n(),Promise.resolve())}loadLanguages(t,n){const i=eO();ei(t)&&(t=[t]);const r=this.options.preload||[],s=t.filter(o=>!r.includes(o)&&this.services.languageUtils.isSupportedCode(o));return s.length?(this.options.preload=r.concat(s),this.loadResources(o=>{i.resolve(),n&&n(o)}),i):(n&&n(),Promise.resolve())}dir(t){var r,s;if(t||(t=this.resolvedLanguage||(((r=this.languages)==null?void 0:r.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const o=new Intl.Locale(t);if(o&&o.getTextInfo){const l=o.getTextInfo();if(l&&l.direction)return l.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=((s=this.services)==null?void 0:s.languageUtils)||new zG(S5());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.includes(i.getLanguagePartFromCode(t))||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const i=new DS(t,n);return i.createInstance=DS.createInstance,i}cloneInstance(t={},n=A2){const i=t.forkResourceStore;i&&delete t.forkResourceStore;const r={...this.options,...t,isClone:!0},s=new DS(r);if((t.debug!==void 0||t.prefix!==void 0)&&(s.logger=s.logger.clone(t)),["store","services","language"].forEach(l=>{s[l]=this[l]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},i){const l=Object.keys(this.store.data).reduce((c,u)=>(c[u]={...this.store.data[u]},c[u]=Object.keys(c[u]).reduce((d,f)=>(d[f]={...c[u][f]},d),c[u]),c),{});s.store=new QG(l,r),s.services.resourceStore=s.store}if(t.interpolation){const c={...S5().interpolation,...this.options.interpolation,...t.interpolation},u={...r,interpolation:c};s.services.interpolator=new KG(u)}return s.translator=new uR(s.services,r),s.translator.on("*",(l,...c)=>{s.emit(l,...c)}),s.init(r,n),s.translator.options=r,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const sc=DS.createInstance();sc.createInstance;sc.dir;sc.init;sc.loadResources;sc.reloadResources;sc.use;sc.changeLanguage;sc.getFixedT;sc.t;sc.exists;sc.setDefaultNamespace;sc.hasLoadedNamespace;sc.loadNamespaces;sc.loadLanguages;var Zke={exports:{}},Si={};/** +安装命令:{{command}}`,title:"接力到云端继续执行",description:"按顺序复制两段提示词,Codex 会通过插件将您的本地任务接力到云端",closeAria:"关闭本地迁移引导",installTitle:"安装插件",installDescription:"首次使用时,请选择一种安装方式。",copied:"已复制",copyInstallPrompt:"复制安装提示词",copyInstallCommand:"复制安装命令",installMethodAria:"插件安装方式",conversationInstall:"与 Codex 对话安装",terminalInstall:"从终端安装",taskTitle:"任务接力",taskDescription:"插件安装完成后复制,Codex 会迁移当前项目并继续执行任务。",copyHandoffPrompt:"复制接力提示词",generatingPairing:"正在生成新的配对码",pairingExpired:"配对码已过期",pairingRemaining:"配对码有效期剩余 {{countdown}}",refreshing:"刷新中",refreshPairing:"刷新配对码",pairingLoading:"正在生成配对码",pairingUnavailable:"配对码尚未生成。",statusAria:"端云接力状态",statusTitle:"接力状态",requestReceivedNamed:"已收到“{{name}}”的端云接力请求",requestReceivedCurrent:"已收到当前项目的端云接力请求",requestHelp:"复制接力提示词后,Codex 的请求会显示在这里。",entering:"正在进入",enterCodex:"进入 Codex",clipboardUnsupported:"当前浏览器不支持写入剪贴板。",steps:{request:"等待端侧请求",session:"创建云端 Session",restore:"恢复项目",continue:"发送续跑任务"},status:{issued:"等待请求",creating:"正在创建 Session",sessionCreated:"正在迁移项目",continuing:"正在启动云端任务",running:"云端执行中",completed:"接力完成",failed:"接力失败"}},Lwe={model:{description:"显示或切换当前对话模型",keywords:"模型 switch"},models:{description:"列出 app-server 可用模型",keywords:"模型列表 list"},skill:{description:"浏览并调用当前工作区可用的 Skill",keywords:"技能 workflow"},skills:{description:"浏览并调用当前工作区可用的 Skills",keywords:"技能列表 workflow list"},new:{description:"开始一个新对话",keywords:"新建 对话"},resume:{description:"打开历史会话或恢复指定 Thread",keywords:"历史 恢复 session"},fork:{description:"从当前上下文分叉一个新对话",keywords:"分叉 branch"},compact:{description:"压缩当前对话上下文",keywords:"压缩 上下文"},archive:{description:"归档当前对话并新建对话",keywords:"归档 关闭"},status:{description:"显示当前连接、Thread、模型与 Token 状态",keywords:"状态 连接 token"},clear:{description:"清空当前视图并开始新对话",keywords:"清空 重置"},help:{description:"显示 Sandbox 支持的快捷命令",keywords:"帮助 命令"},currentModel:"当前模型",availableModel:"可用模型",workspace:"工作空间",notSet:"未设置",modelLabel:"模型",statusLabel:"状态",running:"运行中",idle:"空闲",totalTokens:"累计 Token",contextWindow:"上下文窗口",imageFallback:"图片",unknown:"未知快捷命令:{{command}}。输入 /help 查看可用命令。",automaticSkills:"智能开发模式会自动使用开发能力,无需手动选择 Skill。",activity:{new:"已新建 Codex 对话",resumed:"已恢复 Codex 对话",deleted:"已删除 Codex 历史会话",modelChanged:"已切换 Codex 模型",availableModels:"Codex 可用模型",noModels:"当前没有可用模型",forked:"已分叉 Codex 对话",compacting:"已开始压缩当前 Codex 对话",archived:"已归档 Codex 对话",status:"Codex 当前状态",help:"Sandbox 支持的 Codex 快捷命令"}},$we={label:"智能构建任务",queued:"构建任务已排队",running:"构建任务正在后台运行",recovering:"正在恢复构建任务",waiting_user:"构建任务需要继续处理",stopping:"正在停止构建任务",succeeded:"构建任务已完成",cancelled:"构建任务已停止",failed:"构建任务未完成",open:"返回任务",hide:"隐藏任务通知",reconnecting:"正在重新连接任务服务,已有任务继续保留。"},Fwe={common:Ewe,tool:Cwe,threads:Awe,permissions:Twe,workspace:_we,approval:jwe,composer:Nwe,launch:Rwe,session:Iwe,agentDetails:Pwe,agentWorkspace:Dwe,handoff:Mwe,commands:Lwe,taskNotice:$we},HVe=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:Pwe,agentWorkspace:Dwe,approval:jwe,commands:Lwe,common:Ewe,composer:Nwe,default:Fwe,handoff:Mwe,launch:Rwe,permissions:Twe,session:Iwe,taskNotice:$we,threads:Awe,tool:Cwe,workspace:_we},Symbol.toStringTag,{value:"Module"})),Bwe={retry:"重试",signInToContinue:"登录以继续使用",signInWith:"使用 {{provider}} 登录",enterUsername:"输入一个用户名即可开始",usernamePlaceholder:"用户名(字母 + 数字,最多 16 位)",enter:"进入",usernameInvalid:"只能包含大小写字母和数字,最多 16 位。",identityProvider:{volcengine:"火山引擎 Identity",byteplus:"BytePlus Identity"},powered:{volcengine:"火山引擎 AgentKit 提供企业级 Agent 解决方案",byteplus:"BytePlus AgentKit 提供企业级 Agent 解决方案"},legalPrefix:"继续即表示你已阅读并同意 AgentKit",terms:"产品和服务条款",copyright:"© {{year}} VeADK。保留所有权利。"},Uwe={title:"登录状态已过期",description:"当前编辑内容会保留。重新登录后,刚才的操作将自动继续。",waiting:"等待登录完成…",signInAgain:"重新登录"},Qwe={breadcrumbs:"面包屑",selectAgent:"选择 Agent",switchAgent:"切换智能体"},zwe={cancel:"取消",close:"关闭确认框"},qVe={login:Bwe,authExpired:Uwe,navbar:Qwe,confirm:zwe},WVe=Object.freeze(Object.defineProperty({__proto__:null,authExpired:Uwe,confirm:zwe,default:qVe,login:Bwe,navbar:Qwe},Symbol.toStringTag,{value:"Module"})),Vwe={defaultUser:"用户",shortcuts:"快捷入口",tryCli:"体验 AgentKit CLI",developerResources:"开发者资源",systemInfo:"系统信息",language:"语言",issueFeedback:"问题反馈",logout:"退出登录",roles:{admin:"管理员",developer:"开发者",user:"普通用户",super_admin:"超级管理员"}},Hwe={home:"返回首页",expand:"展开侧边栏",collapse:"收起侧边栏",label:"主导航",newChat:"新会话",agents:"智能体",workspaces:"工作区",library:"资源库",cronjobs:"定时任务",automations:"自动化",users:"用户管理",administration:"管控",reviewCenter:"审核中心"},qwe={title:"历史会话",newConversation:"新会话",create:"新建会话",loading:"正在加载历史会话…",empty:"暂无会话",current:"当前",manage:"管理历史会话:{{title}}",more:"更多",delete:"删除",loadingMore:"加载中…",loadMore:"加载更多",evaluatingTitle:"正在自动评测",evaluating:"评测中",generating:"正在生成"},KVe={account:Vwe,navigation:Hwe,history:qwe},GVe=Object.freeze(Object.defineProperty({__proto__:null,account:Vwe,default:KVe,history:qwe,navigation:Hwe},Symbol.toStringTag,{value:"Module"})),Wwe={placeholder:"请选择",collapseOptions:"收起模型选项",expandOptions:"展开模型选项",noOptions:"暂无可用选项",noMatches:"没有匹配项,可直接使用当前模型 ID"},Kwe={unsupportedActivity:"不支持的 Skill 对话活动",ariaLabel:"Skill 生成对话"},Gwe={code:"错误码:{{code}}",type:"错误类型:{{type}}",representation:"异常表示:{{value}}",rawResponse:`服务端原始响应: +{{value}}`,original:"原始错误:{{message}}",details:"详细信息"},Xwe={ariaLabel:"Skill 文件树",viewSource:"查看源码",viewPreview:"查看预览",download:"下载",binaryFile:"二进制文件",bytes:"{{value}} 字节",binaryDescription:"当前接口仅返回文件元数据,可单独下载原文件。",metadata:"Skill 元数据",noFiles:"暂无文件"},Ywe={close:"关闭",name:"名称",region:"地域",optionalDescription:"描述(可选)",cancel:"取消",create:"创建",creating:"创建中…",save:"保存",saving:"保存中…",upload:"上传",uploading:"上传中…",createSpaceTitle:"新建 Skill 空间",editSpaceTitle:"编辑 Skill 空间",uploadTitle:"上传到 {{name}}",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",archiveValidationFailed:"Skill ZIP 格式校验失败",uploadFailed:"上传 Skill 失败",dropzone:"拖拽 Skill ZIP 到这里",chooseLocalFile:"或点击选择本地文件",archiveHelp:"ZIP 根目录需要包含 SKILL.md,也可以只包含一层包装目录。选择后仅检查格式,不会自动上传。",validating:"正在检查文件格式…",validationPassed:"格式检查通过:{{name}},共 {{count}} 个文件"},Zwe={styles:{concise:"简洁实用",strict:"严谨稳健",tutorial:"教程友好",automation:"自动化优先",custom:"自定义",customFallback:"自定义风格"},stages:{preparing:"正在准备 Dev Sandbox",ready:"Skill 已生成并通过格式校验",failed:"生成失败",cancelled:"已停止",validating:"正在校验 Skill 格式",packaging:"正在整理文件",generating:"正在生成 Skill",repairingAgain:"正在再次修复",autoRepairing:"正在自动修复({{attempt}}/{{max}})"},validation:{fallback:"Skill 格式校验未通过",repairInstruction:"只修复下面列出的 Skill 格式错误,不要改变原有用途和内容范围。",recheckInstruction:"修复后重新检查目录结构、SKILL.md frontmatter 和所有文本文件。",nameTooLong:"Skill 名称不能超过 64 个字符",invalidName:"Skill 名称只能包含小写字母、数字和连字符",modelTooLong:"模型 ID 不能超过 128 个字符",invalidModel:"模型 ID 只能包含字母、数字、点、下划线、连字符、斜杠和冒号"},errors:{loadCapability:"读取 Dev Sandbox 配置失败",autoRepair:"自动修复格式错误失败",pollCandidate:"读取候选方案状态失败,正在重试",createCandidate:"创建候选方案失败",refine:"继续调整失败",repairAgain:"再次修复格式错误失败",selectSpace:"请选择上传的 Skill Space",unsupportedRegion:"当前 Skill 地域不受支持",upload:"上传 Skill 失败",download:"下载失败"},sessionMax:"Session 最长保留 1 小时",remaining:"剩余 {{minutes}}:{{seconds}}",unnamedSpace:"未命名 Skill Space",leaveConfirmation:"离开后将停止并释放正在运行的 Dev Sandbox,确定离开吗?",createTitle:"创建技能",optimizeTitle:"优化 {{name}}",skillFallback:"技能",back:"返回技能空间",home:"主页技能生成",basicInfo:"基本信息",goal:"目标",createIntentPlaceholder:"描述希望这个 Skill 完成什么任务",optimizeIntentPlaceholder:"描述希望如何优化当前 Skill",skillName:"Skill 名称",autoNamePlaceholder:"留空时自动生成",nameHelp:"仅支持小写字母、数字和连字符;留空时自动生成。",createPlans:"生成方案",optimizePlans:"优化方案",createPlansDescription:"按不同方案并行生成多个技能,您可以选择最佳结果",optimizePlansDescription:"按不同方案并行优化当前技能,您可以选择最佳结果",plan:"方案 {{count}}",remove:"移除",model:"模型",modelPlaceholder:"选择或输入模型 ID",style:"风格",customStyle:"自定义风格",customStylePlaceholder:"描述表达方式、严谨程度或输出偏好",addConfiguration:"添加配置",notConfigured:"管理员未配置",generate:"生成",candidates:"候选方案",progress:"进度",retryCandidate:"重试此方案",formatValidationFailed:"格式校验未通过",repairAgain:"再次修复",files:"文件",downloadZip:"下载 ZIP",loadingFiles:"正在读取文件…",filesPending:"生成过程中会在这里显示完整文件树",uploadToSpace:"上传到 Skill Space",loadingSpaces:"正在加载 Skill Space",selectSpace:"选择 Skill Space",continuePlaceholder:"继续调整这个候选方案",continue:"继续调整",uploading:"上传中…",overwrite:"覆盖原 Skill",uploadToSelectedSpace:"上传到 Skill Space",uploadToCurrentSpace:"上传到当前空间",allCandidatesFailed:"所有方案均创建失败,可分别重试。"},Jwe={invalidFormat:"{{label}}格式错误。",recoveryStatus:"Skill 恢复点状态",errorResponse:"错误响应",errorDetails:"错误详情",missingContentType:"Content-Type 缺失",gatewayError:"{{fallback}}(HTTP {{status}},Content-Type: {{contentType}})。请检查代理或网关配置。",nonJson:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}},Content-Type: {{contentType}}),请检查代理或网关配置。",activity:"Skill 会话活动",invalidActivity:"Skill 会话活动格式错误。",invalidToolActivity:"Skill 工具活动格式错误。",invalidTextActivity:"Skill 文本活动格式错误。",publication:"Skill 发布结果",task:"Skill 会话",file:"Skill 文件",unknownTaskState:"Skill 会话状态无法识别。",capability:"Skill 工作台能力",loadCapability:"读取 Skill 工作台能力失败",prepareTask:"准备 Skill 会话失败",taskReference:"Skill 会话引用",startOptimization:"开始优化 Skill 失败",startTask:"开始 Skill 会话失败",taskSummary:"Skill 会话摘要",taskList:"Skill 会话列表",loadTaskList:"读取 Skill 会话列表失败",invalidTaskList:"Skill 会话列表格式错误。",loadTask:"读取 Skill 会话失败",artifact:"Skill 产物",artifactFile:"Skill 产物文件",loadArtifact:"读取 Skill 产物失败",refine:"继续调整 Skill 失败",stop:"停止当前 Skill 任务失败",publish:"发布 Skill 失败",nonNdjson:"发布 Skill 失败:服务端返回了非 NDJSON 响应。",missingStream:"发布 Skill 失败:服务端没有返回进度流。",publishProgress:"发布进度",invalidPublishProgress:"发布进度格式错误。",publishError:"发布错误",unknownPublishEvent:"未知的发布进度事件。",publishResult:"发布结果",streamEnded:"发布进度流提前结束,无法确认发布结果。请刷新技能中心确认状态。",deleteTask:"删除 Skill 会话失败",download:"下载 Skill 失败"},e1e={configSelect:Wwe,conversation:Kwe,errorDetails:Gwe,fileTree:Xwe,management:Ywe,generation:Zwe,api:Jwe},XVe=Object.freeze(Object.defineProperty({__proto__:null,api:Jwe,configSelect:Wwe,conversation:Kwe,default:e1e,errorDetails:Gwe,fileTree:Xwe,generation:Zwe,management:Ywe},Symbol.toStringTag,{value:"Module"})),t1e={back:"返回上一页",reload:"重新加载",notConfigured:"未配置",name:"名称",description:"描述",delete:"删除",save:"保存",saving:"保存中",add:"添加",manage:"管理",environment:"环境",noDescription:"暂无描述",refresh:"刷新",close:"关闭",retry:"重试",loading:"加载中…",previousPage:"上一页",nextPage:"下一页",edit:"编辑",all:"全部",search:"搜索",cancel:"取消",view:"查看",viewDetails:"查看详情",deleting:"删除中…",create:"创建",creating:"创建中",adding:"添加中",generating:"生成中",uploading:"上传中",preview:"预览",loadFailed:"加载失败",select:"选择",collapse:"收起",expand:"展开",none:"无"},n1e={ariaLabel:"AgentKit 快速入口",closeAriaLabel:"关闭 AgentKit 欢迎卡片",title:"欢迎使用 AgentKit",description:"通过 AgentKit 平台快速构建与托管您的企业级智能体",docsAriaLabel:"打开 AgentKit 文档,在新窗口打开",docs:"文档",consoleAriaLabel:"打开 AgentKit 控制台,在新窗口打开",console:"控制台"},i1e={checkUpdates:"检查更新",checkingVersions:"正在检查版本…",versionCheckError:"查询沙箱版本失败,请检查凭据、区域及接口权限后重试",sandboxUpdateError:"Sandbox 更新失败,请刷新检查实际状态后重试",modelEnvRepairUnavailable:"无法补齐模型环境变量,请检查 CODEX_API_KEY 和 CODEX_BASE_URL",updateSandbox:"更新{{variant}}{{name}}",updatingSandbox:"更新中",title:"系统信息",description:"查看当前 Studio 版本及关联的基础资源",general:"通用",currentVersion:"当前版本",storage:"存储",loadingStorage:"正在加载存储信息",tosAddress:"TOS 地址",openTosConsole:"在云控制台中打开 TOS 存储桶",environmentBuild:"环境构建",loadingEnvironmentResources:"正在加载环境构建资源",environmentResourcesError:"环境构建资源加载失败,请检查云凭据后重试。",codePipelineWorkspace:"CodePipeline 工作空间",codePipelinePipeline:"CodePipeline 流水线",openCodePipelineWorkspace:"在云控制台中打开 CodePipeline Workspace",createdOnFirstBuild:"首次构建时自动创建",containerRegistryRepository:"Container Registry 仓库",openContainerRegistryRepository:"在云控制台中打开 Container Registry 仓库",sandboxInfo:"沙箱信息",loadingSandboxInfo:"正在加载沙箱信息",sandboxInfoError:"沙箱信息加载失败,请重试。",snapshot:"快照版",snapshotWithSpace:"快照版 ",openToolConsole:"在云控制台中打开{{name}}",updateModelEnv:"更新{{variant}}{{name}}模型环境变量",modelEnvUpdated:"已更新",modelEnvAlreadyCurrent:"无需更新",userPool:"用户池",loadingUserPool:"正在加载用户池",userPoolError:"用户池加载失败,请重试。",modelEnvUpdateError:"模型环境变量更新失败,请重试。",openUserPoolConsole:"在云控制台中打开用户池{{name}}",unnamedUserPool:"未命名用户池",id:"ID",domain:"域名",region:"区域",noLocalUserPool:"本地模式未配置用户池",noUserPool:"当前 Studio 未配置用户池"},r1e={workspace:"Agent 工作区",library:"Agent 库",evaluation:"评测",agentList:"Agent 列表",agentDetails:"Agent 详情",newAgent:"新建 Agent",loading:"加载中…",loadingCloudAgents:"正在加载云端 Agent…",noAgentSelected:"请选择一个 Agent",local:"本地",remote:"云端",localAgent:"本地 Agent",remoteAgent:"云端 Agent",agentCount:"{{count}} 个 Agent",agentCountLabel:"Agent 数量",details:"详情",chat:"对话",update:"更新",backToAgentList:"返回 Agent 列表",loadingAgent:"正在加载 Agent",loadingAgentDescription:"正在读取 Agent 配置和 Runtime 信息。",loadingAgentInfo:"正在加载 Agent 信息…",detailLoadFailed:"无法加载 Agent 详情",detailLoadFailedDescription:"请检查 Runtime 状态后重试。",partialInfoUnavailable:"部分信息暂时不可用",upgradeRuntimeForDetails:"请升级 Runtime 以查看完整 Agent 信息。",basicInfo:"基本信息",usageOverview:"使用概览",sections:{basic:"基本信息",profileConfig:"Profile 配置",sessionConfig:"会话配置",usage:"使用概览",diagnostics:"诊断",evaluations:"评测",optimizations:"优化建议",integrations:"集成",versions:"版本",channels:"消息渠道"},evaluationGroup:"评测组",optimizations:"优化建议",optimizationsDescription:"根据评测结果查看可执行的优化建议。",integrations:"集成",githubVersions:"GitHub 版本",githubVersionsDescription:"查看持续交付产生的版本并创建回退 PR。",currentVersionOnly:"当前未启用 GitHub 持续交付,仅展示当前生产版本。",loadingVersions:"正在加载版本…",noVersion:"暂无版本记录",prLink:"Pull Request",viewPr:"查看 PR",author:"提交人",publishStatus:"发布状态",viewRelease:"查看发布记录",rollbackToVersion:"回退到此版本",rollingBack:"正在创建回退…",rollbackEvent:"回退事件",sourceMergedRuntimeStill:"最新源码已合并,但 Runtime 仍处于",currentProductionVersionHint:";当前生产版本保持不变。",usageSummary:"使用统计",totalCalls:"总调用次数",userCount:"用户数",userDetails:"用户明细",usageUserList:"Agent 使用用户列表",user:"用户",callCount:"调用次数",lastUsed:"最近使用",unknownUser:"未知用户",loadingUsage:"正在加载使用数据…",refreshing:"刷新中…",noUsage:"暂无使用记录",usageUnavailable:"当前 Agent 暂无可用的使用统计。",usagePagination:"使用记录分页",pageOf:"第 {{page}} / {{total}} 页",notProvided:"暂未提供",integrationMethods:"集成方式",integrationDescription:"通过 Runtime API 或 A2A 协议集成当前 Agent。",integrationProtocol:"集成协议",runtimeStatus:"Runtime 状态",executionFlow:"执行流程",probingIntegration:"正在检测集成能力",probingIntegrationDescription:"正在读取可用端点和鉴权配置。",configurationStatus:"配置状态",discoveryEndpoint:"发现端点",invocationEndpoint:"调用端点",invocationUrl:"调用地址",authentication:"鉴权方式",networkAccess:"网络访问",notAvailable:"暂无",noAuthentication:"无需鉴权",noApiKeyRequired:"无需 API Key",usesOauthJwt:"使用 OAuth / JWT",showApiKey:"显示 API Key",hideApiKey:"隐藏 API Key",pythonExample:"Python 示例",deploymentConfig:"部署配置",deploymentConfigDescription:"确认实例和运行配置后更新 Runtime。",deploymentRegion:"部署区域",mpaControlPlane:"MPA 控制面",loadingMpaAgentView:"正在读取 MPA Runtime 绑定…",mpaRuntimeBound:"该 MPA Agent 已绑定唯一 Runtime,可继续管理。",mpaRuntimeMissing:"当前 Agent 没有可见的 MPA Runtime 绑定。",mpaRuntimeBindingAmbiguous:"多个 MPA Runtime 匹配当前 Agent,请先修复绑定后再修改。",mpaRuntimeOrphan:"Runtime 存在,但其中没有当前 MPA Profile。",mpaRuntimeLegacyAuthUnsupported:"该 Runtime 使用旧版 MPA 镜像,仍要求 X-Jwt-Token。请先更新到当前 AgentKit 兼容镜像,再管理 Profile 或 Session 配置。",profileConfig:"Profile 配置",profileConfigTitle:"Profile 配置",profileConfigDescription:"查看并应用 Agent 级 MPA Profile。Profile 是 Runtime 的长期默认配置,新会话默认继承它。",profileStatus:"Profile 状态",profileApplied:"已应用",profileNotApplied:"未应用",profileNotAppliedDescription:"当前 Runtime 可运行,但尚未保存为 Studio 可管理的 Profile。应用后会生成 Profile revision。",applyProfile:"应用 Profile",reapplyProfile:"重新应用 Profile",editProfile:"编辑 Profile",profileApplying:"应用中…",profileAppliedNotice:"Profile 已应用,当前 revision 为 {{revision}}。",profileApplyIncomplete:"Profile 应用未完成,请查看当前操作状态后重试。",profileApplyFailed:"Profile 应用失败。",profilePrompt:"系统提示词",profileResources:"资源配置",profileResourceSummary:"{{tools}} 个工具 · {{skills}} 个 Skill · {{mcp}} 个 MCP 服务",sessionConfigTitle:"会话配置",sessionConfigDescription:"查看和调整当前 MPA Session 的执行配置。变更只对下一轮对话生效。",loadingSessionConfig:"正在加载会话配置…",sessionConfigNoAgent:"请选择一个 MPA Agent 后再管理会话配置。",sessionConfigNonMpa:"会话配置仅适用于 MPA Agent。",sessionConfigNoSession:"请先打开这个 MPA Agent 的对话,再修改会话配置。",sessionConfigDifferentRuntime:"请先切回这个 MPA Agent 的当前对话,再修改会话配置。",sessionConfigSaved:"会话配置已更新,下一轮对话将使用新 revision。",sessionConfigStale:"该 Session 已被其他位置修改,已展示最新配置,请确认后再保存。",sessionConfigRevision:"配置 revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"最新 Profile revision",sessionProfileUpgradeAvailable:"检测到新的 Profile revision:v{{current}} → v{{target}}。",upgradeSessionProfile:"升级 Session Profile",sessionProfileUpgrading:"升级中…",sessionProfileUpgraded:"Session Profile 已升级,下一轮对话将使用新 revision。",sessionProfileUpgradeFailed:"Session Profile 升级失败。",sessionModelOverride:"模型覆盖",modelId:"模型 ID",inheritProfileDefault:"继承 Profile 默认值",sessionMcpServers:"MCP 服务",mcpServerCount:"已选择 {{count}} 个",clearSessionMcp:"清空 MCP 服务",mpaDiagnosticsTitle:"Runtime 诊断",mpaDiagnosticsDescription:"查看最近的 Runtime Console 运行记录,以及 Agent、Profile、Turn、task 和 worker 关联。",loadingMpaDiagnostics:"正在加载 Runtime 诊断…",noMpaDiagnostics:"当前 Session 暂无 Runtime 诊断运行记录。",latestRun:"最近运行",traceCorrelation:"Trace 关联",traceCorrelationDescription:"Runtime Console 为本次 invocation 返回的稳定标识。",traceSteps:"Trace 步骤",traceStepsDescription:"当前 invocation 最近的有界 Runtime Console 步骤。",mpaInstanceId:"MPA 实例",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker 类型",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile 版本",step:"步骤",stepCount:"步骤数",duration:"耗时",noTraceSteps:"本次 invocation 暂无 trace 步骤。",executionConfigMode:{replace:"Session 覆盖",clear:"本 Session 已清空",inherit:"使用 Profile 默认值"},concurrency:"并发数",selectedOptimizations:"已选优化项",selectedOptimizationsDescription:"这些优化会应用到本次更新。",optimizationProfile:"优化方案",updatePending:"等待更新",updatingDeployment:"正在更新部署",restoringUpdateConfig:"正在恢复更新配置…",updateConfigUnavailable:"无法读取更新配置",legacyConfigMissing:"旧版本 Runtime 缺少可恢复的配置,请重新创建。",deploymentFailed:"部署失败",continueEditing:"继续编辑",loadingOptimizations:"正在加载优化建议…",noOptimizations:"暂无优化建议",fixPriority:"优先级",suggestedModule:"建议模块",suggestionAndReason:"建议与原因",priority:{high:"高",medium:"中",low:"低"},modules:{agentStructure:"Agent 结构",prompt:"提示词",tool:"工具",knowledge:"知识库",memory:"记忆",workflow:"工作流",other:"其他"},evaluationGroupList:"评测组列表",newEvaluationGroup:"新建评测组",newEvaluationGroupName:"新评测组 {{count}}",searchEvaluationGroups:"搜索评测组",noMatchingEvaluationGroups:"没有匹配的评测组",noEvaluationGroupSelected:"请选择一个评测组",groupStats:"{{agents}} 个 Agent · {{runs}} 次运行",evaluationGroupDetails:"评测组详情",evaluationGroupStats:"{{agents}} 个 Agent · {{caseSet}} · {{runs}} 次运行",startEvaluation:"开始评测",evaluationConfig:"评测配置",historyResults:"历史结果",participatingAgents:"参与 Agent",selectedCount:"已选择 {{count}} 个",evaluationResources:"评测资源",evaluationSet:"评测集",evaluator:"评估器",caseCount:"{{count}} 条案例",evaluationMetrics:"评测指标",selectedMetricCount:"已选择 {{count}} 项",historyDescription:"查看每次评测的分数和运行状态。",noHistory:"暂无评测历史",noHistoryDescription:"运行一次评测后,结果会显示在这里。",evaluationRun:"第 {{index}} 次评测",evaluationRunMeta:"{{time}} · {{agents}} 个 Agent",overallScore:"综合分",completed:"已完成",evaluationDefaults:{coreRegression:"核心能力回归",safetyCheck:"安全与幻觉检查",coreSet:"核心回归集",safetySet:"安全边界集",toolSet:"工具调用集",qualityEvaluator:"综合质量评估器",factualEvaluator:"事实一致性评估器",toolEvaluator:"工具调用评估器",responseQuality:"回答质量",factualAccuracy:"事实准确性",toolUse:"工具调用",responseEfficiency:"响应效率",todayTime:"今天 10:32",yesterdayTime:"昨天 16:08",julyTime:"7 月 25 日 14:20",justNow:"刚刚"},defaultCases:{agentName:"示例 Agent",goodSetName:"示例正向案例集",badSetName:"示例负向案例集",weeklyFeedback:{input:"总结本周客户反馈,并按优先级归类。",output:"覆盖主要问题,给出清晰的优先级与下一步动作。",tag:"总结",reason:"任务完整覆盖了用户目标,输出结构清晰,并给出了可执行的下一步动作。"},research:{input:"查询最新公开资料并附上来源。",output:"调用搜索工具,结论与引用一一对应。",tag:"工具调用"},uncertainConclusion:{input:"在信息不足时直接给出确定结论。",output:"应明确说明未知,并主动询问缺失信息。",tag:"幻觉",reason:"信息不足时仍给出了确定结论,缺少必要的澄清步骤与不确定性说明。"},repeatedTool:{input:"连续重复调用相同工具获取同一结果。",output:"复用已有结果,避免无意义的重复调用。",tag:"效率"}},goodCases:"正向案例",badCases:"负向案例",goodCase:"正向案例",badCase:"负向案例",reference:"参考答案",caseResultFilter:"案例结果筛选",feedbackSourceFilter:"反馈来源筛选",searchCases:"搜索案例",searchCasesPlaceholder:"搜索输入、输出或标签",selectCases:"选择案例",selectAll:"全选",selectAllVisible:"选择当前可见案例",selectedCaseCount:"已选择 {{count}} 条",deleteSelected:"删除所选",deleteSelectedTitle:"删除所选 Agent",deleteSelectionDescription:"确定删除所选的 {{count}} 个项目吗?此操作无法撤销。",deleteCasesConfirm:"删除所选案例",deleteOneCaseConfirm:"删除这个案例",deleteFeedbackCase:"删除反馈案例",noFeedbackCases:"暂无反馈案例",noMatchingCases:"没有匹配的案例",loadingEvaluationSet:"正在加载评测集…",userInput:"用户输入",agentOutput:"Agent 输出",score:"得分",scoreReason:"评分原因",noUserInput:"暂无用户输入",noVisibleResponse:"暂无可见回复",note:"备注:",manualFeedback:"人工反馈",automaticFeedback:"自动反馈",scoreValue:"{{score}} 分",unknownTime:"时间未知",deleteAgentTitle:"删除 Agent",deleteAgentDescription:"确定删除 Agent“{{name}}”吗?",deleteDraftDescription:"确定删除草稿“{{name}}”吗?",deleteAgent:"删除 Agent",closeDeleteConfirmation:"关闭删除确认",mpaDeletePreviewSummary:"Studio 将清理可见的空闲会话、该 MPA 独占的沙箱模板和 Skill Space,最后删除 Runtime。数据库及共享资源保留;运行中的任务需先结束或停止。",mpaDeletePreviewSessions:"会话",mpaDeletePreviewActiveSessions:"运行中",mpaDeletePreviewIdleSessions:"空闲",mpaDeleteBlocked:"当前无法删除",mpaDeleteBlockerActiveOperation:"仍有 MPA 创建或更新操作在执行。",mpaDeleteBlockerActiveSessions:"Runtime 中仍有运行中的会话。",mpaDeleteBlockerBindingAmbiguous:"当前 Agent 匹配到多个 MPA Runtime。",mpaDeleteBlockerRuntimeMissing:"当前 MPA Agent 没有可见的 Runtime 绑定。",mpaDeleteBlockerOrphanRuntime:"Runtime 可见,但其中缺少当前 MPA Profile。",mpaDeleteStage:{runtime_sessions:"删除 {{count}} 个可见空闲 Runtime 会话",runtime_diagnostics:"清理这些会话关联的诊断数据和挂载元信息",agentkit_runtime:"删除 AgentKit Runtime",worker_template:"删除独占沙箱模板",skill_space:"删除独占 Skill Space(含空间内技能)"},draftDeletionWarning:"草稿将从当前浏览器中删除。",runtimeDeletionWarning:"Runtime 和相关云端资源将被删除。",noneSelected:"尚未选择",none:"无",notPublished:"未发布",notRecorded:"未记录",noTime:"暂无时间",noPr:"暂无 PR",comingSoon:"评测能力即将开放",preparing:"准备中",cancelled:"已取消",failed:"失败",totalCount:"共 {{count}} 条",deploymentProgress:"部署进度",returnToEdit:"返回编辑",retryOperation:"重试操作",buildLog:"构建日志",githubMountLog:"GitHub 挂载日志",githubDeliveryMountLog:"GitHub 持续交付挂载日志",waitingBuildLog:"正在等待构建日志…",waitingGithubMountLog:"正在等待 GitHub 挂载日志…",copy:"复制",copied:"已复制",copyLabel:"复制{{label}}",copiedLabel:"已复制{{label}}",logLines:"{{count}} 行",logStatus:{synced:"已同步",failed:"读取失败",syncing:"同步中",earlyOmitted:"已省略早期日志",recentOnly:"仅显示最近的构建日志",partiallyOmitted:"已省略部分日志"},deployStatus:{running:"正在部署",unconfirmed:"部署状态待确认",success:"部署完成",error:"部署失败",cancelled:"部署已取消"},deploymentSteps:{prepare:{label:"准备部署",description:"校验配置并创建部署任务"},build:{label:"构建镜像",description:"生成运行环境与智能体代码"},deploy:{label:"部署服务",description:"创建并启动 AgentKit Runtime"},publish:{label:"发布服务",description:"等待服务就绪并生成访问地址"},complete:{label:"部署完成",description:"智能体已可以正常使用"},evaluation:{label:"创建评测集",description:"自动创建 Good Case 和 Bad Case 评测集"},profileApplying:{label:"应用 MPA 配置",description:"将 Studio Agent 配置写入 MPA Runtime"},smokeRunning:{label:"验证 MPA Runtime",description:"在标记可运行前执行 Runtime 就绪验证"},runnable:{label:"MPA Runtime 可运行",description:"Runtime 已接受配置并通过执行就绪验证"},github:{label:"挂载 GitHub 持续交付",description:"初始化目标分支与 GitHub Actions workflow"},update:{label:"更新实例配置",description:"将 Runtime 实例数调整为 {{min}}~{{max}}"}},githubStatus:{published:"已发布",publishing:"发布中",failed:"发布失败",pending:"等待发布",unknown:"未知"},errors:{agentInfoMissing:"Agent 信息不可用",checkUpdateCapability:"无法检查更新能力",checkingUpdateConfig:"正在检查更新配置",cloudOnlyUpdate:"仅云端 Agent 支持更新",deleteDeployedUnsupported:"当前不支持删除已部署 Agent",deleteDraftUnsupported:"当前不支持删除草稿",loadMpaDeletePreview:"无法加载 MPA 删除预览",loadAgentInfo:"无法加载 Agent 信息",loadApiKey:"无法读取 API Key",loadGithubVersions:"无法加载 GitHub 版本",loadEvaluations:"无法加载评测案例",loadMpaAgentView:"无法加载 MPA Agent 状态",loadMpaDiagnostics:"无法加载 Runtime 诊断",loadOptimizations:"无法加载优化建议",loadRuntimeDetails:"无法加载 Runtime 详情",loadSessionConfig:"无法加载会话配置",loadUsage:"无法加载使用数据",noCreatePermission:"当前账号没有创建 Agent 的权限",noManagePermission:"当前账号没有管理此 Agent 的权限",originalConfigUnavailable:"原始配置不可用",probeIntegration:"无法检测集成能力",rollbackVersion:"无法创建版本回退",runtimeRegionMissing:"Runtime 区域信息缺失",updateCapabilityMismatch:"Runtime 更新能力与当前配置不匹配",updateCapabilityPending:"Runtime 更新能力仍在确认中",updateConfigRestoring:"正在恢复更新配置",updateUnsupported:"当前 Runtime 不支持更新",usageMismatch:"返回的使用数据与当前 Agent 不匹配"},mpaDeleteChecking:"正在检查会话和资源归属…",mpaDeleteRetryPreview:"重新检查",mpaDeletePreviewFailed:"删除前检查失败。请处理下面的错误后重新检查。",mpaDeleteRetained:"以下资源将保留",mpaDeleteRetainedReason:{shared:"有其他智能体引用",unproven:"无法确认是此智能体独占的受管资源"}},s1e={title:"环境",loadFailed:"环境加载失败,请检查存储配置后重试。",storageUnavailable:"管理员未配置持久化存储,环境管理暂不可用。",create:"新建环境",configure:"配置环境",details:"环境详情",editorDescription:"配置运行环境,或接入代码仓库和已有镜像",backToList:"返回环境列表",save:"保存环境",createAndBuild:"创建并构建",saveAndBuild:"保存并构建",name:"环境名称",namePlaceholder:"Python 数据处理",descriptionPlaceholder:"说明这个环境适合处理的任务",creationMethod:"创建方式",baseConfiguration:"基础配置",baseEnvironment:"基础环境",operatingSystem:"操作系统",pythonVersion:"Python 版本",fixedByBase:"由 {{base}} 固定为 {{value}}",selectUbuntuVersion:"选择基础镜像的 Ubuntu 版本",selectPythonVersion:"选择需要安装的 Python 版本",skills:"技能",addSkill:"添加环境技能",veadkDescription:"Agent 开发与运行框架",customDockerfile:"自定义 Dockerfile",presetEnvironment:"预制环境",presetHint:"选择“无”可自行填写 Dockerfile 第一行的基础镜像。",dockerfileSize:"{{size}} / {{max}} 字节",upload:"上传",reset:"重置",dockerfileBaseImage:"Dockerfile 基础镜像",dockerfileContent:"Dockerfile 内容",region:"区域",search:"搜索环境",manualImport:"手动导入",noMatches:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称",startBuild:"开始构建",build:"构建",unnamed:"未命名环境",listSeparator:"、",clipboardReadError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",creation:{custom:{label:"自定义配置",description:"通过表单选择基础环境、Python、工具和技能"},dockerfile:{label:"自定义 Dockerfile",description:"上传或直接编辑 Dockerfile"},git:{label:"从代码仓库构建",description:"探查公开仓库并通过 CodePipeline 构建"},image:{label:"使用已有镜像",description:"绑定由外部流水线交付的 CR 镜像"}},baseDescriptions:{"aio-sandbox":"内置 Sandbox Shell 能力 · Ubuntu 22.04","codex-sandbox":"内置 Codex CLI、浏览器与代码执行环境",ubuntu:"标准 Linux 基础镜像"},dockerfileValidation:{baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"},presets:{none:"自行填写 Dockerfile 基础镜像",aio:"内置 Sandbox Shell 与常用运行时",codex:"内置 Codex CLI、浏览器与代码执行环境"},categories:{tools:"工具",productivity:"效率",browser:"浏览器自动化",system:"系统与媒体"},options:{"lark-cli":"飞书开放平台命令行工具",pandoc:"文档格式转换工具",opencli:"将网站与桌面应用转换为命令行工具",uv:"快速 Python 包与项目管理器",ripgrep:"高性能文本检索工具",jq:"JSON 查询与转换工具","github-cli":"在终端中管理 GitHub 工作流",playwright:"浏览器自动化与端到端测试",chromium:"无头浏览器运行时",git:"代码版本管理",curl:"网络请求与文件下载",ffmpeg:"音视频转码与处理",imagemagick:"图片转换与批处理"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",hoursMinutes:"{{hours}} 小时 {{minutes}} 分"},buildStatus:{preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"构建失败",notBuilt:"未构建"},manifest:{title:"环境 Manifest",closeLabel:"关闭环境 Manifest",loading:"正在加载 Manifest",editorLabel:"环境 Manifest YAML",copyFailed:"复制失败,请重试",copied:"已复制",copy:"复制 Manifest",view:"查看环境 Manifest",viewShort:"查看 Manifest",unavailable:"尚无可用 Manifest"},buildDetails:{title:"构建详情",closeLabel:"关闭构建详情",currentStep:"当前步骤",waiting:"等待构建信息",elapsed:"已用时",sourceCommit:"源码提交",openCodePipeline:"在 CodePipeline 中查看",starting:"正在启动",rebuild:"重新构建"},git:{sectionLabel:"公开代码仓库",address:"Git 地址",ref:"Branch、Tag 或 Commit",defaultBranch:"默认分支",inspecting:"正在拉取仓库并查找 Dockerfile",foundDockerfiles:"已在提交 {{commit}} 中找到 {{count}} 个 Dockerfile。",savedDockerfileLoaded:"已载入保存的 Dockerfile,可重新探查仓库更新。",noDockerfile:"仓库中未找到 Dockerfile,请检查分支或仓库内容。",inspectAgain:"重新探查",selectDockerfile:"选择 Dockerfile"},repository:{outputSection:"构建输出",type:"镜像仓库类型",managed:"Studio 默认镜像仓库",existing:"已有镜像仓库",managedHint:"构建时自动创建或复用当前区域的 Studio 镜像仓库。"},existingImage:{sectionLabel:"已有镜像",reference:"Tag 或 Digest",placeholder:"latest 或 sha256:...",hint:"填写镜像 Tag,或以 sha256: 开头的完整 Digest。"},share:{action:"分享",title:"分享环境",closeLabel:"关闭分享环境",generating:"正在生成并复制分享码",copied:"分享码已复制",failed:"分享失败",code:"分享码",fullCode:"完整环境分享码",copiedHint:"分享码已自动复制,也可在这里查看或手动复制。",copyFailedHint:"自动复制失败,可手动复制上方分享码,或重试。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅发送给可信对象。",copyAgain:"再次复制"},import:{title:"导入环境",closeLabel:"关闭导入环境",description:"先检测分享码中的环境,再确认添加到当前账号。",code:"环境分享码",tooMany:"最多可一次导入 {{max}} 个环境,当前检测到 {{count}} 个分享码。",multipleHint:"多个分享码可使用英文逗号、中文逗号或换行分隔,重复项会自动忽略。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅导入可信来源的分享码。",inspectingCodes:"正在检测环境分享码",found:"检测到 {{count}} 个环境:{{names}}。",itemError:"第 {{index}} 个分享码:{{error}}",invalidCode:"分享码无效。",noResult:"服务未返回该分享码的导入结果。",partial:"已导入 {{created}} 个环境,{{remaining}} 个未完成,可重试有效失败项。",inspecting:"正在检测",importing:"正在导入",retryImport:"重试导入",confirm:"确认导入",inspectCodes:"检测分享码"},status:{boundImage:"环境“{{name}}”已绑定已有镜像",queued:"环境“{{name}}”已进入构建队列",savedBuildFailed:"环境已保存,但构建未启动:{{error}}",importedFailed:"已导入 {{created}} 个环境,{{failed}} 个失败",importedDuplicate:"已导入 {{created}} 个环境,{{duplicate}} 个分享码已存在",imported:"已导入 {{count}} 个环境",deleted:"已删除环境“{{name}}”"},deleteTitle:"删除环境",deleteDescription:"确定删除环境“{{name}}”吗?删除后无法恢复。",errors:{repositoryRequired:"请输入公开代码仓库地址。",repositoryHttps:"请输入公开仓库的 HTTPS 地址。",repositoryInvalid:"请输入有效的公开仓库 HTTPS 地址。",imageReferenceWhitespace:"Tag 或 Digest 不能包含空格。",imageDigestInvalid:"Digest 必须是完整的 sha256 值。",imageTagOnly:"这里只填写 Tag,不要重复填写镜像仓库路径。"}},a1e={searchPlaceholder:"搜索资源名称",emptyMessage:"暂无可用选项",searchAriaLabel:"搜索{{label}}",loadingMore:"正在加载更多资源…"},o1e={retryDeployment:"重试部署",retrying:"正在重试…",collapse:"收起错误信息",expand:"展开完整错误信息",copy:"复制完整错误信息"},l1e={steps:"构建步骤",log:"构建日志",syncing:"同步中",loadFailed:"读取失败",synced:"已同步",recentOnly:" · 仅显示最近日志",copiedLog:"已复制构建日志",copyLog:"复制构建日志",copied:"已复制",copy:"复制",logContent:"构建日志内容",waiting:"正在等待 CodePipeline 输出日志…",empty:"暂无构建日志"},c1e={defaultLabel:"Studio 默认环境",defaultDescription:"使用 Studio 预置的标准运行环境",status:{notBuilt:"未构建",preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"失败"},label:"运行环境",placeholder:"请选择运行环境",search:"搜索运行环境",loading:"正在加载运行环境…",loadFailed:"加载运行环境失败",noMatches:"未找到匹配的运行环境",unavailable:"当前没有可用的运行环境",selectionUnavailable:"所选运行环境当前不可用,请重新选择。",selectionHint:"选择构建完成的运行环境后,部署将使用其镜像和工具配置。",versionChanged:"所选环境版本已更新,请确认后继续。",versionMissing:"所选环境版本已不存在,请重新选择。",operatingSystem:"操作系统",language:"语言",image:"镜像",imageVersion:"镜像版本",skills:"技能",tools:"工具",noSkills:"未配置 Skill",noExtraTools:"未配置额外工具",defaultGuidance:"默认环境由 Studio 管理,无需额外配置。",persistenceFallback:"持久化环境服务暂不可用,当前使用默认环境。",emptyFallback:"当前没有可选择的自定义环境。"},u1e={repository:"GitHub 仓库",githubUrl:"GitHub 地址",token:"访问令牌",sessionToken:"{{provider}} 临时令牌",runtime:"Runtime",commit:"提交",workflow:"工作流",syncFailed:"同步 GitHub 代码失败",status:{mounted:"已挂载",bound:"已绑定",synced:"已同步",created:"已创建"},volcengine:"火山引擎",mountDelivery:"挂载持续交付",selectedForDeployment:"已选择,部署时挂载",mountOnDeploy:"部署时挂载持续交付",syncCode:"同步代码",deliveryMode:"GitHub 交付模式",sourceSync:"GitHub 代码同步",delivery:"GitHub 交付",loading:"读取中",running:"执行中",runtimeDeliveryHint:"写入 AgentKit Runtime GitHub Actions workflow,后续 GitHub 提交会更新绑定 Runtime。",initialDeliveryHint:"首次部署成功后初始化目标分支,后续 GitHub 提交会更新绑定 Runtime。",sourceSyncHint:"Studio 会直接 push 到目标分支;该分支由 Studio 管理,远端冲突时同步会失败。Runtime 仍由部署按钮发布。",tokenPlaceholder:"repo 或 contents write 权限",getToken:"获取 Token",hideToken:"隐藏 Token",showToken:"显示 Token",tokenHelp:"Token 仅用于本次操作,成功后不会保留在表单中。",targetBranch:"目标分支",actionsSecretPlaceholder:"用于写入 GitHub Actions Secret",sessionTokenPlaceholder:"临时凭证可选",syncing:"同步中…",pendingHint:"已选择挂载持续交付。点击部署后,Studio 会等待 Runtime 创建完成并初始化 GitHub 目标分支,初始化成功后才完成部署流程。",result:{deliveryMounted:"已挂载持续交付",deliverySelected:"已选择挂载持续交付",githubBound:"已绑定 GitHub",codeSynced:"代码已同步",deliveryHint:"目标分支提交会触发 Runtime 持续交付。",boundHint:"更新并发布时会先同步当前源码到这个分支。"},branch:"分支",viewPr:"查看 PR",createFailed:"创建失败",phase:"阶段",log:"日志"},d1e={name:"飞书",enabling:"正在启用并更新配置…",description:"接收消息并通过飞书机器人回复",configuration:"飞书配置",configurationMode:"飞书配置方式",automatic:"自动配置",manual:"手动配置",cancelling:"取消中…",scanToCreate:"扫码创建",scanDescription:"授权后自动回填凭据",generateQrCode:"生成二维码",qrCodeAlt:"飞书机器人配置二维码",scanToConfirm:"飞书扫码确认",expiresIn:"{{time}} 后失效",created:"机器人已创建",credentialsFilled:"应用凭据已自动回填",qrCodeExpired:"二维码已失效",automaticFailed:"自动配置失败",regenerateQrCode:"请重新生成二维码。",configuredPlaceholder:"已配置,留空沿用",appSecretPlaceholder:"请输入 App Secret",hideSecret:"隐藏 App Secret",showSecret:"显示 App Secret"},f1e={mode:{auto:"自动创建",autoDescription:"部署时自动创建所需资源",recommended:"推荐",create:"指定名称",createDescription:"使用指定名称创建或复用资源",existing:"选择已有",existingDescription:"从当前账号的已有资源中选择"},selectExisting:"请选择已有资源",searchResource:"搜索资源名称",noMatch:"未找到匹配资源",noAvailable:"暂无可用资源",searching:"正在搜索云资源…",loading:"正在加载云资源…",noMatchSentence:"未找到匹配资源。",noAvailableSentence:"暂无可用资源。",loadedSummary:"实际服务区域:{{region}} · 已加载 {{loaded}}{{total}}",registryInstance:"Registry 实例",registryAriaLabel:"镜像仓库 Registry 实例",namespace:"命名空间",namespaceAriaLabel:"镜像仓库 Namespace",repository:"镜像仓库",existingRepository:"已有镜像仓库",selectRegistryFirst:"请先选择 Registry 实例。",selectNamespaceFirst:"请先选择 Namespace。",configurationMode:"配置方式",configurationModeAriaLabel:"{{resource}}配置方式",selectConfigurationMode:"请选择配置方式",automaticNames:"自动创建名称",validation:{tos:"请填写或选择 TOS 存储桶。",cr:"请完整填写或选择 CR 实例、命名空间和镜像仓库。",codePipeline:"请完整填写或选择 CodePipeline Workspace 和 Pipeline。",existingCodePipeline:"请选择已有的 CodePipeline Workspace 和兼容 Pipeline。"},autoBucketWithRegion:"agentkit-platform-{账号 ID}-{{region}}",autoBucket:"agentkit-platform-{账号 ID}",tosBucket:"TOS 存储桶",bucketName:"存储桶名称",bucketNamePlaceholder:"输入存储桶名称",existingBucket:"已有存储桶",existingTosBucket:"已有 TOS 存储桶",bucket:"存储桶",accountIdResolved:"账号 ID 在部署时按当前云账号解析。",containerRegistry:"容器镜像仓库(CR)",instanceName:"实例名称",crInstance:"CR 实例",existingCrInstance:"已有 CR 实例",existingCrNamespace:"已有 CR 命名空间",existingCrRepository:"已有 CR 镜像仓库",autoRegistry:"agentkit-platform-{账号 ID}",autoRepositoryName:"{{name}}-{4 位随机字符}",registryNameNote:"账号 ID 在部署时解析,镜像仓库的随机字符在部署时生成。",workspace:"工作空间",pipeline:"流水线",workspaceName:"Workspace 名称",pipelineName:"Pipeline 名称",existingWorkspace:"已有 CodePipeline Workspace",compatiblePipeline:"兼容 Pipeline",existingPipeline:"已有 AgentKit CodePipeline",pipelineNameNote:"Pipeline 与 Runtime 名称一致。"},h1e={commit:"提交",steps:{permissions:"预检 OTA 所需权限",resolving:"读取目标版本信息",downloading:"下载并校验完整更新包",preparing:"准备 VeFaaS Function 代码",provisioning:"检查并补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布新 Revision 并重启服务"},stages:{permissions:"预检 OTA 权限",resolving:"读取版本信息",downloading:"下载更新包",preparing:"准备 Function 代码",provisioning:"补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布 Revision",checking:"检查更新",unknown:"未知阶段"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},logPermissionPrefix:"无法读取 VeFaaS 发布日志。Function 角色缺少 ",logPermissionSuffix:" 权限,更新会继续。",openIamConsole:"前往 IAM 控制台配置权限",deploymentProgress:"部署进度",live:"实时",completed:"已完成",stopped:"已停止",copied:"已复制",copyFailed:"复制失败",copyLog:"复制日志",waitingForLogs:"等待 VeFaaS 返回更新日志…",noLogs:"本次更新未返回发布日志",messages:{updated:"Studio 已更新,新 Revision 已接管服务",failed:"Studio 更新失败",timeout:"等待 VeFaaS 发布超时,请稍后重新检查版本",submitted:"更新已提交,正在等待 VeFaaS 发布新版本",connectionSwitched:"连接已切换,正在确认新版本状态"},checkingPermissions:"正在检查 OTA 权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",updated:"Studio 已更新",updateToVersion:"更新 Studio 至 {{version}}",checkPermissions:"检查更新权限",authorizationNeeded:"需要授权",updatingShort:"正在更新",refreshForNewVersion:"刷新使用新版",updateFailed:"更新失败",updateNow:"立即更新",newVersionAvailable:"有新版更新",dialog:{failed:"Studio 更新失败",checkingPermissions:"正在检查更新权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",completed:"Studio 更新完成",newVersion:"发现新版本"},permissionCheck:"正在核对 OTA 与定时任务所需的全部 IAM 权限…",permissionCheckHint:"权限全部满足后才会开始下载、更新或发布云资源。",missingPermissionCount:"当前 Function 角色缺少 {{count}} 项 OTA 更新权限,尚未执行任何云资源变更。",functionRole:"Function 角色",currentRole:"当前运行角色",policyToUpdate:"将更新策略",authorizationSteps:{open:"打开授权页面,确认已预填的策略名称和完整策略内容。",debug:"点击页面中的“发起调试”,完成策略更新。",return:"返回此窗口,点击“我已授权,重新检查”。"},missingPermissions:"缺少的权限",openPrefilledAuthorization:"打开已预填的 IAM 授权页面",openIamManually:"前往 IAM 控制台手动配置",noSafePolicy:"当前角色没有唯一可安全更新的自定义策略,请由管理员将上述权限加入该角色。",failedStage:"失败阶段",errorId:"错误 ID",notGenerated:"未生成",openFunctionLogs:"前往 VeFaaS 控制台查看 Function 日志",targetVersion:"目标版本",updateStatus:"更新状态",elapsed:"已用时",progressAriaLabel:"Studio 更新进度",processingUpdate:"正在处理更新",processing:"正在处理",backgroundHint:"发布阶段会短暂中断连接;关闭此窗口不会停止更新,可随时点击右上角按钮重新查看。",confirmDescription:"更新会重启 Studio 服务,预计约 3–5 分钟完成更新与发布。期间正在进行的对话、流式响应或部署任务可能中断,登录态不会受到影响。",selectVersion:"选择版本",currentVersion:"当前版本",changelog:"更新内容",noChangelog:"暂无更新说明",runInBackground:"后台运行",authorizedRecheck:"我已授权,重新检查",tryAgain:"重新尝试"},p1e={deploy:"部署",update:"更新",planHash:"方案哈希",backToConfiguration:"返回配置",releaseRegion:"发布区域",deployRegion:"部署区域",regionPreserved:"更新时沿用现有 Runtime 的部署区域,无法修改。",unnamedAgent:"未命名 Agent",deployTitle:"部署 {{name}}",additionalAgentCount:" 等 {{count}} 个智能体",releaseOverview:"发布概览",agentOverview:"Agent 概览",agentCount:"Agent 数量",model:"模型",systemPrompt:"系统提示词",optimizations:"优化选项",notEnabled:"未启用",effectiveCapabilities:"生效能力",automaticProtection:"自动保护",artifactActions:"发布产物操作",exportYaml:"导出 YAML",viewSource:"查看源代码",downloadSource:"下载源代码",expandFlow:"放大查看执行流程",expand:"放大查看",deploymentConfiguration:"部署配置",runtimeName:"Runtime 名称",runtimeNamePreserved:"更新时保持现有 Runtime 名称不变。",runtimeNameHint:"默认根据 Root Agent 名称生成,并添加随机后缀避免重名;支持 4-64 位字母、数字、连字符和下划线",accessAuthentication:"访问鉴权",authenticationPreserved:"更新时保持现有 Runtime 的鉴权方式不变。",authenticationMethod:"鉴权方式",authenticationAriaLabel:"部署鉴权方式",authenticationPlaceholder:"请选择鉴权方式",messageChannels:"消息渠道",instanceSettings:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",sidecarSingleInstance:"Harness Sidecar 首期仅支持单实例,Runtime 固定为 1~1",inMemorySingleInstance:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",network:"网络",networkPreserved:"现有 Runtime 的区域与网络模式保持不变。",networkMode:"网络模式",networkModes:{public:"公网",both:"公网 + VPC"},subnetId:"子网 ID",subnetHint:"可选,多个用逗号分隔",sharedInternetAccess:"VPC 内共享公网出口",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",createEvaluationSetsHint:"部署成功后,自动创建 Good Case 和 Bad Case 评测集。",resourceConfiguration:"资源配置",environmentVariables:"环境变量",environmentVariablesHint:"组件配置会自动同步到这里,部署前可核对最终值。",itemCount:"{{count}} 项",addVariable:"添加变量",componentGenerated:"组件自动生成",injectedByApiKey:"由所选 API Key 注入",envNameAriaLabel:"{{key}} 环境变量名",envDescriptionAriaLabel:"{{key}}说明:{{description}}",openOpenViking:"打开 OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}:打开 OpenViking {{label}}",requiredEmpty:"必填,尚未填写",optionalEmpty:"可选,尚未填写",envValueAriaLabel:"{{key}} 环境变量值",automatic:"自动",synced:"同步",customModelCredentials:"自定义模型凭据",releaseOnlySecret:"必填,仅用于本次发布",thisRelease:"本次发布",customVariables:"自定义变量",value:"值",deleteVariable:"删除变量",deploymentProgress:"部署进度",retryUpdate:"重试更新",retryDeploy:"重试部署",updateSucceeded:"更新成功",deploySucceeded:"部署成功",region:"区域",agentName:"Agent 名称",apiEndpoint:"API 端点",connecting:"连接中…",chatNow:"立即对话",console:"控制台",actionInProgress:"{{action}}中…",checkingName:"正在检查名称…",retryAction:"重试{{action}}",flowPreview:"执行流程预览",executionFlow:"执行流程",flowPreviewHint:"只读预览,可缩放与拖动画布",closeFlowPreview:"关闭执行流程预览",agentAdded:'Agent "{{name}}" 已添加到左上角下拉列表!',files:{preview:"文件预览",new:"新建文件",empty:"暂无文件",noneSelected:"未选择文件",selectToView:"选择左侧文件以查看内容",loadingEditor:"加载编辑器…",rename:"重命名",renamePrompt:"重命名文件"},apiKey:{selectFirst:"请先选择 API Key",revealing:"正在显示 API Key",hide:"隐藏 API Key",retryReveal:"重试显示 API Key",reveal:"显示 API Key"},task:{preparing:"准备部署",waitingBuildLog:"正在等待构建日志…",waitingGithubLog:"正在等待 GitHub 挂载日志…",syncingGithub:"正在同步当前源码到 GitHub",syncGithubCode:"同步 GitHub 代码",githubSynced:"GitHub 代码已同步",githubSubmitted:"GitHub 代码已提交",githubUpdatingRuntime:"代码已提交到 GitHub,GitHub Actions 正在更新同一个 Runtime",initializingGithub:"开始初始化 GitHub main 分支与 Actions workflow",initializingGithubBranch:"正在初始化 GitHub 持续交付目标分支",mountGithubDelivery:"挂载 GitHub 持续交付",githubBranchInitialized:"GitHub 持续交付已初始化目标分支",githubDeliveryMounted:"GitHub 持续交付已挂载",githubMountFailed:"挂载 GitHub 持续交付失败",githubMountFailedDetail:"GitHub 持续交付挂载失败:{{message}}",githubMountFailedHint:"挂载 GitHub 持续交付失败,详见 GitHub 日志。",applyingMpaProfile:"正在将 Agent 配置应用到 MPA Runtime",mpaProfileApplied:"MPA Runtime 配置已应用",runningMpaSmoke:"正在验证 MPA Runtime 执行链路",mpaReady:"MPA Runtime 已可运行",deploymentComplete:"部署完成",deployedNotConnected:"部署完成,暂未连接",cancelled:"已取消",cancelledHint:"部署已取消,相关 Runtime 资源已请求销毁。",deploymentStatusUnconfirmed:"部署状态待确认",deploymentFailed:"部署失败",buildFailedHint:"构建镜像失败,详见构建日志。"},confirm:{updateTitle:"确认更新",deployTitle:"确认部署",closeLabel:"关闭部署确认",updateDescription:"将更新并发布到当前云端 Runtime,过程可能需要几分钟。确定继续吗?",deployDescription:"将创建新的云端 Runtime,部署过程可能需要几分钟。确定继续吗?",update:"确定更新",deploy:"确定部署"},userPool:{label:"用户池",unnamed:"未命名用户池",current:"当前用户池",ariaLabel:"部署用户池",loading:"正在加载用户池…",placeholder:"请选择用户池",loadingIdentity:"正在加载 Identity 用户池…",empty:"当前账号下暂无 Identity 用户池。",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime。",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime。",markedHint:"当前 Studio 使用的用户池已在列表中标注。"},authentication:{apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPool:"用户池",userPoolDescription:"使用 Identity 用户池签发的 JWT"},steps:{buildImage:"构建镜像",deploy:"部署",publish:"发布",syncCode:"同步代码",uploadPackage:"上传代码包",packageImage:"镜像打包",createRuntime:"创建 Runtime",publishService:"发布服务",updateInstances:"更新实例配置",createEvaluationSets:"创建评测集",applyMpaProfile:"应用 MPA 配置",verifyMpaRuntime:"验证 MPA Runtime",mpaReady:"MPA Runtime 可运行"},errors:{instanceRangeInteger:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数。",instanceRangeOrder:"最小实例数不能大于最大实例数。",selectApiKey:"请先在模型配置中选择 API Key。",loadApiKey:"加载 API Key 失败,请重试。",invalidProject:"项目数据无效",updateFeishu:"更新飞书配置失败:{{message}}",userPoolRequired:"请选择用于 Runtime 鉴权的用户池。",vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",modelSecretRequired:"请填写 {{label}},用于访问对应的自定义模型地址。",managedApiKeyRequired:"{{requirement}},请先返回模型配置选择 API Key。",feishuEnvRequired:"启用飞书后,请填写{{field}}。",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",deployedButGithubMountFailed:"部署成功,但挂载 GitHub 持续交付失败:{{message}}",deployedButGithubBindFailed:"部署成功,但绑定 GitHub 失败:{{message}}",mpaRuntimeIdMissing:"部署成功,但返回缺少 Runtime ID,无法应用 MPA 配置。",mpaOperationIncomplete:"MPA Runtime 初始化未完成,请重试此部署任务。",deploymentStatusUnconfirmed:"连接已中断,当前无法确认部署最终状态。任务可能仍在云端运行,请到 AgentKit 或 Code Pipeline 查看同一任务,避免重复部署。",failedAtStage:"{{action}}失败({{stage}}阶段):{{message}}",noAgentAtEndpoint:"连接成功,但该地址未发现任何 Agent(/list-apps 为空)。",addAgent:"添加 Agent 失败:{{message}}",modelApiKeyRequired:"请填写此模型地址对应的 API Key。"}},m1e={title:"工作区",storageUnavailable:"管理员未配置持久化存储,工作区管理暂不可用。",detail:"工作区详情",create:"新建工作区",editorDescription:"将常用环境组合在一起;同一个环境可以加入多个工作区。",backToList:"返回工作区列表",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",createdAt:"创建时间",updatedAt:"最近更新",basicInfo:"基本信息",namePlaceholder:"例如:内容生产",descriptionPlaceholder:"说明这个工作区的用途",selectedEnvironmentCount:"已选择 {{count}} 个,可在其他工作区中继续复用",searchAvailableEnvironments:"搜索可用环境",searchEnvironments:"搜索环境",noAvailableEnvironments:"还没有可添加的环境",createEnvironmentFirst:"请先在“环境”页面创建并构建环境。",noMatchingEnvironments:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称。",environmentStatus:{available:"可用",building:"构建中",notBuilt:"未构建"},added:"已添加",saved:"已保存工作区“{{name}}”",resourceType:"工作区资源类型",searchWorkspaces:"搜索工作区",loadFailed:"无法加载工作区",noMatchingWorkspaces:"没有匹配的工作区",tryAnotherNameOrEnvironment:"请尝试搜索其他名称或环境",noEnvironmentAdded:"未添加环境",environmentMissing:"环境缺失",availableFraction:"{{available}}/{{total}} 可用",available:"可用",availableCount:"{{count}} 个可用",updated:"更新",addEnvironment:"添加环境",deleteTitle:"删除工作区",deleteDescription:"确定删除工作区“{{name}}”吗?环境本身不会被删除。",deleted:"已删除工作区“{{name}}”",clipboardPermissionError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",codeProjects:"代码项目"},g1e={back:"返回",detailNavigation:"详情导航",noData:"暂无数据",actions:"操作",moreActions:"更多操作 {{label}}",actionsFor:"{{label}} 操作",loading:"资源加载中,请稍候"},b1e={addSkill:"添加 Skill",remove:"移除 {{name}}",confirmRemoveRuntime:"从新版本中移除运行中的 Skill「{{name}}」?",selectedCount:"已加入技能 · {{count}}",close:"关闭{{label}}",sources:{runtime:"运行中来源 · 原样保留,可移除或用同名 Skill 替换",local:"本地",skillspace:"AgentKit Skills 中心",skillhub:"火山 Find Skill 技能广场"},tabs:{local:"本地文件",localShort:"本地文件",skillspace:"AgentKit Skills 中心",skillspaceShort:"AgentKit",skillhub:"火山 Find Skill 技能广场",skillhubShort:"Find Skill"}},y1e={model:"模型",turnControls:"流程控制",pause:"暂停",resume:"恢复",interrupt:"中断",cancel:"取消",pauseTurn:"在安全点暂停完整流程",resumeTurn:"恢复完整流程",interruptTurn:"中断当前流程并保留会话上下文",cancelTurn:"取消当前流程且不可恢复",turnState:{running:"运行中",pausing:"正在到达安全点",paused:"已暂停",resuming:"正在恢复",interrupting:"正在中断",cancelling:"正在取消",interrupted:"已中断",completed:"已完成",failed:"失败",cancelled:"已取消",orphaned:"状态待确认",newTurnRequired:"需要从检查点继续"},tasks:{ppt:"PPT",image:"图片生成",video:"视频生成"},prompts:{ppt:{quarterlyReview:"复盘【季度】经营表现,提炼指标差距、原因与行动建议",projectUpdate:"汇报【项目名称】进展:里程碑、风险、预算和资源诉求",solutionProposal:"为【客户行业】输出解决方案:痛点、架构、实施路径与收益",industryAnalysis:"分析【行业主题】趋势,给出竞争格局、机会与战略建议"},image:{launchVisual:"为【品牌或产品】设计【高级科技】风格的发布会主视觉",ecommercePoster:"生成【产品名称】电商海报,突出【核心卖点】与品牌色",conceptRendering:"呈现【产品或空间】在【使用场景】中的写实概念效果图",socialGraphic:"围绕【传播主题】制作简洁专业的企业社媒配图"},video:{brandFilm:"制作【品牌名称】30 秒宣传片,突出【品牌价值】",productLaunch:"为【产品名称】制作 45 秒发布视频:痛点、功能、场景与行动号召",trainingVideo:"制作【培训主题】企业培训视频,讲清【关键操作或规范】",eventTeaser:"生成【活动名称】20 秒预热视频,包含亮点、时间地点和报名信息"}},firstFrame:"首帧",videoToEdit:"待编辑视频",baseVideo:"基础视频",optimizeSkillPlaceholder:"描述你想优化的技能…",createSkillPlaceholder:"描述你想生成的技能…",createVideoPlaceholder:"描述你想创作的视频…",messageAgentPlaceholder:"向 {{name}} 发消息…",selectAgentFirst:"请先选择智能体",selectSkillFirst:"请先选择需要优化的 Skill",availableSkills:"可用技能",availableSubagents:"可用子 Agent",invokeSkill:"调用技能",useSubagent:"使用子 Agent",loadingCapabilities:"正在读取 Agent 能力…",noMatchingSkills:"当前 Agent 没有匹配技能",noMatchingSubagents:"当前 Agent 没有匹配子 Agent",skillFallbackDescription:"加载并执行该技能",agentFallbackDescription:"将本轮交给该 Agent",skill:"技能",uploadImage:"上传图片",uploadDocument:"上传文档或 PDF",uploadVideo:"上传视频",taskMode:"任务模式",selectTaskMode:"选择任务模式",loadingGenerationModel:"正在加载生成模型",modelUnavailable:"模型不可用",cancelTask:"取消{{task}}任务",stopGenerating:"停止生成",viewVideoProgress:"查看视频生成进度",send:"发送",selectTaskType:"选择任务类型",enterprisePrompts:"{{task}}企业提示词",sessionId:"会话 ID",sessionIdLabel:"会话 ID:",initializing:"初始化中",copied:"已复制",copySessionId:"复制会话 ID",sessionIdCopied:"已复制会话 ID",disclaimer:"回答仅供参考",viewLogs:"查看日志"},v1e={selectAgent:"选择 Agent",noLocalAgents:"暂无本地 Agent。",searchRuntime:"搜索 Runtime 名称",mineOnly:"只看我创建的",noRuntimes:"暂无 Runtime。",unsupported:"不支持",createdByMe:"我创建的",connecting:"连接中…",connected:"已连接",connect:"连接",viewInfoFor:"查看 {{name}} 信息",viewInfo:"查看信息",agentAndRuntimeInfo:"Agent 与 Runtime 信息",detailType:"详情类型",agentInfo:"Agent 信息",runtimeInfo:"Runtime 信息",loadingAgentInfo:"读取 Agent 信息…",cannotLoadAgentInfo:"暂时无法读取 Agent 信息",unnamedAgent:"未命名 Agent",subagents:"子 Agent",tools:"工具",skills:"技能",previewUnsupported:"暂不支持预览",mountedComponents:"挂载组件",noMoreAgentInfo:"暂无更多 Agent 配置信息。",local:"本地",model:"模型",status:"状态",memoryMb:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",resources:"资源",version:"版本",loadingDetails:"读取详情…",environmentVariables:"环境变量",errors:{notFound:"该 Runtime 已不存在或列表信息已过期,请刷新列表后重试。",accessDenied:"当前账号无权访问该 Runtime,请检查所属 Project 和访问权限。",previewUnsupported:"该 Agent Server 版本暂不支持信息预览。",unavailable:"该 Runtime 暂时无法访问,请确认其状态为“就绪”后重试。",timeout:"加载超时,请重试"},componentKinds:{knowledgebase:"知识库",memory:"记忆",prompt_manager:"提示词管理",example_store:"样例库",run_processor:"运行处理器",tracer:"链路追踪",toolset:"工具集",plugin:"插件",other:"其他"},runtimeStatus:{ready:"就绪",unreleased:"未发布",running:"运行中",active:"运行中",creating:"创建中",pending:"等待中",deploying:"部署中",updating:"更新中",failed:"失败",error:"异常",stopping:"停止中",stopped:"已停止",deleting:"删除中",deleted:"已删除"}},x1e={agent:"智能体",agentTypes:{general:"通用智能体",mpa:"MPA 智能体",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"创建人",namedAgent:"{{name}} 智能体",storageLocation:"存储位置",currentBrowser:"当前浏览器",region:"地域",viewDeploymentProgress:"查看 {{name}} 部署进度",viewRuntimeDetails:"查看 {{name}} Runtime 详情",viewDetails:"查看 {{name}} 详情",time:"时间",remainingTime:"剩余时间",expiringSoon:"即将清空",sandboxRemaining:"{{hours}} 小时 {{minutes}} 分钟",wakeable:"已休眠",neverExpires:"永不过期",editDraftNamed:"编辑草稿 {{name}}",viewProgress:"查看进度",deleteDraftNamed:"删除草稿 {{name}}",recheckCompatibility:"重新检测 {{name}} 的对话兼容性",connectedNamed:"{{name}} 已连接",wakeAndChat:"唤醒 {{name}} 并开始对话",chatWith:"与 {{name}} 对话",waking:"唤醒中",deploying:"部署中",draft:"草稿",checking:"检测中",chatUnsupported:"不支持对话",checkFailed:"检测失败",creatorFilter:"创建人筛选",agentType:"智能体类型",searchAgents:"搜索智能体",handoff:"接力",agentList:"{{type}}列表",noMatchingAgents:"没有匹配的智能体",adjustSearch:"请尝试调整搜索或筛选条件",noAgentType:"暂无 {{type}}",noGeneralAgents:"暂无通用智能体",createGeneralAgentDescription:"创建一个通用智能体,开始构建和对话",createAgentType:"创建{{type}}",createAgent:"创建智能体",loadingMore:"正在加载更多智能体",scrollForMore:"继续下滑加载更多",allLoaded:"已加载全部智能体",deleteDraftTitle:"删除草稿?",deleteDraftDescription:"删除后将无法恢复“{{name}}”。",deleteDraft:"删除草稿",loadGeneralAgents:"加载通用智能体",loadAgentType:"加载 {{type}}",compatibility:{checking:"正在请求 Runtime /list-apps,以确认该智能体是否支持 Studio 对话。",empty:"Runtime /list-apps 未返回可用的 Agent,暂时无法连接对话。",supported:"Runtime 支持 Studio 对话。",unknownError:"Runtime /list-apps 请求失败,未返回可识别的错误信息。"},sandboxStatus:{ready:"就绪",wakeable:"已休眠",creating:"创建中",starting:"启动中",initializing:"启动中",pending:"等待中",running:"运行中",failed:"异常",error:"异常",stopped:"已停止",expired:"已过期",deleting:"删除中",deleted:"已删除",unknown:"未知状态"},wakingHint:"正在唤醒智能体,可能需要一些时间。",mpaCreate:{maxInstance:"最大实例数",maxInstanceHelp:"默认 {{maximum}},为 Runtime 自动扩容的实例数上限。",maxInstanceInvalid:"最大实例数必须为大于或等于 1 的整数。",name:"名称",namePlaceholder:"例如 test-agent",nameHelp:"作为 Runtime 名称,支持 4–64 位字母、数字、下划线或连字符。",stepsLabel:"创建步骤",steps:{basics:"基本信息",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"数据库"},next:"下一步",previousStep:"上一步",pgDescription:"选择已有的 PostgreSQL 实例。创建流程会在该实例中准备智能体的独立业务库。",pgSplitDescription:"使用已配置的业务 PG Workspace。多个智能体共用此 Workspace,每个智能体拥有独立业务库。共享资源记录单独存放在 mpa_admin_workspace / mpa_admin_db,由管理员配置。",pgConsoleByteplus:"前往 BytePlus AIDAP 创建或查看 PG Workspace",pgConsole:"前往火山引擎 AIDAP 创建或查看 PG Workspace",pgHost:"PG 主机地址",pgPort:"PG 端口",pgInvalid:"请填写有效的 PG 主机地址和端口。",pgCredentials:"PG 连接账号和密码由部署服务配置;主机和端口须与服务端配置一致。",openvikingDescription:"可选。三项全部填写才启用 OpenViking;全部留空则不向新智能体注入 OpenViking 配置。",openvikingConsoleByteplus:"前往 BytePlus 查看 OpenViking 资源",openvikingConsole:"前往火山引擎查看 OpenViking 资源",openvikingUrl:"OpenViking 服务地址",openvikingResourceId:"OpenViking 资源 ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"请同时填写有效的 HTTPS 服务地址、资源 ID 和 API Key,或全部留空。",openvikingCredentials:"API Key 仅用于本次创建,不保存到浏览器草稿;刷新页面后需重新填写。",tosTitle:"会话输出存储",tosDescription:"可选。选择存储桶,持久保存每个会话的输出目录,使用沙箱 IAM Role 鉴权。未选桶时文件保存在沙箱本地目录。",tosBucket:"TOS 存储桶",tosInvalid:"请选择以 agentkit-platform- 开头的可用存储桶。",tosCredentials:"创建时为共享角色追加所选桶的会话输出访问权限,使用该角色的其他运行时和沙箱也将获得相同权限。",tosDisable:"清除桶选择",tosBucketUnavailable:"当前部署账号或地域无法使用该桶,请从列表选择存储桶后重试。",runtimeImage:"MPA 镜像",workerImage:"Worker 镜像",imageDefault:"留空使用配置文件中的默认镜像",imageInvalid:"请输入有效的镜像地址,不要包含网址、空格或登录凭据。",title:"创建 MPA 智能体",agentId:"智能体 ID",description:"描述",region:"部署地域",plan:"创建计划",sharedResources:"准备或复用账号共享 VPC、子网和 APIG 消息网关",agentResources:"准备独立业务库、技能空间和执行环境,部署智能体",readiness:"检查网关和智能体就绪状态,成功后加入列表",checking:"正在检查创建配置…",configured:"创建配置已就绪。提交后会检查云资源并开始准备。",notConfigured:"尚未配置创建所需的资源参数,请联系管理员配置后重试。",loadFailed:"检查创建配置失败,请重试。",reload:"重新检查",submit:"开始创建",retry:"重试创建",newAgent:"新建另一个智能体",newAgentDescription:"新建另一个智能体将开启可编辑的新请求,替换当前恢复草稿,但不会取消旧任务。旧任务仍在运行时,请等待其结束后再提交。",close:"关闭",cancel:"取消创建",confirmCancel:"确认取消",cancelDescription:"取消后会停止后续步骤。已创建的数据库、技能空间、网关和其他已登记资源会保留,可使用同一智能体 ID 重试。",background:"关闭窗口后创建会继续。再次打开可查看进度。",pollFailed:"暂时无法获取进度,正在重新连接。请勿重复创建其他智能体。",iamPermissionDenied:"部署服务没有准备运行角色所需的 IAM 权限,请联系管理员授权后重试。",iamTrustConflict:"运行角色的信任关系不符合要求,请管理员检查对 VeFaaS 和 APIG 的授权后重试。",iamPolicyConflict:"运行角色所需的同名权限策略内容冲突,请管理员检查后重试。",iamOwnershipConflict:"运行角色与当前部署账号不匹配,请管理员检查后重试。",iamTemporaryFailure:"IAM 请求在重试后仍暂时失败或超时,请检查 Studio 网络连接及 IAM 服务后,用同一智能体 ID 重试。",iamVerificationFailed:"尚未确认运行角色的权限已就绪,请检查 IAM 服务及策略可用性后重试。",iamConfigurationConflict:"自动准备运行角色仅支持默认 MPA 角色,请检查服务端创建配置。",creationFailed:"当前步骤未完成,请检查对应资源、服务端配置及权限后,用同一智能体 ID 重试。",configurationChanged:"此智能体的创建配置已与上次提交不一致。请恢复原配置后重试,或新建另一个智能体请求。",cancelFailed:"取消请求失败,请重新查询进度后重试。",cancelled:"创建已取消,已登记资源保留供重试。",timeout:"创建超时,已登记资源保留。请检查对应资源后重试。",interrupted:"创建任务中断。请用同一智能体 ID 重试以恢复已登记资源。",skillSpace:"技能空间",states:{running:"正在创建",cancelling:"正在取消",succeeded:"创建成功",failed:"创建失败",cancelled:"已取消"},stages:{queued:"等待开始",iam_role:"准备运行角色",checking:"检查账号与配置",network:"准备 VPC 和子网",gateway:"准备 APIG 和 IM Gateway",database:"准备业务数据库",skills:"准备技能空间",worker:"准备执行环境",deploying:"准备数据库、技能空间和 Runtime",verifying:"等待智能体就绪",admin_workspace:"准备管理 PG Workspace",business_workspace:"准备业务 PG Workspace",admin_database:"初始化共享管理库",openviking:"准备 OpenViking 库",openviking_key:"准备 OpenViking 访问凭证"},back:"继续创建",pgAutoDescription:"使用 VeADK 部署账号自动创建或复用两个 PG Workspace:mpa_admin_workspace / mpa_admin_db 存放共享资源记录,业务 Workspace 供多个智能体共用,每个智能体拥有独立业务库。无需填写 PG 连接信息,提交创建后开始准备。",pgPerAgentDescription:"创建流程会复用共享管理 Workspace,并为此智能体准备独立的业务 PG Workspace 和数据库。已有任务重试沿用原数据库。",pgAidbDescription:"创建流程会复用共享管理 Workspace,并为此智能体准备独立业务 Workspace 和 aidb 数据库。业务 Workspace 使用 mpa_agent_<智能体名称> 命名。已有任务重试沿用原数据库。",runtimeNameTaken:"该名称已被 Runtime、沙箱模板、业务 Workspace 或正在创建的任务占用,请更换名称。",runtimeNameCheckFailed:"暂时无法检查名称,请确认资源查询权限和网络后重试。",pgModeChanged:"此创建任务使用旧的 PG 配置,不能直接切换为自动模式重试。请联系管理员确认已有资源和任务后重新创建。",pgMigrationRequired:"检测到旧共享注册库。请先将共享资源记录迁移到 mpa_admin_workspace / mpa_admin_db,并完成现有 Runtime 的注册库地址切换;完成后点击“重新检查”。",openvikingAutoDescription:"将为此智能体创建独立 OpenViking 库,使用默认模型并自动准备连接配置。",openvikingAutoByteplusDescription:"将在 BytePlus 柔佛为此智能体创建个人版 OpenViking 库,并自动准备连接配置。重试将复用已登记的库。",openvikingAutoByteplusRequirements:"使用 MPA 的 ModelArk API Key 和管理员配置的 VLM、Embedding 推理接入点。个人库只有 default 用户;Runtime 镜像须适配该模式及海外数据面后,才能使用记忆功能。取消或删除智能体后,库会保留。",openvikingModelEndpointsInvalid:"请联系管理员在 Studio 服务端配置有效的 OV_VLM_ENDPOINT_ID 和 OV_EMBEDDING_ENDPOINT_ID 后重试。",openvikingAutoBilling:"企业版按量计费,建库成功后开始计费。重试此智能体将复用已登记的库。",openvikingPermissionDenied:"无权准备 OpenViking。请检查部署账号的建库、查询和获取 API Key 权限后重试。",openvikingConfigurationConflict:"OpenViking 的归属或配置与此智能体不一致,请核对登记的库后重试。",openvikingCreateUnknown:"OpenViking 创建结果尚未确认。请管理员核对云端库并补齐登记的资源 ID 后重试;不会自动重复建库。",openvikingNotReady:"OpenViking 仍在初始化,请稍后重试此智能体,将继续使用同一个库。",openvikingResourceFailed:"OpenViking 初始化失败,请在控制台检查库状态及模型配置后重试。",openvikingResourceMissing:"未找到已登记的 OpenViking 库或默认用户,请检查绑定及资源状态后重试。",openvikingModelConfigurationRejected:"平台拒绝了默认模型配置或建库参数,请检查 OpenViking 模型可用性及账号开通情况后重试。",openvikingUnavailable:"暂时无法连接 OpenViking,请检查服务及网络后重试。",openvikingInvalidResponse:"OpenViking 返回的配置不完整或无效,请检查库及默认用户后重试。",openvikingQuotaExceeded:"OpenViking 配额不足或请求过于频繁,请调整配额或稍后重试此智能体。"}},w1e={library:"技能库",skill:"技能",skills:"技能",skillSpace:"技能空间",sandboxNotConfigured:"管理员未配置 Dev Sandbox",adminNotConfigured:"管理员未配置",totalItems:"共 {{count}} 项",cannotLoadSpaces:"无法加载技能空间",someSpacesFailed:"部分技能空间加载失败",degradedRelationWarning:"部分关联异常,已恢复可读取技能",downloadZip:"下载 ZIP",optimize:"优化",closeSkillDetails:"关闭技能详情",skillId:"技能 ID",allFiles:"完整文件",loadingSkillContent:"正在读取技能内容…",noSkillContent:"该技能暂无 SKILL.md 内容",addSkill:"添加技能",localUpload:"本地上传",localUploadDescription:"选择 ZIP 文件,校验通过后上传到技能空间",autoCreate:"自动创建",autoCreateDescription:"选择模型和风格,通过对话生成技能",createSkill:"创建技能",optimizeNamed:"优化 {{name}}",deleteSkillConfirm:"确定删除整个 Skill“{{name}}”吗?此操作会影响所有引用它的空间。",deleteSpaceConfirm:"确定删除 Skill 空间“{{name}}”吗?请先确认空间中的技能已删除。",manageSpaceDescription:"管理空间中的技能并创建新的版本",backToSpaces:"返回技能空间列表",overview:"概览",skillCount:"技能数量",skillCountValue_one:"{{count}} 技能",skillCountValue_other:"{{count}} 技能",updatedAt:"更新时间",skillsInSpace:"{{name}}中的技能",searchSkills:"搜索技能",cannotLoadSkills:"无法加载技能",noMatchingSkills:"没有匹配的技能",noSkills:"暂无技能",tryAnotherName:"请尝试搜索其他名称",emptySkillsDescription:"本地上传 Skill,或自动创建",actions:"操作",spaceDetails:"技能空间详情",editSpace:"编辑空间",deleteSpace:"删除空间",searchSpaces:"搜索技能空间",spaceList:"技能空间列表",noMatchingSpaces:"没有匹配的技能空间",createSpace:"新建技能空间",newSpace:"新建空间",loadingMoreSpaces:"正在加载更多技能空间",scrollForMore:"继续下滑加载更多",allSpacesLoaded:"已加载全部技能空间",errors:{loadSpaces:"读取技能空间失败,请稍后重试",loadSkills:"读取技能失败,请稍后重试",loadSkillDetails:"读取技能详情失败,请稍后重试",deleteSkill:"删除 Skill 失败",deleteSpace:"删除 Skill 空间失败",downloadSkill:"下载 Skill 失败"},status:{active:"可用",available:"可用",creating:"创建中",disabled:"已停用",enabled:"已启用",failed:"异常",inactive:"未启用",pending:"等待中",published:"已发布",ready:"就绪",released:"已发布",running:"运行中",success:"正常",unavailable:"不可用",unreleased:"未发布",updating:"更新中",unknown:"未知"},sharedSpace:"企业共享空间",sharedDescription:"面向企业全员开放的技能,由管理员统一发布和维护",sharedVisibility:"全员可见",sharedPreparing:"正在准备共享空间",sharedLoadFailed:"共享空间加载失败",sharedEmpty:"暂无共享技能,管理员发布后会显示在这里",requestPublication:"申请公开",reviewSubmitting:"提交中…",reviewSubmitted:"已申请",reviewFailed:"申请公开失败",reviewStatusFailed:"审核状态加载失败",reviewRetry:"重新申请",reviewPending:"待审核",reviewApproving:"发布中",reviewApproved:"已公开",reviewReturned:"已退回",reviewHistory:"审核记录",skillDetailSections:"技能详情内容",versions:{title:"版本管理",refresh:"刷新",uploading:"上传中…",upload:"上传新版本",close:"关闭",hint:"新版本不会替换已公开版本,审核通过后才会公开;ZIP 中的技能名称需与原技能一致",loading:"正在加载版本…",loadFailed:"无法加载版本",filesFailed:"无法加载版本文件",uploadFailed:"上传新版本失败",submitFailed:"提交申请失败",retry:"重试",empty:"暂无版本",current:"当前版本",notSubmitted:"未申请公开",submitting:"提交中…",submit:"申请公开",processing:"版本状态:{{status}}",filesLoading:"正在加载文件…",filesEmpty:"暂无文件",history:"历史审核记录",shared:"已公开"},author:"作者",authorName:"作者:{{name}}"},k1e={library:"知识库",createBase:"新建知识库",editBase:"编辑知识库",invalidName:"名称必须以字母开头,且只能包含字母、数字和下划线。",nameHelp:"以字母开头,仅支持字母、数字和下划线,最多 48 个字符。",optionalDescription:"描述(可选)",descriptionOnly:"AgentKit 当前仅支持更新知识库描述。",previewWeb:"预览网页内容",addData:"添加数据",openOriginalWeb:"打开原网页",backToEdit:"返回修改",confirmAdd:"确认添加",source:"知识来源",image:"图片",documentFile:"文档文件",webPage:"在线网页",webUrl:"网页 URL",generatingWebPreview:"正在抓取网页并生成 Markdown 预览",selectFile:"选择知识文件",selectOrDropFile:"选择文件或拖拽到这里",selectedFile:"{{size}} · 点击可重新选择",imageFileHelp:"支持 PNG、JPG 和 JPEG,单个文件不超过 200 MB",documentFileHelp:"支持 PDF、PPTX、DOCX、XLSX 和 TXT,单个文件不超过 200 MB",uploadingFile:"正在上传文件并添加到知识库",optionalName:"名称(可选)",optionalType:"类型(可选)",generatePreview:"生成预览",uploadFile:"上传文件",editMetadata:"编辑知识 Metadata",knowledge:"知识",field:"字段",value:"值",backToList:"返回知识库列表",metadataJson:"元数据(JSON)",provider:"服务提供方",knowledgeId:"知识库 ID",project:"项目",creator:"创建者",data:"数据",deleteInvalidAssociation:"删除失效关联",noData:"这个知识库还没有数据",addFirstData:"添加第一项数据",format:"格式",size:"大小",searchData:"搜索数据",searchLibraryData:"搜索知识库数据",associationInvalid:"关联已失效",providerMissing:"底层 Provider 知识库已不存在",noMatchingData:"没有匹配的数据",loadingMoreData:"正在加载更多数据",retryLoading:"重试加载",details:"知识库详情",searchBases:"搜索知识库",someBasesFailed:"部分知识库暂时无法加载,已展示其余可用内容。",noMatchingBases:"没有匹配的知识库",noManagePermission:"您没有管理此知识库的权限",loadingMoreBases:"正在加载更多知识库",deleteBaseTitle:"删除知识库?",deleteBaseDescription:"将删除 {{name}} 的 AgentKit 关联;如果它由 Studio 创建,也会同时删除 Provider 资源。此操作无法撤销。",deleteDocumentTitle:"删除知识?",deleteDocumentDescription:"将从 Provider 知识库中删除 {{name}},此操作无法撤销。",preview:{processingTitle:"数据正在处理中",processingDetail:"知识库完成解析后即可预览,请稍后重新加载。",failedTitle:"数据解析失败",failedDetail:"请检查源文件或网页地址后重新添加,也可以重新加载最新状态。",noParsedTitle:"暂时没有可预览的解析内容",noParsedDetail:"此类文件会在知识库完成解析后显示文本、表格或页面图片。",noMediaTitle:"暂时没有可预览的媒体内容",noMediaDetail:"知识库尚未返回可访问的媒体预览,请稍后重新加载。",noDataTitle:"暂无可预览的数据内容",noDataDetail:"知识库尚未返回解析结果,请稍后重新加载。",attachmentError:"附件无法预览,请稍后重试。",imageAlt:"知识数据图片",audioUnsupported:"当前浏览器不支持音频预览。",videoUnsupported:"当前浏览器不支持视频预览。",namedPdf:"{{name}} PDF 预览",pdf:"PDF 预览",openPdf:"无法显示时,在新窗口打开 PDF",fileUnsupported:"当前格式暂不支持直接在线预览,已优先显示解析后的内容。",openOriginalFile:"打开原文件",loading:"正在加载数据预览",openOriginalHint:"您可以打开原网页查看来源内容。",chunk:"片段 {{index}}",loadingMore:"正在加载更多",loadMore:"加载更多"},errors:{fileTooLarge:"单个文件不能超过 200 MB",invalidImageType:"请选择 PNG、JPG 或 JPEG 图片",invalidDocumentType:"请选择 PDF、PPTX、DOCX、XLSX 或 TXT 文件",createBase:"创建知识库失败",updateBase:"更新知识库失败",metadataObject:"Metadata 必须是 JSON 对象",metadataFormat:"Metadata 格式错误",noWebPreview:"网页没有可预览的 Markdown 内容",addWeb:"添加网页失败",previewWeb:"生成网页预览失败",uploadFile:"上传文件失败",updateDocument:"更新知识失败",loadPreview:"加载数据预览失败",loadMoreBases:"加载更多知识库失败",loadBases:"加载知识库失败",loadMoreData:"加载更多数据失败",loadData:"加载数据失败",deleteBase:"删除知识库失败",deleteDocument:"删除知识失败"}},O1e={bindingType:"Bot 类型",bindingType_shared:"共享",bindingType_private:"私有",bindingTypeHelp_shared:"各会话相互隔离。",bindingTypeHelp_private:"私聊可召回同 Bot 的历史,包括群聊。",title:"飞书渠道",refresh:"刷新",loading:"正在加载渠道配置…",unsupported:"此 Runtime 不支持渠道管理,请升级 MPA 镜像。",unauthorized:"渠道管理需要 Studio 管理员身份及有效的 Runtime 凭据。",configurationError:"渠道管理配置不完整,请检查 Runtime 元数据及加密密钥。",requestFailed:"渠道请求失败,请检查 Runtime 连接后重试。",bound:"已绑定:{{name}}",unbound:"尚未绑定飞书机器人。",guidance:"私聊使用独立会话。在已授权群内 @ 当前机器人即可对话。",keyRequired:"绑定前请在 Runtime 配置持久的 CHANNEL_STATE_ENCRYPTION_KEY。",gateway:"消息网关",route:"入站路由",delivery:"回复投递",configured:"已配置",missing:"未配置",delivery_not_observed:"尚未观测",delivery_delivered:"已投递",delivery_retrying:"重试中",missingConfig:"缺少 Runtime 配置:{{fields}}",bind:"扫码绑定",newQr:"重新生成二维码",unbind:"解除绑定",confirmUnbind:"确认解绑此机器人?解绑后将停止接收新消息。",qrAlt:"机器人绑定二维码",openQr:"打开授权页面",uncertain:"注册过程已中断。重新开始前,请检查机器人绑定与 Gateway 状态。",bindingFailed:"绑定失败,请检查 Gateway 配置后重试。",chatId:"允许的群 ID",scope:"群会话策略",saveGroup:"保存群权限",noGroups:"尚未授权任何群。私聊无需群权限。",edit:"编辑",remove:"移除",removeGroup:"移除 {{name}}",scope_group_sender:"按发言人隔离",scope_group:"全群共享",scope_group_topic_sender:"按话题和发言人隔离",scope_group_topic:"按话题共享",status_PENDING:"等待扫码",status_SCANNED:"已扫码,等待授权",status_AUTHORIZED:"已授权,准备注册",status_REGISTERING:"正在注册机器人",status_BOUND:"机器人已绑定",status_FAILED:"绑定失败",status_EXPIRED:"二维码已过期",workspaceTitle:"消息渠道",workspaceDescription:"连接消息平台,让用户直接与此智能体对话,并管理访问权限。",provider_feishu:"飞书",provider_wecom:"企业微信",provider_dingtalk:"钉钉",comingSoon:"暂未开放",unavailableDescription:"{{name}}的绑定与消息配置暂未开放。",runtimeRequired:"请先将此智能体部署到 Runtime,再配置消息渠道。",bindingTitle:"机器人绑定",connected:"已绑定",notBound:"未绑定",gatewayDescription:"用于接收渠道消息的网关配置。",routeDescription:"将渠道消息转发给当前智能体的路由配置。",deliveryDescription:"实际观测到的回复投递状态,完成配置不代表已成功投递。",groupsTitle:"群聊权限",groupsDescription:"添加允许访问此智能体的群。",providerBindingTitle:"绑定{{name}}",providerUnbound:"绑定{{name}}机器人,让用户通过消息与此智能体对话。",qrGuidance:"使用{{name}}扫码授权,Runtime 将保存机器人凭据并配置消息网关。",wecomGuidance:"使用企业微信扫码授权,或手动填写 Bot ID 和 Secret 绑定已有机器人。",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"绑定机器人",wecomScan:"扫码绑定",wecomAuthorizing:"等待企业微信授权…",cancelAuthorization:"取消授权",wecomPopupBlocked:"授权窗口被浏览器拦截,请允许弹窗后重试。",wecomAuthCancelled:"已取消企业微信授权,可以重新扫码。",wecomAuthTimeout:"企业微信授权已超时,请重新扫码。",wecomInvalidResult:"授权结果缺少 Bot ID 或 Secret,请重新授权或手动填写。",wecomAuthFailed:"企业微信授权失败,请重试或手动填写凭据。",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"当前镜像尚不支持{{name}}手动配置,请升级后使用;仍可使用极速配置。",pairingTitle:"消息渠道扫码配对",feishuPairingDescription:"如果已有连接机器人,飞书扫码并绑定成功后原有机器人会被替换,可选绑定存量机器人或新建机器人。",generatingQr:"正在生成配对二维码…",dingtalkGuidance:"使用钉钉扫码授权,或手动填写 Client ID 和 Client Secret 绑定已有机器人。",wecomPairingDescription:"将在企业微信授权窗口中重新扫码配对。新机器人绑定成功后会替换当前连接;取消授权或绑定失败不会解绑原机器人。",configurationMethod:"配置方式",quickSetup:"极速配置",manualSetup:"手动配置",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"填写已有{{name}}机器人的应用凭据,连接到当前智能体。",manualReplacement:"绑定成功后将替换当前机器人;取消或绑定失败不会解除现有绑定。",accountsTitle:"飞书机器人",account:"机器人",selectAccount:"请选择机器人",accountEnabled:"已启用",accountDisabled:"已停用",addAccount:"添加机器人",cancelAddAccount:"取消添加",enableAccount:"启用机器人",disableAccount:"停用机器人",noAccounts:"尚未绑定飞书机器人。",accountsFailed:"读取机器人列表失败,请重试。",accountConflict:"机器人账号存在歧义或配置冲突,请刷新并选择机器人。",multiBotPairingDescription:"绑定新的飞书应用会添加机器人;绑定相同 App ID 会更新对应机器人。",provider_lark:"Lark",larkPairingDescription:"使用 Lark 扫码授权机器人。当前配置成功前,已有机器人仍保持绑定。",larkAccountsTitle:"Lark 机器人",noLarkAccounts:"尚未绑定 Lark 机器人。"},YVe={common:t1e,agentKitPromo:n1e,systemInfo:i1e,agentWorkspace:r1e,environmentCenter:s1e,deploymentSelect:a1e,deploymentError:o1e,studioBuildProgress:l1e,cloudEnvironment:c1e,githubCicd:u1e,feishuDeployment:d1e,deploymentResources:f1e,studioUpdate:h1e,projectPreview:p1e,workspace:m1e,resourceCollection:g1e,skillSourcePicker:b1e,composer:y1e,agentSelector:v1e,myAgents:x1e,skillCenter:w1e,knowledge:k1e,channels:O1e},ZVe=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:n1e,agentSelector:v1e,agentWorkspace:r1e,channels:O1e,cloudEnvironment:c1e,common:t1e,composer:y1e,default:YVe,deploymentError:o1e,deploymentResources:f1e,deploymentSelect:a1e,environmentCenter:s1e,feishuDeployment:d1e,githubCicd:u1e,knowledge:k1e,myAgents:x1e,projectPreview:p1e,resourceCollection:g1e,skillCenter:w1e,skillSourcePicker:b1e,studioBuildProgress:l1e,studioUpdate:h1e,systemInfo:i1e,workspace:m1e},Symbol.toStringTag,{value:"Module"})),S1e="用户管理",E1e="{{count}} 位成员",C1e="用户",A1e="角色",T1e="账号状态",_1e="最近登录",j1e="操作",N1e="更改角色",R1e="关闭",I1e="保存角色",P1e="正在保存…",D1e="取消",M1e="返回",L1e="用户池",$1e="火山引擎 Identity",F1e="搜索姓名、邮箱或用户 ID",B1e="搜索",U1e="筛选角色",Q1e="全部角色",z1e="刷新",V1e="正在读取用户…",H1e="更新于 {{time}}",q1e="已将 {{name}} 设置为{{role}}",W1e="重试",K1e="你",G1e="初始超级管理员",X1e="初始超级管理员受保护,不能在此降级",Y1e="保存后,对方刷新 Studio 即可使用新的权限",Z1e="角色需要重新确认",J1e="没有匹配的用户",eke="尝试其他关键词或角色",tke="用户登录或加入当前用户池后会显示在这里",nke="共 {{count}} 位用户",ike="上一页",rke="下一页",ske="尚未登录",ake="未提供",oke={super_admin:"超级管理员",admin:"管理员",developer:"开发者",user:"普通用户"},lke={super_admin:"管理所有资源,并管理用户和分配角色",admin:"管理 Studio 资源",developer:"开发智能体并管理自己的资源",user:"使用智能体和个人功能"},cke={EXTERNAL_PROVIDER:"正常",CONFIRMED:"正常",NORMAL:"正常",ENABLED:"正常",ACTIVE:"正常",UNCONFIRMED:"待验证",DISABLED:"已停用",FORBIDDEN:"已禁用",LOCKED:"已锁定",SUSPENDED:"已暂停",FORCE_CHANGE_PASSWORD:"需要修改密码"},uke={request_failed:"请求未完成,请刷新列表确认当前状态后重试",invalid_response:"用户服务返回异常,请刷新后重试",identity_unavailable:"暂时无法访问 Identity,请稍后重试或检查服务权限",identity_resource_missing:"用户或用户池已不存在,请刷新列表",super_administrator_required:"只有超级管理员可以管理用户",sign_in_required:"请登录后重试",user_not_in_pool:"当前账号不属于此用户池",user_disabled:"当前账号已停用",protected_administrator:"不能降低初始超级管理员的权限",cannot_demote_self:"不能降低自己的超级管理员权限",role_change_conflict:"角色已发生变化,请关闭弹窗并刷新列表后重试",cross_origin_request:"请在当前 Studio 页面内修改角色"},JVe={title:S1e,memberCount:E1e,user:C1e,role:A1e,status:T1e,lastLogin:_1e,actions:j1e,changeRole:N1e,close:R1e,save:I1e,saving:P1e,cancel:D1e,back:M1e,pool:L1e,volcengineIdentity:$1e,searchPlaceholder:F1e,search:B1e,filterRole:U1e,allRoles:Q1e,refresh:z1e,loading:V1e,updatedAt:H1e,saved:q1e,retry:W1e,you:K1e,initialAdministrator:G1e,protectedExplanation:X1e,effectiveAfterRefresh:Y1e,roleConflict:Z1e,noUsers:J1e,tryAnotherSearch:eke,poolEmpty:tke,resultCount:nke,previous:ike,next:rke,neverLoggedIn:ske,unknown:ake,roles:oke,descriptions:lke,states:cke,errors:uke},eHe=Object.freeze(Object.defineProperty({__proto__:null,actions:j1e,allRoles:Q1e,back:M1e,cancel:D1e,changeRole:N1e,close:R1e,default:JVe,descriptions:lke,effectiveAfterRefresh:Y1e,errors:uke,filterRole:U1e,initialAdministrator:G1e,lastLogin:_1e,loading:V1e,memberCount:E1e,neverLoggedIn:ske,next:rke,noUsers:J1e,pool:L1e,poolEmpty:tke,previous:ike,protectedExplanation:X1e,refresh:z1e,resultCount:nke,retry:W1e,role:A1e,roleConflict:Z1e,roles:oke,save:I1e,saved:q1e,saving:P1e,search:B1e,searchPlaceholder:F1e,states:cke,status:T1e,title:S1e,tryAnotherSearch:eke,unknown:ake,updatedAt:H1e,user:C1e,volcengineIdentity:$1e,you:K1e},Symbol.toStringTag,{value:"Module"})),dke="网站集成",fke="将 AgentKit Runtime 以悬浮聊天窗口嵌入网站",hke="返回自动化列表",pke="添加网站",mke="正在加载 Runtime",gke="选择 Runtime",bke="网站域名",yke="例如 xxxx.com 或 localhost:5173",vke="正在生成",xke="生成 Token",wke="已添加网站",kke="{{count}} 个",Oke="{{count}} 个",Ske="正在加载网站集成",Eke="还没有网站集成",Cke="选择 Runtime 并输入网站域名即可生成 Token",Ake="引入方法",Tke="将下面代码放到网页的 body 结束标签前",_ke="已复制",jke="复制代码",Nke="添加网站后会在这里生成引入代码。",Rke="确定删除 {{domain}} 的网站集成吗?",Ike={load:"加载网站集成失败",create:"创建网站集成失败",delete:"删除网站集成失败",noConversationalAgent:"该 Runtime 暂未发现可对话的 Agent"},Pke={requestFailed:"请求失败 ({{status}})",greeting:"您好,有什么可以帮您?",sessionFailed:"无法建立对话会话",unauthorized:"当前网站未获得对话授权",conversationFailed:"对话请求失败,请稍后重试",open:"打开智能体对话",close:"关闭智能体对话",panelLabel:"智能体对话面板",assistant:"智能体助手",online:"在线对话"},tHe={title:dke,description:fke,backToAutomations:hke,addWebsite:pke,loadingRuntime:mke,selectRuntime:gke,websiteDomain:bke,domainPlaceholder:yke,generating:vke,generateToken:xke,addedWebsites:wke,websiteCount_one:kke,websiteCount_other:Oke,loadingIntegrations:Ske,delete:"删除",emptyTitle:Eke,emptyDescription:Cke,embedMethod:Ake,embedInstructions:Tke,copied:_ke,copyCode:jke,embedHint:Nke,confirmDelete:Rke,errors:Ike,widget:Pke},nHe=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:pke,addedWebsites:wke,backToAutomations:hke,confirmDelete:Rke,copied:_ke,copyCode:jke,default:tHe,description:fke,domainPlaceholder:yke,embedHint:Nke,embedInstructions:Tke,embedMethod:Ake,emptyDescription:Cke,emptyTitle:Eke,errors:Ike,generateToken:xke,generating:vke,loadingIntegrations:Ske,loadingRuntime:mke,selectRuntime:gke,title:dke,websiteCount_one:kke,websiteCount_other:Oke,websiteDomain:bke,widget:Pke},Symbol.toStringTag,{value:"Module"})),Dke={types:{all:"全部类型",document:"文档",image:"图片",video:"视频"},previewArtifact:"预览 {{name}}",moreActions:"更多操作 {{name}}",actionMenu:"{{name}} 操作",download:"下载",downloading:"下载中",edit:"编辑信息",delete:"删除产物",previewFailed:"无法预览“{{name}}”:{{message}}",downloadStarted:"已开始下载 {{name}}",downloadFailed:"无法下载“{{name}}”:{{message}}",updated:"已更新 {{name}}",deleted:"已删除 {{name}}",deleteFailed:"无法删除“{{name}}”:{{message}}",typeFilter:"产物类型",searchAria:"搜索产物",searchPlaceholder:"搜索产物或会话",retry:"重试",close:"关闭",listAria:"产物列表",loadFailed:"产物加载失败",loadDetailFallback:"请检查存储配置后重试。",reload:"重新加载",noMatch:"没有找到匹配的产物",noArtifacts:"您还没有任何产物",searchHint:"请尝试搜索其他名称或切换类型",emptyHint:"聊天中生成的产物会自动显示在这里",columns:{name:"名称",source:"来源",updatedAt:"修改时间",actions:"操作"},loadingMore:"正在加载更多产物",unknownTime:"时间未知",preview:{close:"关闭预览",meta:"{{type}} / 版本 {{version}}",loading:"正在加载预览",alt:"{{name}} 预览",loadFailed:"预览加载失败,请稍后重试或下载查看",unsupported:"当前格式暂不支持在线预览,请下载查看",sourceAria:"产物来源",agent:"智能体",session:"会话",tool:"生成工具",createdAt:"生成时间",fileSize:"文件大小",tags:"标签",viewSession:"查看会话"},deleteDialog:{title:"删除产物?",description:"“{{name}}”将从产物库永久删除,聊天记录不会受到影响。",deleting:"删除中",confirm:"删除",close:"关闭删除确认框"},api:{withStatus:"{{message}}({{status}})",listFailed:"读取产物库失败",syncFailed:"同步聊天产物失败",updateFailed:"更新产物失败",deleteFailed:"删除产物失败",downloadFailed:"下载产物失败"}},Mke={unknownSource:"未知来源",unknownCreator:"未知创建者"},Lke={nameRequired:"请输入产物名称",tooManyTags:"标签最多 {{max}} 个",tagTooLong:"单个标签不能超过 {{max}} 个字符",title:"编辑产物信息",subtitle:"内容文件不会被修改",close:"关闭编辑框",name:"名称",description:"描述",descriptionPlaceholder:"补充用途、版本或使用说明",tags:"标签",tagsPlaceholder:"使用逗号分隔,最多 {{max}} 个",cancel:"取消",saving:"保存中",save:"保存"},$ke={change:{added:"新增",modified:"修改",deleted:"删除"},noChanges:"两个版本的源码没有差异",chooseFile:"从左侧选择文件以查看代码",compareTitle:"版本对比",workspaceTitle:"源码工作区",projectFallback:"Agent 项目",switchTheme:"切换源码主题",switchThemeTitle:"切换为{{theme}}主题",themes:{dark:"深色",light:"浅色"},closeWorkspace:"关闭源码工作区",close:"关闭",changedFiles:"变更文件",projectFiles:"项目文件",changes:"变更",files:"文件",openFiles:"打开的文件",noFileSelected:"未选择文件",comparisonDirection:"对比方向",before:"优化前",after:"优化后",loadingEditor:"正在加载编辑器…",changedFileCount_one:"{{count}} 个文件有变更",changedFileCount_other:"{{count}} 个文件有变更",fileCount_one:"{{count}} 个文件",fileCount_other:"{{count}} 个文件",lineCount_one:"{{count}} 行 · UTF-8",lineCount_other:"{{count}} 行 · UTF-8",viewSource:"查看源码",viewSourceAria:"查看和编辑项目源码"},Fke={nav:"搜索",selectAgent:"请选择 Agent",checkingCapabilities:"正在检测 Agent 能力",notMounted:"当前 Agent 未挂载{{label}}",sources:{session:"会话",web:"网络",knowledge:"知识库",memory:"长期记忆"},webDescription:"通过 web_search 工具检索",backendLocal:"本地",failed:"搜索失败:{{message}}",placeholder:{selectAgent:"请先选择 Agent",web:"在网络中检索",knowledge:"在 {{name}} 中检索",knowledgeFallback:"当前 Agent 的知识库",memory:"在 {{name}} 中检索",memoryFallback:"当前用户的长期记忆",session:"在当前 Agent 的会话中检索"},sourceTypeAria:"搜索类型:{{label}}",notSelected:"未选择",sourceType:"搜索类型",selectSource:"选择搜索类型",noAgentHint:"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。",loadingCapabilities:"正在读取当前 Agent 的检索能力…",sourceUnavailable:"当前 Agent 未挂载该数据源",instructions:{web:"输入关键词后回车或点击按钮,通过 web_search 工具检索。",knowledge:"输入问题,检索当前 Agent 挂载的知识库。",memory:"输入线索,检索当前用户跨会话保存的长期记忆。",session:"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"},noResults:"未找到匹配“{{query}}”的结果。",knowledgeFragment:"知识片段 {{index}}",memoryFragment:"记忆片段 {{index}}"},Bke={title:"开发者资源",sections:{documentation:{title:"相关链接",description:"查看开发文档与 AgentKit 常用入口"},bestPractices:{title:"最佳实践",description:"参考开发、调试与部署经验"},showcases:{title:"案例展示",description:"探索 AgentKit 应用案例"}},links:{veadkDocs:"VeADK 文档",cliDocs:"AgentKit CLI 文档",platformDocs:"AgentKit 平台文档",console:"AgentKit 控制台"},articles:{veadkDevelopment:{title:"使用 VeADK 开发并部署智能体",description:"使用 VeADK 构建 Agent,并部署至 AgentKit 智能体运行时。"},cliDevelopment:{title:"使用 AgentKit CLI 开发并部署智能体",description:"通过 AgentKit CLI 创建项目、调试 Agent,并完成部署。"},coverAlt:"{{title}}文章封面"},showcases:{researchAssistant:{title:"多智能体研究助手",description:"由多个专业 Agent 协同完成资料检索、分析和结论整理。"},multimodalAnalysis:{title:"多模态内容分析",description:"在统一会话中理解图片、文档和视频内容。"},customerService:{title:"智能客服工作台",description:"结合知识检索与工具调用处理复杂的客户服务任务。"},webSearch:{title:"联网搜索 Agent",description:"检索实时网页内容,并将信息整理为可追溯的回答。"},a2uiApp:{title:"A2UI 交互应用",description:"让 Agent 根据任务过程生成可交互的前端界面。"},previewAlt:"{{title}}界面预览"}},Uke={title:"资源库",untitledSession:"未命名会话",categoryAria:"资源库分类",regionAria:"区域",tabs:{skills:"技能库",knowledge:"知识库",artifacts:"产物"}},Qke={title:"管理 Agent",subtitle:"列出你有权管理的 AgentKit Runtime",mainAgentOnly:"仅显示主 Agent(控制面信息)。",deleteConfirm:'确定删除 Agent "{{name}}"?该 Runtime 将被永久删除。',regionFilterTitle:"按区域筛选",regionFilterAria:"区域筛选",regionAria:"区域",refresh:"刷新",loading:"加载中…",empty:"暂无你部署的 Agent。",connected:"已连接",connect:"连接到此 Agent",deleteRuntime:"删除该 Runtime",loadingDetail:"读取详情…",agentStructure:"Agent 结构",secretHidden:"敏感值不展示,可通过授权请求直接复制",revealSecret:"{{key}} 的敏感值",copySecret:"复制 {{key}} 的值",copy:"复制",copied:"已复制",copyFailed:"复制失败",notConfigured:"未配置",fields:{model:"模型",description:"描述",status:"状态信息",project:"项目",version:"版本",resources:"资源",memory:"记忆",tool:"工具",knowledge:"知识",mcpToolset:"MCP 工具集",updatedAt:"更新时间"},resource:{memory:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",concurrency:"并发 {{value}}"},environmentVariables:"环境变量",unnamed:"(未命名)"},zke={mainAgent:"主 Agent",subAgent:"子 Agent {{index}}",itemCount_one:"{{count}} 项",itemCount_other:"{{count}} 项",info:"Agent 信息",infoAndTopology:"Agent 信息与设置",loadingInfo:"正在读取 Agent 信息…",unnamedAgent:"未命名 Agent",agentsMd:"AGENTS.md",tools:"工具",toolList:"工具列表",studioTool:"Studio Tool",removeTool:"移除工具 {{name}}",remove:"移除",notConfigured:"未配置",addStudioTool:"添加 Studio 工具",addStudioToolHere:"在此对话中添加 Studio 工具",skills:"技能",skillList:"技能列表",addSkill:"添加技能空间技能",addSkillHere:"向此会话添加技能空间技能",skillMountNextTurn:"挂载的版本将在下一 Turn 开始时冻结。",previewUnsupported:"暂不支持预览",sessionEnvironment:"会话环境",environment:"环境",agentCanvas:"Agent 画布",topology:"结构拓扑",nodeKinds:{agent:"Agent",sandbox:"沙箱","worker-session":"Worker 会话","skill-space":"技能空间",skill:"技能","studio-tool":"Studio 工具",mcp:"MCP",environment:"环境",knowledge:"知识库","sub-agent":"子 Agent"},nodeStatuses:{configured:"已配置",mounted:"已挂载",running:"运行中",paused:"已暂停"},viewCanvasFullscreen:"全屏查看 Agent 画布",viewFullscreen:"全屏查看",executionCanvas:"Agent 执行画布",fullscreenExecutionCanvas:"全屏 Agent 执行画布",closeFullscreenCanvas:"关闭全屏画布",close:"关闭",capabilitiesSubtitle:"能力与协作拓扑",closeInfo:"关闭 Agent 信息",infoUnavailable:"暂时无法读取 Agent 信息。",refresh:"刷新信息",loadingSkills:"正在加载绑定技能…",sessionSkills:"本会话临时技能",noBoundSpace:"当前智能体未绑定技能空间。",noBoundSkills:"绑定的技能空间暂无技能。",loadFailed:"加载失败,请刷新重试。",accessDenied:"无权读取此信息。",documentUnsupported:"当前 Runtime 不支持 Studio 读取 AGENTS.md,请升级 Runtime 镜像。",skillsUnsupported:"当前 Runtime 未提供技能空间绑定信息。",skillsDegraded:"技能信息不完整,请刷新重试。",documentEditHint:"编辑最新版本。保存会发布新版本到此技能空间,可能影响使用它的其他智能体。运行中的会话可能需要等待缓存刷新或新建会话后生效。请保留 frontmatter 中的 name。",documentLoading:"正在加载 SKILL.md…",documentWritable:"可编辑",documentReadOnly:"只读:此空间或当前权限不允许编辑",documentLoadFailed:"无法加载 SKILL.md,请刷新重试。",documentSaveFailed:"未确认保存成功,已保留编辑内容。重试前请重新打开,检查当前版本。",documentConflict:"技能已有新版本。请复制当前修改,再重新打开编辑器,避免覆盖。",discardDocument:"放弃未保存的修改?",keepEditing:"继续编辑",discardChanges:"放弃修改",saveDocument:"保存为新版本"},Vke={mountFailed:"挂载环境失败",closeDialog:"关闭环境弹窗",addTitle:"添加环境",description:"选择当前会话允许 Agent 使用的 Sandbox 环境",closeAdd:"关闭添加环境",searchAria:"搜索环境",searchPlaceholder:"搜索环境名称或能力",availableAria:"可用环境与工作区",loading:"正在读取可用环境…",noMatch:"没有匹配的环境或工作区",workspaces:"工作区",reuseAll:"复用工作区中的全部可用环境",availableEnvironmentCount_one:"{{count}} 个可用环境",availableEnvironmentCount_other:"{{count}} 个可用环境",selectWorkspace:"选择工作区 {{name}}",environments:"环境",includedByWorkspaces:"已由工作区 {{names}} 包含",nameSeparator:"、",selectEnvironment:"选择环境 {{name}}",selectedWorkspaceCount_one:"{{count}} 个工作区",selectedWorkspaceCount_other:"{{count}} 个工作区",coveredEnvironmentCount_one:"{{count}} 个环境",coveredEnvironmentCount_other:"{{count}} 个环境",selectionSummary:"已选择 {{workspaces}},覆盖 {{environments}}",cancel:"取消",mounting:"正在挂载…",confirm:"确认添加",mountedAria:"已挂载环境",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",removeWorkspace:"移除工作区 {{name}}",remove:"移除",removeEnvironment:"移除环境 {{name}}",add:"添加环境",addMore:"添加更多环境",addForSession:"为当前 Session 添加环境",loadingAvailable:"正在加载可用环境…",empty:"暂无可用的 AIO Sandbox 环境。"},Hke={loading:{searching:"正在查找已有环境",creating:"环境初始化中",connecting:"正在连接已有环境"},initializationFailed:"AgentKit CLI 环境初始化失败,当前状态:{{status}}。",sessionExpired:"AgentKit CLI Session 不存在或已过期,请重试。",initializationTimeout:"AgentKit CLI 环境初始化超时,请稍后重试。",nonPersistent:"非持久化环境",recyclingHoursMinutes:"{{hours}} 小时 {{minutes}} 分钟后环境回收",recyclingMinutes:"{{minutes}} 分钟后环境回收",connectionError:`无法连接 Studio 服务,未收到服务端响应。 +原始错误:{{message}}`,unavailable:"连接不可用",requestFailed:"AgentKit CLI 请求失败",retry:"重试",terminalTitle:"AgentKit CLI 终端"},qke={labels:{coding:"智能编程",get_city_weather:"城市天气查询",get_location_weather:"位置天气查询",web_fetch:"网页内容获取",studio_write_artifact:"保存会话产物"},closeDialog:"关闭弹窗",title:"添加 Studio 工具",description:"由 Studio BFF 为 {{agentName}} 的当前会话执行,Runtime 无需预装",close:"关闭添加 Studio 工具",searchAria:"搜索 Studio 工具",searchPlaceholder:"搜索名称或工具标识",availableAria:"可用 Studio 工具",loading:"正在读取 Studio 工具…",noMatch:"没有匹配的 Studio 工具",remove:"移除",add:"添加"},Wke={artifactLibrary:Dke,resourceMetadata:Mke,artifactEdit:Lke,codeBrowser:$ke,search:Fke,developerResources:Bke,library:Uke,manageAgents:Qke,agentTopology:zke,sessionEnvironment:Vke,agentKitCli:Hke,studioTools:qke},iHe=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:Hke,agentTopology:zke,artifactEdit:Lke,artifactLibrary:Dke,codeBrowser:$ke,default:Wke,developerResources:Bke,library:Uke,manageAgents:Qke,resourceMetadata:Mke,search:Fke,sessionEnvironment:Vke,studioTools:qke},Symbol.toStringTag,{value:"Module"})),NU=["zh-CN","en-US"],kA="en-US",Kke="agentkit.studio.locale",rHe={"zh-CN":{dir:"ltr",nativeName:"简体中文"},"en-US":{dir:"ltr",nativeName:"English"}};function OA(e){if(!e)return null;const t=e.trim().replace(/_/g,"-").toLowerCase(),n=NU.find(i=>i.toLowerCase()===t);return n||(t==="zh"||t.startsWith("zh-")?"zh-CN":t==="en"||t.startsWith("en-")?"en-US":null)}function _o(e,t){const n=(e==null?void 0:e.trim())??"";if(!n)return"";const i=new RegExp("\\p{Script=Han}","u").test(n);return t.toLowerCase().startsWith("zh")===i?n:""}function sHe(){if(typeof window>"u")return null;try{return OA(window.localStorage.getItem(Kke))}catch{return null}}function aHe(){if(typeof window>"u")return[];const e=window.navigator;return e?e.languages.length>0?e.languages:e.language?[e.language]:[]:[]}function oHe(){const e=sHe();if(e)return e;for(const t of aHe()){const n=OA(t);if(n)return n}return kA}function lHe(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Kke,e)}catch{}}function Gke(e){typeof document>"u"||(document.documentElement.lang=e,document.documentElement.dir=rHe[e].dir)}const ei=e=>typeof e=="string",eO=()=>{let e,t;const n=new Promise((i,r)=>{e=i,t=r});return n.resolve=e,n.reject=t,n},k5=e=>e==null?"":String(e),cHe=(e,t,n)=>{e.forEach(i=>{t[i]&&(n[i]=t[i])})},uHe=/###/g,FG=e=>e&&e.includes("###")?e.replace(uHe,"."):e,BG=e=>!e||ei(e),PS=(e,t,n)=>{const i=ei(t)?t.split("."):t;let r=0;for(;r{const{obj:i,k:r}=PS(e,t,Object);if(i!==void 0||t.length===1){i[r]=n;return}let s=t[t.length-1],o=t.slice(0,t.length-1),l=PS(e,o,Object);for(;l.obj===void 0&&o.length;)s=`${o[o.length-1]}.${s}`,o=o.slice(0,o.length-1),l=PS(e,o,Object),l!=null&&l.obj&&typeof l.obj[`${l.k}.${s}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${s}`]=n},dHe=(e,t,n,i)=>{const{obj:r,k:s}=PS(e,t,Object);r[s]=r[s]||[],r[s].push(n)},lR=(e,t)=>{const{obj:n,k:i}=PS(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,i))return n[i]},fHe=(e,t,n)=>{const i=lR(e,n);return i!==void 0?i:lR(t,n)},Xke=(e,t,n)=>{for(const i in t)i!=="__proto__"&&i!=="constructor"&&(Object.prototype.hasOwnProperty.call(e,i)?ei(e[i])||e[i]instanceof String||ei(t[i])||t[i]instanceof String?n&&(e[i]=t[i]):Xke(e[i],t[i],n):e[i]=t[i]);return e},Xh=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),hHe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},pHe=e=>ei(e)?e.replace(/[&<>"'\/]/g,t=>hHe[t]):e;class mHe{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const i=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,i),this.regExpQueue.push(t),i}}const gHe=[" ",",","?","!",";"],bHe=new mHe(20),yHe=(e,t,n)=>{t=t||"",n=n||"";const i=gHe.filter(o=>!t.includes(o)&&!n.includes(o));if(i.length===0)return!0;const r=bHe.getRegExp(`(${i.map(o=>o==="?"?"\\?":o).join("|")})`);let s=!r.test(e);if(!s){const o=e.indexOf(n);o>0&&!r.test(e.substring(0,o))&&(s=!0)}return s},dF=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const i=t.split(n);let r=e;for(let s=0;se==null?void 0:e.replace(/_/g,"-"),vHe={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,i;(i=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||i.call(n,console,t)}};class cR{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||vHe,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,i,r){return r&&!this.debug?null:(t=t.map(s=>ei(s)?s.replace(/[\r\n\x00-\x1F\x7F]/g," "):s),ei(t[0])&&(t[0]=`${i}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new cR(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new cR(this.logger,t)}}var sh=new cR;let GP=class{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const r=this.observers[i].get(n)||0;this.observers[i].set(n,r+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}once(t,n){const i=(...r)=>{n(...r),this.off(t,i)};return this.on(t,i),this}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([r,s])=>{for(let o=0;o{for(let o=0;o-1&&this.options.ns.splice(n,1)}getResource(t,n,i,r={}){var u,d;const s=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,o=r.ignoreJSONStructure!==void 0?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;t.includes(".")?l=t.split("."):(l=[t,n],i&&(Array.isArray(i)?l.push(...i):ei(i)&&s?l.push(...i.split(s)):l.push(i)));const c=lR(this.data,l);return!c&&!n&&!i&&t.includes(".")&&(t=l[0],n=l[1],i=l.slice(2).join(".")),c||!o||!ei(i)?c:dF((d=(u=this.data)==null?void 0:u[t])==null?void 0:d[n],i,s)}addResource(t,n,i,r,s={silent:!1}){const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let l=[t,n];i&&(l=l.concat(o?i.split(o):i)),t.includes(".")&&(l=t.split("."),r=n,n=l[1]),this.addNamespaces(n),UG(this.data,l,r),s.silent||this.emit("added",t,n,i,r)}addResources(t,n,i,r={silent:!1}){for(const s in i)(ei(i[s])||Array.isArray(i[s]))&&this.addResource(t,n,s,i[s],{silent:!0});r.silent||this.emit("added",t,n,i)}addResourceBundle(t,n,i,r,s,o={silent:!1,skipCopy:!1}){let l=[t,n];t.includes(".")&&(l=t.split("."),r=i,i=n,n=l[1]),this.addNamespaces(n);let c=lR(this.data,l)||{};o.skipCopy||(i=JSON.parse(JSON.stringify(i))),r?Xke(c,i,s):c={...c,...i},UG(this.data,l,c),o.silent||this.emit("added",t,n,i)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(r=>n[r]&&Object.keys(n[r]).length>0)}toJSON(){return this.data}}var Yke={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,i,r){return e.forEach(s=>{var o;t=((o=this.processors[s])==null?void 0:o.process(t,n,i,r))??t}),t}};const Zke=Symbol("i18next/PATH_KEY");function xHe(){const e=[],t=Object.create(null);let n;return t.get=(i,r)=>{var s;return(s=n==null?void 0:n.revoke)==null||s.call(n),r===Zke?e:(e.push(r),n=Proxy.revocable(i,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Ly(e,t){const{[Zke]:n}=e(xHe()),i=(t==null?void 0:t.keySeparator)??".",r=(t==null?void 0:t.nsSeparator)??":",s=(t==null?void 0:t.enableSelector)==="strict";if(n.length>1&&r){const o=t==null?void 0:t.ns,l=s?Array.isArray(o)?o:o?[o]:null:Array.isArray(o)?o:null;if(l&&(s?l:l.length>1?l.slice(1):[]).includes(n[0]))return`${n[0]}${r}${n.slice(1).join(i)}`}return n.join(i)}const O5=e=>!ei(e)&&typeof e!="boolean"&&typeof e!="number";class uR extends GP{constructor(t,n={}){super(),cHe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=sh.create("translator"),this.checkedLoadedFor={}}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const i={...n};if(t==null)return!1;const r=this.resolve(t,i);if((r==null?void 0:r.res)===void 0)return!1;const s=O5(r.res);return!(i.returnObjects===!1&&s)}extractFromKey(t,n){let i=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let s=n.ns||this.options.defaultNS||[];const o=i&&t.includes(i),l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!yHe(t,i,r);if(o&&!l){const c=t.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:t,namespaces:ei(s)?[s]:s};const u=t.split(i);(i!==r||i===r&&this.options.ns.includes(u[0]))&&(s=u.shift()),t=u.join(r)}return{key:t,namespaces:ei(s)?[s]:s}}translate(t,n,i){let r=typeof n=="object"?{...n}:n;if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r={...r}),r||(r={}),t==null)return"";typeof t=="function"&&(t=Ly(t,{...this.options,...r})),Array.isArray(t)||(t=[String(t)]),t=t.map(N=>typeof N=="function"?Ly(N,{...this.options,...r}):String(N));const s=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:l,namespaces:c}=this.extractFromKey(t[t.length-1],r),u=c[c.length-1];let d=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const f=r.lng||this.language,h=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((f==null?void 0:f.toLowerCase())==="cimode")return h?s?{res:`${u}${d}${l}`,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(r)}:`${u}${d}${l}`:s?{res:l,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(r)}:l;const m=this.resolve(t,r);let g=m==null?void 0:m.res;const b=(m==null?void 0:m.usedKey)||l,v=(m==null?void 0:m.exactUsedKey)||l,y=["[object Number]","[object Function]","[object RegExp]"],w=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,k=r.count!==void 0&&!ei(r.count),S=uR.hasDefaultValue(r),O=k?this.pluralResolver.getSuffix(f,r.count,r):"",A=r.ordinal&&k?this.pluralResolver.getSuffix(f,r.count,{ordinal:!1}):"",E=k&&!r.ordinal&&r.count===0,j=E&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${O}`]||r[`defaultValue${A}`]||r.defaultValue;let T=g;x&&!g&&S&&(T=j);const R=O5(T),C=Object.prototype.toString.apply(T);if(x&&T&&R&&!y.includes(C)&&!(ei(w)&&Array.isArray(T))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const N=this.options.returnedObjectHandler?this.options.returnedObjectHandler(b,T,{...r,ns:c}):`key '${l} (${this.language})' returned an object instead of string.`;return s?(m.res=N,m.usedParams=this.getUsedParamsDetails(r),m):N}if(o){const N=Array.isArray(T),P=N?[]:{},I=N?v:b;for(const D in T)if(Object.prototype.hasOwnProperty.call(T,D)){const _=`${I}${o}${D}`;S&&!g?P[D]=this.translate(_,{...r,defaultValue:O5(j)?j[D]:void 0,joinArrays:!1,ns:c}):P[D]=this.translate(_,{...r,joinArrays:!1,ns:c}),P[D]===_&&(P[D]=T[D])}g=P}}else if(x&&ei(w)&&Array.isArray(g))g=g.join(w),g&&(g=this.extendTranslation(g,t,r,i));else{let N=!1,P=!1;!this.isValidLookup(g)&&S&&(N=!0,g=j),this.isValidLookup(g)||(P=!0,g=l);const D=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&P?void 0:g,_=S&&j!==g&&this.options.updateMissing;if(P||N||_){if(this.logger.log(_?"updateKey":"missingKey",f,u,k&&!_?`${l}${this.pluralResolver.getSuffix(f,r.count,r)}`:l,_?j:g),o){const H=this.resolve(l,{...r,keySeparator:!1});H&&H.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let L=[];const F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&F&&F[0])for(let H=0;H{var z;const Z=S&&U!==g?U:D;this.options.missingKeyHandler?this.options.missingKeyHandler(H,u,q,Z,_,r):(z=this.backendConnector)!=null&&z.saveMissing&&this.backendConnector.saveMissing(H,u,q,Z,_,r),this.emit("missingKey",H,u,q,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&k?L.forEach(H=>{const q=this.pluralResolver.getSuffixes(H,r);E&&r[`defaultValue${this.options.pluralSeparator}zero`]&&!q.includes(`${this.options.pluralSeparator}zero`)&&q.push(`${this.options.pluralSeparator}zero`),q.forEach(U=>{M([H],l+U,r[`defaultValue${U}`]||j)})}):M(L,l,j))}g=this.extendTranslation(g,t,r,m,i),P&&g===l&&this.options.appendNamespaceToMissingKey&&(g=`${u}${d}${l}`),(P||N)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${d}${l}`:l,N?g:void 0,r))}return s?(m.res=g,m.usedParams=this.getUsedParamsDetails(r),m):g}extendTranslation(t,n,i,r,s){var c,u;if((c=this.i18nFormat)!=null&&c.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const d=ei(t)&&(((u=i==null?void 0:i.interpolation)==null?void 0:u.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(d){const m=t.match(this.interpolator.nestingRegexp);f=m&&m.length}let h=i.replace&&!ei(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),t=this.interpolator.interpolate(t,h,i.lng||this.language||r.usedLng,i),d){const m=t.match(this.interpolator.nestingRegexp),g=m&&m.length;f(s==null?void 0:s[0])===m[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${n[0]}`),null):this.translate(...m,n),i)),i.interpolation&&this.interpolator.reset()}const o=i.postProcess||this.options.postProcess,l=ei(o)?[o]:o;return t!=null&&(l!=null&&l.length)&&i.applyPostProcessor!==!1&&(t=Yke.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),t}resolve(t,n={}){let i,r,s,o,l;return ei(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(c=>typeof c=="function"?Ly(c,{...this.options,...n}):c)),t.forEach(c=>{if(this.isValidLookup(i))return;const u=this.extractFromKey(c,n),d=u.key;r=d;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const h=n.count!==void 0&&!ei(n.count),m=h&&!n.ordinal&&n.count===0,g=n.context!==void 0&&(ei(n.context)||typeof n.context=="number")&&n.context!=="",b=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(v=>{var y,w;this.isValidLookup(i)||(l=v,!this.checkedLoadedFor[`${b[0]}-${v}`]&&((y=this.utils)!=null&&y.hasLoadedNamespace)&&!((w=this.utils)!=null&&w.hasLoadedNamespace(l))&&(this.checkedLoadedFor[`${b[0]}-${v}`]=!0,this.logger.warn(`key "${r}" for languages "${b.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),b.forEach(x=>{var O;if(this.isValidLookup(i))return;o=x;const k=[d];if((O=this.i18nFormat)!=null&&O.addLookupKeys)this.i18nFormat.addLookupKeys(k,d,x,v,n);else{let A;h&&(A=this.pluralResolver.getSuffix(x,n.count,n));const E=`${this.options.pluralSeparator}zero`,j=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(n.ordinal&&A.startsWith(j)&&k.push(d+A.replace(j,this.options.pluralSeparator)),k.push(d+A),m&&k.push(d+E)),g){const T=`${d}${this.options.contextSeparator||"_"}${n.context}`;k.push(T),h&&(n.ordinal&&A.startsWith(j)&&k.push(T+A.replace(j,this.options.pluralSeparator)),k.push(T+A),m&&k.push(T+E))}}let S;for(;S=k.pop();)this.isValidLookup(i)||(s=S,i=this.getResource(x,v,S,n))}))})}),{res:i,usedKey:r,exactUsedKey:s,usedLng:o,usedNS:l}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,i,r={}){var s;return(s=this.i18nFormat)!=null&&s.getResource?this.i18nFormat.getResource(t,n,i,r):this.resourceStore.getResource(t,n,i,r)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=t.replace&&!ei(t.replace);let r=i?t.replace:t;if(i&&typeof t.count<"u"&&(r={...r,count:t.count}),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!i){r={...r};for(const s of n)delete r[s]}return r}static hasDefaultValue(t){const n="defaultValue";for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&i.startsWith(n)&&t[i]!==void 0)return!0;return!1}}class zG{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=sh.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(t){if(t=FE(t),!t||!t.includes("-"))return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=FE(t),!t||!t.includes("-"))return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(ei(t)&&t.includes("-")){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(t)}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(i=>{if(n)return;const r=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(r))&&(n=r)}),!n&&this.options.supportedLngs&&t.forEach(i=>{if(n)return;const r=this.getScriptPartFromCode(i);if(this.isSupportedCode(r))return n=r;const s=this.getLanguagePartFromCode(i);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(o=>o===s?!0:!o.includes("-")&&!s.includes("-")?!1:!!(o.includes("-")&&!s.includes("-")&&o.slice(0,o.indexOf("-"))===s||o.startsWith(s)&&s.length>1))}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),ei(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let i=t[n];return i||(i=t[this.getScriptPartFromCode(n)]),i||(i=t[this.formatLanguageCode(n)]),i||(i=t[this.getLanguagePartFromCode(n)]),i||(i=t.default),i||[]}toResolveHierarchy(t,n){const i=this.options.fallbackLng,r=Array.isArray(i)?i.join("|"):i;r!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=r);const s=n===void 0||n===!1||ei(n),o=n===void 0&&typeof this.options.fallbackLng=="function",l=ei(t)&&s&&!o;let c=null;if(l){let h;n===void 0?h="undefined":n===!1?h="boolean:false":h=`string:${n}`,c=`${t.length}:${t}|${h}`}if(c!==null){const h=this.resolveHierarchyCache[c];if(h!==void 0)return h.slice()}const u=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),d=[],f=h=>{h&&(this.isSupportedCode(h)?d.push(h):this.logger.warn(`rejecting language code not found in supportedLngs: ${h}`))};return ei(t)&&(t.includes("-")||t.includes("_"))?(this.options.load!=="languageOnly"&&f(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&f(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&f(this.getLanguagePartFromCode(t))):ei(t)&&f(this.formatLanguageCode(t)),u.forEach(h=>{d.includes(h)||f(this.formatLanguageCode(h))}),c!==null?(this.resolveHierarchyCache[c]=d,d.slice()):d}}const VG={zero:0,one:1,two:2,few:3,many:4,other:5},HG={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class wHe{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=sh.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const i=FE(t==="dev"?"en":t),r=n.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:i,type:r});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let o;try{o=new Intl.PluralRules(i,{type:r})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),HG;if(!t.match(/-|_/))return HG;const c=this.languageUtils.getLanguagePartFromCode(t);o=this.getRule(c,n)}return this.pluralRulesCache[s]=o,o}needsPlural(t,n={}){let i=this.getRule(t,n);return i||(i=this.getRule("dev",n)),(i==null?void 0:i.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,i={}){return this.getSuffixes(t,i).map(r=>`${n}${r}`)}getSuffixes(t,n={}){let i=this.getRule(t,n);return i||(i=this.getRule("dev",n)),i?i.resolvedOptions().pluralCategories.sort((r,s)=>VG[r]-VG[s]).map(r=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r}`):[]}getSuffix(t,n,i={}){const r=this.getRule(t,i);return r?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${r.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,i))}}const qG=(e,t,n,i=".",r=!0)=>{let s=fHe(e,t,n);return!s&&r&&ei(n)&&(s=dF(e,n,i),s===void 0&&(s=dF(t,n,i))),s},WG=e=>e.replace(/\$/g,"$$$$");class KG{constructor(t={}){var n;this.logger=sh.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(i=>i),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:i,useRawValueToEscape:r,prefix:s,prefixEscaped:o,suffix:l,suffixEscaped:c,formatSeparator:u,unescapeSuffix:d,unescapePrefix:f,nestingPrefix:h,nestingPrefixEscaped:m,nestingSuffix:g,nestingSuffixEscaped:b,nestingOptionsSeparator:v,maxReplaces:y,alwaysFormat:w}=t.interpolation;this.escape=n!==void 0?n:pHe,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=r!==void 0?r:!1,this.prefix=s?Xh(s):o||"{{",this.suffix=l?Xh(l):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f?Xh(f):"-",this.unescapeSuffix=this.unescapePrefix?"":d?Xh(d):"",this.nestingPrefix=h?Xh(h):m||Xh("$t("),this.nestingSuffix=g?Xh(g):b||Xh(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=y||1e3,this.alwaysFormat=w!==void 0?w:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,i)=>(n==null?void 0:n.source)===i?(n.lastIndex=0,n):new RegExp(i,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,i,r){var m;let s,o,l;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=g=>{if(!g.includes(this.formatSeparator)){const w=qG(n,c,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(w,void 0,i,{...r,...n,interpolationkey:g}):w}const b=g.split(this.formatSeparator),v=b.shift().trim(),y=b.join(this.formatSeparator).trim();return this.format(qG(n,c,v,this.options.keySeparator,this.options.ignoreJSONStructure),y,i,{...r,...n,interpolationkey:v})};this.resetRegExp(),!this.escapeValue&&typeof t=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(t)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const d=(r==null?void 0:r.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((m=r==null?void 0:r.interpolation)==null?void 0:m.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>g},{regex:this.regexp,safeValue:g=>this.escapeValue?this.escape(g):g}].forEach(g=>{for(l=0;s=g.regex.exec(t);){const b=s[1].trim();if(o=u(b),o===void 0)if(typeof d=="function"){const y=d(t,s,r);o=ei(y)?y:""}else if(r&&Object.prototype.hasOwnProperty.call(r,b))o="";else if(f){o=s[0];continue}else this.logger.warn(`missed to pass in variable ${b} for interpolating ${t}`),o="";else!ei(o)&&!this.useRawValueToEscape&&(o=k5(o));const v=g.safeValue(o);if(t=t.replace(s[0],WG(v)),f?(g.regex.lastIndex+=v.length,g.regex.lastIndex-=s[0].length):g.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),t}nest(t,n,i={}){let r,s,o;const l=(c,u)=>{const d=this.nestingOptionsSeparator;if(!c.includes(d))return c;const f=c.split(new RegExp(`${Xh(d)}[ ]*{`));let h=`{${f[1]}`;c=f[0],h=this.interpolate(h,o);const m=h.match(/'/g),g=h.match(/"/g);(((m==null?void 0:m.length)??0)%2===0&&!g||((g==null?void 0:g.length)??0)%2!==0)&&(h=h.replace(/'/g,'"'));try{o=JSON.parse(h),u&&(o={...u,...o})}catch(b){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,b),`${c}${d}${h}`}return o.defaultValue&&o.defaultValue.includes(this.prefix)&&delete o.defaultValue,c};for(;r=this.nestingRegexp.exec(t);){let c=[];o={...i},o=o.replace&&!ei(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const u=/{.*}/s.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(u!==-1&&(c=r[1].slice(u).split(this.formatSeparator).map(d=>d.trim()).filter(Boolean),r[1]=r[1].slice(0,u)),s=n(l.call(this,r[1].trim(),o),o),s&&r[0]===t&&!ei(s))return s;ei(s)||(s=k5(s)),s||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${t}`),s=""),c.length&&(s=c.reduce((d,f)=>this.format(d,f,i.lng,{...i,interpolationkey:r[1].trim()}),s.trim())),t=t.replace(r[0],WG(k5(s))),this.regexp.lastIndex=0}return t}}const kHe=e=>{let t=e.toLowerCase().trim();const n={};if(e.includes("(")){const i=e.split("(");t=i[0].toLowerCase().trim();const r=i[1].slice(0,-1);t==="currency"&&!r.includes(":")?n.currency||(n.currency=r.trim()):t==="relativetime"&&!r.includes(":")?n.range||(n.range=r.trim()):r.split(";").forEach(o=>{if(o){const[l,...c]=o.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),d=l.trim();n[d]||(n[d]=u),u==="false"&&(n[d]=!1),u==="true"&&(n[d]=!0),isNaN(u)||(n[d]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}},GG=e=>{const t={};return(n,i,r)=>{let s=r;r&&r.interpolationkey&&r.formatParams&&r.formatParams[r.interpolationkey]&&r[r.interpolationkey]&&(s={...s,[r.interpolationkey]:void 0});const o=i+JSON.stringify(s);let l=t[o];return l||(l=e(FE(i),r),t[o]=l),l(n)}},OHe=e=>(t,n,i)=>e(FE(n),i)(t);class SHe{constructor(t={}){this.logger=sh.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const i=n.cacheInBuiltFormats?GG:OHe;this.formats={number:i((r,s)=>{const o=new Intl.NumberFormat(r,{...s});return l=>o.format(l)}),currency:i((r,s)=>{const o=new Intl.NumberFormat(r,{...s,style:"currency"});return l=>o.format(l)}),datetime:i((r,s)=>{const o=new Intl.DateTimeFormat(r,{...s});return l=>o.format(l)}),relativetime:i((r,s)=>{const o=new Intl.RelativeTimeFormat(r,{...s});return l=>o.format(l,s.range||"day")}),list:i((r,s)=>{const o=new Intl.ListFormat(r,{...s});return l=>o.format(l)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=GG(n)}format(t,n,i,r={}){if(!n||t==null)return t;const s=n.split(this.formatSeparator),o=[];for(let c=0;c-1&&!u.includes(")")&&c+1{var h;const{formatName:d,formatOptions:f}=kHe(u);if(this.formats[d]){let m=c;try{const g=((h=r==null?void 0:r.formatParams)==null?void 0:h[r.interpolationkey])||{},b=g.locale||g.lng||r.locale||r.lng||i;m=this.formats[d](c,b,{...f,...r,...g})}catch(g){this.logger.warn(g)}return m}else this.logger.warn(`there was no format function for ${d}`);return c},t)}}const EHe=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class CHe extends GP{constructor(t,n,i,r={}){var s,o;super(),this.backend=t,this.store=n,this.services=i,this.languageUtils=i.languageUtils,this.options=r,this.logger=sh.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],(o=(s=this.backend)==null?void 0:s.init)==null||o.call(s,i,r.backend,r)}queueLoad(t,n,i,r){const s={},o={},l={},c={};return t.forEach(u=>{let d=!0;n.forEach(f=>{const h=`${u}|${f}`;!i.reload&&this.store.hasResourceBundle(u,f)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?o[h]===void 0&&(o[h]=!0):(this.state[h]=1,d=!1,o[h]===void 0&&(o[h]=!0),s[h]===void 0&&(s[h]=!0),c[f]===void 0&&(c[f]=!0)))}),d||(l[u]=!0)}),(Object.keys(s).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(s),pending:Object.keys(o),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(c)}}loaded(t,n,i){const r=t.split("|"),s=r[0],o=r[1];n&&this.emit("failedLoading",s,o,n),!n&&i&&this.store.addResourceBundle(s,o,i,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&i&&(this.state[t]=0);const l={};this.queue.forEach(c=>{dHe(c.loaded,[s],o),EHe(c,t),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{l[u]||(l[u]={});const d=c.loaded[u];d.length&&d.forEach(f=>{l[u][f]===void 0&&(l[u][f]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(c=>!c.done)}read(t,n,i,r=0,s=this.retryTimeout,o){if(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:i,tried:r,wait:s,callback:o});return}this.readingCalls++;const l=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&d&&r{this.read(t,n,i,r+1,s*2,o)},s);return}o(u,d)},c=this.backend[i].bind(this.backend);if(c.length===2){try{const u=c(t,n);u&&typeof u.then=="function"?u.then(d=>l(null,d)).catch(l):l(null,u)}catch(u){l(u)}return}return c(t,n,l)}prepareLoading(t,n,i={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();ei(t)&&(t=this.languageUtils.toResolveHierarchy(t)),ei(n)&&(n=[n]);const s=this.queueLoad(t,n,i,r);if(!s.toLoad.length)return s.pending.length||r(),null;s.toLoad.forEach(o=>{this.loadOne(o)})}load(t,n,i){this.prepareLoading(t,n,{},i)}reload(t,n,i){this.prepareLoading(t,n,{reload:!0},i)}loadOne(t,n=""){const i=t.split("|"),r=i[0],s=i[1];this.read(r,s,"read",void 0,void 0,(o,l)=>{o&&this.logger.warn(`${n}loading namespace ${s} for language ${r} failed`,o),!o&&l&&this.logger.log(`${n}loaded namespace ${s} for language ${r}`,l),this.loaded(t,o,l)})}saveMissing(t,n,i,r,s,o={},l=()=>{}){var c,u,d,f,h;if((u=(c=this.services)==null?void 0:c.utils)!=null&&u.hasLoadedNamespace&&!((f=(d=this.services)==null?void 0:d.utils)!=null&&f.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${i}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if((h=this.backend)!=null&&h.create){const m={...o,isUpdate:s},g=this.backend.create.bind(this.backend);if(g.length<6)try{let b;g.length===5?b=g(t,n,i,r,m):b=g(t,n,i,r),b&&typeof b.then=="function"?b.then(v=>l(null,v)).catch(l):l(null,b)}catch(b){l(b)}else g(t,n,i,r,l,m)}!t||!t[0]||this.store.addResource(t[0],n,i,r)}}}const S5=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),ei(e[1])&&(t.defaultValue=e[1]),ei(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(i=>{t[i]=n[i]})}return t},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),XG=e=>(ei(e.ns)&&(e.ns=[e.ns]),ei(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),ei(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),A2=()=>{},AHe=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class DS extends GP{constructor(t={},n){if(super(),this.options=XG(t),this.services={},this.logger=sh,this.modules={external:[]},AHe(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(ei(t.ns)?t.defaultNS=t.ns:t.ns.includes("translation")||(t.defaultNS=t.ns[0]));const i=S5();this.options={...i,...this.options,...XG(t)},this.options.interpolation={...i.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler);const r=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?sh.init(r(this.modules.logger),this.options):sh.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=SHe;const d=new zG(this.options);this.store=new QG(this.options.resources,this.options);const f=this.services;f.logger=sh,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new wHe(d,{prepend:this.options.pluralSeparator}),u&&(f.formatter=r(u),f.formatter.init&&f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new KG(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new CHe(r(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(h,...m)=>{this.emit(h,...m)}),this.modules.languageDetector&&(f.languageDetector=r(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=r(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new uR(this.services,this.options),this.translator.on("*",(h,...m)=>{this.emit(h,...m)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,n||(n=A2),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...d)=>this.store[u](...d)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...d)=>(this.store[u](...d),this)});const l=eO(),c=()=>{const u=(d,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(f),n(d,f)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),l}loadResources(t,n=A2){var s,o;let i=n;const r=ei(t)?t:this.language;if(typeof t=="function"&&(i=t),!this.options.resources||this.options.partialBundledLanguages){if((r==null?void 0:r.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const l=[],c=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&(l.includes(f)||l.push(f))})};r?c(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>c(d)),(o=(s=this.options.preload)==null?void 0:s.forEach)==null||o.call(s,u=>c(u)),this.services.backendConnector.load(l,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(u)})}else i(null)}reloadResources(t,n,i){const r=eO();return typeof t=="function"&&(i=t,t=void 0),typeof n=="function"&&(i=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),i||(i=A2),this.services.backendConnector.reload(t,n,s=>{r.resolve(),i(s)}),r}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&Yke.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!["cimode","dev"].includes(t)){for(let n=0;n{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},s=(l,c)=>{c?this.isLanguageChangingTo===t&&(r(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,i.resolve((...u)=>this.t(...u)),n&&n(l,(...u)=>this.t(...u))},o=l=>{var d,f;!t&&!l&&this.services.languageDetector&&(l=[]);const c=ei(l)?l:l&&l[0],u=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(ei(l)?[l]:l);u&&(this.language||r(u),this.translator.language||this.translator.changeLanguage(u),(f=(d=this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||f.call(d,u)),this.loadResources(u,h=>{s(h,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(t),i}getFixedT(t,n,i,r){const s=r==null?void 0:r.scopeNs,o=(l,c,...u)=>{let d;typeof c!="object"?d=this.options.overloadTranslationOptionHandler([l,c].concat(u)):d={...c},d.lng=d.lng||o.lng,d.lngs=d.lngs||o.lngs;const f=d.ns!==void 0&&d.ns!==null;d.ns=d.ns||o.ns,d.keyPrefix!==""&&(d.keyPrefix=d.keyPrefix||i||o.keyPrefix);const h={...this.options,...d};Array.isArray(s)&&!f&&(h.ns=s),typeof d.keyPrefix=="function"&&(d.keyPrefix=Ly(d.keyPrefix,h));const m=this.options.keySeparator||".";let g;return d.keyPrefix&&Array.isArray(l)?g=l.map(b=>(typeof b=="function"&&(b=Ly(b,h)),`${d.keyPrefix}${m}${b}`)):(typeof l=="function"&&(l=Ly(l,h)),g=d.keyPrefix?`${d.keyPrefix}${m}${l}`:l),this.t(g,d)};return ei(t)?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=i,o}t(...t){var n;return(n=this.translator)==null?void 0:n.translate(...t)}exists(...t){var n;return(n=this.translator)==null?void 0:n.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=n.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const o=(l,c)=>{const u=this.services.backendConnector.state[`${l}|${c}`];return u===-1||u===0||u===2};if(n.precheck){const l=n.precheck(this,o);if(l!==void 0)return l}return!!(this.hasResourceBundle(i,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(i,t)&&(!r||o(s,t)))}loadNamespaces(t,n){const i=eO();return this.options.ns?(ei(t)&&(t=[t]),t.forEach(r=>{this.options.ns.includes(r)||this.options.ns.push(r)}),this.loadResources(r=>{i.resolve(),n&&n(r)}),i):(n&&n(),Promise.resolve())}loadLanguages(t,n){const i=eO();ei(t)&&(t=[t]);const r=this.options.preload||[],s=t.filter(o=>!r.includes(o)&&this.services.languageUtils.isSupportedCode(o));return s.length?(this.options.preload=r.concat(s),this.loadResources(o=>{i.resolve(),n&&n(o)}),i):(n&&n(),Promise.resolve())}dir(t){var r,s;if(t||(t=this.resolvedLanguage||(((r=this.languages)==null?void 0:r.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const o=new Intl.Locale(t);if(o&&o.getTextInfo){const l=o.getTextInfo();if(l&&l.direction)return l.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=((s=this.services)==null?void 0:s.languageUtils)||new zG(S5());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.includes(i.getLanguagePartFromCode(t))||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const i=new DS(t,n);return i.createInstance=DS.createInstance,i}cloneInstance(t={},n=A2){const i=t.forkResourceStore;i&&delete t.forkResourceStore;const r={...this.options,...t,isClone:!0},s=new DS(r);if((t.debug!==void 0||t.prefix!==void 0)&&(s.logger=s.logger.clone(t)),["store","services","language"].forEach(l=>{s[l]=this[l]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},i){const l=Object.keys(this.store.data).reduce((c,u)=>(c[u]={...this.store.data[u]},c[u]=Object.keys(c[u]).reduce((d,f)=>(d[f]={...c[u][f]},d),c[u]),c),{});s.store=new QG(l,r),s.services.resourceStore=s.store}if(t.interpolation){const c={...S5().interpolation,...this.options.interpolation,...t.interpolation},u={...r,interpolation:c};s.services.interpolator=new KG(u)}return s.translator=new uR(s.services,r),s.translator.on("*",(l,...c)=>{s.emit(l,...c)}),s.init(r,n),s.translator.options=r,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const sc=DS.createInstance();sc.createInstance;sc.dir;sc.init;sc.loadResources;sc.reloadResources;sc.use;sc.changeLanguage;sc.getFixedT;sc.t;sc.exists;sc.setDefaultNamespace;sc.hasLoadedNamespace;sc.loadNamespaces;sc.loadLanguages;var Jke={exports:{}},Si={};/** * @license React * react.production.js * @@ -61,7 +61,7 @@ Studio:{{studioUrl}} * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var RU=Symbol.for("react.transitional.element"),AHe=Symbol.for("react.portal"),THe=Symbol.for("react.fragment"),_He=Symbol.for("react.strict_mode"),jHe=Symbol.for("react.profiler"),NHe=Symbol.for("react.consumer"),RHe=Symbol.for("react.context"),IHe=Symbol.for("react.forward_ref"),PHe=Symbol.for("react.suspense"),DHe=Symbol.for("react.memo"),Jke=Symbol.for("react.lazy"),MHe=Symbol.for("react.activity"),YG=Symbol.iterator;function LHe(e){return e===null||typeof e!="object"?null:(e=YG&&e[YG]||e["@@iterator"],typeof e=="function"?e:null)}var eOe={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},tOe=Object.assign,nOe={};function R1(e,t,n){this.props=e,this.context=t,this.refs=nOe,this.updater=n||eOe}R1.prototype.isReactComponent={};R1.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};R1.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function iOe(){}iOe.prototype=R1.prototype;function IU(e,t,n){this.props=e,this.context=t,this.refs=nOe,this.updater=n||eOe}var PU=IU.prototype=new iOe;PU.constructor=IU;tOe(PU,R1.prototype);PU.isPureReactComponent=!0;var ZG=Array.isArray;function fF(){}var Is={H:null,A:null,T:null,S:null},rOe=Object.prototype.hasOwnProperty;function DU(e,t,n){var i=n.ref;return{$$typeof:RU,type:e,key:t,ref:i!==void 0?i:null,props:n}}function $He(e,t){return DU(e.type,t,e.props)}function MU(e){return typeof e=="object"&&e!==null&&e.$$typeof===RU}function FHe(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var JG=/\/+/g;function E5(e,t){return typeof e=="object"&&e!==null&&e.key!=null?FHe(""+e.key):t.toString(36)}function BHe(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(fF,fF):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function nx(e,t,n,i,r){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"bigint":case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case RU:case AHe:o=!0;break;case Jke:return o=e._init,nx(o(e._payload),t,n,i,r)}}if(o)return r=r(e),o=i===""?"."+E5(e,0):i,ZG(r)?(n="",o!=null&&(n=o.replace(JG,"$&/")+"/"),nx(r,t,n,"",function(u){return u})):r!=null&&(MU(r)&&(r=$He(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(JG,"$&/")+"/")+o)),t.push(r)),1;o=0;var l=i===""?".":i+":";if(ZG(e))for(var c=0;c<]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g;function tX(e){const t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(zHe[n[1]]||e.charAt(e.length-2)==="/")&&(t.voidElement=!0),t.name.startsWith("!--"))){const s=e.indexOf("-->");return{type:"comment",comment:s!==-1?e.slice(4,s):""}}const i=new RegExp(VHe);let r=null;for(;r=i.exec(e),r!==null;)if(r[0].trim())if(r[1]){const s=r[1].trim();let o=[s,null];const l=s.indexOf("=");l>-1&&(o=[s.slice(0,l),s.slice(l+1)]),t.attrs[o[0]]=o[1],i.lastIndex--}else r[2]&&(t.attrs[r[2]]=r[3].trim().substring(1,r[3].length-1));return t}const _2=/|<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,HHe=/<\/?([^\s]+?)[/\s>]/,qHe=/^\s*$/,WHe=/^(script|style)$/i,tS="\0",KHe=Object.create(null);function sOe(e){e.forEach(function(t){if(t.type==="text"){t.content=t.content.split(tS).join("<");return}if(t.type==="comment"){t.comment=t.comment.split(tS).join("<");return}for(const n in t.attrs){const i=t.attrs[n];typeof i=="string"&&i.indexOf(tS)>-1&&(t.attrs[n]=i.split(tS).join("<"))}t.children.length&&sOe(t.children)})}function GHe(e,t){const n=t&&t.components||KHe,i=t&&t.allowedTags;let r=!1;if(i){const g=typeof i=="function"?i:function(w){return i.indexOf(w)>-1};let b="",v=0;_2.lastIndex=0;let y;for(;y=_2.exec(e);){const w=y[0];b+=e.slice(v,y.index);const x=w.match(HHe);w.startsWith("",e}}function YHe(e){return e.reduce(function(t,n){return t+aOe("",n)},"")}var ZHe={parse:GHe,stringify:YHe};const Bj=(e,t,n,i)=>{var s,o,l,c;const r=[n,{code:t,...i||{}}];if((o=(s=e==null?void 0:e.services)==null?void 0:s.logger)!=null&&o.forward)return e.services.logger.forward(r,"warn","react-i18next::",!0);Mc(r[0])&&(r[0]=`react-i18next:: ${r[0]}`),(c=(l=e==null?void 0:e.services)==null?void 0:l.logger)!=null&&c.warn?e.services.logger.warn(...r):console!=null&&console.warn&&console.warn(...r)},nX={},Gx=(e,t,n,i)=>{Mc(n)&&nX[n]||(Mc(n)&&(nX[n]=new Date),Bj(e,t,n,i))},oOe=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},hF=(e,t,n)=>{e.loadNamespaces(t,oOe(e,n))},iX=(e,t,n,i)=>{if(Mc(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return hF(e,n,i);n.forEach(r=>{e.options.ns.indexOf(r)<0&&e.options.ns.push(r)}),e.loadLanguages(t,oOe(e,i))},JHe=(e,t,n={})=>!t.languages||!t.languages.length?(Gx(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(i,r)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!r(i.isLanguageChangingTo,e))return!1}}),Mc=e=>typeof e=="string",Op=e=>typeof e=="object"&&e!==null,eqe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,tqe={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},nqe=e=>tqe[e],lOe=e=>e.replace(eqe,nqe);let pF={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:lOe,transDefaultProps:void 0};const iqe=(e={})=>{pF={...pF,...e}},LU=()=>pF;let cOe;const rqe=e=>{cOe=e},$U=()=>cOe,Uj=(e,t)=>{var i;if(!e)return!1;const n=((i=e.props)==null?void 0:i.children)??e.children;return t?n.length>0:!!n},nS=e=>{var n,i;if(!e)return[];const t=((n=e.props)==null?void 0:n.children)??e.children;return(i=e.props)!=null&&i.i18nIsDynamicList?Jm(t):t},sqe=e=>Array.isArray(e)&&e.every(p.isValidElement),Jm=e=>Array.isArray(e)?e:[e],aqe=(e,t)=>{const n={...t};return n.props={...t.props,...e.props},n},oqe=e=>{const t={};if(!e)return t;const n=i=>{Jm(i).forEach(s=>{Mc(s)||(Uj(s)?n(nS(s)):Op(s)&&!p.isValidElement(s)&&Object.assign(t,s))})};return n(e),t},mF=(e,t,n,i)=>{if(!e)return"";let r="";const s=Jm(e),o=t!=null&&t.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return s.forEach((l,c)=>{if(Mc(l)){r+=`${l}`;return}if(p.isValidElement(l)){const{props:u,type:d}=l,f=Object.keys(u).length,h=o.indexOf(d)>-1,m=u.children;if(!m&&h&&!f){r+=`<${d}/>`;return}if(!m&&(!h||f)||u.i18nIsDynamicList){r+=`<${c}>`;return}if(h&&f<=1){const b=Mc(m)?m:mF(m,t,n,i);r+=`<${d}>${b}`;return}const g=mF(m,t,n,i);r+=`<${c}>${g}`;return}if(l===null){Bj(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:i});return}if(Op(l)){const{format:u,...d}=l,f=Object.keys(d);if(f.length===1){const h=u?`${f[0]}, ${u}`:f[0];r+=`{{${h}}}`;return}Bj(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:i,child:l});return}Bj(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:i,child:l})}),r},lqe=(e,t,n,i,r,s,o)=>{if(n==="")return[];const l=r.transKeepBasicHtmlNodesFor||[],c=n&&new RegExp(l.map(x=>`<${x}`).join("|")).test(n);if(!e&&!t&&!c&&!o)return[n];const u=t??{},d=x=>{Jm(x).forEach(S=>{Mc(S)||(Uj(S)?d(nS(S)):Op(S)&&!p.isValidElement(S)&&Object.assign(u,S))})};d(e);const f=Object.keys(u),h=x=>/^\d+$/.test(x)||l.indexOf(x)>-1||f.indexOf(x)>-1,m=ZHe.parse(`<0>${n}`,{allowedTags:h}),g={...u,...s},b=(x,k,S)=>{var E;const O=nS(x),A=y(O,k.children,S);return sqe(O)&&A.length===0||(E=x.props)!=null&&E.i18nIsDynamicList?O:A},v=(x,k,S,O,A)=>{x.dummy?(x.children=k,S.push(p.cloneElement(x,{key:O},A?void 0:k))):S.push(...p.Children.map([x],E=>{var T;if(E.type===p.Fragment||((T=E.props)==null?void 0:T.i18nIsDynamicList)!==void 0){const R={key:O};return E&&E.props&&Object.keys(E.props).forEach(C=>{C==="children"||C==="i18nIsDynamicList"||(R[C]=E.props[C])}),p.createElement(E.type,R,A?null:k)}const j={key:O};return E&&E.props&&Object.keys(E.props).forEach(R=>{R==="ref"||R==="children"||(j[R]=E.props[R])}),p.cloneElement(E,j,A?null:k)}))},y=(x,k,S)=>{const O=Jm(x),A=Jm(k),E={};return A.reduce((j,T,R)=>{var N,P;const C=((P=(N=T.children)==null?void 0:N[0])==null?void 0:P.content)&&i.services.interpolator.interpolate(T.children[0].content,g,i.language);if(T.type==="tag"){let I=O[parseInt(T.name,10)];!I&&t&&(I=t[T.name]),S.length===1&&!I&&(I=S[0][T.name]),I||(I={});const D={...T.attrs};o&&Object.keys(D).forEach(q=>{const U=D[q];Mc(U)&&(D[q]=lOe(U))});const _=Object.keys(D).length!==0?aqe({props:D},I):I,L=p.isValidElement(_),F=L&&Uj(T,!0)&&!T.voidElement,M=c&&Op(_)&&_.dummy&&!L,H=Op(t)&&Object.hasOwnProperty.call(t,T.name);if(Mc(_)){const q=i.services.interpolator.interpolate(_,g,i.language);j.push(q)}else if(Uj(_)||F){const q=b(_,T,S);v(_,q,j,R)}else if(M){const q=y(O,T.children,S);v(_,q,j,R)}else if(Number.isNaN(parseFloat(T.name)))if(H){const q=b(_,T,S);v(_,q,j,R,T.voidElement)}else if(r.transSupportBasicHtmlNodes&&l.indexOf(T.name)>-1)if(T.voidElement)j.push(p.createElement(T.name,{key:`${T.name}-${R}`}));else{const q=E[T.name]||0;E[T.name]=q+1;let U,Z=0;for(let ne=0;ne`);else{const q=y(O,T.children,S);j.push(`<${T.name}>${q}`)}else if(Op(_)&&!L){const q=T.children[0]?C:null;q&&j.push(q)}else v(_,C,j,R,T.children.length!==1||!C)}else if(T.type==="text"){const I=r.transWrapTextNodes,D=typeof r.unescape=="function"?r.unescape:LU().unescape,_=o?D(i.services.interpolator.interpolate(T.content,g,i.language)):i.services.interpolator.interpolate(T.content,g,i.language);I?j.push(p.createElement(I,{key:`${T.name}-${R}`},_)):j.push(_)}return j},[])},w=y([{dummy:!0,children:e||[]}],m,Jm(e||[]));return nS(w[0])},uOe=(e,t,n)=>{const i=e.key||t,r=p.cloneElement(e,{key:i});if(!r.props||!r.props.children||n.indexOf(`${t}/>`)<0&&n.indexOf(`${t} />`)<0)return r;function s(){return p.createElement(p.Fragment,null,r)}return p.createElement(s,{key:i})},cqe=(e,t)=>e.map((n,i)=>uOe(n,i,t)),uqe=(e,t)=>{const n={};return Object.keys(e).forEach(i=>{Object.assign(n,{[i]:uOe(e[i],i,t)})}),n},dqe=(e,t,n,i)=>e?Array.isArray(e)?cqe(e,t):Op(e)?uqe(e,t):(Gx(n,"TRANS_INVALID_COMPONENTS",' "components" prop expects an object or array',{i18nKey:i}),null):null,fqe=e=>!Op(e)||Array.isArray(e)?!1:Object.keys(e).reduce((t,n)=>t&&Number.isNaN(Number.parseFloat(n)),!0);function hqe({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s={},values:o,defaults:l,components:c,ns:u,i18n:d,t:f,shouldUnescape:h,...m}){var M,H,q,U,Z,z;const g=d||$U();if(!g)return Gx(g,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.",{i18nKey:i}),e;const b=f||g.t.bind(g)||(J=>J),v={...LU(),...(M=g.options)==null?void 0:M.react};let y=u||b.ns||((H=g.options)==null?void 0:H.defaultNS);y=Mc(y)?[y]:y||["translation"];const{transDefaultProps:w}=v,x=w!=null&&w.tOptions?{...w.tOptions,...s}:s,k=h??(w==null?void 0:w.shouldUnescape),S=w!=null&&w.values?{...w.values,...o}:o,O=w!=null&&w.components?{...w.components,...c}:c,A=mF(e,v,g,i),E=l||(x==null?void 0:x.defaultValue)||A||v.transEmptyNodeValue||(typeof i=="function"?Ly(i):i),{hashTransKey:j}=v,T=i||(j?j(A||E):A||E);(U=(q=g.options)==null?void 0:q.interpolation)!=null&&U.defaultVariables?o=S&&Object.keys(S).length>0?{...S,...g.options.interpolation.defaultVariables}:{...g.options.interpolation.defaultVariables}:o=S;const R=oqe(e);R&&typeof R.count=="number"&&t===void 0&&(t=R.count);const C=o||t!==void 0&&!((z=(Z=g.options)==null?void 0:Z.interpolation)!=null&&z.alwaysFormat)||!e?x.interpolation:{interpolation:{...x.interpolation,prefix:"#$?",suffix:"?$#"}},N={...x,context:r||x.context,count:t,...o,...C,defaultValue:E,ns:y};let P=T?b(T,N):E;P===T&&E&&(P=E);const I=dqe(O,P,g,i);let D=I||e,_=null;fqe(I)&&(_=I,D=e);const L=lqe(D,_,P,g,v,N,k),F=n??v.defaultTransParent;return F?p.createElement(F,m,L):L}const pqe={type:"3rdParty",init(e){iqe(e.options.react),rqe(e)}},dOe=p.createContext();class mqe{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function Pw({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s={},values:o,defaults:l,components:c,ns:u,i18n:d,t:f,shouldUnescape:h,...m}){var w;const{i18n:g,defaultNS:b}=p.useContext(dOe)||{},v=d||g||$U(),y=f||(v==null?void 0:v.t.bind(v));return hqe({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s,values:o,defaults:l,components:c,ns:u||(y==null?void 0:y.ns)||b||((w=v==null?void 0:v.options)==null?void 0:w.defaultNS),i18n:v,t:f,shouldUnescape:h,...m})}var fOe={exports:{}},hOe={};/** + */var RU=Symbol.for("react.transitional.element"),THe=Symbol.for("react.portal"),_He=Symbol.for("react.fragment"),jHe=Symbol.for("react.strict_mode"),NHe=Symbol.for("react.profiler"),RHe=Symbol.for("react.consumer"),IHe=Symbol.for("react.context"),PHe=Symbol.for("react.forward_ref"),DHe=Symbol.for("react.suspense"),MHe=Symbol.for("react.memo"),eOe=Symbol.for("react.lazy"),LHe=Symbol.for("react.activity"),YG=Symbol.iterator;function $He(e){return e===null||typeof e!="object"?null:(e=YG&&e[YG]||e["@@iterator"],typeof e=="function"?e:null)}var tOe={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},nOe=Object.assign,iOe={};function R1(e,t,n){this.props=e,this.context=t,this.refs=iOe,this.updater=n||tOe}R1.prototype.isReactComponent={};R1.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};R1.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function rOe(){}rOe.prototype=R1.prototype;function IU(e,t,n){this.props=e,this.context=t,this.refs=iOe,this.updater=n||tOe}var PU=IU.prototype=new rOe;PU.constructor=IU;nOe(PU,R1.prototype);PU.isPureReactComponent=!0;var ZG=Array.isArray;function fF(){}var Is={H:null,A:null,T:null,S:null},sOe=Object.prototype.hasOwnProperty;function DU(e,t,n){var i=n.ref;return{$$typeof:RU,type:e,key:t,ref:i!==void 0?i:null,props:n}}function FHe(e,t){return DU(e.type,t,e.props)}function MU(e){return typeof e=="object"&&e!==null&&e.$$typeof===RU}function BHe(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var JG=/\/+/g;function E5(e,t){return typeof e=="object"&&e!==null&&e.key!=null?BHe(""+e.key):t.toString(36)}function UHe(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(fF,fF):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function nx(e,t,n,i,r){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"bigint":case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case RU:case THe:o=!0;break;case eOe:return o=e._init,nx(o(e._payload),t,n,i,r)}}if(o)return r=r(e),o=i===""?"."+E5(e,0):i,ZG(r)?(n="",o!=null&&(n=o.replace(JG,"$&/")+"/"),nx(r,t,n,"",function(u){return u})):r!=null&&(MU(r)&&(r=FHe(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(JG,"$&/")+"/")+o)),t.push(r)),1;o=0;var l=i===""?".":i+":";if(ZG(e))for(var c=0;c<]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g;function tX(e){const t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(VHe[n[1]]||e.charAt(e.length-2)==="/")&&(t.voidElement=!0),t.name.startsWith("!--"))){const s=e.indexOf("-->");return{type:"comment",comment:s!==-1?e.slice(4,s):""}}const i=new RegExp(HHe);let r=null;for(;r=i.exec(e),r!==null;)if(r[0].trim())if(r[1]){const s=r[1].trim();let o=[s,null];const l=s.indexOf("=");l>-1&&(o=[s.slice(0,l),s.slice(l+1)]),t.attrs[o[0]]=o[1],i.lastIndex--}else r[2]&&(t.attrs[r[2]]=r[3].trim().substring(1,r[3].length-1));return t}const _2=/|<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,qHe=/<\/?([^\s]+?)[/\s>]/,WHe=/^\s*$/,KHe=/^(script|style)$/i,tS="\0",GHe=Object.create(null);function aOe(e){e.forEach(function(t){if(t.type==="text"){t.content=t.content.split(tS).join("<");return}if(t.type==="comment"){t.comment=t.comment.split(tS).join("<");return}for(const n in t.attrs){const i=t.attrs[n];typeof i=="string"&&i.indexOf(tS)>-1&&(t.attrs[n]=i.split(tS).join("<"))}t.children.length&&aOe(t.children)})}function XHe(e,t){const n=t&&t.components||GHe,i=t&&t.allowedTags;let r=!1;if(i){const g=typeof i=="function"?i:function(w){return i.indexOf(w)>-1};let b="",v=0;_2.lastIndex=0;let y;for(;y=_2.exec(e);){const w=y[0];b+=e.slice(v,y.index);const x=w.match(qHe);w.startsWith("",e}}function ZHe(e){return e.reduce(function(t,n){return t+oOe("",n)},"")}var JHe={parse:XHe,stringify:ZHe};const Bj=(e,t,n,i)=>{var s,o,l,c;const r=[n,{code:t,...i||{}}];if((o=(s=e==null?void 0:e.services)==null?void 0:s.logger)!=null&&o.forward)return e.services.logger.forward(r,"warn","react-i18next::",!0);Mc(r[0])&&(r[0]=`react-i18next:: ${r[0]}`),(c=(l=e==null?void 0:e.services)==null?void 0:l.logger)!=null&&c.warn?e.services.logger.warn(...r):console!=null&&console.warn&&console.warn(...r)},nX={},Gx=(e,t,n,i)=>{Mc(n)&&nX[n]||(Mc(n)&&(nX[n]=new Date),Bj(e,t,n,i))},lOe=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},hF=(e,t,n)=>{e.loadNamespaces(t,lOe(e,n))},iX=(e,t,n,i)=>{if(Mc(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return hF(e,n,i);n.forEach(r=>{e.options.ns.indexOf(r)<0&&e.options.ns.push(r)}),e.loadLanguages(t,lOe(e,i))},eqe=(e,t,n={})=>!t.languages||!t.languages.length?(Gx(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(i,r)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!r(i.isLanguageChangingTo,e))return!1}}),Mc=e=>typeof e=="string",Op=e=>typeof e=="object"&&e!==null,tqe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,nqe={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},iqe=e=>nqe[e],cOe=e=>e.replace(tqe,iqe);let pF={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:cOe,transDefaultProps:void 0};const rqe=(e={})=>{pF={...pF,...e}},LU=()=>pF;let uOe;const sqe=e=>{uOe=e},$U=()=>uOe,Uj=(e,t)=>{var i;if(!e)return!1;const n=((i=e.props)==null?void 0:i.children)??e.children;return t?n.length>0:!!n},nS=e=>{var n,i;if(!e)return[];const t=((n=e.props)==null?void 0:n.children)??e.children;return(i=e.props)!=null&&i.i18nIsDynamicList?Jm(t):t},aqe=e=>Array.isArray(e)&&e.every(p.isValidElement),Jm=e=>Array.isArray(e)?e:[e],oqe=(e,t)=>{const n={...t};return n.props={...t.props,...e.props},n},lqe=e=>{const t={};if(!e)return t;const n=i=>{Jm(i).forEach(s=>{Mc(s)||(Uj(s)?n(nS(s)):Op(s)&&!p.isValidElement(s)&&Object.assign(t,s))})};return n(e),t},mF=(e,t,n,i)=>{if(!e)return"";let r="";const s=Jm(e),o=t!=null&&t.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return s.forEach((l,c)=>{if(Mc(l)){r+=`${l}`;return}if(p.isValidElement(l)){const{props:u,type:d}=l,f=Object.keys(u).length,h=o.indexOf(d)>-1,m=u.children;if(!m&&h&&!f){r+=`<${d}/>`;return}if(!m&&(!h||f)||u.i18nIsDynamicList){r+=`<${c}>`;return}if(h&&f<=1){const b=Mc(m)?m:mF(m,t,n,i);r+=`<${d}>${b}`;return}const g=mF(m,t,n,i);r+=`<${c}>${g}`;return}if(l===null){Bj(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:i});return}if(Op(l)){const{format:u,...d}=l,f=Object.keys(d);if(f.length===1){const h=u?`${f[0]}, ${u}`:f[0];r+=`{{${h}}}`;return}Bj(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:i,child:l});return}Bj(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:i,child:l})}),r},cqe=(e,t,n,i,r,s,o)=>{if(n==="")return[];const l=r.transKeepBasicHtmlNodesFor||[],c=n&&new RegExp(l.map(x=>`<${x}`).join("|")).test(n);if(!e&&!t&&!c&&!o)return[n];const u=t??{},d=x=>{Jm(x).forEach(S=>{Mc(S)||(Uj(S)?d(nS(S)):Op(S)&&!p.isValidElement(S)&&Object.assign(u,S))})};d(e);const f=Object.keys(u),h=x=>/^\d+$/.test(x)||l.indexOf(x)>-1||f.indexOf(x)>-1,m=JHe.parse(`<0>${n}`,{allowedTags:h}),g={...u,...s},b=(x,k,S)=>{var E;const O=nS(x),A=y(O,k.children,S);return aqe(O)&&A.length===0||(E=x.props)!=null&&E.i18nIsDynamicList?O:A},v=(x,k,S,O,A)=>{x.dummy?(x.children=k,S.push(p.cloneElement(x,{key:O},A?void 0:k))):S.push(...p.Children.map([x],E=>{var T;if(E.type===p.Fragment||((T=E.props)==null?void 0:T.i18nIsDynamicList)!==void 0){const R={key:O};return E&&E.props&&Object.keys(E.props).forEach(C=>{C==="children"||C==="i18nIsDynamicList"||(R[C]=E.props[C])}),p.createElement(E.type,R,A?null:k)}const j={key:O};return E&&E.props&&Object.keys(E.props).forEach(R=>{R==="ref"||R==="children"||(j[R]=E.props[R])}),p.cloneElement(E,j,A?null:k)}))},y=(x,k,S)=>{const O=Jm(x),A=Jm(k),E={};return A.reduce((j,T,R)=>{var N,P;const C=((P=(N=T.children)==null?void 0:N[0])==null?void 0:P.content)&&i.services.interpolator.interpolate(T.children[0].content,g,i.language);if(T.type==="tag"){let I=O[parseInt(T.name,10)];!I&&t&&(I=t[T.name]),S.length===1&&!I&&(I=S[0][T.name]),I||(I={});const D={...T.attrs};o&&Object.keys(D).forEach(q=>{const U=D[q];Mc(U)&&(D[q]=cOe(U))});const _=Object.keys(D).length!==0?oqe({props:D},I):I,L=p.isValidElement(_),F=L&&Uj(T,!0)&&!T.voidElement,M=c&&Op(_)&&_.dummy&&!L,H=Op(t)&&Object.hasOwnProperty.call(t,T.name);if(Mc(_)){const q=i.services.interpolator.interpolate(_,g,i.language);j.push(q)}else if(Uj(_)||F){const q=b(_,T,S);v(_,q,j,R)}else if(M){const q=y(O,T.children,S);v(_,q,j,R)}else if(Number.isNaN(parseFloat(T.name)))if(H){const q=b(_,T,S);v(_,q,j,R,T.voidElement)}else if(r.transSupportBasicHtmlNodes&&l.indexOf(T.name)>-1)if(T.voidElement)j.push(p.createElement(T.name,{key:`${T.name}-${R}`}));else{const q=E[T.name]||0;E[T.name]=q+1;let U,Z=0;for(let ne=0;ne`);else{const q=y(O,T.children,S);j.push(`<${T.name}>${q}`)}else if(Op(_)&&!L){const q=T.children[0]?C:null;q&&j.push(q)}else v(_,C,j,R,T.children.length!==1||!C)}else if(T.type==="text"){const I=r.transWrapTextNodes,D=typeof r.unescape=="function"?r.unescape:LU().unescape,_=o?D(i.services.interpolator.interpolate(T.content,g,i.language)):i.services.interpolator.interpolate(T.content,g,i.language);I?j.push(p.createElement(I,{key:`${T.name}-${R}`},_)):j.push(_)}return j},[])},w=y([{dummy:!0,children:e||[]}],m,Jm(e||[]));return nS(w[0])},dOe=(e,t,n)=>{const i=e.key||t,r=p.cloneElement(e,{key:i});if(!r.props||!r.props.children||n.indexOf(`${t}/>`)<0&&n.indexOf(`${t} />`)<0)return r;function s(){return p.createElement(p.Fragment,null,r)}return p.createElement(s,{key:i})},uqe=(e,t)=>e.map((n,i)=>dOe(n,i,t)),dqe=(e,t)=>{const n={};return Object.keys(e).forEach(i=>{Object.assign(n,{[i]:dOe(e[i],i,t)})}),n},fqe=(e,t,n,i)=>e?Array.isArray(e)?uqe(e,t):Op(e)?dqe(e,t):(Gx(n,"TRANS_INVALID_COMPONENTS",' "components" prop expects an object or array',{i18nKey:i}),null):null,hqe=e=>!Op(e)||Array.isArray(e)?!1:Object.keys(e).reduce((t,n)=>t&&Number.isNaN(Number.parseFloat(n)),!0);function pqe({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s={},values:o,defaults:l,components:c,ns:u,i18n:d,t:f,shouldUnescape:h,...m}){var M,H,q,U,Z,z;const g=d||$U();if(!g)return Gx(g,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.",{i18nKey:i}),e;const b=f||g.t.bind(g)||(J=>J),v={...LU(),...(M=g.options)==null?void 0:M.react};let y=u||b.ns||((H=g.options)==null?void 0:H.defaultNS);y=Mc(y)?[y]:y||["translation"];const{transDefaultProps:w}=v,x=w!=null&&w.tOptions?{...w.tOptions,...s}:s,k=h??(w==null?void 0:w.shouldUnescape),S=w!=null&&w.values?{...w.values,...o}:o,O=w!=null&&w.components?{...w.components,...c}:c,A=mF(e,v,g,i),E=l||(x==null?void 0:x.defaultValue)||A||v.transEmptyNodeValue||(typeof i=="function"?Ly(i):i),{hashTransKey:j}=v,T=i||(j?j(A||E):A||E);(U=(q=g.options)==null?void 0:q.interpolation)!=null&&U.defaultVariables?o=S&&Object.keys(S).length>0?{...S,...g.options.interpolation.defaultVariables}:{...g.options.interpolation.defaultVariables}:o=S;const R=lqe(e);R&&typeof R.count=="number"&&t===void 0&&(t=R.count);const C=o||t!==void 0&&!((z=(Z=g.options)==null?void 0:Z.interpolation)!=null&&z.alwaysFormat)||!e?x.interpolation:{interpolation:{...x.interpolation,prefix:"#$?",suffix:"?$#"}},N={...x,context:r||x.context,count:t,...o,...C,defaultValue:E,ns:y};let P=T?b(T,N):E;P===T&&E&&(P=E);const I=fqe(O,P,g,i);let D=I||e,_=null;hqe(I)&&(_=I,D=e);const L=cqe(D,_,P,g,v,N,k),F=n??v.defaultTransParent;return F?p.createElement(F,m,L):L}const mqe={type:"3rdParty",init(e){rqe(e.options.react),sqe(e)}},fOe=p.createContext();class gqe{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function Pw({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s={},values:o,defaults:l,components:c,ns:u,i18n:d,t:f,shouldUnescape:h,...m}){var w;const{i18n:g,defaultNS:b}=p.useContext(fOe)||{},v=d||g||$U(),y=f||(v==null?void 0:v.t.bind(v));return pqe({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s,values:o,defaults:l,components:c,ns:u||(y==null?void 0:y.ns)||b||((w=v==null?void 0:v.options)==null?void 0:w.defaultNS),i18n:v,t:f,shouldUnescape:h,...m})}var hOe={exports:{}},pOe={};/** * @license React * use-sync-external-store-shim.production.js * @@ -69,7 +69,7 @@ Studio:{{studioUrl}} * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Dw=p;function gqe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var bqe=typeof Object.is=="function"?Object.is:gqe,yqe=Dw.useState,vqe=Dw.useEffect,xqe=Dw.useLayoutEffect,wqe=Dw.useDebugValue;function kqe(e,t){var n=t(),i=yqe({inst:{value:n,getSnapshot:t}}),r=i[0].inst,s=i[1];return xqe(function(){r.value=n,r.getSnapshot=t,C5(r)&&s({inst:r})},[e,n,t]),vqe(function(){return C5(r)&&s({inst:r}),e(function(){C5(r)&&s({inst:r})})},[e]),wqe(n),n}function C5(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!bqe(e,n)}catch{return!0}}function Oqe(e,t){return t()}var Sqe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Oqe:kqe;hOe.useSyncExternalStore=Dw.useSyncExternalStore!==void 0?Dw.useSyncExternalStore:Sqe;fOe.exports=hOe;var XP=fOe.exports;const Eqe=(e,t)=>{if(Mc(t))return t;if(Op(t)&&Mc(t.defaultValue))return t.defaultValue;if(typeof e=="function")return"";if(Array.isArray(e)){const n=e[e.length-1];return typeof n=="function"?"":n}return e},Cqe={t:Eqe,ready:!1},Aqe=()=>()=>{},_e=(e,t={})=>{var j,T,R;const{i18n:n}=t,{i18n:i,defaultNS:r}=p.useContext(dOe)||{},s=n||i||$U();s&&!s.reportNamespaces&&(s.reportNamespaces=new mqe),s||Gx(s,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.");const o=p.useMemo(()=>{var C;return{...LU(),...(C=s==null?void 0:s.options)==null?void 0:C.react,...t}},[s,t]),{useSuspense:l,keyPrefix:c}=o,u=e||r||((j=s==null?void 0:s.options)==null?void 0:j.defaultNS),d=Mc(u)?[u]:u||["translation"],f=p.useMemo(()=>d,d);(R=(T=s==null?void 0:s.reportNamespaces)==null?void 0:T.addUsedNamespaces)==null||R.call(T,f);const h=p.useRef(0),m=p.useCallback(C=>{if(!s)return Aqe;const{bindI18n:N,bindI18nStore:P}=o,I=()=>{h.current+=1,C()};return N&&s.on(N,I),P&&s.store.on(P,I),()=>{N&&N.split(" ").forEach(D=>s.off(D,I)),P&&P.split(" ").forEach(D=>s.store.off(D,I))}},[s,o]),g=p.useRef(),b=p.useCallback(()=>{if(!s)return Cqe;const C=!!(s.isInitialized||s.initializedStoreOnce)&&f.every(L=>JHe(L,s,o)),N=t.lng||s.language,P=h.current,I=g.current;if(I&&I.ready===C&&I.lng===N&&I.keyPrefix===c&&I.revision===P)return I;const _={t:s.getFixedT(N,o.nsMode==="fallback"?f:f[0],c,{scopeNs:f}),ready:C,lng:N,keyPrefix:c,revision:P};return g.current=_,_},[s,f,c,o,t.lng]),[v,y]=p.useState(0),{t:w,ready:x}=XP.useSyncExternalStore(m,b,b);p.useEffect(()=>{if(s&&!x&&!l){const C=()=>y(N=>N+1);t.lng?iX(s,t.lng,f,C):hF(s,f,C)}},[s,t.lng,f,x,l,v]);const k=s||{},S=p.useRef(null),O=p.useRef(),A=C=>{const N=Object.getOwnPropertyDescriptors(C);N.__original&&delete N.__original;const P=Object.create(Object.getPrototypeOf(C),N);if(!Object.prototype.hasOwnProperty.call(P,"__original"))try{Object.defineProperty(P,"__original",{value:C,writable:!1,enumerable:!1,configurable:!1})}catch{}return P},E=p.useMemo(()=>{const C=k,N=C==null?void 0:C.language;let P=C;C&&(S.current&&S.current.__original===C?O.current!==N?(P=A(C),S.current=P,O.current=N):P=S.current:(P=A(C),S.current=P,O.current=N));const I=!x&&!l?(..._)=>(Gx(s,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),w(..._)):w,D=[I,P,x];return D.t=I,D.i18n=P,D.ready=x,D},[w,k,x,k.resolvedLanguage,k.language,k.languages]);if(s&&l&&!x){let C=!1;try{C=!1}catch{}throw C&&Gx(s,"SUSPENDED_WHILE_LOADING","useTranslation: suspended while translations are loading (useSuspense is true by default). Add a boundary above this component, or set react.useSuspense: false in the i18next init options. https://react.i18next.com/latest/usetranslation-hook"),new Promise(N=>{const P=()=>N();t.lng?iX(s,t.lng,f,P):hF(s,f,P)})}return E},pOe=aHe(),bn=sc.createInstance();bn.use(pqe).init({resources:{"en-US":{adk:rde,app:ofe,conversation:$fe},"zh-CN":{adk:jU,app:hve,conversation:Vve}},lng:pOe,fallbackLng:kA,supportedLngs:[...NU],defaultNS:"common",interpolation:{escapeValue:!1},initAsync:!1});Kke(pOe);bn.on("languageChanged",e=>{const t=OA(e)??kA;Kke(t)});const Tqe=Object.assign({"./resources/en-US/adk.json":Hze,"./resources/en-US/agentReviews.json":Wze,"./resources/en-US/app.json":Kze,"./resources/en-US/automations.json":Gze,"./resources/en-US/common.json":Yze,"./resources/en-US/conversation.json":Zze,"./resources/en-US/create.json":Jze,"./resources/en-US/cronjobs.json":tVe,"./resources/en-US/deepseek.json":iVe,"./resources/en-US/feedback.json":sVe,"./resources/en-US/migrations.json":oVe,"./resources/en-US/newChat.json":lVe,"./resources/en-US/reviews.json":uVe,"./resources/en-US/sandbox.json":dVe,"./resources/en-US/shell.json":hVe,"./resources/en-US/sidebar.json":mVe,"./resources/en-US/skills.json":gVe,"./resources/en-US/ui.json":yVe,"./resources/en-US/users.json":xVe,"./resources/en-US/websiteIntegration.json":kVe,"./resources/en-US/workspaceTools.json":OVe,"./resources/zh-CN/adk.json":SVe,"./resources/zh-CN/agentReviews.json":CVe,"./resources/zh-CN/app.json":AVe,"./resources/zh-CN/automations.json":TVe,"./resources/zh-CN/common.json":jVe,"./resources/zh-CN/conversation.json":NVe,"./resources/zh-CN/create.json":RVe,"./resources/zh-CN/cronjobs.json":PVe,"./resources/zh-CN/deepseek.json":MVe,"./resources/zh-CN/feedback.json":$Ve,"./resources/zh-CN/migrations.json":BVe,"./resources/zh-CN/newChat.json":UVe,"./resources/zh-CN/reviews.json":zVe,"./resources/zh-CN/sandbox.json":VVe,"./resources/zh-CN/shell.json":qVe,"./resources/zh-CN/sidebar.json":KVe,"./resources/zh-CN/skills.json":GVe,"./resources/zh-CN/ui.json":YVe,"./resources/zh-CN/users.json":JVe,"./resources/zh-CN/websiteIntegration.json":tHe,"./resources/zh-CN/workspaceTools.json":nHe});function _qe(){const e={};for(const[t,n]of Object.entries(Tqe)){const i=t.match(/\/resources\/([^/]+)\/([^/]+)\.json$/);if(!i)continue;const[,r,s]=i;e[r]??(e[r]={}),e[r][s]=n.default}return e}for(const[e,t]of Object.entries(_qe()))for(const[n,i]of Object.entries(t??{}))bn.addResourceBundle(e,n,i,!0,!0);async function jqe(e){oHe(e),await bn.changeLanguage(e)}var mOe={exports:{}},YP={},gOe={exports:{}},bOe={};/** + */var Dw=p;function bqe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var yqe=typeof Object.is=="function"?Object.is:bqe,vqe=Dw.useState,xqe=Dw.useEffect,wqe=Dw.useLayoutEffect,kqe=Dw.useDebugValue;function Oqe(e,t){var n=t(),i=vqe({inst:{value:n,getSnapshot:t}}),r=i[0].inst,s=i[1];return wqe(function(){r.value=n,r.getSnapshot=t,C5(r)&&s({inst:r})},[e,n,t]),xqe(function(){return C5(r)&&s({inst:r}),e(function(){C5(r)&&s({inst:r})})},[e]),kqe(n),n}function C5(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!yqe(e,n)}catch{return!0}}function Sqe(e,t){return t()}var Eqe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Sqe:Oqe;pOe.useSyncExternalStore=Dw.useSyncExternalStore!==void 0?Dw.useSyncExternalStore:Eqe;hOe.exports=pOe;var XP=hOe.exports;const Cqe=(e,t)=>{if(Mc(t))return t;if(Op(t)&&Mc(t.defaultValue))return t.defaultValue;if(typeof e=="function")return"";if(Array.isArray(e)){const n=e[e.length-1];return typeof n=="function"?"":n}return e},Aqe={t:Cqe,ready:!1},Tqe=()=>()=>{},_e=(e,t={})=>{var j,T,R;const{i18n:n}=t,{i18n:i,defaultNS:r}=p.useContext(fOe)||{},s=n||i||$U();s&&!s.reportNamespaces&&(s.reportNamespaces=new gqe),s||Gx(s,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.");const o=p.useMemo(()=>{var C;return{...LU(),...(C=s==null?void 0:s.options)==null?void 0:C.react,...t}},[s,t]),{useSuspense:l,keyPrefix:c}=o,u=e||r||((j=s==null?void 0:s.options)==null?void 0:j.defaultNS),d=Mc(u)?[u]:u||["translation"],f=p.useMemo(()=>d,d);(R=(T=s==null?void 0:s.reportNamespaces)==null?void 0:T.addUsedNamespaces)==null||R.call(T,f);const h=p.useRef(0),m=p.useCallback(C=>{if(!s)return Tqe;const{bindI18n:N,bindI18nStore:P}=o,I=()=>{h.current+=1,C()};return N&&s.on(N,I),P&&s.store.on(P,I),()=>{N&&N.split(" ").forEach(D=>s.off(D,I)),P&&P.split(" ").forEach(D=>s.store.off(D,I))}},[s,o]),g=p.useRef(),b=p.useCallback(()=>{if(!s)return Aqe;const C=!!(s.isInitialized||s.initializedStoreOnce)&&f.every(L=>eqe(L,s,o)),N=t.lng||s.language,P=h.current,I=g.current;if(I&&I.ready===C&&I.lng===N&&I.keyPrefix===c&&I.revision===P)return I;const _={t:s.getFixedT(N,o.nsMode==="fallback"?f:f[0],c,{scopeNs:f}),ready:C,lng:N,keyPrefix:c,revision:P};return g.current=_,_},[s,f,c,o,t.lng]),[v,y]=p.useState(0),{t:w,ready:x}=XP.useSyncExternalStore(m,b,b);p.useEffect(()=>{if(s&&!x&&!l){const C=()=>y(N=>N+1);t.lng?iX(s,t.lng,f,C):hF(s,f,C)}},[s,t.lng,f,x,l,v]);const k=s||{},S=p.useRef(null),O=p.useRef(),A=C=>{const N=Object.getOwnPropertyDescriptors(C);N.__original&&delete N.__original;const P=Object.create(Object.getPrototypeOf(C),N);if(!Object.prototype.hasOwnProperty.call(P,"__original"))try{Object.defineProperty(P,"__original",{value:C,writable:!1,enumerable:!1,configurable:!1})}catch{}return P},E=p.useMemo(()=>{const C=k,N=C==null?void 0:C.language;let P=C;C&&(S.current&&S.current.__original===C?O.current!==N?(P=A(C),S.current=P,O.current=N):P=S.current:(P=A(C),S.current=P,O.current=N));const I=!x&&!l?(..._)=>(Gx(s,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),w(..._)):w,D=[I,P,x];return D.t=I,D.i18n=P,D.ready=x,D},[w,k,x,k.resolvedLanguage,k.language,k.languages]);if(s&&l&&!x){let C=!1;try{C=!1}catch{}throw C&&Gx(s,"SUSPENDED_WHILE_LOADING","useTranslation: suspended while translations are loading (useSuspense is true by default). Add a boundary above this component, or set react.useSuspense: false in the i18next init options. https://react.i18next.com/latest/usetranslation-hook"),new Promise(N=>{const P=()=>N();t.lng?iX(s,t.lng,f,P):hF(s,f,P)})}return E},mOe=oHe(),bn=sc.createInstance();bn.use(mqe).init({resources:{"en-US":{adk:sde,app:lfe,conversation:Ffe},"zh-CN":{adk:jU,app:pve,conversation:Hve}},lng:mOe,fallbackLng:kA,supportedLngs:[...NU],defaultNS:"common",interpolation:{escapeValue:!1},initAsync:!1});Gke(mOe);bn.on("languageChanged",e=>{const t=OA(e)??kA;Gke(t)});const _qe=Object.assign({"./resources/en-US/adk.json":qze,"./resources/en-US/agentReviews.json":Kze,"./resources/en-US/app.json":Gze,"./resources/en-US/automations.json":Xze,"./resources/en-US/common.json":Zze,"./resources/en-US/conversation.json":Jze,"./resources/en-US/create.json":eVe,"./resources/en-US/cronjobs.json":nVe,"./resources/en-US/deepseek.json":rVe,"./resources/en-US/feedback.json":aVe,"./resources/en-US/migrations.json":lVe,"./resources/en-US/newChat.json":cVe,"./resources/en-US/reviews.json":dVe,"./resources/en-US/sandbox.json":fVe,"./resources/en-US/shell.json":pVe,"./resources/en-US/sidebar.json":gVe,"./resources/en-US/skills.json":bVe,"./resources/en-US/ui.json":vVe,"./resources/en-US/users.json":wVe,"./resources/en-US/websiteIntegration.json":OVe,"./resources/en-US/workspaceTools.json":SVe,"./resources/zh-CN/adk.json":EVe,"./resources/zh-CN/agentReviews.json":AVe,"./resources/zh-CN/app.json":TVe,"./resources/zh-CN/automations.json":_Ve,"./resources/zh-CN/common.json":NVe,"./resources/zh-CN/conversation.json":RVe,"./resources/zh-CN/create.json":IVe,"./resources/zh-CN/cronjobs.json":DVe,"./resources/zh-CN/deepseek.json":LVe,"./resources/zh-CN/feedback.json":FVe,"./resources/zh-CN/migrations.json":UVe,"./resources/zh-CN/newChat.json":QVe,"./resources/zh-CN/reviews.json":VVe,"./resources/zh-CN/sandbox.json":HVe,"./resources/zh-CN/shell.json":WVe,"./resources/zh-CN/sidebar.json":GVe,"./resources/zh-CN/skills.json":XVe,"./resources/zh-CN/ui.json":ZVe,"./resources/zh-CN/users.json":eHe,"./resources/zh-CN/websiteIntegration.json":nHe,"./resources/zh-CN/workspaceTools.json":iHe});function jqe(){const e={};for(const[t,n]of Object.entries(_qe)){const i=t.match(/\/resources\/([^/]+)\/([^/]+)\.json$/);if(!i)continue;const[,r,s]=i;e[r]??(e[r]={}),e[r][s]=n.default}return e}for(const[e,t]of Object.entries(jqe()))for(const[n,i]of Object.entries(t??{}))bn.addResourceBundle(e,n,i,!0,!0);async function Nqe(e){lHe(e),await bn.changeLanguage(e)}var gOe={exports:{}},YP={},bOe={exports:{}},yOe={};/** * @license React * scheduler.production.js * @@ -77,7 +77,7 @@ Studio:{{studioUrl}} * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(e){function t(D,_){var L=D.length;D.push(_);e:for(;0>>1,M=D[F];if(0>>1;Fr(U,L))Zr(z,U)?(D[F]=z,D[Z]=L,F=Z):(D[F]=U,D[q]=L,F=q);else if(Zr(z,L))D[F]=z,D[Z]=L,F=Z;else break e}}return _}function r(D,_){var L=D.sortIndex-_.sortIndex;return L!==0?L:D.id-_.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,f=null,h=3,m=!1,g=!1,b=!1,v=!1,y=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function k(D){for(var _=n(u);_!==null;){if(_.callback===null)i(u);else if(_.startTime<=D)i(u),_.sortIndex=_.expirationTime,t(c,_);else break;_=n(u)}}function S(D){if(b=!1,k(D),!g)if(n(c)!==null)g=!0,O||(O=!0,C());else{var _=n(u);_!==null&&I(S,_.startTime-D)}}var O=!1,A=-1,E=5,j=-1;function T(){return v?!0:!(e.unstable_now()-jD&&T());){var F=f.callback;if(typeof F=="function"){f.callback=null,h=f.priorityLevel;var M=F(f.expirationTime<=D);if(D=e.unstable_now(),typeof M=="function"){f.callback=M,k(D),_=!0;break t}f===n(c)&&i(c),k(D)}else i(c);f=n(c)}if(f!==null)_=!0;else{var H=n(u);H!==null&&I(S,H.startTime-D),_=!1}}break e}finally{f=null,h=L,m=!1}_=void 0}}finally{_?C():O=!1}}}var C;if(typeof x=="function")C=function(){x(R)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,P=N.port2;N.port1.onmessage=R,C=function(){P.postMessage(null)}}else C=function(){y(R,0)};function I(D,_){A=y(function(){D(e.unstable_now())},_)}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(D){D.callback=null},e.unstable_forceFrameRate=function(D){0>D||125F?(D.sortIndex=L,t(u,D),n(c)===null&&D===n(u)&&(b?(w(A),A=-1):b=!0,I(S,L-F))):(D.sortIndex=M,t(c,D),g||m||(g=!0,O||(O=!0,C()))),D},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(D){var _=h;return function(){var L=h;h=_;try{return D.apply(this,arguments)}finally{h=L}}}})(bOe);gOe.exports=bOe;var Nqe=gOe.exports,yOe={exports:{}},ac={};/** + */(function(e){function t(D,_){var L=D.length;D.push(_);e:for(;0>>1,M=D[F];if(0>>1;Fr(U,L))Zr(z,U)?(D[F]=z,D[Z]=L,F=Z):(D[F]=U,D[q]=L,F=q);else if(Zr(z,L))D[F]=z,D[Z]=L,F=Z;else break e}}return _}function r(D,_){var L=D.sortIndex-_.sortIndex;return L!==0?L:D.id-_.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,f=null,h=3,m=!1,g=!1,b=!1,v=!1,y=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function k(D){for(var _=n(u);_!==null;){if(_.callback===null)i(u);else if(_.startTime<=D)i(u),_.sortIndex=_.expirationTime,t(c,_);else break;_=n(u)}}function S(D){if(b=!1,k(D),!g)if(n(c)!==null)g=!0,O||(O=!0,C());else{var _=n(u);_!==null&&I(S,_.startTime-D)}}var O=!1,A=-1,E=5,j=-1;function T(){return v?!0:!(e.unstable_now()-jD&&T());){var F=f.callback;if(typeof F=="function"){f.callback=null,h=f.priorityLevel;var M=F(f.expirationTime<=D);if(D=e.unstable_now(),typeof M=="function"){f.callback=M,k(D),_=!0;break t}f===n(c)&&i(c),k(D)}else i(c);f=n(c)}if(f!==null)_=!0;else{var H=n(u);H!==null&&I(S,H.startTime-D),_=!1}}break e}finally{f=null,h=L,m=!1}_=void 0}}finally{_?C():O=!1}}}var C;if(typeof x=="function")C=function(){x(R)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,P=N.port2;N.port1.onmessage=R,C=function(){P.postMessage(null)}}else C=function(){y(R,0)};function I(D,_){A=y(function(){D(e.unstable_now())},_)}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(D){D.callback=null},e.unstable_forceFrameRate=function(D){0>D||125F?(D.sortIndex=L,t(u,D),n(c)===null&&D===n(u)&&(b?(w(A),A=-1):b=!0,I(S,L-F))):(D.sortIndex=M,t(c,D),g||m||(g=!0,O||(O=!0,C()))),D},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(D){var _=h;return function(){var L=h;h=_;try{return D.apply(this,arguments)}finally{h=L}}}})(yOe);bOe.exports=yOe;var Rqe=bOe.exports,vOe={exports:{}},ac={};/** * @license React * react-dom.production.js * @@ -85,7 +85,7 @@ Studio:{{studioUrl}} * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Rqe=p;function vOe(e){var t="https://react.dev/errors/"+e;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(xOe)}catch(e){console.error(e)}}xOe(),yOe.exports=ac;var vi=yOe.exports;/** + */var Iqe=p;function xOe(e){var t="https://react.dev/errors/"+e;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(wOe)}catch(e){console.error(e)}}wOe(),vOe.exports=ac;var vi=vOe.exports;/** * @license React * react-dom-client.production.js * @@ -93,15 +93,15 @@ Studio:{{studioUrl}} * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var ho=Nqe,wOe=p,Dqe=vi;function wt(e){var t="https://react.dev/errors/"+e;if(1wx||(e.current=wF[wx],wF[wx]=null,wx--)}function Os(e,t){wx++,wF[wx]=e.current,e.current=t}var mh=jh(null),BE=jh(null),Og=jh(null),dR=jh(null);function fR(e,t){switch(Os(Og,t),Os(BE,e),Os(mh,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?dY(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=dY(t),e=WEe(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$o(mh),Os(mh,e)}function Mw(){$o(mh),$o(BE),$o(Og)}function kF(e){e.memoizedState!==null&&Os(dR,e);var t=mh.current,n=WEe(t,e.type);t!==n&&(Os(BE,e),Os(mh,n))}function hR(e){BE.current===e&&($o(mh),$o(BE)),dR.current===e&&($o(dR),YE._currentValue=$y)}var A5,aX;function ty(e){if(A5===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);A5=t&&t[1]||"",aX=-1wx||(e.current=wF[wx],wF[wx]=null,wx--)}function Os(e,t){wx++,wF[wx]=e.current,e.current=t}var mh=jh(null),BE=jh(null),Og=jh(null),dR=jh(null);function fR(e,t){switch(Os(Og,t),Os(BE,e),Os(mh,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?dY(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=dY(t),e=KEe(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$o(mh),Os(mh,e)}function Mw(){$o(mh),$o(BE),$o(Og)}function kF(e){e.memoizedState!==null&&Os(dR,e);var t=mh.current,n=KEe(t,e.type);t!==n&&(Os(BE,e),Os(mh,n))}function hR(e){BE.current===e&&($o(mh),$o(BE)),dR.current===e&&($o(dR),YE._currentValue=$y)}var A5,aX;function ty(e){if(A5===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);A5=t&&t[1]||"",aX=-1)":-1r||c[i]!==u[r]){var d=` -`+c[i].replace(" at new "," at ");return e.displayName&&d.includes("")&&(d=d.replace("",e.displayName)),d}while(1<=i&&0<=r);break}}}finally{T5=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ty(n):""}function Bqe(e,t){switch(e.tag){case 26:case 27:case 5:return ty(e.type);case 16:return ty("Lazy");case 13:return e.child!==t&&t!==null?ty("Suspense Fallback"):ty("Suspense");case 19:return ty("SuspenseList");case 0:case 15:return _5(e.type,!1);case 11:return _5(e.type.render,!1);case 1:return _5(e.type,!0);case 31:return ty("Activity");default:return""}}function oX(e){try{var t="",n=null;do t+=Bqe(e,n),n=e,e=e.return;while(e);return t}catch(i){return` +`+c[i].replace(" at new "," at ");return e.displayName&&d.includes("")&&(d=d.replace("",e.displayName)),d}while(1<=i&&0<=r);break}}}finally{T5=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ty(n):""}function Uqe(e,t){switch(e.tag){case 26:case 27:case 5:return ty(e.type);case 16:return ty("Lazy");case 13:return e.child!==t&&t!==null?ty("Suspense Fallback"):ty("Suspense");case 19:return ty("SuspenseList");case 0:case 15:return _5(e.type,!1);case 11:return _5(e.type.render,!1);case 1:return _5(e.type,!0);case 31:return ty("Activity");default:return""}}function oX(e){try{var t="",n=null;do t+=Uqe(e,n),n=e,e=e.return;while(e);return t}catch(i){return` Error generating stack: `+i.message+` -`+i.stack}}var OF=Object.prototype.hasOwnProperty,UU=ho.unstable_scheduleCallback,j5=ho.unstable_cancelCallback,Uqe=ho.unstable_shouldYield,Qqe=ho.unstable_requestPaint,_u=ho.unstable_now,zqe=ho.unstable_getCurrentPriorityLevel,TOe=ho.unstable_ImmediatePriority,_Oe=ho.unstable_UserBlockingPriority,pR=ho.unstable_NormalPriority,Vqe=ho.unstable_LowPriority,jOe=ho.unstable_IdlePriority,Hqe=ho.log,qqe=ho.unstable_setDisableYieldValue,EA=null,ju=null;function cg(e){if(typeof Hqe=="function"&&qqe(e),ju&&typeof ju.setStrictMode=="function")try{ju.setStrictMode(EA,e)}catch{}}var Nu=Math.clz32?Math.clz32:Gqe,Wqe=Math.log,Kqe=Math.LN2;function Gqe(e){return e>>>=0,e===0?32:31-(Wqe(e)/Kqe|0)|0}var N2=256,R2=262144,I2=4194304;function ny(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function JP(e,t,n){var i=e.pendingLanes;if(i===0)return 0;var r=0,s=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var l=i&134217727;return l!==0?(i=l&~s,i!==0?r=ny(i):(o&=l,o!==0?r=ny(o):n||(n=l&~e,n!==0&&(r=ny(n))))):(l=i&~s,l!==0?r=ny(l):o!==0?r=ny(o):n||(n=i&~e,n!==0&&(r=ny(n)))),r===0?0:t!==0&&t!==r&&!(t&s)&&(s=r&-r,n=t&-t,s>=n||s===32&&(n&4194048)!==0)?t:r}function CA(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Xqe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 NOe(){var e=I2;return I2<<=1,!(I2&62914560)&&(I2=4194304),e}function N5(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function AA(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Yqe(e,t,n,i,r,s){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var l=e.entanglements,c=e.expirationTimes,u=e.hiddenUpdates;for(n=o&~n;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var iWe=/[\n"\\]/g;function od(e){return e.replace(iWe,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function CF(e,t,n,i,r,s,o,l){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+nd(t)):e.value!==""+nd(t)&&(e.value=""+nd(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?AF(e,o,nd(t)):n!=null?AF(e,o,nd(n)):i!=null&&e.removeAttribute("value"),r==null&&s!=null&&(e.defaultChecked=!!s),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+nd(l):e.removeAttribute("name")}function BOe(e,t,n,i,r,s,o,l){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.type=s),t!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||t!=null)){EF(e);return}n=n!=null?""+nd(n):"",t=t!=null?""+nd(t):n,l||t===e.value||(e.value=t),e.defaultValue=t}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=l?e.checked:!!i,e.defaultChecked=!!i,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o),EF(e)}function AF(e,t,n){t==="number"&&mR(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Yx(e,t,n,i){if(e=e.options,t){t={};for(var r=0;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_F=!1;if(Vp)try{var nO={};Object.defineProperty(nO,"passive",{get:function(){_F=!0}}),window.addEventListener("test",nO,nO),window.removeEventListener("test",nO,nO)}catch{_F=!1}var ug=null,WU=null,Vj=null;function HOe(){if(Vj)return Vj;var e,t=WU,n=t.length,i,r="value"in ug?ug.value:ug.textContent,s=r.length;for(e=0;e=LS),yX=" ",vX=!1;function WOe(e,t){switch(e){case"keyup":return NWe.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function KOe(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Sx=!1;function IWe(e,t){switch(e){case"compositionend":return KOe(t);case"keypress":return t.which!==32?null:(vX=!0,yX);case"textInput":return e=t.data,e===yX&&vX?null:e;default:return null}}function PWe(e,t){if(Sx)return e==="compositionend"||!GU&&WOe(e,t)?(e=HOe(),Vj=WU=ug=null,Sx=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=SX(n)}}function ZOe(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ZOe(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function JOe(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=mR(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=mR(e.document)}return t}function XU(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var QWe=Vp&&"documentMode"in document&&11>=document.documentMode,Ex=null,jF=null,FS=null,NF=!1;function CX(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;NF||Ex==null||Ex!==mR(i)||(i=Ex,"selectionStart"in i&&XU(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),FS&&zE(FS,i)||(FS=i,i=IR(jF,"onSelect"),0>=o,r-=o,ah=1<<32-Nu(t)+r|n<E?(j=A,A=null):j=A.sibling;var T=h(y,A,x[E],k);if(T===null){A===null&&(A=j);break}e&&A&&T.alternate===null&&t(y,A),w=s(T,w,E),O===null?S=T:O.sibling=T,O=T,A=j}if(E===x.length)return n(y,A),ur&&gp(y,E),S;if(A===null){for(;EE?(j=A,A=null):j=A.sibling;var R=h(y,A,T.value,k);if(R===null){A===null&&(A=j);break}e&&A&&R.alternate===null&&t(y,A),w=s(R,w,E),O===null?S=R:O.sibling=R,O=R,A=j}if(T.done)return n(y,A),ur&&gp(y,E),S;if(A===null){for(;!T.done;E++,T=x.next())T=f(y,T.value,k),T!==null&&(w=s(T,w,E),O===null?S=T:O.sibling=T,O=T);return ur&&gp(y,E),S}for(A=i(A);!T.done;E++,T=x.next())T=m(A,y,E,T.value,k),T!==null&&(e&&T.alternate!==null&&A.delete(T.key===null?E:T.key),w=s(T,w,E),O===null?S=T:O.sibling=T,O=T);return e&&A.forEach(function(C){return t(y,C)}),ur&&gp(y,E),S}function v(y,w,x,k){if(typeof x=="object"&&x!==null&&x.type===xx&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case j2:e:{for(var S=x.key;w!==null;){if(w.key===S){if(S=x.type,S===xx){if(w.tag===7){n(y,w.sibling),k=r(w,x.props.children),k.return=y,y=k;break e}}else if(w.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Hm&&iy(S)===w.type){n(y,w.sibling),k=r(w,x.props),rO(k,x),k.return=y,y=k;break e}n(y,w);break}else t(y,w);w=w.sibling}x.type===xx?(k=Fy(x.props.children,y.mode,k,x.key),k.return=y,y=k):(k=qj(x.type,x.key,x.props,null,y.mode,k),rO(k,x),k.return=y,y=k)}return o(y);case iS:e:{for(S=x.key;w!==null;){if(w.key===S)if(w.tag===4&&w.stateNode.containerInfo===x.containerInfo&&w.stateNode.implementation===x.implementation){n(y,w.sibling),k=r(w,x.children||[]),k.return=y,y=k;break e}else{n(y,w);break}else t(y,w);w=w.sibling}k=B5(x,y.mode,k),k.return=y,y=k}return o(y);case Hm:return x=iy(x),v(y,w,x,k)}if(rS(x))return g(y,w,x,k);if(tO(x)){if(S=tO(x),typeof S!="function")throw Error(wt(150));return x=S.call(x),b(y,w,x,k)}if(typeof x.then=="function")return v(y,w,L2(x),k);if(x.$$typeof===Sp)return v(y,w,M2(y,x),k);$2(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint"?(x=""+x,w!==null&&w.tag===6?(n(y,w.sibling),k=r(w,x),k.return=y,y=k):(n(y,w),k=F5(x,y.mode,k),k.return=y,y=k),o(y)):n(y,w)}return function(y,w,x,k){try{qE=0;var S=v(y,w,x,k);return ew=null,S}catch(A){if(A===M1||A===sD)throw A;var O=ku(29,A,null,y.mode);return O.lanes=k,O.return=y,O}finally{}}}var nv=pSe(!0),mSe=pSe(!1),qm=!1;function sQ(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $F(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Eg(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Cg(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,jr&2){var r=i.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),i.pending=t,t=bR(e),aSe(e,null,n),t}return rD(e,i,t,n),bR(e)}function US(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,IOe(e,n)}}function Q5(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?r=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?r=s=t:s=s.next=t}else r=s=t;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:i.shared,callbacks:i.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var FF=!1;function QS(){if(FF){var e=Jx;if(e!==null)throw e}}function zS(e,t,n,i){FF=!1;var r=e.updateQueue;qm=!1;var s=r.firstBaseUpdate,o=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?s=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(s!==null){var f=r.baseState;o=0,d=u=c=null,l=s;do{var h=l.lane&-536870913,m=h!==l.lane;if(m?(ar&h)===h:(i&h)===h){h!==0&&h===Fw&&(FF=!0),d!==null&&(d=d.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var g=e,b=l;h=t;var v=n;switch(b.tag){case 1:if(g=b.payload,typeof g=="function"){f=g.call(v,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=b.payload,h=typeof g=="function"?g.call(v,f,h):g,h==null)break e;f=Ds({},f,h);break e;case 2:qm=!0}}h=l.callback,h!==null&&(e.flags|=64,m&&(e.flags|=8192),m=r.callbacks,m===null?r.callbacks=[h]:m.push(h))}else m={lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=m,c=f):d=d.next=m,o|=h;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;m=l,l=m.next,m.next=null,r.lastBaseUpdate=m,r.shared.pending=null}}while(!0);d===null&&(c=f),r.baseState=c,r.firstBaseUpdate=u,r.lastBaseUpdate=d,s===null&&(r.shared.lanes=0),Vg|=o,e.lanes=o,e.memoizedState=f}}function gSe(e,t){if(typeof e!="function")throw Error(wt(191,e));e.call(t)}function bSe(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;es?s:8;var o=si.T,l={};si.T=l,yQ(e,!1,t,n);try{var c=r(),u=si.S;if(u!==null&&u(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=YWe(c,i);VS(e,t,d,Ru(e))}else VS(e,t,i,Ru(e))}catch(f){VS(e,t,{then:function(){},status:"rejected",reason:f},Ru())}finally{Nr.p=s,o!==null&&l.types!==null&&(o.types=l.types),si.T=o}}function iKe(){}function VF(e,t,n,i){if(e.tag!==5)throw Error(wt(476));var r=QSe(e).queue;USe(e,r,t,$y,n===null?iKe:function(){return zSe(e),n(i)})}function QSe(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:$y,baseState:$y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qp,lastRenderedState:$y},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qp,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function zSe(e){var t=QSe(e);t.next===null&&(t=e.alternate.memoizedState),VS(e,t.next.queue,{},Ru())}function bQ(){return ol(YE)}function VSe(){return ja().memoizedState}function HSe(){return ja().memoizedState}function rKe(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ru();e=Eg(n);var i=Cg(t,e,n);i!==null&&(Lc(i,t,n),US(i,t,n)),t={cache:nQ()},e.payload=t;return}t=t.return}}function sKe(e,t,n){var i=Ru();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},cD(e)?WSe(t,n):(n=ZU(e,t,n,i),n!==null&&(Lc(n,e,i),KSe(n,t,i)))}function qSe(e,t,n){var i=Ru();VS(e,t,n,i)}function VS(e,t,n,i){var r={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(cD(e))WSe(t,r);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,l=s(o,n);if(r.hasEagerState=!0,r.eagerState=l,$u(l,o))return rD(e,t,r,0),us===null&&iD(),!1}catch{}finally{}if(n=ZU(e,t,r,i),n!==null)return Lc(n,e,i),KSe(n,t,i),!0}return!1}function yQ(e,t,n,i){if(i={lane:2,revertLane:AQ(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},cD(e)){if(t)throw Error(wt(479))}else t=ZU(e,n,i,2),t!==null&&Lc(t,e,2)}function cD(e){var t=e.alternate;return e===Ti||t!==null&&t===Ti}function WSe(e,t){tw=OR=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function KSe(e,t,n){if(n&4194048){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,IOe(e,n)}}var KE={readContext:ol,use:oD,useCallback:ua,useContext:ua,useEffect:ua,useImperativeHandle:ua,useLayoutEffect:ua,useInsertionEffect:ua,useMemo:ua,useReducer:ua,useRef:ua,useState:ua,useDebugValue:ua,useDeferredValue:ua,useTransition:ua,useSyncExternalStore:ua,useId:ua,useHostTransitionStatus:ua,useFormState:ua,useActionState:ua,useOptimistic:ua,useMemoCache:ua,useCacheRefresh:ua};KE.useEffectEvent=ua;var GSe={readContext:ol,use:oD,useCallback:function(e,t){return Hl().memoizedState=[e,t===void 0?null:t],e},useContext:ol,useEffect:UX,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Gj(4194308,4,MSe.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Gj(4194308,4,e,t)},useInsertionEffect:function(e,t){Gj(4,2,e,t)},useMemo:function(e,t){var n=Hl();t=t===void 0?null:t;var i=e();if(iv){cg(!0);try{e()}finally{cg(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=Hl();if(n!==void 0){var r=n(t);if(iv){cg(!0);try{n(t)}finally{cg(!1)}}}else r=t;return i.memoizedState=i.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},i.queue=e,e=e.dispatch=sKe.bind(null,Ti,e),[i.memoizedState,e]},useRef:function(e){var t=Hl();return e={current:e},t.memoizedState=e},useState:function(e){e=QF(e);var t=e.queue,n=qSe.bind(null,Ti,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:mQ,useDeferredValue:function(e,t){var n=Hl();return gQ(n,e,t)},useTransition:function(){var e=QF(!1);return e=USe.bind(null,Ti,e.queue,!0,!1),Hl().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=Ti,r=Hl();if(ur){if(n===void 0)throw Error(wt(407));n=n()}else{if(n=t(),us===null)throw Error(wt(349));ar&127||kSe(i,t,n)}r.memoizedState=n;var s={value:n,getSnapshot:t};return r.queue=s,UX(SSe.bind(null,i,s,e),[e]),i.flags|=2048,Uw(9,{destroy:void 0},OSe.bind(null,i,s,n,t),null),n},useId:function(){var e=Hl(),t=us.identifierPrefix;if(ur){var n=oh,i=ah;n=(i&~(1<<32-Nu(i)-1)).toString(32)+n,t="_"+t+"R_"+n,n=SR++,0<\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof i.is=="string"?o.createElement("select",{is:i.is}):o.createElement("select"),i.multiple?s.multiple=!0:i.size&&(s.size=i.size);break;default:s=typeof i.is=="string"?o.createElement(r,{is:i.is}):o.createElement(r)}}s[rl]=t,s[Fc]=i;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)s.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=s;e:switch(ll(s,r,i),r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Zh(t)}}return Cs(t),X5(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Zh(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(wt(166));if(e=Og.current,j0(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,r=sl,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}e[rl]=t,e=!!(e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||qEe(e.nodeValue,n)),e||Qg(t,!0)}else e=PR(e).createTextNode(i),e[rl]=t,t.stateNode=e}return Cs(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=j0(t),n!==null){if(e===null){if(!i)throw Error(wt(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(wt(557));e[rl]=t}else ev(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Cs(t),e=!1}else n=U5(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(wu(t),t):(wu(t),null);if(t.flags&128)throw Error(wt(558))}return Cs(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=j0(t),i!==null&&i.dehydrated!==null){if(e===null){if(!r)throw Error(wt(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(wt(317));r[rl]=t}else ev(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Cs(t),r=!1}else r=U5(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(wu(t),t):(wu(t),null)}return wu(t),t.flags&128?(t.lanes=n,t):(n=i!==null,e=e!==null&&e.memoizedState!==null,n&&(i=t.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool),s=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(s=i.memoizedState.cachePool.pool),s!==r&&(i.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),F2(t,t.updateQueue),Cs(t),null);case 4:return Mw(),e===null&&TQ(t.stateNode.containerInfo),Cs(t),null;case 10:return Np(t.type),Cs(t),null;case 19:if($o(Aa),i=t.memoizedState,i===null)return Cs(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)sO(i,!1);else{if(ha!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=kR(e),s!==null){for(t.flags|=128,sO(i,!1),e=s.updateQueue,t.updateQueue=e,F2(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)oSe(n,e),n=n.sibling;return Os(Aa,Aa.current&1|2),ur&&gp(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&_u()>TR&&(t.flags|=128,r=!0,sO(i,!1),t.lanes=4194304)}else{if(!r)if(e=kR(s),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,F2(t,e),sO(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!ur)return Cs(t),null}else 2*_u()-i.renderingStartTime>TR&&n!==536870912&&(t.flags|=128,r=!0,sO(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(e=i.last,e!==null?e.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=_u(),e.sibling=null,n=Aa.current,Os(Aa,r?n&1|2:n&1),ur&&gp(t,i.treeForkCount),e):(Cs(t),null);case 22:case 23:return wu(t),aQ(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?n&536870912&&!(t.flags&128)&&(Cs(t),t.subtreeFlags&6&&(t.flags|=8192)):Cs(t),n=t.updateQueue,n!==null&&F2(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),e!==null&&$o(By),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Np(Ga),Cs(t),null;case 25:return null;case 30:return null}throw Error(wt(156,t.tag))}function uKe(e,t){switch(tQ(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Np(Ga),Mw(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return hR(t),null;case 31:if(t.memoizedState!==null){if(wu(t),t.alternate===null)throw Error(wt(340));ev()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(wu(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(wt(340));ev()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $o(Aa),null;case 4:return Mw(),null;case 10:return Np(t.type),null;case 22:case 23:return wu(t),aQ(),e!==null&&$o(By),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Np(Ga),null;case 25:return null;default:return null}}function oEe(e,t){switch(tQ(t),t.tag){case 3:Np(Ga),Mw();break;case 26:case 27:case 5:hR(t);break;case 4:Mw();break;case 31:t.memoizedState!==null&&wu(t);break;case 13:wu(t);break;case 19:$o(Aa);break;case 10:Np(t.type);break;case 22:case 23:wu(t),aQ(),e!==null&&$o(By);break;case 24:Np(Ga)}}function RA(e,t){try{var n=t.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&e)===e){i=void 0;var s=n.create,o=n.inst;i=s(),o.destroy=i}n=n.next}while(n!==r)}}catch(l){Wr(t,t.return,l)}}function zg(e,t,n){try{var i=t.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var s=r.next;i=s;do{if((i.tag&e)===e){var o=i.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,r=t;var c=n,u=l;try{u()}catch(d){Wr(r,c,d)}}}i=i.next}while(i!==s)}}catch(d){Wr(t,t.return,d)}}function lEe(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{bSe(t,n)}catch(i){Wr(e,e.return,i)}}}function cEe(e,t,n){n.props=rv(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){Wr(e,t,i)}}function HS(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof n=="function"?e.refCleanup=n(i):n.current=i}}catch(r){Wr(e,t,r)}}function lh(e,t){var n=e.ref,i=e.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){Wr(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){Wr(e,t,r)}else n.current=null}function uEe(e){var t=e.type,n=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(r){Wr(e,e.return,r)}}function Y5(e,t,n){try{var i=e.stateNode;RKe(i,e.type,n,t),i[Fc]=t}catch(r){Wr(e,e.return,r)}}function dEe(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&xb(e.type)||e.tag===4}function Z5(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||dEe(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&xb(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function GF(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ep));else if(i!==4&&(i===27&&xb(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(GF(e,t,n),e=e.sibling;e!==null;)GF(e,t,n),e=e.sibling}function AR(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(i===27&&xb(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(AR(e,t,n),e=e.sibling;e!==null;)AR(e,t,n),e=e.sibling}function fEe(e){var t=e.stateNode,n=e.memoizedProps;try{for(var i=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);ll(t,i,n),t[rl]=e,t[Fc]=n}catch(s){Wr(e,e.return,s)}}var vp=!1,Ka=!1,J5=!1,eY=typeof WeakSet=="function"?WeakSet:Set,jo=null;function dKe(e,t){if(e=e.containerInfo,n8=$R,e=JOe(e),XU(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var m;f!==n||r!==0&&f.nodeType!==3||(l=o+r),f!==s||i!==0&&f.nodeType!==3||(c=o+i),f.nodeType===3&&(o+=f.nodeValue.length),(m=f.firstChild)!==null;)h=f,f=m;for(;;){if(f===e)break t;if(h===n&&++u===r&&(l=o),h===s&&++d===i&&(c=o),(m=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(i8={focusedElem:e,selectionRange:n},$R=!1,jo=t;jo!==null;)if(t=jo,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,jo=e;else for(;jo!==null;){switch(t=jo,s=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n title"))),ll(s,i,n),s[rl]=e,Ro(s),i=s;break e;case"link":var o=xY("link","href",r).get(i+(n.href||""));if(o){for(var l=0;lv&&(o=v,v=b,b=o);var y=EX(l,b),w=EX(l,v);if(y&&w&&(m.rangeCount!==1||m.anchorNode!==y.node||m.anchorOffset!==y.offset||m.focusNode!==w.node||m.focusOffset!==w.offset)){var x=f.createRange();x.setStart(y.node,y.offset),m.removeAllRanges(),b>v?(m.addRange(x),m.extend(w.node,w.offset)):(x.setEnd(w.node,w.offset),m.addRange(x))}}}}for(f=[],m=l;m=m.parentNode;)m.nodeType===1&&f.push({element:m,left:m.scrollLeft,top:m.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;ln?32:n,si.T=null,n=ZF,ZF=null;var s=Tg,o=Rp;if(uo=0,zw=Tg=null,Rp=0,jr&6)throw Error(wt(331));var l=jr;if(jr|=4,OEe(s.current),xEe(s,s.current,o,n),jr=l,IA(0,!1),ju&&typeof ju.onPostCommitFiberRoot=="function")try{ju.onPostCommitFiberRoot(EA,s)}catch{}return!0}finally{Nr.p=r,si.T=i,$Ee(e,t)}}function rY(e,t,n){t=ld(n,t),t=qF(e.stateNode,t,2),e=Cg(e,t,2),e!==null&&(AA(e,2),Nh(e))}function Wr(e,t,n){if(e.tag===3)rY(e,e,n);else for(;t!==null;){if(t.tag===3){rY(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Ag===null||!Ag.has(i))){e=ld(n,e),n=eEe(2),i=Cg(t,n,2),i!==null&&(tEe(n,i,t,e),AA(i,2),Nh(i));break}}t=t.return}}function t3(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new pKe;var r=new Set;i.set(t,r)}else r=i.get(t),r===void 0&&(r=new Set,i.set(t,r));r.has(n)||(SQ=!0,r.add(n),e=vKe.bind(null,e,t,n),t.then(e,e))}function vKe(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,us===e&&(ar&n)===n&&(ha===4||ha===3&&(ar&62914560)===ar&&300>_u()-uD?!(jr&2)&&Vw(e,0):EQ|=n,Qw===ar&&(Qw=0)),Nh(e)}function BEe(e,t){t===0&&(t=NOe()),e=Iv(e,t),e!==null&&(AA(e,t),Nh(e))}function xKe(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),BEe(e,n)}function wKe(e,t){var n=0;switch(e.tag){case 31:case 13:var i=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(wt(314))}i!==null&&i.delete(t),BEe(e,n)}function kKe(e,t){return UU(e,t)}var NR=null,rx=null,e8=!1,RR=!1,n3=!1,hg=0;function Nh(e){e!==rx&&e.next===null&&(rx===null?NR=rx=e:rx=rx.next=e),RR=!0,e8||(e8=!0,SKe())}function IA(e,t){if(!n3&&RR){n3=!0;do for(var n=!1,i=NR;i!==null;){if(e!==0){var r=i.pendingLanes;if(r===0)var s=0;else{var o=i.suspendedLanes,l=i.pingedLanes;s=(1<<31-Nu(42|e)+1)-1,s&=r&~(o&~l),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,sY(i,s))}else s=ar,s=JP(i,i===us?s:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),!(s&3)||CA(i,s)||(n=!0,sY(i,s));i=i.next}while(n);n3=!1}}function OKe(){UEe()}function UEe(){RR=e8=!1;var e=0;hg!==0&&PKe()&&(e=hg);for(var t=_u(),n=null,i=NR;i!==null;){var r=i.next,s=QEe(i,t);s===0?(i.next=null,n===null?NR=r:n.next=r,r===null&&(rx=n)):(n=i,(e!==0||s&3)&&(RR=!0)),i=r}uo!==0&&uo!==5||IA(e),hg!==0&&(hg=0)}function QEe(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,r=e.expirationTimes,s=e.pendingLanes&-62914561;0l)break;var d=c.transferSize,f=c.initiatorType;d&&uY(f)&&(c=c.responseEnd,o+=d*(c"u"?null:document;function YEe(e,t,n){var i=$1;if(i&&typeof t=="string"&&t){var r=od(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),bY.has(r)||(bY.add(r),e={rel:e,crossOrigin:n,href:t},i.querySelector(r)===null&&(t=i.createElement("link"),ll(t,"link",e),Ro(t),i.head.appendChild(t)))}}function zKe(e){dm.D(e),YEe("dns-prefetch",e,null)}function VKe(e,t){dm.C(e,t),YEe("preconnect",e,t)}function HKe(e,t,n){dm.L(e,t,n);var i=$1;if(i&&e&&t){var r='link[rel="preload"][as="'+od(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+od(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+od(n.imageSizes)+'"]')):r+='[href="'+od(e)+'"]';var s=r;switch(t){case"style":s=Hw(e);break;case"script":s=F1(e)}Ad.has(s)||(e=Ds({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Ad.set(s,e),i.querySelector(r)!==null||t==="style"&&i.querySelector(PA(s))||t==="script"&&i.querySelector(DA(s))||(t=i.createElement("link"),ll(t,"link",e),Ro(t),i.head.appendChild(t)))}}function qKe(e,t){dm.m(e,t);var n=$1;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+od(i)+'"][href="'+od(e)+'"]',s=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=F1(e)}if(!Ad.has(s)&&(e=Ds({rel:"modulepreload",href:e},t),Ad.set(s,e),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(DA(s)))return}i=n.createElement("link"),ll(i,"link",e),Ro(i),n.head.appendChild(i)}}}function WKe(e,t,n){dm.S(e,t,n);var i=$1;if(i&&e){var r=Xx(i).hoistableStyles,s=Hw(e);t=t||"default";var o=r.get(s);if(!o){var l={loading:0,preload:null};if(o=i.querySelector(PA(s)))l.loading=5;else{e=Ds({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Ad.get(s))&&_Q(e,n);var c=o=i.createElement("link");Ro(c),ll(c,"link",e),c._p=new Promise(function(u,d){c.onload=u,c.onerror=d}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,Jj(o,t,i)}o={type:"stylesheet",instance:o,count:1,state:l},r.set(s,o)}}}function KKe(e,t){dm.X(e,t);var n=$1;if(n&&e){var i=Xx(n).hoistableScripts,r=F1(e),s=i.get(r);s||(s=n.querySelector(DA(r)),s||(e=Ds({src:e,async:!0},t),(t=Ad.get(r))&&jQ(e,t),s=n.createElement("script"),Ro(s),ll(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function GKe(e,t){dm.M(e,t);var n=$1;if(n&&e){var i=Xx(n).hoistableScripts,r=F1(e),s=i.get(r);s||(s=n.querySelector(DA(r)),s||(e=Ds({src:e,async:!0,type:"module"},t),(t=Ad.get(r))&&jQ(e,t),s=n.createElement("script"),Ro(s),ll(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function yY(e,t,n,i){var r=(r=Og.current)?DR(r):null;if(!r)throw Error(wt(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Hw(n.href),n=Xx(r).hoistableStyles,i=n.get(t),i||(i={type:"style",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Hw(n.href);var s=Xx(r).hoistableStyles,o=s.get(e);if(o||(r=r.ownerDocument||r,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,o),(s=r.querySelector(PA(e)))&&!s._p&&(o.instance=s,o.state.loading=5),Ad.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Ad.set(e,n),s||XKe(r,e,n,o.state))),t&&i===null)throw Error(wt(528,""));return o}if(t&&i!==null)throw Error(wt(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=F1(n),n=Xx(r).hoistableScripts,i=n.get(t),i||(i={type:"script",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(wt(444,e))}}function Hw(e){return'href="'+od(e)+'"'}function PA(e){return'link[rel="stylesheet"]['+e+"]"}function ZEe(e){return Ds({},e,{"data-precedence":e.precedence,precedence:null})}function XKe(e,t,n,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),ll(t,"link",n),Ro(t),e.head.appendChild(t))}function F1(e){return'[src="'+od(e)+'"]'}function DA(e){return"script[async]"+e}function vY(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+od(n.href)+'"]');if(i)return t.instance=i,Ro(i),i;var r=Ds({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Ro(i),ll(i,"style",r),Jj(i,n.precedence,e),t.instance=i;case"stylesheet":r=Hw(n.href);var s=e.querySelector(PA(r));if(s)return t.state.loading|=4,t.instance=s,Ro(s),s;i=ZEe(n),(r=Ad.get(r))&&_Q(i,r),s=(e.ownerDocument||e).createElement("link"),Ro(s);var o=s;return o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),ll(s,"link",i),t.state.loading|=4,Jj(s,n.precedence,e),t.instance=s;case"script":return s=F1(n.src),(r=e.querySelector(DA(s)))?(t.instance=r,Ro(r),r):(i=n,(r=Ad.get(s))&&(i=Ds({},n),jQ(i,r)),e=e.ownerDocument||e,r=e.createElement("script"),Ro(r),ll(r,"link",i),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(wt(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(i=t.instance,t.state.loading|=4,Jj(i,n.precedence,e));return t.instance}function Jj(e,t,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,s=r,o=0;o title"):null)}function YKe(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function JEe(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function ZKe(e,t,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&!(n.state.loading&4)){if(n.instance===null){var r=Hw(i.href),s=t.querySelector(PA(r));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=MR.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=s,Ro(s);return}s=t.ownerDocument||t,i=ZEe(i),(r=Ad.get(r))&&_Q(i,r),s=s.createElement("link"),Ro(s);var o=s;o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),ll(s,"link",i),n.instance=s}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=MR.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var l3=0;function JKe(e,t){return e.stylesheets&&e.count===0&&tN(e,e.stylesheets),0l3?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(r)}}:null}function MR(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)tN(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var LR=null;function tN(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,LR=new Map,t.forEach(eGe,e),LR=null,MR.call(e))}function eGe(e,t){if(!(t.state.loading&4)){var n=LR.get(e);if(n)var i=n.get(null);else{n=new Map,LR.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(oCe)}catch(e){console.error(e)}}oCe(),mOe.exports=YP;var lGe=mOe.exports;const cGe=N1(lGe),DQ=p.createContext({});function mD(e){const t=p.useRef(null);return t.current===null&&(t.current=e()),t.current}const gD=p.createContext(null),eC=p.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class uGe extends p.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function dGe({children:e,isPresent:t}){const n=p.useId(),i=p.useRef(null),r=p.useRef({width:0,height:0,top:0,left:0}),{nonce:s}=p.useContext(eC);return p.useInsertionEffect(()=>{const{width:o,height:l,top:c,left:u}=r.current;if(t||!i.current||!o||!l)return;i.current.dataset.motionPopId=n;const d=document.createElement("style");return s&&(d.nonce=s),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(` +`+i.stack}}var OF=Object.prototype.hasOwnProperty,UU=ho.unstable_scheduleCallback,j5=ho.unstable_cancelCallback,Qqe=ho.unstable_shouldYield,zqe=ho.unstable_requestPaint,_u=ho.unstable_now,Vqe=ho.unstable_getCurrentPriorityLevel,_Oe=ho.unstable_ImmediatePriority,jOe=ho.unstable_UserBlockingPriority,pR=ho.unstable_NormalPriority,Hqe=ho.unstable_LowPriority,NOe=ho.unstable_IdlePriority,qqe=ho.log,Wqe=ho.unstable_setDisableYieldValue,EA=null,ju=null;function cg(e){if(typeof qqe=="function"&&Wqe(e),ju&&typeof ju.setStrictMode=="function")try{ju.setStrictMode(EA,e)}catch{}}var Nu=Math.clz32?Math.clz32:Xqe,Kqe=Math.log,Gqe=Math.LN2;function Xqe(e){return e>>>=0,e===0?32:31-(Kqe(e)/Gqe|0)|0}var N2=256,R2=262144,I2=4194304;function ny(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function JP(e,t,n){var i=e.pendingLanes;if(i===0)return 0;var r=0,s=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var l=i&134217727;return l!==0?(i=l&~s,i!==0?r=ny(i):(o&=l,o!==0?r=ny(o):n||(n=l&~e,n!==0&&(r=ny(n))))):(l=i&~s,l!==0?r=ny(l):o!==0?r=ny(o):n||(n=i&~e,n!==0&&(r=ny(n)))),r===0?0:t!==0&&t!==r&&!(t&s)&&(s=r&-r,n=t&-t,s>=n||s===32&&(n&4194048)!==0)?t:r}function CA(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Yqe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 ROe(){var e=I2;return I2<<=1,!(I2&62914560)&&(I2=4194304),e}function N5(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function AA(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Zqe(e,t,n,i,r,s){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var l=e.entanglements,c=e.expirationTimes,u=e.hiddenUpdates;for(n=o&~n;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var rWe=/[\n"\\]/g;function od(e){return e.replace(rWe,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function CF(e,t,n,i,r,s,o,l){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+nd(t)):e.value!==""+nd(t)&&(e.value=""+nd(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?AF(e,o,nd(t)):n!=null?AF(e,o,nd(n)):i!=null&&e.removeAttribute("value"),r==null&&s!=null&&(e.defaultChecked=!!s),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+nd(l):e.removeAttribute("name")}function UOe(e,t,n,i,r,s,o,l){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.type=s),t!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||t!=null)){EF(e);return}n=n!=null?""+nd(n):"",t=t!=null?""+nd(t):n,l||t===e.value||(e.value=t),e.defaultValue=t}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=l?e.checked:!!i,e.defaultChecked=!!i,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o),EF(e)}function AF(e,t,n){t==="number"&&mR(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Yx(e,t,n,i){if(e=e.options,t){t={};for(var r=0;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_F=!1;if(Vp)try{var nO={};Object.defineProperty(nO,"passive",{get:function(){_F=!0}}),window.addEventListener("test",nO,nO),window.removeEventListener("test",nO,nO)}catch{_F=!1}var ug=null,WU=null,Vj=null;function qOe(){if(Vj)return Vj;var e,t=WU,n=t.length,i,r="value"in ug?ug.value:ug.textContent,s=r.length;for(e=0;e=LS),yX=" ",vX=!1;function KOe(e,t){switch(e){case"keyup":return RWe.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function GOe(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Sx=!1;function PWe(e,t){switch(e){case"compositionend":return GOe(t);case"keypress":return t.which!==32?null:(vX=!0,yX);case"textInput":return e=t.data,e===yX&&vX?null:e;default:return null}}function DWe(e,t){if(Sx)return e==="compositionend"||!GU&&KOe(e,t)?(e=qOe(),Vj=WU=ug=null,Sx=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=SX(n)}}function JOe(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?JOe(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function eSe(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=mR(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=mR(e.document)}return t}function XU(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var zWe=Vp&&"documentMode"in document&&11>=document.documentMode,Ex=null,jF=null,FS=null,NF=!1;function CX(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;NF||Ex==null||Ex!==mR(i)||(i=Ex,"selectionStart"in i&&XU(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),FS&&zE(FS,i)||(FS=i,i=IR(jF,"onSelect"),0>=o,r-=o,ah=1<<32-Nu(t)+r|n<E?(j=A,A=null):j=A.sibling;var T=h(y,A,x[E],k);if(T===null){A===null&&(A=j);break}e&&A&&T.alternate===null&&t(y,A),w=s(T,w,E),O===null?S=T:O.sibling=T,O=T,A=j}if(E===x.length)return n(y,A),ur&&gp(y,E),S;if(A===null){for(;EE?(j=A,A=null):j=A.sibling;var R=h(y,A,T.value,k);if(R===null){A===null&&(A=j);break}e&&A&&R.alternate===null&&t(y,A),w=s(R,w,E),O===null?S=R:O.sibling=R,O=R,A=j}if(T.done)return n(y,A),ur&&gp(y,E),S;if(A===null){for(;!T.done;E++,T=x.next())T=f(y,T.value,k),T!==null&&(w=s(T,w,E),O===null?S=T:O.sibling=T,O=T);return ur&&gp(y,E),S}for(A=i(A);!T.done;E++,T=x.next())T=m(A,y,E,T.value,k),T!==null&&(e&&T.alternate!==null&&A.delete(T.key===null?E:T.key),w=s(T,w,E),O===null?S=T:O.sibling=T,O=T);return e&&A.forEach(function(C){return t(y,C)}),ur&&gp(y,E),S}function v(y,w,x,k){if(typeof x=="object"&&x!==null&&x.type===xx&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case j2:e:{for(var S=x.key;w!==null;){if(w.key===S){if(S=x.type,S===xx){if(w.tag===7){n(y,w.sibling),k=r(w,x.props.children),k.return=y,y=k;break e}}else if(w.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Hm&&iy(S)===w.type){n(y,w.sibling),k=r(w,x.props),rO(k,x),k.return=y,y=k;break e}n(y,w);break}else t(y,w);w=w.sibling}x.type===xx?(k=Fy(x.props.children,y.mode,k,x.key),k.return=y,y=k):(k=qj(x.type,x.key,x.props,null,y.mode,k),rO(k,x),k.return=y,y=k)}return o(y);case iS:e:{for(S=x.key;w!==null;){if(w.key===S)if(w.tag===4&&w.stateNode.containerInfo===x.containerInfo&&w.stateNode.implementation===x.implementation){n(y,w.sibling),k=r(w,x.children||[]),k.return=y,y=k;break e}else{n(y,w);break}else t(y,w);w=w.sibling}k=B5(x,y.mode,k),k.return=y,y=k}return o(y);case Hm:return x=iy(x),v(y,w,x,k)}if(rS(x))return g(y,w,x,k);if(tO(x)){if(S=tO(x),typeof S!="function")throw Error(wt(150));return x=S.call(x),b(y,w,x,k)}if(typeof x.then=="function")return v(y,w,L2(x),k);if(x.$$typeof===Sp)return v(y,w,M2(y,x),k);$2(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint"?(x=""+x,w!==null&&w.tag===6?(n(y,w.sibling),k=r(w,x),k.return=y,y=k):(n(y,w),k=F5(x,y.mode,k),k.return=y,y=k),o(y)):n(y,w)}return function(y,w,x,k){try{qE=0;var S=v(y,w,x,k);return ew=null,S}catch(A){if(A===M1||A===sD)throw A;var O=ku(29,A,null,y.mode);return O.lanes=k,O.return=y,O}finally{}}}var nv=mSe(!0),gSe=mSe(!1),qm=!1;function sQ(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $F(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Eg(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Cg(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,jr&2){var r=i.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),i.pending=t,t=bR(e),oSe(e,null,n),t}return rD(e,i,t,n),bR(e)}function US(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,POe(e,n)}}function Q5(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?r=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?r=s=t:s=s.next=t}else r=s=t;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:i.shared,callbacks:i.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var FF=!1;function QS(){if(FF){var e=Jx;if(e!==null)throw e}}function zS(e,t,n,i){FF=!1;var r=e.updateQueue;qm=!1;var s=r.firstBaseUpdate,o=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?s=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(s!==null){var f=r.baseState;o=0,d=u=c=null,l=s;do{var h=l.lane&-536870913,m=h!==l.lane;if(m?(ar&h)===h:(i&h)===h){h!==0&&h===Fw&&(FF=!0),d!==null&&(d=d.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var g=e,b=l;h=t;var v=n;switch(b.tag){case 1:if(g=b.payload,typeof g=="function"){f=g.call(v,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=b.payload,h=typeof g=="function"?g.call(v,f,h):g,h==null)break e;f=Ds({},f,h);break e;case 2:qm=!0}}h=l.callback,h!==null&&(e.flags|=64,m&&(e.flags|=8192),m=r.callbacks,m===null?r.callbacks=[h]:m.push(h))}else m={lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=m,c=f):d=d.next=m,o|=h;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;m=l,l=m.next,m.next=null,r.lastBaseUpdate=m,r.shared.pending=null}}while(!0);d===null&&(c=f),r.baseState=c,r.firstBaseUpdate=u,r.lastBaseUpdate=d,s===null&&(r.shared.lanes=0),Vg|=o,e.lanes=o,e.memoizedState=f}}function bSe(e,t){if(typeof e!="function")throw Error(wt(191,e));e.call(t)}function ySe(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;es?s:8;var o=si.T,l={};si.T=l,yQ(e,!1,t,n);try{var c=r(),u=si.S;if(u!==null&&u(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=ZWe(c,i);VS(e,t,d,Ru(e))}else VS(e,t,i,Ru(e))}catch(f){VS(e,t,{then:function(){},status:"rejected",reason:f},Ru())}finally{Nr.p=s,o!==null&&l.types!==null&&(o.types=l.types),si.T=o}}function rKe(){}function VF(e,t,n,i){if(e.tag!==5)throw Error(wt(476));var r=zSe(e).queue;QSe(e,r,t,$y,n===null?rKe:function(){return VSe(e),n(i)})}function zSe(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:$y,baseState:$y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qp,lastRenderedState:$y},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qp,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function VSe(e){var t=zSe(e);t.next===null&&(t=e.alternate.memoizedState),VS(e,t.next.queue,{},Ru())}function bQ(){return ol(YE)}function HSe(){return ja().memoizedState}function qSe(){return ja().memoizedState}function sKe(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ru();e=Eg(n);var i=Cg(t,e,n);i!==null&&(Lc(i,t,n),US(i,t,n)),t={cache:nQ()},e.payload=t;return}t=t.return}}function aKe(e,t,n){var i=Ru();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},cD(e)?KSe(t,n):(n=ZU(e,t,n,i),n!==null&&(Lc(n,e,i),GSe(n,t,i)))}function WSe(e,t,n){var i=Ru();VS(e,t,n,i)}function VS(e,t,n,i){var r={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(cD(e))KSe(t,r);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,l=s(o,n);if(r.hasEagerState=!0,r.eagerState=l,$u(l,o))return rD(e,t,r,0),us===null&&iD(),!1}catch{}finally{}if(n=ZU(e,t,r,i),n!==null)return Lc(n,e,i),GSe(n,t,i),!0}return!1}function yQ(e,t,n,i){if(i={lane:2,revertLane:AQ(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},cD(e)){if(t)throw Error(wt(479))}else t=ZU(e,n,i,2),t!==null&&Lc(t,e,2)}function cD(e){var t=e.alternate;return e===Ti||t!==null&&t===Ti}function KSe(e,t){tw=OR=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function GSe(e,t,n){if(n&4194048){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,POe(e,n)}}var KE={readContext:ol,use:oD,useCallback:ua,useContext:ua,useEffect:ua,useImperativeHandle:ua,useLayoutEffect:ua,useInsertionEffect:ua,useMemo:ua,useReducer:ua,useRef:ua,useState:ua,useDebugValue:ua,useDeferredValue:ua,useTransition:ua,useSyncExternalStore:ua,useId:ua,useHostTransitionStatus:ua,useFormState:ua,useActionState:ua,useOptimistic:ua,useMemoCache:ua,useCacheRefresh:ua};KE.useEffectEvent=ua;var XSe={readContext:ol,use:oD,useCallback:function(e,t){return Hl().memoizedState=[e,t===void 0?null:t],e},useContext:ol,useEffect:UX,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Gj(4194308,4,LSe.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Gj(4194308,4,e,t)},useInsertionEffect:function(e,t){Gj(4,2,e,t)},useMemo:function(e,t){var n=Hl();t=t===void 0?null:t;var i=e();if(iv){cg(!0);try{e()}finally{cg(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=Hl();if(n!==void 0){var r=n(t);if(iv){cg(!0);try{n(t)}finally{cg(!1)}}}else r=t;return i.memoizedState=i.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},i.queue=e,e=e.dispatch=aKe.bind(null,Ti,e),[i.memoizedState,e]},useRef:function(e){var t=Hl();return e={current:e},t.memoizedState=e},useState:function(e){e=QF(e);var t=e.queue,n=WSe.bind(null,Ti,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:mQ,useDeferredValue:function(e,t){var n=Hl();return gQ(n,e,t)},useTransition:function(){var e=QF(!1);return e=QSe.bind(null,Ti,e.queue,!0,!1),Hl().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=Ti,r=Hl();if(ur){if(n===void 0)throw Error(wt(407));n=n()}else{if(n=t(),us===null)throw Error(wt(349));ar&127||OSe(i,t,n)}r.memoizedState=n;var s={value:n,getSnapshot:t};return r.queue=s,UX(ESe.bind(null,i,s,e),[e]),i.flags|=2048,Uw(9,{destroy:void 0},SSe.bind(null,i,s,n,t),null),n},useId:function(){var e=Hl(),t=us.identifierPrefix;if(ur){var n=oh,i=ah;n=(i&~(1<<32-Nu(i)-1)).toString(32)+n,t="_"+t+"R_"+n,n=SR++,0<\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof i.is=="string"?o.createElement("select",{is:i.is}):o.createElement("select"),i.multiple?s.multiple=!0:i.size&&(s.size=i.size);break;default:s=typeof i.is=="string"?o.createElement(r,{is:i.is}):o.createElement(r)}}s[rl]=t,s[Fc]=i;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)s.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=s;e:switch(ll(s,r,i),r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Zh(t)}}return Cs(t),X5(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Zh(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(wt(166));if(e=Og.current,j0(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,r=sl,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}e[rl]=t,e=!!(e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||WEe(e.nodeValue,n)),e||Qg(t,!0)}else e=PR(e).createTextNode(i),e[rl]=t,t.stateNode=e}return Cs(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=j0(t),n!==null){if(e===null){if(!i)throw Error(wt(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(wt(557));e[rl]=t}else ev(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Cs(t),e=!1}else n=U5(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(wu(t),t):(wu(t),null);if(t.flags&128)throw Error(wt(558))}return Cs(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=j0(t),i!==null&&i.dehydrated!==null){if(e===null){if(!r)throw Error(wt(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(wt(317));r[rl]=t}else ev(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Cs(t),r=!1}else r=U5(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(wu(t),t):(wu(t),null)}return wu(t),t.flags&128?(t.lanes=n,t):(n=i!==null,e=e!==null&&e.memoizedState!==null,n&&(i=t.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool),s=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(s=i.memoizedState.cachePool.pool),s!==r&&(i.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),F2(t,t.updateQueue),Cs(t),null);case 4:return Mw(),e===null&&TQ(t.stateNode.containerInfo),Cs(t),null;case 10:return Np(t.type),Cs(t),null;case 19:if($o(Aa),i=t.memoizedState,i===null)return Cs(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)sO(i,!1);else{if(ha!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=kR(e),s!==null){for(t.flags|=128,sO(i,!1),e=s.updateQueue,t.updateQueue=e,F2(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)lSe(n,e),n=n.sibling;return Os(Aa,Aa.current&1|2),ur&&gp(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&_u()>TR&&(t.flags|=128,r=!0,sO(i,!1),t.lanes=4194304)}else{if(!r)if(e=kR(s),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,F2(t,e),sO(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!ur)return Cs(t),null}else 2*_u()-i.renderingStartTime>TR&&n!==536870912&&(t.flags|=128,r=!0,sO(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(e=i.last,e!==null?e.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=_u(),e.sibling=null,n=Aa.current,Os(Aa,r?n&1|2:n&1),ur&&gp(t,i.treeForkCount),e):(Cs(t),null);case 22:case 23:return wu(t),aQ(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?n&536870912&&!(t.flags&128)&&(Cs(t),t.subtreeFlags&6&&(t.flags|=8192)):Cs(t),n=t.updateQueue,n!==null&&F2(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),e!==null&&$o(By),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Np(Ga),Cs(t),null;case 25:return null;case 30:return null}throw Error(wt(156,t.tag))}function dKe(e,t){switch(tQ(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Np(Ga),Mw(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return hR(t),null;case 31:if(t.memoizedState!==null){if(wu(t),t.alternate===null)throw Error(wt(340));ev()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(wu(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(wt(340));ev()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $o(Aa),null;case 4:return Mw(),null;case 10:return Np(t.type),null;case 22:case 23:return wu(t),aQ(),e!==null&&$o(By),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Np(Ga),null;case 25:return null;default:return null}}function lEe(e,t){switch(tQ(t),t.tag){case 3:Np(Ga),Mw();break;case 26:case 27:case 5:hR(t);break;case 4:Mw();break;case 31:t.memoizedState!==null&&wu(t);break;case 13:wu(t);break;case 19:$o(Aa);break;case 10:Np(t.type);break;case 22:case 23:wu(t),aQ(),e!==null&&$o(By);break;case 24:Np(Ga)}}function RA(e,t){try{var n=t.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&e)===e){i=void 0;var s=n.create,o=n.inst;i=s(),o.destroy=i}n=n.next}while(n!==r)}}catch(l){Wr(t,t.return,l)}}function zg(e,t,n){try{var i=t.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var s=r.next;i=s;do{if((i.tag&e)===e){var o=i.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,r=t;var c=n,u=l;try{u()}catch(d){Wr(r,c,d)}}}i=i.next}while(i!==s)}}catch(d){Wr(t,t.return,d)}}function cEe(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{ySe(t,n)}catch(i){Wr(e,e.return,i)}}}function uEe(e,t,n){n.props=rv(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){Wr(e,t,i)}}function HS(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof n=="function"?e.refCleanup=n(i):n.current=i}}catch(r){Wr(e,t,r)}}function lh(e,t){var n=e.ref,i=e.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){Wr(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){Wr(e,t,r)}else n.current=null}function dEe(e){var t=e.type,n=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(r){Wr(e,e.return,r)}}function Y5(e,t,n){try{var i=e.stateNode;IKe(i,e.type,n,t),i[Fc]=t}catch(r){Wr(e,e.return,r)}}function fEe(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&xb(e.type)||e.tag===4}function Z5(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||fEe(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&xb(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function GF(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ep));else if(i!==4&&(i===27&&xb(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(GF(e,t,n),e=e.sibling;e!==null;)GF(e,t,n),e=e.sibling}function AR(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(i===27&&xb(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(AR(e,t,n),e=e.sibling;e!==null;)AR(e,t,n),e=e.sibling}function hEe(e){var t=e.stateNode,n=e.memoizedProps;try{for(var i=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);ll(t,i,n),t[rl]=e,t[Fc]=n}catch(s){Wr(e,e.return,s)}}var vp=!1,Ka=!1,J5=!1,eY=typeof WeakSet=="function"?WeakSet:Set,jo=null;function fKe(e,t){if(e=e.containerInfo,n8=$R,e=eSe(e),XU(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var m;f!==n||r!==0&&f.nodeType!==3||(l=o+r),f!==s||i!==0&&f.nodeType!==3||(c=o+i),f.nodeType===3&&(o+=f.nodeValue.length),(m=f.firstChild)!==null;)h=f,f=m;for(;;){if(f===e)break t;if(h===n&&++u===r&&(l=o),h===s&&++d===i&&(c=o),(m=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(i8={focusedElem:e,selectionRange:n},$R=!1,jo=t;jo!==null;)if(t=jo,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,jo=e;else for(;jo!==null;){switch(t=jo,s=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n title"))),ll(s,i,n),s[rl]=e,Ro(s),i=s;break e;case"link":var o=xY("link","href",r).get(i+(n.href||""));if(o){for(var l=0;lv&&(o=v,v=b,b=o);var y=EX(l,b),w=EX(l,v);if(y&&w&&(m.rangeCount!==1||m.anchorNode!==y.node||m.anchorOffset!==y.offset||m.focusNode!==w.node||m.focusOffset!==w.offset)){var x=f.createRange();x.setStart(y.node,y.offset),m.removeAllRanges(),b>v?(m.addRange(x),m.extend(w.node,w.offset)):(x.setEnd(w.node,w.offset),m.addRange(x))}}}}for(f=[],m=l;m=m.parentNode;)m.nodeType===1&&f.push({element:m,left:m.scrollLeft,top:m.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;ln?32:n,si.T=null,n=ZF,ZF=null;var s=Tg,o=Rp;if(uo=0,zw=Tg=null,Rp=0,jr&6)throw Error(wt(331));var l=jr;if(jr|=4,SEe(s.current),wEe(s,s.current,o,n),jr=l,IA(0,!1),ju&&typeof ju.onPostCommitFiberRoot=="function")try{ju.onPostCommitFiberRoot(EA,s)}catch{}return!0}finally{Nr.p=r,si.T=i,FEe(e,t)}}function rY(e,t,n){t=ld(n,t),t=qF(e.stateNode,t,2),e=Cg(e,t,2),e!==null&&(AA(e,2),Nh(e))}function Wr(e,t,n){if(e.tag===3)rY(e,e,n);else for(;t!==null;){if(t.tag===3){rY(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Ag===null||!Ag.has(i))){e=ld(n,e),n=tEe(2),i=Cg(t,n,2),i!==null&&(nEe(n,i,t,e),AA(i,2),Nh(i));break}}t=t.return}}function t3(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new mKe;var r=new Set;i.set(t,r)}else r=i.get(t),r===void 0&&(r=new Set,i.set(t,r));r.has(n)||(SQ=!0,r.add(n),e=xKe.bind(null,e,t,n),t.then(e,e))}function xKe(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,us===e&&(ar&n)===n&&(ha===4||ha===3&&(ar&62914560)===ar&&300>_u()-uD?!(jr&2)&&Vw(e,0):EQ|=n,Qw===ar&&(Qw=0)),Nh(e)}function UEe(e,t){t===0&&(t=ROe()),e=Iv(e,t),e!==null&&(AA(e,t),Nh(e))}function wKe(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),UEe(e,n)}function kKe(e,t){var n=0;switch(e.tag){case 31:case 13:var i=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(wt(314))}i!==null&&i.delete(t),UEe(e,n)}function OKe(e,t){return UU(e,t)}var NR=null,rx=null,e8=!1,RR=!1,n3=!1,hg=0;function Nh(e){e!==rx&&e.next===null&&(rx===null?NR=rx=e:rx=rx.next=e),RR=!0,e8||(e8=!0,EKe())}function IA(e,t){if(!n3&&RR){n3=!0;do for(var n=!1,i=NR;i!==null;){if(e!==0){var r=i.pendingLanes;if(r===0)var s=0;else{var o=i.suspendedLanes,l=i.pingedLanes;s=(1<<31-Nu(42|e)+1)-1,s&=r&~(o&~l),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,sY(i,s))}else s=ar,s=JP(i,i===us?s:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),!(s&3)||CA(i,s)||(n=!0,sY(i,s));i=i.next}while(n);n3=!1}}function SKe(){QEe()}function QEe(){RR=e8=!1;var e=0;hg!==0&&DKe()&&(e=hg);for(var t=_u(),n=null,i=NR;i!==null;){var r=i.next,s=zEe(i,t);s===0?(i.next=null,n===null?NR=r:n.next=r,r===null&&(rx=n)):(n=i,(e!==0||s&3)&&(RR=!0)),i=r}uo!==0&&uo!==5||IA(e),hg!==0&&(hg=0)}function zEe(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,r=e.expirationTimes,s=e.pendingLanes&-62914561;0l)break;var d=c.transferSize,f=c.initiatorType;d&&uY(f)&&(c=c.responseEnd,o+=d*(c"u"?null:document;function ZEe(e,t,n){var i=$1;if(i&&typeof t=="string"&&t){var r=od(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),bY.has(r)||(bY.add(r),e={rel:e,crossOrigin:n,href:t},i.querySelector(r)===null&&(t=i.createElement("link"),ll(t,"link",e),Ro(t),i.head.appendChild(t)))}}function VKe(e){dm.D(e),ZEe("dns-prefetch",e,null)}function HKe(e,t){dm.C(e,t),ZEe("preconnect",e,t)}function qKe(e,t,n){dm.L(e,t,n);var i=$1;if(i&&e&&t){var r='link[rel="preload"][as="'+od(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+od(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+od(n.imageSizes)+'"]')):r+='[href="'+od(e)+'"]';var s=r;switch(t){case"style":s=Hw(e);break;case"script":s=F1(e)}Ad.has(s)||(e=Ds({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Ad.set(s,e),i.querySelector(r)!==null||t==="style"&&i.querySelector(PA(s))||t==="script"&&i.querySelector(DA(s))||(t=i.createElement("link"),ll(t,"link",e),Ro(t),i.head.appendChild(t)))}}function WKe(e,t){dm.m(e,t);var n=$1;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+od(i)+'"][href="'+od(e)+'"]',s=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=F1(e)}if(!Ad.has(s)&&(e=Ds({rel:"modulepreload",href:e},t),Ad.set(s,e),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(DA(s)))return}i=n.createElement("link"),ll(i,"link",e),Ro(i),n.head.appendChild(i)}}}function KKe(e,t,n){dm.S(e,t,n);var i=$1;if(i&&e){var r=Xx(i).hoistableStyles,s=Hw(e);t=t||"default";var o=r.get(s);if(!o){var l={loading:0,preload:null};if(o=i.querySelector(PA(s)))l.loading=5;else{e=Ds({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Ad.get(s))&&_Q(e,n);var c=o=i.createElement("link");Ro(c),ll(c,"link",e),c._p=new Promise(function(u,d){c.onload=u,c.onerror=d}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,Jj(o,t,i)}o={type:"stylesheet",instance:o,count:1,state:l},r.set(s,o)}}}function GKe(e,t){dm.X(e,t);var n=$1;if(n&&e){var i=Xx(n).hoistableScripts,r=F1(e),s=i.get(r);s||(s=n.querySelector(DA(r)),s||(e=Ds({src:e,async:!0},t),(t=Ad.get(r))&&jQ(e,t),s=n.createElement("script"),Ro(s),ll(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function XKe(e,t){dm.M(e,t);var n=$1;if(n&&e){var i=Xx(n).hoistableScripts,r=F1(e),s=i.get(r);s||(s=n.querySelector(DA(r)),s||(e=Ds({src:e,async:!0,type:"module"},t),(t=Ad.get(r))&&jQ(e,t),s=n.createElement("script"),Ro(s),ll(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function yY(e,t,n,i){var r=(r=Og.current)?DR(r):null;if(!r)throw Error(wt(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Hw(n.href),n=Xx(r).hoistableStyles,i=n.get(t),i||(i={type:"style",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Hw(n.href);var s=Xx(r).hoistableStyles,o=s.get(e);if(o||(r=r.ownerDocument||r,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,o),(s=r.querySelector(PA(e)))&&!s._p&&(o.instance=s,o.state.loading=5),Ad.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Ad.set(e,n),s||YKe(r,e,n,o.state))),t&&i===null)throw Error(wt(528,""));return o}if(t&&i!==null)throw Error(wt(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=F1(n),n=Xx(r).hoistableScripts,i=n.get(t),i||(i={type:"script",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(wt(444,e))}}function Hw(e){return'href="'+od(e)+'"'}function PA(e){return'link[rel="stylesheet"]['+e+"]"}function JEe(e){return Ds({},e,{"data-precedence":e.precedence,precedence:null})}function YKe(e,t,n,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),ll(t,"link",n),Ro(t),e.head.appendChild(t))}function F1(e){return'[src="'+od(e)+'"]'}function DA(e){return"script[async]"+e}function vY(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+od(n.href)+'"]');if(i)return t.instance=i,Ro(i),i;var r=Ds({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Ro(i),ll(i,"style",r),Jj(i,n.precedence,e),t.instance=i;case"stylesheet":r=Hw(n.href);var s=e.querySelector(PA(r));if(s)return t.state.loading|=4,t.instance=s,Ro(s),s;i=JEe(n),(r=Ad.get(r))&&_Q(i,r),s=(e.ownerDocument||e).createElement("link"),Ro(s);var o=s;return o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),ll(s,"link",i),t.state.loading|=4,Jj(s,n.precedence,e),t.instance=s;case"script":return s=F1(n.src),(r=e.querySelector(DA(s)))?(t.instance=r,Ro(r),r):(i=n,(r=Ad.get(s))&&(i=Ds({},n),jQ(i,r)),e=e.ownerDocument||e,r=e.createElement("script"),Ro(r),ll(r,"link",i),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(wt(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(i=t.instance,t.state.loading|=4,Jj(i,n.precedence,e));return t.instance}function Jj(e,t,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,s=r,o=0;o title"):null)}function ZKe(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function eCe(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function JKe(e,t,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&!(n.state.loading&4)){if(n.instance===null){var r=Hw(i.href),s=t.querySelector(PA(r));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=MR.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=s,Ro(s);return}s=t.ownerDocument||t,i=JEe(i),(r=Ad.get(r))&&_Q(i,r),s=s.createElement("link"),Ro(s);var o=s;o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),ll(s,"link",i),n.instance=s}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=MR.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var l3=0;function eGe(e,t){return e.stylesheets&&e.count===0&&tN(e,e.stylesheets),0l3?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(r)}}:null}function MR(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)tN(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var LR=null;function tN(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,LR=new Map,t.forEach(tGe,e),LR=null,MR.call(e))}function tGe(e,t){if(!(t.state.loading&4)){var n=LR.get(e);if(n)var i=n.get(null);else{n=new Map,LR.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(lCe)}catch(e){console.error(e)}}lCe(),gOe.exports=YP;var cGe=gOe.exports;const uGe=N1(cGe),DQ=p.createContext({});function mD(e){const t=p.useRef(null);return t.current===null&&(t.current=e()),t.current}const gD=p.createContext(null),eC=p.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class dGe extends p.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function fGe({children:e,isPresent:t}){const n=p.useId(),i=p.useRef(null),r=p.useRef({width:0,height:0,top:0,left:0}),{nonce:s}=p.useContext(eC);return p.useInsertionEffect(()=>{const{width:o,height:l,top:c,left:u}=r.current;if(t||!i.current||!o||!l)return;i.current.dataset.motionPopId=n;const d=document.createElement("style");return s&&(d.nonce=s),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(` [data-motion-pop-id="${n}"] { position: absolute !important; width: ${o}px !important; @@ -109,27 +109,27 @@ Error generating stack: `+i.message+` top: ${c}px !important; left: ${u}px !important; } - `),()=>{document.head.removeChild(d)}},[t]),a.jsx(uGe,{isPresent:t,childRef:i,sizeRef:r,children:p.cloneElement(e,{ref:i})})}const fGe=({children:e,initial:t,isPresent:n,onExitComplete:i,custom:r,presenceAffectsLayout:s,mode:o})=>{const l=mD(hGe),c=p.useId(),u=p.useCallback(f=>{l.set(f,!0);for(const h of l.values())if(!h)return;i&&i()},[l,i]),d=p.useMemo(()=>({id:c,initial:t,isPresent:n,custom:r,onExitComplete:u,register:f=>(l.set(f,!1),()=>l.delete(f))}),s?[Math.random(),u]:[n,u]);return p.useMemo(()=>{l.forEach((f,h)=>l.set(h,!1))},[n]),p.useEffect(()=>{!n&&!l.size&&i&&i()},[n]),o==="popLayout"&&(e=a.jsx(dGe,{isPresent:n,children:e})),a.jsx(gD.Provider,{value:d,children:e})};function hGe(){return new Map}function lCe(e=!0){const t=p.useContext(gD);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:r}=t,s=p.useId();p.useEffect(()=>{e&&r(s)},[e]);const o=p.useCallback(()=>e&&i&&i(s),[s,i,e]);return!n&&i?[!1,o]:[!0]}const H2=e=>e.key||"";function TY(e){const t=[];return p.Children.forEach(e,n=>{p.isValidElement(n)&&t.push(n)}),t}const MQ=typeof window<"u",cCe=MQ?p.useLayoutEffect:p.useEffect,uf=({children:e,custom:t,initial:n=!0,onExitComplete:i,presenceAffectsLayout:r=!0,mode:s="sync",propagate:o=!1})=>{const[l,c]=lCe(o),u=p.useMemo(()=>TY(e),[e]),d=o&&!l?[]:u.map(H2),f=p.useRef(!0),h=p.useRef(u),m=mD(()=>new Map),[g,b]=p.useState(u),[v,y]=p.useState(u);cCe(()=>{f.current=!1,h.current=u;for(let k=0;k{const S=H2(k),O=o&&!l?!1:u===v||d.includes(S),A=()=>{if(m.has(S))m.set(S,!0);else return;let E=!0;m.forEach(j=>{j||(E=!1)}),E&&(x==null||x(),y(h.current),o&&(c==null||c()),i&&i())};return a.jsx(fGe,{isPresent:O,initial:!f.current||n?void 0:!1,custom:O?void 0:t,presenceAffectsLayout:r,mode:s,onExitComplete:O?void 0:A,children:k},S)})})},Iu=e=>e;let uCe=Iu;const pGe={useManualTiming:!1};function mGe(e){let t=new Set,n=new Set,i=!1,r=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function l(u){s.has(u)&&(c.schedule(u),e()),u(o)}const c={schedule:(u,d=!1,f=!1)=>{const m=f&&i?t:n;return d&&s.add(u),m.has(u)||m.add(u),u},cancel:u=>{n.delete(u),s.delete(u)},process:u=>{if(o=u,i){r=!0;return}i=!0,[t,n]=[n,t],t.forEach(l),t.clear(),i=!1,r&&(r=!1,c.process(u))}};return c}const q2=["read","resolveKeyframes","update","preRender","render","postRender"],gGe=40;function dCe(e,t){let n=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=q2.reduce((y,w)=>(y[w]=mGe(s),y),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:f,postRender:h}=o,m=()=>{const y=performance.now();n=!1,r.delta=i?1e3/60:Math.max(Math.min(y-r.timestamp,gGe),1),r.timestamp=y,r.isProcessing=!0,l.process(r),c.process(r),u.process(r),d.process(r),f.process(r),h.process(r),r.isProcessing=!1,n&&t&&(i=!1,e(m))},g=()=>{n=!0,i=!0,r.isProcessing||e(m)};return{schedule:q2.reduce((y,w)=>{const x=o[w];return y[w]=(k,S=!1,O=!1)=>(n||g(),x.schedule(k,S,O)),y},{}),cancel:y=>{for(let w=0;w_Y[e].some(n=>!!t[n])};function bGe(e){for(const t in e)Ww[t]={...Ww[t],...e[t]}}const yGe=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function BR(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||yGe.has(e)}let hCe=e=>!BR(e);function pCe(e){e&&(hCe=t=>t.startsWith("on")?!BR(t):e(t))}try{pCe(require("@emotion/is-prop-valid").default)}catch{}function vGe(e,t,n){const i={};for(const r in e)r==="values"&&typeof e.values=="object"||(hCe(r)||n===!0&&BR(r)||!t&&!BR(r)||e.draggable&&r.startsWith("onDrag"))&&(i[r]=e[r]);return i}function xGe({children:e,isValidProp:t,...n}){t&&pCe(t),n={...p.useContext(eC),...n},n.isStatic=mD(()=>n.isStatic);const i=p.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return a.jsx(eC.Provider,{value:i,children:e})}function wGe(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...i)=>e(...i);return new Proxy(n,{get:(i,r)=>r==="create"?e:(t.has(r)||t.set(r,e(r)),t.get(r))})}const bD=p.createContext({});function tC(e){return typeof e=="string"||Array.isArray(e)}function yD(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const LQ=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],$Q=["initial",...LQ];function vD(e){return yD(e.animate)||$Q.some(t=>tC(e[t]))}function mCe(e){return!!(vD(e)||e.variants)}function kGe(e,t){if(vD(e)){const{initial:n,animate:i}=e;return{initial:n===!1||tC(n)?n:void 0,animate:tC(i)?i:void 0}}return e.inherit!==!1?t:{}}function OGe(e){const{initial:t,animate:n}=kGe(e,p.useContext(bD));return p.useMemo(()=>({initial:t,animate:n}),[jY(t),jY(n)])}function jY(e){return Array.isArray(e)?e.join(" "):e}const SGe=Symbol.for("motionComponentSymbol");function Rx(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function EGe(e,t,n){return p.useCallback(i=>{i&&e.onMount&&e.onMount(i),t&&(i?t.mount(i):t.unmount()),n&&(typeof n=="function"?n(i):Rx(n)&&(n.current=i))},[t])}const FQ=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),CGe="framerAppearId",gCe="data-"+FQ(CGe),{schedule:BQ}=dCe(queueMicrotask,!1),bCe=p.createContext({});function AGe(e,t,n,i,r){var s,o;const{visualElement:l}=p.useContext(bD),c=p.useContext(fCe),u=p.useContext(gD),d=p.useContext(eC).reducedMotion,f=p.useRef(null);i=i||c.renderer,!f.current&&i&&(f.current=i(e,{visualState:t,parent:l,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));const h=f.current,m=p.useContext(bCe);h&&!h.projection&&r&&(h.type==="html"||h.type==="svg")&&TGe(f.current,n,r,m);const g=p.useRef(!1);p.useInsertionEffect(()=>{h&&g.current&&h.update(n,u)});const b=n[gCe],v=p.useRef(!!b&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,b))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,b)));return cCe(()=>{h&&(g.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),BQ.render(h.render),v.current&&h.animationState&&h.animationState.animateChanges())}),p.useEffect(()=>{h&&(!v.current&&h.animationState&&h.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,b)}),v.current=!1))}),h}function TGe(e,t,n,i){const{layoutId:r,layout:s,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:yCe(e.parent)),e.projection.setOptions({layoutId:r,layout:s,alwaysMeasureLayout:!!o||l&&Rx(l),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:i,layoutScroll:c,layoutRoot:u})}function yCe(e){if(e)return e.options.allowProjection!==!1?e.projection:yCe(e.parent)}function _Ge({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:i,Component:r}){var s,o;e&&bGe(e);function l(u,d){let f;const h={...p.useContext(eC),...u,layoutId:jGe(u)},{isStatic:m}=h,g=OGe(u),b=i(u,m);if(!m&&MQ){NGe();const v=RGe(h);f=v.MeasureLayout,g.visualElement=AGe(r,b,h,t,v.ProjectionNode)}return a.jsxs(bD.Provider,{value:g,children:[f&&g.visualElement?a.jsx(f,{visualElement:g.visualElement,...h}):null,n(r,u,EGe(b,g.visualElement,d),b,m,g.visualElement)]})}l.displayName=`motion.${typeof r=="string"?r:`create(${(o=(s=r.displayName)!==null&&s!==void 0?s:r.name)!==null&&o!==void 0?o:""})`}`;const c=p.forwardRef(l);return c[SGe]=r,c}function jGe({layoutId:e}){const t=p.useContext(DQ).id;return t&&e!==void 0?t+"-"+e:e}function NGe(e,t){p.useContext(fCe).strict}function RGe(e){const{drag:t,layout:n}=Ww;if(!t&&!n)return{};const i={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}const IGe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function UQ(e){return typeof e!="string"||e.includes("-")?!1:!!(IGe.indexOf(e)>-1||/[A-Z]/u.test(e))}function NY(e){const t=[{},{}];return e==null||e.values.forEach((n,i)=>{t[0][i]=n.get(),t[1][i]=n.getVelocity()}),t}function QQ(e,t,n,i){if(typeof t=="function"){const[r,s]=NY(i);t=t(n!==void 0?n:e.custom,r,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[r,s]=NY(i);t=t(n!==void 0?n:e.custom,r,s)}return t}const d8=e=>Array.isArray(e),PGe=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),DGe=e=>d8(e)?e[e.length-1]||0:e,Cl=e=>!!(e&&e.getVelocity);function iN(e){const t=Cl(e)?e.get():e;return PGe(t)?t.toValue():t}function MGe({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},i,r,s){const o={latestValues:LGe(i,r,s,e),renderState:t()};return n&&(o.onMount=l=>n({props:i,current:l,...o}),o.onUpdate=l=>n(l)),o}const vCe=e=>(t,n)=>{const i=p.useContext(bD),r=p.useContext(gD),s=()=>MGe(e,t,i,r);return n?s():mD(s)};function LGe(e,t,n,i){const r={},s=i(e,{});for(const h in s)r[h]=iN(s[h]);let{initial:o,animate:l}=e;const c=vD(e),u=mCe(e);t&&u&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const f=d?l:o;if(f&&typeof f!="boolean"&&!yD(f)){const h=Array.isArray(f)?f:[f];for(let m=0;mt=>typeof t=="string"&&t.startsWith(e),wCe=xCe("--"),$Ge=xCe("var(--"),zQ=e=>$Ge(e)?FGe.test(e.split("/*")[0].trim()):!1,FGe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,kCe=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Gp=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},nC={...U1,transform:e=>Gp(0,1,e)},W2={...U1,default:1},MA=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Um=MA("deg"),gh=MA("%"),Yn=MA("px"),BGe=MA("vh"),UGe=MA("vw"),RY={...gh,parse:e=>gh.parse(e)/100,transform:e=>gh.transform(e*100)},QGe={borderWidth:Yn,borderTopWidth:Yn,borderRightWidth:Yn,borderBottomWidth:Yn,borderLeftWidth:Yn,borderRadius:Yn,radius:Yn,borderTopLeftRadius:Yn,borderTopRightRadius:Yn,borderBottomRightRadius:Yn,borderBottomLeftRadius:Yn,width:Yn,maxWidth:Yn,height:Yn,maxHeight:Yn,top:Yn,right:Yn,bottom:Yn,left:Yn,padding:Yn,paddingTop:Yn,paddingRight:Yn,paddingBottom:Yn,paddingLeft:Yn,margin:Yn,marginTop:Yn,marginRight:Yn,marginBottom:Yn,marginLeft:Yn,backgroundPositionX:Yn,backgroundPositionY:Yn},zGe={rotate:Um,rotateX:Um,rotateY:Um,rotateZ:Um,scale:W2,scaleX:W2,scaleY:W2,scaleZ:W2,skew:Um,skewX:Um,skewY:Um,distance:Yn,translateX:Yn,translateY:Yn,translateZ:Yn,x:Yn,y:Yn,z:Yn,perspective:Yn,transformPerspective:Yn,opacity:nC,originX:RY,originY:RY,originZ:Yn},IY={...U1,transform:Math.round},VQ={...QGe,...zGe,zIndex:IY,size:Yn,fillOpacity:nC,strokeOpacity:nC,numOctaves:IY},VGe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},HGe=B1.length;function qGe(e,t,n){let i="",r=!0;for(let s=0;s({style:{},transform:{},transformOrigin:{},vars:{}}),OCe=()=>({...WQ(),attrs:{}}),KQ=e=>typeof e=="string"&&e.toLowerCase()==="svg";function SCe(e,{style:t,vars:n},i,r){Object.assign(e.style,t,r&&r.getProjectionStyles(i));for(const s in n)e.style.setProperty(s,n[s])}const ECe=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function CCe(e,t,n,i){SCe(e,t,void 0,i);for(const r in t.attrs)e.setAttribute(ECe.has(r)?r:FQ(r),t.attrs[r])}const UR={};function YGe(e){Object.assign(UR,e)}function ACe(e,{layout:t,layoutId:n}){return Dv.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!UR[e]||e==="opacity")}function GQ(e,t,n){var i;const{style:r}=e,s={};for(const o in r)(Cl(r[o])||t.style&&Cl(t.style[o])||ACe(o,e)||((i=n==null?void 0:n.getValue(o))===null||i===void 0?void 0:i.liveStyle)!==void 0)&&(s[o]=r[o]);return s}function TCe(e,t,n){const i=GQ(e,t,n);for(const r in e)if(Cl(e[r])||Cl(t[r])){const s=B1.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[s]=e[r]}return i}function ZGe(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const DY=["x","y","width","height","cx","cy","r"],JGe={useVisualState:vCe({scrapeMotionValuesFromProps:TCe,createRenderState:OCe,onUpdate:({props:e,prevProps:t,current:n,renderState:i,latestValues:r})=>{if(!n)return;let s=!!e.drag;if(!s){for(const l in r)if(Dv.has(l)){s=!0;break}}if(!s)return;let o=!t;if(t)for(let l=0;l{ZGe(n,i),Ps.render(()=>{qQ(i,r,KQ(n.tagName),e.transformTemplate),CCe(n,i)})})}})},eXe={useVisualState:vCe({scrapeMotionValuesFromProps:GQ,createRenderState:WQ})};function _Ce(e,t,n){for(const i in t)!Cl(t[i])&&!ACe(i,n)&&(e[i]=t[i])}function tXe({transformTemplate:e},t){return p.useMemo(()=>{const n=WQ();return HQ(n,t,e),Object.assign({},n.vars,n.style)},[t])}function nXe(e,t){const n=e.style||{},i={};return _Ce(i,n,e),Object.assign(i,tXe(e,t)),i}function iXe(e,t){const n={},i=nXe(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=i,n}function rXe(e,t,n,i){const r=p.useMemo(()=>{const s=OCe();return qQ(s,t,KQ(i),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};_Ce(s,e.style,e),r.style={...s,...r.style}}return r}function sXe(e=!1){return(n,i,r,{latestValues:s},o)=>{const c=(UQ(n)?rXe:iXe)(i,s,o,n),u=vGe(i,typeof n=="string",e),d=n!==p.Fragment?{...u,...c,ref:r}:{},{children:f}=i,h=p.useMemo(()=>Cl(f)?f.get():f,[f]);return p.createElement(n,{...d,children:h})}}function aXe(e,t){return function(i,{forwardMotionProps:r}={forwardMotionProps:!1}){const o={...UQ(i)?JGe:eXe,preloadedFeatures:e,useRender:sXe(r),createVisualElement:t,Component:i};return _Ge(o)}}function jCe(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i(rN===void 0&&bh.set(Zo.isProcessing||pGe.useManualTiming?Zo.timestamp:performance.now()),rN),set:e=>{rN=e,queueMicrotask(oXe)}};function YQ(e,t){e.indexOf(t)===-1&&e.push(t)}function ZQ(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class JQ{constructor(){this.subscriptions=[]}add(t){return YQ(this.subscriptions,t),()=>ZQ(this.subscriptions,t)}notify(t,n,i){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](t,n,i);else for(let s=0;s!isNaN(parseFloat(e));class cXe{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(i,r=!0)=>{const s=bh.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=bh.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=lXe(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new JQ);const i=this.events[t].add(n);return t==="change"?()=>{i(),Ps.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,i){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=bh.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>MY)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,MY);return RCe(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function iC(e,t){return new cXe(e,t)}function uXe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,iC(n))}function dXe(e,t){const n=xD(e,t);let{transitionEnd:i={},transition:r={},...s}=n||{};s={...s,...i};for(const o in s){const l=DGe(s[o]);uXe(e,o,l)}}function fXe(e){return!!(Cl(e)&&e.add)}function f8(e,t){const n=e.getValue("willChange");if(fXe(n))return n.add(t)}function ICe(e){return e.props[gCe]}function ez(e){let t;return()=>(t===void 0&&(t=e()),t)}const hXe=ez(()=>window.ScrollTimeline!==void 0);class pXe{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let i=0;i{if(hXe()&&r.attachTimeline)return r.attachTimeline(t);if(typeof n=="function")return n(r)});return()=>{i.forEach((r,s)=>{r&&r(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;nn[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class mXe extends pXe{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const Ip=e=>e*1e3,Pp=e=>e/1e3;function tz(e){return typeof e=="function"}function LY(e,t){e.timeline=t,e.onfinish=null}const nz=e=>Array.isArray(e)&&typeof e[0]=="number",gXe={linearEasing:void 0};function bXe(e,t){const n=ez(e);return()=>{var i;return(i=gXe[t])!==null&&i!==void 0?i:n()}}const QR=bXe(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Kw=(e,t,n)=>{const i=t-e;return i===0?1:(n-e)/i},PCe=(e,t,n=10)=>{let i="";const r=Math.max(Math.round(t/n),2);for(let s=0;s`cubic-bezier(${e}, ${t}, ${n}, ${i})`,h8={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:lS([0,.65,.55,1]),circOut:lS([.55,0,1,.45]),backIn:lS([.31,.01,.66,-.59]),backOut:lS([.33,1.53,.69,.99])};function MCe(e,t){if(e)return typeof e=="function"&&QR()?PCe(e,t):nz(e)?lS(e):Array.isArray(e)?e.map(n=>MCe(n,t)||h8.easeOut):h8[e]}const LCe=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,yXe=1e-7,vXe=12;function xXe(e,t,n,i,r){let s,o,l=0;do o=t+(n-t)/2,s=LCe(o,i,r)-e,s>0?n=o:t=o;while(Math.abs(s)>yXe&&++lxXe(s,0,1,e,n);return s=>s===0||s===1?s:LCe(r(s),t,i)}const $Ce=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,FCe=e=>t=>1-e(1-t),BCe=LA(.33,1.53,.69,.99),iz=FCe(BCe),UCe=$Ce(iz),QCe=e=>(e*=2)<1?.5*iz(e):.5*(2-Math.pow(2,-10*(e-1))),rz=e=>1-Math.sin(Math.acos(e)),zCe=FCe(rz),VCe=$Ce(rz),HCe=e=>/^0[^.\s]+$/u.test(e);function wXe(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||HCe(e):!0}const XS=e=>Math.round(e*1e5)/1e5,sz=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function kXe(e){return e==null}const OXe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,az=(e,t)=>n=>!!(typeof n=="string"&&OXe.test(n)&&n.startsWith(e)||t&&!kXe(n)&&Object.prototype.hasOwnProperty.call(n,t)),qCe=(e,t,n)=>i=>{if(typeof i!="string")return i;const[r,s,o,l]=i.match(sz);return{[e]:parseFloat(r),[t]:parseFloat(s),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},SXe=e=>Gp(0,255,e),u3={...U1,transform:e=>Math.round(SXe(e))},Oy={test:az("rgb","red"),parse:qCe("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+u3.transform(e)+", "+u3.transform(t)+", "+u3.transform(n)+", "+XS(nC.transform(i))+")"};function EXe(e){let t="",n="",i="",r="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),r=e.substring(4,5),t+=t,n+=n,i+=i,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const p8={test:az("#"),parse:EXe,transform:Oy.transform},Ix={test:az("hsl","hue"),parse:qCe("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+gh.transform(XS(t))+", "+gh.transform(XS(n))+", "+XS(nC.transform(i))+")"},Ol={test:e=>Oy.test(e)||p8.test(e)||Ix.test(e),parse:e=>Oy.test(e)?Oy.parse(e):Ix.test(e)?Ix.parse(e):p8.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Oy.transform(e):Ix.transform(e)},CXe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function AXe(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(sz))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(CXe))===null||n===void 0?void 0:n.length)||0)>0}const WCe="number",KCe="color",TXe="var",_Xe="var(",$Y="${}",jXe=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function rC(e){const t=e.toString(),n=[],i={color:[],number:[],var:[]},r=[];let s=0;const l=t.replace(jXe,c=>(Ol.test(c)?(i.color.push(s),r.push(KCe),n.push(Ol.parse(c))):c.startsWith(_Xe)?(i.var.push(s),r.push(TXe),n.push(c)):(i.number.push(s),r.push(WCe),n.push(parseFloat(c))),++s,$Y)).split($Y);return{values:n,split:l,indexes:i,types:r}}function GCe(e){return rC(e).values}function XCe(e){const{split:t,types:n}=rC(e),i=t.length;return r=>{let s="";for(let o=0;otypeof e=="number"?0:e;function RXe(e){const t=GCe(e);return XCe(e)(t.map(NXe))}const qg={test:AXe,parse:GCe,createTransformer:XCe,getAnimatableNone:RXe},IXe=new Set(["brightness","contrast","saturate","opacity"]);function PXe(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(sz)||[];if(!i)return e;const r=n.replace(i,"");let s=IXe.has(t)?1:0;return i!==n&&(s*=100),t+"("+s+r+")"}const DXe=/\b([a-z-]*)\(.*?\)/gu,m8={...qg,getAnimatableNone:e=>{const t=e.match(DXe);return t?t.map(PXe).join(" "):e}},MXe={...VQ,color:Ol,backgroundColor:Ol,outlineColor:Ol,fill:Ol,stroke:Ol,borderColor:Ol,borderTopColor:Ol,borderRightColor:Ol,borderBottomColor:Ol,borderLeftColor:Ol,filter:m8,WebkitFilter:m8},oz=e=>MXe[e];function YCe(e,t){let n=oz(e);return n!==m8&&(n=qg),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const LXe=new Set(["auto","none","0"]);function $Xe(e,t,n){let i=0,r;for(;ie===U1||e===Yn,BY=(e,t)=>parseFloat(e.split(", ")[t]),UY=(e,t)=>(n,{transform:i})=>{if(i==="none"||!i)return 0;const r=i.match(/^matrix3d\((.+)\)$/u);if(r)return BY(r[1],t);{const s=i.match(/^matrix\((.+)\)$/u);return s?BY(s[1],e):0}},FXe=new Set(["x","y","z"]),BXe=B1.filter(e=>!FXe.has(e));function UXe(e){const t=[];return BXe.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t}const Gw={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:UY(4,13),y:UY(5,14)};Gw.translateX=Gw.x;Gw.translateY=Gw.y;const zy=new Set;let g8=!1,b8=!1;function ZCe(){if(b8){const e=Array.from(zy).filter(i=>i.needsMeasurement),t=new Set(e.map(i=>i.element)),n=new Map;t.forEach(i=>{const r=UXe(i);r.length&&(n.set(i,r),i.render())}),e.forEach(i=>i.measureInitialState()),t.forEach(i=>{i.render();const r=n.get(i);r&&r.forEach(([s,o])=>{var l;(l=i.getValue(s))===null||l===void 0||l.set(o)})}),e.forEach(i=>i.measureEndState()),e.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}b8=!1,g8=!1,zy.forEach(e=>e.complete()),zy.clear()}function JCe(){zy.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(b8=!0)})}function QXe(){JCe(),ZCe()}class lz{constructor(t,n,i,r,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=i,this.motionValue=r,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(zy.add(this),g8||(g8=!0,Ps.read(JCe),Ps.resolveKeyframes(ZCe))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:i,motionValue:r}=this;for(let s=0;s/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),zXe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function VXe(e){const t=zXe.exec(e);if(!t)return[,];const[,n,i,r]=t;return[`--${n??i}`,r]}function tAe(e,t,n=1){const[i,r]=VXe(e);if(!i)return;const s=window.getComputedStyle(t).getPropertyValue(i);if(s){const o=s.trim();return eAe(o)?parseFloat(o):o}return zQ(r)?tAe(r,t,n+1):r}const nAe=e=>t=>t.test(e),HXe={test:e=>e==="auto",parse:e=>e},iAe=[U1,Yn,gh,Um,UGe,BGe,HXe],QY=e=>iAe.find(nAe(e));class rAe extends lz{constructor(t,n,i,r,s){super(t,n,i,r,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:i}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c{n.getValue(c).set(u)}),this.resolveNoneKeyframes()}}const zY=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(qg.test(e)||e==="0")&&!e.startsWith("url("));function qXe(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ne!==null;function wD(e,{repeat:t,repeatType:n="loop"},i){const r=e.filter(KXe),s=t&&n!=="loop"&&t%2===1?0:r.length-1;return!s||i===void 0?r[s]:i}const GXe=40;class sAe{constructor({autoplay:t=!0,delay:n=0,type:i="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:o="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=bh.now(),this.options={autoplay:t,delay:n,type:i,repeat:r,repeatDelay:s,repeatType:o,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>GXe?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&QXe(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=bh.now(),this.hasAttemptedResolve=!0;const{name:i,type:r,velocity:s,delay:o,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!WXe(t,i,r,s))if(o)this.options.duration=0;else{c&&c(wD(t,this.options,n)),l&&l(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const y8=2e4;function aAe(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t=y8?1/0:t}const Js=(e,t,n)=>e+(t-e)*n;function d3(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function XXe({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,t/=100,n/=100;let r=0,s=0,o=0;if(!t)r=s=o=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;r=d3(c,l,e+1/3),s=d3(c,l,e),o=d3(c,l,e-1/3)}return{red:Math.round(r*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}function zR(e,t){return n=>n>0?t:e}const f3=(e,t,n)=>{const i=e*e,r=n*(t*t-i)+i;return r<0?0:Math.sqrt(r)},YXe=[p8,Oy,Ix],ZXe=e=>YXe.find(t=>t.test(e));function VY(e){const t=ZXe(e);if(!t)return!1;let n=t.parse(e);return t===Ix&&(n=XXe(n)),n}const HY=(e,t)=>{const n=VY(e),i=VY(t);if(!n||!i)return zR(e,t);const r={...n};return s=>(r.red=f3(n.red,i.red,s),r.green=f3(n.green,i.green,s),r.blue=f3(n.blue,i.blue,s),r.alpha=Js(n.alpha,i.alpha,s),Oy.transform(r))},JXe=(e,t)=>n=>t(e(n)),$A=(...e)=>e.reduce(JXe),v8=new Set(["none","hidden"]);function eYe(e,t){return v8.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function tYe(e,t){return n=>Js(e,t,n)}function cz(e){return typeof e=="number"?tYe:typeof e=="string"?zQ(e)?zR:Ol.test(e)?HY:rYe:Array.isArray(e)?oAe:typeof e=="object"?Ol.test(e)?HY:nYe:zR}function oAe(e,t){const n=[...e],i=n.length,r=e.map((s,o)=>cz(s)(s,t[o]));return s=>{for(let o=0;o{for(const s in i)n[s]=i[s](r);return n}}function iYe(e,t){var n;const i=[],r={color:0,var:0,number:0};for(let s=0;s{const n=qg.createTransformer(t),i=rC(e),r=rC(t);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?v8.has(e)&&!r.values.length||v8.has(t)&&!i.values.length?eYe(e,t):$A(oAe(iYe(i,r),r.values),n):zR(e,t)};function lAe(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Js(e,t,n):cz(e)(e,t)}const sYe=5;function cAe(e,t,n){const i=Math.max(t-sYe,0);return RCe(n-e(i),t-i)}const da={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},h3=.001;function aYe({duration:e=da.duration,bounce:t=da.bounce,velocity:n=da.velocity,mass:i=da.mass}){let r,s,o=1-t;o=Gp(da.minDamping,da.maxDamping,o),e=Gp(da.minDuration,da.maxDuration,Pp(e)),o<1?(r=u=>{const d=u*o,f=d*e,h=d-n,m=x8(u,o),g=Math.exp(-f);return h3-h/m*g},s=u=>{const f=u*o*e,h=f*n+n,m=Math.pow(o,2)*Math.pow(u,2)*e,g=Math.exp(-f),b=x8(Math.pow(u,2),o);return(-r(u)+h3>0?-1:1)*((h-m)*g)/b}):(r=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-h3+d*f},s=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const l=5/e,c=lYe(r,s,l);if(e=Ip(e),isNaN(c))return{stiffness:da.stiffness,damping:da.damping,duration:e};{const u=Math.pow(c,2)*i;return{stiffness:u,damping:o*2*Math.sqrt(i*u),duration:e}}}const oYe=12;function lYe(e,t,n){let i=n;for(let r=1;re[n]!==void 0)}function dYe(e){let t={velocity:da.velocity,stiffness:da.stiffness,damping:da.damping,mass:da.mass,isResolvedFromDuration:!1,...e};if(!qY(e,uYe)&&qY(e,cYe))if(e.visualDuration){const n=e.visualDuration,i=2*Math.PI/(n*1.2),r=i*i,s=2*Gp(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:da.mass,stiffness:r,damping:s}}else{const n=aYe(e);t={...t,...n,mass:da.mass},t.isResolvedFromDuration=!0}return t}function uAe(e=da.visualDuration,t=da.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:i,restDelta:r}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:s},{stiffness:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:m}=dYe({...n,velocity:-Pp(n.velocity||0)}),g=h||0,b=u/(2*Math.sqrt(c*d)),v=o-s,y=Pp(Math.sqrt(c/d)),w=Math.abs(v)<5;i||(i=w?da.restSpeed.granular:da.restSpeed.default),r||(r=w?da.restDelta.granular:da.restDelta.default);let x;if(b<1){const S=x8(y,b);x=O=>{const A=Math.exp(-b*y*O);return o-A*((g+b*y*v)/S*Math.sin(S*O)+v*Math.cos(S*O))}}else if(b===1)x=S=>o-Math.exp(-y*S)*(v+(g+y*v)*S);else{const S=y*Math.sqrt(b*b-1);x=O=>{const A=Math.exp(-b*y*O),E=Math.min(S*O,300);return o-A*((g+b*y*v)*Math.sinh(E)+S*v*Math.cosh(E))/S}}const k={calculatedDuration:m&&f||null,next:S=>{const O=x(S);if(m)l.done=S>=f;else{let A=0;b<1&&(A=S===0?Ip(g):cAe(x,S,O));const E=Math.abs(A)<=i,j=Math.abs(o-O)<=r;l.done=E&&j}return l.value=l.done?o:O,l},toString:()=>{const S=Math.min(aAe(k),y8),O=PCe(A=>k.next(S*A).value,S,30);return S+"ms "+O}};return k}function WY({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:s=500,modifyTarget:o,min:l,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},m=E=>l!==void 0&&Ec,g=E=>l===void 0?c:c===void 0||Math.abs(l-E)-b*Math.exp(-E/i),x=E=>y+w(E),k=E=>{const j=w(E),T=x(E);h.done=Math.abs(j)<=u,h.value=h.done?y:T};let S,O;const A=E=>{m(h.value)&&(S=E,O=uAe({keyframes:[h.value,g(h.value)],velocity:cAe(x,E,h.value),damping:r,stiffness:s,restDelta:u,restSpeed:d}))};return A(0),{calculatedDuration:null,next:E=>{let j=!1;return!O&&S===void 0&&(j=!0,k(E),A(E)),S!==void 0&&E>=S?O.next(E-S):(!j&&k(E),h)}}}const fYe=LA(.42,0,1,1),hYe=LA(0,0,.58,1),dAe=LA(.42,0,.58,1),pYe=e=>Array.isArray(e)&&typeof e[0]!="number",mYe={linear:Iu,easeIn:fYe,easeInOut:dAe,easeOut:hYe,circIn:rz,circInOut:VCe,circOut:zCe,backIn:iz,backInOut:UCe,backOut:BCe,anticipate:QCe},KY=e=>{if(nz(e)){uCe(e.length===4);const[t,n,i,r]=e;return LA(t,n,i,r)}else if(typeof e=="string")return mYe[e];return e};function gYe(e,t,n){const i=[],r=n||lAe,s=e.length-1;for(let o=0;ot[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=gYe(t,i,r),c=l.length,u=d=>{if(o&&d1)for(;fu(Gp(e[0],e[s-1],d)):u}function yYe(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const r=Kw(0,t,i);e.push(Js(n,1,r))}}function vYe(e){const t=[0];return yYe(t,e.length-1),t}function xYe(e,t){return e.map(n=>n*t)}function wYe(e,t){return e.map(()=>t||dAe).splice(0,e.length-1)}function VR({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const r=pYe(i)?i.map(KY):KY(i),s={done:!1,value:t[0]},o=xYe(n&&n.length===t.length?n:vYe(t),e),l=bYe(o,t,{ease:Array.isArray(r)?r:wYe(t,r)});return{calculatedDuration:e,next:c=>(s.value=l(c),s.done=c>=e,s)}}const kYe=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Ps.update(t,!0),stop:()=>Hg(t),now:()=>Zo.isProcessing?Zo.timestamp:bh.now()}},OYe={decay:WY,inertia:WY,tween:VR,keyframes:VR,spring:uAe},SYe=e=>e/100;class uz extends sAe{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:n,motionValue:i,element:r,keyframes:s}=this.options,o=(r==null?void 0:r.KeyframeResolver)||lz,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new o(s,l,n,i,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:s,velocity:o=0}=this.options,l=tz(n)?n:OYe[n]||VR;let c,u;l!==VR&&typeof t[0]!="number"&&(c=$A(SYe,lAe(t[0],t[1])),t=[0,100]);const d=l({...this.options,keyframes:t});s==="mirror"&&(u=l({...this.options,keyframes:[...t].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=aAe(d));const{calculatedDuration:f}=d,h=f+r,m=h*(i+1)-r;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:c,calculatedDuration:f,resolvedDuration:h,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:i}=this;if(!i){const{keyframes:E}=this.options;return{done:!0,value:E[E.length-1]}}const{finalKeyframe:r,generator:s,mirroredGenerator:o,mapPercentToKeyframes:l,keyframes:c,calculatedDuration:u,totalDuration:d,resolvedDuration:f}=i;if(this.startTime===null)return s.next(0);const{delay:h,repeat:m,repeatType:g,repeatDelay:b,onUpdate:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const y=this.currentTime-h*(this.speed>=0?1:-1),w=this.speed>=0?y<0:y>d;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let x=this.currentTime,k=s;if(m){const E=Math.min(this.currentTime,d)/f;let j=Math.floor(E),T=E%1;!T&&E>=1&&(T=1),T===1&&j--,j=Math.min(j,m+1),!!(j%2)&&(g==="reverse"?(T=1-T,b&&(T-=b/f)):g==="mirror"&&(k=o)),x=Gp(0,1,T)*f}const S=w?{done:!1,value:c[0]}:k.next(x);l&&(S.value=l(S.value));let{done:O}=S;!w&&u!==null&&(O=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const A=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return A&&r!==void 0&&(S.value=wD(c,this.options,r)),v&&v(S.value),A&&this.finish(),S}get duration(){const{resolved:t}=this;return t?Pp(t.calculatedDuration):0}get time(){return Pp(this.currentTime)}set time(t){t=Ip(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Pp(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=kYe,onPlay:n,startTime:i}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),n&&n();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=r):this.startTime=i??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const EYe=new Set(["opacity","clipPath","filter","transform"]);function CYe(e,t,n,{delay:i=0,duration:r=300,repeat:s=0,repeatType:o="loop",ease:l="easeInOut",times:c}={}){const u={[t]:n};c&&(u.offset=c);const d=MCe(l,r);return Array.isArray(d)&&(u.easing=d),e.animate(u,{delay:i,duration:r,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const AYe=ez(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),HR=10,TYe=2e4;function _Ye(e){return tz(e.type)||e.type==="spring"||!DCe(e.ease)}function jYe(e,t){const n=new uz({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let i={done:!1,value:e[0]};const r=[];let s=0;for(;!i.done&&sthis.onKeyframesResolved(o,l),n,i,r),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:i=300,times:r,ease:s,type:o,motionValue:l,name:c,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof s=="string"&&QR()&&NYe(s)&&(s=fAe[s]),_Ye(this.options)){const{onComplete:f,onUpdate:h,motionValue:m,element:g,...b}=this.options,v=jYe(t,b);t=v.keyframes,t.length===1&&(t[1]=t[0]),i=v.duration,r=v.times,s=v.ease,o="keyframes"}const d=CYe(l.owner.current,c,t,{...this.options,duration:i,times:r,ease:s});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(LY(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(wD(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:i,times:r,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Pp(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Pp(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:i}=n;i.currentTime=Ip(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:i}=n;i.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Iu;const{animation:i}=n;LY(i,t)}return Iu}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:i,duration:r,type:s,ease:o,times:l}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:d,onComplete:f,element:h,...m}=this.options,g=new uz({...m,keyframes:i,duration:r,type:s,ease:o,times:l,isGenerator:!0}),b=Ip(this.time);u.setWithVelocity(g.sample(b-HR).value,g.sample(b).value,HR)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:i,repeatDelay:r,repeatType:s,damping:o,type:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=n.owner.getProps();return AYe()&&i&&EYe.has(i)&&!c&&!u&&!r&&s!=="mirror"&&o!==0&&l!=="inertia"}}const RYe={type:"spring",stiffness:500,damping:25,restSpeed:10},IYe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),PYe={type:"keyframes",duration:.8},DYe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},MYe=(e,{keyframes:t})=>t.length>2?PYe:Dv.has(e)?e.startsWith("scale")?IYe(t[1]):RYe:DYe;function LYe({when:e,delay:t,delayChildren:n,staggerChildren:i,staggerDirection:r,repeat:s,repeatType:o,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const dz=(e,t,n,i={},r,s)=>o=>{const l=XQ(i,e)||{},c=l.delay||i.delay||0;let{elapsed:u=0}=i;u=u-Ip(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:h=>{t.set(h),l.onUpdate&&l.onUpdate(h)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:s?void 0:r};LYe(l)||(d={...d,...MYe(e,d)}),d.duration&&(d.duration=Ip(d.duration)),d.repeatDelay&&(d.repeatDelay=Ip(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(f=!0)),f&&!s&&t.get()!==void 0){const h=wD(d.keyframes,l);if(h!==void 0)return Ps.update(()=>{d.onUpdate(h),d.onComplete()}),new mXe([])}return!s&&GY.supports(d)?new GY(d):new uz(d)};function $Ye({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,i}function hAe(e,t,{delay:n=0,transitionOverride:i,type:r}={}){var s;let{transition:o=e.getDefaultTransition(),transitionEnd:l,...c}=t;i&&(o=i);const u=[],d=r&&e.animationState&&e.animationState.getState()[r];for(const f in c){const h=e.getValue(f,(s=e.latestValues[f])!==null&&s!==void 0?s:null),m=c[f];if(m===void 0||d&&$Ye(d,f))continue;const g={delay:n,...XQ(o||{},f)};let b=!1;if(window.MotionHandoffAnimation){const y=ICe(e);if(y){const w=window.MotionHandoffAnimation(y,f,Ps);w!==null&&(g.startTime=w,b=!0)}}f8(e,f),h.start(dz(f,h,m,e.shouldReduceMotion&&NCe.has(f)?{type:!1}:g,e,b));const v=h.animation;v&&u.push(v)}return l&&Promise.all(u).then(()=>{Ps.update(()=>{l&&dXe(e,l)})}),u}function w8(e,t,n={}){var i;const r=xD(e,t,n.type==="exit"?(i=e.presenceContext)===null||i===void 0?void 0:i.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const o=r?()=>Promise.all(hAe(e,r,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=s;return FYe(e,t,d+u,f,h,n)}:()=>Promise.resolve(),{when:c}=s;if(c){const[u,d]=c==="beforeChildren"?[o,l]:[l,o];return u().then(()=>d())}else return Promise.all([o(),l(n.delay)])}function FYe(e,t,n=0,i=0,r=1,s){const o=[],l=(e.variantChildren.size-1)*i,c=r===1?(u=0)=>u*i:(u=0)=>l-u*i;return Array.from(e.variantChildren).sort(BYe).forEach((u,d)=>{u.notify("AnimationStart",t),o.push(w8(u,t,{...s,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(o)}function BYe(e,t){return e.sortNodePosition(t)}function UYe(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const r=t.map(s=>w8(e,s,n));i=Promise.all(r)}else if(typeof t=="string")i=w8(e,t,n);else{const r=typeof t=="function"?xD(e,t,n.custom):t;i=Promise.all(hAe(e,r,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}const QYe=$Q.length;function pAe(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?pAe(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;nPromise.all(t.map(({animation:n,options:i})=>UYe(e,n,i)))}function qYe(e){let t=HYe(e),n=XY(),i=!0;const r=c=>(u,d)=>{var f;const h=xD(e,d,c==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:m,transitionEnd:g,...b}=h;u={...u,...b,...g}}return u};function s(c){t=c(e)}function o(c){const{props:u}=e,d=pAe(e.parent)||{},f=[],h=new Set;let m={},g=1/0;for(let v=0;vg&&k,j=!1;const T=Array.isArray(x)?x:[x];let R=T.reduce(r(y),{});S===!1&&(R={});const{prevResolvedValues:C={}}=w,N={...C,...R},P=_=>{E=!0,h.has(_)&&(j=!0,h.delete(_)),w.needsAnimating[_]=!0;const L=e.getValue(_);L&&(L.liveStyle=!1)};for(const _ in N){const L=R[_],F=C[_];if(m.hasOwnProperty(_))continue;let M=!1;d8(L)&&d8(F)?M=!jCe(L,F):M=L!==F,M?L!=null?P(_):h.add(_):L!==void 0&&h.has(_)?P(_):w.protectedKeys[_]=!0}w.prevProp=x,w.prevResolvedValues=R,w.isActive&&(m={...m,...R}),i&&e.blockInitialAnimation&&(E=!1),E&&(!(O&&A)||j)&&f.push(...T.map(_=>({animation:_,options:{type:y}})))}if(h.size){const v={};h.forEach(y=>{const w=e.getBaseTarget(y),x=e.getValue(y);x&&(x.liveStyle=!0),v[y]=w??null}),f.push({animation:v})}let b=!!f.length;return i&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(b=!1),i=!1,b?t(f):Promise.resolve()}function l(c,u){var d;if(n[c].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(h=>{var m;return(m=h.animationState)===null||m===void 0?void 0:m.setActive(c,u)}),n[c].isActive=u;const f=o(c);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:o,setActive:l,setAnimateFunction:s,getState:()=>n,reset:()=>{n=XY(),i=!0}}}function WYe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!jCe(t,e):!1}function Qb(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function XY(){return{animate:Qb(!0),whileInView:Qb(),whileHover:Qb(),whileTap:Qb(),whileDrag:Qb(),whileFocus:Qb(),exit:Qb()}}class wb{constructor(t){this.isMounted=!1,this.node=t}update(){}}class KYe extends wb{constructor(t){super(t),t.animationState||(t.animationState=qYe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();yD(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let GYe=0;class XYe extends wb{constructor(){super(...arguments),this.id=GYe++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const r=this.node.animationState.setActive("exit",!t);n&&!t&&r.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const YYe={animation:{Feature:KYe},exit:{Feature:XYe}},Gd={x:!1,y:!1};function mAe(){return Gd.x||Gd.y}function ZYe(e){return e==="x"||e==="y"?Gd[e]?null:(Gd[e]=!0,()=>{Gd[e]=!1}):Gd.x||Gd.y?null:(Gd.x=Gd.y=!0,()=>{Gd.x=Gd.y=!1})}const fz=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function sC(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}function FA(e){return{point:{x:e.pageX,y:e.pageY}}}const JYe=e=>t=>fz(t)&&e(t,FA(t));function YS(e,t,n,i){return sC(e,t,JYe(n),i)}const YY=(e,t)=>Math.abs(e-t);function eZe(e,t){const n=YY(e.x,t.x),i=YY(e.y,t.y);return Math.sqrt(n**2+i**2)}class gAe{constructor(t,n,{transformPagePoint:i,contextWindow:r,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=m3(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,m=eZe(f.offset,{x:0,y:0})>=3;if(!h&&!m)return;const{point:g}=f,{timestamp:b}=Zo;this.history.push({...g,timestamp:b});const{onStart:v,onMove:y}=this.handlers;h||(v&&v(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=p3(h,this.transformPagePoint),Ps.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:m,onSessionEnd:g,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=m3(f.type==="pointercancel"?this.lastMoveEventInfo:p3(h,this.transformPagePoint),this.history);this.startEvent&&m&&m(f,v),g&&g(f,v)},!fz(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=i,this.contextWindow=r||window;const o=FA(t),l=p3(o,this.transformPagePoint),{point:c}=l,{timestamp:u}=Zo;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,m3(l,this.history)),this.removeListeners=$A(YS(this.contextWindow,"pointermove",this.handlePointerMove),YS(this.contextWindow,"pointerup",this.handlePointerUp),YS(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Hg(this.updatePoint)}}function p3(e,t){return t?{point:t(e.point)}:e}function ZY(e,t){return{x:e.x-t.x,y:e.y-t.y}}function m3({point:e},t){return{point:e,delta:ZY(e,bAe(t)),offset:ZY(e,tZe(t)),velocity:nZe(t,.1)}}function tZe(e){return e[0]}function bAe(e){return e[e.length-1]}function nZe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const r=bAe(e);for(;n>=0&&(i=e[n],!(r.timestamp-i.timestamp>Ip(t)));)n--;if(!i)return{x:0,y:0};const s=Pp(r.timestamp-i.timestamp);if(s===0)return{x:0,y:0};const o={x:(r.x-i.x)/s,y:(r.y-i.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const yAe=1e-4,iZe=1-yAe,rZe=1+yAe,vAe=.01,sZe=0-vAe,aZe=0+vAe;function Bu(e){return e.max-e.min}function oZe(e,t,n){return Math.abs(e-t)<=n}function JY(e,t,n,i=.5){e.origin=i,e.originPoint=Js(t.min,t.max,e.origin),e.scale=Bu(n)/Bu(t),e.translate=Js(n.min,n.max,e.origin)-e.originPoint,(e.scale>=iZe&&e.scale<=rZe||isNaN(e.scale))&&(e.scale=1),(e.translate>=sZe&&e.translate<=aZe||isNaN(e.translate))&&(e.translate=0)}function ZS(e,t,n,i){JY(e.x,t.x,n.x,i?i.originX:void 0),JY(e.y,t.y,n.y,i?i.originY:void 0)}function eZ(e,t,n){e.min=n.min+t.min,e.max=e.min+Bu(t)}function lZe(e,t,n){eZ(e.x,t.x,n.x),eZ(e.y,t.y,n.y)}function tZ(e,t,n){e.min=t.min-n.min,e.max=e.min+Bu(t)}function JS(e,t,n){tZ(e.x,t.x,n.x),tZ(e.y,t.y,n.y)}function cZe(e,{min:t,max:n},i){return t!==void 0&&en&&(e=i?Js(n,e,i.max):Math.min(e,n)),e}function nZ(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function uZe(e,{top:t,left:n,bottom:i,right:r}){return{x:nZ(e.x,n,r),y:nZ(e.y,t,i)}}function iZ(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.mini?n=Kw(t.min,t.max-i,e.min):i>r&&(n=Kw(e.min,e.max-r,t.min)),Gp(0,1,n)}function hZe(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const k8=.35;function pZe(e=k8){return e===!1?e=0:e===!0&&(e=k8),{x:rZ(e,"left","right"),y:rZ(e,"top","bottom")}}function rZ(e,t,n){return{min:sZ(e,t),max:sZ(e,n)}}function sZ(e,t){return typeof e=="number"?e:e[t]||0}const aZ=()=>({translate:0,scale:1,origin:0,originPoint:0}),Px=()=>({x:aZ(),y:aZ()}),oZ=()=>({min:0,max:0}),wa=()=>({x:oZ(),y:oZ()});function ed(e){return[e("x"),e("y")]}function xAe({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function mZe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function gZe(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function g3(e){return e===void 0||e===1}function O8({scale:e,scaleX:t,scaleY:n}){return!g3(e)||!g3(t)||!g3(n)}function sy(e){return O8(e)||wAe(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function wAe(e){return lZ(e.x)||lZ(e.y)}function lZ(e){return e&&e!=="0%"}function qR(e,t,n){const i=e-n,r=t*i;return n+r}function cZ(e,t,n,i,r){return r!==void 0&&(e=qR(e,r,i)),qR(e,n,i)+t}function S8(e,t=0,n=1,i,r){e.min=cZ(e.min,t,n,i,r),e.max=cZ(e.max,t,n,i,r)}function kAe(e,{x:t,y:n}){S8(e.x,t.translate,t.scale,t.originPoint),S8(e.y,n.translate,n.scale,n.originPoint)}const uZ=.999999999999,dZ=1.0000000000001;function bZe(e,t,n,i=!1){const r=n.length;if(!r)return;t.x=t.y=1;let s,o;for(let l=0;luZ&&(t.x=1),t.yuZ&&(t.y=1)}function Dx(e,t){e.min=e.min+t,e.max=e.max+t}function fZ(e,t,n,i,r=.5){const s=Js(e.min,e.max,r);S8(e,t,n,s,i)}function Mx(e,t){fZ(e.x,t.x,t.scaleX,t.scale,t.originX),fZ(e.y,t.y,t.scaleY,t.scale,t.originY)}function OAe(e,t){return xAe(gZe(e.getBoundingClientRect(),t))}function yZe(e,t,n){const i=OAe(e,n),{scroll:r}=t;return r&&(Dx(i.x,r.offset.x),Dx(i.y,r.offset.y)),i}const SAe=({current:e})=>e?e.ownerDocument.defaultView:null,vZe=new WeakMap;class xZe{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=wa(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(FA(d).point)},s=(d,f)=>{const{drag:h,dragPropagation:m,onDragStart:g}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=ZYe(h),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ed(v=>{let y=this.getAxisMotionValue(v).get()||0;if(gh.test(y)){const{projection:w}=this.visualElement;if(w&&w.layout){const x=w.layout.layoutBox[v];x&&(y=Bu(x)*(parseFloat(y)/100))}}this.originPoint[v]=y}),g&&Ps.postRender(()=>g(d,f)),f8(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},o=(d,f)=>{const{dragPropagation:h,dragDirectionLock:m,onDirectionLock:g,onDrag:b}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:v}=f;if(m&&this.currentDirection===null){this.currentDirection=wZe(v),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),b&&b(d,f)},l=(d,f)=>this.stop(d,f),c=()=>ed(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new gAe(t,{onSessionStart:r,onStart:s,onMove:o,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:SAe(this.visualElement)})}stop(t,n){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:r}=n;this.startAnimation(r);const{onDragEnd:s}=this.getProps();s&&Ps.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,i){const{drag:r}=this.getProps();if(!i||!K2(t,r,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(o=cZe(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:i}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,s=this.constraints;n&&Rx(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&r?this.constraints=uZe(r.layoutBox,n):this.constraints=!1,this.elastic=pZe(i),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&ed(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=hZe(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Rx(t))return!1;const i=t.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=yZe(i,r.root,this.visualElement.getTransformPagePoint());let o=dZe(r.layout.layoutBox,s);if(n){const l=n(mZe(o));this.hasMutatedConstraints=!!l,l&&(o=xAe(l))}return o}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=ed(d=>{if(!K2(d,n,this.currentDirection))return;let f=c&&c[d]||{};o&&(f={min:0,max:0});const h=r?200:1e6,m=r?40:1e7,g={type:"inertia",velocity:i?t[d]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(d,g)});return Promise.all(u).then(l)}startAxisValueAnimation(t,n){const i=this.getAxisMotionValue(t);return f8(this.visualElement,t),i.start(dz(t,i,0,n,this.visualElement,!1))}stopAnimation(){ed(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){ed(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps(),r=i[n];return r||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){ed(n=>{const{drag:i}=this.getProps();if(!K2(n,i,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(n);if(r&&r.layout){const{min:o,max:l}=r.layout.layoutBox[n];s.set(t[n]-Js(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!Rx(n)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};ed(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();r[o]=fZe({min:c,max:c},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),ed(o=>{if(!K2(o,t,null))return;const l=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];l.set(Js(c,u,r[o]))})}addListeners(){if(!this.visualElement.current)return;vZe.set(this.visualElement,this);const t=this.visualElement.current,n=YS(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),i=()=>{const{dragConstraints:c}=this.getProps();Rx(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,s=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),Ps.read(i);const o=sC(window,"resize",()=>this.scalePositionWithinConstraints()),l=r.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(ed(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=c[d].translate,f.set(f.get()+c[d].translate))}),this.visualElement.render())});return()=>{o(),n(),s(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:o=k8,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:o,dragMomentum:l}}}function K2(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function wZe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class kZe extends wb{constructor(t){super(t),this.removeGroupControls=Iu,this.removeListeners=Iu,this.controls=new xZe(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Iu}unmount(){this.removeGroupControls(),this.removeListeners()}}const hZ=e=>(t,n)=>{e&&Ps.postRender(()=>e(t,n))};class OZe extends wb{constructor(){super(...arguments),this.removePointerDownListener=Iu}onPointerDown(t){this.session=new gAe(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:SAe(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:hZ(t),onStart:hZ(n),onMove:i,onEnd:(s,o)=>{delete this.session,r&&Ps.postRender(()=>r(s,o))}}}mount(){this.removePointerDownListener=YS(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const sN={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function pZ(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const lO={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Yn.test(e))e=parseFloat(e);else return e;const n=pZ(e,t.target.x),i=pZ(e,t.target.y);return`${n}% ${i}%`}},SZe={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,r=qg.parse(e);if(r.length>5)return i;const s=qg.createTransformer(e),o=typeof r[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;r[0+o]/=l,r[1+o]/=c;const u=Js(l,c,.5);return typeof r[2+o]=="number"&&(r[2+o]/=u),typeof r[3+o]=="number"&&(r[3+o]/=u),s(r)}};class EZe extends p.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=t;YGe(CZe),s&&(n.group&&n.group.add(s),i&&i.register&&r&&i.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),sN.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:r,isPresent:s}=this.props,o=i.projection;return o&&(o.isPresent=s,r||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||Ps.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),BQ.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:r}=t;r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function EAe(e){const[t,n]=lCe(),i=p.useContext(DQ);return a.jsx(EZe,{...e,layoutGroup:i,switchLayoutGroup:p.useContext(bCe),isPresent:t,safeToRemove:n})}const CZe={borderRadius:{...lO,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:lO,borderTopRightRadius:lO,borderBottomLeftRadius:lO,borderBottomRightRadius:lO,boxShadow:SZe};function AZe(e,t,n){const i=Cl(e)?e:iC(e);return i.start(dz("",i,t,n)),i.animation}function TZe(e){return e instanceof SVGElement&&e.tagName!=="svg"}const _Ze=(e,t)=>e.depth-t.depth;class jZe{constructor(){this.children=[],this.isDirty=!1}add(t){YQ(this.children,t),this.isDirty=!0}remove(t){ZQ(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(_Ze),this.isDirty=!1,this.children.forEach(t)}}function NZe(e,t){const n=bh.now(),i=({timestamp:r})=>{const s=r-n;s>=t&&(Hg(i),e(s-t))};return Ps.read(i,!0),()=>Hg(i)}const CAe=["TopLeft","TopRight","BottomLeft","BottomRight"],RZe=CAe.length,mZ=e=>typeof e=="string"?parseFloat(e):e,gZ=e=>typeof e=="number"||Yn.test(e);function IZe(e,t,n,i,r,s){r?(e.opacity=Js(0,n.opacity!==void 0?n.opacity:1,PZe(i)),e.opacityExit=Js(t.opacity!==void 0?t.opacity:1,0,DZe(i))):s&&(e.opacity=Js(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,i));for(let o=0;oit?1:n(Kw(e,t,i))}function yZ(e,t){e.min=t.min,e.max=t.max}function Ju(e,t){yZ(e.x,t.x),yZ(e.y,t.y)}function vZ(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function xZ(e,t,n,i,r){return e-=t,e=qR(e,1/n,i),r!==void 0&&(e=qR(e,1/r,i)),e}function MZe(e,t=0,n=1,i=.5,r,s=e,o=e){if(gh.test(t)&&(t=parseFloat(t),t=Js(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=Js(s.min,s.max,i);e===s&&(l-=t),e.min=xZ(e.min,t,n,l,r),e.max=xZ(e.max,t,n,l,r)}function wZ(e,t,[n,i,r],s,o){MZe(e,t[n],t[i],t[r],t.scale,s,o)}const LZe=["x","scaleX","originX"],$Ze=["y","scaleY","originY"];function kZ(e,t,n,i){wZ(e.x,t,LZe,n?n.x:void 0,i?i.x:void 0),wZ(e.y,t,$Ze,n?n.y:void 0,i?i.y:void 0)}function OZ(e){return e.translate===0&&e.scale===1}function TAe(e){return OZ(e.x)&&OZ(e.y)}function SZ(e,t){return e.min===t.min&&e.max===t.max}function FZe(e,t){return SZ(e.x,t.x)&&SZ(e.y,t.y)}function EZ(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function _Ae(e,t){return EZ(e.x,t.x)&&EZ(e.y,t.y)}function CZ(e){return Bu(e.x)/Bu(e.y)}function AZ(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class BZe{constructor(){this.members=[]}add(t){YQ(this.members,t),t.scheduleRender()}remove(t){if(ZQ(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(r=>t===r);if(n===0)return!1;let i;for(let r=n;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1){i=s;break}}return i?(this.promote(i),!0):!1}promote(t,n){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,n&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:r}=t.options;r===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:i}=t;n.onExitComplete&&n.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function UZe(e,t,n){let i="";const r=e.x.translate/t.x,s=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((r||s||o)&&(i=`translate3d(${r}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:h,skewX:m,skewY:g}=n;u&&(i=`perspective(${u}px) ${i}`),d&&(i+=`rotate(${d}deg) `),f&&(i+=`rotateX(${f}deg) `),h&&(i+=`rotateY(${h}deg) `),m&&(i+=`skewX(${m}deg) `),g&&(i+=`skewY(${g}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(i+=`scale(${l}, ${c})`),i||"none"}const ay={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},cS=typeof window<"u"&&window.MotionDebug!==void 0,b3=["","X","Y","Z"],QZe={visibility:"hidden"},TZ=1e3;let zZe=0;function y3(e,t,n,i){const{latestValues:r}=t;r[e]&&(n[e]=r[e],t.setStaticValue(e,0),i&&(i[e]=0))}function jAe(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=ICe(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Ps,!(r||s))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&jAe(i)}function NAe({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(o={},l=t==null?void 0:t()){this.id=zZe++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,cS&&(ay.totalNodes=ay.resolvedTargetDeltas=ay.recalculatedProjection=0),this.nodes.forEach(qZe),this.nodes.forEach(YZe),this.nodes.forEach(ZZe),this.nodes.forEach(WZe),cS&&window.MotionDebug.record(ay)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;cthis.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=NZe(h,250),sN.hasAnimatedSinceResize&&(sN.hasAnimatedSinceResize=!1,this.nodes.forEach(jZ))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeTargetChanged:m,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||d.getDefaultTransition()||iJe,{onLayoutAnimationStart:v,onLayoutAnimationComplete:y}=d.getProps(),w=!this.targetLayout||!_Ae(this.targetLayout,g)||m,x=!h&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||h&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,x);const k={...XQ(b,"layout"),onPlay:v,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(k.delay=0,k.type=!1),this.startAnimation(k)}else h||jZ(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Hg(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(JZe),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&jAe(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{const S=k/1e3;NZ(f.x,o.x,S),NZ(f.y,o.y,S),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(JS(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),tJe(this.relativeTarget,this.relativeTargetOrigin,h,S),x&&FZe(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=wa()),Ju(x,this.relativeTarget)),b&&(this.animationValues=d,IZe(d,u,this.latestValues,S,w,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Hg(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ps.update(()=>{sN.hasAnimatedSinceResize=!0,this.currentAnimation=AZe(0,TZ,{...o,onUpdate:l=>{this.mixTargetDelta(l),o.onUpdate&&o.onUpdate(l)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(TZ),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=o;if(!(!l||!c||!u)){if(this!==o&&this.layout&&u&&RAe(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||wa();const f=Bu(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+f;const h=Bu(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+h}Ju(l,c),Mx(l,d),ZS(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new BZe),this.sharedNodes.get(o).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:l}=this.options;return l?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:l}=this.options;return l?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&y3("z",o,u,this.animationValues);for(let d=0;d{var l;return(l=o.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(_Z),this.root.sharedNodes.clear()}}}function VZe(e){e.updateLayout()}function HZe(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:r}=e.layout,{animationType:s}=e.options,o=n.source!==e.layout.source;s==="size"?ed(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=Bu(h);h.min=i[f].min,h.max=h.min+m}):RAe(s,n.layoutBox,i)&&ed(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=Bu(i[f]);h.max=h.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+m)});const l=Px();ZS(l,i,n.layoutBox);const c=Px();o?ZS(c,e.applyTransform(r,!0),n.measuredBox):ZS(c,i,n.layoutBox);const u=!TAe(l);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:m}=f;if(h&&m){const g=wa();JS(g,n.layoutBox,h.layoutBox);const b=wa();JS(b,i,m.layoutBox),_Ae(g,b)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=b,e.relativeTargetOrigin=g,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:i,snapshot:n,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:i}=e.options;i&&i()}e.options.transition=void 0}function qZe(e){cS&&ay.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function WZe(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function KZe(e){e.clearSnapshot()}function _Z(e){e.clearMeasurements()}function GZe(e){e.isLayoutDirty=!1}function XZe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function jZ(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function YZe(e){e.resolveTargetDelta()}function ZZe(e){e.calcProjection()}function JZe(e){e.resetSkewAndRotation()}function eJe(e){e.removeLeadSnapshot()}function NZ(e,t,n){e.translate=Js(t.translate,0,n),e.scale=Js(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function RZ(e,t,n,i){e.min=Js(t.min,n.min,i),e.max=Js(t.max,n.max,i)}function tJe(e,t,n,i){RZ(e.x,t.x,n.x,i),RZ(e.y,t.y,n.y,i)}function nJe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const iJe={duration:.45,ease:[.4,0,.1,1]},IZ=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),PZ=IZ("applewebkit/")&&!IZ("chrome/")?Math.round:Iu;function DZ(e){e.min=PZ(e.min),e.max=PZ(e.max)}function rJe(e){DZ(e.x),DZ(e.y)}function RAe(e,t,n){return e==="position"||e==="preserve-aspect"&&!oZe(CZ(t),CZ(n),.2)}function sJe(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const aJe=NAe({attachResizeListener:(e,t)=>sC(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),v3={current:void 0},IAe=NAe({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!v3.current){const e=new aJe({});e.mount(window),e.setOptions({layoutScroll:!0}),v3.current=e}return v3.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),oJe={pan:{Feature:OZe},drag:{Feature:kZe,ProjectionNode:IAe,MeasureLayout:EAe}};function lJe(e,t,n){var i;if(e instanceof Element)return[e];if(typeof e=="string"){let r=document;const s=(i=void 0)!==null&&i!==void 0?i:r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}function PAe(e,t){const n=lJe(e),i=new AbortController,r={passive:!0,...t,signal:i.signal};return[n,r,()=>i.abort()]}function MZ(e){return t=>{t.pointerType==="touch"||mAe()||e(t)}}function cJe(e,t,n={}){const[i,r,s]=PAe(e,n),o=MZ(l=>{const{target:c}=l,u=t(l);if(typeof u!="function"||!c)return;const d=MZ(f=>{u(f),c.removeEventListener("pointerleave",d)});c.addEventListener("pointerleave",d,r)});return i.forEach(l=>{l.addEventListener("pointerenter",o,r)}),s}function LZ(e,t,n){const{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,s=i[r];s&&Ps.postRender(()=>s(t,FA(t)))}class uJe extends wb{mount(){const{current:t}=this.node;t&&(this.unmount=cJe(t,n=>(LZ(this.node,n,"Start"),i=>LZ(this.node,i,"End"))))}unmount(){}}class dJe extends wb{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=$A(sC(this.node.current,"focus",()=>this.onFocus()),sC(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const DAe=(e,t)=>t?e===t?!0:DAe(e,t.parentElement):!1,fJe=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function hJe(e){return fJe.has(e.tagName)||e.tabIndex!==-1}const uS=new WeakSet;function $Z(e){return t=>{t.key==="Enter"&&e(t)}}function x3(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const pJe=(e,t)=>{const n=e.currentTarget;if(!n)return;const i=$Z(()=>{if(uS.has(n))return;x3(n,"down");const r=$Z(()=>{x3(n,"up")}),s=()=>x3(n,"cancel");n.addEventListener("keyup",r,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",i,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),t)};function FZ(e){return fz(e)&&!mAe()}function mJe(e,t,n={}){const[i,r,s]=PAe(e,n),o=l=>{const c=l.currentTarget;if(!FZ(l)||uS.has(c))return;uS.add(c);const u=t(l),d=(m,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!FZ(m)||!uS.has(c))&&(uS.delete(c),typeof u=="function"&&u(m,{success:g}))},f=m=>{d(m,n.useGlobalTarget||DAe(c,m.target))},h=m=>{d(m,!1)};window.addEventListener("pointerup",f,r),window.addEventListener("pointercancel",h,r)};return i.forEach(l=>{!hJe(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,r),l.addEventListener("focus",u=>pJe(u,r),r)}),s}function BZ(e,t,n){const{props:i}=e;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),s=i[r];s&&Ps.postRender(()=>s(t,FA(t)))}class gJe extends wb{mount(){const{current:t}=this.node;t&&(this.unmount=mJe(t,n=>(BZ(this.node,n,"Start"),(i,{success:r})=>BZ(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const E8=new WeakMap,w3=new WeakMap,bJe=e=>{const t=E8.get(e.target);t&&t(e)},yJe=e=>{e.forEach(bJe)};function vJe({root:e,...t}){const n=e||document;w3.has(n)||w3.set(n,{});const i=w3.get(n),r=JSON.stringify(t);return i[r]||(i[r]=new IntersectionObserver(yJe,{root:e,...t})),i[r]}function xJe(e,t,n){const i=vJe(t);return E8.set(e,n),i.observe(e),()=>{E8.delete(e),i.unobserve(e)}}const wJe={some:0,all:1};class kJe extends wb{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:i,amount:r="some",once:s}=t,o={root:n?n.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:wJe[r]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),h=u?d:f;h&&h(c)};return xJe(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(OJe(t,n))&&this.startObserver()}unmount(){}}function OJe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const SJe={inView:{Feature:kJe},tap:{Feature:gJe},focus:{Feature:dJe},hover:{Feature:uJe}},EJe={layout:{ProjectionNode:IAe,MeasureLayout:EAe}},WR={current:null},hz={current:!1};function MAe(){if(hz.current=!0,!!MQ)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>WR.current=e.matches;e.addListener(t),t()}else WR.current=!1}const CJe=[...iAe,Ol,qg],AJe=e=>CJe.find(nAe(e)),UZ=new WeakMap;function TJe(e,t,n){for(const i in t){const r=t[i],s=n[i];if(Cl(r))e.addValue(i,r);else if(Cl(s))e.addValue(i,iC(r,{owner:e}));else if(s!==r)if(e.hasValue(i)){const o=e.getValue(i);o.liveStyle===!0?o.jump(r):o.hasAnimated||o.set(r)}else{const o=e.getStaticValue(i);e.addValue(i,iC(o!==void 0?o:r,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const QZ=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class _Je{scrapeMotionValuesFromProps(t,n,i){return{}}constructor({parent:t,props:n,presenceContext:i,reducedMotionConfig:r,blockInitialAnimation:s,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=lz,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=bh.now();this.renderScheduledAtthis.bindToMotionValue(i,n)),hz.current||MAe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:WR.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){UZ.delete(this.current),this.projection&&this.projection.unmount(),Hg(this.notifyUpdate),Hg(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const i=Dv.has(t),r=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&Ps.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{r(),s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Ww){const n=Ww[t];if(!n)continue;const{isEnabled:i,Feature:r}=n;if(!this.features[t]&&r&&i(this.props)&&(this.features[t]=new r(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):wa()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;in.variantChildren.delete(t)}addValue(t,n){const i=this.values.get(t);n!==i&&(i&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return i===void 0&&n!==void 0&&(i=iC(n===null?void 0:n,{owner:this}),this.addValue(t,i)),i}readValue(t,n){var i;let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(i=this.getBaseTargetFromProps(this.props,t))!==null&&i!==void 0?i:this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(eAe(r)||HCe(r))?r=parseFloat(r):!AJe(r)&&qg.test(n)&&(r=YCe(t,n)),this.setBaseTarget(t,Cl(r)?r.get():r)),Cl(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:i}=this.props;let r;if(typeof i=="string"||typeof i=="object"){const o=QQ(this.props,i,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(r=o[t])}if(i&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Cl(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new JQ),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class LAe extends _Je{constructor(){super(...arguments),this.KeyframeResolver=rAe}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:i}){delete n[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Cl(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function jJe(e){return window.getComputedStyle(e)}class NJe extends LAe{constructor(){super(...arguments),this.type="html",this.renderInstance=SCe}readValueFromInstance(t,n){if(Dv.has(n)){const i=oz(n);return i&&i.default||0}else{const i=jJe(t),r=(wCe(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(t,{transformPagePoint:n}){return OAe(t,n)}build(t,n,i){HQ(t,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,n,i){return GQ(t,n,i)}}class RJe extends LAe{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=wa}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Dv.has(n)){const i=oz(n);return i&&i.default||0}return n=ECe.has(n)?n:FQ(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,i){return TCe(t,n,i)}build(t,n,i){qQ(t,n,this.isSVGTag,i.transformTemplate)}renderInstance(t,n,i,r){CCe(t,n,i,r)}mount(t){this.isSVGTag=KQ(t.tagName),super.mount(t)}}const IJe=(e,t)=>UQ(e)?new RJe(t):new NJe(t,{allowProjection:e!==p.Fragment}),PJe=aXe({...YYe,...SJe,...oJe,...EJe},IJe),_r=wGe(PJe);function kD(){!hz.current&&MAe();const[e]=p.useState(WR.current);return e}function lo(){return lo=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?p.useEffect:p.useLayoutEffect;function sx(e,t,n){var i=p.useRef(t);i.current=t,p.useEffect(function(){function r(s){i.current(s)}return e&&window.addEventListener(e,r,n),function(){e&&window.removeEventListener(e,r)}},[e])}var DJe=["container"];function MJe(e){var t=e.container,n=t===void 0?document.body:t,i=OD(e,DJe);return vi.createPortal(Pi.createElement("div",lo({},i)),n)}function LJe(e){return Pi.createElement("svg",lo({width:"44",height:"44",viewBox:"0 0 768 768"},e),Pi.createElement("path",{d:"M607.5 205.5l-178.5 178.5 178.5 178.5-45 45-178.5-178.5-178.5 178.5-45-45 178.5-178.5-178.5-178.5 45-45 178.5 178.5 178.5-178.5z"}))}function $Je(e){return Pi.createElement("svg",lo({width:"44",height:"44",viewBox:"0 0 768 768"},e),Pi.createElement("path",{d:"M640.5 352.5v63h-390l178.5 180-45 45-256.5-256.5 256.5-256.5 45 45-178.5 180h390z"}))}function FJe(e){return Pi.createElement("svg",lo({width:"44",height:"44",viewBox:"0 0 768 768"},e),Pi.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function BJe(){return p.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function VZ(e){var t=e.touches[0],n=t.clientX,i=t.clientY;if(e.touches.length>=2){var r=e.touches[1],s=r.clientX,o=r.clientY;return[(n+s)/2,(i+o)/2,Math.sqrt(Math.pow(s-n,2)+Math.pow(o-i,2))]}return[n,i,0]}var Wm=function(e,t,n,i){var r,s=n*t,o=(s-i)/2,l=e;return s<=i?(r=1,l=0):e>0&&o-e<=0?(r=2,l=o):e<0&&o+e<=0&&(r=3,l=-o),[r,l]};function k3(e,t,n,i,r,s,o,l,c,u){o===void 0&&(o=innerWidth/2),l===void 0&&(l=innerHeight/2),c===void 0&&(c=0),u===void 0&&(u=0);var d=Wm(e,s,n,innerWidth)[0],f=Wm(t,s,i,innerHeight),h=innerWidth/2,m=innerHeight/2;return{x:o-s/r*(o-(h+e))-h+(i/n>=3&&n*s===innerWidth?0:d?c/2:c),y:l-s/r*(l-(m+t))-m+(f[0]?u/2:u),lastCX:o,lastCY:l}}function T8(e,t,n){var i=e%180!=0;return i?[n,t,i]:[t,n,i]}function O3(e,t,n){var i=T8(n,innerWidth,innerHeight),r=i[0],s=i[1],o=0,l=r,c=s,u=e/t*s,d=t/e*r;return e=s?l=u:e>=r&&tr/s?c=d:t/e>=3&&!i[2]?o=((c=d)-s)/2:l=u,{width:l,height:c,x:0,y:o,pause:!0}}function X2(e,t){var n=t.leading,i=n!==void 0&&n,r=t.maxWait,s=t.wait,o=s===void 0?r||0:s,l=p.useRef(e);l.current=e;var c=p.useRef(0),u=p.useRef(),d=function(){return u.current&&clearTimeout(u.current)},f=p.useCallback(function(){var h=[].slice.call(arguments),m=Date.now();function g(){c.current=m,d(),l.current.apply(null,h)}var b=c.current,v=m-b;if(b===0&&(i&&g(),c.current=m),r!==void 0){if(v>r)return void g()}else v=1&&s&&s())};d()}function d(){c=requestAnimationFrame(u)}}var QJe={T:0,L:0,W:0,H:0,FIT:void 0},FAe=function(){var e=p.useRef(!1);return p.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},zJe=["className"];function VJe(e){var t=e.className,n=t===void 0?"":t,i=OD(e,zJe);return Pi.createElement("div",lo({className:"PhotoView__Spinner "+n},i),Pi.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},Pi.createElement("path",{opacity:".25",d:"M16 0 A16 16 0 0 0 16 32 A16 16 0 0 0 16 0 M16 4 A12 12 0 0 1 16 28 A12 12 0 0 1 16 4"}),Pi.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var HJe=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function qJe(e){var t=e.src,n=e.loaded,i=e.broken,r=e.className,s=e.onPhotoLoad,o=e.loadingElement,l=e.brokenElement,c=OD(e,HJe),u=FAe();return t&&!i?Pi.createElement(Pi.Fragment,null,Pi.createElement("img",lo({className:"PhotoView__Photo"+(r?" "+r:""),src:t,onLoad:function(d){var f=d.target;u.current&&s({loaded:!0,naturalWidth:f.naturalWidth,naturalHeight:f.naturalHeight})},onError:function(){u.current&&s({broken:!0})},draggable:!1,alt:""},c)),!n&&(o?Pi.createElement("span",{className:"PhotoView__icon"},o):Pi.createElement(VJe,{className:"PhotoView__icon"}))):l?Pi.createElement("span",{className:"PhotoView__icon"},typeof l=="function"?l({src:t}):l):null}var WJe={naturalWidth:void 0,naturalHeight:void 0,width:void 0,height:void 0,loaded:void 0,broken:!1,x:0,y:0,touched:!1,maskTouched:!1,rotate:0,scale:1,CX:0,CY:0,lastX:0,lastY:0,lastCX:0,lastCY:0,lastScale:1,touchTime:0,touchLength:0,pause:!0,stopRaf:!0,reach:void 0};function KJe(e){var t=e.item,n=t.src,i=t.render,r=t.width,s=r===void 0?0:r,o=t.height,l=o===void 0?0:o,c=t.originRef,u=e.visible,d=e.speed,f=e.easing,h=e.wrapClassName,m=e.className,g=e.style,b=e.loadingElement,v=e.brokenElement,y=e.onPhotoTap,w=e.onMaskTap,x=e.onReachMove,k=e.onReachUp,S=e.onPhotoResize,O=e.isActive,A=e.expose,E=KR(WJe),j=E[0],T=E[1],R=p.useRef(0),C=FAe(),N=j.naturalWidth,P=N===void 0?s:N,I=j.naturalHeight,D=I===void 0?l:I,_=j.width,L=_===void 0?s:_,F=j.height,M=F===void 0?l:F,H=j.loaded,q=H===void 0?!n:H,U=j.broken,Z=j.x,z=j.y,J=j.touched,ne=j.stopRaf,W=j.maskTouched,X=j.rotate,le=j.scale,V=j.CX,Y=j.CY,K=j.lastX,ue=j.lastY,te=j.lastCX,Oe=j.lastCY,fe=j.lastScale,pe=j.touchTime,Se=j.touchLength,ve=j.pause,Le=j.reach,He=Vy({onScale:function(je){return Ge(G2(je))},onRotate:function(je){X!==je&&(A({rotate:je}),T(lo({rotate:je},O3(P,D,je))))}});function Ge(je,kt,Tt){le!==je&&(A({scale:je}),T(lo({scale:je},k3(Z,z,L,M,le,je,kt,Tt),je<=1&&{x:0,y:0})))}var De=X2(function(je,kt,Tt){if(Tt===void 0&&(Tt=0),(J||W)&&O){var fn=T8(X,L,M),tn=fn[0],We=fn[1];if(Tt===0&&R.current===0){var vt=Math.abs(je-V)<=20,Ke=Math.abs(kt-Y)<=20;if(vt&&Ke)return void T({lastCX:je,lastCY:kt});R.current=vt?kt>Y?3:2:1}var ot,it=je-te,tt=kt-Oe;if(Tt===0){var Ct=Wm(it+K,le,tn,innerWidth)[0],Ot=Wm(tt+ue,le,We,innerHeight);ot=function(Dt,Ze,bt,gt){return Ze&&Dt===1||gt==="x"?"x":bt&&Dt>1||gt==="y"?"y":void 0}(R.current,Ct,Ot[0],Le),ot!==void 0&&x(ot,je,kt,le)}if(ot==="x"||W)return void T({reach:"x"});var Bt=G2(le+(Tt-Se)/100/2*le,P/L,.2);A({scale:Bt}),T(lo({touchLength:Tt,reach:ot,scale:Bt},k3(Z,z,L,M,le,Bt,je,kt,it,tt)))}},{maxWait:8});function se(je){return!ne&&!J&&(C.current&&T(lo({},je,{pause:u})),C.current)}var ce,ye,Ae,Ee,Ce,Be,he,ie,we=(Ce=function(je){return se({x:je})},Be=function(je){return se({y:je})},he=function(je){return C.current&&(A({scale:je}),T({scale:je})),!J&&C.current},ie=Vy({X:function(je){return Ce(je)},Y:function(je){return Be(je)},S:function(je){return he(je)}}),function(je,kt,Tt,fn,tn,We,vt,Ke,ot,it,tt){var Ct=T8(it,tn,We),Ot=Ct[0],Bt=Ct[1],Dt=Wm(je,Ke,Ot,innerWidth),Ze=Dt[0],bt=Dt[1],gt=Wm(kt,Ke,Bt,innerHeight),an=gt[0],Ft=gt[1],cn=Date.now()-tt;if(cn>=200||Ke!==vt||Math.abs(ot-vt)>1){var Je=k3(je,kt,tn,We,vt,Ke),lt=Je.x,hn=Je.y,Sn=Ze?bt:lt!==je?lt:null,Ji=an?Ft:hn!==kt?hn:null;return Sn!==null&&my(je,Sn,ie.X),Ji!==null&&my(kt,Ji,ie.Y),void(Ke!==vt&&my(vt,Ke,ie.S))}var Qn=(je-Tt)/cn,_n=(kt-fn)/cn,pi=Math.sqrt(Math.pow(Qn,2)+Math.pow(_n,2)),Nn=!1,Dn=!1;(function(_i,Fn){var Kn,Rn=_i,nt=0,Ut=0,Qe=function(jn){Kn||(Kn=jn);var lr=jn-Kn,ta=Math.sign(_i),Ms=-.001*ta,ts=Math.sign(-Rn)*Math.pow(Rn,2)*2e-4,ci=Rn*lr+(Ms+ts)*Math.pow(lr,2)/2;nt+=ci,Kn=jn,ta*(Rn+=(Ms+ts)*lr)<=0?Qt():Fn(nt)?xt():Qt()};function xt(){Ut=requestAnimationFrame(Qe)}function Qt(){cancelAnimationFrame(Ut)}xt()})(pi,function(_i){var Fn=je+_i*(Qn/pi),Kn=kt+_i*(_n/pi),Rn=Wm(Fn,vt,Ot,innerWidth),nt=Rn[0],Ut=Rn[1],Qe=Wm(Kn,vt,Bt,innerHeight),xt=Qe[0],Qt=Qe[1];if(nt&&!Nn&&(Nn=!0,Ze?my(Fn,Ut,ie.X):HZ(Ut,Fn+(Fn-Ut),ie.X)),xt&&!Dn&&(Dn=!0,an?my(Kn,Qt,ie.Y):HZ(Qt,Kn+(Kn-Qt),ie.Y)),Nn&&Dn)return!1;var jn=Nn||ie.X(Ut),lr=Dn||ie.Y(Qt);return jn&&lr})}),Re=(ce=y,ye=function(je,kt){Le||Ge(le!==1?1:Math.max(2,P/L),je,kt)},Ae=p.useRef(0),Ee=X2(function(){Ae.current=0,ce.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var je=[].slice.call(arguments);Ae.current+=1,Ee.apply(void 0,je),Ae.current>=2&&(Ee.cancel(),Ae.current=0,ye.apply(void 0,je))});function Ue(je,kt){if(R.current=0,(J||W)&&O){T({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var Tt=G2(le,P/L);if(we(Z,z,K,ue,L,M,le,Tt,fe,X,pe),k(je,kt),V===je&&Y===kt){if(J)return void Re(je,kt);W&&w(je,kt)}}}function _t(je,kt,Tt){Tt===void 0&&(Tt=0),T({touched:!0,CX:je,CY:kt,lastCX:je,lastCY:kt,lastX:Z,lastY:z,lastScale:le,touchLength:Tt,touchTime:Date.now()})}function Pt(je){T({maskTouched:!0,CX:je.clientX,CY:je.clientY,lastX:Z,lastY:z})}sx(sp?void 0:"mousemove",function(je){je.preventDefault(),De(je.clientX,je.clientY)}),sx(sp?void 0:"mouseup",function(je){Ue(je.clientX,je.clientY)}),sx(sp?"touchmove":void 0,function(je){je.preventDefault();var kt=VZ(je);De.apply(void 0,kt)},{passive:!1}),sx(sp?"touchend":void 0,function(je){var kt=je.changedTouches[0];Ue(kt.clientX,kt.clientY)},{passive:!1}),sx("resize",X2(function(){q&&!J&&(T(O3(P,D,X)),S())},{maxWait:8})),A8(function(){O&&A(lo({scale:le,rotate:X},He))},[O]);var Gt=function(je,kt,Tt,fn,tn,We,vt,Ke,ot,it){var tt=function(lt,hn,Sn,Ji,Qn){var _n=p.useRef(!1),pi=KR({lead:!0,scale:Sn}),Nn=pi[0],Dn=Nn.lead,_i=Nn.scale,Fn=pi[1],Kn=X2(function(Rn){try{return Qn(!0),Fn({lead:!1,scale:Rn}),Promise.resolve()}catch(nt){return Promise.reject(nt)}},{wait:Ji});return A8(function(){_n.current?(Qn(!1),Fn({lead:!0}),Kn(Sn)):_n.current=!0},[Sn]),Dn?[lt*_i,hn*_i,Sn/_i]:[lt*Sn,hn*Sn,1]}(We,vt,Ke,ot,it),Ct=tt[0],Ot=tt[1],Bt=tt[2],Dt=function(lt,hn,Sn,Ji,Qn){var _n=p.useState(QJe),pi=_n[0],Nn=_n[1],Dn=p.useState(0),_i=Dn[0],Fn=Dn[1],Kn=p.useRef(),Rn=Vy({OK:function(){return lt&&Fn(4)}});function nt(Ut){Qn(!1),Fn(Ut)}return p.useEffect(function(){if(Kn.current||(Kn.current=Date.now()),Sn){if(function(Ut,Qe){var xt=Ut&&Ut.current;if(xt&&xt.nodeType===1){var Qt=xt.getBoundingClientRect();Qe({T:Qt.top,L:Qt.left,W:Qt.width,H:Qt.height,FIT:xt.tagName==="IMG"?getComputedStyle(xt).objectFit:void 0})}}(hn,Nn),lt)return Date.now()-Kn.current<250?(Fn(1),requestAnimationFrame(function(){Fn(2),requestAnimationFrame(function(){return nt(3)})}),void setTimeout(Rn.OK,Ji)):void Fn(4);nt(5)}},[lt,Sn]),[_i,pi]}(je,kt,Tt,ot,it),Ze=Dt[0],bt=Dt[1],gt=bt.W,an=bt.FIT,Ft=innerWidth/2,cn=innerHeight/2,Je=Ze<3||Ze>4;return[Je?gt?bt.L:Ft:fn+(Ft-We*Ke/2),Je?gt?bt.T:cn:tn+(cn-vt*Ke/2),Ct,Je&&an?Ct*(bt.H/gt):Ot,Ze===0?Bt:Je?gt/(We*Ke)||.01:Bt,Je?an?1:0:1,Ze,an]}(u,c,q,Z,z,L,M,le,d,function(je){return T({pause:je})}),St=Gt[4],Lt=Gt[6],qe="transform "+d+"ms "+f,yt={className:m,onMouseDown:sp?void 0:function(je){je.stopPropagation(),je.button===0&&_t(je.clientX,je.clientY,0)},onTouchStart:sp?function(je){je.stopPropagation(),_t.apply(void 0,VZ(je))}:void 0,onWheel:function(je){if(!Le){var kt=G2(le-je.deltaY/100/2,P/L);T({stopRaf:!0}),Ge(kt,je.clientX,je.clientY)}},style:{width:Gt[2]+"px",height:Gt[3]+"px",opacity:Gt[5],objectFit:Lt===4?void 0:Gt[7],transform:X?"rotate("+X+"deg)":void 0,transition:Lt>2?qe+", opacity "+d+"ms ease, height "+(Lt<4?d/2:Lt>4?d:0)+"ms "+f:void 0}};return Pi.createElement("div",{className:"PhotoView__PhotoWrap"+(h?" "+h:""),style:g,onMouseDown:!sp&&O?Pt:void 0,onTouchStart:sp&&O?function(je){return Pt(je.touches[0])}:void 0},Pi.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+St+", 0, 0, "+St+", "+Gt[0]+", "+Gt[1]+")",transition:J||ve?void 0:qe,willChange:O?"transform":void 0}},n?Pi.createElement(qJe,lo({src:n,loaded:q,broken:U},yt,{onPhotoLoad:function(je){T(lo({},je,je.loaded&&O3(je.naturalWidth||0,je.naturalHeight||0,X)))},loadingElement:b,brokenElement:v})):i&&i({attrs:yt,scale:St,rotate:X})))}var qZ={x:0,touched:!1,pause:!1,lastCX:void 0,lastCY:void 0,bg:void 0,lastBg:void 0,overlay:!0,minimal:!0,scale:1,rotate:0};function GJe(e){var t=e.loop,n=t===void 0?3:t,i=e.speed,r=e.easing,s=e.photoClosable,o=e.maskClosable,l=o===void 0||o,c=e.maskOpacity,u=c===void 0?1:c,d=e.pullClosable,f=d===void 0||d,h=e.bannerVisible,m=h===void 0||h,g=e.overlayRender,b=e.toolbarRender,v=e.className,y=e.maskClassName,w=e.photoClassName,x=e.photoWrapClassName,k=e.loadingElement,S=e.brokenElement,O=e.images,A=e.index,E=A===void 0?0:A,j=e.onIndexChange,T=e.visible,R=e.onClose,C=e.afterClose,N=e.portalContainer,P=KR(qZ),I=P[0],D=P[1],_=p.useState(0),L=_[0],F=_[1],M=I.x,H=I.touched,q=I.pause,U=I.lastCX,Z=I.lastCY,z=I.bg,J=z===void 0?u:z,ne=I.lastBg,W=I.overlay,X=I.minimal,le=I.scale,V=I.rotate,Y=I.onScale,K=I.onRotate,ue=e.hasOwnProperty("index"),te=ue?E:L,Oe=ue?j:F,fe=p.useRef(te),pe=O.length,Se=O[te],ve=typeof n=="boolean"?n:pe>n,Le=function(St,Lt){var qe=p.useReducer(function(Tt){return!Tt},!1)[1],yt=p.useRef(0),je=function(Tt){var fn=p.useRef(Tt);function tn(We){fn.current=We}return p.useMemo(function(){(function(We){St?(We(St),yt.current=1):yt.current=2})(tn)},[Tt]),[fn.current,tn]}(St),kt=je[1];return[je[0],yt.current,function(){qe(),yt.current===2&&(kt(!1),Lt&&Lt()),yt.current=0}]}(T,C),He=Le[0],Ge=Le[1],De=Le[2];A8(function(){if(He)return D({pause:!0,x:te*-(innerWidth+R0)}),void(fe.current=te);D(qZ)},[He]);var se=Vy({close:function(St){K&&K(0),D({overlay:!0,lastBg:J}),R(St)},changeIndex:function(St,Lt){Lt===void 0&&(Lt=!1);var qe=ve?fe.current+(St-te):St,yt=pe-1,je=C8(qe,0,yt),kt=ve?qe:je,Tt=innerWidth+R0;D({touched:!1,lastCX:void 0,lastCY:void 0,x:-Tt*kt,pause:Lt}),fe.current=kt,Oe&&Oe(ve?St<0?yt:St>yt?0:St:je)}}),ce=se.close,ye=se.changeIndex;function Ae(St){return St?ce():D({overlay:!W})}function Ee(){D({x:-(innerWidth+R0)*te,lastCX:void 0,lastCY:void 0,pause:!0}),fe.current=te}function Ce(St,Lt,qe,yt){St==="x"?function(je){if(U!==void 0){var kt=je-U,Tt=kt;!ve&&(te===0&&kt>0||te===pe-1&&kt<0)&&(Tt=kt/2),D({touched:!0,lastCX:U,x:-(innerWidth+R0)*fe.current+Tt,pause:!1})}else D({touched:!0,lastCX:je,x:M,pause:!1})}(Lt):St==="y"&&function(je,kt){if(Z!==void 0){var Tt=u===null?null:C8(u,.01,u-Math.abs(je-Z)/100/4);D({touched:!0,lastCY:Z,bg:kt===1?Tt:u,minimal:kt===1})}else D({touched:!0,lastCY:je,bg:J,minimal:!0})}(qe,yt)}function Be(St,Lt){var qe=St-(U??St),yt=Lt-(Z??Lt),je=!1;if(qe<-40)ye(te+1);else if(qe>40)ye(te-1);else{var kt=-(innerWidth+R0)*fe.current;Math.abs(yt)>100&&X&&f&&(je=!0,ce()),D({touched:!1,x:kt,lastCX:void 0,lastCY:void 0,bg:u,overlay:!!je||W})}}sx("keydown",function(St){if(T)switch(St.key){case"ArrowLeft":ye(te-1,!0);break;case"ArrowRight":ye(te+1,!0);break;case"Escape":ce()}});var he=function(St,Lt,qe){return p.useMemo(function(){var yt=St.length;return qe?St.concat(St).concat(St).slice(yt+Lt-1,yt+Lt+2):St.slice(Math.max(Lt-1,0),Math.min(Lt+2,yt+1))},[St,Lt,qe])}(O,te,ve);if(!He)return null;var ie=W&&!Ge,we=T?J:ne,Re=Y&&K&&{images:O,index:te,visible:T,onClose:ce,onIndexChange:ye,overlayVisible:ie,overlay:Se&&Se.overlay,scale:le,rotate:V,onScale:Y,onRotate:K},Ue=i?i(Ge):400,_t=r?r(Ge):zZ,Pt=i?i(3):600,Gt=r?r(3):zZ;return Pi.createElement(MJe,{className:"PhotoView-Portal"+(ie?"":" PhotoView-Slider__clean")+(T?"":" PhotoView-Slider__willClose")+(v?" "+v:""),role:"dialog",onClick:function(St){return St.stopPropagation()},container:N},T&&Pi.createElement(BJe,null),Pi.createElement("div",{className:"PhotoView-Slider__Backdrop"+(y?" "+y:"")+(Ge===1?" PhotoView-Slider__fadeIn":Ge===2?" PhotoView-Slider__fadeOut":""),style:{background:we?"rgba(0, 0, 0, "+we+")":void 0,transitionTimingFunction:_t,transitionDuration:(H?0:Ue)+"ms",animationDuration:Ue+"ms"},onAnimationEnd:De}),m&&Pi.createElement("div",{className:"PhotoView-Slider__BannerWrap"},Pi.createElement("div",{className:"PhotoView-Slider__Counter"},te+1," / ",pe),Pi.createElement("div",{className:"PhotoView-Slider__BannerRight"},b&&Re&&b(Re),Pi.createElement(LJe,{className:"PhotoView-Slider__toolbarIcon",onClick:ce}))),he.map(function(St,Lt){var qe=ve||te!==0?fe.current-1+Lt:te+Lt;return Pi.createElement(KJe,{key:ve?St.key+"/"+St.src+"/"+qe:St.key,item:St,speed:Ue,easing:_t,visible:T,onReachMove:Ce,onReachUp:Be,onPhotoTap:function(){return Ae(s)},onMaskTap:function(){return Ae(l)},wrapClassName:x,className:w,style:{left:(innerWidth+R0)*qe+"px",transform:"translate3d("+M+"px, 0px, 0)",transition:H||q?void 0:"transform "+Pt+"ms "+Gt},loadingElement:k,brokenElement:S,onPhotoResize:Ee,isActive:fe.current===qe,expose:D})}),!sp&&m&&Pi.createElement(Pi.Fragment,null,(ve||te!==0)&&Pi.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return ye(te-1,!0)}},Pi.createElement($Je,null)),(ve||te+1-1){var y=u.slice();return y.splice(v,1,b),void l({images:y})}l(function(w){return{images:w.images.concat(b)}})},remove:function(b){l(function(v){var y=v.images.filter(function(w){return w.key!==b});return{images:y,index:Math.min(y.length-1,f)}})},show:function(b){var v=u.findIndex(function(y){return y.key===b});l({visible:!0,index:v}),i&&i(!0,v,o)}}),m=Vy({close:function(){l({visible:!1}),i&&i(!1,f,o)},changeIndex:function(b){l({index:b}),n&&n(b,o)}}),g=p.useMemo(function(){return lo({},o,h)},[o,h]);return Pi.createElement($Ae.Provider,{value:g},t,Pi.createElement(GJe,lo({images:u,visible:d,index:f,onIndexChange:m.changeIndex,onClose:m.close},r)))}var BAe=function(e){var t,n,i=e.src,r=e.render,s=e.overlay,o=e.width,l=e.height,c=e.triggers,u=c===void 0?["onClick"]:c,d=e.children,f=p.useContext($Ae),h=(t=function(){return f.nextId()},(n=p.useRef({sign:!1,fn:void 0}).current).sign||(n.sign=!0,n.fn=t()),n.fn),m=p.useRef(null);p.useImperativeHandle(d==null?void 0:d.ref,function(){return m.current}),p.useEffect(function(){return function(){f.remove(h)}},[]);var g=Vy({render:function(v){return r&&r(v)},show:function(v,y){f.show(h),function(w,x){if(d){var k=d.props[w];k&&k(x)}}(v,y)}}),b=p.useMemo(function(){var v={};return u.forEach(function(y){v[y]=g.show.bind(null,y)}),v},[]);return p.useEffect(function(){f.update({key:h,src:i,originRef:m,render:g.render,overlay:s,width:o,height:l})},[i]),d?p.Children.only(p.cloneElement(d,lo({},b,{ref:m}))):null};function sv(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("path",{d:"m7.5 9 2.7 2.5L7.5 14M12.7 14h3.8"}),a.jsx("path",{d:"M3.8 7.5h16.4",opacity:".55"})]})}function UAe(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("path",{d:"M3.8 8h16.4"}),a.jsx("circle",{cx:"6.5",cy:"6.3",r:".65",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"8.8",cy:"6.3",r:".65",fill:"currentColor",stroke:"none"}),a.jsx("path",{d:"m9 15 2.2-4 1.6 2.4 1.1-1.2L16 15H9Z"})]})}function pz(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M12 3.4 19 6v5.3c0 4.3-2.7 7.6-7 9.3-4.3-1.7-7-5-7-9.3V6l7-2.6Z"}),a.jsx("path",{d:"m8.8 12 2 2 4.4-4.4"})]})}function aN(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M3.5 7.7h6.1l1.7 2h9.2v7.5a2.3 2.3 0 0 1-2.3 2.3H5.8a2.3 2.3 0 0 1-2.3-2.3V7.7Z"}),a.jsx("path",{d:"M3.8 7.7V6.8a2.3 2.3 0 0 1 2.3-2.3h3l1.8 2h6.9a2.3 2.3 0 0 1 2.3 2.3v.9"}),a.jsx("path",{d:"M12 13v3M10.5 14.5h3"})]})}function JJe(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 5v14M5 12h14"})})}function WZ(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6.5 11.5 5.5-5.5 5.5 5.5M12 6v12"})})}function KZ(e){return a.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",...e,children:a.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1.75",fill:"currentColor"})})}function eet(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("circle",{cx:"8.5",cy:"9",r:"1.4"}),a.jsx("path",{d:"m5.5 17 4.2-4.2 2.6 2.4 2.1-2.1 4.1 3.9"})]})}function tet(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3.5h7l5 5v12H6z"}),a.jsx("path",{d:"M13 3.5v5h5M9 13h6M9 16h5"})]})}function net(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"5",width:"13.5",height:"14",rx:"2.5"}),a.jsx("path",{d:"m17 10 3.5-2v8L17 14zM7 8.5h4.5"})]})}function iet(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m12 3 1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5zM18.5 15.5l.7 2.1 2.1.7-2.1.7-.7 2.1-.7-2.1-2.1-.7 2.1-.7z"})})}function QAe(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function _8(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m9 6 6 6-6 6"})})}function ret(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.8 8.2A8 8 0 1 1 4 12M4.8 8.2V4.5M4.8 8.2h3.7"}),a.jsx("path",{d:"M12 8v4.5l3 1.8"})]})}function _c(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M20 12a8 8 0 1 1-2.35-5.65"})})}function set(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"8",y:"8",width:"11",height:"11",rx:"2"}),a.jsx("path",{d:"M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"})]})}function zAe(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m5 12.5 4.2 4.2L19 7"})})}function Q(e,t={}){return bn.t(e,{...t,ns:"adk"})}function hl(e){const t=new Headers(e);return t.has("Accept-Language")||t.set("Accept-Language",bn.resolvedLanguage||bn.language),t}function j8(){return bn.resolvedLanguage||bn.language}function aet(e){if(e.timezone!=null){if(typeof e.timezone!="string")return!1;try{new Intl.DateTimeFormat("en-US",{timeZone:e.timezone})}catch{return!1}}return e.runAt!=null&&(typeof e.runAt!="string"||!Number.isFinite(Date.parse(e.runAt)))?!1:[e.weekdays,e.monthDays].every(t=>t==null||Array.isArray(t)&&t.every(Number.isInteger))}async function oet(e,t,n,i,r){const s=await e(`/web/mpa-cron/${encodeURIComponent(t.runtimeId)}?region=${encodeURIComponent(t.region)}&offset=${n}&query=${encodeURIComponent(i)}`,{signal:r},{});if(!s.ok)throw new Error(`MPA_HTTP_${s.status}`);let o;try{o=await s.json()}catch{throw new Error("MPA_INVALID_RESPONSE")}if(!o||!Array.isArray(o.items)||!Number.isInteger(o.total)||o.total<0||typeof o.hasMore!="boolean"||o.hasMore&&(!Number.isInteger(o.nextOffset)||o.nextOffset<=n)||o.overview!=null&&(!Number.isFinite(o.overview.executionCount)||!Number.isFinite(o.overview.successRate))||!o.items.every(l=>l&&typeof l.id=="string"&&typeof l.name=="string"&&typeof l.enabled=="boolean"&&(l.prompt==null||typeof l.prompt=="string")&&l.schedule&&typeof l.schedule.type=="string"&&aet(l.schedule)&&[l.agentId,l.lastRunAt,l.runningAt,l.createdAt].every(c=>c==null||typeof c=="string")&&(l.nextRunAt==null||typeof l.nextRunAt=="string")&&(l.lastRunStatus==null||typeof l.lastRunStatus=="string")))throw new Error("MPA_INVALID_RESPONSE");return o}async function cet(e,t,n,i,r,s){const o=await e(`/web/mpa-cron/${encodeURIComponent(t.runtimeId)}${i}?region=${encodeURIComponent(t.region)}`,{method:n,signal:s,...r===void 0?{}:{headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}},{});if(!o.ok)throw new Error(`MPA_HTTP_${o.status}`);let l;try{l=await o.json()}catch{throw new Error("MPA_INVALID_RESPONSE")}if(!l||typeof l!="object"||Array.isArray(l))throw new Error("MPA_INVALID_RESPONSE");return l}async function uet(e,t,n,i,r){const s=await e(`/web/mpa-cron/${encodeURIComponent(t.runtimeId)}/${encodeURIComponent(n)}/runs?region=${encodeURIComponent(t.region)}&offset=${i}`,{signal:r},{});if(!s.ok)throw new Error(`MPA_HTTP_${s.status}`);let o;try{o=await s.json()}catch{throw new Error("MPA_INVALID_RESPONSE")}if(!o||!Array.isArray(o.items)||!Number.isInteger(o.total)||o.total<0||typeof o.hasMore!="boolean"||o.hasMore&&(!Number.isInteger(o.nextOffset)||o.nextOffset<=i)||!o.items.every(l=>l&&typeof l.id=="string"&&typeof l.status=="string"&&typeof l.scheduledAt=="string"&&[l.startedAt,l.errorMessage,l.sessionId].every(c=>c==null||typeof c=="string")&&(l.durationMs==null||Number.isFinite(l.durationMs)&&l.durationMs>=0)))throw new Error("MPA_INVALID_RESPONSE");return o}const GZ="veadk_auth_qs",det=new Set(["view","source","sessionId","artifactSha256","validationReportSha256","projectId","versionId"]);let cO=null;function fet(){if(cO!==null)return cO;const e=new URLSearchParams(window.location.search),t=new URLSearchParams,n=new URLSearchParams,i=e.get("view")==="runtime-deploy"&&e.get("source")==="intelligent-development";e.forEach((s,o)=>{(i&&det.has(o)?n:t).append(o,s)});const r=t.toString();if(r?(sessionStorage.setItem(GZ,r),cO=r):cO=sessionStorage.getItem(GZ)??"",r){const s=n.toString();window.history.replaceState(null,"",window.location.pathname+(s?`?${s}`:"")+window.location.hash)}return cO}function Na(e){const t=fet();if(!t)return e;const n=new URL(e,window.location.origin);return new URLSearchParams(t).forEach((i,r)=>{n.searchParams.has(r)||n.searchParams.set(r,i)}),/^https?:\/\//i.test(e)?n.toString():n.pathname+n.search+n.hash}const eo=3e4,yr=12e4,mz=1e4;function po(e,t=eo){if(t<=0)return e??void 0;const n=AbortSignal.timeout(t);return e?AbortSignal.any([e,n]):n}const GR="veadk_local_user",XR="veadk_local_user_tab",het="X-VeADK-OAuth-Refresh-Retry",pet=[50,250],met=/^[A-Za-z0-9]{1,16}$/;function VAe(){try{const e=sessionStorage.getItem(XR);if(e)return e;const t=localStorage.getItem(GR);return t&&sessionStorage.setItem(XR,t),t}catch{try{return localStorage.getItem(GR)}catch{return null}}}function XZ(e){try{sessionStorage.setItem(XR,e)}catch{}try{localStorage.setItem(GR,e)}catch{}}function get(){try{sessionStorage.removeItem(XR)}catch{}try{localStorage.removeItem(GR)}catch{}}function oc(e){const t=new Headers(e),n=VAe();return n&&t.set("X-VeADK-Local-User",n),t}async function HAe(){let e;try{e=await fetch("/web/auth-config",{headers:hl({Accept:"application/json"}),signal:po(void 0,mz)})}catch(t){throw console.warn("[identity] /web/auth-config is unreachable:",t),new Error(Q("identity.loadConfigNetworkFailed"))}if(!e.ok)throw new Error(Q("identity.configServiceFailed",{status:e.status}));try{const t=await e.json();if(!Array.isArray(t.providers))throw new TypeError("providers is not an array");return t.providers}catch(t){throw console.warn("[identity] /web/auth-config returned an invalid response:",t),new Error(Q("identity.invalidConfigResponse"))}}function bet(e){const t=window.location.pathname+window.location.search+window.location.hash,n=e.includes("?")?"&":"?";window.location.assign(`${e}${n}redirect=${encodeURIComponent(t)}`)}function yet(){const e=window.location.pathname+window.location.search+window.location.hash,t=window.open("about:blank","_blank","popup,width=520,height=720");if(!t)return null;try{t.opener=null,t.location.replace(`/oauth2/login?redirect=${encodeURIComponent(e)}`)}catch{return t.close(),null}return t}async function vet(){const[e,t]=await Promise.all([N8(),HAe()]);return e.status==="unauthenticated"&&t.length>0}function xet(){window.location.assign("/oauth2/logout")}async function wet(){for(let e=0;;e+=1){let t;try{t=await fetch("/oauth2/userinfo",{headers:hl({Accept:"application/json"}),signal:po(void 0,mz)})}catch(i){throw console.warn("[identity] /oauth2/userinfo is unreachable:",i),new Error(Q("identity.serviceNetworkFailed"))}const n=pet[e];if(t.status!==401||t.headers.get(het)!=="1"||n===void 0)return t;await new Promise(i=>window.setTimeout(i,n))}}async function N8(){const e=await wet();if(e.ok){let n;try{n=await e.json()}catch(r){throw console.warn("[identity] /oauth2/userinfo returned a non-JSON response:",r),new Error(Q("identity.invalidServiceResponse"))}return{status:"authenticated",userId:String(n.sub??n.user_id??n.email??""),info:n}}if(e.status===401)return{status:"unauthenticated",userId:"",local:!1};if(e.status!==404)throw new Error(Q("identity.serviceFailed",{status:e.status}));const t=VAe();return t?{status:"authenticated",userId:t,info:{name:t},local:!0}:{status:"unauthenticated",userId:"",local:!0}}function ket(e){if(!e)return"";for(const t of[e.name,e.preferred_username,e.username,e.email])if(typeof t=="string"&&t.trim())return t.trim();return""}function Oet(e){const t=e==null?void 0:e.picture;return typeof t=="string"?t.trim():""}const R8="veadk:authentication-required";let eE=null,dS=null;function Eet(e){if(!e.redirected||!e.url)return!1;try{const t=new URL(e.url);return t.pathname.includes("/authorize")||t.pathname.includes("/oauth2/login")||t.hostname.includes(".userpool.auth.")}catch{return!1}}function Cet(e){eE||(eE=new Promise(n=>{dS=n}),window.dispatchEvent(new Event(R8)));const t=eE;return e?e.aborted?Promise.reject(e.reason??new Error("Request aborted")):new Promise((n,i)=>{const r=()=>i(e.reason??new Error("Request aborted"));e.addEventListener("abort",r,{once:!0}),t.then(()=>{e.removeEventListener("abort",r),n()},s=>{e.removeEventListener("abort",r),i(s)})}):t}function Aet(){return eE!==null}function Tet(){dS==null||dS(),dS=null,eE=null}async function SD(e,t){var i;const n=await e.text().catch(()=>"");try{return JSON.parse(n)}catch{const r=((i=e.headers.get("content-type"))==null?void 0:i.split(";",1)[0])||Q("common.contentTypeMissing"),s=n.trim().slice(0,2e3),o=s?` -${Q("common.response",{response:s})}`:"";throw new Error(Q("jsonResponse.nonJson",{fallback:t,status:e.status,contentType:r,detail:o}))}}const _et=/\brun_sse\s*failed\s*:\s*404\b/i,jet=/session not found/i,Net=/(?:^|[::\s])not found\s*$/i,Ret=/Expecting (?:'[^']+'|\w+)(?: delimiter)?: line \d+ column \d+ \(char \d+\)/i,Iet=/Unknown or expired collection_id\s+'[^']+'\.\s*Call collect_resources first\./i,Pet=/(?:RateLimitError|\bTPM\b|\bRPM\b|tokens? per minute|requests? per minute)[\s\S]*(?:\b429\b|limit|quota)|\b429\b[\s\S]*(?:model|RateLimitError|\bTPM\b|\bRPM\b)/i;function I0(e,t){return e.includes(t)?e:`${e} + `),()=>{document.head.removeChild(d)}},[t]),a.jsx(dGe,{isPresent:t,childRef:i,sizeRef:r,children:p.cloneElement(e,{ref:i})})}const hGe=({children:e,initial:t,isPresent:n,onExitComplete:i,custom:r,presenceAffectsLayout:s,mode:o})=>{const l=mD(pGe),c=p.useId(),u=p.useCallback(f=>{l.set(f,!0);for(const h of l.values())if(!h)return;i&&i()},[l,i]),d=p.useMemo(()=>({id:c,initial:t,isPresent:n,custom:r,onExitComplete:u,register:f=>(l.set(f,!1),()=>l.delete(f))}),s?[Math.random(),u]:[n,u]);return p.useMemo(()=>{l.forEach((f,h)=>l.set(h,!1))},[n]),p.useEffect(()=>{!n&&!l.size&&i&&i()},[n]),o==="popLayout"&&(e=a.jsx(fGe,{isPresent:n,children:e})),a.jsx(gD.Provider,{value:d,children:e})};function pGe(){return new Map}function cCe(e=!0){const t=p.useContext(gD);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:r}=t,s=p.useId();p.useEffect(()=>{e&&r(s)},[e]);const o=p.useCallback(()=>e&&i&&i(s),[s,i,e]);return!n&&i?[!1,o]:[!0]}const H2=e=>e.key||"";function TY(e){const t=[];return p.Children.forEach(e,n=>{p.isValidElement(n)&&t.push(n)}),t}const MQ=typeof window<"u",uCe=MQ?p.useLayoutEffect:p.useEffect,uf=({children:e,custom:t,initial:n=!0,onExitComplete:i,presenceAffectsLayout:r=!0,mode:s="sync",propagate:o=!1})=>{const[l,c]=cCe(o),u=p.useMemo(()=>TY(e),[e]),d=o&&!l?[]:u.map(H2),f=p.useRef(!0),h=p.useRef(u),m=mD(()=>new Map),[g,b]=p.useState(u),[v,y]=p.useState(u);uCe(()=>{f.current=!1,h.current=u;for(let k=0;k{const S=H2(k),O=o&&!l?!1:u===v||d.includes(S),A=()=>{if(m.has(S))m.set(S,!0);else return;let E=!0;m.forEach(j=>{j||(E=!1)}),E&&(x==null||x(),y(h.current),o&&(c==null||c()),i&&i())};return a.jsx(hGe,{isPresent:O,initial:!f.current||n?void 0:!1,custom:O?void 0:t,presenceAffectsLayout:r,mode:s,onExitComplete:O?void 0:A,children:k},S)})})},Iu=e=>e;let dCe=Iu;const mGe={useManualTiming:!1};function gGe(e){let t=new Set,n=new Set,i=!1,r=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function l(u){s.has(u)&&(c.schedule(u),e()),u(o)}const c={schedule:(u,d=!1,f=!1)=>{const m=f&&i?t:n;return d&&s.add(u),m.has(u)||m.add(u),u},cancel:u=>{n.delete(u),s.delete(u)},process:u=>{if(o=u,i){r=!0;return}i=!0,[t,n]=[n,t],t.forEach(l),t.clear(),i=!1,r&&(r=!1,c.process(u))}};return c}const q2=["read","resolveKeyframes","update","preRender","render","postRender"],bGe=40;function fCe(e,t){let n=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=q2.reduce((y,w)=>(y[w]=gGe(s),y),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:f,postRender:h}=o,m=()=>{const y=performance.now();n=!1,r.delta=i?1e3/60:Math.max(Math.min(y-r.timestamp,bGe),1),r.timestamp=y,r.isProcessing=!0,l.process(r),c.process(r),u.process(r),d.process(r),f.process(r),h.process(r),r.isProcessing=!1,n&&t&&(i=!1,e(m))},g=()=>{n=!0,i=!0,r.isProcessing||e(m)};return{schedule:q2.reduce((y,w)=>{const x=o[w];return y[w]=(k,S=!1,O=!1)=>(n||g(),x.schedule(k,S,O)),y},{}),cancel:y=>{for(let w=0;w_Y[e].some(n=>!!t[n])};function yGe(e){for(const t in e)Ww[t]={...Ww[t],...e[t]}}const vGe=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function BR(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||vGe.has(e)}let pCe=e=>!BR(e);function mCe(e){e&&(pCe=t=>t.startsWith("on")?!BR(t):e(t))}try{mCe(require("@emotion/is-prop-valid").default)}catch{}function xGe(e,t,n){const i={};for(const r in e)r==="values"&&typeof e.values=="object"||(pCe(r)||n===!0&&BR(r)||!t&&!BR(r)||e.draggable&&r.startsWith("onDrag"))&&(i[r]=e[r]);return i}function wGe({children:e,isValidProp:t,...n}){t&&mCe(t),n={...p.useContext(eC),...n},n.isStatic=mD(()=>n.isStatic);const i=p.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return a.jsx(eC.Provider,{value:i,children:e})}function kGe(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...i)=>e(...i);return new Proxy(n,{get:(i,r)=>r==="create"?e:(t.has(r)||t.set(r,e(r)),t.get(r))})}const bD=p.createContext({});function tC(e){return typeof e=="string"||Array.isArray(e)}function yD(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const LQ=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],$Q=["initial",...LQ];function vD(e){return yD(e.animate)||$Q.some(t=>tC(e[t]))}function gCe(e){return!!(vD(e)||e.variants)}function OGe(e,t){if(vD(e)){const{initial:n,animate:i}=e;return{initial:n===!1||tC(n)?n:void 0,animate:tC(i)?i:void 0}}return e.inherit!==!1?t:{}}function SGe(e){const{initial:t,animate:n}=OGe(e,p.useContext(bD));return p.useMemo(()=>({initial:t,animate:n}),[jY(t),jY(n)])}function jY(e){return Array.isArray(e)?e.join(" "):e}const EGe=Symbol.for("motionComponentSymbol");function Rx(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function CGe(e,t,n){return p.useCallback(i=>{i&&e.onMount&&e.onMount(i),t&&(i?t.mount(i):t.unmount()),n&&(typeof n=="function"?n(i):Rx(n)&&(n.current=i))},[t])}const FQ=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),AGe="framerAppearId",bCe="data-"+FQ(AGe),{schedule:BQ}=fCe(queueMicrotask,!1),yCe=p.createContext({});function TGe(e,t,n,i,r){var s,o;const{visualElement:l}=p.useContext(bD),c=p.useContext(hCe),u=p.useContext(gD),d=p.useContext(eC).reducedMotion,f=p.useRef(null);i=i||c.renderer,!f.current&&i&&(f.current=i(e,{visualState:t,parent:l,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));const h=f.current,m=p.useContext(yCe);h&&!h.projection&&r&&(h.type==="html"||h.type==="svg")&&_Ge(f.current,n,r,m);const g=p.useRef(!1);p.useInsertionEffect(()=>{h&&g.current&&h.update(n,u)});const b=n[bCe],v=p.useRef(!!b&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,b))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,b)));return uCe(()=>{h&&(g.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),BQ.render(h.render),v.current&&h.animationState&&h.animationState.animateChanges())}),p.useEffect(()=>{h&&(!v.current&&h.animationState&&h.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,b)}),v.current=!1))}),h}function _Ge(e,t,n,i){const{layoutId:r,layout:s,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:vCe(e.parent)),e.projection.setOptions({layoutId:r,layout:s,alwaysMeasureLayout:!!o||l&&Rx(l),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:i,layoutScroll:c,layoutRoot:u})}function vCe(e){if(e)return e.options.allowProjection!==!1?e.projection:vCe(e.parent)}function jGe({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:i,Component:r}){var s,o;e&&yGe(e);function l(u,d){let f;const h={...p.useContext(eC),...u,layoutId:NGe(u)},{isStatic:m}=h,g=SGe(u),b=i(u,m);if(!m&&MQ){RGe();const v=IGe(h);f=v.MeasureLayout,g.visualElement=TGe(r,b,h,t,v.ProjectionNode)}return a.jsxs(bD.Provider,{value:g,children:[f&&g.visualElement?a.jsx(f,{visualElement:g.visualElement,...h}):null,n(r,u,CGe(b,g.visualElement,d),b,m,g.visualElement)]})}l.displayName=`motion.${typeof r=="string"?r:`create(${(o=(s=r.displayName)!==null&&s!==void 0?s:r.name)!==null&&o!==void 0?o:""})`}`;const c=p.forwardRef(l);return c[EGe]=r,c}function NGe({layoutId:e}){const t=p.useContext(DQ).id;return t&&e!==void 0?t+"-"+e:e}function RGe(e,t){p.useContext(hCe).strict}function IGe(e){const{drag:t,layout:n}=Ww;if(!t&&!n)return{};const i={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}const PGe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function UQ(e){return typeof e!="string"||e.includes("-")?!1:!!(PGe.indexOf(e)>-1||/[A-Z]/u.test(e))}function NY(e){const t=[{},{}];return e==null||e.values.forEach((n,i)=>{t[0][i]=n.get(),t[1][i]=n.getVelocity()}),t}function QQ(e,t,n,i){if(typeof t=="function"){const[r,s]=NY(i);t=t(n!==void 0?n:e.custom,r,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[r,s]=NY(i);t=t(n!==void 0?n:e.custom,r,s)}return t}const d8=e=>Array.isArray(e),DGe=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),MGe=e=>d8(e)?e[e.length-1]||0:e,Cl=e=>!!(e&&e.getVelocity);function iN(e){const t=Cl(e)?e.get():e;return DGe(t)?t.toValue():t}function LGe({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},i,r,s){const o={latestValues:$Ge(i,r,s,e),renderState:t()};return n&&(o.onMount=l=>n({props:i,current:l,...o}),o.onUpdate=l=>n(l)),o}const xCe=e=>(t,n)=>{const i=p.useContext(bD),r=p.useContext(gD),s=()=>LGe(e,t,i,r);return n?s():mD(s)};function $Ge(e,t,n,i){const r={},s=i(e,{});for(const h in s)r[h]=iN(s[h]);let{initial:o,animate:l}=e;const c=vD(e),u=gCe(e);t&&u&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const f=d?l:o;if(f&&typeof f!="boolean"&&!yD(f)){const h=Array.isArray(f)?f:[f];for(let m=0;mt=>typeof t=="string"&&t.startsWith(e),kCe=wCe("--"),FGe=wCe("var(--"),zQ=e=>FGe(e)?BGe.test(e.split("/*")[0].trim()):!1,BGe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,OCe=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Gp=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},nC={...U1,transform:e=>Gp(0,1,e)},W2={...U1,default:1},MA=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Um=MA("deg"),gh=MA("%"),Yn=MA("px"),UGe=MA("vh"),QGe=MA("vw"),RY={...gh,parse:e=>gh.parse(e)/100,transform:e=>gh.transform(e*100)},zGe={borderWidth:Yn,borderTopWidth:Yn,borderRightWidth:Yn,borderBottomWidth:Yn,borderLeftWidth:Yn,borderRadius:Yn,radius:Yn,borderTopLeftRadius:Yn,borderTopRightRadius:Yn,borderBottomRightRadius:Yn,borderBottomLeftRadius:Yn,width:Yn,maxWidth:Yn,height:Yn,maxHeight:Yn,top:Yn,right:Yn,bottom:Yn,left:Yn,padding:Yn,paddingTop:Yn,paddingRight:Yn,paddingBottom:Yn,paddingLeft:Yn,margin:Yn,marginTop:Yn,marginRight:Yn,marginBottom:Yn,marginLeft:Yn,backgroundPositionX:Yn,backgroundPositionY:Yn},VGe={rotate:Um,rotateX:Um,rotateY:Um,rotateZ:Um,scale:W2,scaleX:W2,scaleY:W2,scaleZ:W2,skew:Um,skewX:Um,skewY:Um,distance:Yn,translateX:Yn,translateY:Yn,translateZ:Yn,x:Yn,y:Yn,z:Yn,perspective:Yn,transformPerspective:Yn,opacity:nC,originX:RY,originY:RY,originZ:Yn},IY={...U1,transform:Math.round},VQ={...zGe,...VGe,zIndex:IY,size:Yn,fillOpacity:nC,strokeOpacity:nC,numOctaves:IY},HGe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},qGe=B1.length;function WGe(e,t,n){let i="",r=!0;for(let s=0;s({style:{},transform:{},transformOrigin:{},vars:{}}),SCe=()=>({...WQ(),attrs:{}}),KQ=e=>typeof e=="string"&&e.toLowerCase()==="svg";function ECe(e,{style:t,vars:n},i,r){Object.assign(e.style,t,r&&r.getProjectionStyles(i));for(const s in n)e.style.setProperty(s,n[s])}const CCe=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function ACe(e,t,n,i){ECe(e,t,void 0,i);for(const r in t.attrs)e.setAttribute(CCe.has(r)?r:FQ(r),t.attrs[r])}const UR={};function ZGe(e){Object.assign(UR,e)}function TCe(e,{layout:t,layoutId:n}){return Dv.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!UR[e]||e==="opacity")}function GQ(e,t,n){var i;const{style:r}=e,s={};for(const o in r)(Cl(r[o])||t.style&&Cl(t.style[o])||TCe(o,e)||((i=n==null?void 0:n.getValue(o))===null||i===void 0?void 0:i.liveStyle)!==void 0)&&(s[o]=r[o]);return s}function _Ce(e,t,n){const i=GQ(e,t,n);for(const r in e)if(Cl(e[r])||Cl(t[r])){const s=B1.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[s]=e[r]}return i}function JGe(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const DY=["x","y","width","height","cx","cy","r"],eXe={useVisualState:xCe({scrapeMotionValuesFromProps:_Ce,createRenderState:SCe,onUpdate:({props:e,prevProps:t,current:n,renderState:i,latestValues:r})=>{if(!n)return;let s=!!e.drag;if(!s){for(const l in r)if(Dv.has(l)){s=!0;break}}if(!s)return;let o=!t;if(t)for(let l=0;l{JGe(n,i),Ps.render(()=>{qQ(i,r,KQ(n.tagName),e.transformTemplate),ACe(n,i)})})}})},tXe={useVisualState:xCe({scrapeMotionValuesFromProps:GQ,createRenderState:WQ})};function jCe(e,t,n){for(const i in t)!Cl(t[i])&&!TCe(i,n)&&(e[i]=t[i])}function nXe({transformTemplate:e},t){return p.useMemo(()=>{const n=WQ();return HQ(n,t,e),Object.assign({},n.vars,n.style)},[t])}function iXe(e,t){const n=e.style||{},i={};return jCe(i,n,e),Object.assign(i,nXe(e,t)),i}function rXe(e,t){const n={},i=iXe(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=i,n}function sXe(e,t,n,i){const r=p.useMemo(()=>{const s=SCe();return qQ(s,t,KQ(i),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};jCe(s,e.style,e),r.style={...s,...r.style}}return r}function aXe(e=!1){return(n,i,r,{latestValues:s},o)=>{const c=(UQ(n)?sXe:rXe)(i,s,o,n),u=xGe(i,typeof n=="string",e),d=n!==p.Fragment?{...u,...c,ref:r}:{},{children:f}=i,h=p.useMemo(()=>Cl(f)?f.get():f,[f]);return p.createElement(n,{...d,children:h})}}function oXe(e,t){return function(i,{forwardMotionProps:r}={forwardMotionProps:!1}){const o={...UQ(i)?eXe:tXe,preloadedFeatures:e,useRender:aXe(r),createVisualElement:t,Component:i};return jGe(o)}}function NCe(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i(rN===void 0&&bh.set(Zo.isProcessing||mGe.useManualTiming?Zo.timestamp:performance.now()),rN),set:e=>{rN=e,queueMicrotask(lXe)}};function YQ(e,t){e.indexOf(t)===-1&&e.push(t)}function ZQ(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class JQ{constructor(){this.subscriptions=[]}add(t){return YQ(this.subscriptions,t),()=>ZQ(this.subscriptions,t)}notify(t,n,i){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](t,n,i);else for(let s=0;s!isNaN(parseFloat(e));class uXe{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(i,r=!0)=>{const s=bh.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=bh.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=cXe(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new JQ);const i=this.events[t].add(n);return t==="change"?()=>{i(),Ps.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,i){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=bh.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>MY)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,MY);return ICe(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function iC(e,t){return new uXe(e,t)}function dXe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,iC(n))}function fXe(e,t){const n=xD(e,t);let{transitionEnd:i={},transition:r={},...s}=n||{};s={...s,...i};for(const o in s){const l=MGe(s[o]);dXe(e,o,l)}}function hXe(e){return!!(Cl(e)&&e.add)}function f8(e,t){const n=e.getValue("willChange");if(hXe(n))return n.add(t)}function PCe(e){return e.props[bCe]}function ez(e){let t;return()=>(t===void 0&&(t=e()),t)}const pXe=ez(()=>window.ScrollTimeline!==void 0);class mXe{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let i=0;i{if(pXe()&&r.attachTimeline)return r.attachTimeline(t);if(typeof n=="function")return n(r)});return()=>{i.forEach((r,s)=>{r&&r(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;nn[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class gXe extends mXe{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const Ip=e=>e*1e3,Pp=e=>e/1e3;function tz(e){return typeof e=="function"}function LY(e,t){e.timeline=t,e.onfinish=null}const nz=e=>Array.isArray(e)&&typeof e[0]=="number",bXe={linearEasing:void 0};function yXe(e,t){const n=ez(e);return()=>{var i;return(i=bXe[t])!==null&&i!==void 0?i:n()}}const QR=yXe(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Kw=(e,t,n)=>{const i=t-e;return i===0?1:(n-e)/i},DCe=(e,t,n=10)=>{let i="";const r=Math.max(Math.round(t/n),2);for(let s=0;s`cubic-bezier(${e}, ${t}, ${n}, ${i})`,h8={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:lS([0,.65,.55,1]),circOut:lS([.55,0,1,.45]),backIn:lS([.31,.01,.66,-.59]),backOut:lS([.33,1.53,.69,.99])};function LCe(e,t){if(e)return typeof e=="function"&&QR()?DCe(e,t):nz(e)?lS(e):Array.isArray(e)?e.map(n=>LCe(n,t)||h8.easeOut):h8[e]}const $Ce=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,vXe=1e-7,xXe=12;function wXe(e,t,n,i,r){let s,o,l=0;do o=t+(n-t)/2,s=$Ce(o,i,r)-e,s>0?n=o:t=o;while(Math.abs(s)>vXe&&++lwXe(s,0,1,e,n);return s=>s===0||s===1?s:$Ce(r(s),t,i)}const FCe=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,BCe=e=>t=>1-e(1-t),UCe=LA(.33,1.53,.69,.99),iz=BCe(UCe),QCe=FCe(iz),zCe=e=>(e*=2)<1?.5*iz(e):.5*(2-Math.pow(2,-10*(e-1))),rz=e=>1-Math.sin(Math.acos(e)),VCe=BCe(rz),HCe=FCe(rz),qCe=e=>/^0[^.\s]+$/u.test(e);function kXe(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||qCe(e):!0}const XS=e=>Math.round(e*1e5)/1e5,sz=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function OXe(e){return e==null}const SXe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,az=(e,t)=>n=>!!(typeof n=="string"&&SXe.test(n)&&n.startsWith(e)||t&&!OXe(n)&&Object.prototype.hasOwnProperty.call(n,t)),WCe=(e,t,n)=>i=>{if(typeof i!="string")return i;const[r,s,o,l]=i.match(sz);return{[e]:parseFloat(r),[t]:parseFloat(s),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},EXe=e=>Gp(0,255,e),u3={...U1,transform:e=>Math.round(EXe(e))},Oy={test:az("rgb","red"),parse:WCe("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+u3.transform(e)+", "+u3.transform(t)+", "+u3.transform(n)+", "+XS(nC.transform(i))+")"};function CXe(e){let t="",n="",i="",r="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),r=e.substring(4,5),t+=t,n+=n,i+=i,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const p8={test:az("#"),parse:CXe,transform:Oy.transform},Ix={test:az("hsl","hue"),parse:WCe("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+gh.transform(XS(t))+", "+gh.transform(XS(n))+", "+XS(nC.transform(i))+")"},Ol={test:e=>Oy.test(e)||p8.test(e)||Ix.test(e),parse:e=>Oy.test(e)?Oy.parse(e):Ix.test(e)?Ix.parse(e):p8.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Oy.transform(e):Ix.transform(e)},AXe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function TXe(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(sz))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(AXe))===null||n===void 0?void 0:n.length)||0)>0}const KCe="number",GCe="color",_Xe="var",jXe="var(",$Y="${}",NXe=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function rC(e){const t=e.toString(),n=[],i={color:[],number:[],var:[]},r=[];let s=0;const l=t.replace(NXe,c=>(Ol.test(c)?(i.color.push(s),r.push(GCe),n.push(Ol.parse(c))):c.startsWith(jXe)?(i.var.push(s),r.push(_Xe),n.push(c)):(i.number.push(s),r.push(KCe),n.push(parseFloat(c))),++s,$Y)).split($Y);return{values:n,split:l,indexes:i,types:r}}function XCe(e){return rC(e).values}function YCe(e){const{split:t,types:n}=rC(e),i=t.length;return r=>{let s="";for(let o=0;otypeof e=="number"?0:e;function IXe(e){const t=XCe(e);return YCe(e)(t.map(RXe))}const qg={test:TXe,parse:XCe,createTransformer:YCe,getAnimatableNone:IXe},PXe=new Set(["brightness","contrast","saturate","opacity"]);function DXe(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(sz)||[];if(!i)return e;const r=n.replace(i,"");let s=PXe.has(t)?1:0;return i!==n&&(s*=100),t+"("+s+r+")"}const MXe=/\b([a-z-]*)\(.*?\)/gu,m8={...qg,getAnimatableNone:e=>{const t=e.match(MXe);return t?t.map(DXe).join(" "):e}},LXe={...VQ,color:Ol,backgroundColor:Ol,outlineColor:Ol,fill:Ol,stroke:Ol,borderColor:Ol,borderTopColor:Ol,borderRightColor:Ol,borderBottomColor:Ol,borderLeftColor:Ol,filter:m8,WebkitFilter:m8},oz=e=>LXe[e];function ZCe(e,t){let n=oz(e);return n!==m8&&(n=qg),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const $Xe=new Set(["auto","none","0"]);function FXe(e,t,n){let i=0,r;for(;ie===U1||e===Yn,BY=(e,t)=>parseFloat(e.split(", ")[t]),UY=(e,t)=>(n,{transform:i})=>{if(i==="none"||!i)return 0;const r=i.match(/^matrix3d\((.+)\)$/u);if(r)return BY(r[1],t);{const s=i.match(/^matrix\((.+)\)$/u);return s?BY(s[1],e):0}},BXe=new Set(["x","y","z"]),UXe=B1.filter(e=>!BXe.has(e));function QXe(e){const t=[];return UXe.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t}const Gw={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:UY(4,13),y:UY(5,14)};Gw.translateX=Gw.x;Gw.translateY=Gw.y;const zy=new Set;let g8=!1,b8=!1;function JCe(){if(b8){const e=Array.from(zy).filter(i=>i.needsMeasurement),t=new Set(e.map(i=>i.element)),n=new Map;t.forEach(i=>{const r=QXe(i);r.length&&(n.set(i,r),i.render())}),e.forEach(i=>i.measureInitialState()),t.forEach(i=>{i.render();const r=n.get(i);r&&r.forEach(([s,o])=>{var l;(l=i.getValue(s))===null||l===void 0||l.set(o)})}),e.forEach(i=>i.measureEndState()),e.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}b8=!1,g8=!1,zy.forEach(e=>e.complete()),zy.clear()}function eAe(){zy.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(b8=!0)})}function zXe(){eAe(),JCe()}class lz{constructor(t,n,i,r,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=i,this.motionValue=r,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(zy.add(this),g8||(g8=!0,Ps.read(eAe),Ps.resolveKeyframes(JCe))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:i,motionValue:r}=this;for(let s=0;s/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),VXe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function HXe(e){const t=VXe.exec(e);if(!t)return[,];const[,n,i,r]=t;return[`--${n??i}`,r]}function nAe(e,t,n=1){const[i,r]=HXe(e);if(!i)return;const s=window.getComputedStyle(t).getPropertyValue(i);if(s){const o=s.trim();return tAe(o)?parseFloat(o):o}return zQ(r)?nAe(r,t,n+1):r}const iAe=e=>t=>t.test(e),qXe={test:e=>e==="auto",parse:e=>e},rAe=[U1,Yn,gh,Um,QGe,UGe,qXe],QY=e=>rAe.find(iAe(e));class sAe extends lz{constructor(t,n,i,r,s){super(t,n,i,r,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:i}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c{n.getValue(c).set(u)}),this.resolveNoneKeyframes()}}const zY=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(qg.test(e)||e==="0")&&!e.startsWith("url("));function WXe(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ne!==null;function wD(e,{repeat:t,repeatType:n="loop"},i){const r=e.filter(GXe),s=t&&n!=="loop"&&t%2===1?0:r.length-1;return!s||i===void 0?r[s]:i}const XXe=40;class aAe{constructor({autoplay:t=!0,delay:n=0,type:i="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:o="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=bh.now(),this.options={autoplay:t,delay:n,type:i,repeat:r,repeatDelay:s,repeatType:o,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>XXe?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&zXe(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=bh.now(),this.hasAttemptedResolve=!0;const{name:i,type:r,velocity:s,delay:o,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!KXe(t,i,r,s))if(o)this.options.duration=0;else{c&&c(wD(t,this.options,n)),l&&l(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const y8=2e4;function oAe(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t=y8?1/0:t}const Js=(e,t,n)=>e+(t-e)*n;function d3(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function YXe({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,t/=100,n/=100;let r=0,s=0,o=0;if(!t)r=s=o=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;r=d3(c,l,e+1/3),s=d3(c,l,e),o=d3(c,l,e-1/3)}return{red:Math.round(r*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}function zR(e,t){return n=>n>0?t:e}const f3=(e,t,n)=>{const i=e*e,r=n*(t*t-i)+i;return r<0?0:Math.sqrt(r)},ZXe=[p8,Oy,Ix],JXe=e=>ZXe.find(t=>t.test(e));function VY(e){const t=JXe(e);if(!t)return!1;let n=t.parse(e);return t===Ix&&(n=YXe(n)),n}const HY=(e,t)=>{const n=VY(e),i=VY(t);if(!n||!i)return zR(e,t);const r={...n};return s=>(r.red=f3(n.red,i.red,s),r.green=f3(n.green,i.green,s),r.blue=f3(n.blue,i.blue,s),r.alpha=Js(n.alpha,i.alpha,s),Oy.transform(r))},eYe=(e,t)=>n=>t(e(n)),$A=(...e)=>e.reduce(eYe),v8=new Set(["none","hidden"]);function tYe(e,t){return v8.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function nYe(e,t){return n=>Js(e,t,n)}function cz(e){return typeof e=="number"?nYe:typeof e=="string"?zQ(e)?zR:Ol.test(e)?HY:sYe:Array.isArray(e)?lAe:typeof e=="object"?Ol.test(e)?HY:iYe:zR}function lAe(e,t){const n=[...e],i=n.length,r=e.map((s,o)=>cz(s)(s,t[o]));return s=>{for(let o=0;o{for(const s in i)n[s]=i[s](r);return n}}function rYe(e,t){var n;const i=[],r={color:0,var:0,number:0};for(let s=0;s{const n=qg.createTransformer(t),i=rC(e),r=rC(t);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?v8.has(e)&&!r.values.length||v8.has(t)&&!i.values.length?tYe(e,t):$A(lAe(rYe(i,r),r.values),n):zR(e,t)};function cAe(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Js(e,t,n):cz(e)(e,t)}const aYe=5;function uAe(e,t,n){const i=Math.max(t-aYe,0);return ICe(n-e(i),t-i)}const da={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},h3=.001;function oYe({duration:e=da.duration,bounce:t=da.bounce,velocity:n=da.velocity,mass:i=da.mass}){let r,s,o=1-t;o=Gp(da.minDamping,da.maxDamping,o),e=Gp(da.minDuration,da.maxDuration,Pp(e)),o<1?(r=u=>{const d=u*o,f=d*e,h=d-n,m=x8(u,o),g=Math.exp(-f);return h3-h/m*g},s=u=>{const f=u*o*e,h=f*n+n,m=Math.pow(o,2)*Math.pow(u,2)*e,g=Math.exp(-f),b=x8(Math.pow(u,2),o);return(-r(u)+h3>0?-1:1)*((h-m)*g)/b}):(r=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-h3+d*f},s=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const l=5/e,c=cYe(r,s,l);if(e=Ip(e),isNaN(c))return{stiffness:da.stiffness,damping:da.damping,duration:e};{const u=Math.pow(c,2)*i;return{stiffness:u,damping:o*2*Math.sqrt(i*u),duration:e}}}const lYe=12;function cYe(e,t,n){let i=n;for(let r=1;re[n]!==void 0)}function fYe(e){let t={velocity:da.velocity,stiffness:da.stiffness,damping:da.damping,mass:da.mass,isResolvedFromDuration:!1,...e};if(!qY(e,dYe)&&qY(e,uYe))if(e.visualDuration){const n=e.visualDuration,i=2*Math.PI/(n*1.2),r=i*i,s=2*Gp(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:da.mass,stiffness:r,damping:s}}else{const n=oYe(e);t={...t,...n,mass:da.mass},t.isResolvedFromDuration=!0}return t}function dAe(e=da.visualDuration,t=da.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:i,restDelta:r}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:s},{stiffness:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:m}=fYe({...n,velocity:-Pp(n.velocity||0)}),g=h||0,b=u/(2*Math.sqrt(c*d)),v=o-s,y=Pp(Math.sqrt(c/d)),w=Math.abs(v)<5;i||(i=w?da.restSpeed.granular:da.restSpeed.default),r||(r=w?da.restDelta.granular:da.restDelta.default);let x;if(b<1){const S=x8(y,b);x=O=>{const A=Math.exp(-b*y*O);return o-A*((g+b*y*v)/S*Math.sin(S*O)+v*Math.cos(S*O))}}else if(b===1)x=S=>o-Math.exp(-y*S)*(v+(g+y*v)*S);else{const S=y*Math.sqrt(b*b-1);x=O=>{const A=Math.exp(-b*y*O),E=Math.min(S*O,300);return o-A*((g+b*y*v)*Math.sinh(E)+S*v*Math.cosh(E))/S}}const k={calculatedDuration:m&&f||null,next:S=>{const O=x(S);if(m)l.done=S>=f;else{let A=0;b<1&&(A=S===0?Ip(g):uAe(x,S,O));const E=Math.abs(A)<=i,j=Math.abs(o-O)<=r;l.done=E&&j}return l.value=l.done?o:O,l},toString:()=>{const S=Math.min(oAe(k),y8),O=DCe(A=>k.next(S*A).value,S,30);return S+"ms "+O}};return k}function WY({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:s=500,modifyTarget:o,min:l,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},m=E=>l!==void 0&&Ec,g=E=>l===void 0?c:c===void 0||Math.abs(l-E)-b*Math.exp(-E/i),x=E=>y+w(E),k=E=>{const j=w(E),T=x(E);h.done=Math.abs(j)<=u,h.value=h.done?y:T};let S,O;const A=E=>{m(h.value)&&(S=E,O=dAe({keyframes:[h.value,g(h.value)],velocity:uAe(x,E,h.value),damping:r,stiffness:s,restDelta:u,restSpeed:d}))};return A(0),{calculatedDuration:null,next:E=>{let j=!1;return!O&&S===void 0&&(j=!0,k(E),A(E)),S!==void 0&&E>=S?O.next(E-S):(!j&&k(E),h)}}}const hYe=LA(.42,0,1,1),pYe=LA(0,0,.58,1),fAe=LA(.42,0,.58,1),mYe=e=>Array.isArray(e)&&typeof e[0]!="number",gYe={linear:Iu,easeIn:hYe,easeInOut:fAe,easeOut:pYe,circIn:rz,circInOut:HCe,circOut:VCe,backIn:iz,backInOut:QCe,backOut:UCe,anticipate:zCe},KY=e=>{if(nz(e)){dCe(e.length===4);const[t,n,i,r]=e;return LA(t,n,i,r)}else if(typeof e=="string")return gYe[e];return e};function bYe(e,t,n){const i=[],r=n||cAe,s=e.length-1;for(let o=0;ot[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=bYe(t,i,r),c=l.length,u=d=>{if(o&&d1)for(;fu(Gp(e[0],e[s-1],d)):u}function vYe(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const r=Kw(0,t,i);e.push(Js(n,1,r))}}function xYe(e){const t=[0];return vYe(t,e.length-1),t}function wYe(e,t){return e.map(n=>n*t)}function kYe(e,t){return e.map(()=>t||fAe).splice(0,e.length-1)}function VR({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const r=mYe(i)?i.map(KY):KY(i),s={done:!1,value:t[0]},o=wYe(n&&n.length===t.length?n:xYe(t),e),l=yYe(o,t,{ease:Array.isArray(r)?r:kYe(t,r)});return{calculatedDuration:e,next:c=>(s.value=l(c),s.done=c>=e,s)}}const OYe=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Ps.update(t,!0),stop:()=>Hg(t),now:()=>Zo.isProcessing?Zo.timestamp:bh.now()}},SYe={decay:WY,inertia:WY,tween:VR,keyframes:VR,spring:dAe},EYe=e=>e/100;class uz extends aAe{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:n,motionValue:i,element:r,keyframes:s}=this.options,o=(r==null?void 0:r.KeyframeResolver)||lz,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new o(s,l,n,i,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:s,velocity:o=0}=this.options,l=tz(n)?n:SYe[n]||VR;let c,u;l!==VR&&typeof t[0]!="number"&&(c=$A(EYe,cAe(t[0],t[1])),t=[0,100]);const d=l({...this.options,keyframes:t});s==="mirror"&&(u=l({...this.options,keyframes:[...t].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=oAe(d));const{calculatedDuration:f}=d,h=f+r,m=h*(i+1)-r;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:c,calculatedDuration:f,resolvedDuration:h,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:i}=this;if(!i){const{keyframes:E}=this.options;return{done:!0,value:E[E.length-1]}}const{finalKeyframe:r,generator:s,mirroredGenerator:o,mapPercentToKeyframes:l,keyframes:c,calculatedDuration:u,totalDuration:d,resolvedDuration:f}=i;if(this.startTime===null)return s.next(0);const{delay:h,repeat:m,repeatType:g,repeatDelay:b,onUpdate:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const y=this.currentTime-h*(this.speed>=0?1:-1),w=this.speed>=0?y<0:y>d;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let x=this.currentTime,k=s;if(m){const E=Math.min(this.currentTime,d)/f;let j=Math.floor(E),T=E%1;!T&&E>=1&&(T=1),T===1&&j--,j=Math.min(j,m+1),!!(j%2)&&(g==="reverse"?(T=1-T,b&&(T-=b/f)):g==="mirror"&&(k=o)),x=Gp(0,1,T)*f}const S=w?{done:!1,value:c[0]}:k.next(x);l&&(S.value=l(S.value));let{done:O}=S;!w&&u!==null&&(O=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const A=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return A&&r!==void 0&&(S.value=wD(c,this.options,r)),v&&v(S.value),A&&this.finish(),S}get duration(){const{resolved:t}=this;return t?Pp(t.calculatedDuration):0}get time(){return Pp(this.currentTime)}set time(t){t=Ip(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Pp(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=OYe,onPlay:n,startTime:i}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),n&&n();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=r):this.startTime=i??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const CYe=new Set(["opacity","clipPath","filter","transform"]);function AYe(e,t,n,{delay:i=0,duration:r=300,repeat:s=0,repeatType:o="loop",ease:l="easeInOut",times:c}={}){const u={[t]:n};c&&(u.offset=c);const d=LCe(l,r);return Array.isArray(d)&&(u.easing=d),e.animate(u,{delay:i,duration:r,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const TYe=ez(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),HR=10,_Ye=2e4;function jYe(e){return tz(e.type)||e.type==="spring"||!MCe(e.ease)}function NYe(e,t){const n=new uz({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let i={done:!1,value:e[0]};const r=[];let s=0;for(;!i.done&&s<_Ye;)i=n.sample(s),r.push(i.value),s+=HR;return{times:void 0,keyframes:r,duration:s-HR,ease:"linear"}}const hAe={anticipate:zCe,backInOut:QCe,circInOut:HCe};function RYe(e){return e in hAe}class GY extends aAe{constructor(t){super(t);const{name:n,motionValue:i,element:r,keyframes:s}=this.options;this.resolver=new sAe(s,(o,l)=>this.onKeyframesResolved(o,l),n,i,r),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:i=300,times:r,ease:s,type:o,motionValue:l,name:c,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof s=="string"&&QR()&&RYe(s)&&(s=hAe[s]),jYe(this.options)){const{onComplete:f,onUpdate:h,motionValue:m,element:g,...b}=this.options,v=NYe(t,b);t=v.keyframes,t.length===1&&(t[1]=t[0]),i=v.duration,r=v.times,s=v.ease,o="keyframes"}const d=AYe(l.owner.current,c,t,{...this.options,duration:i,times:r,ease:s});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(LY(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(wD(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:i,times:r,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Pp(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Pp(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:i}=n;i.currentTime=Ip(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:i}=n;i.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Iu;const{animation:i}=n;LY(i,t)}return Iu}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:i,duration:r,type:s,ease:o,times:l}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:d,onComplete:f,element:h,...m}=this.options,g=new uz({...m,keyframes:i,duration:r,type:s,ease:o,times:l,isGenerator:!0}),b=Ip(this.time);u.setWithVelocity(g.sample(b-HR).value,g.sample(b).value,HR)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:i,repeatDelay:r,repeatType:s,damping:o,type:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=n.owner.getProps();return TYe()&&i&&CYe.has(i)&&!c&&!u&&!r&&s!=="mirror"&&o!==0&&l!=="inertia"}}const IYe={type:"spring",stiffness:500,damping:25,restSpeed:10},PYe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),DYe={type:"keyframes",duration:.8},MYe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},LYe=(e,{keyframes:t})=>t.length>2?DYe:Dv.has(e)?e.startsWith("scale")?PYe(t[1]):IYe:MYe;function $Ye({when:e,delay:t,delayChildren:n,staggerChildren:i,staggerDirection:r,repeat:s,repeatType:o,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const dz=(e,t,n,i={},r,s)=>o=>{const l=XQ(i,e)||{},c=l.delay||i.delay||0;let{elapsed:u=0}=i;u=u-Ip(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:h=>{t.set(h),l.onUpdate&&l.onUpdate(h)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:s?void 0:r};$Ye(l)||(d={...d,...LYe(e,d)}),d.duration&&(d.duration=Ip(d.duration)),d.repeatDelay&&(d.repeatDelay=Ip(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(f=!0)),f&&!s&&t.get()!==void 0){const h=wD(d.keyframes,l);if(h!==void 0)return Ps.update(()=>{d.onUpdate(h),d.onComplete()}),new gXe([])}return!s&&GY.supports(d)?new GY(d):new uz(d)};function FYe({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,i}function pAe(e,t,{delay:n=0,transitionOverride:i,type:r}={}){var s;let{transition:o=e.getDefaultTransition(),transitionEnd:l,...c}=t;i&&(o=i);const u=[],d=r&&e.animationState&&e.animationState.getState()[r];for(const f in c){const h=e.getValue(f,(s=e.latestValues[f])!==null&&s!==void 0?s:null),m=c[f];if(m===void 0||d&&FYe(d,f))continue;const g={delay:n,...XQ(o||{},f)};let b=!1;if(window.MotionHandoffAnimation){const y=PCe(e);if(y){const w=window.MotionHandoffAnimation(y,f,Ps);w!==null&&(g.startTime=w,b=!0)}}f8(e,f),h.start(dz(f,h,m,e.shouldReduceMotion&&RCe.has(f)?{type:!1}:g,e,b));const v=h.animation;v&&u.push(v)}return l&&Promise.all(u).then(()=>{Ps.update(()=>{l&&fXe(e,l)})}),u}function w8(e,t,n={}){var i;const r=xD(e,t,n.type==="exit"?(i=e.presenceContext)===null||i===void 0?void 0:i.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const o=r?()=>Promise.all(pAe(e,r,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=s;return BYe(e,t,d+u,f,h,n)}:()=>Promise.resolve(),{when:c}=s;if(c){const[u,d]=c==="beforeChildren"?[o,l]:[l,o];return u().then(()=>d())}else return Promise.all([o(),l(n.delay)])}function BYe(e,t,n=0,i=0,r=1,s){const o=[],l=(e.variantChildren.size-1)*i,c=r===1?(u=0)=>u*i:(u=0)=>l-u*i;return Array.from(e.variantChildren).sort(UYe).forEach((u,d)=>{u.notify("AnimationStart",t),o.push(w8(u,t,{...s,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(o)}function UYe(e,t){return e.sortNodePosition(t)}function QYe(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const r=t.map(s=>w8(e,s,n));i=Promise.all(r)}else if(typeof t=="string")i=w8(e,t,n);else{const r=typeof t=="function"?xD(e,t,n.custom):t;i=Promise.all(pAe(e,r,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}const zYe=$Q.length;function mAe(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?mAe(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;nPromise.all(t.map(({animation:n,options:i})=>QYe(e,n,i)))}function WYe(e){let t=qYe(e),n=XY(),i=!0;const r=c=>(u,d)=>{var f;const h=xD(e,d,c==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:m,transitionEnd:g,...b}=h;u={...u,...b,...g}}return u};function s(c){t=c(e)}function o(c){const{props:u}=e,d=mAe(e.parent)||{},f=[],h=new Set;let m={},g=1/0;for(let v=0;vg&&k,j=!1;const T=Array.isArray(x)?x:[x];let R=T.reduce(r(y),{});S===!1&&(R={});const{prevResolvedValues:C={}}=w,N={...C,...R},P=_=>{E=!0,h.has(_)&&(j=!0,h.delete(_)),w.needsAnimating[_]=!0;const L=e.getValue(_);L&&(L.liveStyle=!1)};for(const _ in N){const L=R[_],F=C[_];if(m.hasOwnProperty(_))continue;let M=!1;d8(L)&&d8(F)?M=!NCe(L,F):M=L!==F,M?L!=null?P(_):h.add(_):L!==void 0&&h.has(_)?P(_):w.protectedKeys[_]=!0}w.prevProp=x,w.prevResolvedValues=R,w.isActive&&(m={...m,...R}),i&&e.blockInitialAnimation&&(E=!1),E&&(!(O&&A)||j)&&f.push(...T.map(_=>({animation:_,options:{type:y}})))}if(h.size){const v={};h.forEach(y=>{const w=e.getBaseTarget(y),x=e.getValue(y);x&&(x.liveStyle=!0),v[y]=w??null}),f.push({animation:v})}let b=!!f.length;return i&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(b=!1),i=!1,b?t(f):Promise.resolve()}function l(c,u){var d;if(n[c].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(h=>{var m;return(m=h.animationState)===null||m===void 0?void 0:m.setActive(c,u)}),n[c].isActive=u;const f=o(c);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:o,setActive:l,setAnimateFunction:s,getState:()=>n,reset:()=>{n=XY(),i=!0}}}function KYe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!NCe(t,e):!1}function Qb(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function XY(){return{animate:Qb(!0),whileInView:Qb(),whileHover:Qb(),whileTap:Qb(),whileDrag:Qb(),whileFocus:Qb(),exit:Qb()}}class wb{constructor(t){this.isMounted=!1,this.node=t}update(){}}class GYe extends wb{constructor(t){super(t),t.animationState||(t.animationState=WYe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();yD(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let XYe=0;class YYe extends wb{constructor(){super(...arguments),this.id=XYe++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const r=this.node.animationState.setActive("exit",!t);n&&!t&&r.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const ZYe={animation:{Feature:GYe},exit:{Feature:YYe}},Gd={x:!1,y:!1};function gAe(){return Gd.x||Gd.y}function JYe(e){return e==="x"||e==="y"?Gd[e]?null:(Gd[e]=!0,()=>{Gd[e]=!1}):Gd.x||Gd.y?null:(Gd.x=Gd.y=!0,()=>{Gd.x=Gd.y=!1})}const fz=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function sC(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}function FA(e){return{point:{x:e.pageX,y:e.pageY}}}const eZe=e=>t=>fz(t)&&e(t,FA(t));function YS(e,t,n,i){return sC(e,t,eZe(n),i)}const YY=(e,t)=>Math.abs(e-t);function tZe(e,t){const n=YY(e.x,t.x),i=YY(e.y,t.y);return Math.sqrt(n**2+i**2)}class bAe{constructor(t,n,{transformPagePoint:i,contextWindow:r,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=m3(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,m=tZe(f.offset,{x:0,y:0})>=3;if(!h&&!m)return;const{point:g}=f,{timestamp:b}=Zo;this.history.push({...g,timestamp:b});const{onStart:v,onMove:y}=this.handlers;h||(v&&v(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=p3(h,this.transformPagePoint),Ps.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:m,onSessionEnd:g,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=m3(f.type==="pointercancel"?this.lastMoveEventInfo:p3(h,this.transformPagePoint),this.history);this.startEvent&&m&&m(f,v),g&&g(f,v)},!fz(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=i,this.contextWindow=r||window;const o=FA(t),l=p3(o,this.transformPagePoint),{point:c}=l,{timestamp:u}=Zo;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,m3(l,this.history)),this.removeListeners=$A(YS(this.contextWindow,"pointermove",this.handlePointerMove),YS(this.contextWindow,"pointerup",this.handlePointerUp),YS(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Hg(this.updatePoint)}}function p3(e,t){return t?{point:t(e.point)}:e}function ZY(e,t){return{x:e.x-t.x,y:e.y-t.y}}function m3({point:e},t){return{point:e,delta:ZY(e,yAe(t)),offset:ZY(e,nZe(t)),velocity:iZe(t,.1)}}function nZe(e){return e[0]}function yAe(e){return e[e.length-1]}function iZe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const r=yAe(e);for(;n>=0&&(i=e[n],!(r.timestamp-i.timestamp>Ip(t)));)n--;if(!i)return{x:0,y:0};const s=Pp(r.timestamp-i.timestamp);if(s===0)return{x:0,y:0};const o={x:(r.x-i.x)/s,y:(r.y-i.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const vAe=1e-4,rZe=1-vAe,sZe=1+vAe,xAe=.01,aZe=0-xAe,oZe=0+xAe;function Bu(e){return e.max-e.min}function lZe(e,t,n){return Math.abs(e-t)<=n}function JY(e,t,n,i=.5){e.origin=i,e.originPoint=Js(t.min,t.max,e.origin),e.scale=Bu(n)/Bu(t),e.translate=Js(n.min,n.max,e.origin)-e.originPoint,(e.scale>=rZe&&e.scale<=sZe||isNaN(e.scale))&&(e.scale=1),(e.translate>=aZe&&e.translate<=oZe||isNaN(e.translate))&&(e.translate=0)}function ZS(e,t,n,i){JY(e.x,t.x,n.x,i?i.originX:void 0),JY(e.y,t.y,n.y,i?i.originY:void 0)}function eZ(e,t,n){e.min=n.min+t.min,e.max=e.min+Bu(t)}function cZe(e,t,n){eZ(e.x,t.x,n.x),eZ(e.y,t.y,n.y)}function tZ(e,t,n){e.min=t.min-n.min,e.max=e.min+Bu(t)}function JS(e,t,n){tZ(e.x,t.x,n.x),tZ(e.y,t.y,n.y)}function uZe(e,{min:t,max:n},i){return t!==void 0&&en&&(e=i?Js(n,e,i.max):Math.min(e,n)),e}function nZ(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function dZe(e,{top:t,left:n,bottom:i,right:r}){return{x:nZ(e.x,n,r),y:nZ(e.y,t,i)}}function iZ(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.mini?n=Kw(t.min,t.max-i,e.min):i>r&&(n=Kw(e.min,e.max-r,t.min)),Gp(0,1,n)}function pZe(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const k8=.35;function mZe(e=k8){return e===!1?e=0:e===!0&&(e=k8),{x:rZ(e,"left","right"),y:rZ(e,"top","bottom")}}function rZ(e,t,n){return{min:sZ(e,t),max:sZ(e,n)}}function sZ(e,t){return typeof e=="number"?e:e[t]||0}const aZ=()=>({translate:0,scale:1,origin:0,originPoint:0}),Px=()=>({x:aZ(),y:aZ()}),oZ=()=>({min:0,max:0}),wa=()=>({x:oZ(),y:oZ()});function ed(e){return[e("x"),e("y")]}function wAe({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function gZe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function bZe(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function g3(e){return e===void 0||e===1}function O8({scale:e,scaleX:t,scaleY:n}){return!g3(e)||!g3(t)||!g3(n)}function sy(e){return O8(e)||kAe(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function kAe(e){return lZ(e.x)||lZ(e.y)}function lZ(e){return e&&e!=="0%"}function qR(e,t,n){const i=e-n,r=t*i;return n+r}function cZ(e,t,n,i,r){return r!==void 0&&(e=qR(e,r,i)),qR(e,n,i)+t}function S8(e,t=0,n=1,i,r){e.min=cZ(e.min,t,n,i,r),e.max=cZ(e.max,t,n,i,r)}function OAe(e,{x:t,y:n}){S8(e.x,t.translate,t.scale,t.originPoint),S8(e.y,n.translate,n.scale,n.originPoint)}const uZ=.999999999999,dZ=1.0000000000001;function yZe(e,t,n,i=!1){const r=n.length;if(!r)return;t.x=t.y=1;let s,o;for(let l=0;luZ&&(t.x=1),t.yuZ&&(t.y=1)}function Dx(e,t){e.min=e.min+t,e.max=e.max+t}function fZ(e,t,n,i,r=.5){const s=Js(e.min,e.max,r);S8(e,t,n,s,i)}function Mx(e,t){fZ(e.x,t.x,t.scaleX,t.scale,t.originX),fZ(e.y,t.y,t.scaleY,t.scale,t.originY)}function SAe(e,t){return wAe(bZe(e.getBoundingClientRect(),t))}function vZe(e,t,n){const i=SAe(e,n),{scroll:r}=t;return r&&(Dx(i.x,r.offset.x),Dx(i.y,r.offset.y)),i}const EAe=({current:e})=>e?e.ownerDocument.defaultView:null,xZe=new WeakMap;class wZe{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=wa(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(FA(d).point)},s=(d,f)=>{const{drag:h,dragPropagation:m,onDragStart:g}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=JYe(h),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ed(v=>{let y=this.getAxisMotionValue(v).get()||0;if(gh.test(y)){const{projection:w}=this.visualElement;if(w&&w.layout){const x=w.layout.layoutBox[v];x&&(y=Bu(x)*(parseFloat(y)/100))}}this.originPoint[v]=y}),g&&Ps.postRender(()=>g(d,f)),f8(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},o=(d,f)=>{const{dragPropagation:h,dragDirectionLock:m,onDirectionLock:g,onDrag:b}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:v}=f;if(m&&this.currentDirection===null){this.currentDirection=kZe(v),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),b&&b(d,f)},l=(d,f)=>this.stop(d,f),c=()=>ed(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new bAe(t,{onSessionStart:r,onStart:s,onMove:o,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:EAe(this.visualElement)})}stop(t,n){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:r}=n;this.startAnimation(r);const{onDragEnd:s}=this.getProps();s&&Ps.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,i){const{drag:r}=this.getProps();if(!i||!K2(t,r,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(o=uZe(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:i}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,s=this.constraints;n&&Rx(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&r?this.constraints=dZe(r.layoutBox,n):this.constraints=!1,this.elastic=mZe(i),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&ed(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=pZe(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Rx(t))return!1;const i=t.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=vZe(i,r.root,this.visualElement.getTransformPagePoint());let o=fZe(r.layout.layoutBox,s);if(n){const l=n(gZe(o));this.hasMutatedConstraints=!!l,l&&(o=wAe(l))}return o}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=ed(d=>{if(!K2(d,n,this.currentDirection))return;let f=c&&c[d]||{};o&&(f={min:0,max:0});const h=r?200:1e6,m=r?40:1e7,g={type:"inertia",velocity:i?t[d]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(d,g)});return Promise.all(u).then(l)}startAxisValueAnimation(t,n){const i=this.getAxisMotionValue(t);return f8(this.visualElement,t),i.start(dz(t,i,0,n,this.visualElement,!1))}stopAnimation(){ed(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){ed(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps(),r=i[n];return r||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){ed(n=>{const{drag:i}=this.getProps();if(!K2(n,i,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(n);if(r&&r.layout){const{min:o,max:l}=r.layout.layoutBox[n];s.set(t[n]-Js(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!Rx(n)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};ed(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();r[o]=hZe({min:c,max:c},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),ed(o=>{if(!K2(o,t,null))return;const l=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];l.set(Js(c,u,r[o]))})}addListeners(){if(!this.visualElement.current)return;xZe.set(this.visualElement,this);const t=this.visualElement.current,n=YS(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),i=()=>{const{dragConstraints:c}=this.getProps();Rx(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,s=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),Ps.read(i);const o=sC(window,"resize",()=>this.scalePositionWithinConstraints()),l=r.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(ed(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=c[d].translate,f.set(f.get()+c[d].translate))}),this.visualElement.render())});return()=>{o(),n(),s(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:o=k8,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:o,dragMomentum:l}}}function K2(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function kZe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class OZe extends wb{constructor(t){super(t),this.removeGroupControls=Iu,this.removeListeners=Iu,this.controls=new wZe(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Iu}unmount(){this.removeGroupControls(),this.removeListeners()}}const hZ=e=>(t,n)=>{e&&Ps.postRender(()=>e(t,n))};class SZe extends wb{constructor(){super(...arguments),this.removePointerDownListener=Iu}onPointerDown(t){this.session=new bAe(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:EAe(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:hZ(t),onStart:hZ(n),onMove:i,onEnd:(s,o)=>{delete this.session,r&&Ps.postRender(()=>r(s,o))}}}mount(){this.removePointerDownListener=YS(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const sN={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function pZ(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const lO={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Yn.test(e))e=parseFloat(e);else return e;const n=pZ(e,t.target.x),i=pZ(e,t.target.y);return`${n}% ${i}%`}},EZe={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,r=qg.parse(e);if(r.length>5)return i;const s=qg.createTransformer(e),o=typeof r[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;r[0+o]/=l,r[1+o]/=c;const u=Js(l,c,.5);return typeof r[2+o]=="number"&&(r[2+o]/=u),typeof r[3+o]=="number"&&(r[3+o]/=u),s(r)}};class CZe extends p.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=t;ZGe(AZe),s&&(n.group&&n.group.add(s),i&&i.register&&r&&i.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),sN.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:r,isPresent:s}=this.props,o=i.projection;return o&&(o.isPresent=s,r||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||Ps.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),BQ.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:r}=t;r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function CAe(e){const[t,n]=cCe(),i=p.useContext(DQ);return a.jsx(CZe,{...e,layoutGroup:i,switchLayoutGroup:p.useContext(yCe),isPresent:t,safeToRemove:n})}const AZe={borderRadius:{...lO,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:lO,borderTopRightRadius:lO,borderBottomLeftRadius:lO,borderBottomRightRadius:lO,boxShadow:EZe};function TZe(e,t,n){const i=Cl(e)?e:iC(e);return i.start(dz("",i,t,n)),i.animation}function _Ze(e){return e instanceof SVGElement&&e.tagName!=="svg"}const jZe=(e,t)=>e.depth-t.depth;class NZe{constructor(){this.children=[],this.isDirty=!1}add(t){YQ(this.children,t),this.isDirty=!0}remove(t){ZQ(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(jZe),this.isDirty=!1,this.children.forEach(t)}}function RZe(e,t){const n=bh.now(),i=({timestamp:r})=>{const s=r-n;s>=t&&(Hg(i),e(s-t))};return Ps.read(i,!0),()=>Hg(i)}const AAe=["TopLeft","TopRight","BottomLeft","BottomRight"],IZe=AAe.length,mZ=e=>typeof e=="string"?parseFloat(e):e,gZ=e=>typeof e=="number"||Yn.test(e);function PZe(e,t,n,i,r,s){r?(e.opacity=Js(0,n.opacity!==void 0?n.opacity:1,DZe(i)),e.opacityExit=Js(t.opacity!==void 0?t.opacity:1,0,MZe(i))):s&&(e.opacity=Js(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,i));for(let o=0;oit?1:n(Kw(e,t,i))}function yZ(e,t){e.min=t.min,e.max=t.max}function Ju(e,t){yZ(e.x,t.x),yZ(e.y,t.y)}function vZ(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function xZ(e,t,n,i,r){return e-=t,e=qR(e,1/n,i),r!==void 0&&(e=qR(e,1/r,i)),e}function LZe(e,t=0,n=1,i=.5,r,s=e,o=e){if(gh.test(t)&&(t=parseFloat(t),t=Js(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=Js(s.min,s.max,i);e===s&&(l-=t),e.min=xZ(e.min,t,n,l,r),e.max=xZ(e.max,t,n,l,r)}function wZ(e,t,[n,i,r],s,o){LZe(e,t[n],t[i],t[r],t.scale,s,o)}const $Ze=["x","scaleX","originX"],FZe=["y","scaleY","originY"];function kZ(e,t,n,i){wZ(e.x,t,$Ze,n?n.x:void 0,i?i.x:void 0),wZ(e.y,t,FZe,n?n.y:void 0,i?i.y:void 0)}function OZ(e){return e.translate===0&&e.scale===1}function _Ae(e){return OZ(e.x)&&OZ(e.y)}function SZ(e,t){return e.min===t.min&&e.max===t.max}function BZe(e,t){return SZ(e.x,t.x)&&SZ(e.y,t.y)}function EZ(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function jAe(e,t){return EZ(e.x,t.x)&&EZ(e.y,t.y)}function CZ(e){return Bu(e.x)/Bu(e.y)}function AZ(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class UZe{constructor(){this.members=[]}add(t){YQ(this.members,t),t.scheduleRender()}remove(t){if(ZQ(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(r=>t===r);if(n===0)return!1;let i;for(let r=n;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1){i=s;break}}return i?(this.promote(i),!0):!1}promote(t,n){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,n&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:r}=t.options;r===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:i}=t;n.onExitComplete&&n.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function QZe(e,t,n){let i="";const r=e.x.translate/t.x,s=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((r||s||o)&&(i=`translate3d(${r}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:h,skewX:m,skewY:g}=n;u&&(i=`perspective(${u}px) ${i}`),d&&(i+=`rotate(${d}deg) `),f&&(i+=`rotateX(${f}deg) `),h&&(i+=`rotateY(${h}deg) `),m&&(i+=`skewX(${m}deg) `),g&&(i+=`skewY(${g}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(i+=`scale(${l}, ${c})`),i||"none"}const ay={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},cS=typeof window<"u"&&window.MotionDebug!==void 0,b3=["","X","Y","Z"],zZe={visibility:"hidden"},TZ=1e3;let VZe=0;function y3(e,t,n,i){const{latestValues:r}=t;r[e]&&(n[e]=r[e],t.setStaticValue(e,0),i&&(i[e]=0))}function NAe(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=PCe(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Ps,!(r||s))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&NAe(i)}function RAe({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(o={},l=t==null?void 0:t()){this.id=VZe++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,cS&&(ay.totalNodes=ay.resolvedTargetDeltas=ay.recalculatedProjection=0),this.nodes.forEach(WZe),this.nodes.forEach(ZZe),this.nodes.forEach(JZe),this.nodes.forEach(KZe),cS&&window.MotionDebug.record(ay)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;cthis.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=RZe(h,250),sN.hasAnimatedSinceResize&&(sN.hasAnimatedSinceResize=!1,this.nodes.forEach(jZ))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeTargetChanged:m,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||d.getDefaultTransition()||rJe,{onLayoutAnimationStart:v,onLayoutAnimationComplete:y}=d.getProps(),w=!this.targetLayout||!jAe(this.targetLayout,g)||m,x=!h&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||h&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,x);const k={...XQ(b,"layout"),onPlay:v,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(k.delay=0,k.type=!1),this.startAnimation(k)}else h||jZ(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Hg(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(eJe),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&NAe(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{const S=k/1e3;NZ(f.x,o.x,S),NZ(f.y,o.y,S),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(JS(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),nJe(this.relativeTarget,this.relativeTargetOrigin,h,S),x&&BZe(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=wa()),Ju(x,this.relativeTarget)),b&&(this.animationValues=d,PZe(d,u,this.latestValues,S,w,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Hg(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ps.update(()=>{sN.hasAnimatedSinceResize=!0,this.currentAnimation=TZe(0,TZ,{...o,onUpdate:l=>{this.mixTargetDelta(l),o.onUpdate&&o.onUpdate(l)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(TZ),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=o;if(!(!l||!c||!u)){if(this!==o&&this.layout&&u&&IAe(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||wa();const f=Bu(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+f;const h=Bu(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+h}Ju(l,c),Mx(l,d),ZS(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new UZe),this.sharedNodes.get(o).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:l}=this.options;return l?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:l}=this.options;return l?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&y3("z",o,u,this.animationValues);for(let d=0;d{var l;return(l=o.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(_Z),this.root.sharedNodes.clear()}}}function HZe(e){e.updateLayout()}function qZe(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:r}=e.layout,{animationType:s}=e.options,o=n.source!==e.layout.source;s==="size"?ed(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=Bu(h);h.min=i[f].min,h.max=h.min+m}):IAe(s,n.layoutBox,i)&&ed(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=Bu(i[f]);h.max=h.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+m)});const l=Px();ZS(l,i,n.layoutBox);const c=Px();o?ZS(c,e.applyTransform(r,!0),n.measuredBox):ZS(c,i,n.layoutBox);const u=!_Ae(l);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:m}=f;if(h&&m){const g=wa();JS(g,n.layoutBox,h.layoutBox);const b=wa();JS(b,i,m.layoutBox),jAe(g,b)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=b,e.relativeTargetOrigin=g,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:i,snapshot:n,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:i}=e.options;i&&i()}e.options.transition=void 0}function WZe(e){cS&&ay.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function KZe(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function GZe(e){e.clearSnapshot()}function _Z(e){e.clearMeasurements()}function XZe(e){e.isLayoutDirty=!1}function YZe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function jZ(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function ZZe(e){e.resolveTargetDelta()}function JZe(e){e.calcProjection()}function eJe(e){e.resetSkewAndRotation()}function tJe(e){e.removeLeadSnapshot()}function NZ(e,t,n){e.translate=Js(t.translate,0,n),e.scale=Js(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function RZ(e,t,n,i){e.min=Js(t.min,n.min,i),e.max=Js(t.max,n.max,i)}function nJe(e,t,n,i){RZ(e.x,t.x,n.x,i),RZ(e.y,t.y,n.y,i)}function iJe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const rJe={duration:.45,ease:[.4,0,.1,1]},IZ=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),PZ=IZ("applewebkit/")&&!IZ("chrome/")?Math.round:Iu;function DZ(e){e.min=PZ(e.min),e.max=PZ(e.max)}function sJe(e){DZ(e.x),DZ(e.y)}function IAe(e,t,n){return e==="position"||e==="preserve-aspect"&&!lZe(CZ(t),CZ(n),.2)}function aJe(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const oJe=RAe({attachResizeListener:(e,t)=>sC(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),v3={current:void 0},PAe=RAe({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!v3.current){const e=new oJe({});e.mount(window),e.setOptions({layoutScroll:!0}),v3.current=e}return v3.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),lJe={pan:{Feature:SZe},drag:{Feature:OZe,ProjectionNode:PAe,MeasureLayout:CAe}};function cJe(e,t,n){var i;if(e instanceof Element)return[e];if(typeof e=="string"){let r=document;const s=(i=void 0)!==null&&i!==void 0?i:r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}function DAe(e,t){const n=cJe(e),i=new AbortController,r={passive:!0,...t,signal:i.signal};return[n,r,()=>i.abort()]}function MZ(e){return t=>{t.pointerType==="touch"||gAe()||e(t)}}function uJe(e,t,n={}){const[i,r,s]=DAe(e,n),o=MZ(l=>{const{target:c}=l,u=t(l);if(typeof u!="function"||!c)return;const d=MZ(f=>{u(f),c.removeEventListener("pointerleave",d)});c.addEventListener("pointerleave",d,r)});return i.forEach(l=>{l.addEventListener("pointerenter",o,r)}),s}function LZ(e,t,n){const{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,s=i[r];s&&Ps.postRender(()=>s(t,FA(t)))}class dJe extends wb{mount(){const{current:t}=this.node;t&&(this.unmount=uJe(t,n=>(LZ(this.node,n,"Start"),i=>LZ(this.node,i,"End"))))}unmount(){}}class fJe extends wb{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=$A(sC(this.node.current,"focus",()=>this.onFocus()),sC(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const MAe=(e,t)=>t?e===t?!0:MAe(e,t.parentElement):!1,hJe=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function pJe(e){return hJe.has(e.tagName)||e.tabIndex!==-1}const uS=new WeakSet;function $Z(e){return t=>{t.key==="Enter"&&e(t)}}function x3(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const mJe=(e,t)=>{const n=e.currentTarget;if(!n)return;const i=$Z(()=>{if(uS.has(n))return;x3(n,"down");const r=$Z(()=>{x3(n,"up")}),s=()=>x3(n,"cancel");n.addEventListener("keyup",r,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",i,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),t)};function FZ(e){return fz(e)&&!gAe()}function gJe(e,t,n={}){const[i,r,s]=DAe(e,n),o=l=>{const c=l.currentTarget;if(!FZ(l)||uS.has(c))return;uS.add(c);const u=t(l),d=(m,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!FZ(m)||!uS.has(c))&&(uS.delete(c),typeof u=="function"&&u(m,{success:g}))},f=m=>{d(m,n.useGlobalTarget||MAe(c,m.target))},h=m=>{d(m,!1)};window.addEventListener("pointerup",f,r),window.addEventListener("pointercancel",h,r)};return i.forEach(l=>{!pJe(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,r),l.addEventListener("focus",u=>mJe(u,r),r)}),s}function BZ(e,t,n){const{props:i}=e;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),s=i[r];s&&Ps.postRender(()=>s(t,FA(t)))}class bJe extends wb{mount(){const{current:t}=this.node;t&&(this.unmount=gJe(t,n=>(BZ(this.node,n,"Start"),(i,{success:r})=>BZ(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const E8=new WeakMap,w3=new WeakMap,yJe=e=>{const t=E8.get(e.target);t&&t(e)},vJe=e=>{e.forEach(yJe)};function xJe({root:e,...t}){const n=e||document;w3.has(n)||w3.set(n,{});const i=w3.get(n),r=JSON.stringify(t);return i[r]||(i[r]=new IntersectionObserver(vJe,{root:e,...t})),i[r]}function wJe(e,t,n){const i=xJe(t);return E8.set(e,n),i.observe(e),()=>{E8.delete(e),i.unobserve(e)}}const kJe={some:0,all:1};class OJe extends wb{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:i,amount:r="some",once:s}=t,o={root:n?n.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:kJe[r]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),h=u?d:f;h&&h(c)};return wJe(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(SJe(t,n))&&this.startObserver()}unmount(){}}function SJe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const EJe={inView:{Feature:OJe},tap:{Feature:bJe},focus:{Feature:fJe},hover:{Feature:dJe}},CJe={layout:{ProjectionNode:PAe,MeasureLayout:CAe}},WR={current:null},hz={current:!1};function LAe(){if(hz.current=!0,!!MQ)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>WR.current=e.matches;e.addListener(t),t()}else WR.current=!1}const AJe=[...rAe,Ol,qg],TJe=e=>AJe.find(iAe(e)),UZ=new WeakMap;function _Je(e,t,n){for(const i in t){const r=t[i],s=n[i];if(Cl(r))e.addValue(i,r);else if(Cl(s))e.addValue(i,iC(r,{owner:e}));else if(s!==r)if(e.hasValue(i)){const o=e.getValue(i);o.liveStyle===!0?o.jump(r):o.hasAnimated||o.set(r)}else{const o=e.getStaticValue(i);e.addValue(i,iC(o!==void 0?o:r,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const QZ=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class jJe{scrapeMotionValuesFromProps(t,n,i){return{}}constructor({parent:t,props:n,presenceContext:i,reducedMotionConfig:r,blockInitialAnimation:s,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=lz,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=bh.now();this.renderScheduledAtthis.bindToMotionValue(i,n)),hz.current||LAe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:WR.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){UZ.delete(this.current),this.projection&&this.projection.unmount(),Hg(this.notifyUpdate),Hg(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const i=Dv.has(t),r=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&Ps.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{r(),s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Ww){const n=Ww[t];if(!n)continue;const{isEnabled:i,Feature:r}=n;if(!this.features[t]&&r&&i(this.props)&&(this.features[t]=new r(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):wa()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;in.variantChildren.delete(t)}addValue(t,n){const i=this.values.get(t);n!==i&&(i&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return i===void 0&&n!==void 0&&(i=iC(n===null?void 0:n,{owner:this}),this.addValue(t,i)),i}readValue(t,n){var i;let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(i=this.getBaseTargetFromProps(this.props,t))!==null&&i!==void 0?i:this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(tAe(r)||qCe(r))?r=parseFloat(r):!TJe(r)&&qg.test(n)&&(r=ZCe(t,n)),this.setBaseTarget(t,Cl(r)?r.get():r)),Cl(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:i}=this.props;let r;if(typeof i=="string"||typeof i=="object"){const o=QQ(this.props,i,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(r=o[t])}if(i&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Cl(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new JQ),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class $Ae extends jJe{constructor(){super(...arguments),this.KeyframeResolver=sAe}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:i}){delete n[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Cl(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function NJe(e){return window.getComputedStyle(e)}class RJe extends $Ae{constructor(){super(...arguments),this.type="html",this.renderInstance=ECe}readValueFromInstance(t,n){if(Dv.has(n)){const i=oz(n);return i&&i.default||0}else{const i=NJe(t),r=(kCe(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(t,{transformPagePoint:n}){return SAe(t,n)}build(t,n,i){HQ(t,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,n,i){return GQ(t,n,i)}}class IJe extends $Ae{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=wa}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Dv.has(n)){const i=oz(n);return i&&i.default||0}return n=CCe.has(n)?n:FQ(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,i){return _Ce(t,n,i)}build(t,n,i){qQ(t,n,this.isSVGTag,i.transformTemplate)}renderInstance(t,n,i,r){ACe(t,n,i,r)}mount(t){this.isSVGTag=KQ(t.tagName),super.mount(t)}}const PJe=(e,t)=>UQ(e)?new IJe(t):new RJe(t,{allowProjection:e!==p.Fragment}),DJe=oXe({...ZYe,...EJe,...lJe,...CJe},PJe),_r=kGe(DJe);function kD(){!hz.current&&LAe();const[e]=p.useState(WR.current);return e}function lo(){return lo=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?p.useEffect:p.useLayoutEffect;function sx(e,t,n){var i=p.useRef(t);i.current=t,p.useEffect(function(){function r(s){i.current(s)}return e&&window.addEventListener(e,r,n),function(){e&&window.removeEventListener(e,r)}},[e])}var MJe=["container"];function LJe(e){var t=e.container,n=t===void 0?document.body:t,i=OD(e,MJe);return vi.createPortal(Pi.createElement("div",lo({},i)),n)}function $Je(e){return Pi.createElement("svg",lo({width:"44",height:"44",viewBox:"0 0 768 768"},e),Pi.createElement("path",{d:"M607.5 205.5l-178.5 178.5 178.5 178.5-45 45-178.5-178.5-178.5 178.5-45-45 178.5-178.5-178.5-178.5 45-45 178.5 178.5 178.5-178.5z"}))}function FJe(e){return Pi.createElement("svg",lo({width:"44",height:"44",viewBox:"0 0 768 768"},e),Pi.createElement("path",{d:"M640.5 352.5v63h-390l178.5 180-45 45-256.5-256.5 256.5-256.5 45 45-178.5 180h390z"}))}function BJe(e){return Pi.createElement("svg",lo({width:"44",height:"44",viewBox:"0 0 768 768"},e),Pi.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function UJe(){return p.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function VZ(e){var t=e.touches[0],n=t.clientX,i=t.clientY;if(e.touches.length>=2){var r=e.touches[1],s=r.clientX,o=r.clientY;return[(n+s)/2,(i+o)/2,Math.sqrt(Math.pow(s-n,2)+Math.pow(o-i,2))]}return[n,i,0]}var Wm=function(e,t,n,i){var r,s=n*t,o=(s-i)/2,l=e;return s<=i?(r=1,l=0):e>0&&o-e<=0?(r=2,l=o):e<0&&o+e<=0&&(r=3,l=-o),[r,l]};function k3(e,t,n,i,r,s,o,l,c,u){o===void 0&&(o=innerWidth/2),l===void 0&&(l=innerHeight/2),c===void 0&&(c=0),u===void 0&&(u=0);var d=Wm(e,s,n,innerWidth)[0],f=Wm(t,s,i,innerHeight),h=innerWidth/2,m=innerHeight/2;return{x:o-s/r*(o-(h+e))-h+(i/n>=3&&n*s===innerWidth?0:d?c/2:c),y:l-s/r*(l-(m+t))-m+(f[0]?u/2:u),lastCX:o,lastCY:l}}function T8(e,t,n){var i=e%180!=0;return i?[n,t,i]:[t,n,i]}function O3(e,t,n){var i=T8(n,innerWidth,innerHeight),r=i[0],s=i[1],o=0,l=r,c=s,u=e/t*s,d=t/e*r;return e=s?l=u:e>=r&&tr/s?c=d:t/e>=3&&!i[2]?o=((c=d)-s)/2:l=u,{width:l,height:c,x:0,y:o,pause:!0}}function X2(e,t){var n=t.leading,i=n!==void 0&&n,r=t.maxWait,s=t.wait,o=s===void 0?r||0:s,l=p.useRef(e);l.current=e;var c=p.useRef(0),u=p.useRef(),d=function(){return u.current&&clearTimeout(u.current)},f=p.useCallback(function(){var h=[].slice.call(arguments),m=Date.now();function g(){c.current=m,d(),l.current.apply(null,h)}var b=c.current,v=m-b;if(b===0&&(i&&g(),c.current=m),r!==void 0){if(v>r)return void g()}else v=1&&s&&s())};d()}function d(){c=requestAnimationFrame(u)}}var zJe={T:0,L:0,W:0,H:0,FIT:void 0},BAe=function(){var e=p.useRef(!1);return p.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},VJe=["className"];function HJe(e){var t=e.className,n=t===void 0?"":t,i=OD(e,VJe);return Pi.createElement("div",lo({className:"PhotoView__Spinner "+n},i),Pi.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},Pi.createElement("path",{opacity:".25",d:"M16 0 A16 16 0 0 0 16 32 A16 16 0 0 0 16 0 M16 4 A12 12 0 0 1 16 28 A12 12 0 0 1 16 4"}),Pi.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var qJe=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function WJe(e){var t=e.src,n=e.loaded,i=e.broken,r=e.className,s=e.onPhotoLoad,o=e.loadingElement,l=e.brokenElement,c=OD(e,qJe),u=BAe();return t&&!i?Pi.createElement(Pi.Fragment,null,Pi.createElement("img",lo({className:"PhotoView__Photo"+(r?" "+r:""),src:t,onLoad:function(d){var f=d.target;u.current&&s({loaded:!0,naturalWidth:f.naturalWidth,naturalHeight:f.naturalHeight})},onError:function(){u.current&&s({broken:!0})},draggable:!1,alt:""},c)),!n&&(o?Pi.createElement("span",{className:"PhotoView__icon"},o):Pi.createElement(HJe,{className:"PhotoView__icon"}))):l?Pi.createElement("span",{className:"PhotoView__icon"},typeof l=="function"?l({src:t}):l):null}var KJe={naturalWidth:void 0,naturalHeight:void 0,width:void 0,height:void 0,loaded:void 0,broken:!1,x:0,y:0,touched:!1,maskTouched:!1,rotate:0,scale:1,CX:0,CY:0,lastX:0,lastY:0,lastCX:0,lastCY:0,lastScale:1,touchTime:0,touchLength:0,pause:!0,stopRaf:!0,reach:void 0};function GJe(e){var t=e.item,n=t.src,i=t.render,r=t.width,s=r===void 0?0:r,o=t.height,l=o===void 0?0:o,c=t.originRef,u=e.visible,d=e.speed,f=e.easing,h=e.wrapClassName,m=e.className,g=e.style,b=e.loadingElement,v=e.brokenElement,y=e.onPhotoTap,w=e.onMaskTap,x=e.onReachMove,k=e.onReachUp,S=e.onPhotoResize,O=e.isActive,A=e.expose,E=KR(KJe),j=E[0],T=E[1],R=p.useRef(0),C=BAe(),N=j.naturalWidth,P=N===void 0?s:N,I=j.naturalHeight,D=I===void 0?l:I,_=j.width,L=_===void 0?s:_,F=j.height,M=F===void 0?l:F,H=j.loaded,q=H===void 0?!n:H,U=j.broken,Z=j.x,z=j.y,J=j.touched,ne=j.stopRaf,W=j.maskTouched,X=j.rotate,ce=j.scale,V=j.CX,Y=j.CY,K=j.lastX,de=j.lastY,ee=j.lastCX,Oe=j.lastCY,he=j.lastScale,ge=j.touchTime,Se=j.touchLength,xe=j.pause,Pe=j.reach,Ue=Vy({onScale:function(je){return Ke(G2(je))},onRotate:function(je){X!==je&&(A({rotate:je}),T(lo({rotate:je},O3(P,D,je))))}});function Ke(je,kt,_t){ce!==je&&(A({scale:je}),T(lo({scale:je},k3(Z,z,L,M,ce,je,kt,_t),je<=1&&{x:0,y:0})))}var Me=X2(function(je,kt,_t){if(_t===void 0&&(_t=0),(J||W)&&O){var fn=T8(X,L,M),tn=fn[0],qe=fn[1];if(_t===0&&R.current===0){var vt=Math.abs(je-V)<=20,We=Math.abs(kt-Y)<=20;if(vt&&We)return void T({lastCX:je,lastCY:kt});R.current=vt?kt>Y?3:2:1}var ot,it=je-ee,tt=kt-Oe;if(_t===0){var At=Wm(it+K,ce,tn,innerWidth)[0],Ot=Wm(tt+de,ce,qe,innerHeight);ot=function(Mt,Ze,bt,gt){return Ze&&Mt===1||gt==="x"?"x":bt&&Mt>1||gt==="y"?"y":void 0}(R.current,At,Ot[0],Pe),ot!==void 0&&x(ot,je,kt,ce)}if(ot==="x"||W)return void T({reach:"x"});var Ut=G2(ce+(_t-Se)/100/2*ce,P/L,.2);A({scale:Ut}),T(lo({touchLength:_t,reach:ot,scale:Ut},k3(Z,z,L,M,ce,Ut,je,kt,it,tt)))}},{maxWait:8});function re(je){return!ne&&!J&&(C.current&&T(lo({},je,{pause:u})),C.current)}var ue,be,Ce,Ee,Ve,Ge,ye,oe,ie=(Ve=function(je){return re({x:je})},Ge=function(je){return re({y:je})},ye=function(je){return C.current&&(A({scale:je}),T({scale:je})),!J&&C.current},oe=Vy({X:function(je){return Ve(je)},Y:function(je){return Ge(je)},S:function(je){return ye(je)}}),function(je,kt,_t,fn,tn,qe,vt,We,ot,it,tt){var At=T8(it,tn,qe),Ot=At[0],Ut=At[1],Mt=Wm(je,We,Ot,innerWidth),Ze=Mt[0],bt=Mt[1],gt=Wm(kt,We,Ut,innerHeight),an=gt[0],Bt=gt[1],cn=Date.now()-tt;if(cn>=200||We!==vt||Math.abs(ot-vt)>1){var Je=k3(je,kt,tn,qe,vt,We),lt=Je.x,hn=Je.y,Sn=Ze?bt:lt!==je?lt:null,Ji=an?Bt:hn!==kt?hn:null;return Sn!==null&&my(je,Sn,oe.X),Ji!==null&&my(kt,Ji,oe.Y),void(We!==vt&&my(vt,We,oe.S))}var Qn=(je-_t)/cn,_n=(kt-fn)/cn,pi=Math.sqrt(Math.pow(Qn,2)+Math.pow(_n,2)),Nn=!1,Dn=!1;(function(_i,Fn){var Kn,Rn=_i,nt=0,Qt=0,Be=function(jn){Kn||(Kn=jn);var lr=jn-Kn,ta=Math.sign(_i),Ms=-.001*ta,ts=Math.sign(-Rn)*Math.pow(Rn,2)*2e-4,ci=Rn*lr+(Ms+ts)*Math.pow(lr,2)/2;nt+=ci,Kn=jn,ta*(Rn+=(Ms+ts)*lr)<=0?zt():Fn(nt)?xt():zt()};function xt(){Qt=requestAnimationFrame(Be)}function zt(){cancelAnimationFrame(Qt)}xt()})(pi,function(_i){var Fn=je+_i*(Qn/pi),Kn=kt+_i*(_n/pi),Rn=Wm(Fn,vt,Ot,innerWidth),nt=Rn[0],Qt=Rn[1],Be=Wm(Kn,vt,Ut,innerHeight),xt=Be[0],zt=Be[1];if(nt&&!Nn&&(Nn=!0,Ze?my(Fn,Qt,oe.X):HZ(Qt,Fn+(Fn-Qt),oe.X)),xt&&!Dn&&(Dn=!0,an?my(Kn,zt,oe.Y):HZ(zt,Kn+(Kn-zt),oe.Y)),Nn&&Dn)return!1;var jn=Nn||oe.X(Qt),lr=Dn||oe.Y(zt);return jn&&lr})}),Ae=(ue=y,be=function(je,kt){Pe||Ke(ce!==1?1:Math.max(2,P/L),je,kt)},Ce=p.useRef(0),Ee=X2(function(){Ce.current=0,ue.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var je=[].slice.call(arguments);Ce.current+=1,Ee.apply(void 0,je),Ce.current>=2&&(Ee.cancel(),Ce.current=0,be.apply(void 0,je))});function Re(je,kt){if(R.current=0,(J||W)&&O){T({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var _t=G2(ce,P/L);if(ie(Z,z,K,de,L,M,ce,_t,he,X,ge),k(je,kt),V===je&&Y===kt){if(J)return void Ae(je,kt);W&&w(je,kt)}}}function St(je,kt,_t){_t===void 0&&(_t=0),T({touched:!0,CX:je,CY:kt,lastCX:je,lastCY:kt,lastX:Z,lastY:z,lastScale:ce,touchLength:_t,touchTime:Date.now()})}function Nt(je){T({maskTouched:!0,CX:je.clientX,CY:je.clientY,lastX:Z,lastY:z})}sx(sp?void 0:"mousemove",function(je){je.preventDefault(),Me(je.clientX,je.clientY)}),sx(sp?void 0:"mouseup",function(je){Re(je.clientX,je.clientY)}),sx(sp?"touchmove":void 0,function(je){je.preventDefault();var kt=VZ(je);Me.apply(void 0,kt)},{passive:!1}),sx(sp?"touchend":void 0,function(je){var kt=je.changedTouches[0];Re(kt.clientX,kt.clientY)},{passive:!1}),sx("resize",X2(function(){q&&!J&&(T(O3(P,D,X)),S())},{maxWait:8})),A8(function(){O&&A(lo({scale:ce,rotate:X},Ue))},[O]);var Dt=function(je,kt,_t,fn,tn,qe,vt,We,ot,it){var tt=function(lt,hn,Sn,Ji,Qn){var _n=p.useRef(!1),pi=KR({lead:!0,scale:Sn}),Nn=pi[0],Dn=Nn.lead,_i=Nn.scale,Fn=pi[1],Kn=X2(function(Rn){try{return Qn(!0),Fn({lead:!1,scale:Rn}),Promise.resolve()}catch(nt){return Promise.reject(nt)}},{wait:Ji});return A8(function(){_n.current?(Qn(!1),Fn({lead:!0}),Kn(Sn)):_n.current=!0},[Sn]),Dn?[lt*_i,hn*_i,Sn/_i]:[lt*Sn,hn*Sn,1]}(qe,vt,We,ot,it),At=tt[0],Ot=tt[1],Ut=tt[2],Mt=function(lt,hn,Sn,Ji,Qn){var _n=p.useState(zJe),pi=_n[0],Nn=_n[1],Dn=p.useState(0),_i=Dn[0],Fn=Dn[1],Kn=p.useRef(),Rn=Vy({OK:function(){return lt&&Fn(4)}});function nt(Qt){Qn(!1),Fn(Qt)}return p.useEffect(function(){if(Kn.current||(Kn.current=Date.now()),Sn){if(function(Qt,Be){var xt=Qt&&Qt.current;if(xt&&xt.nodeType===1){var zt=xt.getBoundingClientRect();Be({T:zt.top,L:zt.left,W:zt.width,H:zt.height,FIT:xt.tagName==="IMG"?getComputedStyle(xt).objectFit:void 0})}}(hn,Nn),lt)return Date.now()-Kn.current<250?(Fn(1),requestAnimationFrame(function(){Fn(2),requestAnimationFrame(function(){return nt(3)})}),void setTimeout(Rn.OK,Ji)):void Fn(4);nt(5)}},[lt,Sn]),[_i,pi]}(je,kt,_t,ot,it),Ze=Mt[0],bt=Mt[1],gt=bt.W,an=bt.FIT,Bt=innerWidth/2,cn=innerHeight/2,Je=Ze<3||Ze>4;return[Je?gt?bt.L:Bt:fn+(Bt-qe*We/2),Je?gt?bt.T:cn:tn+(cn-vt*We/2),At,Je&&an?At*(bt.H/gt):Ot,Ze===0?Ut:Je?gt/(qe*We)||.01:Ut,Je?an?1:0:1,Ze,an]}(u,c,q,Z,z,L,M,ce,d,function(je){return T({pause:je})}),Et=Dt[4],$t=Dt[6],He="transform "+d+"ms "+f,yt={className:m,onMouseDown:sp?void 0:function(je){je.stopPropagation(),je.button===0&&St(je.clientX,je.clientY,0)},onTouchStart:sp?function(je){je.stopPropagation(),St.apply(void 0,VZ(je))}:void 0,onWheel:function(je){if(!Pe){var kt=G2(ce-je.deltaY/100/2,P/L);T({stopRaf:!0}),Ke(kt,je.clientX,je.clientY)}},style:{width:Dt[2]+"px",height:Dt[3]+"px",opacity:Dt[5],objectFit:$t===4?void 0:Dt[7],transform:X?"rotate("+X+"deg)":void 0,transition:$t>2?He+", opacity "+d+"ms ease, height "+($t<4?d/2:$t>4?d:0)+"ms "+f:void 0}};return Pi.createElement("div",{className:"PhotoView__PhotoWrap"+(h?" "+h:""),style:g,onMouseDown:!sp&&O?Nt:void 0,onTouchStart:sp&&O?function(je){return Nt(je.touches[0])}:void 0},Pi.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+Et+", 0, 0, "+Et+", "+Dt[0]+", "+Dt[1]+")",transition:J||xe?void 0:He,willChange:O?"transform":void 0}},n?Pi.createElement(WJe,lo({src:n,loaded:q,broken:U},yt,{onPhotoLoad:function(je){T(lo({},je,je.loaded&&O3(je.naturalWidth||0,je.naturalHeight||0,X)))},loadingElement:b,brokenElement:v})):i&&i({attrs:yt,scale:Et,rotate:X})))}var qZ={x:0,touched:!1,pause:!1,lastCX:void 0,lastCY:void 0,bg:void 0,lastBg:void 0,overlay:!0,minimal:!0,scale:1,rotate:0};function XJe(e){var t=e.loop,n=t===void 0?3:t,i=e.speed,r=e.easing,s=e.photoClosable,o=e.maskClosable,l=o===void 0||o,c=e.maskOpacity,u=c===void 0?1:c,d=e.pullClosable,f=d===void 0||d,h=e.bannerVisible,m=h===void 0||h,g=e.overlayRender,b=e.toolbarRender,v=e.className,y=e.maskClassName,w=e.photoClassName,x=e.photoWrapClassName,k=e.loadingElement,S=e.brokenElement,O=e.images,A=e.index,E=A===void 0?0:A,j=e.onIndexChange,T=e.visible,R=e.onClose,C=e.afterClose,N=e.portalContainer,P=KR(qZ),I=P[0],D=P[1],_=p.useState(0),L=_[0],F=_[1],M=I.x,H=I.touched,q=I.pause,U=I.lastCX,Z=I.lastCY,z=I.bg,J=z===void 0?u:z,ne=I.lastBg,W=I.overlay,X=I.minimal,ce=I.scale,V=I.rotate,Y=I.onScale,K=I.onRotate,de=e.hasOwnProperty("index"),ee=de?E:L,Oe=de?j:F,he=p.useRef(ee),ge=O.length,Se=O[ee],xe=typeof n=="boolean"?n:ge>n,Pe=function(Et,$t){var He=p.useReducer(function(_t){return!_t},!1)[1],yt=p.useRef(0),je=function(_t){var fn=p.useRef(_t);function tn(qe){fn.current=qe}return p.useMemo(function(){(function(qe){Et?(qe(Et),yt.current=1):yt.current=2})(tn)},[_t]),[fn.current,tn]}(Et),kt=je[1];return[je[0],yt.current,function(){He(),yt.current===2&&(kt(!1),$t&&$t()),yt.current=0}]}(T,C),Ue=Pe[0],Ke=Pe[1],Me=Pe[2];A8(function(){if(Ue)return D({pause:!0,x:ee*-(innerWidth+R0)}),void(he.current=ee);D(qZ)},[Ue]);var re=Vy({close:function(Et){K&&K(0),D({overlay:!0,lastBg:J}),R(Et)},changeIndex:function(Et,$t){$t===void 0&&($t=!1);var He=xe?he.current+(Et-ee):Et,yt=ge-1,je=C8(He,0,yt),kt=xe?He:je,_t=innerWidth+R0;D({touched:!1,lastCX:void 0,lastCY:void 0,x:-_t*kt,pause:$t}),he.current=kt,Oe&&Oe(xe?Et<0?yt:Et>yt?0:Et:je)}}),ue=re.close,be=re.changeIndex;function Ce(Et){return Et?ue():D({overlay:!W})}function Ee(){D({x:-(innerWidth+R0)*ee,lastCX:void 0,lastCY:void 0,pause:!0}),he.current=ee}function Ve(Et,$t,He,yt){Et==="x"?function(je){if(U!==void 0){var kt=je-U,_t=kt;!xe&&(ee===0&&kt>0||ee===ge-1&&kt<0)&&(_t=kt/2),D({touched:!0,lastCX:U,x:-(innerWidth+R0)*he.current+_t,pause:!1})}else D({touched:!0,lastCX:je,x:M,pause:!1})}($t):Et==="y"&&function(je,kt){if(Z!==void 0){var _t=u===null?null:C8(u,.01,u-Math.abs(je-Z)/100/4);D({touched:!0,lastCY:Z,bg:kt===1?_t:u,minimal:kt===1})}else D({touched:!0,lastCY:je,bg:J,minimal:!0})}(He,yt)}function Ge(Et,$t){var He=Et-(U??Et),yt=$t-(Z??$t),je=!1;if(He<-40)be(ee+1);else if(He>40)be(ee-1);else{var kt=-(innerWidth+R0)*he.current;Math.abs(yt)>100&&X&&f&&(je=!0,ue()),D({touched:!1,x:kt,lastCX:void 0,lastCY:void 0,bg:u,overlay:!!je||W})}}sx("keydown",function(Et){if(T)switch(Et.key){case"ArrowLeft":be(ee-1,!0);break;case"ArrowRight":be(ee+1,!0);break;case"Escape":ue()}});var ye=function(Et,$t,He){return p.useMemo(function(){var yt=Et.length;return He?Et.concat(Et).concat(Et).slice(yt+$t-1,yt+$t+2):Et.slice(Math.max($t-1,0),Math.min($t+2,yt+1))},[Et,$t,He])}(O,ee,xe);if(!Ue)return null;var oe=W&&!Ke,ie=T?J:ne,Ae=Y&&K&&{images:O,index:ee,visible:T,onClose:ue,onIndexChange:be,overlayVisible:oe,overlay:Se&&Se.overlay,scale:ce,rotate:V,onScale:Y,onRotate:K},Re=i?i(Ke):400,St=r?r(Ke):zZ,Nt=i?i(3):600,Dt=r?r(3):zZ;return Pi.createElement(LJe,{className:"PhotoView-Portal"+(oe?"":" PhotoView-Slider__clean")+(T?"":" PhotoView-Slider__willClose")+(v?" "+v:""),role:"dialog",onClick:function(Et){return Et.stopPropagation()},container:N},T&&Pi.createElement(UJe,null),Pi.createElement("div",{className:"PhotoView-Slider__Backdrop"+(y?" "+y:"")+(Ke===1?" PhotoView-Slider__fadeIn":Ke===2?" PhotoView-Slider__fadeOut":""),style:{background:ie?"rgba(0, 0, 0, "+ie+")":void 0,transitionTimingFunction:St,transitionDuration:(H?0:Re)+"ms",animationDuration:Re+"ms"},onAnimationEnd:Me}),m&&Pi.createElement("div",{className:"PhotoView-Slider__BannerWrap"},Pi.createElement("div",{className:"PhotoView-Slider__Counter"},ee+1," / ",ge),Pi.createElement("div",{className:"PhotoView-Slider__BannerRight"},b&&Ae&&b(Ae),Pi.createElement($Je,{className:"PhotoView-Slider__toolbarIcon",onClick:ue}))),ye.map(function(Et,$t){var He=xe||ee!==0?he.current-1+$t:ee+$t;return Pi.createElement(GJe,{key:xe?Et.key+"/"+Et.src+"/"+He:Et.key,item:Et,speed:Re,easing:St,visible:T,onReachMove:Ve,onReachUp:Ge,onPhotoTap:function(){return Ce(s)},onMaskTap:function(){return Ce(l)},wrapClassName:x,className:w,style:{left:(innerWidth+R0)*He+"px",transform:"translate3d("+M+"px, 0px, 0)",transition:H||q?void 0:"transform "+Nt+"ms "+Dt},loadingElement:k,brokenElement:S,onPhotoResize:Ee,isActive:he.current===He,expose:D})}),!sp&&m&&Pi.createElement(Pi.Fragment,null,(xe||ee!==0)&&Pi.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return be(ee-1,!0)}},Pi.createElement(FJe,null)),(xe||ee+1-1){var y=u.slice();return y.splice(v,1,b),void l({images:y})}l(function(w){return{images:w.images.concat(b)}})},remove:function(b){l(function(v){var y=v.images.filter(function(w){return w.key!==b});return{images:y,index:Math.min(y.length-1,f)}})},show:function(b){var v=u.findIndex(function(y){return y.key===b});l({visible:!0,index:v}),i&&i(!0,v,o)}}),m=Vy({close:function(){l({visible:!1}),i&&i(!1,f,o)},changeIndex:function(b){l({index:b}),n&&n(b,o)}}),g=p.useMemo(function(){return lo({},o,h)},[o,h]);return Pi.createElement(FAe.Provider,{value:g},t,Pi.createElement(XJe,lo({images:u,visible:d,index:f,onIndexChange:m.changeIndex,onClose:m.close},r)))}var UAe=function(e){var t,n,i=e.src,r=e.render,s=e.overlay,o=e.width,l=e.height,c=e.triggers,u=c===void 0?["onClick"]:c,d=e.children,f=p.useContext(FAe),h=(t=function(){return f.nextId()},(n=p.useRef({sign:!1,fn:void 0}).current).sign||(n.sign=!0,n.fn=t()),n.fn),m=p.useRef(null);p.useImperativeHandle(d==null?void 0:d.ref,function(){return m.current}),p.useEffect(function(){return function(){f.remove(h)}},[]);var g=Vy({render:function(v){return r&&r(v)},show:function(v,y){f.show(h),function(w,x){if(d){var k=d.props[w];k&&k(x)}}(v,y)}}),b=p.useMemo(function(){var v={};return u.forEach(function(y){v[y]=g.show.bind(null,y)}),v},[]);return p.useEffect(function(){f.update({key:h,src:i,originRef:m,render:g.render,overlay:s,width:o,height:l})},[i]),d?p.Children.only(p.cloneElement(d,lo({},b,{ref:m}))):null};function sv(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("path",{d:"m7.5 9 2.7 2.5L7.5 14M12.7 14h3.8"}),a.jsx("path",{d:"M3.8 7.5h16.4",opacity:".55"})]})}function QAe(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("path",{d:"M3.8 8h16.4"}),a.jsx("circle",{cx:"6.5",cy:"6.3",r:".65",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"8.8",cy:"6.3",r:".65",fill:"currentColor",stroke:"none"}),a.jsx("path",{d:"m9 15 2.2-4 1.6 2.4 1.1-1.2L16 15H9Z"})]})}function pz(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M12 3.4 19 6v5.3c0 4.3-2.7 7.6-7 9.3-4.3-1.7-7-5-7-9.3V6l7-2.6Z"}),a.jsx("path",{d:"m8.8 12 2 2 4.4-4.4"})]})}function aN(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M3.5 7.7h6.1l1.7 2h9.2v7.5a2.3 2.3 0 0 1-2.3 2.3H5.8a2.3 2.3 0 0 1-2.3-2.3V7.7Z"}),a.jsx("path",{d:"M3.8 7.7V6.8a2.3 2.3 0 0 1 2.3-2.3h3l1.8 2h6.9a2.3 2.3 0 0 1 2.3 2.3v.9"}),a.jsx("path",{d:"M12 13v3M10.5 14.5h3"})]})}function eet(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 5v14M5 12h14"})})}function WZ(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6.5 11.5 5.5-5.5 5.5 5.5M12 6v12"})})}function KZ(e){return a.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",...e,children:a.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1.75",fill:"currentColor"})})}function tet(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("circle",{cx:"8.5",cy:"9",r:"1.4"}),a.jsx("path",{d:"m5.5 17 4.2-4.2 2.6 2.4 2.1-2.1 4.1 3.9"})]})}function net(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3.5h7l5 5v12H6z"}),a.jsx("path",{d:"M13 3.5v5h5M9 13h6M9 16h5"})]})}function iet(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"5",width:"13.5",height:"14",rx:"2.5"}),a.jsx("path",{d:"m17 10 3.5-2v8L17 14zM7 8.5h4.5"})]})}function ret(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m12 3 1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5zM18.5 15.5l.7 2.1 2.1.7-2.1.7-.7 2.1-.7-2.1-2.1-.7 2.1-.7z"})})}function zAe(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function _8(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m9 6 6 6-6 6"})})}function set(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.8 8.2A8 8 0 1 1 4 12M4.8 8.2V4.5M4.8 8.2h3.7"}),a.jsx("path",{d:"M12 8v4.5l3 1.8"})]})}function _c(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M20 12a8 8 0 1 1-2.35-5.65"})})}function aet(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"8",y:"8",width:"11",height:"11",rx:"2"}),a.jsx("path",{d:"M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"})]})}function VAe(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m5 12.5 4.2 4.2L19 7"})})}function Q(e,t={}){return bn.t(e,{...t,ns:"adk"})}function hl(e){const t=new Headers(e);return t.has("Accept-Language")||t.set("Accept-Language",bn.resolvedLanguage||bn.language),t}function j8(){return bn.resolvedLanguage||bn.language}function oet(e){if(e.timezone!=null){if(typeof e.timezone!="string")return!1;try{new Intl.DateTimeFormat("en-US",{timeZone:e.timezone})}catch{return!1}}return e.runAt!=null&&(typeof e.runAt!="string"||!Number.isFinite(Date.parse(e.runAt)))?!1:[e.weekdays,e.monthDays].every(t=>t==null||Array.isArray(t)&&t.every(Number.isInteger))}async function cet(e,t,n,i,r){const s=await e(`/web/mpa-cron/${encodeURIComponent(t.runtimeId)}?region=${encodeURIComponent(t.region)}&offset=${n}&query=${encodeURIComponent(i)}`,{signal:r},{});if(!s.ok)throw new Error(`MPA_HTTP_${s.status}`);let o;try{o=await s.json()}catch{throw new Error("MPA_INVALID_RESPONSE")}if(!o||!Array.isArray(o.items)||!Number.isInteger(o.total)||o.total<0||typeof o.hasMore!="boolean"||o.hasMore&&(!Number.isInteger(o.nextOffset)||o.nextOffset<=n)||o.overview!=null&&(!Number.isFinite(o.overview.executionCount)||!Number.isFinite(o.overview.successRate))||!o.items.every(l=>l&&typeof l.id=="string"&&typeof l.name=="string"&&typeof l.enabled=="boolean"&&(l.prompt==null||typeof l.prompt=="string")&&l.schedule&&typeof l.schedule.type=="string"&&oet(l.schedule)&&[l.agentId,l.lastRunAt,l.runningAt,l.createdAt].every(c=>c==null||typeof c=="string")&&(l.nextRunAt==null||typeof l.nextRunAt=="string")&&(l.lastRunStatus==null||typeof l.lastRunStatus=="string")))throw new Error("MPA_INVALID_RESPONSE");return o}async function uet(e,t,n,i,r,s){const o=await e(`/web/mpa-cron/${encodeURIComponent(t.runtimeId)}${i}?region=${encodeURIComponent(t.region)}`,{method:n,signal:s,...r===void 0?{}:{headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}},{});if(!o.ok)throw new Error(`MPA_HTTP_${o.status}`);let l;try{l=await o.json()}catch{throw new Error("MPA_INVALID_RESPONSE")}if(!l||typeof l!="object"||Array.isArray(l))throw new Error("MPA_INVALID_RESPONSE");return l}async function det(e,t,n,i,r){const s=await e(`/web/mpa-cron/${encodeURIComponent(t.runtimeId)}/${encodeURIComponent(n)}/runs?region=${encodeURIComponent(t.region)}&offset=${i}`,{signal:r},{});if(!s.ok)throw new Error(`MPA_HTTP_${s.status}`);let o;try{o=await s.json()}catch{throw new Error("MPA_INVALID_RESPONSE")}if(!o||!Array.isArray(o.items)||!Number.isInteger(o.total)||o.total<0||typeof o.hasMore!="boolean"||o.hasMore&&(!Number.isInteger(o.nextOffset)||o.nextOffset<=i)||!o.items.every(l=>l&&typeof l.id=="string"&&typeof l.status=="string"&&typeof l.scheduledAt=="string"&&[l.startedAt,l.errorMessage,l.sessionId].every(c=>c==null||typeof c=="string")&&(l.durationMs==null||Number.isFinite(l.durationMs)&&l.durationMs>=0)))throw new Error("MPA_INVALID_RESPONSE");return o}const GZ="veadk_auth_qs",fet=new Set(["view","source","sessionId","artifactSha256","validationReportSha256","projectId","versionId"]);let cO=null;function het(){if(cO!==null)return cO;const e=new URLSearchParams(window.location.search),t=new URLSearchParams,n=new URLSearchParams,i=e.get("view")==="runtime-deploy"&&e.get("source")==="intelligent-development";e.forEach((s,o)=>{(i&&fet.has(o)?n:t).append(o,s)});const r=t.toString();if(r?(sessionStorage.setItem(GZ,r),cO=r):cO=sessionStorage.getItem(GZ)??"",r){const s=n.toString();window.history.replaceState(null,"",window.location.pathname+(s?`?${s}`:"")+window.location.hash)}return cO}function Na(e){const t=het();if(!t)return e;const n=new URL(e,window.location.origin);return new URLSearchParams(t).forEach((i,r)=>{n.searchParams.has(r)||n.searchParams.set(r,i)}),/^https?:\/\//i.test(e)?n.toString():n.pathname+n.search+n.hash}const eo=3e4,yr=12e4,mz=1e4;function po(e,t=eo){if(t<=0)return e??void 0;const n=AbortSignal.timeout(t);return e?AbortSignal.any([e,n]):n}const GR="veadk_local_user",XR="veadk_local_user_tab",pet="X-VeADK-OAuth-Refresh-Retry",met=[50,250],get=/^[A-Za-z0-9]{1,16}$/;function HAe(){try{const e=sessionStorage.getItem(XR);if(e)return e;const t=localStorage.getItem(GR);return t&&sessionStorage.setItem(XR,t),t}catch{try{return localStorage.getItem(GR)}catch{return null}}}function XZ(e){try{sessionStorage.setItem(XR,e)}catch{}try{localStorage.setItem(GR,e)}catch{}}function bet(){try{sessionStorage.removeItem(XR)}catch{}try{localStorage.removeItem(GR)}catch{}}function oc(e){const t=new Headers(e),n=HAe();return n&&t.set("X-VeADK-Local-User",n),t}async function qAe(){let e;try{e=await fetch("/web/auth-config",{headers:hl({Accept:"application/json"}),signal:po(void 0,mz)})}catch(t){throw console.warn("[identity] /web/auth-config is unreachable:",t),new Error(Q("identity.loadConfigNetworkFailed"))}if(!e.ok)throw new Error(Q("identity.configServiceFailed",{status:e.status}));try{const t=await e.json();if(!Array.isArray(t.providers))throw new TypeError("providers is not an array");return t.providers}catch(t){throw console.warn("[identity] /web/auth-config returned an invalid response:",t),new Error(Q("identity.invalidConfigResponse"))}}function yet(e){const t=window.location.pathname+window.location.search+window.location.hash,n=e.includes("?")?"&":"?";window.location.assign(`${e}${n}redirect=${encodeURIComponent(t)}`)}function vet(){const e=window.location.pathname+window.location.search+window.location.hash,t=window.open("about:blank","_blank","popup,width=520,height=720");if(!t)return null;try{t.opener=null,t.location.replace(`/oauth2/login?redirect=${encodeURIComponent(e)}`)}catch{return t.close(),null}return t}async function xet(){const[e,t]=await Promise.all([N8(),qAe()]);return e.status==="unauthenticated"&&t.length>0}function wet(){window.location.assign("/oauth2/logout")}async function ket(){for(let e=0;;e+=1){let t;try{t=await fetch("/oauth2/userinfo",{headers:hl({Accept:"application/json"}),signal:po(void 0,mz)})}catch(i){throw console.warn("[identity] /oauth2/userinfo is unreachable:",i),new Error(Q("identity.serviceNetworkFailed"))}const n=met[e];if(t.status!==401||t.headers.get(pet)!=="1"||n===void 0)return t;await new Promise(i=>window.setTimeout(i,n))}}async function N8(){const e=await ket();if(e.ok){let n;try{n=await e.json()}catch(r){throw console.warn("[identity] /oauth2/userinfo returned a non-JSON response:",r),new Error(Q("identity.invalidServiceResponse"))}return{status:"authenticated",userId:String(n.sub??n.user_id??n.email??""),info:n}}if(e.status===401)return{status:"unauthenticated",userId:"",local:!1};if(e.status!==404)throw new Error(Q("identity.serviceFailed",{status:e.status}));const t=HAe();return t?{status:"authenticated",userId:t,info:{name:t},local:!0}:{status:"unauthenticated",userId:"",local:!0}}function Oet(e){if(!e)return"";for(const t of[e.name,e.preferred_username,e.username,e.email])if(typeof t=="string"&&t.trim())return t.trim();return""}function Eet(e){const t=e==null?void 0:e.picture;return typeof t=="string"?t.trim():""}const R8="veadk:authentication-required";let eE=null,dS=null;function Cet(e){if(!e.redirected||!e.url)return!1;try{const t=new URL(e.url);return t.pathname.includes("/authorize")||t.pathname.includes("/oauth2/login")||t.hostname.includes(".userpool.auth.")}catch{return!1}}function Aet(e){eE||(eE=new Promise(n=>{dS=n}),window.dispatchEvent(new Event(R8)));const t=eE;return e?e.aborted?Promise.reject(e.reason??new Error("Request aborted")):new Promise((n,i)=>{const r=()=>i(e.reason??new Error("Request aborted"));e.addEventListener("abort",r,{once:!0}),t.then(()=>{e.removeEventListener("abort",r),n()},s=>{e.removeEventListener("abort",r),i(s)})}):t}function Tet(){return eE!==null}function _et(){dS==null||dS(),dS=null,eE=null}async function SD(e,t){var i;const n=await e.text().catch(()=>"");try{return JSON.parse(n)}catch{const r=((i=e.headers.get("content-type"))==null?void 0:i.split(";",1)[0])||Q("common.contentTypeMissing"),s=n.trim().slice(0,2e3),o=s?` +${Q("common.response",{response:s})}`:"";throw new Error(Q("jsonResponse.nonJson",{fallback:t,status:e.status,contentType:r,detail:o}))}}const jet=/\brun_sse\s*failed\s*:\s*404\b/i,Net=/session not found/i,Ret=/(?:^|[::\s])not found\s*$/i,Iet=/Expecting (?:'[^']+'|\w+)(?: delimiter)?: line \d+ column \d+ \(char \d+\)/i,Pet=/Unknown or expired collection_id\s+'[^']+'\.\s*Call collect_resources first\./i,Det=/(?:RateLimitError|\bTPM\b|\bRPM\b|tokens? per minute|requests? per minute)[\s\S]*(?:\b429\b|limit|quota)|\b429\b[\s\S]*(?:model|RateLimitError|\bTPM\b|\bRPM\b)/i;function I0(e,t){return e.includes(t)?e:`${e} -${t}`}function nl(e){const t=String(e),n=Q("runSse.rawResponseLabel");let i=t.includes(n)?t:`${n}${t}`;if(Ret.test(t))i=I0(i,Q("runSse.toolArgumentHint"));else{if(Iet.test(t))return I0(i,Q("runSse.resourceCollectionExpiredHint"));if(Pet.test(t))return I0(i,Q("runSse.modelQuotaHint"));_et.test(t)&&(jet.test(t)?i=I0(i,Q("runSse.persistentMemoryHint")):Net.test(t)&&(i=I0(i,Q("runSse.unsupportedRouteHint"))))}return I0(i,Q("runSse.networkConfigurationHint"))}const aC="__sseEvent";async function*BA(e){if(!e.body)throw new Error("Response has no body");const t=e.body.getReader(),n=new TextDecoder;let i="";const r=o=>o.length>500?Q("sse.truncatedData",{data:o.slice(0,500),count:o.length}):o,s=(o,l=!1)=>{var f;const c=o.split(/\r?\n/),u=(f=c.find(h=>h.startsWith("event:")))==null?void 0:f.slice(6).trim(),d=c.filter(h=>h.startsWith("data:")).map(h=>h.slice(5).trimStart()).join(` -`);if(!(!d||d==="[DONE]"||d==="ping"))try{const h=JSON.parse(d);return u&&h&&typeof h=="object"&&Object.defineProperty(h,aC,{value:u,enumerable:!1,configurable:!0}),h}catch{const h=r(d);throw l?new Error(Q("sse.incompleteEvent",{data:h})):new Error(Q("sse.invalidEventJson",{data:h}))}};try{for(;;){const{done:o,value:l}=await t.read();if(o)break;i+=n.decode(l,{stream:!0});let c=i.match(/\r?\n\r?\n/);for(;(c==null?void 0:c.index)!==void 0;){const u=i.slice(0,c.index);i=i.slice(c.index+c[0].length);const d=s(u);d!==void 0&&(yield d),c=i.match(/\r?\n\r?\n/)}}if(i+=n.decode(),i.trim()){const o=s(i,!0);o!==void 0&&(yield o)}}finally{try{await t.cancel()}catch{}finally{t.releaseLock()}}}const Det="X-Studio-FaaS-Instance",Met="X-Studio-FaaS-Request-Id";function YR(e,t,n){var s,o;const i=((s=e.headers.get(Det))==null?void 0:s.trim())??"";if(!t||!n||!i)return null;const r=((o=e.headers.get(Met))==null?void 0:o.trim())??"";return{runtimeId:t,region:n,instanceName:i,...r?{requestId:r}:{}}}function YZ(e,t,n,i){const r=e==="byteplus"?"https://console.byteplus.com":"https://console.volcengine.com",s=new URLSearchParams({projectName:"default",runtimeId:n,instanceName:i});return`${r}/agentkit/region:agentkit+${encodeURIComponent(t)}/runtime?${s}`}function Let(e){return/\b(?:ERROR|FATAL|CRITICAL)\b/i.test(e)?"error":/\bWARN(?:ING)?\b/i.test(e)?"warning":/\bDEBUG\b/i.test(e)?"debug":/\bINFO\b/i.test(e)?"info":"default"}function $et(e){if(!e||typeof e!="object")return!1;const t=e;return t.type==="done"?!0:t.type==="context"?typeof t.instanceName=="string"&&typeof t.consoleUrl=="string":t.type==="logs"?typeof t.text=="string"&&typeof t.updatedAt=="number":t.type==="error"?typeof t.message=="string"&&(t.detail===void 0||typeof t.detail=="string")&&(t.statusCode===void 0||typeof t.statusCode=="string")&&(t.errorCode===void 0||typeof t.errorCode=="string")&&(t.requestId===void 0||typeof t.requestId=="string")&&(t.responseBody===void 0||typeof t.responseBody=="string"):!1}function qAe(e){var i;const t=[e.message],n=[e.statusCode?Q("runtimeLogs.httpStatus",{status:e.statusCode}):"",e.errorCode?Q("runtimeLogs.errorCode",{code:e.errorCode}):"",e.requestId?`Request ID:${e.requestId}`:""].filter(Boolean);return n.length>0&&t.push(n.join(` +${t}`}function nl(e){const t=String(e),n=Q("runSse.rawResponseLabel");let i=t.includes(n)?t:`${n}${t}`;if(Iet.test(t))i=I0(i,Q("runSse.toolArgumentHint"));else{if(Pet.test(t))return I0(i,Q("runSse.resourceCollectionExpiredHint"));if(Det.test(t))return I0(i,Q("runSse.modelQuotaHint"));jet.test(t)&&(Net.test(t)?i=I0(i,Q("runSse.persistentMemoryHint")):Ret.test(t)&&(i=I0(i,Q("runSse.unsupportedRouteHint"))))}return I0(i,Q("runSse.networkConfigurationHint"))}const aC="__sseEvent";async function*BA(e){if(!e.body)throw new Error("Response has no body");const t=e.body.getReader(),n=new TextDecoder;let i="";const r=o=>o.length>500?Q("sse.truncatedData",{data:o.slice(0,500),count:o.length}):o,s=(o,l=!1)=>{var f;const c=o.split(/\r?\n/),u=(f=c.find(h=>h.startsWith("event:")))==null?void 0:f.slice(6).trim(),d=c.filter(h=>h.startsWith("data:")).map(h=>h.slice(5).trimStart()).join(` +`);if(!(!d||d==="[DONE]"||d==="ping"))try{const h=JSON.parse(d);return u&&h&&typeof h=="object"&&Object.defineProperty(h,aC,{value:u,enumerable:!1,configurable:!0}),h}catch{const h=r(d);throw l?new Error(Q("sse.incompleteEvent",{data:h})):new Error(Q("sse.invalidEventJson",{data:h}))}};try{for(;;){const{done:o,value:l}=await t.read();if(o)break;i+=n.decode(l,{stream:!0});let c=i.match(/\r?\n\r?\n/);for(;(c==null?void 0:c.index)!==void 0;){const u=i.slice(0,c.index);i=i.slice(c.index+c[0].length);const d=s(u);d!==void 0&&(yield d),c=i.match(/\r?\n\r?\n/)}}if(i+=n.decode(),i.trim()){const o=s(i,!0);o!==void 0&&(yield o)}}finally{try{await t.cancel()}catch{}finally{t.releaseLock()}}}const Met="X-Studio-FaaS-Instance",Let="X-Studio-FaaS-Request-Id";function YR(e,t,n){var s,o;const i=((s=e.headers.get(Met))==null?void 0:s.trim())??"";if(!t||!n||!i)return null;const r=((o=e.headers.get(Let))==null?void 0:o.trim())??"";return{runtimeId:t,region:n,instanceName:i,...r?{requestId:r}:{}}}function YZ(e,t,n,i){const r=e==="byteplus"?"https://console.byteplus.com":"https://console.volcengine.com",s=new URLSearchParams({projectName:"default",runtimeId:n,instanceName:i});return`${r}/agentkit/region:agentkit+${encodeURIComponent(t)}/runtime?${s}`}function $et(e){return/\b(?:ERROR|FATAL|CRITICAL)\b/i.test(e)?"error":/\bWARN(?:ING)?\b/i.test(e)?"warning":/\bDEBUG\b/i.test(e)?"debug":/\bINFO\b/i.test(e)?"info":"default"}function Fet(e){if(!e||typeof e!="object")return!1;const t=e;return t.type==="done"?!0:t.type==="context"?typeof t.instanceName=="string"&&typeof t.consoleUrl=="string":t.type==="logs"?typeof t.text=="string"&&typeof t.updatedAt=="number":t.type==="error"?typeof t.message=="string"&&(t.detail===void 0||typeof t.detail=="string")&&(t.statusCode===void 0||typeof t.statusCode=="string")&&(t.errorCode===void 0||typeof t.errorCode=="string")&&(t.requestId===void 0||typeof t.requestId=="string")&&(t.responseBody===void 0||typeof t.responseBody=="string"):!1}function WAe(e){var i;const t=[e.message],n=[e.statusCode?Q("runtimeLogs.httpStatus",{status:e.statusCode}):"",e.errorCode?Q("runtimeLogs.errorCode",{code:e.errorCode}):"",e.requestId?`Request ID:${e.requestId}`:""].filter(Boolean);return n.length>0&&t.push(n.join(` `)),e.detail&&e.detail!==e.message&&t.push(e.detail),e.responseBody&&!((i=e.detail)!=null&&i.includes(e.responseBody))&&t.push(Q("runtimeLogs.cloudResponseBody",{body:e.responseBody})),t.join(` -`)}async function Fet(e){const t=`HTTP ${e.status}${e.statusText?` ${e.statusText}`:""}`,n=await e.text();if(!n)return t;try{const i=JSON.parse(n);if(typeof i.detail=="string"&&i.detail)return`${t} +`)}async function Bet(e){const t=`HTTP ${e.status}${e.statusText?` ${e.statusText}`:""}`,n=await e.text();if(!n)return t;try{const i=JSON.parse(n);if(typeof i.detail=="string"&&i.detail)return`${t} -${i.detail}`;if(i.detail&&typeof i.detail=="object"){const r=i.detail;if(typeof r.message=="string")return qAe({message:r.message,...typeof r.detail=="string"?{detail:r.detail}:{},...typeof r.statusCode=="string"?{statusCode:r.statusCode}:{},...typeof r.errorCode=="string"?{errorCode:r.errorCode}:{},...typeof r.requestId=="string"?{requestId:r.requestId}:{},...typeof r.responseBody=="string"?{responseBody:r.responseBody}:{}})}return`${t} +${i.detail}`;if(i.detail&&typeof i.detail=="object"){const r=i.detail;if(typeof r.message=="string")return WAe({message:r.message,...typeof r.detail=="string"?{detail:r.detail}:{},...typeof r.statusCode=="string"?{statusCode:r.statusCode}:{},...typeof r.errorCode=="string"?{errorCode:r.errorCode}:{},...typeof r.requestId=="string"?{requestId:r.requestId}:{},...typeof r.responseBody=="string"?{responseBody:r.responseBody}:{}})}return`${t} ${JSON.stringify(i,null,2)}`}catch{return`${t} -${n}`}}async function*Bet({runtimeId:e,region:t,instanceName:n,sessionId:i,follow:r=!0,signal:s}){const o=new URLSearchParams({region:t,follow:String(r)});n&&o.set("instance_name",n),i&&o.set("session_id",i);const l=await fetch(Na(`/web/runtime-logs/${encodeURIComponent(e)}/stream?${o.toString()}`),{headers:hl(oc({Accept:"text/event-stream"})),cache:"no-store",signal:s});if(!l.ok)throw new Error(Q("runtimeLogs.loadFailedWithDetail",{detail:await Fet(l)}));for await(const c of BA(l)){if(!$et(c))throw new Error(Q("runtimeLogs.invalidFormat"));yield c}}const Uet=255,Qet=/[\p{L}\p{M}\p{N}\p{P}\p{Zs}]/u;function zet(e){const t=e.normalize("NFKC").replace(/\s+/gu," ").trim(),n=new TextEncoder;let i=0,r="";for(const s of t){if(!Qet.test(s))continue;const o=n.encode(s).byteLength;if(i+o>Uet)break;r+=s,i+=o}return r.replace(/ +/g," ").trimEnd()}const Vet=/RunPipeline result could not be reconciled|Polling build status failed/i;class oN extends Error{constructor({taskId:n,cause:i}={}){super("The deployment request may still be running, but its status could not be confirmed.");Zt(this,"taskId");this.name="DeploymentStatusUnconfirmedError",this.taskId=n}}function WAe(e){if(e instanceof oN)return!0;const t=e instanceof Error?e.message:String(e??"");return Vet.test(t)}function KAe(e){return!!(e&&typeof e=="object"&&"name"in e&&e.name==="AbortError")}async function Het({load:e,signal:t,timeoutMs:n=30*6e4,intervalMs:i=2e3,shouldRetry:r=()=>!0}){if(t!=null&&t.aborted)throw t.reason??new DOMException("Aborted","AbortError");const s=Date.now()+Math.max(0,n);for(;!(t!=null&&t.aborted)&&Date.now()<=s;){try{const o=await e(t);if(o.done)return o}catch(o){if(t!=null&&t.aborted||KAe(o)||!r(o))throw o}if(t!=null&&t.aborted)throw t.reason??new DOMException("Aborted","AbortError");i<=0||await new Promise((o,l)=>{const c=()=>{globalThis.clearTimeout(u),t==null||t.removeEventListener("abort",c),l((t==null?void 0:t.reason)??new DOMException("Aborted","AbortError"))},u=globalThis.setTimeout(()=>{t==null||t.removeEventListener("abort",c),o()},i);t==null||t.addEventListener("abort",c,{once:!0})})}return null}const I8="ap-southeast-1",gz="cn-beijing",qet="https://ark.ap-southeast.bytepluses.com/api/v3",Wet="https://ark.cn-beijing.volces.com/api/v3/",Ket="https://console.byteplus.com/ark/region:ark+ap-southeast-1/openManagement",Get="https://console.volcengine.com/ark/region:ark+cn-beijing/openManagement",Xet="dola-seed-2-1-turbo-260628",Yet="doubao-seed-2-1-pro-260628",Zet="skylark-embedding-vision-250615",Jet="doubao-embedding-vision-250615",ett="seed-2-0-lite-260228",ttt="doubao-seed-2-0-lite-260428",ntt="dola-seedream-5-0-pro-260628",itt="doubao-seedream-5-0-260128",rtt="seededit-3-0-i2i-250628",stt="doubao-seededit-3-0-i2i-250628",att="dreamina-seedance-2-0-260128",ott="doubao-seedance-2-0-260128";function Pu(e){return e==="byteplus"?[{value:I8,label:I8}]:[{value:"cn-beijing",label:Q("cloudRegion.cnBeijing")},{value:"cn-shanghai",label:Q("cloudRegion.cnShanghai")}]}function nr(e){var t;return((t=Pu(e)[0])==null?void 0:t.value)||gz}const ltt=new Set(["cn-beijing","cn-shanghai","ap-southeast-1"]);function ED(e){return typeof e=="string"&<t.has(e)}function Sh(e,t){var i;return((i=(t?Pu(t):[...Pu("volcengine"),...Pu("byteplus")]).find(r=>r.value===e))==null?void 0:i.label)||e||"-"}function Xp(e){return e==="byteplus"?Xet:Yet}function Fo(e){return e==="byteplus"?qet:Wet}function ctt(e){return e==="byteplus"?Ket:Get}function utt(e){return e==="byteplus"?Zet:Jet}function dtt(e){return e==="byteplus"?ett:ttt}function ftt(e){return e==="byteplus"?ntt:itt}function htt(e){return e==="byteplus"?rtt:stt}function ptt(e){return e==="byteplus"?att:ott}const bz="veadk.messageFeedback.v1";function yz(e,t,n,i){return[e,t,n,i].join(":")}function vz(){if(typeof window>"u")return{};try{const e=JSON.parse(localStorage.getItem(bz)??"{}");return e&&typeof e=="object"?e:{}}catch{return{}}}function mtt(e,t,n){if(typeof window>"u")return;const i=vz();i[e]={...i[e]??{},[`veadk_feedback:${t}`]:n},localStorage.setItem(bz,JSON.stringify(i))}function GAe(e){if(typeof window>"u")return;const t=yz(e.runtimeId,e.appName,e.userId,e.sessionId),n=vz(),i=n[t];if(i){for(const r of e.eventIds)delete i[`veadk_feedback:${r}`];Object.keys(i).length===0?delete n[t]:n[t]=i,localStorage.setItem(bz,JSON.stringify(n))}}const lN="",xz=new Map;function XAe(e,t){xz.set(e,t)}function YAe(){xz.clear()}function Pa(e){const t=xz.get(e);return t?{app:t.app,ep:{base:t.base,apiKey:t.apiKey,runtimeId:t.runtimeId,mpaInstanceId:t.mpaInstanceId,region:t.region,agentCategory:t.agentCategory}}:{app:e,ep:{}}}function Q1(e,t){return e!=="a2a-default"&&!!(t.runtimeId&&(t.agentCategory==="mpa"||t.mpaInstanceId))}async function mt(e,t={},n={},i=eo){const r=po(t.signal,i),s=!!n.runtimeId&&String(t.method??"GET").toUpperCase()==="DELETE",o={...t,...s?{method:"POST"}:{},headers:hl(oc(t.headers))},l=()=>{const d={...o,signal:r};if(n.runtimeId){const f=new URLSearchParams;n.region&&f.set("_runtime_region",n.region),n.retryProbe&&f.set("probe_retry","connect"),s&&f.set("_method","DELETE");const h=f.toString()?`${e.includes("?")?"&":"?"}${f.toString()}`:"";return fetch(Na(`${lN}/web/runtime-proxy/${n.runtimeId}${e}${h}`),d)}if(n.base){const f=new Headers(d.headers);return f.set("X-AgentKit-Base",n.base),n.apiKey&&f.set("X-AgentKit-Key",n.apiKey),fetch(Na(`${lN}/agentkit-proxy${e}`),{...d,headers:f})}return fetch(Na(`${lN}${e}`),d)},c=async d=>{if(d.headers.get("X-Studio-Error-Source")==="upstream")return!1;if(Eet(d))return!0;if(d.status!==401)return!1;try{return await vet()}catch{return!1}};let u=await l();for(;await c(u);)await Cet(r),u=await l();return u}function yn(e,t={},n=eo){return mt(e,t,{},n)}function ZAe(e){return typeof e=="string"?e:Array.isArray(e)?e.map(t=>{var n;if(t&&typeof t=="object"&&"msg"in t){const i=Array.isArray(t.loc)?(n=t.loc)==null?void 0:n.join("."):"",r=String(t.msg??"");return i?`${i}: ${r}`:r}return String(t)}).filter(Boolean).join(` -`):e&&typeof e=="object"?JSON.stringify(e):""}async function gtt(e){const t=await e.clone().text().catch(()=>"");if(!t)return"";try{const n=JSON.parse(t),i=n.detail??n.error;if(typeof i=="string")return i;if(i&&typeof i=="object"&&"code"in i)return String(i.code??"")}catch{return""}return""}async function Vt(e,t){const n=e.headers.get("X-Studio-Error-Source"),i=n==="upstream"?e.headers.get("X-Studio-Upstream-Status")??e.status:e.status,r=Q("common.fallbackWithHttpStatus",{fallback:t,status:i}),s=await e.text().catch(()=>"");if(n==="upstream")return Q("client.errorWithCloudResponse",{context:r,action:e.headers.get("X-Studio-Upstream-Action")??"",response:s||Q("client.emptyCloudResponse")});if(!s)return r;try{const o=JSON.parse(s),l=ZAe(o.detail??o.error);return n==="transport"||n==="studio"?l?`${r} -${l}`:r:l?Q("client.errorWithDetailAndRawResponse",{context:r,detail:l,response:s}):Q("client.errorWithRawResponse",{context:r,response:s})}catch{return Q("client.errorWithRawResponse",{context:r,response:s})}}async function btt(e){const t=await Vt(e,Q("client.mpaRuntimeSessionsLoadFailed"));return e.status===401&&/X-Jwt-Token/i.test(t)?Q("client.mpaRuntimeLegacyAuthUnsupported",{detail:t}):t}async function wz(e,t=!1){const n=await mt(`/web/model-api-keys${t?"?refresh=true":""}`,{signal:e,cache:"no-store"});if(!n.ok)throw new Error(await Vt(n,Q("client.loadArkApiKeysFailed")));return await n.json()}async function JAe(e,t){const n=await mt(`/web/model-api-keys/${encodeURIComponent(e)}/value`,{method:"POST",signal:t,cache:"no-store"});if(!n.ok)throw new Error(await Vt(n,Q("client.loadArkApiKeysFailed")));return await n.json()}async function z1(e){const t=new URLSearchParams;e!=null&&e.apiKeyId&&t.set("apiKeyId",e.apiKeyId),e!=null&&e.refresh&&t.set("refresh","true"),e!=null&&e.scope&&t.set("scope",e.scope);const n=t.toString(),i=await mt(`/web/model-options${n?`?${n}`:""}`,{signal:e==null?void 0:e.signal,cache:"no-store"});if(!i.ok)throw new Error(await Vt(i,Q("client.loadModelsFailed")));return await i.json()}async function eTe(){const e=await mt("/list-apps");if(!e.ok)throw new Error(`list-apps failed: ${e.status}`);return e.json()}class V1 extends Error{constructor(){super(Q("client.runtimeAccessDenied")),this.name="RuntimeAccessDeniedError"}}class Ea extends Error{constructor(t,n=!1,i=!1){super(t),this.unsupported=n,this.retryable=i,this.name="RuntimeProbeError"}}const tTe=()=>Q("client.privateRuntimeUnavailable"),nTe=()=>Q("client.runtimeTemporarilyUnavailable"),ZZ=["cn-beijing","cn-shanghai"],ytt=3e4,H1=5*60*1e3,iTe=60*1e3;let oC="volcengine";const iw=new Map,oy=new Map,ly=new Map,ef=new Map,os=new Map;function kz(e,t,n){return`${t}:${e}:${n??""}`}function rTe(e){e!==oC&&os.clear(),oC=e}function UA(e){const t=(e||"").trim();if(oC==="byteplus")return[t&&!t.startsWith("cn-")?t:I8];const n=t&&!t.startsWith("ap-")?t:gz;return ZZ.includes(n)?[n,...ZZ.filter(i=>i!==n)]:[n]}function CD(e){const t=(e||"").trim();return t?[t]:UA()}function Mv(...e){return e.map(t=>String(t??"")).join("")}function kb(e,t,n){const i=e.get(t);return i!=null&&i.value&&Date.now()-i.updatedAt<=n?i.value:null}function Oz(e,t,n){return e.set(t,{value:n,updatedAt:Date.now()}),n}function Y2(e,t){return t?t.aborted?Promise.reject(new DOMException("The operation was aborted.","AbortError")):new Promise((n,i)=>{const r=()=>{i(new DOMException("The operation was aborted.","AbortError"))};t.addEventListener("abort",r,{once:!0}),e.then(s=>{t.removeEventListener("abort",r),n(s)},s=>{t.removeEventListener("abort",r),i(s)})}):e}async function sTe(e){try{const t=await e.clone().json();return typeof t.detail=="string"?t.detail:""}catch{return""}}async function QA(e,t,n,i,r=eo){const s=await mt("/list-apps",{signal:i},n??{base:e,apiKey:t},r),o=n!=null&&n.runtimeId?await sTe(s):"";if(n!=null&&n.runtimeId&&o==="runtime_access_denied")throw new V1;if(n!=null&&n.runtimeId&&o==="runtime_private_endpoint_unreachable")throw new Ea(tTe());if(n!=null&&n.runtimeId&&["runtime_proxy_connect_error","runtime_proxy_timeout","runtime_json_connect_error","runtime_json_timeout"].includes(o))throw new Ea(nTe(),!1,!0);if(n!=null&&n.runtimeId&&s.status===404)throw new Ea(Q("client.runtimeConnectionUnsupported"),!0,!0);if(n!=null&&n.runtimeId&&(s.status===401||s.status===403))throw new Ea(Q("client.runtimeConnectionDenied"));if(!s.ok)throw new Error(await Vt(s,Q("client.listAgentsFailed")));let l;try{l=await s.json()}catch{throw new Ea(Q("client.invalidListAppsJson"))}if(!Array.isArray(l)||l.some(u=>typeof u!="string"||!u.trim()))throw new Ea(Q("client.invalidListAppsFormat"));const c=l.map(u=>u.trim());return n!=null&&n.runtimeId&&iw.set(kz(n.runtimeId,n.region??"",n.runtimeVersion),{apps:c,expiresAt:Date.now()+ytt}),c}async function aTe(e,t){const{app:n,ep:i}=Pa(e);if(Q1(n,i)){const o=await vtt(i),l=await mt(`/api/v1/agents/${encodeURIComponent(o)}/profile-status`,{cache:"no-store"},i),c=!l.ok&&await gtt(l)==="profile_not_found";if(!l.ok&&!c){const m=Q("client.createSessionFailedWithStatus",{status:l.status}),g=await Vt(l,Q("client.createSessionFailed"));throw new Error(g===m?m:Q("common.fallbackWithDetail",{fallback:m,detail:g}))}const u=c?{}:await l.json(),d=Number(u.profileRevision??0),f=await mt("/api/v1/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mpaInstanceId:o,profileRevision:d})},i);if(!f.ok){const m=Q("client.createSessionFailedWithStatus",{status:f.status}),g=await Vt(f,Q("client.createSessionFailed"));throw new Error(g===m?m:Q("common.fallbackWithDetail",{fallback:m,detail:g}))}const h=await f.json();return String(h.sessionId??h.id??"")}const r=await mt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"},i);if(!r.ok){const o=Q("client.createSessionFailedWithStatus",{status:r.status}),l=await Vt(r,Q("client.createSessionFailed"));throw new Error(l===o?o:Q("common.fallbackWithDetail",{fallback:o,detail:l}))}return(await r.json()).id}async function vtt(e){var i,r,s,o;const t=(i=e.mpaInstanceId)==null?void 0:i.trim();if(t)return t;const n=((r=e.runtimeId)==null?void 0:r.trim())??"";if(!n)return"";try{const l=await ID(n,e.region??"cn-beijing"),c=(s=l.mpaInstanceId)==null?void 0:s.trim();if(c)return c;const u=(o=l.envs.find(d=>d.key==="MPA_AGENT_ID"))==null?void 0:o.value.trim();if(u)return u}catch{}return n}async function Sz(e,t){const{app:n,ep:i}=Pa(e);if(Q1(n,i)){const s=await mt("/api/v1/sessions",{cache:"no-store"},i);if(!s.ok)throw new Error(await btt(s));const o=await s.json();return Array.isArray(o)?o:o.sessions??[]}const r=await mt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{},i);if(!r.ok)throw new Error(await Vt(r,Q("client.listSessionsFailed")));return r.json()}async function lC(e,t,n){const{app:i,ep:r}=Pa(e);if(Q1(i,r)){const l=await mt(`/api/v1/sessions/${encodeURIComponent(n)}`,{cache:"no-store"},r);if(!l.ok){const f=await Vt(l,Q("client.getSessionFailed"));throw new Error(Q("client.getSessionFailedWithDetail",{status:l.status,detail:f}))}const c=await l.json(),u=await mt(`/api/v1/sessions/${encodeURIComponent(n)}/events`,{cache:"no-store"},r);if(!u.ok){const f=await Vt(u,Q("client.getSessionFailed"));throw new Error(Q("client.getSessionFailedWithDetail",{status:u.status,detail:f}))}const d=await u.json();return c.events=Array.isArray(d.events)?d.events:[],c}const s=await mt(`/apps/${i}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}`,{},r);if(!s.ok){const l=await Vt(s,Q("client.getSessionFailed"));throw new Error(Q("client.getSessionFailedWithDetail",{status:s.status,detail:l}))}const o=await s.json();if(r.runtimeId){const l=yz(r.runtimeId,i,t,n);o.state={...vz()[l]??{},...o.state??{}}}return o}async function oTe(e){const{app:t,ep:n}=Pa(e.appName);if(!n.runtimeId)throw new Error(Q("client.feedbackRuntimeOnly"));if(!n.region)throw new Error(Q("client.feedbackRegionMissing"));const i=await mt("/web/evaluation/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:n.runtimeId,region:n.region,appName:t,userId:e.userId,sessionId:e.sessionId,eventId:e.eventId,rating:e.rating,comment:e.comment??""})},{},yr);if(!i.ok)throw new Error(await Vt(i,Q("client.submitFeedbackFailed")));const r=await i.json(),s=yz(n.runtimeId,t,e.userId,e.sessionId);return mtt(s,e.eventId,r),r}async function AD(e,t={}){const n=Mv(e.runtimeId,e.region||"cn-beijing",e.appName,e.pageSize??100),i=kb(ef,n,iTe);if(!t.force&&i)return i;const r=ef.get(n);if(!t.force&&(r!=null&&r.promise))return r.promise;let s=null;const o=(async()=>{for(const l of CD(e.region)){const c=new URLSearchParams({runtimeId:e.runtimeId,region:l,appName:e.appName,page_size:String(e.pageSize??100)}),u=await mt(`/web/evaluation/feedback-cases?${c.toString()}`);if(u.ok)return Oz(ef,n,await u.json());s=new Error(await Vt(u,Q("client.loadEvaluationSetsFailed")))}throw s??new Error(Q("client.loadEvaluationSetsFailed"))})();ef.set(n,{...r,promise:o,updatedAt:(r==null?void 0:r.updatedAt)??0});try{return await o}finally{const l=ef.get(n);(l==null?void 0:l.promise)===o&&ef.set(n,{value:l.value,updatedAt:l.updatedAt})}}async function P8(e){let t=null;for(const n of CD(e.region)){const i=new URLSearchParams({runtimeId:e.runtimeId,region:n,appName:e.appName,userId:e.userId}),r=await mt(`/web/evaluation/statuses?${i.toString()}`);if(r.ok)return r.json();t=new Error(await Vt(r,Q("client.loadAutoEvaluationStatusFailed")))}throw t??new Error(Q("client.loadAutoEvaluationStatusFailed"))}async function lTe(e){let t=null;for(const n of CD(e.region)){const i=new URLSearchParams({runtimeId:e.runtimeId,region:n,appName:e.appName}),r=await mt(`/web/evaluation/optimizations?${i.toString()}`);if(r.ok)return r.json();t=new Error(await Vt(r,Q("client.loadOptimizationsFailed")))}throw t??new Error(Q("client.loadOptimizationsFailed"))}function cTe(e){return kb(ef,Mv(e.runtimeId,e.region||"cn-beijing",e.appName,e.pageSize??100),iTe)}function xtt(e){AD(e).catch(()=>{})}function uTe(e){AD(e,{force:!0}).catch(()=>{})}function dTe(e,t){return["good","bad"].map(n=>{const i=e.find(r=>r.kind===n);return{kind:n,evaluationSetId:(i==null?void 0:i.evaluationSetId)??null,evaluationSetName:(i==null?void 0:i.evaluationSetName)??null,workspaceId:(i==null?void 0:i.workspaceId)??null,itemCount:t.filter(r=>r.kind===n).length}})}function cN(e){const t=e.comment??"",n=e.rating==="bad"&&!!t.trim();for(const[i,r]of ef.entries()){const s=r.value;if(!s||s.runtimeId!==e.runtimeId||s.agentName!==e.appName)continue;const o=s.items.filter(c=>c.sessionId!==e.sessionId||c.messageId!==e.messageId),l=e.rating?[{id:`local:${e.runtimeId}:${e.sessionId}:${e.messageId}`,itemKey:`local:${e.messageId}`,kind:e.rating,input:e.input,output:e.output,referenceOutput:e.referenceOutput??e.output,comment:t,agentName:e.appName,sessionId:e.sessionId,messageId:e.messageId,runtimeId:e.runtimeId,invocationId:e.invocationId??"",userId:e.userId,createdAt:e.createdAt??new Date().toISOString(),evaluationSetId:"",evaluationSetName:"",workspaceId:"",source:"user",score:n?0:null,reason:n?t:""},...o]:o;ef.set(i,{value:{...s,sets:dTe(s.sets,l),items:l},updatedAt:Date.now(),promise:r.promise})}}async function fTe(e){let t=null;for(const n of CD(e.region)){const i=await mt("/web/evaluation/feedback-cases/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e.runtimeId,region:n,appName:e.appName,itemIds:e.itemIds})},{},yr);if(i.ok){const r=await i.json(),s=new Set(e.itemIds);for(const[o,l]of ef.entries()){const c=l.value;if(!c||c.runtimeId!==e.runtimeId||c.agentName!==e.appName)continue;const u=c.items.filter(d=>!s.has(d.id));ef.set(o,{value:{...c,sets:dTe(c.sets,u),items:u},updatedAt:Date.now()})}return r}t=new Error(await Vt(i,Q("client.deleteEvaluationCaseFailed")))}throw t??new Error(Q("client.deleteEvaluationCaseFailed"))}async function D8(e,t,n){const{app:i,ep:r}=Pa(e);if(Q1(i,r)){const o=await mt(`/api/v1/sessions/${encodeURIComponent(n)}`,{method:"DELETE"},r);if(!o.ok&&o.status!==404)throw new Error(`delete session failed: ${o.status}`);return}const s=await mt(`/apps/${i}/users/${encodeURIComponent(t)}/sessions/${n}`,{method:"DELETE"},r);if(!s.ok&&s.status!==404)throw new Error(`delete session failed: ${s.status}`)}function wtt(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"="),i=window.atob(n),r=new Uint8Array(i.length);for(let s=0;sURL.revokeObjectURL(l),0)}async function pTe(e,t,n,i,r){const{app:s,ep:o}=Pa(e),l=r==null?"":`?version=${encodeURIComponent(r)}`,c=`/apps/${encodeURIComponent(s)}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}/artifacts/${encodeURIComponent(i)}${l}`,u=await mt(c,{},o,yr);if(!u.ok)throw new Error(await Vt(u,Q("client.downloadFileFailed")));const d=await u.json(),f=d.inlineData??d.inline_data;if(!(f!=null&&f.data))throw new Error(Q("client.fileUnavailable"));const h=wtt(f.data),m=h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength);return{blob:new Blob([m],{type:f.mimeType??f.mime_type??"application/octet-stream"}),downloadName:f.displayName??f.display_name??i}}async function Cz(e,t,n,i,r){const{blob:s}=await pTe(e,t,n,i,r);return URL.createObjectURL(s)}async function ktt(e){const t=await mt("/web/media/capabilities");if(!t.ok)throw new Error(await Vt(t,"media capabilities failed"));return t.json()}async function mTe(e,t,n,i){const{app:r}=Pa(e),s=new FormData;s.set("app_name",r),s.set("user_id",t),s.set("session_id",n),s.set("file",i);const o=await mt("/web/media",{method:"POST",body:s},{},yr);if(!o.ok)throw new Error(await Vt(o,Q("client.uploadFileFailed")));return{...await o.json(),status:"ready"}}async function M8(e,t,n){const{app:i}=Pa(e),r=`/web/media/${encodeURIComponent(i)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}/delete`,s=await mt(r,{method:"POST"});if(!s.ok&&s.status!==404)throw new Error(await Vt(s,"media cleanup failed"))}function gTe(e){try{const t=new URL(e);if(t.protocol!=="veadk-media:"||t.hostname!=="apps")return;const n=t.pathname.split("/").filter(Boolean).map(decodeURIComponent);return n.length!==7||n[1]!=="users"||n[3]!=="sessions"||n[5]!=="media"?void 0:`/web/media/${n.map(encodeURIComponent).filter((i,r)=>![1,3,5].includes(r)).join("/")}`}catch{return}}async function uN(e,t){const n=gTe(t);if(!n)throw new Error("Invalid VeADK media URI");const i=await mt(`${n}/delete`,{method:"POST"});if(!i.ok&&i.status!==404)throw new Error(await Vt(i,"media cleanup failed"))}function bTe(e,t){if(t.startsWith("data:")||t.startsWith("blob:")||/^https?:/.test(t))return t;const n=gTe(t);if(!n)return t;const i=`${n}/content`;return Na(`${lN}${i}`)}async function ZR(e,t,n){const{app:i,ep:r}=Pa(e);let s;if(r.runtimeId){const c=new URLSearchParams({runtimeId:r.runtimeId,sessionId:t,region:r.region??"cn-beijing"});if(n&&c.set("endTimeMs",String(Math.round(n))),s=await mt(`/web/runtime-trace?${c.toString()}`),s.status===404)throw new Error(Q("client.traceDisabled"))}else s=await mt(`/dev/apps/${encodeURIComponent(i)}/debug/trace/session/${encodeURIComponent(t)}`,{},r);if(!s.ok)throw new Error(await Vt(s,Q("client.loadTraceFailed")));const o=s.headers.get("content-type")??"";if(!o.includes("application/json")){const c=o.split(";",1)[0]||Q("client.contentTypeMissing");throw new Error(Q("client.traceNonJson",{contentType:c}))}const l=await s.json();if(!Array.isArray(l))throw new Error(Q("client.invalidTraceFormat"));return l}async function L8(e){const t=await mt("/web/issue-feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await Vt(t,Q("client.submitIssueFeedbackFailed")));if((await t.json()).submitted!==!0)throw new Error(Q("client.issueFeedbackNotConfirmed"));return{submitted:!0}}async function JZ(e,t,n=!0,i){const r=await mt(`/web/agent-info/${e}`,{signal:i},t);if(!r.ok)throw new Error(`agent-info failed: ${r.status}`);const s=await r.json();if(n&&!s.draft)try{const o=await mt(`/web/agent-draft/${e}`,{},t);if(o.ok){const l=await o.json();s.draft=l.draft}}catch{}return{appName:e,agentCategory:s.agentCategory,mpa:s.mpa,name:s.name??e,description:s.description??"",type:s.type,model:s.model??"",selectableModels:s.selectableModels??[],turnLifecycleControl:s.turnLifecycleControl,resourceTopology:s.resourceTopology,tools:s.tools??[],skillsPreviewSupported:Array.isArray(s.skills),skills:s.skills??[],subAgents:s.subAgents??[],components:s.components??[],searchSources:s.searchSources??[],graph:s.graph,draft:s.draft}}function Ott(e){return/agent-info failed:\s*404\b/i.test(String(e))}async function yTe(e,t,n=!0,i){try{return await JZ(e,t,n,i)}catch(r){if(e==="a2a-default"||!Ott(r))throw r;return JZ("a2a-default",t,n,i)}}class TD extends Error{constructor(t){super("Turn state changed before the control request completed"),this.authoritativeState=t,this.name="TurnControlConflictError"}}async function vTe(e,t){const{ep:n}=Pa(e),i=await mt(`/api/v1/a2a/tasks/by-session/${encodeURIComponent(t)}/control`,{cache:"no-store"},n);if(!i.ok)throw new Error(await Vt(i,"turn control failed"));return i.json()}async function xTe(e,t,n,i){var o;const{ep:r}=Pa(e),s=await mt(`/api/v1/a2a/tasks/by-session/${encodeURIComponent(t)}/control/${n}`,{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":crypto.randomUUID()},body:JSON.stringify({expectedGeneration:i})},r);if(s.status===409){const l=await s.json().catch(()=>null);if((o=l==null?void 0:l.detail)!=null&&o.taskId)throw new TD(l.detail)}if(!s.ok)throw new Error(await Vt(s,"turn control failed"));return s.json()}async function Stt(e,t,n,i,r){var c;const{ep:s}=Pa(e),o=await mt(`/api/v1/a2a/tasks/${encodeURIComponent(n)}/continue`,{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":r},body:JSON.stringify({expectedGeneration:i})},s);if(o.status===409){const u=await o.json().catch(()=>null);if((c=u==null?void 0:u.detail)!=null&&c.taskId)throw new TD(u.detail)}if(!o.ok)throw new Error(await Vt(o,"turn continue failed"));const l=await o.json();if(l.sessionId!==t)throw new Error("turn continue returned a different session");return l}async function*wTe({appName:e,sessionId:t,taskId:n,expectedGeneration:i,idempotencyKey:r,lastEventId:s,signal:o,onRuntimeContext:l}){const{ep:c}=Pa(e),u=(s==null?void 0:s.trim())??"",d=_z(o);let f;try{const g=await mt(`/api/v1/a2a/tasks/${encodeURIComponent(n)}/continue`,{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":r},body:JSON.stringify({expectedGeneration:i}),signal:d.signal},c,0),b=YR(g,c.runtimeId??"",c.region??"");if(b&&(l==null||l(b)),!g.ok){d.cleanup();const y=await Vt(g,"turn continue failed");throw new Error(nl(Q("client.runSseFailedWithDetail",{status:g.status,detail:y})))}const v=await g.json();if(v.sessionId!==t)throw d.cleanup(),new Error(nl("turn continue returned a different session"));f=await mt(`/api/v1/sessions/${encodeURIComponent(t)}/sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invocationId:v.invocationId,...u?{lastEventId:u}:{}}),signal:d.signal},c,0)}catch(g){throw d.cleanup(),d.timedOut()?new Error(Wg()):o!=null&&o.aborted||(g==null?void 0:g.name)==="AbortError"?g:new Error(nl(g))}const h=YR(f,c.runtimeId??"",c.region??"");if(h&&(l==null||l(h)),!f.ok){d.cleanup();const g=await Vt(f,Q("client.runSessionFailed"));throw new Error(nl(Q("client.runSseFailedWithDetail",{status:f.status,detail:g})))}let m=!1;try{for await(const g of BA(f)){if(g&&typeof g=="object"&&g[aC]==="done"){d.clearDeadline();break}m=!0,d.clearDeadline();const b={...g};delete b[aC],typeof b.error=="string"&&(b.error=nl(b.error)),typeof b.errorMessage=="string"&&(b.errorMessage=nl(b.errorMessage)),typeof b.error_message=="string"&&(b.error_message=nl(b.error_message)),yield b}}catch(g){throw d.timedOut()?new Error(Wg()):o!=null&&o.aborted||(g==null?void 0:g.name)==="AbortError"?g:new Error(nl(g))}finally{d.cleanup()}if(!m)throw new Error(Tz())}async function $8(e,t){const{app:n,ep:i}=Pa(e);return yTe(n,i,!1,t)}async function Ett(e,t,n){let i=null;for(const r of UA(t)){const s={runtimeId:e,region:r};try{const o=kz(e,r),l=iw.get(o);l&&l.expiresAt<=Date.now()&&iw.delete(o);const c=iw.get(o),u=n||(c==null?void 0:c.apps[0])||(await QA("","",s))[0];if(!u)throw new Error(Q("client.noPreviewableAgent"));return yTe(u,s)}catch(o){if(o instanceof V1||o instanceof Ea&&!o.unsupported)throw o;i=o instanceof Error?o:new Error(String(o))}}throw i??new Error(Q("client.noPreviewableAgent"))}async function Az(e,t,n={},i={}){const r=typeof n=="string"?n:void 0,s=typeof n=="string"?i:n,o=Mv(e,t||"cn-beijing",r??""),l=kb(oy,o,H1);if(!s.force&&l)return l;const c=oy.get(o);if(!s.force&&(c!=null&&c.promise))return c.promise;const u=Ett(e,t,r).then(d=>Oz(oy,o,d));oy.set(o,{...c,promise:u,updatedAt:(c==null?void 0:c.updatedAt)??0});try{return await u}finally{const d=oy.get(o);(d==null?void 0:d.promise)===u&&oy.set(o,{value:d.value,updatedAt:d.updatedAt})}}function kTe(e,t,n=""){return kb(oy,Mv(e,t||"cn-beijing",n),H1)}function OTe(e,t,n=""){Az(e,t,n).catch(()=>{})}function JR(e){const{app:t,ep:n}=Pa(e);return Q1(t,n)}function ap(e){const{app:t,ep:n}=Pa(e);return t==="a2a-default"&&!!(n.runtimeId&&(n.agentCategory==="mpa"||n.mpaInstanceId))}async function STe(e,t,n,i){const{app:r,ep:s}=Pa(e),o=new URLSearchParams({source:t,app_name:r,q:n,user_id:i}),l=await mt(`/web/search?${o.toString()}`,{},s);if(!l.ok)throw new Error(await Vt(l,Q("client.agentSearchFailed")));return l.json()}async function ETe(e,t){const{app:n}=Pa(e),i=await mt(`/web/search?source=web&app_name=${encodeURIComponent(n)}&q=${encodeURIComponent(t)}`);if(!i.ok)throw new Error(`web search failed: ${i.status}`);return i.json()}function Tz(){return nl(Q("client.emptySseBody"))}function fS(){return nl(Q("client.noDisplayableSseReply"))}const Ctt=6e4;function Wg(){return Q("client.firstSseEventTimeout")}function _z(e){if(e!=null&&e.aborted)return{signal:e,clearDeadline:()=>{},cleanup:()=>{},timedOut:()=>!1};const t=new AbortController;let n=!1,i=!1;const r=()=>{i||(i=!0,clearTimeout(o))},s=()=>{t.signal.aborted||t.abort((e==null?void 0:e.reason)??new DOMException("Aborted","AbortError"))},o=setTimeout(()=>{i||t.signal.aborted||(n=!0,i=!0,t.abort(new Error(Wg())))},Ctt);return e==null||e.addEventListener("abort",s,{once:!0}),{signal:t.signal,clearDeadline:r,cleanup:()=>{r(),e==null||e.removeEventListener("abort",s)},timedOut:()=>n}}async function*F8({appName:e,userId:t,sessionId:n,text:i,modelId:r,idempotencyKey:s,executionConfigVersion:o,lastEventId:l,attachments:c=[],invocation:u,platformTools:d,environmentMounts:f,environmentMount:h,functionResponses:m=[],signal:g,onRuntimeContext:b}){const{app:v,ep:y}=Pa(e),w=c.flatMap(I=>I.status&&I.status!=="ready"?[]:I.uri?[{fileData:{mimeType:I.mimeType,fileUri:I.uri,displayName:I.name},partMetadata:{veadkMedia:{id:I.id,uri:I.uri,name:I.name,mimeType:I.mimeType,sizeBytes:I.sizeBytes}}}]:I.data?[{inlineData:{mimeType:I.mimeType,data:I.data,displayName:I.name}}]:[]),x=u&&(u.skills.length>0||u.targetAgent)?u:void 0,k=[...w,...m.map(I=>({functionResponse:{id:I.id,name:I.name,response:I.response}})),...i.trim()?[{text:i}]:[]];if(x&&k.length>0){const I=k[0],D=I.partMetadata;k[0]={...I,partMetadata:{...D,veadkInvocation:x}}}const S=(s==null?void 0:s.trim())??"",O=(l==null?void 0:l.trim())??"",A=typeof o=="number",E=A||S?{veadkExecution:{...A?{executionConfigVersion:o}:{},...S?{idempotencyKey:S}:{}}}:void 0,j=x||E?{...x?{veadkInvocation:x}:{},...E??{}}:void 0,T=Q1(v,y);if(T&&y.runtimeId){const I=y.region?`?region=${encodeURIComponent(y.region)}`:"";try{const D=await yn(`/web/mpa/identity-prewarm/${encodeURIComponent(y.runtimeId)}${I}`,{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest"},signal:g},1e4);D.ok||console.warn("[mpa] identity prewarm unavailable",D.status)}catch(D){if(g!=null&&g.aborted)throw D;console.warn("[mpa] identity prewarm unavailable")}}let R;const C=_z(g);try{if(T){const I=await mt(`/api/v1/sessions/${encodeURIComponent(n)}/run`,{method:"POST",headers:{"Content-Type":"application/json",...S?{"Idempotency-Key":S}:{}},body:JSON.stringify({content:i,...A?{executionConfigVersion:o}:{}}),signal:C.signal},y,0),D=YR(I,y.runtimeId??"",y.region??"");if(D&&(b==null||b(D)),!I.ok){C.cleanup();const L=await Vt(I,Q("client.runSessionFailed"));throw new Error(nl(Q("client.runSseFailedWithDetail",{status:I.status,detail:L})))}const _=await I.json();R=await mt(`/api/v1/sessions/${encodeURIComponent(n)}/sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invocationId:_.invocationId,...O?{lastEventId:O}:{}}),signal:C.signal},y,0)}else R=await mt("/run_sse",{method:"POST",headers:{"Content-Type":"application/json",...S?{"Idempotency-Key":S}:{}},body:JSON.stringify({app_name:v,user_id:t,session_id:n,new_message:{role:"user",parts:k},streaming:!0,...O?{lastEventId:O}:{},...A?{executionConfigVersion:o}:{},...r!=null&&r.trim()?{model_id:r.trim()}:{},...d!==void 0?{platform_tools:[...d]}:{},...f!==void 0?{environment_mounts:[...f]}:h?{environment_mount:h}:{},custom_metadata:j}),signal:C.signal},y,0)}catch(I){throw C.cleanup(),C.timedOut()?new Error(Wg()):g!=null&&g.aborted||(I==null?void 0:I.name)==="AbortError"?I:new Error(nl(I))}const N=YR(R,y.runtimeId??"",y.region??"");if(N&&(b==null||b(N)),!R.ok){C.cleanup();const I=await Vt(R,Q("client.runSessionFailed"));throw new Error(nl(Q("client.runSseFailedWithDetail",{status:R.status,detail:I})))}let P=!1;try{for await(const I of BA(R)){if(I&&typeof I=="object"&&I[aC]==="done"){C.clearDeadline();break}P=!0,C.clearDeadline();const D={...I};delete D[aC],typeof D.error=="string"&&(D.error=nl(D.error)),typeof D.errorMessage=="string"&&(D.errorMessage=nl(D.errorMessage)),typeof D.error_message=="string"&&(D.error_message=nl(D.error_message)),yield D}}catch(I){throw C.timedOut()?new Error(Wg()):g!=null&&g.aborted||(I==null?void 0:I.name)==="AbortError"?I:new Error(nl(I))}finally{C.cleanup()}if(!P)throw new Error(Tz())}class rw extends Error{constructor(n,{status:i,code:r,currentState:s}){super(n);Zt(this,"status");Zt(this,"code");Zt(this,"currentState");this.name="MpaExecutionConfigRequestError",this.status=i,this.code=r,this.currentState=s}}async function jz(e){const t=Q("client.mpaExecutionConfigFailed"),n=await e.text().catch(()=>"");if(!n)return new rw(Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),{status:e.status,code:""});try{const i=JSON.parse(n),r=i.error&&typeof i.error=="object"?i.error:i.detail&&typeof i.detail=="object"?i.detail:null,s=ZAe(i.detail??i.error),o=s?Q("client.errorWithDetailAndRawResponse",{context:Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),detail:s,response:n}):Q("client.errorWithRawResponse",{context:Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),response:n});return new rw(o,{status:e.status,code:String((r==null?void 0:r.code)??""),currentState:(r==null?void 0:r.currentState)??i.currentState})}catch{return new rw(Q("client.errorWithRawResponse",{context:Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),response:n}),{status:e.status,code:""})}}function zA(e){var r,s,o;const t=(e.selectedSkills??[]).map(l=>({source:l.source,folder:l.folder,name:l.name,skillSpaceId:l.skillSpaceId,skillSpaceName:l.skillSpaceName,skillSpaceRegion:l.skillSpaceRegion,skillId:l.skillId,version:l.version})),n=(e.skills??[]).map(l=>({name:l})),i=(e.mcpTools??[]).map(l=>({name:l.name,transport:l.transport,url:l.url}));return{name:((r=e.name)==null?void 0:r.trim())||"mpa-agent",description:e.description??"",system:((s=e.instruction)==null?void 0:s.trim())||"You are a helpful assistant.",model:{id:e.modelName||e.model||"",source:e.modelSource??"ark",provider:e.modelProvider??"",apiBase:e.modelApiBase??""},tools:[...(e.builtinTools??[]).map(l=>({id:l,source:"builtin"})),...(e.tools??[]).map(l=>({name:l,source:"legacy"})),...(e.customTools??[]).map(l=>({name:l.name,description:l.description,source:"custom"}))],skills:[...t,...n],mcpServers:i,...(o=e.subAgents)!=null&&o.length?{multiagent:{type:e.agentType??"llm",subAgents:e.subAgents.map(zA)}}:{},metadata:{"veadk:agent-type":"mpa","veadk:source":"studio-agent-draft",agentType:e.agentType??"llm"}}}async function Nz(e){const t={operationKind:e.operationKind,runtimeId:e.runtimeId,region:e.region,mpaInstanceId:e.mpaInstanceId,sourceProfileId:e.sourceProfileId,targetKey:e.targetKey,runtimeRevision:e.runtimeRevision,profile:zA(e.draft)},n=e.operationKind==="update"?`/web/mpa/agents/${encodeURIComponent(e.mpaInstanceId)}`:"/web/mpa/agents",i=await mt(n,{method:e.operationKind==="update"?"PATCH":"POST",headers:{"Content-Type":"application/json","Idempotency-Key":e.idempotencyKey},body:JSON.stringify(t)});if(!i.ok)throw new Error(await Vt(i,Q("client.mpaOperationFailed")));return await i.json()}async function eI(e){var r,s,o,l;const t=e.runtimeId.trim(),n=((r=e.mpaInstanceId)==null?void 0:r.trim())||t,i=(s=e.sourceDraftId)!=null&&s.trim()?`studio-draft:${e.sourceDraftId.trim()}`:`studio-agent:${e.agentName}:${e.taskId}`;return Nz({operationKind:e.operationKind,runtimeId:t,region:e.region,mpaInstanceId:n,sourceProfileId:i,draft:e.draft,targetKey:e.operationKind==="update"?n:`runtime:${e.region}:${((o=e.runtimeName)==null?void 0:o.trim())||n}`,runtimeRevision:((l=e.runtimeRevision)==null?void 0:l.trim())||void 0,idempotencyKey:`${e.taskId}:mpa-profile`})}async function CTe(){const e=await mt("/web/mpa/agent-operations?status=active",{cache:"no-store"});if(!e.ok)throw new Error(await Vt(e,Q("client.mpaOperationLoadFailed")));return(await e.json()).operations??[]}async function ATe(e,t){const n=await mt(`/web/mpa/agent-operations/${encodeURIComponent(e)}`,{cache:"no-store",signal:t});if(!n.ok)throw new Error(await Vt(n,Q("client.mpaOperationLoadFailed")));return await n.json()}async function TTe(e){const t=new URLSearchParams({runtimeId:e.runtimeId,region:e.region}),n=await mt(`/web/mpa/agents/${encodeURIComponent(e.mpaInstanceId)}/profile-status?${t.toString()}`,{cache:"no-store",signal:e.signal});if(!n.ok)throw new Error(await Vt(n,Q("client.mpaOperationLoadFailed")));const i=await n.json();return{operationId:String(i.operationId??""),status:String(i.status??""),profileRevision:Number(i.profileRevision??0),runtimeRevision:String(i.runtimeRevision??""),etag:String(i.etag??n.headers.get("ETag")??"")}}async function _Te(e){const t=new URLSearchParams({region:e.region??"all"});e.runtimeId&&t.set("runtimeId",e.runtimeId);const n=await mt(`/web/mpa/agents/${encodeURIComponent(e.mpaInstanceId)}/view?${t.toString()}`,{cache:"no-store",signal:e.signal});if(!n.ok)throw new Error(await Vt(n,Q("client.mpaOperationLoadFailed")));return await n.json()}async function jTe(e){const t=new URLSearchParams({runtimeId:e.runtimeId,region:e.region}),n=await mt(`/web/mpa/agents/${encodeURIComponent(e.mpaInstanceId)}/delete-preview?${t.toString()}`,{cache:"no-store",signal:e.signal});if(!n.ok)throw new Error(await Vt(n,Q("client.mpaDeletePreviewFailed")));return await n.json()}async function NTe(e){const t={runtimeId:e.runtimeId,region:e.region},n=await mt(`/api/v1/runtime-console/admin/sessions/${encodeURIComponent(e.sessionId)}/runs`,{cache:"no-store",signal:e.signal},t);if(!n.ok)throw new Error(await Vt(n,Q("client.loadMpaDiagnosticsFailed")));return await n.json()}async function RTe(e){const t={runtimeId:e.runtimeId,region:e.region},n=new URLSearchParams({sessionId:e.sessionId}),i=await mt(`/api/v1/runtime-console/admin/runs/${encodeURIComponent(e.invocationId)}/trace?${n.toString()}`,{cache:"no-store",signal:e.signal},t);if(!i.ok)throw new Error(await Vt(i,Q("client.loadMpaDiagnosticsFailed")));return await i.json()}async function Rz(e,t){const n=await mt(`/web/mpa/agent-operations/${encodeURIComponent(e)}/retry`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operationKind:t.operationKind,runtimeId:t.runtimeId,region:t.region,mpaInstanceId:t.mpaInstanceId,sourceProfileId:t.sourceProfileId,targetKey:t.targetKey,runtimeRevision:t.runtimeRevision,profile:zA(t.draft)})});if(!n.ok)throw new Error(await Vt(n,Q("client.mpaOperationFailed")));return await n.json()}async function Iz(e){const t=new URLSearchParams({runtimeId:e.runtimeId,region:e.region}),n=await mt(`/web/mpa/sessions/${encodeURIComponent(e.sessionId)}/execution-config?${t.toString()}`,{cache:"no-store",signal:e.signal});if(!n.ok)throw await jz(n);return await n.json()}async function B8(e){const t=await mt(`/web/mpa/sessions/${encodeURIComponent(e.sessionId)}/execution-config`,{method:"PATCH",headers:{"Content-Type":"application/json","If-Match":e.etag},body:JSON.stringify({runtimeId:e.runtimeId,region:e.region,changes:e.changes})});if(!t.ok)throw await jz(t);return await t.json()}async function ITe(e){const t=await mt(`/web/mpa/sessions/${encodeURIComponent(e.sessionId)}/profile-upgrade`,{method:"POST",headers:{"Content-Type":"application/json","If-Match":e.etag,"Idempotency-Key":e.idempotencyKey},body:JSON.stringify({runtimeId:e.runtimeId,region:e.region,targetProfileRevision:e.targetProfileRevision})});if(!t.ok)throw await jz(t);return await t.json()}async function _D(e,t){const n=new URLSearchParams({name:e,region:t}),i=await mt(`/web/runtime-name-availability?${n.toString()}`,{cache:"no-store"});if(!i.ok)throw new Error(await Vt(i,Q("client.checkRuntimeNameFailed")));const r=await i.json();if(typeof r.available!="boolean")throw new Error(Q("client.invalidRuntimeNameCheck"));return{available:r.available}}async function PTe(e,t){const n=new URLSearchParams({kind:e.kind,region:e.region});e.registry&&n.set("registry",e.registry),e.namespace&&n.set("namespace",e.namespace),e.workspaceId&&n.set("workspaceId",e.workspaceId),e.search&&n.set("search",e.search),e.namePrefix&&n.set("namePrefix",e.namePrefix),e.pageNumber&&n.set("pageNumber",String(e.pageNumber)),e.pageSize&&n.set("pageSize",String(e.pageSize));const i=await mt(`/web/deployment-resources?${n.toString()}`,{signal:t});if(!i.ok)throw new Error(await Vt(i,Q("client.loadCloudResourcesFailed")));const r=await i.json();if(typeof r.serviceRegion!="string"||!Array.isArray(r.items)||typeof r.pageNumber!="number"||typeof r.pageSize!="number"||typeof r.totalCount!="number"||typeof r.hasMore!="boolean")throw new Error(Q("client.invalidCloudResources"));const s=r.items.map(o=>{if(!o||typeof o!="object"||typeof o.id!="string"||typeof o.name!="string"||typeof o.region!="string"||typeof o.status!="string")throw new Error(Q("client.invalidCloudResources"));return o});return{serviceRegion:r.serviceRegion,items:s,pageNumber:r.pageNumber,pageSize:r.pageSize,totalCount:r.totalCount,hasMore:r.hasMore}}function DTe(e,t){const n=e;if(!n||typeof n!="object"||!Array.isArray(n.mounts))throw new Error(Q("client.invalidEnvironmentMount"));if(n.mounts.length!==t.length)throw new Error(Q("client.environmentMountMismatch"));return n.mounts.map((i,r)=>{const s=t[r];if(!i||typeof i!="object"||typeof i.environment_id!="string"||typeof i.environment_version_id!="string"||typeof i.mount_instance_id!="string"||typeof i.sandbox_session_id!="string"||!i.environment_id||!i.environment_version_id||!i.mount_instance_id||!i.sandbox_session_id)throw new Error(Q("client.invalidEnvironmentMount"));if(i.environment_id!==s.environment_id||i.environment_version_id!==s.environment_version_id||s.mount_instance_id!==void 0&&i.mount_instance_id!==s.mount_instance_id)throw new Error(Q("client.environmentMountMismatch"));return i})}async function MTe({runtimeId:e,appName:t,userId:n,sessionId:i,environmentMounts:r}){const{app:s}=Pa(t);let o;try{o=await mt("/web/v3/session-environment-mounts/prepare",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtime_id:e,app_name:s,user_id:n,session_id:i,environment_mounts:[...r]})})}catch(l){throw l instanceof TypeError?new Error(Q("client.environmentMountNetworkFailed")):l}if(!o.ok)throw new Error(await Vt(o,Q("client.environmentMountFailed")));return DTe(await o.json(),r)}function Pz(e){const t=new Set,n=[];for(const i of e.split(/[,,\n\r]+/)){const r=i.trim();!r||t.has(r)||(t.add(r),n.push(r))}return n}async function LTe(e,t=typeof navigator>"u"?void 0:navigator.clipboard){if(!(t!=null&&t.writeText))throw new Error(Q("client.clipboardUnsupported"));try{await t.writeText(e)}catch{throw new Error(Q("client.clipboardWriteFailed"))}}const eJ={codex:0,codex_snapshot:1,deepseek_harness:2,deepseek_harness_snapshot:3,openclaw:4,openclaw_snapshot:5,hermes:6,hermes_snapshot:7,dev:8};async function $Te(e){var r;const t=await mt("/web/system-info",{signal:e});if(!t.ok)throw new Error(await Vt(t,Q("client.loadSystemInfoFailed")));const n=await t.json();if(typeof((r=n.storage)==null?void 0:r.tosAddress)!="string"||!Array.isArray(n.sandboxTools))throw new Error(Q("client.invalidSystemInfo"));const i=n.sandboxTools.map(s=>{if(!s||typeof s!="object"||typeof s.kind!="string"||typeof s.label!="string"||typeof s.toolId!="string"||typeof s.snapshot!="boolean"||typeof s.needsModelEnvUpdate!="boolean"||typeof s.canUpdateModelEnv!="boolean"||typeof s.modelEnvError!="string"||typeof s.modelEnvErrorCode!="string")throw new Error(Q("client.invalidSystemInfo"));return s}).sort((s,o)=>(eJ[s.kind]??Number.MAX_SAFE_INTEGER)-(eJ[o.kind]??Number.MAX_SAFE_INTEGER));return{storage:{tosAddress:n.storage.tosAddress},sandboxTools:i}}const FTe=new Set(["preparing","queued","building","scanning","available","failed"]);function Dz(e){if(e===null)return null;if(!e||typeof e!="object")throw new Error(Q("client.invalidEnvironmentBuild"));const t=e;if(typeof t.versionId!="string"||!FTe.has(t.status)||typeof t.image!="string"||typeof t.error!="string"||typeof t.createdAt!="string"||typeof t.updatedAt!="string"||t.resources!==null&&typeof t.resources!="object")throw new Error(Q("client.invalidEnvironmentBuild"));const n=Array.isArray(t.steps)?t.steps.map(i=>{if(!i||typeof i!="object"||typeof i.key!="string"||typeof i.label!="string"||!["pending","running","succeeded","failed"].includes(i.status)||i.startedAt!==null&&typeof i.startedAt!="string"||i.finishedAt!==null&&typeof i.finishedAt!="string")throw new Error(Q("client.invalidEnvironmentBuildStep"));return i}):[];return{...t,toolId:typeof t.toolId=="string"?t.toolId:"",toolStatus:["creating","ready","failed"].includes(t.toolStatus)?t.toolStatus:"",runId:typeof t.runId=="string"?t.runId:"",currentStep:typeof t.currentStep=="string"?t.currentStep:"",sourceCommitSha:typeof t.sourceCommitSha=="string"?t.sourceCommitSha:"",steps:n,progressError:typeof t.progressError=="string"?t.progressError:"",logTail:typeof t.logTail=="string"?t.logTail:"",logTruncated:t.logTruncated===!0,logUpdatedAt:typeof t.logUpdatedAt=="string"?t.logUpdatedAt:null,logError:typeof t.logError=="string"?t.logError:""}}function BTe(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidEnvironmentManifest"));const t=e;if(!["agentkit.studio/v3","agentkit.studio/v1alpha1"].includes(t.apiVersion)||t.kind!=="Environment"||!t.metadata||typeof t.metadata.id!="string"||typeof t.metadata.name!="string"||typeof t.metadata.version!="string"||typeof t.metadata.description!="string"||!t.spec||typeof t.spec.image!="string"||!["ubuntu","aio-sandbox","codex-sandbox"].includes(t.spec.baseEnvironment)||typeof t.spec.baseImage!="string"||!["ubuntu-22.04","ubuntu-24.04"].includes(t.spec.operatingSystem)||!["python-3.10","python-3.12"].includes(t.spec.language)||t.spec.executionRuntime!=="veadk"||!Array.isArray(t.spec.packages)||!t.spec.packages.every(n=>typeof n=="string")||!Array.isArray(t.spec.capabilities)||!t.spec.capabilities.every(n=>typeof n=="string")||!Array.isArray(t.spec.skills)||!t.status||!FTe.has(t.status.phase)||typeof t.status.createdAt!="string"||typeof t.status.updatedAt!="string")throw new Error(Q("client.invalidEnvironmentManifest"));return t}function UTe(e){if(e==null)return;if(!e||typeof e!="object")throw new Error(Q("client.invalidImageRepository"));const t=e;if(typeof t.region!="string"||typeof t.registry!="string"||typeof t.namespace!="string"||typeof t.repository!="string")throw new Error(Q("client.invalidImageRepository"));return t}function Att(e){if(e==null)return;if(!e||typeof e!="object")throw new Error(Q("client.invalidCodeRepository"));const t=e;if(typeof t.repositoryUrl!="string"||t.ref!==void 0&&typeof t.ref!="string"||typeof t.dockerfilePath!="string")throw new Error(Q("client.invalidCodeRepository"));return t}function Ttt(e){const t=UTe(e);if(!t)return;const n=e;if(typeof n.reference!="string")throw new Error(Q("client.invalidImageSource"));return{...t,reference:n.reference}}function Mz(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidEnvironment"));const t=e;if(typeof t.id!="string"||typeof t.name!="string"||typeof t.description!="string"||t.baseEnvironment!==void 0&&t.baseEnvironment!=="ubuntu"&&t.baseEnvironment!=="aio-sandbox"&&t.baseEnvironment!=="codex-sandbox"||t.operatingSystem!=="ubuntu-22.04"&&t.operatingSystem!=="ubuntu-24.04"||t.language!=="python-3.10"&&t.language!=="python-3.12"||!Array.isArray(t.optionIds)||!t.optionIds.every(n=>typeof n=="string")||t.selectedSkills!==void 0&&!Array.isArray(t.selectedSkills)||typeof t.dockerfile!="string"||typeof t.createdAt!="string"||typeof t.updatedAt!="string")throw new Error(Q("client.invalidEnvironment"));return{...t,baseEnvironment:t.baseEnvironment==="aio-sandbox"?"aio-sandbox":t.baseEnvironment==="codex-sandbox"?"codex-sandbox":"ubuntu",selectedSkills:t.selectedSkills??[],gitSource:Att(t.gitSource),containerRepository:UTe(t.containerRepository),imageSource:Ttt(t.imageSource),latestVersion:Dz(t.latestVersion)}}function QTe(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidWorkspace"));const t=e;if(typeof t.id!="string"||typeof t.name!="string"||typeof t.description!="string"||!Array.isArray(t.environmentIds)||!t.environmentIds.every(n=>typeof n=="string")||typeof t.createdAt!="string"||typeof t.updatedAt!="string")throw new Error(Q("client.invalidWorkspace"));return t}async function Lz(e){const t=await mt("/web/workspaces",{signal:e});if(!t.ok)throw new Error(await Vt(t,Q("client.loadWorkspacesFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(Q("client.invalidWorkspaceList"));return n.items.map(QTe)}async function zTe(e,t,n,i){const r=await mt(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:i});if(!r.ok)throw new Error(await Vt(r,Q("client.saveWorkspaceFailed")));return QTe(await r.json())}function VTe(e,t){return zTe("/web/workspaces","POST",e,t)}function HTe(e,t,n){return zTe(`/web/workspaces/${encodeURIComponent(e)}`,"PATCH",t,n)}async function qTe(e,t){const n=await mt(`/web/workspaces/${encodeURIComponent(e)}`,{method:"DELETE",signal:t});if(!n.ok)throw new Error(await Vt(n,Q("client.deleteWorkspaceFailed")))}async function VA(e){const t=await mt("/web/v3/environments",{signal:e});if(!t.ok)throw new Error(await Vt(t,Q("client.loadEnvironmentsFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(Q("client.invalidEnvironmentList"));return n.items.map(Mz)}async function WTe(e,t){const n=await mt("/web/v3/environment-repositories/inspect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw new Error(await Vt(n,Q("client.probeRepositoryFailed")));const i=await n.json();if(typeof i.repositoryUrl!="string"||typeof i.ref!="string"||typeof i.commitSha!="string"||!Array.isArray(i.dockerfiles)||!i.dockerfiles.every(r=>typeof r=="string"))throw new Error(Q("client.invalidRepositoryProbe"));return i}async function KTe(e,t){const n=await mt(`/web/v3/environments/${encodeURIComponent(e)}/share-code`,{method:"POST",signal:t});if(!n.ok)throw new Error(await Vt(n,Q("client.exportEnvironmentCodeFailed")));const i=await n.json();if(typeof i.shareCode!="string"||typeof i.name!="string")throw new Error(Q("client.invalidEnvironmentCode"));return i}async function GTe(e,t){const n=await mt("/web/v3/environment-share-codes/inspect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shareCodes:e}),signal:t});if(!n.ok)throw new Error(await Vt(n,Q("client.inspectEnvironmentCodeFailed")));const i=await n.json();if(!Array.isArray(i.items))throw new Error(Q("client.invalidEnvironmentCodeInspection"));return i.items.map(r=>{if(!r||typeof r!="object")throw new Error(Q("client.invalidEnvironmentCodeInspection"));const s=r,o=s.status==="valid"||s.valid===!0?"valid":s.status==="invalid"||s.valid===!1?"invalid":null;if(!Number.isInteger(s.index)||o===null||s.name!==void 0&&typeof s.name!="string"||s.error!==void 0&&typeof s.error!="string")throw new Error(Q("client.invalidEnvironmentCodeInspection"));return{index:s.index,status:o,name:s.name??"",error:s.error??""}})}async function XTe(e,t){const n=await mt("/web/v3/environment-share-codes/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shareCodes:e}),signal:t});if(!n.ok)throw new Error(await Vt(n,Q("client.importEnvironmentCodeFailed")));const i=await n.json();if(!Array.isArray(i.items))throw new Error(Q("client.invalidEnvironmentCodeImport"));return i.items.map(r=>{if(!r||typeof r!="object")throw new Error(Q("client.invalidEnvironmentCodeImport"));const s=r;if(!Number.isInteger(s.index)||!(s.status==="created"||s.status==="duplicate"||s.status==="failed")||s.name!==void 0&&typeof s.name!="string"||s.error!==void 0&&typeof s.error!="string")throw new Error(Q("client.invalidEnvironmentCodeImport"));return{index:s.index,status:s.status,name:s.name??"",environment:s.environment===void 0||s.environment===null?void 0:Mz(s.environment),error:s.error??""}})}async function YTe(e,t,n,i){let r;try{r=await mt(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:i})}catch(s){throw s instanceof DOMException&&s.name==="AbortError"?s:s instanceof TypeError?new Error(Q("client.studioUnavailable")):s}if(!r.ok)throw new Error(await Vt(r,Q("client.saveEnvironmentFailed")));return Mz(await r.json())}function ZTe(e,t){return YTe("/web/v3/environments","POST",e,t)}function JTe(e,t,n){return YTe(`/web/v3/environments/${encodeURIComponent(e)}`,"PATCH",t,n)}async function e2e(e,t){const n=await mt(`/web/v3/environments/${encodeURIComponent(e)}`,{method:"DELETE",signal:t});if(!n.ok)throw new Error(await Vt(n,Q("client.deleteEnvironmentFailed")))}async function U8(e,t){const n=await mt(`/web/v3/environments/${encodeURIComponent(e)}/build`,{method:"POST",signal:t});if(!n.ok)throw new Error(await Vt(n,Q("client.startEnvironmentBuildFailed")));const i=Dz(await n.json());if(!i)throw new Error(Q("client.invalidEnvironmentBuild"));return i}async function t2e(e,t,n={}){const i=n.includeLogs?"?includeLogs=true":"",r=await mt(`/web/v3/environments/${encodeURIComponent(e)}/builds/${encodeURIComponent(t)}${i}`,{signal:n.signal});if(!r.ok)throw new Error(await Vt(r,Q("client.loadEnvironmentBuildFailed")));const s=Dz(await r.json());if(!s)throw new Error(Q("client.invalidEnvironmentBuild"));return s}async function n2e(e,t,n){const i=await mt(`/web/v3/environments/${encodeURIComponent(e)}/builds/${encodeURIComponent(t)}/manifest`,{signal:n});if(!i.ok)throw new Error(await Vt(i,Q("client.loadEnvironmentManifestFailed")));return BTe(await i.json())}function tJ(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidEnvironmentResource"));const t=e;if(t.source!=="provided"&&t.source!=="managed"||typeof t.consoleUrl!="string")throw new Error(Q("client.invalidEnvironmentResource"));return t}async function i2e(e){const t=await mt("/web/v3/environment-resources",{signal:e});if(!t.ok)throw new Error(await Vt(t,Q("client.loadEnvironmentResourcesFailed")));const n=await t.json();if(n.provider!=="volcengine"&&n.provider!=="byteplus"||typeof n.region!="string")throw new Error(Q("client.invalidEnvironmentResource"));return{provider:n.provider,region:n.region,codePipeline:tJ(n.codePipeline),containerRegistry:tJ(n.containerRegistry)}}async function _tt(e,t){const n=await mt(`/web/system-info/sandbox-tools/${encodeURIComponent(e)}/model-env`,{method:"POST",signal:t});if(!n.ok)throw new Error(await Vt(n,Q("client.updateCodexSandboxFailed")));const i=await n.json();if(i.kind!=="codex"&&i.kind!=="codex_snapshot"||typeof i.toolId!="string"||typeof i.updated!="boolean")throw new Error(Q("client.invalidCodexSandboxUpdate"));return i}async function jD(e){const t=await mt("/web/identity/user-pools",{signal:e});if(!t.ok)throw new Error(await Vt(t,Q("client.loadUserPoolsFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(Q("client.invalidUserPoolList"));return n.items.map(i=>{if(!i||typeof i!="object"||typeof i.uid!="string"||typeof i.name!="string"||typeof i.domain!="string"||typeof i.region!="string"||typeof i.isCurrent!="boolean")throw new Error(Q("client.invalidUserPoolList"));return i})}class nJ extends Error{constructor(t,n){super(n),this.status=t,this.name="DeploymentRecoveryHttpError"}}const tE=new Map;function jtt(e){if(typeof e=="string")return e?{message:e}:null;if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e,n=typeof t.message=="string"?t.message:typeof t.error=="string"?t.error:"";return n?{message:n,phase:typeof t.phase=="string"?t.phase:void 0,runtimeId:typeof t.runtimeId=="string"?t.runtimeId:void 0,logPath:typeof t.logPath=="string"?t.logPath:void 0}:null}class nE extends Error{constructor(t){super(t.message),this.detail=t,this.name="GithubCicdPipelineError"}}async function fm(e){const t=await e.text().catch(()=>"");if(t)try{const n=JSON.parse(t),i=jtt(n.detail??n.error);if(i)return new nE(i)}catch{return new nE({message:t})}return new nE({message:Q("client.syncGithubFailed",{status:e.status})})}async function r2e(e){const t=await mt("/web/github-delivery/source-sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e.project,githubUrl:e.githubUrl,githubToken:e.githubToken,baseBranch:e.baseBranch,region:e.region,cloudProvider:e.cloudProvider})},{},0);if(!t.ok)throw await fm(t);return t.json()}async function s2e(e){const t=await mt("/web/github-delivery/cicd-pipeline",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({githubUrl:e.githubUrl,githubToken:e.githubToken,baseBranch:e.baseBranch,runtimeName:e.runtimeName,runtimeId:e.runtimeId,region:e.region,agentCategory:e.agentCategory,mpaCompatibilityManifest:e.mpaCompatibilityManifest,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await fm(t);return t.json()}async function a2e(e){const t=await mt("/web/github-delivery/init-main",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e.project,githubUrl:e.githubUrl,githubToken:e.githubToken,baseBranch:e.baseBranch,runtimeName:e.runtimeName,runtimeId:e.runtimeId,region:e.region,agentCategory:e.agentCategory,mpaCompatibilityManifest:e.mpaCompatibilityManifest,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await fm(t);return t.json()}async function Ntt(e){const t=await mt("/web/github-delivery/source-sync/cicd",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pipelineId:e.pipelineId,runtimeName:e.runtimeName,runtimeId:e.runtimeId,region:e.region,agentCategory:e.agentCategory,mpaCompatibilityManifest:e.mpaCompatibilityManifest,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await fm(t);return t.json()}async function o2e(e){const t=await mt(`/web/github-cicd/runtime-binding?runtimeId=${encodeURIComponent(e)}`);if(!t.ok)throw await fm(t);const n=await t.json();return n.pipelineId?n:null}async function dN(e){const t=await mt(`/web/github-delivery/versions?runtimeId=${encodeURIComponent(e)}`);if(!t.ok)throw await fm(t);return t.json()}async function l2e(e){const t=await mt("/web/github-delivery/rollback-pr",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await fm(t);return t.json()}async function $z(e){const t=await mt("/web/github-cicd/runtime-binding",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await fm(t);return t.json()}async function c2e(e){const t=await mt("/web/github-cicd/runtime-sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e.runtimeId,project:e.project,agentCategory:e.agentCategory,mpaCompatibilityManifest:e.mpaCompatibilityManifest})},{},0);if(!t.ok)throw await fm(t);return t.json()}async function Lv(e,t,n,i){var h,m,g,b,v,y;const r=i==null?void 0:i.taskId,s=r?new AbortController:void 0;r&&s&&tE.set(r,s);const o=()=>{r&&tE.get(r)===s&&tE.delete(r)},l=async w=>{if(KAe(w))throw w;if(!r||!(i!=null&&i.runtimeId)||typeof i.baseRuntimeVersion!="number")throw new oN({taskId:r,cause:w});const x=await Het({signal:s==null?void 0:s.signal,shouldRetry:k=>!(k instanceof nJ)||k.status===404||k.status===408||k.status===429||k.status>=500,load:async k=>{const S=await mt("/web/deploy-agentkit/status",{method:"POST",headers:{"Content-Type":"application/json"},signal:k,body:JSON.stringify({taskId:r,runtimeId:i.runtimeId,runtimeName:i.runtimeName,appName:i.appName??e,region:n.region,projectName:n.projectName,baseRuntimeVersion:i.baseRuntimeVersion})},{},3e4);if(!S.ok)throw new nJ(S.status,await Vt(S,Q("client.deploymentFailed")));return S.json()}});if(!x)throw new oN({taskId:r,cause:w});return x};let c=null,u=null;try{const w=!!(i!=null&&i.migrationTaskId);(h=i==null?void 0:i.onStage)==null||h.call(i,{level:"info",phase:"upload",message:Q(w?"client.validatingMigrationArtifact":"client.uploadingCodePackage"),pct:0}),c=await mt("/web/deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},signal:s==null?void 0:s.signal,body:JSON.stringify({name:e,files:w?[]:t,config:n,taskId:r,migrationTaskId:i==null?void 0:i.migrationTaskId,runtimeId:i==null?void 0:i.runtimeId,runtimeName:i==null?void 0:i.runtimeName,appName:i==null?void 0:i.appName,agentCategory:i==null?void 0:i.agentCategory,mpaCompatibilityManifest:i==null?void 0:i.mpaCompatibilityManifest,editMode:i==null?void 0:i.editMode,draft:i==null?void 0:i.draft,updateEtag:i==null?void 0:i.updateEtag,baseRuntimeVersion:i==null?void 0:i.baseRuntimeVersion,removeRuntimeEnvKeys:i==null?void 0:i.removeRuntimeEnvKeys,mcpSecretValues:i==null?void 0:i.mcpSecretValues,mcpCredentialReuses:i==null?void 0:i.mcpCredentialReuses,sessionStorage:i==null?void 0:i.sessionStorage,minInstance:i==null?void 0:i.minInstance,maxInstance:i==null?void 0:i.maxInstance,createEvaluationSets:i==null?void 0:i.createEvaluationSets,description:zet((i==null?void 0:i.description)??""),authentication:i==null?void 0:i.authentication,im:i==null?void 0:i.im,envs:i==null?void 0:i.envs,resources:i==null?void 0:i.resources,source:(i==null?void 0:i.source)??(i!=null&&i.migrationTaskId?{kind:"migration",migrationId:i.migrationTaskId}:{kind:"inlineFiles"}),harnessSidecar:i==null?void 0:i.harnessSidecar,environment:i==null?void 0:i.environment})},{},0),(m=i==null?void 0:i.onStage)==null||m.call(i,{level:"success",phase:"upload",message:Q(w?"client.migrationArtifactValidated":"client.codePackageUploaded"),pct:100})}catch(w){try{u=await l(w)}finally{o()}}if(c&&!c.ok){const w=await Vt(c,Q("client.deploymentFailed"));throw o(),new Error(w)}if(c)try{for await(const w of BA(c)){const x=w;if(x&&x.done){u=x;break}x&&x.message&&((g=i==null?void 0:i.onStage)==null||g.call(i,x))}}catch(w){try{u=await l(w)}finally{o()}}if(u)o();else try{u=await l()}finally{o()}if(!u.success){const w=new Error(u.error||Q("client.deploymentFailed"));throw WAe(w)?new oN({taskId:r,cause:w}):w}if(!u.agentName)throw new Error(Q("client.deploymentMissingAgentName"));if(!u.runtimeId&&!u.url)throw new Error(Q("client.deploymentMissingConnection"));const d=(b=u.runtimeName)!=null&&b.trim()?u.agentName:e,f=((v=u.runtimeName)==null?void 0:v.trim())||u.agentName;return{apikey:u.apikey??"",url:u.url??"",agentName:d,runtimeName:f,runtimeId:u.runtimeId,mpaInstanceId:((y=u.mpaInstanceId)==null?void 0:y.trim())||void 0,consoleUrl:u.consoleUrl,region:u.region,version:u.version,warnings:u.warnings,feishuChannel:u.feishuChannel}}async function u2e(e){var n;const t=await mt("/web/cancel-deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e})});if(!t.ok){const i=await t.text().catch(()=>"");throw new Error(i||Q("client.cancelDeploymentFailed",{status:t.status}))}(n=tE.get(e))==null||n.abort(),tE.delete(e)}async function Rtt(e=gz){const t=await mt(`/web/my-runtimes?region=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(Q("client.loadFailed",{status:t.status}));return(await t.json()).runtimes??[]}const cC={title:"AgentKit Studio",logoUrl:""},Q8={enabled:!1},S3={studio:!1,version:"",provider:"volcengine",branding:cC,features:{newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,agentUsage:!1,addAgentkit:!0,generatedAgentTestRun:!0},defaultView:"chat",agentsSource:"local",telemetry:Q8};function Itt(e){if(!e||typeof e!="object")return Q8;const t=e;if(t.enabled!==!0||!t.studio||typeof t.studio!="object")return Q8;const n=t.studio;return{enabled:!0,studio:{deployId:typeof n.deployId=="string"?n.deployId:"",userPoolId:typeof n.userPoolId=="string"?n.userPoolId:"",applicationId:typeof n.applicationId=="string"?n.applicationId:"",functionId:typeof n.functionId=="string"?n.functionId:"",region:typeof n.region=="string"?n.region:"",project:typeof n.project=="string"?n.project:"",version:typeof n.version=="string"?n.version:"",accountId:typeof n.accountId=="string"?n.accountId:"",accountIdResolutionError:typeof n.accountIdResolutionError=="string"?n.accountIdResolutionError:""}}}async function d2e(){var e,t;try{const n=await mt("/web/ui-config");if(!n.ok)return S3;const i=await n.json(),r=typeof((e=i.branding)==null?void 0:e.logoUrl)=="string"?i.branding.logoUrl:cC.logoUrl,s=i.provider==="byteplus"?"byteplus":"volcengine";return rTe(s),{studio:i.studio??!1,version:typeof i.version=="string"?i.version:"",provider:s,branding:{title:typeof((t=i.branding)==null?void 0:t.title)=="string"?i.branding.title:cC.title,logoUrl:r?Na(r):""},features:{...S3.features,...i.features??{}},defaultView:i.defaultView??"chat",agentsSource:i.agentsSource==="cloud"?"cloud":"local",telemetry:Itt(i.telemetry)}}catch{return S3}}const f2e={role:"user",telemetry:{userId:"",accountId:""},capabilities:{createAgents:!1,createPersonalAgents:!1,manageAgents:!1,runtimeScope:"mine",manageUsers:!1}};async function h2e(){var n,i,r,s,o,l;const e=await mt("/web/access");if(!e.ok)throw new Error(Q("client.loadPermissionsFailed",{status:e.status}));const t=await e.json();if(!["super_admin","admin","developer","user"].includes(t.role)||typeof((n=t.telemetry)==null?void 0:n.userId)!="string"||t.telemetry.accountId!==void 0&&typeof t.telemetry.accountId!="string"||typeof((i=t.capabilities)==null?void 0:i.createAgents)!="boolean"||typeof((r=t.capabilities)==null?void 0:r.createPersonalAgents)!="boolean"||typeof((s=t.capabilities)==null?void 0:s.manageAgents)!="boolean"||((o=t.capabilities)==null?void 0:o.manageUsers)!==void 0&&typeof t.capabilities.manageUsers!="boolean"||!["all","mine"].includes((l=t.capabilities)==null?void 0:l.runtimeScope))throw new Error(Q("client.invalidPermissionResponse"));return t}async function p2e(e,t){const n=new URLSearchParams;e&&n.set("targetVersion",e),t&&n.set("startedAt",String(t));const i=n.size?`?${n.toString()}`:"",r=await mt(`/web/studio-update${i}`);if(!r.ok)throw new Error(Q("client.checkStudioUpdateFailed",{status:r.status}));return await r.json()}async function m2e(){const e=await mt("/web/studio-update/permissions");if(!e.ok){let t="";try{const n=await e.json();t=typeof n.detail=="string"?n.detail:""}catch{t=""}throw new Error(t||Q("client.studioUpdatePreflightFailed",{status:e.status}))}return await e.json()}async function g2e(e){const t=await mt("/web/studio-update",{method:"POST",headers:{"Content-Type":"application/json","X-VeADK-Studio-Update":"1"},body:JSON.stringify({version:e})},{},yr);if(!t.ok){let n="";try{const i=await t.json();n=typeof i.detail=="string"?i.detail:""}catch{n=""}throw new Error(n||Q("client.submitStudioUpdateFailed",{status:t.status}))}return await t.json()}async function b2e({runtimeId:e,region:t,appName:n,page:i=1,pageSize:r=20,signal:s}){const o=new URLSearchParams({runtimeId:e,region:t,appName:n,page:String(i),pageSize:String(r)}),l=await mt(`/web/agent-usage?${o.toString()}`,{signal:s});if(!l.ok)throw new Error(await Vt(l,Q("client.loadAgentUsageFailed")));const c=l.headers.get("content-type")||Q("client.notProvided"),u=c.toLowerCase();if(!u.includes("application/json")&&!u.includes("+json"))throw new Error(Q("client.agentUsageNonJson",{status:l.status,contentType:c})+Q("client.checkStudioGateway"));try{return await l.json()}catch{throw new Error(Q("client.agentUsageInvalidJson",{status:l.status,contentType:c})+Q("client.retryCheckGateway"))}}function hm(e=""){return`/web/cronjobs${e?`/${encodeURIComponent(e)}`:""}`}async function z8(e){const t=await mt(hm(),{signal:e});if(!t.ok)throw new Error(await Vt(t,Q("client.loadCronJobsFailed")));const n=await t.json();return Array.isArray(n)?n:n.items??[]}async function Ptt(e,t){const n=await mt(hm(e),{signal:t});if(!n.ok)throw new Error(await Vt(n,Q("client.loadCronJobFailed")));return await n.json()}async function y2e(e){const t=await mt(hm(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await Vt(t,Q("client.createCronJobFailed")));return await t.json()}async function v2e(e,t){const n=await mt(`${hm(e)}/update`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error(await Vt(n,Q("client.updateCronJobFailed")));return await n.json()}async function x2e(e,t){const n=t?"enable":"disable",i=await mt(`${hm(e)}/${n}`,{method:"POST"});if(!i.ok)throw new Error(await Vt(i,Q(t?"client.enableCronJobFailed":"client.pauseCronJobFailed")));return await i.json()}async function w2e(e){const t=await mt(`${hm(e)}/run`,{method:"POST"});if(!t.ok)throw new Error(await Vt(t,Q("client.runCronJobFailed")));return await t.json()}async function V8(e,t){const n=await mt(`${hm(e)}/runs`,{signal:t});if(!n.ok)throw new Error(await Vt(n,Q("client.loadCronHistoryFailed")));const i=await n.json();return Array.isArray(i)?i:i.items??[]}async function k2e(e,t){const n=await mt(`${hm(e)}/runs/${encodeURIComponent(t)}/cancel`,{method:"POST"});if(!n.ok)throw new Error(await Vt(n,Q("client.stopCronRunFailed")));return await n.json()}async function O2e(e){const t=await mt(hm(e),{method:"DELETE"});if(!t.ok)throw new Error(await Vt(t,Q("client.deleteCronJobFailed")))}class ND extends Error{constructor(t,n){super(t),this.status=n,this.name="RuntimeListError"}}async function $v(e={}){const t=new URLSearchParams({scope:e.scope??"all",page_size:String(e.pageSize??30),region:e.region??"all"});e.agentCategory&&t.set("agentCategory",e.agentCategory),e.nextToken&&t.set("next_token",e.nextToken);const n=await mt(`/web/runtimes?${t.toString()}`,{signal:e.signal});if(!n.ok){const r=await Vt(n,Q("client.loadRuntimeFailed"));throw new ND(r,n.status)}const i=await n.json();return{runtimes:i.runtimes??[],nextToken:i.nextToken??""}}async function Xw(e,t,n={}){if(n.preferCached){const i=kz(e,t,n.currentVersion),r=iw.get(i);if(r&&r.expiresAt>Date.now())return[...r.apps];r&&iw.delete(i)}try{const i={runtimeId:e,region:t,runtimeVersion:n.currentVersion};return n.retryProbe&&(i.retryProbe=!0),await QA("","",i,n.signal,n.timeoutMs)}catch(i){if(i instanceof V1||i instanceof Ea||i instanceof Error)throw i;return null}}async function S2e(e,t){const n=new URLSearchParams({region:t}),i=await mt(`/web/runtime-tool-channel/${encodeURIComponent(e)}/capabilities?${n.toString()}`);if(!i.ok)throw new Ea(await Vt(i,Q("client.loadLocalToolsFailed")),!1,!0);return await i.json()}async function E2e(e,t){const n=new URLSearchParams({region:t}),i=await mt(`/web/runtime-route-channel/${encodeURIComponent(e)}/connect?${n.toString()}`,{method:"POST"});if(!i.ok)throw new Ea(await Vt(i,Q("client.connectDynamicRouteFailed")),!1,!0);return await i.json()}async function C2e(e,t,n={}){const i={runtimeId:e,region:t};n.retryProbe&&(i.retryProbe=!0);const r=await mt("/.well-known/agent-card.json",{},i),s=await sTe(r);if(s==="runtime_access_denied")throw new V1;if(s==="runtime_private_endpoint_unreachable")throw new Ea(tTe());if(["runtime_proxy_connect_error","runtime_proxy_timeout"].includes(s))throw new Ea(nTe());if(r.status===404)return null;if(r.status===401||r.status===403)throw new Ea(Q("client.a2aProbeDenied"));if(!r.ok)throw new Error(await Vt(r,Q("client.loadA2aCardFailed")));const o=await r.json().catch(()=>null),l=typeof(o==null?void 0:o.url)=="string"?o.url.trim():"";return l?{name:typeof(o==null?void 0:o.name)=="string"?o.name:"",description:typeof(o==null?void 0:o.description)=="string"?o.description:"",endpoint:l}:null}async function A2e(e,t){const n=new URLSearchParams({runtimeId:e,region:t}),i=await mt(`/web/runtime-api-key/reveal?${n.toString()}`,{method:"POST",cache:"no-store"});if(!i.ok)throw new Error(await Vt(i,Q("client.loadRuntimeApiKeyFailed")));const r=await i.json();if(typeof r.apiKey!="string"||!r.apiKey)throw new Error(Q("client.runtimeApiKeyMissing"));return r.apiKey}async function T2e(e,t,n={}){const i=n.agentCategory==="mpa";let r;try{r=await mt("/web/delete-runtime",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e,region:t,agentCategory:n.agentCategory,mpaInstanceId:n.mpaInstanceId})},{},i?18e4:eo)}catch(s){if(!i||!(s instanceof Error)||s.name!=="TimeoutError")throw s;try{const o=new URLSearchParams({runtimeId:e,region:t}),l=await mt(`/web/mpa-runtime-deletion-status?${o.toString()}`,{cache:"no-store"});if(l.ok){const c=await l.json();if((c==null?void 0:c.deleted)===!0)return}}catch{}throw new Error(Q("client.mpaDeleteUnconfirmed"))}if(!r.ok){const s=await r.text().catch(()=>"");throw new Error(s||Q("client.deleteFailed",{status:r.status}))}}async function _2e({runtimeId:e,region:t,appName:n,etag:i,signal:r}){const s=await mt("/web/runtime-mcp-credentials",{method:"POST",cache:"no-store",signal:r,headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e,region:t,appName:n,etag:i})});if(!s.ok)throw new Error(await Vt(s,Q("client.loadMcpCredentialsFailed")));const o=await s.json().catch(()=>null);if(!Array.isArray(o==null?void 0:o.credentials))throw new Error(Q("client.invalidMcpCredentials"));return o.credentials.map(l=>{if(!l||typeof l!="object")throw new Error(Q("client.invalidMcpCredentials"));const c=l,u={agentName:c.agentName,name:c.name,url:c.url,authTokenEnv:c.authTokenEnv,value:c.value};if(Object.values(u).some(d=>typeof d!="string"))throw new Error(Q("client.invalidMcpCredentials"));return u})}function fN({runtimeId:e,region:t,appName:n,currentVersion:i}){return Mv(oC,t,e,i??"",(n==null?void 0:n.trim())??"")}async function Dtt({runtimeId:e,region:t,appName:n,currentVersion:i,force:r=!1}){const s=new URLSearchParams({runtimeId:e,region:t});n&&s.set("appName",n),i!=null&&s.set("currentVersion",String(i)),r&&s.set("refresh","true");const o=await mt(`/web/runtime-update-capability?${s.toString()}`);if(!o.ok)throw new Error(await Mtt(o));return await o.json()}function RD({runtimeId:e,region:t,appName:n,currentVersion:i,signal:r,force:s=!1}){var u,d;const o={runtimeId:e,region:t,appName:n,currentVersion:i},l=fN(o);if(s&&os.delete(l),!s){const f=kb(os,l,H1);if(f)return Y2(Promise.resolve(f),r);const h=(u=os.get(l))==null?void 0:u.promise;if(h)return Y2(h,r);if(n){const m=fN({...o,appName:""}),g=(d=os.get(m))==null?void 0:d.promise;if(g){let b;return b=g.then(v=>{var w,x,k,S,O;if(v.recoveryStatus==="preparing")return((w=os.get(l))==null?void 0:w.promise)===b&&os.delete(l),v;const y=((k=(x=v.agent)==null?void 0:x.appName)==null?void 0:k.trim())??"";return y&&y!==n.trim()?(((S=os.get(l))==null?void 0:S.promise)===b&&os.delete(l),RD(o)):(((O=os.get(l))==null?void 0:O.promise)===b&&os.set(l,{value:v,updatedAt:Date.now()}),v)},v=>{var y;throw((y=os.get(l))==null?void 0:y.promise)===b&&os.delete(l),v}),os.set(l,{promise:b,updatedAt:0}),Y2(b,r)}}}let c;return c=Dtt({...o,force:s}).then(f=>{var h,m,g,b,v;if(f.recoveryStatus==="preparing")return((h=os.get(l))==null?void 0:h.promise)===c&&os.delete(l),f;if(((m=os.get(l))==null?void 0:m.promise)===c){os.set(l,{value:f,updatedAt:Date.now()});const y=new Set(["",((b=(g=f.agent)==null?void 0:g.appName)==null?void 0:b.trim())??""]);for(const w of y){const x=fN({...o,appName:w});x!==l&&!((v=os.get(x))!=null&&v.promise)&&os.set(x,{value:f,updatedAt:Date.now()})}}return f},f=>{var h;throw((h=os.get(l))==null?void 0:h.promise)===c&&os.delete(l),f}),os.set(l,{promise:c,updatedAt:0}),Y2(c,r)}function H8({runtimeId:e,region:t,appName:n,currentVersion:i}){return kb(os,fN({runtimeId:e,region:t,appName:n,currentVersion:i}),H1)}function q8(e){return RD(e).then(()=>{},()=>{})}function W8(e,t){if(!e){os.clear();return}for(const n of os.keys()){const[i,r,s]=n.split("");i===oC&&s===e&&(!t||r===t)&&os.delete(n)}}async function Mtt(e){const t=await e.json().catch(()=>null),n=typeof(t==null?void 0:t.detail)=="string"?t.detail:"";return e.status===403?Q("client.runtimeManageForbidden"):e.status===404?Q(n==="runtime_not_found"?"client.runtimeNotFound":"client.runtimeUnavailable"):Q("client.checkRuntimeUpdateFailed",{status:e.status})}async function Ltt(e,t){let n=null;for(const i of UA(t)){const r=await mt(`/web/runtime-detail?runtimeId=${encodeURIComponent(e)}®ion=${encodeURIComponent(i)}`);if(r.ok)return r.json();n=new Error(await Vt(r,Q("client.loadRuntimeDetailFailed")))}throw n??new Error(Q("client.loadRuntimeDetailFailed"))}async function ID(e,t="cn-beijing",n={}){const i=Mv(e,t||"cn-beijing"),r=kb(ly,i,H1);if(!n.force&&r)return r;const s=ly.get(i);if(!n.force&&(s!=null&&s.promise))return s.promise;const o=Ltt(e,t).then(l=>Oz(ly,i,l));ly.set(i,{...s,promise:o,updatedAt:(s==null?void 0:s.updatedAt)??0});try{return await o}finally{const l=ly.get(i);(l==null?void 0:l.promise)===o&&ly.set(i,{value:l.value,updatedAt:l.updatedAt})}}async function $tt(e,t,n){const i=new URLSearchParams({runtimeId:e,region:t,key:n}),r=await mt(`/web/runtime-env/copy?${i.toString()}`,{method:"POST"});if(!r.ok)throw new Error(await Vt(r,Q("client.copySecretFailed")));const s=await r.json();if(typeof s.value!="string"||!s.value)throw new Error(Q("client.copySecretFailed"));await navigator.clipboard.writeText(s.value)}function j2e(e,t="cn-beijing"){return kb(ly,Mv(e,t||"cn-beijing"),H1)}function N2e(e,t="cn-beijing"){ID(e,t).catch(()=>{})}async function iE(e){const t=await mt("/web/generated-agent-projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await Vt(t,Q("client.generateProjectFailed")));return t.json()}const Ftt=19e4,Btt=12e4;async function R2e(e){const t=await mt("/web/generated-agent-drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requirement:e})},{},Ftt);if(!t.ok)throw new Error(await Vt(t,Q("client.generateAgentConfigFailed")));return SD(t,Q("client.generateAgentConfigFailed"))}async function I2e(e,t){const n=await mt("/web/generated-agent-test-runs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e,runtimeId:t==null?void 0:t.runtimeId,runtimeRegion:t==null?void 0:t.region,mcpCredentialReuses:t==null?void 0:t.mcpCredentialReuses})},{},Btt);if(!n.ok)throw new Error(await Vt(n,Q("client.createDebugRunFailed")));return SD(n,Q("client.createDebugRunFailed"))}async function P2e(e,t){const n=await mt(`/web/generated-agent-test-runs/${e}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:t})});if(!n.ok)throw new Error(await Vt(n,Q("client.createDebugSessionFailed")));return(await SD(n,Q("client.createDebugSessionFailed"))).id}async function D2e(e,t){const n=await mt(`/web/generated-agent-test-runs/${encodeURIComponent(e)}/trace/session/${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await Vt(n,Q("client.loadDebugTraceFailed")));const i=await SD(n,Q("client.loadDebugTraceFailed"));if(!Array.isArray(i))throw new Error(Q("client.invalidDebugTrace"));return i}async function*M2e({runId:e,userId:t,sessionId:n,text:i,signal:r}){const s=i.trim()?[{text:i}]:[],o=_z(r);let l;try{l=await mt(`/web/generated-agent-test-runs/${e}/run_sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({user_id:t,session_id:n,new_message:{role:"user",parts:s},streaming:!0}),signal:o.signal},{},0)}catch(c){throw o.cleanup(),o.timedOut()?new Error(Wg()):c}if(!l.ok)throw o.cleanup(),new Error(await Vt(l,Q("client.debugRunFailed")));try{for await(const c of BA(l))o.clearDeadline(),yield c}catch(c){throw o.timedOut()?new Error(Wg()):c}finally{o.cleanup()}}async function ax(e){const t=await mt(`/web/generated-agent-test-runs/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404)throw new Error(await Vt(t,Q("client.cleanupDebugRunFailed")))}function L2e(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidSandboxVersion"));const t=e;if(typeof t.toolId!="string"||typeof t.error!="string")throw new Error(Q("client.invalidSandboxVersion"));if(!t.error&&(t.provider!=="volcengine"&&t.provider!=="byteplus"||typeof t.region!="string"||typeof t.status!="string"||typeof t.currentImage!="string"||typeof t.latestImage!="string"||typeof t.needsImageUpdate!="boolean"||typeof t.canUpdate!="boolean"||typeof t.needsModelEnvUpdate!="boolean"||typeof t.canUpdateModelEnv!="boolean"||typeof t.modelEnvError!="string"))throw new Error(Q("client.invalidSandboxVersion"));return t}async function $2e(e){const t=await mt("/web/system-info/sandbox-tools/updates",{signal:e});if(!t.ok)throw new Error(await Vt(t,Q("client.loadSandboxVersionsFailed")));const n=await t.json();if(!Array.isArray(n.tools))throw new Error(Q("client.invalidSandboxVersion"));return n.tools.map(L2e)}async function F2e(e){const t=await mt(`/web/system-info/sandbox-tools/${encodeURIComponent(e)}/update`,{method:"POST"},{},33e4);if(!t.ok)throw new Error(await Vt(t,Q("client.updateSandboxFailed")));const n=await t.json();if(typeof n.updated!="boolean")throw new Error(Q("client.invalidSandboxUpdate"));return{updated:n.updated,state:L2e(n.state)}}class Ou extends Error{constructor(t){super(`Channel request failed (${t})`),this.status=t}}async function wc(e,t,n={}){const i=await mt(`/api/v1/channels${t}`,{...n,headers:{"Content-Type":"application/json",...n.headers}},e);if(!i.ok)throw new Ou(i.status);return i.json()}function K8(e,t,n,i){return oet(mt,e,t,n,i)}function B2e(e,t,n,i,r){return cet(mt,e,t,n,i,r)}function U2e(e,t,n,i){return uet(mt,e,t,n,i)}const Utt=Object.freeze(Object.defineProperty({__proto__:null,ChannelApiError:Ou,DEFAULT_SITE_BRANDING:cC,DEFAULT_STUDIO_ACCESS:f2e,GithubCicdPipelineError:nE,MpaExecutionConfigRequestError:rw,RuntimeAccessDeniedError:V1,RuntimeListError:ND,RuntimeProbeError:Ea,TurnControlConflictError:TD,applyMpaProfileAfterDeployment:eI,attachGithubDeliveryCicdToSourceSync:Ntt,bindGithubCicdRuntime:$z,buildEnvironment:U8,cancelAgentkitDeployment:u2e,cancelCronJobRun:k2e,channelRequest:wc,checkRuntimeNameAvailability:_D,clearMessageFeedbackCache:GAe,clearRemoteApps:YAe,componentSearch:STe,continueTurn:Stt,continueTurnSSE:wTe,controlTurn:xTe,copyRuntimeEnvironmentSecret:$tt,createCronJob:y2e,createEnvironment:ZTe,createGeneratedAgentTestRun:I2e,createGeneratedAgentTestSession:P2e,createGithubCicdPipeline:r2e,createGithubDeliveryCicdPipeline:s2e,createGithubDeliveryRollbackPr:l2e,createSession:aTe,createWorkspace:VTe,deleteAgentFeedbackCases:fTe,deleteCronJob:O2e,deleteEnvironment:e2e,deleteGeneratedAgentTestRun:ax,deleteMedia:uN,deleteRuntime:T2e,deleteSession:D8,deleteSessionMedia:M8,deleteWorkspace:qTe,deployAgentkitProject:Lv,downloadArtifact:Ez,ensureRuntimeRouteChannel:E2e,exportEnvironmentShareCode:KTe,fetchRemoteApps:QA,fetchSessionFile:hTe,generateAgentDraftFromRequirement:R2e,generateAgentProject:iE,getAgentFeedbackCases:AD,getAgentInfo:$8,getAgentOptimizations:lTe,getAgentUsage:b2e,getAutomaticEvaluationStatuses:P8,getCachedAgentFeedbackCases:cTe,getCachedRuntimeAgentInfo:kTe,getCachedRuntimeDetail:j2e,getCachedRuntimeUpdateCapability:H8,getCronJob:Ptt,getEnvironmentBuild:t2e,getEnvironmentManifest:n2e,getEnvironmentResources:i2e,getGeneratedAgentTestTrace:D2e,getGithubCicdRuntimeBinding:o2e,getGithubDeliveryVersions:dN,getMediaCapabilities:ktt,getMpaAgentDeletePreview:jTe,getMpaAgentOperation:ATe,getMpaAgentView:_Te,getMpaProfileStatus:TTe,getMpaRuntimeConsoleRuns:NTe,getMpaRuntimeConsoleTrace:RTe,getMpaSessionExecutionConfig:Iz,getMyRuntimes:Rtt,getRuntimeAgentInfo:Az,getRuntimeDetail:ID,getRuntimeMcpCredentials:_2e,getRuntimeStudioToolCapabilities:S2e,getRuntimeUpdateCapability:RD,getRuntimes:$v,getSandboxImageUpdates:$2e,getSession:lC,getSessionTrace:ZR,getStudioAccess:h2e,getStudioUpdatePermissions:m2e,getStudioUpdateStatus:p2e,getSystemInfo:$Te,getTurnControl:vTe,getUiConfig:d2e,httpErrorMessage:Vt,importEnvironmentShareCodes:XTe,initializeGithubDeliveryMain:a2e,inspectEnvironmentRepository:WTe,inspectEnvironmentShareCodes:GTe,invalidateRuntimeUpdateCapabilityCache:W8,isMpaA2aRuntimeApp:ap,isMpaRuntimeApp:JR,listActiveMpaAgentOperations:CTe,listApps:eTe,listCronJobRuns:V8,listCronJobs:z8,listDeploymentResources:PTe,listEnvironments:VA,listIdentityUserPools:jD,listModelApiKeys:wz,listModelOptions:z1,listMpaCronTasks:K8,listMpaRuns:U2e,listSessions:Sz,listWorkspaces:Lz,mediaContentUrl:bTe,mpaProfileFromAgentDraft:zA,parseEnvironmentManifest:BTe,parseEnvironmentShareCodes:Pz,parsePreparedSessionEnvironmentMounts:DTe,patchMpaSessionExecutionConfig:B8,prefetchAgentFeedbackCases:xtt,prefetchRuntimeAgentInfo:OTe,prefetchRuntimeDetail:N2e,prefetchRuntimeUpdateCapability:q8,prepareSessionEnvironmentMounts:MTe,previewArtifact:Cz,probeRuntimeA2a:C2e,probeRuntimeApps:Xw,refreshAgentFeedbackCases:uTe,registerRemoteApp:XAe,requestMpaTask:B2e,retryMpaAgentOperation:Rz,revealModelApiKey:JAe,revealRuntimeApiKey:A2e,runCronJobNow:w2e,runGeneratedAgentTestSSE:M2e,runSSE:F8,runSseEmptyResponseError:Tz,runSseFirstEventTimeoutError:Wg,runSseIncompleteResponseError:fS,runtimeRegionCandidates:UA,setClientCloudProvider:rTe,setCronJobEnabled:x2e,startMpaAgentOperation:Nz,startStudioUpdate:g2e,studioFetch:yn,submitIssueFeedback:L8,submitMessageFeedback:oTe,syncGithubCicdRuntime:c2e,updateCodexSandboxToolModelEnv:_tt,updateCronJob:v2e,updateEnvironment:JTe,updateSandboxTool:F2e,updateWorkspace:HTe,upgradeMpaSessionProfile:ITe,uploadMedia:mTe,upsertCachedAgentFeedbackCase:cN,webSearch:ETe,writeEnvironmentShareCode:LTe},Symbol.toStringTag,{value:"Module"})),Qtt="/web/sandbox/sessions",iJ="/web/sandbox/codex-project-handoff",rJ=3e4,E3=33e4,ztt=6e4,Vtt=6e5,uO=15e3,hp=6e4,Htt=33e4,sJ=3e4,qtt=60*60,G8=40;function PD(e){const t=e.trim().toLowerCase();return["ready","running","wakeable"].includes(t)?"ready":t}function Fz(e){switch(e.trim().toLowerCase()){case"ready":return Q("sandbox.status.ready");case"wakeable":return Q("sandbox.status.wakeable");case"creating":return Q("sandbox.status.creating");case"starting":case"initializing":return Q("sandbox.status.starting");case"pending":return Q("sandbox.status.pending");case"running":return Q("sandbox.status.running");case"failed":case"error":return Q("sandbox.status.failed");case"stopped":return Q("sandbox.status.stopped");case"expired":return Q("sandbox.status.expired");case"deleting":return Q("sandbox.status.deleting");case"deleted":return Q("sandbox.status.deleted");default:return Q("sandbox.status.unknown")}}function ys(e){const t=hl(e);return t.has("Accept")||t.set("Accept","application/json"),t}class Bz extends Error{constructor(n,i={}){var r;super(n);Zt(this,"code");Zt(this,"retryable");Zt(this,"publicMessage");Zt(this,"httpStatus");this.name="SandboxServiceError",this.code=i.code??"",this.retryable=i.retryable===!0,this.publicMessage=((r=i.publicMessage)==null?void 0:r.trim())||n,this.httpStatus=i.httpStatus}}function Wtt(e){return e instanceof Bz?e.publicMessage:e instanceof Error&&e.name==="TimeoutError"?Q("sandbox.developmentTimeout"):e instanceof TypeError?Q("sandbox.developmentDisconnected"):Q("sandbox.developmentFailed")}async function Bs(e,t){const n=await e.text().catch(()=>"");let i={};try{i=JSON.parse(n)}catch{const d=Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status});return new Error(n?Q("common.fallbackWithDetail",{fallback:d,detail:n}):d)}const r=i.detail,s=r&&typeof r=="object"?r:i,o=r&&typeof r=="object"&&"message"in r?r.message:r??i.error??i.message,l=typeof o=="string"?o:o==null?"":JSON.stringify(o),c=Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),u=l?Q("common.fallbackWithDetail",{fallback:c,detail:l}):c;return new Bz(u,{code:typeof s.code=="string"?s.code:"",retryable:s.retryable===!0,publicMessage:l||c,httpStatus:e.status})}async function aJ(e,t){const n=await e.text().catch(()=>"");try{return JSON.parse(n)}catch{throw new Error(Q("sandbox.invalidStudioResponse",{fallback:t}))}}function zb(e,t="codex",n=e.toolName==="intelligent-development"){if(!e.sessionId||!e.status)throw new Error(Q("sandbox.invalidSession"));return{resourceType:"session",id:e.sessionId,toolName:t,userSessionId:e.userSessionId??"",displayName:e.displayName??"",status:e.status,createdAt:e.createdAt??"",expireAt:e.expireAt??"",persistent:e.persistent!==!1,toolType:e.toolType??"",intelligentDevelopment:n,createdBy:e.createdBy??"",region:e.region??"",isMine:e.isMine===!0,threadId:e.threadId??"",cwd:e.cwd??"",workspaceLocked:e.workspaceLocked===!0,busy:e.busy===!0,...typeof e.model=="string"?{model:e.model}:{},permissions:DD(e.permissions),...e.conversation===void 0?{}:{restoredConversation:cy(e.conversation)}}}function oJ(e,t="codex"){if(!e.snapshotId||!e.status)throw new Error(Q("sandbox.invalidSnapshot"));return{resourceType:"snapshot",id:e.snapshotId,snapshotId:e.snapshotId,sourceSessionId:e.sessionId??"",toolName:t,userSessionId:e.userSessionId??"",displayName:e.displayName??"",status:e.status,snapshotStatus:e.snapshotStatus??"Unknown",reason:e.reason??"",createdAt:e.createdAt??"",createdBy:e.createdBy??"",region:e.region??"",isMine:e.isMine===!0}}function lJ(e,t){if((t==null?void 0:t.autoResumeSnapshots)===void 0)return e;const n=new URLSearchParams({autoResumeSnapshots:String(t.autoResumeSnapshots)});return`${e}?${n.toString()}`}const dO={approvalPolicy:"on-request",approvalsReviewer:"user",sandboxMode:"workspace-write",networkAccess:!1};function DD(e){if(!e||typeof e!="object")return{...dO};const t=e,n=t.approvalPolicy,i=t.approvalsReviewer,r=t.sandboxMode;return{approvalPolicy:n==="untrusted"||n==="on-request"||n==="never"?n:dO.approvalPolicy,approvalsReviewer:i==="user"||i==="auto_review"?i:dO.approvalsReviewer,sandboxMode:r==="read-only"||r==="workspace-write"||r==="danger-full-access"?r:dO.sandboxMode,networkAccess:typeof t.networkAccess=="boolean"?t.networkAccess:dO.networkAccess}}function cJ(e){if(!e||typeof e!="object")throw new Error(Q("sandbox.invalidSettings"));const t=e;return{threadId:typeof t.threadId=="string"?t.threadId:"",cwd:typeof t.cwd=="string"?t.cwd:"",...typeof t.model=="string"?{model:t.model}:{},workspaceLocked:t.workspaceLocked===!0,busy:t.busy===!0,permissions:DD(t.permissions)}}function Oa(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Ktt(e){const t=Oa(e);if(!(!t||typeof t.id!="string"||!t.id))return{id:t.id,displayName:typeof t.displayName=="string"?t.displayName:t.id,description:typeof t.description=="string"?t.description:"",isDefault:t.isDefault===!0}}function Gtt(e){const t=Oa(e);if(!(!t||typeof t.id!="string"||!t.id||typeof t.name!="string"||!t.name))return{id:t.id,name:t.name,description:typeof t.description=="string"?t.description:""}}function Q2e(e){const t=Oa(e);if(!(!t||typeof t.id!="string"||!t.id))return{id:t.id,...typeof t.name=="string"&&t.name?{name:t.name}:{},preview:typeof t.preview=="string"?t.preview:"",cwd:typeof t.cwd=="string"?t.cwd:"",modelProvider:typeof t.modelProvider=="string"?t.modelProvider:"",createdAt:typeof t.createdAt=="number"&&Number.isFinite(t.createdAt)?t.createdAt:0,updatedAt:typeof t.updatedAt=="number"&&Number.isFinite(t.updatedAt)?t.updatedAt:0,status:typeof t.status=="string"?t.status:"unknown"}}function cy(e){const t=Oa(e),n=Q2e(t==null?void 0:t.thread);if(!t||!n||typeof t.threadId!="string"||!Array.isArray(t.messages))throw new Error(Q("sandbox.invalidThreadSnapshot"));const i=t.messages.flatMap(r=>{const s=Oa(r);if(!s||typeof s.id!="string"||s.role!=="user"&&s.role!=="assistant"||typeof s.content!="string"||typeof s.timestamp!="number")return[];const o=Array.isArray(s.skillNames)?s.skillNames.filter(c=>typeof c=="string"&&!!c):[],l=Array.isArray(s.images)?s.images.flatMap(c=>{const u=Oa(c);return!u||typeof u.mimeType!="string"||!u.mimeType.startsWith("image/")||typeof u.data!="string"||!u.data?[]:[{mimeType:u.mimeType,data:u.data,...typeof u.name=="string"&&u.name?{name:u.name}:{},...typeof u.alt=="string"&&u.alt?{alt:u.alt}:{}}]}):[];return[{id:s.id,role:s.role,content:s.content,timestamp:s.timestamp,...o.length?{skillNames:o}:{},...l.length?{images:l}:{}}]});return{thread:n,threadId:t.threadId,messages:i,...typeof t.model=="string"?{model:t.model}:{},...typeof t.cwd=="string"?{cwd:t.cwd}:{},workspaceLocked:t.workspaceLocked===!0,permissions:DD(t.permissions)}}function X8(e){if(!e||typeof e!="object")return;const t=e;if(![t.totalTokens,t.inputTokens,t.cachedInputTokens,t.outputTokens,t.reasoningOutputTokens].some(i=>typeof i!="number"||!Number.isFinite(i)||i<0))return{totalTokens:Math.trunc(t.totalTokens),inputTokens:Math.trunc(t.inputTokens),cachedInputTokens:Math.trunc(t.cachedInputTokens),outputTokens:Math.trunc(t.outputTokens),reasoningOutputTokens:Math.trunc(t.reasoningOutputTokens)}}function Xtt(e){const t=X8(e.usage);if(!t||typeof e.turnId!="string")return;const n=X8(e.threadTotal),i=e.modelContextWindow;return{turnId:e.turnId,usage:t,...n?{threadTotal:n}:{},...typeof i=="number"&&Number.isFinite(i)&&i>=0?{modelContextWindow:Math.trunc(i)}:{}}}function Ytt(e){return typeof e.id!="string"||e.kind!=="command"&&e.kind!=="file"||typeof e.method!="string"?null:{id:e.id,kind:e.kind,method:e.method,...typeof e.reason=="string"?{reason:e.reason}:{},...typeof e.command=="string"?{command:e.command}:{},...typeof e.cwd=="string"?{cwd:e.cwd}:{},...typeof e.grantRoot=="string"?{grantRoot:e.grantRoot}:{},...e.changes!==void 0?{changes:e.changes}:{},...typeof e.threadId=="string"?{threadId:e.threadId}:{},...typeof e.turnId=="string"?{turnId:e.turnId}:{},...typeof e.itemId=="string"?{itemId:e.itemId}:{}}}function z2e(e={}){let t="";const n=[],i=new Map,r=new Map;let s,o;function l(){var h;const f=s?[...n,s]:n;(h=e.onBlocks)==null||h.call(e,[...f])}function c(f){t+=f;const h=n[n.length-1],m=n.length-1,g=[...i.values()].includes(m);(h==null?void 0:h.kind)==="text"&&!g?n[m]={...h,text:h.text+f}:n.push({kind:"text",text:f}),l()}function u(f){if(typeof f.id!="string"||f.kind!=="thinking"&&f.kind!=="commentary"&&f.kind!=="tool"||f.status!=="running"&&f.status!=="done"&&f.status!=="error")return;const h=f.status!=="running";let m;if(f.kind==="thinking")m={kind:"thinking",text:typeof f.text=="string"?f.text:"",done:h};else if(f.kind==="commentary"){if(typeof f.text!="string"||!f.text)return;m={kind:"text",text:f.text}}else{if(typeof f.name!="string"||!f.name)return;m={kind:"tool",name:f.name,args:f.args,response:f.response,status:f.status==="error"?"failed":h?"completed":"running",done:h}}m={...m,id:f.id,...typeof f.itemType=="string"?{itemType:f.itemType}:{},...typeof f.phase=="string"?{phase:f.phase}:{},...typeof f.durationMs=="number"?{durationMs:f.durationMs}:{}};const g=i.get(f.id);g===void 0?(i.set(f.id,n.length),n.push(m)):n[g]=m,l()}function d(f){var b,v,y,w;let h="message";const m=[];for(const x of f.split(/\r?\n/))x.startsWith("event:")&&(h=x.slice(6).trim()),x.startsWith("data:")&&m.push(x.slice(5).trimStart());if(m.length===0)return;let g;try{g=JSON.parse(m.join(` -`))}catch{throw new Error(Q("sandbox.invalidConversationResponse"))}if(h==="error"){const x=typeof g.message=="string"&&g.message?g.message:Q("sandbox.conversationFailed");throw new Bz(x,{code:typeof g.code=="string"?g.code:"",retryable:g.retryable===!0,publicMessage:x})}if(h==="progress"&&typeof g.text=="string"&&(s=g.text?{kind:"progress",text:g.text}:void 0,l()),["activity","delta","tool_output","tool_progress","plan","diff"].includes(h)&&(s=void 0),h==="activity"&&u(g),(h==="tool_output"||h==="tool_progress")&&typeof g.id=="string"){const x=i.get(g.id),k=x===void 0?void 0:n[x];if((k==null?void 0:k.kind)==="tool"&&x!==void 0&&typeof g.text=="string"){const S=Oa(k.response)||{};n[x]=h==="tool_progress"?{...k,progressText:g.text}:{...k,response:{...S,output:(g.snapshot?"":String(S.output||""))+g.text}},l()}}if((h==="plan"||h==="diff")&&typeof g.id=="string"){const x=typeof g.text=="string"?g.text:"",k=Array.isArray(g.items)?g.items:Array.isArray(g.plan)?g.plan:[],S=h==="diff"?{kind:"diff",id:g.id,text:x,done:g.status==="done"}:{kind:"plan",id:g.id,title:Q("developmentRuns.plan"),summary:x,done:g.status==="done",items:k.flatMap(A=>{const E=Oa(A);if(!E||typeof(E.text??E.step)!="string")return[];const j=E.status==="inProgress"?"in_progress":E.status;return[{text:String(E.text??E.step),status:j==="completed"||j==="failed"||j==="in_progress"?j:"pending"}]})},O=i.get(g.id);O===void 0?(i.set(g.id,n.length),n.push(S)):n[O]=S,l()}if(h==="development.source_ready"||h==="development.succeeded"){const x=Oa(g.payload),k=Oa(x==null?void 0:x.delivery),S=h==="development.succeeded";if(k&&typeof k.sessionId=="string"&&typeof k.artifactSha256=="string"&&typeof k.validationReportSha256=="string"&&typeof k.agentName=="string"&&typeof k.entryPoint=="string"&&typeof k.fileCount=="number"&&typeof k.artifactSize=="number"&&typeof k.validatedAt=="string"&&k.deployable===!0&&k.verified===S&&typeof k.validationSummary=="string"&&Array.isArray(k.gateSummary)&&k.gateSummary.every(O=>typeof O=="string")){const O={kind:"delivery",value:{sessionId:k.sessionId,...typeof k.projectId=="string"&&typeof k.versionId=="string"?{projectId:k.projectId,versionId:k.versionId,...k.parentVersionId===null||typeof k.parentVersionId=="string"?{parentVersionId:k.parentVersionId}:{}}:{},artifactSha256:k.artifactSha256,validationReportSha256:k.validationReportSha256,agentName:k.agentName,entryPoint:k.entryPoint,fileCount:k.fileCount,artifactSize:k.artifactSize,validatedAt:k.validatedAt,gateSummary:k.gateSummary,deployable:k.deployable,verified:k.verified,validationSummary:k.validationSummary}},A=n.findIndex(E=>E.kind==="delivery"&&E.value.sessionId===k.sessionId&&E.value.artifactSha256===k.artifactSha256&&E.value.validationReportSha256===k.validationReportSha256);A===-1?n.push(O):n[A]=O,l()}}if(h==="approval"){const x=Ytt(g);x&&((b=e.onApproval)==null||b.call(e,x))}if(h==="usage"){const x=Xtt(g);x&&(o=x,(v=e.onUsage)==null||v.call(e,x))}if(h==="approval_resolved"&&typeof g.approvalId=="string"&&((y=e.onApprovalResolved)==null||y.call(e,g.approvalId)),h==="delta"&&typeof g.text=="string")if(typeof g.id=="string"&&g.id){const x=r.get(g.id),k=x===void 0?void 0:n[x],S=((w=Oa(g))==null?void 0:w.snapshot)===!0;(k==null?void 0:k.kind)==="text"?n[x]={...k,phase:typeof g.phase=="string"&&g.phase?g.phase:k.phase,text:S?k.text.startsWith(g.text)?k.text:g.text:k.text+g.text}:(r.set(g.id,n.length),n.push({kind:"text",text:g.text,id:g.id,itemType:typeof g.itemType=="string"?g.itemType:void 0,phase:typeof g.phase=="string"?g.phase:void 0})),t=n.filter(O=>O.kind==="text").map(O=>O.text).join(""),l()}else c(g.text);if(h==="done"&&!t&&typeof g.text=="string"&&c(g.text),h==="done"){for(let x=0;x({text:t,blocks:n.map(f=>({...f})),...o?{usage:o}:{}})}}async function Ztt(e,t={}){if(!e.body)throw new Error(Q("sandbox.emptyConversationResponse"));const n=e.body.getReader(),i=new TextDecoder;let r="";const s=z2e(t);for(;;){const{done:l,value:c}=await n.read();r+=i.decode(c,{stream:!l});const u=r.split(/\r?\n\r?\n/);if(r=u.pop()??"",u.forEach(s.consumeFrame),l)break}r.trim()&&s.consumeFrame(r),s.consumeFrame(`event: done -data: {}`);const o=s.result();if(o.blocks.length===0)throw new Error(Q("sandbox.emptyReply"));return o}async function su(e,t,n,{method:i="GET",body:r,options:s={},fallback:o}){if(!t)throw new Error(Q("sandbox.missingSession"));const l=await yn(`${e}/${encodeURIComponent(t)}/${n}`,{method:i,headers:ys(r===void 0?void 0:{"Content-Type":"application/json"}),...r===void 0?{}:{body:JSON.stringify(r)},signal:s.signal},hp);if(!l.ok)throw await Bs(l,o);return l.json()}function V2e(e,t={}){return{async listSessions(n={}){const i=await yn(lJ(e,n),{method:"GET",headers:ys(),signal:n.signal},rJ);if(!i.ok)throw await Bs(i,Q("sandbox.listCodexFailed"));const r=await i.json();if(!Array.isArray(r.sessions))throw new Error(Q("sandbox.invalidSessionList"));if(r.snapshots!==void 0&&!Array.isArray(r.snapshots))throw new Error(Q("sandbox.invalidSnapshotList"));return[...r.sessions.map(s=>zb(s,"codex",t.intelligentDevelopment)),...(r.snapshots??[]).map(s=>oJ(s))]},async startSession(n={}){var s,o;const i=((s=n.displayName)==null?void 0:s.trim())??"",r=await yn(e,{method:"POST",headers:ys({"Content-Type":"application/json"}),body:JSON.stringify({displayName:t.textOnly&&n.projectId?Array.from(i).slice(0,G8).join(""):i,...(o=n.modelId)!=null&&o.trim()?{modelId:n.modelId.trim()}:{},...t.textOnly&&n.projectId?{projectId:n.projectId,...n.baseVersionId?{baseVersionId:n.baseVersionId}:{}}:{},...t.textOnly?{}:{persistent:n.persistent??!0},...n.diskGb!==void 0?{diskGb:n.diskGb}:{}}),signal:n.signal},E3);if(!r.ok)throw await Bs(r,Q("sandbox.startFailed"));return zb(await r.json(),"codex",t.intelligentDevelopment)},async listAgentSessions(n,i={}){const r=await yn(lJ(`/web/${n}/sessions`,i),{method:"GET",headers:ys(),signal:i.signal},rJ);if(!r.ok)throw await Bs(r,Q("sandbox.listAgentFailed",{kind:n}));const s=await r.json();if(!Array.isArray(s.sessions))throw new Error(Q("sandbox.invalidKindSessionList",{kind:n}));if(s.snapshots!==void 0&&!Array.isArray(s.snapshots))throw new Error(Q("sandbox.invalidKindSnapshotList",{kind:n}));return[...s.sessions.map(o=>zb(o,n)),...(s.snapshots??[]).map(o=>oJ(o,n))]},async startAgentSession(n,i={}){var s;const r=await yn(`/web/${n}/sessions`,{method:"POST",headers:ys({"Content-Type":"application/json"}),body:JSON.stringify({displayName:((s=i.displayName)==null?void 0:s.trim())??"",persistent:i.persistent??!0,...i.diskGb!==void 0?{diskGb:i.diskGb}:{}}),signal:i.signal},E3);if(!r.ok)throw await Bs(r,Q("sandbox.createAgentFailed",{kind:n}));return zb(await r.json(),n)},async openAgentSession(n,i,r={}){if(!i)throw new Error(Q("sandbox.missingSessionToOpen"));const s=await yn(`/web/${n}/sessions/${encodeURIComponent(i)}/open`,{method:"POST",headers:ys(),signal:r.signal},hp);if(!s.ok)throw await Bs(s,Q("sandbox.openAgentFailed",{kind:n}));const o=await s.json();if(typeof o.webuiUrl!="string"||!o.webuiUrl.startsWith("/"))throw new Error(Q("sandbox.invalidAgentHomeUrl",{kind:n}));return{session:zb(o,n),kind:n,webuiUrl:Na(o.webuiUrl)}},async launchAgentTerminal(n,i,r={}){if(!i)throw new Error(Q("sandbox.missingSessionForTerminal"));const s=await yn(`/web/${n}/sessions/${encodeURIComponent(i)}/terminal`,{method:"POST",headers:ys(),signal:r.signal},hp);if(!s.ok)throw await Bs(s,Q("sandbox.openTerminalFailed",{kind:n}));const o=await s.json();return{url:H2e(o.url,`${n} Terminal`),...typeof o.shellSessionId=="string"?{shellSessionId:o.shellSessionId}:{}}},async deleteAgentSession(n,i,r={}){if(!i)return;const s=await yn(`/web/${n}/sessions/${encodeURIComponent(i)}`,{method:"DELETE",headers:ys(),signal:r.signal},uO);if(!s.ok&&s.status!==404)throw await Bs(s,Q("sandbox.deleteAgentFailed",{kind:n}))},async resumeSnapshot(n,i,r={}){if(!i)throw new Error(Q("sandbox.missingSnapshot"));const s=n==="codex"?"/web/sandbox":`/web/${n}`,o=await yn(`${s}/snapshots/${encodeURIComponent(i)}/resume`,{method:"POST",headers:ys(),signal:r.signal},E3);if(!o.ok)throw await Bs(o,Q("sandbox.resumeSnapshotFailed"));return zb(await o.json(),n)},async deleteSnapshot(n,i,r={}){if(!i)return;const s=n==="codex"?"/web/sandbox":`/web/${n}`,o=await yn(`${s}/snapshots/${encodeURIComponent(i)}`,{method:"DELETE",headers:ys(),signal:r.signal},uO);if(!o.ok&&o.status!==404)throw await Bs(o,Q("sandbox.deleteSnapshotFailed"))},async connectSession(n,i={}){if(!n)throw new Error(Q("sandbox.missingSessionToConnect"));const r=await yn(`${e}/${encodeURIComponent(n)}/connect`,{method:"POST",headers:ys({"Content-Type":"application/json"}),signal:i.signal},ztt);if(!r.ok)throw await Bs(r,Q("sandbox.connectCodexFailed"));const s=zb(await r.json(),"codex",t.intelligentDevelopment);if(s.status.toLowerCase()!=="ready")throw new Error(Q("sandbox.sessionNotReady",{status:s.status}));return s},async sendMessage(n,i={}){var s;if(!n.sessionId||!n.text.trim())throw new Error(Q("sandbox.invalidMessage"));const r=await yn(`${e}/${encodeURIComponent(n.sessionId)}/messages`,{method:"POST",headers:ys({Accept:"text/event-stream","Content-Type":"application/json"}),body:JSON.stringify({message:n.text,...!t.textOnly&&((s=n.skillIds)!=null&&s.length)?{skillIds:n.skillIds}:{}}),signal:i.signal},t.messageTimeoutMs??Vtt);if(!r.ok)throw await Bs(r,Q("sandbox.conversationFailed"));return Ztt(r,i)},async interruptSession(n,i={}){if(!n)return;const r=await yn(`${e}/${encodeURIComponent(n)}/interrupt`,{method:"POST",headers:ys(),signal:i.signal},t.interruptTimeoutMs??uO);if(!r.ok&&![404,409].includes(r.status))throw await Bs(r,Q("sandbox.interruptFailed"))},async getStatus(n,i={}){const r=await su(e,n,"status",{options:i,fallback:Q("sandbox.getStatusFailed")}),s=cJ(r),o=Oa(r),l=X8(o==null?void 0:o.threadTotal),c=o==null?void 0:o.modelContextWindow;return{...s,...l?{threadTotal:l}:{},...typeof c=="number"&&Number.isFinite(c)&&c>=0?{modelContextWindow:Math.trunc(c)}:{}}},async getEndpoint(n,i={}){const r=Oa(await su(e,n,"endpoint",{options:i,fallback:Q("sandbox.getEndpointFailed")}));if(typeof(r==null?void 0:r.endpoint)!="string"||!r.endpoint.trim())throw new Error(Q("sandbox.invalidEndpoint"));return{endpoint:r.endpoint,sessionId:typeof r.sessionId=="string"?r.sessionId:n,...typeof r.expireAt=="string"?{expireAt:r.expireAt}:{}}},async createCodexProjectHandoffPairing(n={}){const i=await yn(`${iJ}/pairings`,{method:"POST",headers:ys({Accept:"application/json","Content-Type":"application/json"}),body:JSON.stringify({ttlSeconds:qtt}),signal:n.signal},sJ);if(!i.ok)throw await Bs(i,Q("sandbox.createHandoffPairingFailed"));const r=Oa(await aJ(i,Q("sandbox.createHandoffPairingFailed")));if(typeof(r==null?void 0:r.pairingCode)!="string"||!r.pairingCode.trim()||typeof r.expireAt!="string"||!r.expireAt.trim())throw new Error(Q("sandbox.invalidHandoffPairing"));const s=typeof r.studioUrl=="string"&&r.studioUrl.trim()?r.studioUrl.trim():window.location.origin;return{pairingCode:r.pairingCode,expireAt:r.expireAt,studioUrl:s}},async getCodexProjectHandoffStatus(n,i={}){const r=await yn(`${iJ}/pairings/${encodeURIComponent(n)}`,{headers:ys({Accept:"application/json"}),signal:i.signal},sJ);if(!r.ok)throw await Bs(r,Q("sandbox.getHandoffStatusFailed"));const s=Oa(await aJ(r,Q("sandbox.getHandoffStatusFailed"))),o=new Set(["issued","creating","session-created","continuing","running","completed","failed"]);if(typeof(s==null?void 0:s.state)!="string"||!o.has(s.state)||typeof s.expireAt!="string"||!s.expireAt.trim())throw new Error(Q("sandbox.invalidHandoffStatus"));return{state:s.state,expireAt:s.expireAt,...typeof s.projectName=="string"?{projectName:s.projectName}:{},...typeof s.agentName=="string"?{agentName:s.agentName}:{},...typeof s.sessionId=="string"?{sessionId:s.sessionId}:{},...typeof s.error=="string"?{error:s.error}:{},...s.failedStage==="creating-session"||s.failedStage==="uploading-project"||s.failedStage==="restoring-project"||s.failedStage==="continuing-task"?{failedStage:s.failedStage}:{}}},async listModels(n,i={}){const r=Oa(await su(e,n,"models",{options:i,fallback:Q("sandbox.listModelsFailed")}));if(!Array.isArray(r==null?void 0:r.models))throw new Error(Q("sandbox.invalidModelList"));return r.models.flatMap(s=>{const o=Ktt(s);return o?[o]:[]})},async setModel(n,i,r={}){const s=Oa(await su(e,n,"model",{method:"PUT",body:{model:i},options:r,fallback:Q("sandbox.setModelFailed")}));if(typeof(s==null?void 0:s.model)!="string"||!s.model)throw new Error(Q("sandbox.invalidModel"));return s.model},async listSkills(n,i=!1,r={}){const o=Oa(await su(e,n,`skills${i?"?force_reload=true":""}`,{options:r,fallback:Q("sandbox.listSkillsFailed")}));if(!Array.isArray(o==null?void 0:o.skills))throw new Error(Q("sandbox.invalidSkillList"));return o.skills.flatMap(l=>{const c=Gtt(l);return c?[c]:[]})},async listThreads(n,i={},r={}){const s=new URLSearchParams;i.cursor&&s.set("cursor",i.cursor),i.search&&s.set("search",i.search),i.archived&&s.set("archived","true");const o=s.size?`?${s}`:"",l=Oa(await su(e,n,`threads${o}`,{options:r,fallback:Q("sandbox.listThreadsFailed")}));if(!Array.isArray(l==null?void 0:l.threads))throw new Error(Q("sandbox.invalidThreadList"));return{threads:l.threads.flatMap(c=>{const u=Q2e(c);return u?[u]:[]}),...typeof l.nextCursor=="string"?{nextCursor:l.nextCursor}:{}}},async newThread(n,i={}){return cy(await su(e,n,"threads/new",{method:"POST",options:i,fallback:Q("sandbox.createThreadFailed")}))},async readThread(n,i,r={}){if(!i)throw new Error(Q("sandbox.missingThread"));return cy(await su(e,n,`threads/${encodeURIComponent(i)}`,{options:r,fallback:Q("sandbox.readThreadFailed")}))},async resumeThread(n,i,r={}){return cy(await su(e,n,"threads/resume",{method:"POST",body:{threadId:i},options:r,fallback:Q("sandbox.resumeThreadFailed")}))},async forkThread(n,i={}){return cy(await su(e,n,"threads/fork",{method:"POST",options:i,fallback:Q("sandbox.forkThreadFailed")}))},async archiveThread(n,i,r={}){const s=Oa(await su(e,n,"threads/archive",{method:"POST",body:{threadId:i},options:r,fallback:Q("sandbox.archiveThreadFailed")}));if((s==null?void 0:s.archived)!==!0)throw new Error(Q("sandbox.invalidArchiveResult"));return{archived:!0,...s.thread?{snapshot:cy(s)}:{}}},async deleteThread(n,i,r={}){const s=Oa(await su(e,n,"threads/delete",{method:"POST",body:{threadId:i},options:r,fallback:Q("sandbox.deleteThreadFailed")}));if((s==null?void 0:s.deleted)!==!0)throw new Error(Q("sandbox.invalidDeleteResult"));return{deleted:!0,...s.thread?{snapshot:cy(s)}:{}}},async compactThread(n,i={}){await su(e,n,"threads/compact",{method:"POST",options:i,fallback:Q("sandbox.compactThreadFailed")})},async getSettings(n,i={}){const r=await yn(`${e}/${encodeURIComponent(n)}/settings`,{method:"GET",headers:ys(),signal:i.signal},hp);if(!r.ok)throw await Bs(r,Q("sandbox.getSettingsFailed"));return cJ(await r.json())},async updatePermissions(n,i,r={}){const s=await yn(`${e}/${encodeURIComponent(n)}/permissions`,{method:"PUT",headers:ys({"Content-Type":"application/json"}),body:JSON.stringify(i),signal:r.signal},hp);if(!s.ok)throw await Bs(s,Q("sandbox.updatePermissionsFailed"));const o=await s.json();return DD(o.permissions)},async updateWorkspace(n,i,r={}){const s=await yn(`${e}/${encodeURIComponent(n)}/workspace`,{method:"PUT",headers:ys({"Content-Type":"application/json"}),body:JSON.stringify({cwd:i}),signal:r.signal},hp);if(!s.ok)throw await Bs(s,Q("sandbox.updateWorkspaceFailed"));const o=await s.json();if(typeof o.cwd!="string"||!o.cwd)throw new Error(Q("sandbox.invalidWorkingDirectory"));return o.cwd},async listDirectories(n,i,r={}){const s=new URLSearchParams({path:i}),o=await yn(`${e}/${encodeURIComponent(n)}/directories?${s}`,{method:"GET",headers:ys(),signal:r.signal},hp);if(!o.ok)throw await Bs(o,Q("sandbox.listDirectoriesFailed"));const l=await o.json();if(typeof l.path!="string"||!Array.isArray(l.directories)||l.directories.some(c=>!c||typeof c.name!="string"||typeof c.path!="string"))throw new Error(Q("sandbox.invalidDirectoryList"));return{path:l.path,...typeof l.parent=="string"?{parent:l.parent}:{},directories:l.directories}},async resolveApproval(n,i,r,s={}){const o=await yn(`${e}/${encodeURIComponent(n)}/approvals/${encodeURIComponent(i)}`,{method:"POST",headers:ys({"Content-Type":"application/json"}),body:JSON.stringify({decision:r}),signal:s.signal},hp);if(!o.ok)throw await Bs(o,Q("sandbox.resolveApprovalFailed"))},async launchTerminal(n,i={}){return uJ(e,n,"terminal",i)},async launchBrowser(n,i={}){return uJ(e,n,"browser",i)},async uploadFile(n,i,r={}){const s=new FormData;s.set("file",i,i.name);const o=await yn(`${e}/${encodeURIComponent(n)}/files`,{method:"POST",headers:ys(),body:s,signal:r.signal},Htt);if(!o.ok)throw await Bs(o,Q("sandbox.uploadFileFailed"));const l=await o.json();if(typeof l.id!="string"||typeof l.path!="string"||typeof l.name!="string"||typeof l.mimeType!="string"||typeof l.sizeBytes!="number")throw new Error(Q("sandbox.invalidUploadResult"));return l},async closeSession(n,i={}){if(!n)return;const r=await yn(`${e}/${encodeURIComponent(n)}/disconnect`,{method:"POST",headers:ys(),signal:i.signal},uO);if(!r.ok&&r.status!==404)throw await Bs(r,Q("sandbox.disconnectCodexFailed"))},async deleteSession(n,i={}){if(!n)return;const r=await yn(`${e}/${encodeURIComponent(n)}`,{method:"DELETE",headers:ys(),signal:i.signal},uO);if(!r.ok&&r.status!==404)throw await Bs(r,Q("sandbox.deleteCodexFailed"))}}}const Hr=V2e(Qtt),P0=V2e("/web/intelligent-development/sessions",{textOnly:!0,messageTimeoutMs:36e5,interruptTimeoutMs:45e3,intelligentDevelopment:!0});async function uJ(e,t,n,i){const r=await yn(`${e}/${encodeURIComponent(t)}/${n}`,{method:"POST",headers:ys(),signal:i.signal},hp);if(!r.ok)throw await Bs(r,Q(n==="terminal"?"sandbox.openSandboxTerminalFailed":"sandbox.openSandboxBrowserFailed"));const s=await r.json();return{url:H2e(s.url,Q("sandbox.toolLabel")),...typeof s.shellSessionId=="string"?{shellSessionId:s.shellSessionId}:{}}}function H2e(e,t){if(typeof e!="string")throw new Error(Q("sandbox.invalidToolUrl",{label:t}));if(e.startsWith("/"))return Na(e);let n;try{n=new URL(e)}catch{throw new Error(Q("sandbox.invalidToolUrl",{label:t}))}const i=n.protocol==="http:"&&window.location.protocol==="http:";if(n.protocol!=="https:"&&!i)throw new Error(Q("sandbox.unsafeToolUrl",{label:t}));return n.toString()}const yu=e=>["succeeded","cancelled","failed"].includes(e.state),q2e="/web/intelligent-development";class Yw extends Error{constructor(t,n){super(t),this.status=n}}async function Vb(e,t="GET",n,i){const r=await yn(`${q2e}${e}`,{method:t,signal:i,headers:ys(n===void 0?void 0:{"Content-Type":"application/json"}),...n===void 0?{}:{body:JSON.stringify(n)}},3e4);if(!r.ok){const s=await r.json().catch(()=>null),o=s==null?void 0:s.detail;throw new Yw(typeof o=="string"?o:(o==null?void 0:o.message)||Q("developmentRuns.requestFailed"),r.status)}return r.json()}function D0(e){const t=e;if(!t||typeof t.runId!="string"||typeof t.sessionId!="string"||!["queued","running","recovering","waiting_user","stopping","succeeded","cancelled","failed"].includes(t.state))throw new Error(Q("developmentRuns.invalidResponse"));return t}const Yd={async active(e){const t=await Vb("/runs","GET",void 0,e);if(!Array.isArray(t.runs))throw new Error(Q("developmentRuns.invalidResponse"));return t.runs.map(D0)},async get(e,t){return D0(await Vb(`/runs/${encodeURIComponent(e)}`,"GET",void 0,t))},async list(e,t){const n=await Vb(`/sessions/${encodeURIComponent(e)}/runs`,"GET",void 0,t);if(!Array.isArray(n.runs))throw new Error(Q("developmentRuns.invalidResponse"));return n.runs.map(D0)},async create(e,t,n){return D0(await Vb(`/sessions/${encodeURIComponent(e)}/runs`,"POST",{message:t,requestId:n}))},async steer(e,t,n){await Vb(`/runs/${encodeURIComponent(e)}/inputs`,"POST",{message:t,clientId:n})},async stop(e){return D0(await Vb(`/runs/${encodeURIComponent(e)}/stop`,"POST"))},async resume(e){return D0(await Vb(`/runs/${encodeURIComponent(e)}/resume`,"POST"))}};class Jtt{constructor(t){Zt(this,"cursor",0);Zt(this,"turns",[]);Zt(this,"activeInput");Zt(this,"itemTurns",new Map);Zt(this,"nativeInputs",new Map);Zt(this,"metrics",new Map);Zt(this,"inputOrder",[]);Zt(this,"projections",new Map);Zt(this,"itemInputs",new Map);this.run=t,this.activeInput=t.requestId}projection(t){let n=this.projections.get(t);if(!n){const i={role:"assistant",blocks:[],meta:{localId:`${t}:assistant`}},r=this.turns.findIndex(s=>{var o;return((o=s.meta)==null?void 0:o.localId)===`${t}:user`});this.turns.splice(r<0?this.turns.length:r+1,0,i),n=z2e({onBlocks:s=>{i.blocks=s.map(o=>({...o,turnId:this.itemTurns.get(o.id||"")}))},onUsage:s=>{i.meta={...i.meta,sandboxUsage:s.usage}}}),this.projections.set(t,n)}return n}apply(t){if(t.payload.runId!==this.run.runId)throw new Error(Q("developmentRuns.invalidResponse"));if(t.seq<=this.cursor)return;if(t.seq!==this.cursor+1)throw new Error(Q("developmentRuns.eventGap"));for(const i of this.turns)i.blocks.some(r=>r.kind==="turn-summary")&&(i.blocks=i.blocks.filter(r=>r.kind!=="turn-summary"));const n=t.payload;if(t.type==="run.input"&&typeof n.clientId=="string"&&typeof n.message=="string")this.turns.push({role:"user",blocks:[{kind:"text",text:n.message}],meta:{localId:`${n.clientId}:user`},activity:{id:`${n.clientId}:delivery`,title:Q(`developmentRuns.input.${String(n.status)}`)}}),this.inputOrder.push(n.clientId),this.projection(n.clientId),n.status==="delivered"&&this.inputOrder.indexOf(n.clientId)>=this.inputOrder.indexOf(this.activeInput)&&(this.activeInput=n.clientId);else if(t.type==="run.input_status"&&typeof n.clientId=="string"){const i=this.turns.find(r=>{var s;return((s=r.meta)==null?void 0:s.localId)===`${n.clientId}:user`});i&&(i.activity={id:`${n.clientId}:delivery`,title:Q(`developmentRuns.input.${String(n.status)}`)}),n.status==="delivered"&&this.inputOrder.indexOf(n.clientId)>=this.inputOrder.indexOf(this.activeInput)&&(this.activeInput=n.clientId)}else if(t.type==="run.turn"&&typeof n.turnId=="string"){const r={...this.metrics.get(n.turnId),turnId:n.turnId,status:String(n.status||"inProgress"),toolCalls:0,toolDurationComplete:!1};for(const s of["startedAt","completedAt","durationMs"])typeof n[s]=="number"&&Number.isFinite(n[s])&&n[s]>=0&&(r[s]=n[s]);if(typeof n.model=="string"&&(r.model=n.model),n.usage&&typeof n.usage=="object"&&!Array.isArray(n.usage)){const s={};for(const o of["totalTokens","inputTokens","outputTokens","cachedInputTokens","cacheWriteInputTokens","reasoningOutputTokens"]){const l=n.usage[o];typeof l=="number"&&Number.isSafeInteger(l)&&l>=0&&(s[o]=l)}r.usage=s}n.usageIncomplete===!0&&(r.usageIncomplete=!0),this.metrics.set(n.turnId,r),this.nativeInputs.set(n.turnId,this.activeInput),this.projection(this.activeInput)}else if(t.type==="run.status"){if(this.run={...this.run,...n},yu(this.run))for(const[i,r]of this.metrics)r.status==="inProgress"&&this.metrics.set(i,{...r,status:"unavailable",usageIncomplete:!0});if(yu(this.run)||this.run.state==="waiting_user")for(const i of this.projections.values())i.consumeFrame(`event: done +${n}`}}async function*Uet({runtimeId:e,region:t,instanceName:n,sessionId:i,follow:r=!0,signal:s}){const o=new URLSearchParams({region:t,follow:String(r)});n&&o.set("instance_name",n),i&&o.set("session_id",i);const l=await fetch(Na(`/web/runtime-logs/${encodeURIComponent(e)}/stream?${o.toString()}`),{headers:hl(oc({Accept:"text/event-stream"})),cache:"no-store",signal:s});if(!l.ok)throw new Error(Q("runtimeLogs.loadFailedWithDetail",{detail:await Bet(l)}));for await(const c of BA(l)){if(!Fet(c))throw new Error(Q("runtimeLogs.invalidFormat"));yield c}}const Qet=255,zet=/[\p{L}\p{M}\p{N}\p{P}\p{Zs}]/u;function Vet(e){const t=e.normalize("NFKC").replace(/\s+/gu," ").trim(),n=new TextEncoder;let i=0,r="";for(const s of t){if(!zet.test(s))continue;const o=n.encode(s).byteLength;if(i+o>Qet)break;r+=s,i+=o}return r.replace(/ +/g," ").trimEnd()}const Het=/RunPipeline result could not be reconciled|Polling build status failed/i;class oN extends Error{constructor({taskId:n,cause:i}={}){super("The deployment request may still be running, but its status could not be confirmed.");Zt(this,"taskId");this.name="DeploymentStatusUnconfirmedError",this.taskId=n}}function KAe(e){if(e instanceof oN)return!0;const t=e instanceof Error?e.message:String(e??"");return Het.test(t)}function GAe(e){return!!(e&&typeof e=="object"&&"name"in e&&e.name==="AbortError")}async function qet({load:e,signal:t,timeoutMs:n=30*6e4,intervalMs:i=2e3,shouldRetry:r=()=>!0}){if(t!=null&&t.aborted)throw t.reason??new DOMException("Aborted","AbortError");const s=Date.now()+Math.max(0,n);for(;!(t!=null&&t.aborted)&&Date.now()<=s;){try{const o=await e(t);if(o.done)return o}catch(o){if(t!=null&&t.aborted||GAe(o)||!r(o))throw o}if(t!=null&&t.aborted)throw t.reason??new DOMException("Aborted","AbortError");i<=0||await new Promise((o,l)=>{const c=()=>{globalThis.clearTimeout(u),t==null||t.removeEventListener("abort",c),l((t==null?void 0:t.reason)??new DOMException("Aborted","AbortError"))},u=globalThis.setTimeout(()=>{t==null||t.removeEventListener("abort",c),o()},i);t==null||t.addEventListener("abort",c,{once:!0})})}return null}const I8="ap-southeast-1",gz="cn-beijing",Wet="https://ark.ap-southeast.bytepluses.com/api/v3",Ket="https://ark.cn-beijing.volces.com/api/v3/",Get="https://console.byteplus.com/ark/region:ark+ap-southeast-1/openManagement",Xet="https://console.volcengine.com/ark/region:ark+cn-beijing/openManagement",Yet="dola-seed-2-1-turbo-260628",Zet="doubao-seed-2-1-pro-260628",Jet="skylark-embedding-vision-250615",ett="doubao-embedding-vision-250615",ttt="seed-2-0-lite-260228",ntt="doubao-seed-2-0-lite-260428",itt="dola-seedream-5-0-pro-260628",rtt="doubao-seedream-5-0-260128",stt="seededit-3-0-i2i-250628",att="doubao-seededit-3-0-i2i-250628",ott="dreamina-seedance-2-0-260128",ltt="doubao-seedance-2-0-260128";function Pu(e){return e==="byteplus"?[{value:I8,label:I8}]:[{value:"cn-beijing",label:Q("cloudRegion.cnBeijing")},{value:"cn-shanghai",label:Q("cloudRegion.cnShanghai")}]}function nr(e){var t;return((t=Pu(e)[0])==null?void 0:t.value)||gz}const ctt=new Set(["cn-beijing","cn-shanghai","ap-southeast-1"]);function ED(e){return typeof e=="string"&&ctt.has(e)}function Sh(e,t){var i;return((i=(t?Pu(t):[...Pu("volcengine"),...Pu("byteplus")]).find(r=>r.value===e))==null?void 0:i.label)||e||"-"}function Xp(e){return e==="byteplus"?Yet:Zet}function Fo(e){return e==="byteplus"?Wet:Ket}function utt(e){return e==="byteplus"?Get:Xet}function dtt(e){return e==="byteplus"?Jet:ett}function ftt(e){return e==="byteplus"?ttt:ntt}function htt(e){return e==="byteplus"?itt:rtt}function ptt(e){return e==="byteplus"?stt:att}function mtt(e){return e==="byteplus"?ott:ltt}const bz="veadk.messageFeedback.v1";function yz(e,t,n,i){return[e,t,n,i].join(":")}function vz(){if(typeof window>"u")return{};try{const e=JSON.parse(localStorage.getItem(bz)??"{}");return e&&typeof e=="object"?e:{}}catch{return{}}}function gtt(e,t,n){if(typeof window>"u")return;const i=vz();i[e]={...i[e]??{},[`veadk_feedback:${t}`]:n},localStorage.setItem(bz,JSON.stringify(i))}function XAe(e){if(typeof window>"u")return;const t=yz(e.runtimeId,e.appName,e.userId,e.sessionId),n=vz(),i=n[t];if(i){for(const r of e.eventIds)delete i[`veadk_feedback:${r}`];Object.keys(i).length===0?delete n[t]:n[t]=i,localStorage.setItem(bz,JSON.stringify(n))}}const lN="",xz=new Map;function YAe(e,t){xz.set(e,t)}function ZAe(){xz.clear()}function Pa(e){const t=xz.get(e);return t?{app:t.app,ep:{base:t.base,apiKey:t.apiKey,runtimeId:t.runtimeId,mpaInstanceId:t.mpaInstanceId,region:t.region,agentCategory:t.agentCategory}}:{app:e,ep:{}}}function Q1(e,t){return e!=="a2a-default"&&!!(t.runtimeId&&(t.agentCategory==="mpa"||t.mpaInstanceId))}async function mt(e,t={},n={},i=eo){const r=po(t.signal,i),s=!!n.runtimeId&&String(t.method??"GET").toUpperCase()==="DELETE",o={...t,...s?{method:"POST"}:{},headers:hl(oc(t.headers))},l=()=>{const d={...o,signal:r};if(n.runtimeId){const f=new URLSearchParams;n.region&&f.set("_runtime_region",n.region),n.retryProbe&&f.set("probe_retry","connect"),s&&f.set("_method","DELETE");const h=f.toString()?`${e.includes("?")?"&":"?"}${f.toString()}`:"";return fetch(Na(`${lN}/web/runtime-proxy/${n.runtimeId}${e}${h}`),d)}if(n.base){const f=new Headers(d.headers);return f.set("X-AgentKit-Base",n.base),n.apiKey&&f.set("X-AgentKit-Key",n.apiKey),fetch(Na(`${lN}/agentkit-proxy${e}`),{...d,headers:f})}return fetch(Na(`${lN}${e}`),d)},c=async d=>{if(d.headers.get("X-Studio-Error-Source")==="upstream")return!1;if(Cet(d))return!0;if(d.status!==401)return!1;try{return await xet()}catch{return!1}};let u=await l();for(;await c(u);)await Aet(r),u=await l();return u}function yn(e,t={},n=eo){return mt(e,t,{},n)}function JAe(e){return typeof e=="string"?e:Array.isArray(e)?e.map(t=>{var n;if(t&&typeof t=="object"&&"msg"in t){const i=Array.isArray(t.loc)?(n=t.loc)==null?void 0:n.join("."):"",r=String(t.msg??"");return i?`${i}: ${r}`:r}return String(t)}).filter(Boolean).join(` +`):e&&typeof e=="object"?JSON.stringify(e):""}async function btt(e){const t=await e.clone().text().catch(()=>"");if(!t)return"";try{const n=JSON.parse(t),i=n.detail??n.error;if(typeof i=="string")return i;if(i&&typeof i=="object"&&"code"in i)return String(i.code??"")}catch{return""}return""}async function Ht(e,t){const n=e.headers.get("X-Studio-Error-Source"),i=n==="upstream"?e.headers.get("X-Studio-Upstream-Status")??e.status:e.status,r=Q("common.fallbackWithHttpStatus",{fallback:t,status:i}),s=await e.text().catch(()=>"");if(n==="upstream")return Q("client.errorWithCloudResponse",{context:r,action:e.headers.get("X-Studio-Upstream-Action")??"",response:s||Q("client.emptyCloudResponse")});if(!s)return r;try{const o=JSON.parse(s),l=JAe(o.detail??o.error);return n==="transport"||n==="studio"?l?`${r} +${l}`:r:l?Q("client.errorWithDetailAndRawResponse",{context:r,detail:l,response:s}):Q("client.errorWithRawResponse",{context:r,response:s})}catch{return Q("client.errorWithRawResponse",{context:r,response:s})}}async function ytt(e){const t=await Ht(e,Q("client.mpaRuntimeSessionsLoadFailed"));return e.status===401&&/X-Jwt-Token/i.test(t)?Q("client.mpaRuntimeLegacyAuthUnsupported",{detail:t}):t}async function wz(e,t=!1){const n=await mt(`/web/model-api-keys${t?"?refresh=true":""}`,{signal:e,cache:"no-store"});if(!n.ok)throw new Error(await Ht(n,Q("client.loadArkApiKeysFailed")));return await n.json()}async function eTe(e,t){const n=await mt(`/web/model-api-keys/${encodeURIComponent(e)}/value`,{method:"POST",signal:t,cache:"no-store"});if(!n.ok)throw new Error(await Ht(n,Q("client.loadArkApiKeysFailed")));return await n.json()}async function z1(e){const t=new URLSearchParams;e!=null&&e.apiKeyId&&t.set("apiKeyId",e.apiKeyId),e!=null&&e.refresh&&t.set("refresh","true"),e!=null&&e.scope&&t.set("scope",e.scope);const n=t.toString(),i=await mt(`/web/model-options${n?`?${n}`:""}`,{signal:e==null?void 0:e.signal,cache:"no-store"});if(!i.ok)throw new Error(await Ht(i,Q("client.loadModelsFailed")));return await i.json()}async function tTe(){const e=await mt("/list-apps");if(!e.ok)throw new Error(`list-apps failed: ${e.status}`);return e.json()}class V1 extends Error{constructor(){super(Q("client.runtimeAccessDenied")),this.name="RuntimeAccessDeniedError"}}class Ea extends Error{constructor(t,n=!1,i=!1){super(t),this.unsupported=n,this.retryable=i,this.name="RuntimeProbeError"}}const nTe=()=>Q("client.privateRuntimeUnavailable"),iTe=()=>Q("client.runtimeTemporarilyUnavailable"),ZZ=["cn-beijing","cn-shanghai"],vtt=3e4,H1=5*60*1e3,rTe=60*1e3;let oC="volcengine";const iw=new Map,oy=new Map,ly=new Map,ef=new Map,os=new Map;function kz(e,t,n){return`${t}:${e}:${n??""}`}function sTe(e){e!==oC&&os.clear(),oC=e}function UA(e){const t=(e||"").trim();if(oC==="byteplus")return[t&&!t.startsWith("cn-")?t:I8];const n=t&&!t.startsWith("ap-")?t:gz;return ZZ.includes(n)?[n,...ZZ.filter(i=>i!==n)]:[n]}function CD(e){const t=(e||"").trim();return t?[t]:UA()}function Mv(...e){return e.map(t=>String(t??"")).join("")}function kb(e,t,n){const i=e.get(t);return i!=null&&i.value&&Date.now()-i.updatedAt<=n?i.value:null}function Oz(e,t,n){return e.set(t,{value:n,updatedAt:Date.now()}),n}function Y2(e,t){return t?t.aborted?Promise.reject(new DOMException("The operation was aborted.","AbortError")):new Promise((n,i)=>{const r=()=>{i(new DOMException("The operation was aborted.","AbortError"))};t.addEventListener("abort",r,{once:!0}),e.then(s=>{t.removeEventListener("abort",r),n(s)},s=>{t.removeEventListener("abort",r),i(s)})}):e}async function aTe(e){try{const t=await e.clone().json();return typeof t.detail=="string"?t.detail:""}catch{return""}}async function QA(e,t,n,i,r=eo){const s=await mt("/list-apps",{signal:i},n??{base:e,apiKey:t},r),o=n!=null&&n.runtimeId?await aTe(s):"";if(n!=null&&n.runtimeId&&o==="runtime_access_denied")throw new V1;if(n!=null&&n.runtimeId&&o==="runtime_private_endpoint_unreachable")throw new Ea(nTe());if(n!=null&&n.runtimeId&&["runtime_proxy_connect_error","runtime_proxy_timeout","runtime_json_connect_error","runtime_json_timeout"].includes(o))throw new Ea(iTe(),!1,!0);if(n!=null&&n.runtimeId&&s.status===404)throw new Ea(Q("client.runtimeConnectionUnsupported"),!0,!0);if(n!=null&&n.runtimeId&&(s.status===401||s.status===403))throw new Ea(Q("client.runtimeConnectionDenied"));if(!s.ok)throw new Error(await Ht(s,Q("client.listAgentsFailed")));let l;try{l=await s.json()}catch{throw new Ea(Q("client.invalidListAppsJson"))}if(!Array.isArray(l)||l.some(u=>typeof u!="string"||!u.trim()))throw new Ea(Q("client.invalidListAppsFormat"));const c=l.map(u=>u.trim());return n!=null&&n.runtimeId&&iw.set(kz(n.runtimeId,n.region??"",n.runtimeVersion),{apps:c,expiresAt:Date.now()+vtt}),c}async function oTe(e,t){const{app:n,ep:i}=Pa(e);if(Q1(n,i)){const o=await xtt(i),l=await mt(`/api/v1/agents/${encodeURIComponent(o)}/profile-status`,{cache:"no-store"},i),c=!l.ok&&await btt(l)==="profile_not_found";if(!l.ok&&!c){const m=Q("client.createSessionFailedWithStatus",{status:l.status}),g=await Ht(l,Q("client.createSessionFailed"));throw new Error(g===m?m:Q("common.fallbackWithDetail",{fallback:m,detail:g}))}const u=c?{}:await l.json(),d=Number(u.profileRevision??0),f=await mt("/api/v1/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mpaInstanceId:o,profileRevision:d})},i);if(!f.ok){const m=Q("client.createSessionFailedWithStatus",{status:f.status}),g=await Ht(f,Q("client.createSessionFailed"));throw new Error(g===m?m:Q("common.fallbackWithDetail",{fallback:m,detail:g}))}const h=await f.json();return String(h.sessionId??h.id??"")}const r=await mt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"},i);if(!r.ok){const o=Q("client.createSessionFailedWithStatus",{status:r.status}),l=await Ht(r,Q("client.createSessionFailed"));throw new Error(l===o?o:Q("common.fallbackWithDetail",{fallback:o,detail:l}))}return(await r.json()).id}async function xtt(e){var i,r,s,o;const t=(i=e.mpaInstanceId)==null?void 0:i.trim();if(t)return t;const n=((r=e.runtimeId)==null?void 0:r.trim())??"";if(!n)return"";try{const l=await ID(n,e.region??"cn-beijing"),c=(s=l.mpaInstanceId)==null?void 0:s.trim();if(c)return c;const u=(o=l.envs.find(d=>d.key==="MPA_AGENT_ID"))==null?void 0:o.value.trim();if(u)return u}catch{}return n}async function Sz(e,t){const{app:n,ep:i}=Pa(e);if(Q1(n,i)){const s=await mt("/api/v1/sessions",{cache:"no-store"},i);if(!s.ok)throw new Error(await ytt(s));const o=await s.json();return Array.isArray(o)?o:o.sessions??[]}const r=await mt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{},i);if(!r.ok)throw new Error(await Ht(r,Q("client.listSessionsFailed")));return r.json()}async function lC(e,t,n){const{app:i,ep:r}=Pa(e);if(Q1(i,r)){const l=await mt(`/api/v1/sessions/${encodeURIComponent(n)}`,{cache:"no-store"},r);if(!l.ok){const f=await Ht(l,Q("client.getSessionFailed"));throw new Error(Q("client.getSessionFailedWithDetail",{status:l.status,detail:f}))}const c=await l.json(),u=await mt(`/api/v1/sessions/${encodeURIComponent(n)}/events`,{cache:"no-store"},r);if(!u.ok){const f=await Ht(u,Q("client.getSessionFailed"));throw new Error(Q("client.getSessionFailedWithDetail",{status:u.status,detail:f}))}const d=await u.json();return c.events=Array.isArray(d.events)?d.events:[],c}const s=await mt(`/apps/${i}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}`,{},r);if(!s.ok){const l=await Ht(s,Q("client.getSessionFailed"));throw new Error(Q("client.getSessionFailedWithDetail",{status:s.status,detail:l}))}const o=await s.json();if(r.runtimeId){const l=yz(r.runtimeId,i,t,n);o.state={...vz()[l]??{},...o.state??{}}}return o}async function lTe(e){const{app:t,ep:n}=Pa(e.appName);if(!n.runtimeId)throw new Error(Q("client.feedbackRuntimeOnly"));if(!n.region)throw new Error(Q("client.feedbackRegionMissing"));const i=await mt("/web/evaluation/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:n.runtimeId,region:n.region,appName:t,userId:e.userId,sessionId:e.sessionId,eventId:e.eventId,rating:e.rating,comment:e.comment??""})},{},yr);if(!i.ok)throw new Error(await Ht(i,Q("client.submitFeedbackFailed")));const r=await i.json(),s=yz(n.runtimeId,t,e.userId,e.sessionId);return gtt(s,e.eventId,r),r}async function AD(e,t={}){const n=Mv(e.runtimeId,e.region||"cn-beijing",e.appName,e.pageSize??100),i=kb(ef,n,rTe);if(!t.force&&i)return i;const r=ef.get(n);if(!t.force&&(r!=null&&r.promise))return r.promise;let s=null;const o=(async()=>{for(const l of CD(e.region)){const c=new URLSearchParams({runtimeId:e.runtimeId,region:l,appName:e.appName,page_size:String(e.pageSize??100)}),u=await mt(`/web/evaluation/feedback-cases?${c.toString()}`);if(u.ok)return Oz(ef,n,await u.json());s=new Error(await Ht(u,Q("client.loadEvaluationSetsFailed")))}throw s??new Error(Q("client.loadEvaluationSetsFailed"))})();ef.set(n,{...r,promise:o,updatedAt:(r==null?void 0:r.updatedAt)??0});try{return await o}finally{const l=ef.get(n);(l==null?void 0:l.promise)===o&&ef.set(n,{value:l.value,updatedAt:l.updatedAt})}}async function P8(e){let t=null;for(const n of CD(e.region)){const i=new URLSearchParams({runtimeId:e.runtimeId,region:n,appName:e.appName,userId:e.userId}),r=await mt(`/web/evaluation/statuses?${i.toString()}`);if(r.ok)return r.json();t=new Error(await Ht(r,Q("client.loadAutoEvaluationStatusFailed")))}throw t??new Error(Q("client.loadAutoEvaluationStatusFailed"))}async function cTe(e){let t=null;for(const n of CD(e.region)){const i=new URLSearchParams({runtimeId:e.runtimeId,region:n,appName:e.appName}),r=await mt(`/web/evaluation/optimizations?${i.toString()}`);if(r.ok)return r.json();t=new Error(await Ht(r,Q("client.loadOptimizationsFailed")))}throw t??new Error(Q("client.loadOptimizationsFailed"))}function uTe(e){return kb(ef,Mv(e.runtimeId,e.region||"cn-beijing",e.appName,e.pageSize??100),rTe)}function wtt(e){AD(e).catch(()=>{})}function dTe(e){AD(e,{force:!0}).catch(()=>{})}function fTe(e,t){return["good","bad"].map(n=>{const i=e.find(r=>r.kind===n);return{kind:n,evaluationSetId:(i==null?void 0:i.evaluationSetId)??null,evaluationSetName:(i==null?void 0:i.evaluationSetName)??null,workspaceId:(i==null?void 0:i.workspaceId)??null,itemCount:t.filter(r=>r.kind===n).length}})}function cN(e){const t=e.comment??"",n=e.rating==="bad"&&!!t.trim();for(const[i,r]of ef.entries()){const s=r.value;if(!s||s.runtimeId!==e.runtimeId||s.agentName!==e.appName)continue;const o=s.items.filter(c=>c.sessionId!==e.sessionId||c.messageId!==e.messageId),l=e.rating?[{id:`local:${e.runtimeId}:${e.sessionId}:${e.messageId}`,itemKey:`local:${e.messageId}`,kind:e.rating,input:e.input,output:e.output,referenceOutput:e.referenceOutput??e.output,comment:t,agentName:e.appName,sessionId:e.sessionId,messageId:e.messageId,runtimeId:e.runtimeId,invocationId:e.invocationId??"",userId:e.userId,createdAt:e.createdAt??new Date().toISOString(),evaluationSetId:"",evaluationSetName:"",workspaceId:"",source:"user",score:n?0:null,reason:n?t:""},...o]:o;ef.set(i,{value:{...s,sets:fTe(s.sets,l),items:l},updatedAt:Date.now(),promise:r.promise})}}async function hTe(e){let t=null;for(const n of CD(e.region)){const i=await mt("/web/evaluation/feedback-cases/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e.runtimeId,region:n,appName:e.appName,itemIds:e.itemIds})},{},yr);if(i.ok){const r=await i.json(),s=new Set(e.itemIds);for(const[o,l]of ef.entries()){const c=l.value;if(!c||c.runtimeId!==e.runtimeId||c.agentName!==e.appName)continue;const u=c.items.filter(d=>!s.has(d.id));ef.set(o,{value:{...c,sets:fTe(c.sets,u),items:u},updatedAt:Date.now()})}return r}t=new Error(await Ht(i,Q("client.deleteEvaluationCaseFailed")))}throw t??new Error(Q("client.deleteEvaluationCaseFailed"))}async function D8(e,t,n){const{app:i,ep:r}=Pa(e);if(Q1(i,r)){const o=await mt(`/api/v1/sessions/${encodeURIComponent(n)}`,{method:"DELETE"},r);if(!o.ok&&o.status!==404)throw new Error(`delete session failed: ${o.status}`);return}const s=await mt(`/apps/${i}/users/${encodeURIComponent(t)}/sessions/${n}`,{method:"DELETE"},r);if(!s.ok&&s.status!==404)throw new Error(`delete session failed: ${s.status}`)}function ktt(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"="),i=window.atob(n),r=new Uint8Array(i.length);for(let s=0;sURL.revokeObjectURL(l),0)}async function mTe(e,t,n,i,r){const{app:s,ep:o}=Pa(e),l=r==null?"":`?version=${encodeURIComponent(r)}`,c=`/apps/${encodeURIComponent(s)}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}/artifacts/${encodeURIComponent(i)}${l}`,u=await mt(c,{},o,yr);if(!u.ok)throw new Error(await Ht(u,Q("client.downloadFileFailed")));const d=await u.json(),f=d.inlineData??d.inline_data;if(!(f!=null&&f.data))throw new Error(Q("client.fileUnavailable"));const h=ktt(f.data),m=h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength);return{blob:new Blob([m],{type:f.mimeType??f.mime_type??"application/octet-stream"}),downloadName:f.displayName??f.display_name??i}}async function Cz(e,t,n,i,r){const{blob:s}=await mTe(e,t,n,i,r);return URL.createObjectURL(s)}async function Ott(e){const t=await mt("/web/media/capabilities");if(!t.ok)throw new Error(await Ht(t,"media capabilities failed"));return t.json()}async function gTe(e,t,n,i){const{app:r}=Pa(e),s=new FormData;s.set("app_name",r),s.set("user_id",t),s.set("session_id",n),s.set("file",i);const o=await mt("/web/media",{method:"POST",body:s},{},yr);if(!o.ok)throw new Error(await Ht(o,Q("client.uploadFileFailed")));return{...await o.json(),status:"ready"}}async function M8(e,t,n){const{app:i}=Pa(e),r=`/web/media/${encodeURIComponent(i)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}/delete`,s=await mt(r,{method:"POST"});if(!s.ok&&s.status!==404)throw new Error(await Ht(s,"media cleanup failed"))}function bTe(e){try{const t=new URL(e);if(t.protocol!=="veadk-media:"||t.hostname!=="apps")return;const n=t.pathname.split("/").filter(Boolean).map(decodeURIComponent);return n.length!==7||n[1]!=="users"||n[3]!=="sessions"||n[5]!=="media"?void 0:`/web/media/${n.map(encodeURIComponent).filter((i,r)=>![1,3,5].includes(r)).join("/")}`}catch{return}}async function uN(e,t){const n=bTe(t);if(!n)throw new Error("Invalid VeADK media URI");const i=await mt(`${n}/delete`,{method:"POST"});if(!i.ok&&i.status!==404)throw new Error(await Ht(i,"media cleanup failed"))}function yTe(e,t){if(t.startsWith("data:")||t.startsWith("blob:")||/^https?:/.test(t))return t;const n=bTe(t);if(!n)return t;const i=`${n}/content`;return Na(`${lN}${i}`)}async function ZR(e,t,n){const{app:i,ep:r}=Pa(e);let s;if(r.runtimeId){const c=new URLSearchParams({runtimeId:r.runtimeId,sessionId:t,region:r.region??"cn-beijing"});if(n&&c.set("endTimeMs",String(Math.round(n))),s=await mt(`/web/runtime-trace?${c.toString()}`),s.status===404)throw new Error(Q("client.traceDisabled"))}else s=await mt(`/dev/apps/${encodeURIComponent(i)}/debug/trace/session/${encodeURIComponent(t)}`,{},r);if(!s.ok)throw new Error(await Ht(s,Q("client.loadTraceFailed")));const o=s.headers.get("content-type")??"";if(!o.includes("application/json")){const c=o.split(";",1)[0]||Q("client.contentTypeMissing");throw new Error(Q("client.traceNonJson",{contentType:c}))}const l=await s.json();if(!Array.isArray(l))throw new Error(Q("client.invalidTraceFormat"));return l}async function L8(e){const t=await mt("/web/issue-feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await Ht(t,Q("client.submitIssueFeedbackFailed")));if((await t.json()).submitted!==!0)throw new Error(Q("client.issueFeedbackNotConfirmed"));return{submitted:!0}}async function JZ(e,t,n=!0,i){const r=await mt(`/web/agent-info/${e}`,{signal:i},t);if(!r.ok)throw new Error(`agent-info failed: ${r.status}`);const s=await r.json();if(n&&!s.draft)try{const o=await mt(`/web/agent-draft/${e}`,{},t);if(o.ok){const l=await o.json();s.draft=l.draft}}catch{}return{appName:e,agentCategory:s.agentCategory,mpa:s.mpa,name:s.name??e,description:s.description??"",type:s.type,model:s.model??"",selectableModels:s.selectableModels??[],turnLifecycleControl:s.turnLifecycleControl,resourceTopology:s.resourceTopology,tools:s.tools??[],skillsPreviewSupported:Array.isArray(s.skills),skills:s.skills??[],subAgents:s.subAgents??[],components:s.components??[],searchSources:s.searchSources??[],graph:s.graph,draft:s.draft}}function Stt(e){return/agent-info failed:\s*404\b/i.test(String(e))}async function vTe(e,t,n=!0,i){try{return await JZ(e,t,n,i)}catch(r){if(e==="a2a-default"||!Stt(r))throw r;return JZ("a2a-default",t,n,i)}}class TD extends Error{constructor(t){super("Turn state changed before the control request completed"),this.authoritativeState=t,this.name="TurnControlConflictError"}}async function xTe(e,t){const{ep:n}=Pa(e),i=await mt(`/api/v1/a2a/tasks/by-session/${encodeURIComponent(t)}/control`,{cache:"no-store"},n);if(!i.ok)throw new Error(await Ht(i,"turn control failed"));return i.json()}async function wTe(e,t,n,i){var o;const{ep:r}=Pa(e),s=await mt(`/api/v1/a2a/tasks/by-session/${encodeURIComponent(t)}/control/${n}`,{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":crypto.randomUUID()},body:JSON.stringify({expectedGeneration:i})},r);if(s.status===409){const l=await s.json().catch(()=>null);if((o=l==null?void 0:l.detail)!=null&&o.taskId)throw new TD(l.detail)}if(!s.ok)throw new Error(await Ht(s,"turn control failed"));return s.json()}async function Ett(e,t,n,i,r){var c;const{ep:s}=Pa(e),o=await mt(`/api/v1/a2a/tasks/${encodeURIComponent(n)}/continue`,{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":r},body:JSON.stringify({expectedGeneration:i})},s);if(o.status===409){const u=await o.json().catch(()=>null);if((c=u==null?void 0:u.detail)!=null&&c.taskId)throw new TD(u.detail)}if(!o.ok)throw new Error(await Ht(o,"turn continue failed"));const l=await o.json();if(l.sessionId!==t)throw new Error("turn continue returned a different session");return l}async function*kTe({appName:e,sessionId:t,taskId:n,expectedGeneration:i,idempotencyKey:r,lastEventId:s,signal:o,onRuntimeContext:l}){const{ep:c}=Pa(e),u=(s==null?void 0:s.trim())??"",d=_z(o);let f;try{const g=await mt(`/api/v1/a2a/tasks/${encodeURIComponent(n)}/continue`,{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":r},body:JSON.stringify({expectedGeneration:i}),signal:d.signal},c,0),b=YR(g,c.runtimeId??"",c.region??"");if(b&&(l==null||l(b)),!g.ok){d.cleanup();const y=await Ht(g,"turn continue failed");throw new Error(nl(Q("client.runSseFailedWithDetail",{status:g.status,detail:y})))}const v=await g.json();if(v.sessionId!==t)throw d.cleanup(),new Error(nl("turn continue returned a different session"));f=await mt(`/api/v1/sessions/${encodeURIComponent(t)}/sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invocationId:v.invocationId,...u?{lastEventId:u}:{}}),signal:d.signal},c,0)}catch(g){throw d.cleanup(),d.timedOut()?new Error(Wg()):o!=null&&o.aborted||(g==null?void 0:g.name)==="AbortError"?g:new Error(nl(g))}const h=YR(f,c.runtimeId??"",c.region??"");if(h&&(l==null||l(h)),!f.ok){d.cleanup();const g=await Ht(f,Q("client.runSessionFailed"));throw new Error(nl(Q("client.runSseFailedWithDetail",{status:f.status,detail:g})))}let m=!1;try{for await(const g of BA(f)){if(g&&typeof g=="object"&&g[aC]==="done"){d.clearDeadline();break}m=!0,d.clearDeadline();const b={...g};delete b[aC],typeof b.error=="string"&&(b.error=nl(b.error)),typeof b.errorMessage=="string"&&(b.errorMessage=nl(b.errorMessage)),typeof b.error_message=="string"&&(b.error_message=nl(b.error_message)),yield b}}catch(g){throw d.timedOut()?new Error(Wg()):o!=null&&o.aborted||(g==null?void 0:g.name)==="AbortError"?g:new Error(nl(g))}finally{d.cleanup()}if(!m)throw new Error(Tz())}async function $8(e,t){const{app:n,ep:i}=Pa(e);return vTe(n,i,!1,t)}async function Ctt(e,t,n){let i=null;for(const r of UA(t)){const s={runtimeId:e,region:r};try{const o=kz(e,r),l=iw.get(o);l&&l.expiresAt<=Date.now()&&iw.delete(o);const c=iw.get(o),u=n||(c==null?void 0:c.apps[0])||(await QA("","",s))[0];if(!u)throw new Error(Q("client.noPreviewableAgent"));return vTe(u,s)}catch(o){if(o instanceof V1||o instanceof Ea&&!o.unsupported)throw o;i=o instanceof Error?o:new Error(String(o))}}throw i??new Error(Q("client.noPreviewableAgent"))}async function Az(e,t,n={},i={}){const r=typeof n=="string"?n:void 0,s=typeof n=="string"?i:n,o=Mv(e,t||"cn-beijing",r??""),l=kb(oy,o,H1);if(!s.force&&l)return l;const c=oy.get(o);if(!s.force&&(c!=null&&c.promise))return c.promise;const u=Ctt(e,t,r).then(d=>Oz(oy,o,d));oy.set(o,{...c,promise:u,updatedAt:(c==null?void 0:c.updatedAt)??0});try{return await u}finally{const d=oy.get(o);(d==null?void 0:d.promise)===u&&oy.set(o,{value:d.value,updatedAt:d.updatedAt})}}function OTe(e,t,n=""){return kb(oy,Mv(e,t||"cn-beijing",n),H1)}function STe(e,t,n=""){Az(e,t,n).catch(()=>{})}function JR(e){const{app:t,ep:n}=Pa(e);return Q1(t,n)}function ap(e){const{app:t,ep:n}=Pa(e);return t==="a2a-default"&&!!(n.runtimeId&&(n.agentCategory==="mpa"||n.mpaInstanceId))}async function ETe(e,t,n,i){const{app:r,ep:s}=Pa(e),o=new URLSearchParams({source:t,app_name:r,q:n,user_id:i}),l=await mt(`/web/search?${o.toString()}`,{},s);if(!l.ok)throw new Error(await Ht(l,Q("client.agentSearchFailed")));return l.json()}async function CTe(e,t){const{app:n}=Pa(e),i=await mt(`/web/search?source=web&app_name=${encodeURIComponent(n)}&q=${encodeURIComponent(t)}`);if(!i.ok)throw new Error(`web search failed: ${i.status}`);return i.json()}function Tz(){return nl(Q("client.emptySseBody"))}function fS(){return nl(Q("client.noDisplayableSseReply"))}const Att=6e4;function Wg(){return Q("client.firstSseEventTimeout")}function _z(e){if(e!=null&&e.aborted)return{signal:e,clearDeadline:()=>{},cleanup:()=>{},timedOut:()=>!1};const t=new AbortController;let n=!1,i=!1;const r=()=>{i||(i=!0,clearTimeout(o))},s=()=>{t.signal.aborted||t.abort((e==null?void 0:e.reason)??new DOMException("Aborted","AbortError"))},o=setTimeout(()=>{i||t.signal.aborted||(n=!0,i=!0,t.abort(new Error(Wg())))},Att);return e==null||e.addEventListener("abort",s,{once:!0}),{signal:t.signal,clearDeadline:r,cleanup:()=>{r(),e==null||e.removeEventListener("abort",s)},timedOut:()=>n}}async function*F8({appName:e,userId:t,sessionId:n,text:i,modelId:r,idempotencyKey:s,executionConfigVersion:o,lastEventId:l,attachments:c=[],invocation:u,platformTools:d,environmentMounts:f,environmentMount:h,functionResponses:m=[],signal:g,onRuntimeContext:b}){const{app:v,ep:y}=Pa(e),w=c.flatMap(I=>I.status&&I.status!=="ready"?[]:I.uri?[{fileData:{mimeType:I.mimeType,fileUri:I.uri,displayName:I.name},partMetadata:{veadkMedia:{id:I.id,uri:I.uri,name:I.name,mimeType:I.mimeType,sizeBytes:I.sizeBytes}}}]:I.data?[{inlineData:{mimeType:I.mimeType,data:I.data,displayName:I.name}}]:[]),x=u&&(u.skills.length>0||u.targetAgent)?u:void 0,k=[...w,...m.map(I=>({functionResponse:{id:I.id,name:I.name,response:I.response}})),...i.trim()?[{text:i}]:[]];if(x&&k.length>0){const I=k[0],D=I.partMetadata;k[0]={...I,partMetadata:{...D,veadkInvocation:x}}}const S=(s==null?void 0:s.trim())??"",O=(l==null?void 0:l.trim())??"",A=typeof o=="number",E=A||S?{veadkExecution:{...A?{executionConfigVersion:o}:{},...S?{idempotencyKey:S}:{}}}:void 0,j=x||E?{...x?{veadkInvocation:x}:{},...E??{}}:void 0,T=Q1(v,y);if(T&&y.runtimeId){const I=y.region?`?region=${encodeURIComponent(y.region)}`:"";try{const D=await yn(`/web/mpa/identity-prewarm/${encodeURIComponent(y.runtimeId)}${I}`,{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest"},signal:g},1e4);D.ok||console.warn("[mpa] identity prewarm unavailable",D.status)}catch(D){if(g!=null&&g.aborted)throw D;console.warn("[mpa] identity prewarm unavailable")}}let R;const C=_z(g);try{if(T){const I=await mt(`/api/v1/sessions/${encodeURIComponent(n)}/run`,{method:"POST",headers:{"Content-Type":"application/json",...S?{"Idempotency-Key":S}:{}},body:JSON.stringify({content:i,...A?{executionConfigVersion:o}:{}}),signal:C.signal},y,0),D=YR(I,y.runtimeId??"",y.region??"");if(D&&(b==null||b(D)),!I.ok){C.cleanup();const L=await Ht(I,Q("client.runSessionFailed"));throw new Error(nl(Q("client.runSseFailedWithDetail",{status:I.status,detail:L})))}const _=await I.json();R=await mt(`/api/v1/sessions/${encodeURIComponent(n)}/sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invocationId:_.invocationId,...O?{lastEventId:O}:{}}),signal:C.signal},y,0)}else R=await mt("/run_sse",{method:"POST",headers:{"Content-Type":"application/json",...S?{"Idempotency-Key":S}:{}},body:JSON.stringify({app_name:v,user_id:t,session_id:n,new_message:{role:"user",parts:k},streaming:!0,...O?{lastEventId:O}:{},...A?{executionConfigVersion:o}:{},...r!=null&&r.trim()?{model_id:r.trim()}:{},...d!==void 0?{platform_tools:[...d]}:{},...f!==void 0?{environment_mounts:[...f]}:h?{environment_mount:h}:{},custom_metadata:j}),signal:C.signal},y,0)}catch(I){throw C.cleanup(),C.timedOut()?new Error(Wg()):g!=null&&g.aborted||(I==null?void 0:I.name)==="AbortError"?I:new Error(nl(I))}const N=YR(R,y.runtimeId??"",y.region??"");if(N&&(b==null||b(N)),!R.ok){C.cleanup();const I=await Ht(R,Q("client.runSessionFailed"));throw new Error(nl(Q("client.runSseFailedWithDetail",{status:R.status,detail:I})))}let P=!1;try{for await(const I of BA(R)){if(I&&typeof I=="object"&&I[aC]==="done"){C.clearDeadline();break}P=!0,C.clearDeadline();const D={...I};delete D[aC],typeof D.error=="string"&&(D.error=nl(D.error)),typeof D.errorMessage=="string"&&(D.errorMessage=nl(D.errorMessage)),typeof D.error_message=="string"&&(D.error_message=nl(D.error_message)),yield D}}catch(I){throw C.timedOut()?new Error(Wg()):g!=null&&g.aborted||(I==null?void 0:I.name)==="AbortError"?I:new Error(nl(I))}finally{C.cleanup()}if(!P)throw new Error(Tz())}class rw extends Error{constructor(n,{status:i,code:r,currentState:s}){super(n);Zt(this,"status");Zt(this,"code");Zt(this,"currentState");this.name="MpaExecutionConfigRequestError",this.status=i,this.code=r,this.currentState=s}}async function jz(e){const t=Q("client.mpaExecutionConfigFailed"),n=await e.text().catch(()=>"");if(!n)return new rw(Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),{status:e.status,code:""});try{const i=JSON.parse(n),r=i.error&&typeof i.error=="object"?i.error:i.detail&&typeof i.detail=="object"?i.detail:null,s=JAe(i.detail??i.error),o=s?Q("client.errorWithDetailAndRawResponse",{context:Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),detail:s,response:n}):Q("client.errorWithRawResponse",{context:Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),response:n});return new rw(o,{status:e.status,code:String((r==null?void 0:r.code)??""),currentState:(r==null?void 0:r.currentState)??i.currentState})}catch{return new rw(Q("client.errorWithRawResponse",{context:Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),response:n}),{status:e.status,code:""})}}function zA(e){var r,s,o;const t=(e.selectedSkills??[]).map(l=>({source:l.source,folder:l.folder,name:l.name,skillSpaceId:l.skillSpaceId,skillSpaceName:l.skillSpaceName,skillSpaceRegion:l.skillSpaceRegion,skillId:l.skillId,version:l.version})),n=(e.skills??[]).map(l=>({name:l})),i=(e.mcpTools??[]).map(l=>({name:l.name,transport:l.transport,url:l.url}));return{name:((r=e.name)==null?void 0:r.trim())||"mpa-agent",description:e.description??"",system:((s=e.instruction)==null?void 0:s.trim())||"You are a helpful assistant.",model:{id:e.modelName||e.model||"",source:e.modelSource??"ark",provider:e.modelProvider??"",apiBase:e.modelApiBase??""},tools:[...(e.builtinTools??[]).map(l=>({id:l,source:"builtin"})),...(e.tools??[]).map(l=>({name:l,source:"legacy"})),...(e.customTools??[]).map(l=>({name:l.name,description:l.description,source:"custom"}))],skills:[...t,...n],mcpServers:i,...(o=e.subAgents)!=null&&o.length?{multiagent:{type:e.agentType??"llm",subAgents:e.subAgents.map(zA)}}:{},metadata:{"veadk:agent-type":"mpa","veadk:source":"studio-agent-draft",agentType:e.agentType??"llm"}}}async function Nz(e){const t={operationKind:e.operationKind,runtimeId:e.runtimeId,region:e.region,mpaInstanceId:e.mpaInstanceId,sourceProfileId:e.sourceProfileId,targetKey:e.targetKey,runtimeRevision:e.runtimeRevision,profile:zA(e.draft)},n=e.operationKind==="update"?`/web/mpa/agents/${encodeURIComponent(e.mpaInstanceId)}`:"/web/mpa/agents",i=await mt(n,{method:e.operationKind==="update"?"PATCH":"POST",headers:{"Content-Type":"application/json","Idempotency-Key":e.idempotencyKey},body:JSON.stringify(t)});if(!i.ok)throw new Error(await Ht(i,Q("client.mpaOperationFailed")));return await i.json()}async function eI(e){var r,s,o,l;const t=e.runtimeId.trim(),n=((r=e.mpaInstanceId)==null?void 0:r.trim())||t,i=(s=e.sourceDraftId)!=null&&s.trim()?`studio-draft:${e.sourceDraftId.trim()}`:`studio-agent:${e.agentName}:${e.taskId}`;return Nz({operationKind:e.operationKind,runtimeId:t,region:e.region,mpaInstanceId:n,sourceProfileId:i,draft:e.draft,targetKey:e.operationKind==="update"?n:`runtime:${e.region}:${((o=e.runtimeName)==null?void 0:o.trim())||n}`,runtimeRevision:((l=e.runtimeRevision)==null?void 0:l.trim())||void 0,idempotencyKey:`${e.taskId}:mpa-profile`})}async function ATe(){const e=await mt("/web/mpa/agent-operations?status=active",{cache:"no-store"});if(!e.ok)throw new Error(await Ht(e,Q("client.mpaOperationLoadFailed")));return(await e.json()).operations??[]}async function TTe(e,t){const n=await mt(`/web/mpa/agent-operations/${encodeURIComponent(e)}`,{cache:"no-store",signal:t});if(!n.ok)throw new Error(await Ht(n,Q("client.mpaOperationLoadFailed")));return await n.json()}async function _Te(e){const t=new URLSearchParams({runtimeId:e.runtimeId,region:e.region}),n=await mt(`/web/mpa/agents/${encodeURIComponent(e.mpaInstanceId)}/profile-status?${t.toString()}`,{cache:"no-store",signal:e.signal});if(!n.ok)throw new Error(await Ht(n,Q("client.mpaOperationLoadFailed")));const i=await n.json();return{operationId:String(i.operationId??""),status:String(i.status??""),profileRevision:Number(i.profileRevision??0),runtimeRevision:String(i.runtimeRevision??""),etag:String(i.etag??n.headers.get("ETag")??"")}}async function jTe(e){const t=new URLSearchParams({region:e.region??"all"});e.runtimeId&&t.set("runtimeId",e.runtimeId);const n=await mt(`/web/mpa/agents/${encodeURIComponent(e.mpaInstanceId)}/view?${t.toString()}`,{cache:"no-store",signal:e.signal});if(!n.ok)throw new Error(await Ht(n,Q("client.mpaOperationLoadFailed")));return await n.json()}async function NTe(e){const t=new URLSearchParams({runtimeId:e.runtimeId,region:e.region}),n=await mt(`/web/mpa/agents/${encodeURIComponent(e.mpaInstanceId)}/delete-preview?${t.toString()}`,{cache:"no-store",signal:e.signal});if(!n.ok)throw new Error(await Ht(n,Q("client.mpaDeletePreviewFailed")));return await n.json()}async function RTe(e){const t={runtimeId:e.runtimeId,region:e.region},n=await mt(`/api/v1/runtime-console/admin/sessions/${encodeURIComponent(e.sessionId)}/runs`,{cache:"no-store",signal:e.signal},t);if(!n.ok)throw new Error(await Ht(n,Q("client.loadMpaDiagnosticsFailed")));return await n.json()}async function ITe(e){const t={runtimeId:e.runtimeId,region:e.region},n=new URLSearchParams({sessionId:e.sessionId}),i=await mt(`/api/v1/runtime-console/admin/runs/${encodeURIComponent(e.invocationId)}/trace?${n.toString()}`,{cache:"no-store",signal:e.signal},t);if(!i.ok)throw new Error(await Ht(i,Q("client.loadMpaDiagnosticsFailed")));return await i.json()}async function Rz(e,t){const n=await mt(`/web/mpa/agent-operations/${encodeURIComponent(e)}/retry`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operationKind:t.operationKind,runtimeId:t.runtimeId,region:t.region,mpaInstanceId:t.mpaInstanceId,sourceProfileId:t.sourceProfileId,targetKey:t.targetKey,runtimeRevision:t.runtimeRevision,profile:zA(t.draft)})});if(!n.ok)throw new Error(await Ht(n,Q("client.mpaOperationFailed")));return await n.json()}async function Iz(e){const t=new URLSearchParams({runtimeId:e.runtimeId,region:e.region}),n=await mt(`/web/mpa/sessions/${encodeURIComponent(e.sessionId)}/execution-config?${t.toString()}`,{cache:"no-store",signal:e.signal});if(!n.ok)throw await jz(n);return await n.json()}async function B8(e){const t=await mt(`/web/mpa/sessions/${encodeURIComponent(e.sessionId)}/execution-config`,{method:"PATCH",headers:{"Content-Type":"application/json","If-Match":e.etag},body:JSON.stringify({runtimeId:e.runtimeId,region:e.region,changes:e.changes})});if(!t.ok)throw await jz(t);return await t.json()}async function PTe(e){const t=await mt(`/web/mpa/sessions/${encodeURIComponent(e.sessionId)}/profile-upgrade`,{method:"POST",headers:{"Content-Type":"application/json","If-Match":e.etag,"Idempotency-Key":e.idempotencyKey},body:JSON.stringify({runtimeId:e.runtimeId,region:e.region,targetProfileRevision:e.targetProfileRevision})});if(!t.ok)throw await jz(t);return await t.json()}async function _D(e,t){const n=new URLSearchParams({name:e,region:t}),i=await mt(`/web/runtime-name-availability?${n.toString()}`,{cache:"no-store"});if(!i.ok)throw new Error(await Ht(i,Q("client.checkRuntimeNameFailed")));const r=await i.json();if(typeof r.available!="boolean")throw new Error(Q("client.invalidRuntimeNameCheck"));return{available:r.available}}async function DTe(e,t){const n=new URLSearchParams({kind:e.kind,region:e.region});e.registry&&n.set("registry",e.registry),e.namespace&&n.set("namespace",e.namespace),e.workspaceId&&n.set("workspaceId",e.workspaceId),e.search&&n.set("search",e.search),e.namePrefix&&n.set("namePrefix",e.namePrefix),e.pageNumber&&n.set("pageNumber",String(e.pageNumber)),e.pageSize&&n.set("pageSize",String(e.pageSize));const i=await mt(`/web/deployment-resources?${n.toString()}`,{signal:t});if(!i.ok)throw new Error(await Ht(i,Q("client.loadCloudResourcesFailed")));const r=await i.json();if(typeof r.serviceRegion!="string"||!Array.isArray(r.items)||typeof r.pageNumber!="number"||typeof r.pageSize!="number"||typeof r.totalCount!="number"||typeof r.hasMore!="boolean")throw new Error(Q("client.invalidCloudResources"));const s=r.items.map(o=>{if(!o||typeof o!="object"||typeof o.id!="string"||typeof o.name!="string"||typeof o.region!="string"||typeof o.status!="string")throw new Error(Q("client.invalidCloudResources"));return o});return{serviceRegion:r.serviceRegion,items:s,pageNumber:r.pageNumber,pageSize:r.pageSize,totalCount:r.totalCount,hasMore:r.hasMore}}function MTe(e,t){const n=e;if(!n||typeof n!="object"||!Array.isArray(n.mounts))throw new Error(Q("client.invalidEnvironmentMount"));if(n.mounts.length!==t.length)throw new Error(Q("client.environmentMountMismatch"));return n.mounts.map((i,r)=>{const s=t[r];if(!i||typeof i!="object"||typeof i.environment_id!="string"||typeof i.environment_version_id!="string"||typeof i.mount_instance_id!="string"||typeof i.sandbox_session_id!="string"||!i.environment_id||!i.environment_version_id||!i.mount_instance_id||!i.sandbox_session_id)throw new Error(Q("client.invalidEnvironmentMount"));if(i.environment_id!==s.environment_id||i.environment_version_id!==s.environment_version_id||s.mount_instance_id!==void 0&&i.mount_instance_id!==s.mount_instance_id)throw new Error(Q("client.environmentMountMismatch"));return i})}async function LTe({runtimeId:e,appName:t,userId:n,sessionId:i,environmentMounts:r}){const{app:s}=Pa(t);let o;try{o=await mt("/web/v3/session-environment-mounts/prepare",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtime_id:e,app_name:s,user_id:n,session_id:i,environment_mounts:[...r]})})}catch(l){throw l instanceof TypeError?new Error(Q("client.environmentMountNetworkFailed")):l}if(!o.ok)throw new Error(await Ht(o,Q("client.environmentMountFailed")));return MTe(await o.json(),r)}function Pz(e){const t=new Set,n=[];for(const i of e.split(/[,,\n\r]+/)){const r=i.trim();!r||t.has(r)||(t.add(r),n.push(r))}return n}async function $Te(e,t=typeof navigator>"u"?void 0:navigator.clipboard){if(!(t!=null&&t.writeText))throw new Error(Q("client.clipboardUnsupported"));try{await t.writeText(e)}catch{throw new Error(Q("client.clipboardWriteFailed"))}}const eJ={codex:0,codex_snapshot:1,deepseek_harness:2,deepseek_harness_snapshot:3,openclaw:4,openclaw_snapshot:5,hermes:6,hermes_snapshot:7,dev:8};async function FTe(e){var r;const t=await mt("/web/system-info",{signal:e});if(!t.ok)throw new Error(await Ht(t,Q("client.loadSystemInfoFailed")));const n=await t.json();if(typeof((r=n.storage)==null?void 0:r.tosAddress)!="string"||!Array.isArray(n.sandboxTools))throw new Error(Q("client.invalidSystemInfo"));const i=n.sandboxTools.map(s=>{if(!s||typeof s!="object"||typeof s.kind!="string"||typeof s.label!="string"||typeof s.toolId!="string"||typeof s.snapshot!="boolean"||typeof s.needsModelEnvUpdate!="boolean"||typeof s.canUpdateModelEnv!="boolean"||typeof s.modelEnvError!="string"||typeof s.modelEnvErrorCode!="string")throw new Error(Q("client.invalidSystemInfo"));return s}).sort((s,o)=>(eJ[s.kind]??Number.MAX_SAFE_INTEGER)-(eJ[o.kind]??Number.MAX_SAFE_INTEGER));return{storage:{tosAddress:n.storage.tosAddress},sandboxTools:i}}const BTe=new Set(["preparing","queued","building","scanning","available","failed"]);function Dz(e){if(e===null)return null;if(!e||typeof e!="object")throw new Error(Q("client.invalidEnvironmentBuild"));const t=e;if(typeof t.versionId!="string"||!BTe.has(t.status)||typeof t.image!="string"||typeof t.error!="string"||typeof t.createdAt!="string"||typeof t.updatedAt!="string"||t.resources!==null&&typeof t.resources!="object")throw new Error(Q("client.invalidEnvironmentBuild"));const n=Array.isArray(t.steps)?t.steps.map(i=>{if(!i||typeof i!="object"||typeof i.key!="string"||typeof i.label!="string"||!["pending","running","succeeded","failed"].includes(i.status)||i.startedAt!==null&&typeof i.startedAt!="string"||i.finishedAt!==null&&typeof i.finishedAt!="string")throw new Error(Q("client.invalidEnvironmentBuildStep"));return i}):[];return{...t,toolId:typeof t.toolId=="string"?t.toolId:"",toolStatus:["creating","ready","failed"].includes(t.toolStatus)?t.toolStatus:"",runId:typeof t.runId=="string"?t.runId:"",currentStep:typeof t.currentStep=="string"?t.currentStep:"",sourceCommitSha:typeof t.sourceCommitSha=="string"?t.sourceCommitSha:"",steps:n,progressError:typeof t.progressError=="string"?t.progressError:"",logTail:typeof t.logTail=="string"?t.logTail:"",logTruncated:t.logTruncated===!0,logUpdatedAt:typeof t.logUpdatedAt=="string"?t.logUpdatedAt:null,logError:typeof t.logError=="string"?t.logError:""}}function UTe(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidEnvironmentManifest"));const t=e;if(!["agentkit.studio/v3","agentkit.studio/v1alpha1"].includes(t.apiVersion)||t.kind!=="Environment"||!t.metadata||typeof t.metadata.id!="string"||typeof t.metadata.name!="string"||typeof t.metadata.version!="string"||typeof t.metadata.description!="string"||!t.spec||typeof t.spec.image!="string"||!["ubuntu","aio-sandbox","codex-sandbox"].includes(t.spec.baseEnvironment)||typeof t.spec.baseImage!="string"||!["ubuntu-22.04","ubuntu-24.04"].includes(t.spec.operatingSystem)||!["python-3.10","python-3.12"].includes(t.spec.language)||t.spec.executionRuntime!=="veadk"||!Array.isArray(t.spec.packages)||!t.spec.packages.every(n=>typeof n=="string")||!Array.isArray(t.spec.capabilities)||!t.spec.capabilities.every(n=>typeof n=="string")||!Array.isArray(t.spec.skills)||!t.status||!BTe.has(t.status.phase)||typeof t.status.createdAt!="string"||typeof t.status.updatedAt!="string")throw new Error(Q("client.invalidEnvironmentManifest"));return t}function QTe(e){if(e==null)return;if(!e||typeof e!="object")throw new Error(Q("client.invalidImageRepository"));const t=e;if(typeof t.region!="string"||typeof t.registry!="string"||typeof t.namespace!="string"||typeof t.repository!="string")throw new Error(Q("client.invalidImageRepository"));return t}function Ttt(e){if(e==null)return;if(!e||typeof e!="object")throw new Error(Q("client.invalidCodeRepository"));const t=e;if(typeof t.repositoryUrl!="string"||t.ref!==void 0&&typeof t.ref!="string"||typeof t.dockerfilePath!="string")throw new Error(Q("client.invalidCodeRepository"));return t}function _tt(e){const t=QTe(e);if(!t)return;const n=e;if(typeof n.reference!="string")throw new Error(Q("client.invalidImageSource"));return{...t,reference:n.reference}}function Mz(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidEnvironment"));const t=e;if(typeof t.id!="string"||typeof t.name!="string"||typeof t.description!="string"||t.baseEnvironment!==void 0&&t.baseEnvironment!=="ubuntu"&&t.baseEnvironment!=="aio-sandbox"&&t.baseEnvironment!=="codex-sandbox"||t.operatingSystem!=="ubuntu-22.04"&&t.operatingSystem!=="ubuntu-24.04"||t.language!=="python-3.10"&&t.language!=="python-3.12"||!Array.isArray(t.optionIds)||!t.optionIds.every(n=>typeof n=="string")||t.selectedSkills!==void 0&&!Array.isArray(t.selectedSkills)||typeof t.dockerfile!="string"||typeof t.createdAt!="string"||typeof t.updatedAt!="string")throw new Error(Q("client.invalidEnvironment"));return{...t,baseEnvironment:t.baseEnvironment==="aio-sandbox"?"aio-sandbox":t.baseEnvironment==="codex-sandbox"?"codex-sandbox":"ubuntu",selectedSkills:t.selectedSkills??[],gitSource:Ttt(t.gitSource),containerRepository:QTe(t.containerRepository),imageSource:_tt(t.imageSource),latestVersion:Dz(t.latestVersion)}}function zTe(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidWorkspace"));const t=e;if(typeof t.id!="string"||typeof t.name!="string"||typeof t.description!="string"||!Array.isArray(t.environmentIds)||!t.environmentIds.every(n=>typeof n=="string")||typeof t.createdAt!="string"||typeof t.updatedAt!="string")throw new Error(Q("client.invalidWorkspace"));return t}async function Lz(e){const t=await mt("/web/workspaces",{signal:e});if(!t.ok)throw new Error(await Ht(t,Q("client.loadWorkspacesFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(Q("client.invalidWorkspaceList"));return n.items.map(zTe)}async function VTe(e,t,n,i){const r=await mt(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:i});if(!r.ok)throw new Error(await Ht(r,Q("client.saveWorkspaceFailed")));return zTe(await r.json())}function HTe(e,t){return VTe("/web/workspaces","POST",e,t)}function qTe(e,t,n){return VTe(`/web/workspaces/${encodeURIComponent(e)}`,"PATCH",t,n)}async function WTe(e,t){const n=await mt(`/web/workspaces/${encodeURIComponent(e)}`,{method:"DELETE",signal:t});if(!n.ok)throw new Error(await Ht(n,Q("client.deleteWorkspaceFailed")))}async function VA(e){const t=await mt("/web/v3/environments",{signal:e});if(!t.ok)throw new Error(await Ht(t,Q("client.loadEnvironmentsFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(Q("client.invalidEnvironmentList"));return n.items.map(Mz)}async function KTe(e,t){const n=await mt("/web/v3/environment-repositories/inspect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw new Error(await Ht(n,Q("client.probeRepositoryFailed")));const i=await n.json();if(typeof i.repositoryUrl!="string"||typeof i.ref!="string"||typeof i.commitSha!="string"||!Array.isArray(i.dockerfiles)||!i.dockerfiles.every(r=>typeof r=="string"))throw new Error(Q("client.invalidRepositoryProbe"));return i}async function GTe(e,t){const n=await mt(`/web/v3/environments/${encodeURIComponent(e)}/share-code`,{method:"POST",signal:t});if(!n.ok)throw new Error(await Ht(n,Q("client.exportEnvironmentCodeFailed")));const i=await n.json();if(typeof i.shareCode!="string"||typeof i.name!="string")throw new Error(Q("client.invalidEnvironmentCode"));return i}async function XTe(e,t){const n=await mt("/web/v3/environment-share-codes/inspect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shareCodes:e}),signal:t});if(!n.ok)throw new Error(await Ht(n,Q("client.inspectEnvironmentCodeFailed")));const i=await n.json();if(!Array.isArray(i.items))throw new Error(Q("client.invalidEnvironmentCodeInspection"));return i.items.map(r=>{if(!r||typeof r!="object")throw new Error(Q("client.invalidEnvironmentCodeInspection"));const s=r,o=s.status==="valid"||s.valid===!0?"valid":s.status==="invalid"||s.valid===!1?"invalid":null;if(!Number.isInteger(s.index)||o===null||s.name!==void 0&&typeof s.name!="string"||s.error!==void 0&&typeof s.error!="string")throw new Error(Q("client.invalidEnvironmentCodeInspection"));return{index:s.index,status:o,name:s.name??"",error:s.error??""}})}async function YTe(e,t){const n=await mt("/web/v3/environment-share-codes/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shareCodes:e}),signal:t});if(!n.ok)throw new Error(await Ht(n,Q("client.importEnvironmentCodeFailed")));const i=await n.json();if(!Array.isArray(i.items))throw new Error(Q("client.invalidEnvironmentCodeImport"));return i.items.map(r=>{if(!r||typeof r!="object")throw new Error(Q("client.invalidEnvironmentCodeImport"));const s=r;if(!Number.isInteger(s.index)||!(s.status==="created"||s.status==="duplicate"||s.status==="failed")||s.name!==void 0&&typeof s.name!="string"||s.error!==void 0&&typeof s.error!="string")throw new Error(Q("client.invalidEnvironmentCodeImport"));return{index:s.index,status:s.status,name:s.name??"",environment:s.environment===void 0||s.environment===null?void 0:Mz(s.environment),error:s.error??""}})}async function ZTe(e,t,n,i){let r;try{r=await mt(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:i})}catch(s){throw s instanceof DOMException&&s.name==="AbortError"?s:s instanceof TypeError?new Error(Q("client.studioUnavailable")):s}if(!r.ok)throw new Error(await Ht(r,Q("client.saveEnvironmentFailed")));return Mz(await r.json())}function JTe(e,t){return ZTe("/web/v3/environments","POST",e,t)}function e2e(e,t,n){return ZTe(`/web/v3/environments/${encodeURIComponent(e)}`,"PATCH",t,n)}async function t2e(e,t){const n=await mt(`/web/v3/environments/${encodeURIComponent(e)}`,{method:"DELETE",signal:t});if(!n.ok)throw new Error(await Ht(n,Q("client.deleteEnvironmentFailed")))}async function U8(e,t){const n=await mt(`/web/v3/environments/${encodeURIComponent(e)}/build`,{method:"POST",signal:t});if(!n.ok)throw new Error(await Ht(n,Q("client.startEnvironmentBuildFailed")));const i=Dz(await n.json());if(!i)throw new Error(Q("client.invalidEnvironmentBuild"));return i}async function n2e(e,t,n={}){const i=n.includeLogs?"?includeLogs=true":"",r=await mt(`/web/v3/environments/${encodeURIComponent(e)}/builds/${encodeURIComponent(t)}${i}`,{signal:n.signal});if(!r.ok)throw new Error(await Ht(r,Q("client.loadEnvironmentBuildFailed")));const s=Dz(await r.json());if(!s)throw new Error(Q("client.invalidEnvironmentBuild"));return s}async function i2e(e,t,n){const i=await mt(`/web/v3/environments/${encodeURIComponent(e)}/builds/${encodeURIComponent(t)}/manifest`,{signal:n});if(!i.ok)throw new Error(await Ht(i,Q("client.loadEnvironmentManifestFailed")));return UTe(await i.json())}function tJ(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidEnvironmentResource"));const t=e;if(t.source!=="provided"&&t.source!=="managed"||typeof t.consoleUrl!="string")throw new Error(Q("client.invalidEnvironmentResource"));return t}async function r2e(e){const t=await mt("/web/v3/environment-resources",{signal:e});if(!t.ok)throw new Error(await Ht(t,Q("client.loadEnvironmentResourcesFailed")));const n=await t.json();if(n.provider!=="volcengine"&&n.provider!=="byteplus"||typeof n.region!="string")throw new Error(Q("client.invalidEnvironmentResource"));return{provider:n.provider,region:n.region,codePipeline:tJ(n.codePipeline),containerRegistry:tJ(n.containerRegistry)}}async function jtt(e,t){const n=await mt(`/web/system-info/sandbox-tools/${encodeURIComponent(e)}/model-env`,{method:"POST",signal:t});if(!n.ok)throw new Error(await Ht(n,Q("client.updateCodexSandboxFailed")));const i=await n.json();if(i.kind!=="codex"&&i.kind!=="codex_snapshot"||typeof i.toolId!="string"||typeof i.updated!="boolean")throw new Error(Q("client.invalidCodexSandboxUpdate"));return i}async function jD(e){const t=await mt("/web/identity/user-pools",{signal:e});if(!t.ok)throw new Error(await Ht(t,Q("client.loadUserPoolsFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(Q("client.invalidUserPoolList"));return n.items.map(i=>{if(!i||typeof i!="object"||typeof i.uid!="string"||typeof i.name!="string"||typeof i.domain!="string"||typeof i.region!="string"||typeof i.isCurrent!="boolean")throw new Error(Q("client.invalidUserPoolList"));return i})}class nJ extends Error{constructor(t,n){super(n),this.status=t,this.name="DeploymentRecoveryHttpError"}}const tE=new Map;function Ntt(e){if(typeof e=="string")return e?{message:e}:null;if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e,n=typeof t.message=="string"?t.message:typeof t.error=="string"?t.error:"";return n?{message:n,phase:typeof t.phase=="string"?t.phase:void 0,runtimeId:typeof t.runtimeId=="string"?t.runtimeId:void 0,logPath:typeof t.logPath=="string"?t.logPath:void 0}:null}class nE extends Error{constructor(t){super(t.message),this.detail=t,this.name="GithubCicdPipelineError"}}async function fm(e){const t=await e.text().catch(()=>"");if(t)try{const n=JSON.parse(t),i=Ntt(n.detail??n.error);if(i)return new nE(i)}catch{return new nE({message:t})}return new nE({message:Q("client.syncGithubFailed",{status:e.status})})}async function s2e(e){const t=await mt("/web/github-delivery/source-sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e.project,githubUrl:e.githubUrl,githubToken:e.githubToken,baseBranch:e.baseBranch,region:e.region,cloudProvider:e.cloudProvider})},{},0);if(!t.ok)throw await fm(t);return t.json()}async function a2e(e){const t=await mt("/web/github-delivery/cicd-pipeline",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({githubUrl:e.githubUrl,githubToken:e.githubToken,baseBranch:e.baseBranch,runtimeName:e.runtimeName,runtimeId:e.runtimeId,region:e.region,agentCategory:e.agentCategory,mpaCompatibilityManifest:e.mpaCompatibilityManifest,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await fm(t);return t.json()}async function o2e(e){const t=await mt("/web/github-delivery/init-main",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e.project,githubUrl:e.githubUrl,githubToken:e.githubToken,baseBranch:e.baseBranch,runtimeName:e.runtimeName,runtimeId:e.runtimeId,region:e.region,agentCategory:e.agentCategory,mpaCompatibilityManifest:e.mpaCompatibilityManifest,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await fm(t);return t.json()}async function Rtt(e){const t=await mt("/web/github-delivery/source-sync/cicd",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pipelineId:e.pipelineId,runtimeName:e.runtimeName,runtimeId:e.runtimeId,region:e.region,agentCategory:e.agentCategory,mpaCompatibilityManifest:e.mpaCompatibilityManifest,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await fm(t);return t.json()}async function l2e(e){const t=await mt(`/web/github-cicd/runtime-binding?runtimeId=${encodeURIComponent(e)}`);if(!t.ok)throw await fm(t);const n=await t.json();return n.pipelineId?n:null}async function dN(e){const t=await mt(`/web/github-delivery/versions?runtimeId=${encodeURIComponent(e)}`);if(!t.ok)throw await fm(t);return t.json()}async function c2e(e){const t=await mt("/web/github-delivery/rollback-pr",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await fm(t);return t.json()}async function $z(e){const t=await mt("/web/github-cicd/runtime-binding",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await fm(t);return t.json()}async function u2e(e){const t=await mt("/web/github-cicd/runtime-sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e.runtimeId,project:e.project,agentCategory:e.agentCategory,mpaCompatibilityManifest:e.mpaCompatibilityManifest})},{},0);if(!t.ok)throw await fm(t);return t.json()}async function Lv(e,t,n,i){var h,m,g,b,v,y;const r=i==null?void 0:i.taskId,s=r?new AbortController:void 0;r&&s&&tE.set(r,s);const o=()=>{r&&tE.get(r)===s&&tE.delete(r)},l=async w=>{if(GAe(w))throw w;if(!r||!(i!=null&&i.runtimeId)||typeof i.baseRuntimeVersion!="number")throw new oN({taskId:r,cause:w});const x=await qet({signal:s==null?void 0:s.signal,shouldRetry:k=>!(k instanceof nJ)||k.status===404||k.status===408||k.status===429||k.status>=500,load:async k=>{const S=await mt("/web/deploy-agentkit/status",{method:"POST",headers:{"Content-Type":"application/json"},signal:k,body:JSON.stringify({taskId:r,runtimeId:i.runtimeId,runtimeName:i.runtimeName,appName:i.appName??e,region:n.region,projectName:n.projectName,baseRuntimeVersion:i.baseRuntimeVersion})},{},3e4);if(!S.ok)throw new nJ(S.status,await Ht(S,Q("client.deploymentFailed")));return S.json()}});if(!x)throw new oN({taskId:r,cause:w});return x};let c=null,u=null;try{const w=!!(i!=null&&i.migrationTaskId);(h=i==null?void 0:i.onStage)==null||h.call(i,{level:"info",phase:"upload",message:Q(w?"client.validatingMigrationArtifact":"client.uploadingCodePackage"),pct:0}),c=await mt("/web/deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},signal:s==null?void 0:s.signal,body:JSON.stringify({name:e,files:w?[]:t,config:n,taskId:r,migrationTaskId:i==null?void 0:i.migrationTaskId,runtimeId:i==null?void 0:i.runtimeId,runtimeName:i==null?void 0:i.runtimeName,appName:i==null?void 0:i.appName,agentCategory:i==null?void 0:i.agentCategory,mpaCompatibilityManifest:i==null?void 0:i.mpaCompatibilityManifest,editMode:i==null?void 0:i.editMode,draft:i==null?void 0:i.draft,updateEtag:i==null?void 0:i.updateEtag,baseRuntimeVersion:i==null?void 0:i.baseRuntimeVersion,removeRuntimeEnvKeys:i==null?void 0:i.removeRuntimeEnvKeys,mcpSecretValues:i==null?void 0:i.mcpSecretValues,mcpCredentialReuses:i==null?void 0:i.mcpCredentialReuses,sessionStorage:i==null?void 0:i.sessionStorage,minInstance:i==null?void 0:i.minInstance,maxInstance:i==null?void 0:i.maxInstance,createEvaluationSets:i==null?void 0:i.createEvaluationSets,description:Vet((i==null?void 0:i.description)??""),authentication:i==null?void 0:i.authentication,im:i==null?void 0:i.im,envs:i==null?void 0:i.envs,resources:i==null?void 0:i.resources,source:(i==null?void 0:i.source)??(i!=null&&i.migrationTaskId?{kind:"migration",migrationId:i.migrationTaskId}:{kind:"inlineFiles"}),harnessSidecar:i==null?void 0:i.harnessSidecar,environment:i==null?void 0:i.environment})},{},0),(m=i==null?void 0:i.onStage)==null||m.call(i,{level:"success",phase:"upload",message:Q(w?"client.migrationArtifactValidated":"client.codePackageUploaded"),pct:100})}catch(w){try{u=await l(w)}finally{o()}}if(c&&!c.ok){const w=await Ht(c,Q("client.deploymentFailed"));throw o(),new Error(w)}if(c)try{for await(const w of BA(c)){const x=w;if(x&&x.done){u=x;break}x&&x.message&&((g=i==null?void 0:i.onStage)==null||g.call(i,x))}}catch(w){try{u=await l(w)}finally{o()}}if(u)o();else try{u=await l()}finally{o()}if(!u.success){const w=new Error(u.error||Q("client.deploymentFailed"));throw KAe(w)?new oN({taskId:r,cause:w}):w}if(!u.agentName)throw new Error(Q("client.deploymentMissingAgentName"));if(!u.runtimeId&&!u.url)throw new Error(Q("client.deploymentMissingConnection"));const d=(b=u.runtimeName)!=null&&b.trim()?u.agentName:e,f=((v=u.runtimeName)==null?void 0:v.trim())||u.agentName;return{apikey:u.apikey??"",url:u.url??"",agentName:d,runtimeName:f,runtimeId:u.runtimeId,mpaInstanceId:((y=u.mpaInstanceId)==null?void 0:y.trim())||void 0,consoleUrl:u.consoleUrl,region:u.region,version:u.version,warnings:u.warnings,feishuChannel:u.feishuChannel}}async function d2e(e){var n;const t=await mt("/web/cancel-deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e})});if(!t.ok){const i=await t.text().catch(()=>"");throw new Error(i||Q("client.cancelDeploymentFailed",{status:t.status}))}(n=tE.get(e))==null||n.abort(),tE.delete(e)}async function Itt(e=gz){const t=await mt(`/web/my-runtimes?region=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(Q("client.loadFailed",{status:t.status}));return(await t.json()).runtimes??[]}const cC={title:"AgentKit Studio",logoUrl:""},Q8={enabled:!1},S3={studio:!1,version:"",provider:"volcengine",branding:cC,features:{newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,agentUsage:!1,addAgentkit:!0,generatedAgentTestRun:!0},defaultView:"chat",agentsSource:"local",telemetry:Q8};function Ptt(e){if(!e||typeof e!="object")return Q8;const t=e;if(t.enabled!==!0||!t.studio||typeof t.studio!="object")return Q8;const n=t.studio;return{enabled:!0,studio:{deployId:typeof n.deployId=="string"?n.deployId:"",userPoolId:typeof n.userPoolId=="string"?n.userPoolId:"",applicationId:typeof n.applicationId=="string"?n.applicationId:"",functionId:typeof n.functionId=="string"?n.functionId:"",region:typeof n.region=="string"?n.region:"",project:typeof n.project=="string"?n.project:"",version:typeof n.version=="string"?n.version:"",accountId:typeof n.accountId=="string"?n.accountId:"",accountIdResolutionError:typeof n.accountIdResolutionError=="string"?n.accountIdResolutionError:""}}}async function f2e(){var e,t;try{const n=await mt("/web/ui-config");if(!n.ok)return S3;const i=await n.json(),r=typeof((e=i.branding)==null?void 0:e.logoUrl)=="string"?i.branding.logoUrl:cC.logoUrl,s=i.provider==="byteplus"?"byteplus":"volcengine";return sTe(s),{studio:i.studio??!1,version:typeof i.version=="string"?i.version:"",provider:s,branding:{title:typeof((t=i.branding)==null?void 0:t.title)=="string"?i.branding.title:cC.title,logoUrl:r?Na(r):""},features:{...S3.features,...i.features??{}},defaultView:i.defaultView??"chat",agentsSource:i.agentsSource==="cloud"?"cloud":"local",telemetry:Ptt(i.telemetry)}}catch{return S3}}const h2e={role:"user",telemetry:{userId:"",accountId:""},capabilities:{createAgents:!1,createPersonalAgents:!1,manageAgents:!1,runtimeScope:"mine",manageUsers:!1}};async function p2e(){var n,i,r,s,o,l;const e=await mt("/web/access");if(!e.ok)throw new Error(Q("client.loadPermissionsFailed",{status:e.status}));const t=await e.json();if(!["super_admin","admin","developer","user"].includes(t.role)||typeof((n=t.telemetry)==null?void 0:n.userId)!="string"||t.telemetry.accountId!==void 0&&typeof t.telemetry.accountId!="string"||typeof((i=t.capabilities)==null?void 0:i.createAgents)!="boolean"||typeof((r=t.capabilities)==null?void 0:r.createPersonalAgents)!="boolean"||typeof((s=t.capabilities)==null?void 0:s.manageAgents)!="boolean"||((o=t.capabilities)==null?void 0:o.manageUsers)!==void 0&&typeof t.capabilities.manageUsers!="boolean"||!["all","mine"].includes((l=t.capabilities)==null?void 0:l.runtimeScope))throw new Error(Q("client.invalidPermissionResponse"));return t}async function m2e(e,t){const n=new URLSearchParams;e&&n.set("targetVersion",e),t&&n.set("startedAt",String(t));const i=n.size?`?${n.toString()}`:"",r=await mt(`/web/studio-update${i}`);if(!r.ok)throw new Error(Q("client.checkStudioUpdateFailed",{status:r.status}));return await r.json()}async function g2e(){const e=await mt("/web/studio-update/permissions");if(!e.ok){let t="";try{const n=await e.json();t=typeof n.detail=="string"?n.detail:""}catch{t=""}throw new Error(t||Q("client.studioUpdatePreflightFailed",{status:e.status}))}return await e.json()}async function b2e(e){const t=await mt("/web/studio-update",{method:"POST",headers:{"Content-Type":"application/json","X-VeADK-Studio-Update":"1"},body:JSON.stringify({version:e})},{},yr);if(!t.ok){let n="";try{const i=await t.json();n=typeof i.detail=="string"?i.detail:""}catch{n=""}throw new Error(n||Q("client.submitStudioUpdateFailed",{status:t.status}))}return await t.json()}async function y2e({runtimeId:e,region:t,appName:n,page:i=1,pageSize:r=20,signal:s}){const o=new URLSearchParams({runtimeId:e,region:t,appName:n,page:String(i),pageSize:String(r)}),l=await mt(`/web/agent-usage?${o.toString()}`,{signal:s});if(!l.ok)throw new Error(await Ht(l,Q("client.loadAgentUsageFailed")));const c=l.headers.get("content-type")||Q("client.notProvided"),u=c.toLowerCase();if(!u.includes("application/json")&&!u.includes("+json"))throw new Error(Q("client.agentUsageNonJson",{status:l.status,contentType:c})+Q("client.checkStudioGateway"));try{return await l.json()}catch{throw new Error(Q("client.agentUsageInvalidJson",{status:l.status,contentType:c})+Q("client.retryCheckGateway"))}}function hm(e=""){return`/web/cronjobs${e?`/${encodeURIComponent(e)}`:""}`}async function z8(e){const t=await mt(hm(),{signal:e});if(!t.ok)throw new Error(await Ht(t,Q("client.loadCronJobsFailed")));const n=await t.json();return Array.isArray(n)?n:n.items??[]}async function Dtt(e,t){const n=await mt(hm(e),{signal:t});if(!n.ok)throw new Error(await Ht(n,Q("client.loadCronJobFailed")));return await n.json()}async function v2e(e){const t=await mt(hm(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await Ht(t,Q("client.createCronJobFailed")));return await t.json()}async function x2e(e,t){const n=await mt(`${hm(e)}/update`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error(await Ht(n,Q("client.updateCronJobFailed")));return await n.json()}async function w2e(e,t){const n=t?"enable":"disable",i=await mt(`${hm(e)}/${n}`,{method:"POST"});if(!i.ok)throw new Error(await Ht(i,Q(t?"client.enableCronJobFailed":"client.pauseCronJobFailed")));return await i.json()}async function k2e(e){const t=await mt(`${hm(e)}/run`,{method:"POST"});if(!t.ok)throw new Error(await Ht(t,Q("client.runCronJobFailed")));return await t.json()}async function V8(e,t){const n=await mt(`${hm(e)}/runs`,{signal:t});if(!n.ok)throw new Error(await Ht(n,Q("client.loadCronHistoryFailed")));const i=await n.json();return Array.isArray(i)?i:i.items??[]}async function O2e(e,t){const n=await mt(`${hm(e)}/runs/${encodeURIComponent(t)}/cancel`,{method:"POST"});if(!n.ok)throw new Error(await Ht(n,Q("client.stopCronRunFailed")));return await n.json()}async function S2e(e){const t=await mt(hm(e),{method:"DELETE"});if(!t.ok)throw new Error(await Ht(t,Q("client.deleteCronJobFailed")))}class ND extends Error{constructor(t,n){super(t),this.status=n,this.name="RuntimeListError"}}async function $v(e={}){const t=new URLSearchParams({scope:e.scope??"all",page_size:String(e.pageSize??30),region:e.region??"all"});e.agentCategory&&t.set("agentCategory",e.agentCategory),e.nextToken&&t.set("next_token",e.nextToken);const n=await mt(`/web/runtimes?${t.toString()}`,{signal:e.signal});if(!n.ok){const r=await Ht(n,Q("client.loadRuntimeFailed"));throw new ND(r,n.status)}const i=await n.json();return{runtimes:i.runtimes??[],nextToken:i.nextToken??""}}async function Xw(e,t,n={}){if(n.preferCached){const i=kz(e,t,n.currentVersion),r=iw.get(i);if(r&&r.expiresAt>Date.now())return[...r.apps];r&&iw.delete(i)}try{const i={runtimeId:e,region:t,runtimeVersion:n.currentVersion};return n.retryProbe&&(i.retryProbe=!0),await QA("","",i,n.signal,n.timeoutMs)}catch(i){if(i instanceof V1||i instanceof Ea||i instanceof Error)throw i;return null}}async function E2e(e,t){const n=new URLSearchParams({region:t}),i=await mt(`/web/runtime-tool-channel/${encodeURIComponent(e)}/capabilities?${n.toString()}`);if(!i.ok)throw new Ea(await Ht(i,Q("client.loadLocalToolsFailed")),!1,!0);return await i.json()}async function C2e(e,t){const n=new URLSearchParams({region:t}),i=await mt(`/web/runtime-route-channel/${encodeURIComponent(e)}/connect?${n.toString()}`,{method:"POST"});if(!i.ok)throw new Ea(await Ht(i,Q("client.connectDynamicRouteFailed")),!1,!0);return await i.json()}async function A2e(e,t,n={}){const i={runtimeId:e,region:t};n.retryProbe&&(i.retryProbe=!0);const r=await mt("/.well-known/agent-card.json",{},i),s=await aTe(r);if(s==="runtime_access_denied")throw new V1;if(s==="runtime_private_endpoint_unreachable")throw new Ea(nTe());if(["runtime_proxy_connect_error","runtime_proxy_timeout"].includes(s))throw new Ea(iTe());if(r.status===404)return null;if(r.status===401||r.status===403)throw new Ea(Q("client.a2aProbeDenied"));if(!r.ok)throw new Error(await Ht(r,Q("client.loadA2aCardFailed")));const o=await r.json().catch(()=>null),l=typeof(o==null?void 0:o.url)=="string"?o.url.trim():"";return l?{name:typeof(o==null?void 0:o.name)=="string"?o.name:"",description:typeof(o==null?void 0:o.description)=="string"?o.description:"",endpoint:l}:null}async function T2e(e,t){const n=new URLSearchParams({runtimeId:e,region:t}),i=await mt(`/web/runtime-api-key/reveal?${n.toString()}`,{method:"POST",cache:"no-store"});if(!i.ok)throw new Error(await Ht(i,Q("client.loadRuntimeApiKeyFailed")));const r=await i.json();if(typeof r.apiKey!="string"||!r.apiKey)throw new Error(Q("client.runtimeApiKeyMissing"));return r.apiKey}async function _2e(e,t,n={}){const i=n.agentCategory==="mpa";let r;try{r=await mt("/web/delete-runtime",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e,region:t,agentCategory:n.agentCategory,mpaInstanceId:n.mpaInstanceId})},{},i?18e4:eo)}catch(s){if(!i||!(s instanceof Error)||s.name!=="TimeoutError")throw s;try{const o=new URLSearchParams({runtimeId:e,region:t}),l=await mt(`/web/mpa-runtime-deletion-status?${o.toString()}`,{cache:"no-store"});if(l.ok){const c=await l.json();if((c==null?void 0:c.deleted)===!0)return}}catch{}throw new Error(Q("client.mpaDeleteUnconfirmed"))}if(!r.ok){const s=await r.text().catch(()=>"");throw new Error(s||Q("client.deleteFailed",{status:r.status}))}}async function j2e({runtimeId:e,region:t,appName:n,etag:i,signal:r}){const s=await mt("/web/runtime-mcp-credentials",{method:"POST",cache:"no-store",signal:r,headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e,region:t,appName:n,etag:i})});if(!s.ok)throw new Error(await Ht(s,Q("client.loadMcpCredentialsFailed")));const o=await s.json().catch(()=>null);if(!Array.isArray(o==null?void 0:o.credentials))throw new Error(Q("client.invalidMcpCredentials"));return o.credentials.map(l=>{if(!l||typeof l!="object")throw new Error(Q("client.invalidMcpCredentials"));const c=l,u={agentName:c.agentName,name:c.name,url:c.url,authTokenEnv:c.authTokenEnv,value:c.value};if(Object.values(u).some(d=>typeof d!="string"))throw new Error(Q("client.invalidMcpCredentials"));return u})}function fN({runtimeId:e,region:t,appName:n,currentVersion:i}){return Mv(oC,t,e,i??"",(n==null?void 0:n.trim())??"")}async function Mtt({runtimeId:e,region:t,appName:n,currentVersion:i,force:r=!1}){const s=new URLSearchParams({runtimeId:e,region:t});n&&s.set("appName",n),i!=null&&s.set("currentVersion",String(i)),r&&s.set("refresh","true");const o=await mt(`/web/runtime-update-capability?${s.toString()}`);if(!o.ok)throw new Error(await Ltt(o));return await o.json()}function RD({runtimeId:e,region:t,appName:n,currentVersion:i,signal:r,force:s=!1}){var u,d;const o={runtimeId:e,region:t,appName:n,currentVersion:i},l=fN(o);if(s&&os.delete(l),!s){const f=kb(os,l,H1);if(f)return Y2(Promise.resolve(f),r);const h=(u=os.get(l))==null?void 0:u.promise;if(h)return Y2(h,r);if(n){const m=fN({...o,appName:""}),g=(d=os.get(m))==null?void 0:d.promise;if(g){let b;return b=g.then(v=>{var w,x,k,S,O;if(v.recoveryStatus==="preparing")return((w=os.get(l))==null?void 0:w.promise)===b&&os.delete(l),v;const y=((k=(x=v.agent)==null?void 0:x.appName)==null?void 0:k.trim())??"";return y&&y!==n.trim()?(((S=os.get(l))==null?void 0:S.promise)===b&&os.delete(l),RD(o)):(((O=os.get(l))==null?void 0:O.promise)===b&&os.set(l,{value:v,updatedAt:Date.now()}),v)},v=>{var y;throw((y=os.get(l))==null?void 0:y.promise)===b&&os.delete(l),v}),os.set(l,{promise:b,updatedAt:0}),Y2(b,r)}}}let c;return c=Mtt({...o,force:s}).then(f=>{var h,m,g,b,v;if(f.recoveryStatus==="preparing")return((h=os.get(l))==null?void 0:h.promise)===c&&os.delete(l),f;if(((m=os.get(l))==null?void 0:m.promise)===c){os.set(l,{value:f,updatedAt:Date.now()});const y=new Set(["",((b=(g=f.agent)==null?void 0:g.appName)==null?void 0:b.trim())??""]);for(const w of y){const x=fN({...o,appName:w});x!==l&&!((v=os.get(x))!=null&&v.promise)&&os.set(x,{value:f,updatedAt:Date.now()})}}return f},f=>{var h;throw((h=os.get(l))==null?void 0:h.promise)===c&&os.delete(l),f}),os.set(l,{promise:c,updatedAt:0}),Y2(c,r)}function H8({runtimeId:e,region:t,appName:n,currentVersion:i}){return kb(os,fN({runtimeId:e,region:t,appName:n,currentVersion:i}),H1)}function q8(e){return RD(e).then(()=>{},()=>{})}function W8(e,t){if(!e){os.clear();return}for(const n of os.keys()){const[i,r,s]=n.split("");i===oC&&s===e&&(!t||r===t)&&os.delete(n)}}async function Ltt(e){const t=await e.json().catch(()=>null),n=typeof(t==null?void 0:t.detail)=="string"?t.detail:"";return e.status===403?Q("client.runtimeManageForbidden"):e.status===404?Q(n==="runtime_not_found"?"client.runtimeNotFound":"client.runtimeUnavailable"):Q("client.checkRuntimeUpdateFailed",{status:e.status})}async function $tt(e,t){let n=null;for(const i of UA(t)){const r=await mt(`/web/runtime-detail?runtimeId=${encodeURIComponent(e)}®ion=${encodeURIComponent(i)}`);if(r.ok)return r.json();n=new Error(await Ht(r,Q("client.loadRuntimeDetailFailed")))}throw n??new Error(Q("client.loadRuntimeDetailFailed"))}async function ID(e,t="cn-beijing",n={}){const i=Mv(e,t||"cn-beijing"),r=kb(ly,i,H1);if(!n.force&&r)return r;const s=ly.get(i);if(!n.force&&(s!=null&&s.promise))return s.promise;const o=$tt(e,t).then(l=>Oz(ly,i,l));ly.set(i,{...s,promise:o,updatedAt:(s==null?void 0:s.updatedAt)??0});try{return await o}finally{const l=ly.get(i);(l==null?void 0:l.promise)===o&&ly.set(i,{value:l.value,updatedAt:l.updatedAt})}}async function Ftt(e,t,n){const i=new URLSearchParams({runtimeId:e,region:t,key:n}),r=await mt(`/web/runtime-env/copy?${i.toString()}`,{method:"POST"});if(!r.ok)throw new Error(await Ht(r,Q("client.copySecretFailed")));const s=await r.json();if(typeof s.value!="string"||!s.value)throw new Error(Q("client.copySecretFailed"));await navigator.clipboard.writeText(s.value)}function N2e(e,t="cn-beijing"){return kb(ly,Mv(e,t||"cn-beijing"),H1)}function R2e(e,t="cn-beijing"){ID(e,t).catch(()=>{})}async function iE(e){const t=await mt("/web/generated-agent-projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await Ht(t,Q("client.generateProjectFailed")));return t.json()}const Btt=19e4,Utt=12e4;async function I2e(e){const t=await mt("/web/generated-agent-drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requirement:e})},{},Btt);if(!t.ok)throw new Error(await Ht(t,Q("client.generateAgentConfigFailed")));return SD(t,Q("client.generateAgentConfigFailed"))}async function P2e(e,t){const n=await mt("/web/generated-agent-test-runs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e,runtimeId:t==null?void 0:t.runtimeId,runtimeRegion:t==null?void 0:t.region,mcpCredentialReuses:t==null?void 0:t.mcpCredentialReuses})},{},Utt);if(!n.ok)throw new Error(await Ht(n,Q("client.createDebugRunFailed")));return SD(n,Q("client.createDebugRunFailed"))}async function D2e(e,t){const n=await mt(`/web/generated-agent-test-runs/${e}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:t})});if(!n.ok)throw new Error(await Ht(n,Q("client.createDebugSessionFailed")));return(await SD(n,Q("client.createDebugSessionFailed"))).id}async function M2e(e,t){const n=await mt(`/web/generated-agent-test-runs/${encodeURIComponent(e)}/trace/session/${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await Ht(n,Q("client.loadDebugTraceFailed")));const i=await SD(n,Q("client.loadDebugTraceFailed"));if(!Array.isArray(i))throw new Error(Q("client.invalidDebugTrace"));return i}async function*L2e({runId:e,userId:t,sessionId:n,text:i,signal:r}){const s=i.trim()?[{text:i}]:[],o=_z(r);let l;try{l=await mt(`/web/generated-agent-test-runs/${e}/run_sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({user_id:t,session_id:n,new_message:{role:"user",parts:s},streaming:!0}),signal:o.signal},{},0)}catch(c){throw o.cleanup(),o.timedOut()?new Error(Wg()):c}if(!l.ok)throw o.cleanup(),new Error(await Ht(l,Q("client.debugRunFailed")));try{for await(const c of BA(l))o.clearDeadline(),yield c}catch(c){throw o.timedOut()?new Error(Wg()):c}finally{o.cleanup()}}async function ax(e){const t=await mt(`/web/generated-agent-test-runs/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404)throw new Error(await Ht(t,Q("client.cleanupDebugRunFailed")))}function $2e(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidSandboxVersion"));const t=e;if(typeof t.toolId!="string"||typeof t.error!="string")throw new Error(Q("client.invalidSandboxVersion"));if(!t.error&&(t.provider!=="volcengine"&&t.provider!=="byteplus"||typeof t.region!="string"||typeof t.status!="string"||typeof t.currentImage!="string"||typeof t.latestImage!="string"||typeof t.needsImageUpdate!="boolean"||typeof t.canUpdate!="boolean"||typeof t.needsModelEnvUpdate!="boolean"||typeof t.canUpdateModelEnv!="boolean"||typeof t.modelEnvError!="string"))throw new Error(Q("client.invalidSandboxVersion"));return t}async function F2e(e){const t=await mt("/web/system-info/sandbox-tools/updates",{signal:e});if(!t.ok)throw new Error(await Ht(t,Q("client.loadSandboxVersionsFailed")));const n=await t.json();if(!Array.isArray(n.tools))throw new Error(Q("client.invalidSandboxVersion"));return n.tools.map($2e)}async function B2e(e){const t=await mt(`/web/system-info/sandbox-tools/${encodeURIComponent(e)}/update`,{method:"POST"},{},33e4);if(!t.ok)throw new Error(await Ht(t,Q("client.updateSandboxFailed")));const n=await t.json();if(typeof n.updated!="boolean")throw new Error(Q("client.invalidSandboxUpdate"));return{updated:n.updated,state:$2e(n.state)}}class Ou extends Error{constructor(t){super(`Channel request failed (${t})`),this.status=t}}async function wc(e,t,n={}){const i=await mt(`/api/v1/channels${t}`,{...n,headers:{"Content-Type":"application/json",...n.headers}},e);if(!i.ok)throw new Ou(i.status);return i.json()}function K8(e,t,n,i){return cet(mt,e,t,n,i)}function U2e(e,t,n,i,r){return uet(mt,e,t,n,i,r)}function Q2e(e,t,n,i){return det(mt,e,t,n,i)}const Qtt=Object.freeze(Object.defineProperty({__proto__:null,ChannelApiError:Ou,DEFAULT_SITE_BRANDING:cC,DEFAULT_STUDIO_ACCESS:h2e,GithubCicdPipelineError:nE,MpaExecutionConfigRequestError:rw,RuntimeAccessDeniedError:V1,RuntimeListError:ND,RuntimeProbeError:Ea,TurnControlConflictError:TD,applyMpaProfileAfterDeployment:eI,attachGithubDeliveryCicdToSourceSync:Rtt,bindGithubCicdRuntime:$z,buildEnvironment:U8,cancelAgentkitDeployment:d2e,cancelCronJobRun:O2e,channelRequest:wc,checkRuntimeNameAvailability:_D,clearMessageFeedbackCache:XAe,clearRemoteApps:ZAe,componentSearch:ETe,continueTurn:Ett,continueTurnSSE:kTe,controlTurn:wTe,copyRuntimeEnvironmentSecret:Ftt,createCronJob:v2e,createEnvironment:JTe,createGeneratedAgentTestRun:P2e,createGeneratedAgentTestSession:D2e,createGithubCicdPipeline:s2e,createGithubDeliveryCicdPipeline:a2e,createGithubDeliveryRollbackPr:c2e,createSession:oTe,createWorkspace:HTe,deleteAgentFeedbackCases:hTe,deleteCronJob:S2e,deleteEnvironment:t2e,deleteGeneratedAgentTestRun:ax,deleteMedia:uN,deleteRuntime:_2e,deleteSession:D8,deleteSessionMedia:M8,deleteWorkspace:WTe,deployAgentkitProject:Lv,downloadArtifact:Ez,ensureRuntimeRouteChannel:C2e,exportEnvironmentShareCode:GTe,fetchRemoteApps:QA,fetchSessionFile:pTe,generateAgentDraftFromRequirement:I2e,generateAgentProject:iE,getAgentFeedbackCases:AD,getAgentInfo:$8,getAgentOptimizations:cTe,getAgentUsage:y2e,getAutomaticEvaluationStatuses:P8,getCachedAgentFeedbackCases:uTe,getCachedRuntimeAgentInfo:OTe,getCachedRuntimeDetail:N2e,getCachedRuntimeUpdateCapability:H8,getCronJob:Dtt,getEnvironmentBuild:n2e,getEnvironmentManifest:i2e,getEnvironmentResources:r2e,getGeneratedAgentTestTrace:M2e,getGithubCicdRuntimeBinding:l2e,getGithubDeliveryVersions:dN,getMediaCapabilities:Ott,getMpaAgentDeletePreview:NTe,getMpaAgentOperation:TTe,getMpaAgentView:jTe,getMpaProfileStatus:_Te,getMpaRuntimeConsoleRuns:RTe,getMpaRuntimeConsoleTrace:ITe,getMpaSessionExecutionConfig:Iz,getMyRuntimes:Itt,getRuntimeAgentInfo:Az,getRuntimeDetail:ID,getRuntimeMcpCredentials:j2e,getRuntimeStudioToolCapabilities:E2e,getRuntimeUpdateCapability:RD,getRuntimes:$v,getSandboxImageUpdates:F2e,getSession:lC,getSessionTrace:ZR,getStudioAccess:p2e,getStudioUpdatePermissions:g2e,getStudioUpdateStatus:m2e,getSystemInfo:FTe,getTurnControl:xTe,getUiConfig:f2e,httpErrorMessage:Ht,importEnvironmentShareCodes:YTe,initializeGithubDeliveryMain:o2e,inspectEnvironmentRepository:KTe,inspectEnvironmentShareCodes:XTe,invalidateRuntimeUpdateCapabilityCache:W8,isMpaA2aRuntimeApp:ap,isMpaRuntimeApp:JR,listActiveMpaAgentOperations:ATe,listApps:tTe,listCronJobRuns:V8,listCronJobs:z8,listDeploymentResources:DTe,listEnvironments:VA,listIdentityUserPools:jD,listModelApiKeys:wz,listModelOptions:z1,listMpaCronTasks:K8,listMpaRuns:Q2e,listSessions:Sz,listWorkspaces:Lz,mediaContentUrl:yTe,mpaProfileFromAgentDraft:zA,parseEnvironmentManifest:UTe,parseEnvironmentShareCodes:Pz,parsePreparedSessionEnvironmentMounts:MTe,patchMpaSessionExecutionConfig:B8,prefetchAgentFeedbackCases:wtt,prefetchRuntimeAgentInfo:STe,prefetchRuntimeDetail:R2e,prefetchRuntimeUpdateCapability:q8,prepareSessionEnvironmentMounts:LTe,previewArtifact:Cz,probeRuntimeA2a:A2e,probeRuntimeApps:Xw,refreshAgentFeedbackCases:dTe,registerRemoteApp:YAe,requestMpaTask:U2e,retryMpaAgentOperation:Rz,revealModelApiKey:eTe,revealRuntimeApiKey:T2e,runCronJobNow:k2e,runGeneratedAgentTestSSE:L2e,runSSE:F8,runSseEmptyResponseError:Tz,runSseFirstEventTimeoutError:Wg,runSseIncompleteResponseError:fS,runtimeRegionCandidates:UA,setClientCloudProvider:sTe,setCronJobEnabled:w2e,startMpaAgentOperation:Nz,startStudioUpdate:b2e,studioFetch:yn,submitIssueFeedback:L8,submitMessageFeedback:lTe,syncGithubCicdRuntime:u2e,updateCodexSandboxToolModelEnv:jtt,updateCronJob:x2e,updateEnvironment:e2e,updateSandboxTool:B2e,updateWorkspace:qTe,upgradeMpaSessionProfile:PTe,uploadMedia:gTe,upsertCachedAgentFeedbackCase:cN,webSearch:CTe,writeEnvironmentShareCode:$Te},Symbol.toStringTag,{value:"Module"})),ztt="/web/sandbox/sessions",iJ="/web/sandbox/codex-project-handoff",rJ=3e4,E3=33e4,Vtt=6e4,Htt=6e5,uO=15e3,hp=6e4,qtt=33e4,sJ=3e4,Wtt=60*60,G8=40;function PD(e){const t=e.trim().toLowerCase();return["ready","running","wakeable"].includes(t)?"ready":t}function Fz(e){switch(e.trim().toLowerCase()){case"ready":return Q("sandbox.status.ready");case"wakeable":return Q("sandbox.status.wakeable");case"creating":return Q("sandbox.status.creating");case"starting":case"initializing":return Q("sandbox.status.starting");case"pending":return Q("sandbox.status.pending");case"running":return Q("sandbox.status.running");case"failed":case"error":return Q("sandbox.status.failed");case"stopped":return Q("sandbox.status.stopped");case"expired":return Q("sandbox.status.expired");case"deleting":return Q("sandbox.status.deleting");case"deleted":return Q("sandbox.status.deleted");default:return Q("sandbox.status.unknown")}}function ys(e){const t=hl(e);return t.has("Accept")||t.set("Accept","application/json"),t}class Bz extends Error{constructor(n,i={}){var r;super(n);Zt(this,"code");Zt(this,"retryable");Zt(this,"publicMessage");Zt(this,"httpStatus");this.name="SandboxServiceError",this.code=i.code??"",this.retryable=i.retryable===!0,this.publicMessage=((r=i.publicMessage)==null?void 0:r.trim())||n,this.httpStatus=i.httpStatus}}function Ktt(e){return e instanceof Bz?e.publicMessage:e instanceof Error&&e.name==="TimeoutError"?Q("sandbox.developmentTimeout"):e instanceof TypeError?Q("sandbox.developmentDisconnected"):Q("sandbox.developmentFailed")}async function Bs(e,t){const n=await e.text().catch(()=>"");let i={};try{i=JSON.parse(n)}catch{const d=Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status});return new Error(n?Q("common.fallbackWithDetail",{fallback:d,detail:n}):d)}const r=i.detail,s=r&&typeof r=="object"?r:i,o=r&&typeof r=="object"&&"message"in r?r.message:r??i.error??i.message,l=typeof o=="string"?o:o==null?"":JSON.stringify(o),c=Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),u=l?Q("common.fallbackWithDetail",{fallback:c,detail:l}):c;return new Bz(u,{code:typeof s.code=="string"?s.code:"",retryable:s.retryable===!0,publicMessage:l||c,httpStatus:e.status})}async function aJ(e,t){const n=await e.text().catch(()=>"");try{return JSON.parse(n)}catch{throw new Error(Q("sandbox.invalidStudioResponse",{fallback:t}))}}function zb(e,t="codex",n=e.toolName==="intelligent-development"){if(!e.sessionId||!e.status)throw new Error(Q("sandbox.invalidSession"));return{resourceType:"session",id:e.sessionId,toolName:t,userSessionId:e.userSessionId??"",displayName:e.displayName??"",status:e.status,createdAt:e.createdAt??"",expireAt:e.expireAt??"",persistent:e.persistent!==!1,toolType:e.toolType??"",intelligentDevelopment:n,createdBy:e.createdBy??"",region:e.region??"",isMine:e.isMine===!0,threadId:e.threadId??"",cwd:e.cwd??"",workspaceLocked:e.workspaceLocked===!0,busy:e.busy===!0,...typeof e.model=="string"?{model:e.model}:{},permissions:DD(e.permissions),...e.conversation===void 0?{}:{restoredConversation:cy(e.conversation)}}}function oJ(e,t="codex"){if(!e.snapshotId||!e.status)throw new Error(Q("sandbox.invalidSnapshot"));return{resourceType:"snapshot",id:e.snapshotId,snapshotId:e.snapshotId,sourceSessionId:e.sessionId??"",toolName:t,userSessionId:e.userSessionId??"",displayName:e.displayName??"",status:e.status,snapshotStatus:e.snapshotStatus??"Unknown",reason:e.reason??"",createdAt:e.createdAt??"",createdBy:e.createdBy??"",region:e.region??"",isMine:e.isMine===!0}}function lJ(e,t){if((t==null?void 0:t.autoResumeSnapshots)===void 0)return e;const n=new URLSearchParams({autoResumeSnapshots:String(t.autoResumeSnapshots)});return`${e}?${n.toString()}`}const dO={approvalPolicy:"on-request",approvalsReviewer:"user",sandboxMode:"workspace-write",networkAccess:!1};function DD(e){if(!e||typeof e!="object")return{...dO};const t=e,n=t.approvalPolicy,i=t.approvalsReviewer,r=t.sandboxMode;return{approvalPolicy:n==="untrusted"||n==="on-request"||n==="never"?n:dO.approvalPolicy,approvalsReviewer:i==="user"||i==="auto_review"?i:dO.approvalsReviewer,sandboxMode:r==="read-only"||r==="workspace-write"||r==="danger-full-access"?r:dO.sandboxMode,networkAccess:typeof t.networkAccess=="boolean"?t.networkAccess:dO.networkAccess}}function cJ(e){if(!e||typeof e!="object")throw new Error(Q("sandbox.invalidSettings"));const t=e;return{threadId:typeof t.threadId=="string"?t.threadId:"",cwd:typeof t.cwd=="string"?t.cwd:"",...typeof t.model=="string"?{model:t.model}:{},workspaceLocked:t.workspaceLocked===!0,busy:t.busy===!0,permissions:DD(t.permissions)}}function Oa(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Gtt(e){const t=Oa(e);if(!(!t||typeof t.id!="string"||!t.id))return{id:t.id,displayName:typeof t.displayName=="string"?t.displayName:t.id,description:typeof t.description=="string"?t.description:"",isDefault:t.isDefault===!0}}function Xtt(e){const t=Oa(e);if(!(!t||typeof t.id!="string"||!t.id||typeof t.name!="string"||!t.name))return{id:t.id,name:t.name,description:typeof t.description=="string"?t.description:""}}function z2e(e){const t=Oa(e);if(!(!t||typeof t.id!="string"||!t.id))return{id:t.id,...typeof t.name=="string"&&t.name?{name:t.name}:{},preview:typeof t.preview=="string"?t.preview:"",cwd:typeof t.cwd=="string"?t.cwd:"",modelProvider:typeof t.modelProvider=="string"?t.modelProvider:"",createdAt:typeof t.createdAt=="number"&&Number.isFinite(t.createdAt)?t.createdAt:0,updatedAt:typeof t.updatedAt=="number"&&Number.isFinite(t.updatedAt)?t.updatedAt:0,status:typeof t.status=="string"?t.status:"unknown"}}function cy(e){const t=Oa(e),n=z2e(t==null?void 0:t.thread);if(!t||!n||typeof t.threadId!="string"||!Array.isArray(t.messages))throw new Error(Q("sandbox.invalidThreadSnapshot"));const i=t.messages.flatMap(r=>{const s=Oa(r);if(!s||typeof s.id!="string"||s.role!=="user"&&s.role!=="assistant"||typeof s.content!="string"||typeof s.timestamp!="number")return[];const o=Array.isArray(s.skillNames)?s.skillNames.filter(c=>typeof c=="string"&&!!c):[],l=Array.isArray(s.images)?s.images.flatMap(c=>{const u=Oa(c);return!u||typeof u.mimeType!="string"||!u.mimeType.startsWith("image/")||typeof u.data!="string"||!u.data?[]:[{mimeType:u.mimeType,data:u.data,...typeof u.name=="string"&&u.name?{name:u.name}:{},...typeof u.alt=="string"&&u.alt?{alt:u.alt}:{}}]}):[];return[{id:s.id,role:s.role,content:s.content,timestamp:s.timestamp,...o.length?{skillNames:o}:{},...l.length?{images:l}:{}}]});return{thread:n,threadId:t.threadId,messages:i,...typeof t.model=="string"?{model:t.model}:{},...typeof t.cwd=="string"?{cwd:t.cwd}:{},workspaceLocked:t.workspaceLocked===!0,permissions:DD(t.permissions)}}function X8(e){if(!e||typeof e!="object")return;const t=e;if(![t.totalTokens,t.inputTokens,t.cachedInputTokens,t.outputTokens,t.reasoningOutputTokens].some(i=>typeof i!="number"||!Number.isFinite(i)||i<0))return{totalTokens:Math.trunc(t.totalTokens),inputTokens:Math.trunc(t.inputTokens),cachedInputTokens:Math.trunc(t.cachedInputTokens),outputTokens:Math.trunc(t.outputTokens),reasoningOutputTokens:Math.trunc(t.reasoningOutputTokens)}}function Ytt(e){const t=X8(e.usage);if(!t||typeof e.turnId!="string")return;const n=X8(e.threadTotal),i=e.modelContextWindow;return{turnId:e.turnId,usage:t,...n?{threadTotal:n}:{},...typeof i=="number"&&Number.isFinite(i)&&i>=0?{modelContextWindow:Math.trunc(i)}:{}}}function Ztt(e){return typeof e.id!="string"||e.kind!=="command"&&e.kind!=="file"||typeof e.method!="string"?null:{id:e.id,kind:e.kind,method:e.method,...typeof e.reason=="string"?{reason:e.reason}:{},...typeof e.command=="string"?{command:e.command}:{},...typeof e.cwd=="string"?{cwd:e.cwd}:{},...typeof e.grantRoot=="string"?{grantRoot:e.grantRoot}:{},...e.changes!==void 0?{changes:e.changes}:{},...typeof e.threadId=="string"?{threadId:e.threadId}:{},...typeof e.turnId=="string"?{turnId:e.turnId}:{},...typeof e.itemId=="string"?{itemId:e.itemId}:{}}}function V2e(e={}){let t="";const n=[],i=new Map,r=new Map;let s,o;function l(){var h;const f=s?[...n,s]:n;(h=e.onBlocks)==null||h.call(e,[...f])}function c(f){t+=f;const h=n[n.length-1],m=n.length-1,g=[...i.values()].includes(m);(h==null?void 0:h.kind)==="text"&&!g?n[m]={...h,text:h.text+f}:n.push({kind:"text",text:f}),l()}function u(f){if(typeof f.id!="string"||f.kind!=="thinking"&&f.kind!=="commentary"&&f.kind!=="tool"||f.status!=="running"&&f.status!=="done"&&f.status!=="error")return;const h=f.status!=="running";let m;if(f.kind==="thinking")m={kind:"thinking",text:typeof f.text=="string"?f.text:"",done:h};else if(f.kind==="commentary"){if(typeof f.text!="string"||!f.text)return;m={kind:"text",text:f.text}}else{if(typeof f.name!="string"||!f.name)return;m={kind:"tool",name:f.name,args:f.args,response:f.response,status:f.status==="error"?"failed":h?"completed":"running",done:h}}m={...m,id:f.id,...typeof f.itemType=="string"?{itemType:f.itemType}:{},...typeof f.phase=="string"?{phase:f.phase}:{},...typeof f.durationMs=="number"?{durationMs:f.durationMs}:{}};const g=i.get(f.id);g===void 0?(i.set(f.id,n.length),n.push(m)):n[g]=m,l()}function d(f){var b,v,y,w;let h="message";const m=[];for(const x of f.split(/\r?\n/))x.startsWith("event:")&&(h=x.slice(6).trim()),x.startsWith("data:")&&m.push(x.slice(5).trimStart());if(m.length===0)return;let g;try{g=JSON.parse(m.join(` +`))}catch{throw new Error(Q("sandbox.invalidConversationResponse"))}if(h==="error"){const x=typeof g.message=="string"&&g.message?g.message:Q("sandbox.conversationFailed");throw new Bz(x,{code:typeof g.code=="string"?g.code:"",retryable:g.retryable===!0,publicMessage:x})}if(h==="progress"&&typeof g.text=="string"&&(s=g.text?{kind:"progress",text:g.text}:void 0,l()),["activity","delta","tool_output","tool_progress","plan","diff"].includes(h)&&(s=void 0),h==="activity"&&u(g),(h==="tool_output"||h==="tool_progress")&&typeof g.id=="string"){const x=i.get(g.id),k=x===void 0?void 0:n[x];if((k==null?void 0:k.kind)==="tool"&&x!==void 0&&typeof g.text=="string"){const S=Oa(k.response)||{};n[x]=h==="tool_progress"?{...k,progressText:g.text}:{...k,response:{...S,output:(g.snapshot?"":String(S.output||""))+g.text}},l()}}if((h==="plan"||h==="diff")&&typeof g.id=="string"){const x=typeof g.text=="string"?g.text:"",k=Array.isArray(g.items)?g.items:Array.isArray(g.plan)?g.plan:[],S=h==="diff"?{kind:"diff",id:g.id,text:x,done:g.status==="done"}:{kind:"plan",id:g.id,title:Q("developmentRuns.plan"),summary:x,done:g.status==="done",items:k.flatMap(A=>{const E=Oa(A);if(!E||typeof(E.text??E.step)!="string")return[];const j=E.status==="inProgress"?"in_progress":E.status;return[{text:String(E.text??E.step),status:j==="completed"||j==="failed"||j==="in_progress"?j:"pending"}]})},O=i.get(g.id);O===void 0?(i.set(g.id,n.length),n.push(S)):n[O]=S,l()}if(h==="development.source_ready"||h==="development.succeeded"){const x=Oa(g.payload),k=Oa(x==null?void 0:x.delivery),S=h==="development.succeeded";if(k&&typeof k.sessionId=="string"&&typeof k.artifactSha256=="string"&&typeof k.validationReportSha256=="string"&&typeof k.agentName=="string"&&typeof k.entryPoint=="string"&&typeof k.fileCount=="number"&&typeof k.artifactSize=="number"&&typeof k.validatedAt=="string"&&k.deployable===!0&&k.verified===S&&typeof k.validationSummary=="string"&&Array.isArray(k.gateSummary)&&k.gateSummary.every(O=>typeof O=="string")){const O={kind:"delivery",value:{sessionId:k.sessionId,...typeof k.projectId=="string"&&typeof k.versionId=="string"?{projectId:k.projectId,versionId:k.versionId,...k.parentVersionId===null||typeof k.parentVersionId=="string"?{parentVersionId:k.parentVersionId}:{}}:{},artifactSha256:k.artifactSha256,validationReportSha256:k.validationReportSha256,agentName:k.agentName,entryPoint:k.entryPoint,fileCount:k.fileCount,artifactSize:k.artifactSize,validatedAt:k.validatedAt,gateSummary:k.gateSummary,deployable:k.deployable,verified:k.verified,validationSummary:k.validationSummary}},A=n.findIndex(E=>E.kind==="delivery"&&E.value.sessionId===k.sessionId&&E.value.artifactSha256===k.artifactSha256&&E.value.validationReportSha256===k.validationReportSha256);A===-1?n.push(O):n[A]=O,l()}}if(h==="approval"){const x=Ztt(g);x&&((b=e.onApproval)==null||b.call(e,x))}if(h==="usage"){const x=Ytt(g);x&&(o=x,(v=e.onUsage)==null||v.call(e,x))}if(h==="approval_resolved"&&typeof g.approvalId=="string"&&((y=e.onApprovalResolved)==null||y.call(e,g.approvalId)),h==="delta"&&typeof g.text=="string")if(typeof g.id=="string"&&g.id){const x=r.get(g.id),k=x===void 0?void 0:n[x],S=((w=Oa(g))==null?void 0:w.snapshot)===!0;(k==null?void 0:k.kind)==="text"?n[x]={...k,phase:typeof g.phase=="string"&&g.phase?g.phase:k.phase,text:S?k.text.startsWith(g.text)?k.text:g.text:k.text+g.text}:(r.set(g.id,n.length),n.push({kind:"text",text:g.text,id:g.id,itemType:typeof g.itemType=="string"?g.itemType:void 0,phase:typeof g.phase=="string"?g.phase:void 0})),t=n.filter(O=>O.kind==="text").map(O=>O.text).join(""),l()}else c(g.text);if(h==="done"&&!t&&typeof g.text=="string"&&c(g.text),h==="done"){for(let x=0;x({text:t,blocks:n.map(f=>({...f})),...o?{usage:o}:{}})}}async function Jtt(e,t={}){if(!e.body)throw new Error(Q("sandbox.emptyConversationResponse"));const n=e.body.getReader(),i=new TextDecoder;let r="";const s=V2e(t);for(;;){const{done:l,value:c}=await n.read();r+=i.decode(c,{stream:!l});const u=r.split(/\r?\n\r?\n/);if(r=u.pop()??"",u.forEach(s.consumeFrame),l)break}r.trim()&&s.consumeFrame(r),s.consumeFrame(`event: done +data: {}`);const o=s.result();if(o.blocks.length===0)throw new Error(Q("sandbox.emptyReply"));return o}async function su(e,t,n,{method:i="GET",body:r,options:s={},fallback:o}){if(!t)throw new Error(Q("sandbox.missingSession"));const l=await yn(`${e}/${encodeURIComponent(t)}/${n}`,{method:i,headers:ys(r===void 0?void 0:{"Content-Type":"application/json"}),...r===void 0?{}:{body:JSON.stringify(r)},signal:s.signal},hp);if(!l.ok)throw await Bs(l,o);return l.json()}function H2e(e,t={}){return{async listSessions(n={}){const i=await yn(lJ(e,n),{method:"GET",headers:ys(),signal:n.signal},rJ);if(!i.ok)throw await Bs(i,Q("sandbox.listCodexFailed"));const r=await i.json();if(!Array.isArray(r.sessions))throw new Error(Q("sandbox.invalidSessionList"));if(r.snapshots!==void 0&&!Array.isArray(r.snapshots))throw new Error(Q("sandbox.invalidSnapshotList"));return[...r.sessions.map(s=>zb(s,"codex",t.intelligentDevelopment)),...(r.snapshots??[]).map(s=>oJ(s))]},async startSession(n={}){var s,o;const i=((s=n.displayName)==null?void 0:s.trim())??"",r=await yn(e,{method:"POST",headers:ys({"Content-Type":"application/json"}),body:JSON.stringify({displayName:t.textOnly&&n.projectId?Array.from(i).slice(0,G8).join(""):i,...(o=n.modelId)!=null&&o.trim()?{modelId:n.modelId.trim()}:{},...t.textOnly&&n.projectId?{projectId:n.projectId,...n.baseVersionId?{baseVersionId:n.baseVersionId}:{}}:{},...t.textOnly?{}:{persistent:n.persistent??!0},...n.diskGb!==void 0?{diskGb:n.diskGb}:{}}),signal:n.signal},E3);if(!r.ok)throw await Bs(r,Q("sandbox.startFailed"));return zb(await r.json(),"codex",t.intelligentDevelopment)},async listAgentSessions(n,i={}){const r=await yn(lJ(`/web/${n}/sessions`,i),{method:"GET",headers:ys(),signal:i.signal},rJ);if(!r.ok)throw await Bs(r,Q("sandbox.listAgentFailed",{kind:n}));const s=await r.json();if(!Array.isArray(s.sessions))throw new Error(Q("sandbox.invalidKindSessionList",{kind:n}));if(s.snapshots!==void 0&&!Array.isArray(s.snapshots))throw new Error(Q("sandbox.invalidKindSnapshotList",{kind:n}));return[...s.sessions.map(o=>zb(o,n)),...(s.snapshots??[]).map(o=>oJ(o,n))]},async startAgentSession(n,i={}){var s;const r=await yn(`/web/${n}/sessions`,{method:"POST",headers:ys({"Content-Type":"application/json"}),body:JSON.stringify({displayName:((s=i.displayName)==null?void 0:s.trim())??"",persistent:i.persistent??!0,...i.diskGb!==void 0?{diskGb:i.diskGb}:{}}),signal:i.signal},E3);if(!r.ok)throw await Bs(r,Q("sandbox.createAgentFailed",{kind:n}));return zb(await r.json(),n)},async openAgentSession(n,i,r={}){if(!i)throw new Error(Q("sandbox.missingSessionToOpen"));const s=await yn(`/web/${n}/sessions/${encodeURIComponent(i)}/open`,{method:"POST",headers:ys(),signal:r.signal},hp);if(!s.ok)throw await Bs(s,Q("sandbox.openAgentFailed",{kind:n}));const o=await s.json();if(typeof o.webuiUrl!="string"||!o.webuiUrl.startsWith("/"))throw new Error(Q("sandbox.invalidAgentHomeUrl",{kind:n}));return{session:zb(o,n),kind:n,webuiUrl:Na(o.webuiUrl)}},async launchAgentTerminal(n,i,r={}){if(!i)throw new Error(Q("sandbox.missingSessionForTerminal"));const s=await yn(`/web/${n}/sessions/${encodeURIComponent(i)}/terminal`,{method:"POST",headers:ys(),signal:r.signal},hp);if(!s.ok)throw await Bs(s,Q("sandbox.openTerminalFailed",{kind:n}));const o=await s.json();return{url:q2e(o.url,`${n} Terminal`),...typeof o.shellSessionId=="string"?{shellSessionId:o.shellSessionId}:{}}},async deleteAgentSession(n,i,r={}){if(!i)return;const s=await yn(`/web/${n}/sessions/${encodeURIComponent(i)}`,{method:"DELETE",headers:ys(),signal:r.signal},uO);if(!s.ok&&s.status!==404)throw await Bs(s,Q("sandbox.deleteAgentFailed",{kind:n}))},async resumeSnapshot(n,i,r={}){if(!i)throw new Error(Q("sandbox.missingSnapshot"));const s=n==="codex"?"/web/sandbox":`/web/${n}`,o=await yn(`${s}/snapshots/${encodeURIComponent(i)}/resume`,{method:"POST",headers:ys(),signal:r.signal},E3);if(!o.ok)throw await Bs(o,Q("sandbox.resumeSnapshotFailed"));return zb(await o.json(),n)},async deleteSnapshot(n,i,r={}){if(!i)return;const s=n==="codex"?"/web/sandbox":`/web/${n}`,o=await yn(`${s}/snapshots/${encodeURIComponent(i)}`,{method:"DELETE",headers:ys(),signal:r.signal},uO);if(!o.ok&&o.status!==404)throw await Bs(o,Q("sandbox.deleteSnapshotFailed"))},async connectSession(n,i={}){if(!n)throw new Error(Q("sandbox.missingSessionToConnect"));const r=await yn(`${e}/${encodeURIComponent(n)}/connect`,{method:"POST",headers:ys({"Content-Type":"application/json"}),signal:i.signal},Vtt);if(!r.ok)throw await Bs(r,Q("sandbox.connectCodexFailed"));const s=zb(await r.json(),"codex",t.intelligentDevelopment);if(s.status.toLowerCase()!=="ready")throw new Error(Q("sandbox.sessionNotReady",{status:s.status}));return s},async sendMessage(n,i={}){var s;if(!n.sessionId||!n.text.trim())throw new Error(Q("sandbox.invalidMessage"));const r=await yn(`${e}/${encodeURIComponent(n.sessionId)}/messages`,{method:"POST",headers:ys({Accept:"text/event-stream","Content-Type":"application/json"}),body:JSON.stringify({message:n.text,...!t.textOnly&&((s=n.skillIds)!=null&&s.length)?{skillIds:n.skillIds}:{}}),signal:i.signal},t.messageTimeoutMs??Htt);if(!r.ok)throw await Bs(r,Q("sandbox.conversationFailed"));return Jtt(r,i)},async interruptSession(n,i={}){if(!n)return;const r=await yn(`${e}/${encodeURIComponent(n)}/interrupt`,{method:"POST",headers:ys(),signal:i.signal},t.interruptTimeoutMs??uO);if(!r.ok&&![404,409].includes(r.status))throw await Bs(r,Q("sandbox.interruptFailed"))},async getStatus(n,i={}){const r=await su(e,n,"status",{options:i,fallback:Q("sandbox.getStatusFailed")}),s=cJ(r),o=Oa(r),l=X8(o==null?void 0:o.threadTotal),c=o==null?void 0:o.modelContextWindow;return{...s,...l?{threadTotal:l}:{},...typeof c=="number"&&Number.isFinite(c)&&c>=0?{modelContextWindow:Math.trunc(c)}:{}}},async getEndpoint(n,i={}){const r=Oa(await su(e,n,"endpoint",{options:i,fallback:Q("sandbox.getEndpointFailed")}));if(typeof(r==null?void 0:r.endpoint)!="string"||!r.endpoint.trim())throw new Error(Q("sandbox.invalidEndpoint"));return{endpoint:r.endpoint,sessionId:typeof r.sessionId=="string"?r.sessionId:n,...typeof r.expireAt=="string"?{expireAt:r.expireAt}:{}}},async createCodexProjectHandoffPairing(n={}){const i=await yn(`${iJ}/pairings`,{method:"POST",headers:ys({Accept:"application/json","Content-Type":"application/json"}),body:JSON.stringify({ttlSeconds:Wtt}),signal:n.signal},sJ);if(!i.ok)throw await Bs(i,Q("sandbox.createHandoffPairingFailed"));const r=Oa(await aJ(i,Q("sandbox.createHandoffPairingFailed")));if(typeof(r==null?void 0:r.pairingCode)!="string"||!r.pairingCode.trim()||typeof r.expireAt!="string"||!r.expireAt.trim())throw new Error(Q("sandbox.invalidHandoffPairing"));const s=typeof r.studioUrl=="string"&&r.studioUrl.trim()?r.studioUrl.trim():window.location.origin;return{pairingCode:r.pairingCode,expireAt:r.expireAt,studioUrl:s}},async getCodexProjectHandoffStatus(n,i={}){const r=await yn(`${iJ}/pairings/${encodeURIComponent(n)}`,{headers:ys({Accept:"application/json"}),signal:i.signal},sJ);if(!r.ok)throw await Bs(r,Q("sandbox.getHandoffStatusFailed"));const s=Oa(await aJ(r,Q("sandbox.getHandoffStatusFailed"))),o=new Set(["issued","creating","session-created","continuing","running","completed","failed"]);if(typeof(s==null?void 0:s.state)!="string"||!o.has(s.state)||typeof s.expireAt!="string"||!s.expireAt.trim())throw new Error(Q("sandbox.invalidHandoffStatus"));return{state:s.state,expireAt:s.expireAt,...typeof s.projectName=="string"?{projectName:s.projectName}:{},...typeof s.agentName=="string"?{agentName:s.agentName}:{},...typeof s.sessionId=="string"?{sessionId:s.sessionId}:{},...typeof s.error=="string"?{error:s.error}:{},...s.failedStage==="creating-session"||s.failedStage==="uploading-project"||s.failedStage==="restoring-project"||s.failedStage==="continuing-task"?{failedStage:s.failedStage}:{}}},async listModels(n,i={}){const r=Oa(await su(e,n,"models",{options:i,fallback:Q("sandbox.listModelsFailed")}));if(!Array.isArray(r==null?void 0:r.models))throw new Error(Q("sandbox.invalidModelList"));return r.models.flatMap(s=>{const o=Gtt(s);return o?[o]:[]})},async setModel(n,i,r={}){const s=Oa(await su(e,n,"model",{method:"PUT",body:{model:i},options:r,fallback:Q("sandbox.setModelFailed")}));if(typeof(s==null?void 0:s.model)!="string"||!s.model)throw new Error(Q("sandbox.invalidModel"));return s.model},async listSkills(n,i=!1,r={}){const o=Oa(await su(e,n,`skills${i?"?force_reload=true":""}`,{options:r,fallback:Q("sandbox.listSkillsFailed")}));if(!Array.isArray(o==null?void 0:o.skills))throw new Error(Q("sandbox.invalidSkillList"));return o.skills.flatMap(l=>{const c=Xtt(l);return c?[c]:[]})},async listThreads(n,i={},r={}){const s=new URLSearchParams;i.cursor&&s.set("cursor",i.cursor),i.search&&s.set("search",i.search),i.archived&&s.set("archived","true");const o=s.size?`?${s}`:"",l=Oa(await su(e,n,`threads${o}`,{options:r,fallback:Q("sandbox.listThreadsFailed")}));if(!Array.isArray(l==null?void 0:l.threads))throw new Error(Q("sandbox.invalidThreadList"));return{threads:l.threads.flatMap(c=>{const u=z2e(c);return u?[u]:[]}),...typeof l.nextCursor=="string"?{nextCursor:l.nextCursor}:{}}},async newThread(n,i={}){return cy(await su(e,n,"threads/new",{method:"POST",options:i,fallback:Q("sandbox.createThreadFailed")}))},async readThread(n,i,r={}){if(!i)throw new Error(Q("sandbox.missingThread"));return cy(await su(e,n,`threads/${encodeURIComponent(i)}`,{options:r,fallback:Q("sandbox.readThreadFailed")}))},async resumeThread(n,i,r={}){return cy(await su(e,n,"threads/resume",{method:"POST",body:{threadId:i},options:r,fallback:Q("sandbox.resumeThreadFailed")}))},async forkThread(n,i={}){return cy(await su(e,n,"threads/fork",{method:"POST",options:i,fallback:Q("sandbox.forkThreadFailed")}))},async archiveThread(n,i,r={}){const s=Oa(await su(e,n,"threads/archive",{method:"POST",body:{threadId:i},options:r,fallback:Q("sandbox.archiveThreadFailed")}));if((s==null?void 0:s.archived)!==!0)throw new Error(Q("sandbox.invalidArchiveResult"));return{archived:!0,...s.thread?{snapshot:cy(s)}:{}}},async deleteThread(n,i,r={}){const s=Oa(await su(e,n,"threads/delete",{method:"POST",body:{threadId:i},options:r,fallback:Q("sandbox.deleteThreadFailed")}));if((s==null?void 0:s.deleted)!==!0)throw new Error(Q("sandbox.invalidDeleteResult"));return{deleted:!0,...s.thread?{snapshot:cy(s)}:{}}},async compactThread(n,i={}){await su(e,n,"threads/compact",{method:"POST",options:i,fallback:Q("sandbox.compactThreadFailed")})},async getSettings(n,i={}){const r=await yn(`${e}/${encodeURIComponent(n)}/settings`,{method:"GET",headers:ys(),signal:i.signal},hp);if(!r.ok)throw await Bs(r,Q("sandbox.getSettingsFailed"));return cJ(await r.json())},async updatePermissions(n,i,r={}){const s=await yn(`${e}/${encodeURIComponent(n)}/permissions`,{method:"PUT",headers:ys({"Content-Type":"application/json"}),body:JSON.stringify(i),signal:r.signal},hp);if(!s.ok)throw await Bs(s,Q("sandbox.updatePermissionsFailed"));const o=await s.json();return DD(o.permissions)},async updateWorkspace(n,i,r={}){const s=await yn(`${e}/${encodeURIComponent(n)}/workspace`,{method:"PUT",headers:ys({"Content-Type":"application/json"}),body:JSON.stringify({cwd:i}),signal:r.signal},hp);if(!s.ok)throw await Bs(s,Q("sandbox.updateWorkspaceFailed"));const o=await s.json();if(typeof o.cwd!="string"||!o.cwd)throw new Error(Q("sandbox.invalidWorkingDirectory"));return o.cwd},async listDirectories(n,i,r={}){const s=new URLSearchParams({path:i}),o=await yn(`${e}/${encodeURIComponent(n)}/directories?${s}`,{method:"GET",headers:ys(),signal:r.signal},hp);if(!o.ok)throw await Bs(o,Q("sandbox.listDirectoriesFailed"));const l=await o.json();if(typeof l.path!="string"||!Array.isArray(l.directories)||l.directories.some(c=>!c||typeof c.name!="string"||typeof c.path!="string"))throw new Error(Q("sandbox.invalidDirectoryList"));return{path:l.path,...typeof l.parent=="string"?{parent:l.parent}:{},directories:l.directories}},async resolveApproval(n,i,r,s={}){const o=await yn(`${e}/${encodeURIComponent(n)}/approvals/${encodeURIComponent(i)}`,{method:"POST",headers:ys({"Content-Type":"application/json"}),body:JSON.stringify({decision:r}),signal:s.signal},hp);if(!o.ok)throw await Bs(o,Q("sandbox.resolveApprovalFailed"))},async launchTerminal(n,i={}){return uJ(e,n,"terminal",i)},async launchBrowser(n,i={}){return uJ(e,n,"browser",i)},async uploadFile(n,i,r={}){const s=new FormData;s.set("file",i,i.name);const o=await yn(`${e}/${encodeURIComponent(n)}/files`,{method:"POST",headers:ys(),body:s,signal:r.signal},qtt);if(!o.ok)throw await Bs(o,Q("sandbox.uploadFileFailed"));const l=await o.json();if(typeof l.id!="string"||typeof l.path!="string"||typeof l.name!="string"||typeof l.mimeType!="string"||typeof l.sizeBytes!="number")throw new Error(Q("sandbox.invalidUploadResult"));return l},async closeSession(n,i={}){if(!n)return;const r=await yn(`${e}/${encodeURIComponent(n)}/disconnect`,{method:"POST",headers:ys(),signal:i.signal},uO);if(!r.ok&&r.status!==404)throw await Bs(r,Q("sandbox.disconnectCodexFailed"))},async deleteSession(n,i={}){if(!n)return;const r=await yn(`${e}/${encodeURIComponent(n)}`,{method:"DELETE",headers:ys(),signal:i.signal},uO);if(!r.ok&&r.status!==404)throw await Bs(r,Q("sandbox.deleteCodexFailed"))}}}const Hr=H2e(ztt),P0=H2e("/web/intelligent-development/sessions",{textOnly:!0,messageTimeoutMs:36e5,interruptTimeoutMs:45e3,intelligentDevelopment:!0});async function uJ(e,t,n,i){const r=await yn(`${e}/${encodeURIComponent(t)}/${n}`,{method:"POST",headers:ys(),signal:i.signal},hp);if(!r.ok)throw await Bs(r,Q(n==="terminal"?"sandbox.openSandboxTerminalFailed":"sandbox.openSandboxBrowserFailed"));const s=await r.json();return{url:q2e(s.url,Q("sandbox.toolLabel")),...typeof s.shellSessionId=="string"?{shellSessionId:s.shellSessionId}:{}}}function q2e(e,t){if(typeof e!="string")throw new Error(Q("sandbox.invalidToolUrl",{label:t}));if(e.startsWith("/"))return Na(e);let n;try{n=new URL(e)}catch{throw new Error(Q("sandbox.invalidToolUrl",{label:t}))}const i=n.protocol==="http:"&&window.location.protocol==="http:";if(n.protocol!=="https:"&&!i)throw new Error(Q("sandbox.unsafeToolUrl",{label:t}));return n.toString()}const yu=e=>["succeeded","cancelled","failed"].includes(e.state),W2e="/web/intelligent-development";class Yw extends Error{constructor(t,n){super(t),this.status=n}}async function Vb(e,t="GET",n,i){const r=await yn(`${W2e}${e}`,{method:t,signal:i,headers:ys(n===void 0?void 0:{"Content-Type":"application/json"}),...n===void 0?{}:{body:JSON.stringify(n)}},3e4);if(!r.ok){const s=await r.json().catch(()=>null),o=s==null?void 0:s.detail;throw new Yw(typeof o=="string"?o:(o==null?void 0:o.message)||Q("developmentRuns.requestFailed"),r.status)}return r.json()}function D0(e){const t=e;if(!t||typeof t.runId!="string"||typeof t.sessionId!="string"||!["queued","running","recovering","waiting_user","stopping","succeeded","cancelled","failed"].includes(t.state))throw new Error(Q("developmentRuns.invalidResponse"));return t}const Yd={async active(e){const t=await Vb("/runs","GET",void 0,e);if(!Array.isArray(t.runs))throw new Error(Q("developmentRuns.invalidResponse"));return t.runs.map(D0)},async get(e,t){return D0(await Vb(`/runs/${encodeURIComponent(e)}`,"GET",void 0,t))},async list(e,t){const n=await Vb(`/sessions/${encodeURIComponent(e)}/runs`,"GET",void 0,t);if(!Array.isArray(n.runs))throw new Error(Q("developmentRuns.invalidResponse"));return n.runs.map(D0)},async create(e,t,n){return D0(await Vb(`/sessions/${encodeURIComponent(e)}/runs`,"POST",{message:t,requestId:n}))},async steer(e,t,n){await Vb(`/runs/${encodeURIComponent(e)}/inputs`,"POST",{message:t,clientId:n})},async stop(e){return D0(await Vb(`/runs/${encodeURIComponent(e)}/stop`,"POST"))},async resume(e){return D0(await Vb(`/runs/${encodeURIComponent(e)}/resume`,"POST"))}};class ent{constructor(t){Zt(this,"cursor",0);Zt(this,"turns",[]);Zt(this,"activeInput");Zt(this,"itemTurns",new Map);Zt(this,"nativeInputs",new Map);Zt(this,"metrics",new Map);Zt(this,"inputOrder",[]);Zt(this,"projections",new Map);Zt(this,"itemInputs",new Map);this.run=t,this.activeInput=t.requestId}projection(t){let n=this.projections.get(t);if(!n){const i={role:"assistant",blocks:[],meta:{localId:`${t}:assistant`}},r=this.turns.findIndex(s=>{var o;return((o=s.meta)==null?void 0:o.localId)===`${t}:user`});this.turns.splice(r<0?this.turns.length:r+1,0,i),n=V2e({onBlocks:s=>{i.blocks=s.map(o=>({...o,turnId:this.itemTurns.get(o.id||"")}))},onUsage:s=>{i.meta={...i.meta,sandboxUsage:s.usage}}}),this.projections.set(t,n)}return n}apply(t){if(t.payload.runId!==this.run.runId)throw new Error(Q("developmentRuns.invalidResponse"));if(t.seq<=this.cursor)return;if(t.seq!==this.cursor+1)throw new Error(Q("developmentRuns.eventGap"));for(const i of this.turns)i.blocks.some(r=>r.kind==="turn-summary")&&(i.blocks=i.blocks.filter(r=>r.kind!=="turn-summary"));const n=t.payload;if(t.type==="run.input"&&typeof n.clientId=="string"&&typeof n.message=="string")this.turns.push({role:"user",blocks:[{kind:"text",text:n.message}],meta:{localId:`${n.clientId}:user`},activity:{id:`${n.clientId}:delivery`,title:Q(`developmentRuns.input.${String(n.status)}`)}}),this.inputOrder.push(n.clientId),this.projection(n.clientId),n.status==="delivered"&&this.inputOrder.indexOf(n.clientId)>=this.inputOrder.indexOf(this.activeInput)&&(this.activeInput=n.clientId);else if(t.type==="run.input_status"&&typeof n.clientId=="string"){const i=this.turns.find(r=>{var s;return((s=r.meta)==null?void 0:s.localId)===`${n.clientId}:user`});i&&(i.activity={id:`${n.clientId}:delivery`,title:Q(`developmentRuns.input.${String(n.status)}`)}),n.status==="delivered"&&this.inputOrder.indexOf(n.clientId)>=this.inputOrder.indexOf(this.activeInput)&&(this.activeInput=n.clientId)}else if(t.type==="run.turn"&&typeof n.turnId=="string"){const r={...this.metrics.get(n.turnId),turnId:n.turnId,status:String(n.status||"inProgress"),toolCalls:0,toolDurationComplete:!1};for(const s of["startedAt","completedAt","durationMs"])typeof n[s]=="number"&&Number.isFinite(n[s])&&n[s]>=0&&(r[s]=n[s]);if(typeof n.model=="string"&&(r.model=n.model),n.usage&&typeof n.usage=="object"&&!Array.isArray(n.usage)){const s={};for(const o of["totalTokens","inputTokens","outputTokens","cachedInputTokens","cacheWriteInputTokens","reasoningOutputTokens"]){const l=n.usage[o];typeof l=="number"&&Number.isSafeInteger(l)&&l>=0&&(s[o]=l)}r.usage=s}n.usageIncomplete===!0&&(r.usageIncomplete=!0),this.metrics.set(n.turnId,r),this.nativeInputs.set(n.turnId,this.activeInput),this.projection(this.activeInput)}else if(t.type==="run.status"){if(this.run={...this.run,...n},yu(this.run))for(const[i,r]of this.metrics)r.status==="inProgress"&&this.metrics.set(i,{...r,status:"unavailable",usageIncomplete:!0});if(yu(this.run)||this.run.state==="waiting_user")for(const i of this.projections.values())i.consumeFrame(`event: done data: {}`)}else if(!t.type.startsWith("run.")){const i=typeof n.id=="string"&&n.id?n.id:["plan","diff"].includes(t.type)?t.type:"",r=i?`${String(n.turnId||"")}:${i}`:"",s=r&&this.itemInputs.get(r)||this.activeInput;r&&(this.itemInputs.set(r,s),typeof n.turnId=="string"&&this.itemTurns.set(r,n.turnId)),typeof n.turnId=="string"&&this.nativeInputs.set(n.turnId,this.activeInput);const o=t.type==="activity"&&n.kind==="commentary";this.projection(s).consumeFrame(`event: ${o?"delta":t.type} -data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type==="run.input"||t.type==="run.input_status")&&n.status==="delivered"&&typeof n.turnId=="string"&&typeof n.clientId=="string"&&this.nativeInputs.set(n.turnId,n.clientId),this.decorate(),this.cursor=t.seq}decorate(){const t=!yu(this.run)&&this.run.state!=="waiting_user",n=[...this.turns].reverse().find(i=>i.role==="assistant");for(const i of this.turns)i.role==="assistant"&&(i.meta={...i.meta,streaming:t&&i===n});for(const i of this.metrics.values()){if(!["completed","failed","interrupted","cancelled","unavailable"].includes(i.status))continue;const r=new Map;for(const u of this.turns)for(const d of u.blocks)d.kind==="tool"&&d.turnId===i.turnId&&d.id&&r.set(d.id,d);const s=[...r.values()].filter(u=>typeof u.durationMs=="number"&&Number.isFinite(u.durationMs)&&u.durationMs>=0),o={...i,toolCalls:r.size,toolDurationComplete:s.length===r.size,toolDurationMs:s.length||!r.size?s.reduce((u,d)=>u+d.durationMs,0):void 0},l=this.nativeInputs.get(i.turnId),c=this.turns.find(u=>{var d;return((d=u.meta)==null?void 0:d.localId)===`${l}:assistant`});if(c){const u=c.blocks.reduce((d,f,h)=>f.turnId===i.turnId?h:d,-1);c.blocks.splice(u<0?c.blocks.length:u+1,0,{kind:"turn-summary",id:`${i.turnId}:summary`,turnId:i.turnId,value:o})}}}}function ent(e,t){return new Promise((n,i)=>{if(t.aborted){i(new DOMException("Aborted","AbortError"));return}const r=()=>{clearTimeout(s),i(new DOMException("Aborted","AbortError"))},s=setTimeout(()=>{t.removeEventListener("abort",r),n()},e);t.addEventListener("abort",r,{once:!0})})}async function tnt(e,t,n){var c;const i=await yn(`${q2e}/runs/${encodeURIComponent(e.run.runId)}/events?after=${e.cursor}`,{signal:t,headers:ys({Accept:"text/event-stream"})},0);if(!i.ok)throw new Yw(Q("developmentRuns.requestFailed"),i.status);if(!i.body)throw new Error(Q("developmentRuns.invalidResponse"));const r=i.body.getReader(),s=new TextDecoder;let o="",l=!1;try{for(;;){const{value:u,done:d}=await r.read();o+=s.decode(u,{stream:!d});const f=o.split(/\r?\n\r?\n/);o=f.pop()||"";for(const h of f){const m=h.split(/\r?\n/),g=(c=m.find(y=>y.startsWith("event:")))==null?void 0:c.slice(6).trim();if(g==="done"){l=!0;continue}const b=m.filter(y=>y.startsWith("data:")).map(y=>y.slice(5).trimStart()).join(` -`);if(!g||!b)continue;const v=JSON.parse(b);if(!Number.isSafeInteger(v.seq))throw new Error(Q("developmentRuns.invalidResponse"));e.apply({seq:v.seq,type:g,payload:v})}if(n(),d)break}if(!l)throw new Error(Q("developmentRuns.reconnecting"))}finally{await r.cancel().catch(()=>{}),r.releaseLock()}}async function nnt(e,t,n,i,r){const s=new Map;let o=0;const l=new Map;let c;r==null||r(h=>{t.aborted||h.sessionId!==e||(l.set(h.runId,h),c==null||c())});const u=h=>new Promise(m=>{const g=()=>{clearTimeout(b),t.removeEventListener("abort",g),c=void 0,m()},b=setTimeout(g,h);c=g,t.addEventListener("abort",g,{once:!0}),(t.aborted||l.size)&&g()}),d=new Map,f=()=>{var m;if(t.aborted)return;const h=[...s.values()];n(h.flatMap(g=>{let b=d.get(g);return(!b||b.cursor!==g.cursor)&&(b={cursor:g.cursor,turns:g.turns.map(v=>({...v}))},d.set(g,b)),b.turns}),((m=h[h.length-1])==null?void 0:m.run)||null)};for(;!t.aborted;)try{const h=l.size?[]:await Yd.list(e,t),m=[...new Map([...h,...l.values()].map(g=>[g.runId,g])).values()];l.clear();for(const g of m){let b=s.get(g.runId);if(b||(b=new Jtt(g),s.set(g.runId,b)),b.cursor>=g.lastSeq&&(b.run=g),b.cursor{o=0,i(""),f()})}catch(v){if(!(v instanceof Yw&&v.status===404&&yu(g)))throw v}}o=0,i(""),f(),await u(1500)}catch(h){if(t.aborted)return;if(h instanceof Yw&&[401,403,404].includes(h.status))throw h;i(Q("developmentRuns.reconnecting")),await ent(Math.min(1e3*2**o++,15e3),t)}}function int({sessionId:e,ownerId:t,onTurns:n,onBusy:i}){const[r,s]=p.useState(null),[o,l]=p.useState(""),[c,u]=p.useState(""),[d,f]=p.useState(!1),[h,m]=p.useState(!1),g=p.useRef({onTurns:n,onBusy:i});g.current={onTurns:n,onBusy:i};const b=p.useRef(0),v=p.useRef([]),y=p.useRef([]),w=p.useRef(null),x=()=>{const C=new Set(v.current.map(N=>{var P;return(P=N.meta)==null?void 0:P.localId}));y.current=y.current.filter(N=>{var P;return!C.has((P=N.meta)==null?void 0:P.localId)}),g.current.onTurns([...v.current,...y.current])},k=p.useRef(!1),S=p.useRef(!1),O=p.useRef(null),A=p.useRef({sessionId:e,ownerId:t});A.current={sessionId:e,ownerId:t},p.useEffect(()=>{b.current+=1,s(null),u(""),l(""),v.current=[],w.current=null;const C=O.current;if(((C==null?void 0:C.session)!==e||C.owner!==t)&&(y.current=[],m(!1),S.current=!1,O.current=null,k.current=!1,f(!1)),e&&x(),!e||!t)return;const N=new AbortController,P=()=>!N.signal.aborted&&A.current.sessionId===e&&A.current.ownerId===t;return nnt(e,N.signal,(I,D)=>{P()&&(v.current=I,x(),s(D),g.current.onBusy(k.current||!!(D&&!yu(D))),D&&yu(D)&&(m(!1),S.current=!1))},I=>{P()&&l(I)},I=>{P()&&(w.current=I)}).catch(I=>{P()&&u(I instanceof Error?I.message:String(I))}),()=>N.abort()},[e,t]);function E(C,N=e){const P=A.current.ownerId;let I=O.current;return(!I||I.session!==N||I.owner!==P||I.text!==C)&&(I={session:N,owner:P,text:C,id:crypto.randomUUID()},O.current=I),y.current.some(D=>{var _;return((_=D.meta)==null?void 0:_.localId)===`${I.id}:user`})||y.current.push({role:"user",blocks:[{kind:"text",text:C}],meta:{localId:`${I.id}:user`}},{role:"assistant",blocks:[{kind:"progress",text:Q(r&&!yu(r)?"developmentRuns.processing":"developmentRuns.preparing")}],meta:{localId:`${I.id}:assistant`}}),[...y.current]}async function j(C,N=e){var L;if(!C.trim()||k.current||S.current)return!1;k.current=!0,f(!0),u("");const P=A.current.ownerId,I=()=>A.current.ownerId===P&&A.current.sessionId===N;E(C,N),x(),g.current.onBusy(!0);const D=O.current,_=(D==null?void 0:D.session)===N&&D.owner===P&&D.text===C?D:{session:N,owner:P,text:C,id:crypto.randomUUID(),runId:void 0,stopRequested:!1};O.current=_;try{const F=await Yd.list(N),M=F[F.length-1];if(!I())return!1;!_.runId&&M&&!yu(M)&&M.requestId!==_.id&&(_.runId=M.runId);let H;return _.runId?(await Yd.steer(_.runId,C,_.id),H=await Yd.get(_.runId)):H=await Yd.create(N,C,_.id),(_.stopRequested||I()&&S.current)&&(H=await Yd.stop(H.runId)),I()&&(s(H),(L=w.current)==null||L.call(w,H),g.current.onBusy(!yu(H)),O.current=null),!0}catch(F){return I()&&(g.current.onBusy(!!(r&&!yu(r))),u(F instanceof Error?F.message:String(F)),_.stopRequested&&(S.current=!1,m(!1))),!1}finally{I()&&(k.current=!1,f(!1))}}async function T(){S.current=!0,m(!0),u(""),O.current&&(O.current.stopRequested=!0);const C=b.current;try{const P=(await Yd.list(e)).find(I=>!yu(I));if(P){const I=await Yd.stop(P.runId);C===b.current&&s(I)}else!k.current&&C===b.current&&(S.current=!1,m(!1))}catch(N){C===b.current&&(u(N instanceof Error?N.message:String(N)),m(!1),S.current=!1)}}async function R(){if(!r)return;const C=b.current;try{const N=await Yd.resume(r.runId);C===b.current&&(s(N),u(""))}catch(N){C===b.current&&u(N instanceof Error?N.message:String(N))}}return{run:r,connection:o,error:c,submitting:d,stopPending:h,prepare:E,submit:j,stop:T,resume:R}}function dJ(e){return e?["stopping","waiting_user","failed","cancelled"].includes(e.state)?e.statusMessage:e.phase==="reporting"?Q("developmentRuns.reporting"):e.state==="recovering"?e.statusMessage:["outcome_read","delivery"].includes(e.phase)?Q("developmentRuns.packaging"):e.phase==="version"?Q("developmentRuns.savingVersion"):e.phase==="cycle_complete"?Q("developmentRuns.finishing"):e.statusMessage:""}function W2e(e){if(e==null||!Number.isFinite(e)||e<0)return Q("developmentRuns.notReported");const t=Math.round(e);if(t===0)return`<${Q("developmentRuns.durationUnits.milliseconds",{value:"1"})}`;if(t<1e3)return Q("developmentRuns.durationUnits.milliseconds",{value:t.toLocaleString(j8())});const n=Math.round(t/100);return[["hours",Math.floor(n/36e3)],["minutes",Math.floor(n%36e3/600)],["seconds",n%600/10]].filter(([,r])=>r>0).map(([r,s])=>Q(`developmentRuns.durationUnits.${r}`,{value:s.toLocaleString(j8(),{maximumFractionDigits:1})})).join(" ")}const C3=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},fJ=e=>typeof e=="string"?e.replace(/\s+/g," ").trim().slice(0,160):"";function K2e(e){var n;const t=C3(e.args);if(e.itemType==="dynamicToolCall"&&e.name==="submit_build_result")return Q("developmentRuns.submitResult");if(e.itemType==="commandExecution"){const i=Array.isArray(t.commandActions)?t.commandActions.map(C3):[],r=new Set(i.map(c=>c.type));if(i.length&&r.size===1){if(r.has("read"))return Q("developmentRuns.read",{target:"Read project files"});if(r.has("listFiles"))return Q("developmentRuns.listFiles",{target:"List directory"});if(r.has("search"))return Q("developmentRuns.search",{target:"Search project files"})}const s=typeof t.command=="string"?t.command:"",l=(n=[[/\b(?:pytest|vitest|jest)\b|\b(?:npm|pnpm|yarn) (?:run )?test\b/,"Run tests"],[/\b(?:npm|pnpm|yarn) (?:ci|install|add)\b|\b(?:pip|pip3|uv pip) install\b|\buv sync\b/,"Install dependencies"],[/\b(?:ruff|eslint|prettier|pyright|tsc)\b/,"Check code quality"],[/\b(?:npm|pnpm|yarn) (?:run )?build\b|\bpython[^;]* -m build\b/,"Build project"],[/\bgit (?:status|diff|log|show)\b/,"Inspect Git changes"],[/\bgit (?:add|commit)\b/,"Save Git changes"],[/\b(?:curl|wget)\b/,"Send HTTP request"],[/\bcompileall\b/,"Check Python syntax"]].find(([c])=>c.test(s)))==null?void 0:n[1];return l?Q("developmentRuns.command",{target:l}):e.name}if(e.itemType==="fileChange"){const i=Array.isArray(t.changes)?t.changes.map(r=>fJ(C3(r).path)).filter(Boolean):[];return Q("developmentRuns.editFiles",{target:i.join(", ")})}return e.itemType==="webSearch"?Q("developmentRuns.webSearch",{target:fJ(t.query)}):e.name}const rnt=e=>["tool","thinking","plan","diff"].includes(e.kind);function snt(e){const t=[];return e.forEach((n,i)=>{if(n.kind==="progress")return;const r=rnt(n),s=t[t.length-1];r&&(s!=null&&s.process)?s.blocks.push(n):t.push({id:n.id||`${n.kind}:${i}`,process:r,blocks:[n]})}),t}const hJ="M 15 15 C 15 5, 25 5, 30 15 C 35 25, 45 25, 45 15 C 45 5, 35 5, 30 15 C 25 25, 15 25, 15 15";function av({variant:e="infinity",size:t=e==="ring"?20:32,label:n="加载中",decorative:i=!1,className:r="",style:s}){const o=kD(),l=typeof t=="number"?t/2:`calc(${t} / 2)`,c=typeof t=="number"?t*3/40:`calc(${t} * 3 / 40)`;return a.jsxs("span",{className:`studio-loading studio-loading--${e} ${r}`.trim(),style:s,role:i?void 0:"status","aria-live":i?void 0:"polite","aria-hidden":i||void 0,children:[e==="infinity"?a.jsxs("svg",{className:"studio-loading__infinity",width:typeof t=="number"?t:void 0,height:typeof l=="number"?l:void 0,style:typeof t=="string"?{width:t,height:l}:void 0,viewBox:"0 0 60 30",fill:"none","aria-hidden":"true",children:[a.jsx("path",{className:"studio-loading__track",d:hJ,strokeWidth:"4",strokeLinecap:"round"}),a.jsx(_r.path,{className:"studio-loading__path",d:hJ,strokeWidth:"4",strokeLinecap:"round",strokeDasharray:o?void 0:"100",initial:{strokeDashoffset:100},animate:{strokeDashoffset:o?0:[100,-100]},transition:{duration:o?0:2,repeat:o?0:1/0,ease:"linear"}})]}):a.jsx(_r.div,{className:"studio-loading__ring",style:{width:t,height:t,borderWidth:c},"aria-hidden":"true",animate:{rotate:o?0:360},transition:{duration:o?0:1,repeat:o?0:1/0,ease:"linear"}}),!i&&a.jsx("span",{className:"studio-loading__label",children:n})]})}function ki({className:e="",type:t="button",variant:n="primary",size:i="default",startIcon:r,endIcon:s,iconOnly:o=!1,hoverEffect:l="background",loading:c=!1,disabled:u,children:d,...f}){return a.jsxs("button",{...f,type:t,disabled:u||c,"aria-busy":c||f["aria-busy"],"data-hover-effect":o?l:void 0,className:`studio-button studio-button--${n} studio-button--size-${i}${o?" studio-button--icon-only":""}${c?" studio-button--loading":""} ${e}`.trim(),children:[r&&a.jsx("span",{className:"studio-button__icon","aria-hidden":"true",children:r}),!o&&a.jsx("span",{className:"studio-button__label",children:d}),!o&&s&&a.jsx("span",{className:"studio-button__icon studio-button__end-icon","aria-hidden":"true",children:s}),c&&a.jsx("span",{className:"studio-button__loading","aria-hidden":"true",children:a.jsx(av,{variant:"ring",size:"var(--studio-button-icon-size)",decorative:!0})})]})}function ant({variant:e,...t}){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:e==="warning"?a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"m10.3 4.5-7.6 13a2 2 0 0 0 1.7 3h15.2a2 2 0 0 0 1.7-3l-7.6-13a2 2 0 0 0-3.4 0Z"}),a.jsx("path",{d:"M12 9v4m0 3.5h.01"})]}):a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"12",cy:"12",r:"8.5"}),e==="success"?a.jsx("path",{d:"m8 12 2.7 2.7L16 9.4"}):e==="error"?a.jsx("path",{d:"m9.2 9.2 5.6 5.6m0-5.6-5.6 5.6"}):a.jsx("path",{d:"M12 11v5m0-8h.01"})]})})}function ont(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m7 7 10 10M17 7 7 17"})})}function lnt({variant:e="info",title:t,description:n,action:i,onDismiss:r,closeLabel:s="关闭通知",className:o="",role:l="status",...c}){return a.jsxs("div",{...c,role:l,className:`studio-toast ${o}`.trim(),"data-variant":e,children:[a.jsx(ant,{variant:e,className:"studio-toast__status"}),a.jsxs("div",{className:"studio-toast__content",children:[t!=null&&a.jsx("div",{className:"studio-toast__title",children:t}),n!=null&&a.jsx("div",{className:"studio-toast__description",children:n}),i!=null&&a.jsx("div",{className:"studio-toast__action",children:i})]}),r&&a.jsx(ki,{variant:"ghost",iconOnly:!0,startIcon:a.jsx(ont,{}),"aria-label":s,onClick:r,className:"studio-toast__close"})]})}function Uz(){}const cnt=Object.freeze([]),Jl=Object.freeze({});function MD(e){p.useEffect(e,cnt)}const pJ={};function Td(e,t){const n=p.useRef(pJ);return n.current===pJ&&(n.current=e(t)),n}const unt=()=>{},ti=typeof document<"u"?p.useLayoutEffect:unt;function dnt(e,t){return function(i,...r){const s=new URL(e);return s.searchParams.set("code",i.toString()),r.forEach(o=>s.searchParams.append("args[]",o)),`${t} error #${i}; visit ${s} for the full message.`}}const Uc=dnt("https://base-ui.com/production-error","Base UI"),G2e=p.createContext(void 0);function Qz(){const e=p.useContext(G2e);if(!e)throw new Error(Uc(73));return e}var X2e={exports:{}},Y2e={};/** +data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type==="run.input"||t.type==="run.input_status")&&n.status==="delivered"&&typeof n.turnId=="string"&&typeof n.clientId=="string"&&this.nativeInputs.set(n.turnId,n.clientId),this.decorate(),this.cursor=t.seq}decorate(){const t=!yu(this.run)&&this.run.state!=="waiting_user",n=[...this.turns].reverse().find(i=>i.role==="assistant");for(const i of this.turns)i.role==="assistant"&&(i.meta={...i.meta,streaming:t&&i===n});for(const i of this.metrics.values()){if(!["completed","failed","interrupted","cancelled","unavailable"].includes(i.status))continue;const r=new Map;for(const u of this.turns)for(const d of u.blocks)d.kind==="tool"&&d.turnId===i.turnId&&d.id&&r.set(d.id,d);const s=[...r.values()].filter(u=>typeof u.durationMs=="number"&&Number.isFinite(u.durationMs)&&u.durationMs>=0),o={...i,toolCalls:r.size,toolDurationComplete:s.length===r.size,toolDurationMs:s.length||!r.size?s.reduce((u,d)=>u+d.durationMs,0):void 0},l=this.nativeInputs.get(i.turnId),c=this.turns.find(u=>{var d;return((d=u.meta)==null?void 0:d.localId)===`${l}:assistant`});if(c){const u=c.blocks.reduce((d,f,h)=>f.turnId===i.turnId?h:d,-1);c.blocks.splice(u<0?c.blocks.length:u+1,0,{kind:"turn-summary",id:`${i.turnId}:summary`,turnId:i.turnId,value:o})}}}}function tnt(e,t){return new Promise((n,i)=>{if(t.aborted){i(new DOMException("Aborted","AbortError"));return}const r=()=>{clearTimeout(s),i(new DOMException("Aborted","AbortError"))},s=setTimeout(()=>{t.removeEventListener("abort",r),n()},e);t.addEventListener("abort",r,{once:!0})})}async function nnt(e,t,n){var c;const i=await yn(`${W2e}/runs/${encodeURIComponent(e.run.runId)}/events?after=${e.cursor}`,{signal:t,headers:ys({Accept:"text/event-stream"})},0);if(!i.ok)throw new Yw(Q("developmentRuns.requestFailed"),i.status);if(!i.body)throw new Error(Q("developmentRuns.invalidResponse"));const r=i.body.getReader(),s=new TextDecoder;let o="",l=!1;try{for(;;){const{value:u,done:d}=await r.read();o+=s.decode(u,{stream:!d});const f=o.split(/\r?\n\r?\n/);o=f.pop()||"";for(const h of f){const m=h.split(/\r?\n/),g=(c=m.find(y=>y.startsWith("event:")))==null?void 0:c.slice(6).trim();if(g==="done"){l=!0;continue}const b=m.filter(y=>y.startsWith("data:")).map(y=>y.slice(5).trimStart()).join(` +`);if(!g||!b)continue;const v=JSON.parse(b);if(!Number.isSafeInteger(v.seq))throw new Error(Q("developmentRuns.invalidResponse"));e.apply({seq:v.seq,type:g,payload:v})}if(n(),d)break}if(!l)throw new Error(Q("developmentRuns.reconnecting"))}finally{await r.cancel().catch(()=>{}),r.releaseLock()}}async function int(e,t,n,i,r){const s=new Map;let o=0;const l=new Map;let c;r==null||r(h=>{t.aborted||h.sessionId!==e||(l.set(h.runId,h),c==null||c())});const u=h=>new Promise(m=>{const g=()=>{clearTimeout(b),t.removeEventListener("abort",g),c=void 0,m()},b=setTimeout(g,h);c=g,t.addEventListener("abort",g,{once:!0}),(t.aborted||l.size)&&g()}),d=new Map,f=()=>{var m;if(t.aborted)return;const h=[...s.values()];n(h.flatMap(g=>{let b=d.get(g);return(!b||b.cursor!==g.cursor)&&(b={cursor:g.cursor,turns:g.turns.map(v=>({...v}))},d.set(g,b)),b.turns}),((m=h[h.length-1])==null?void 0:m.run)||null)};for(;!t.aborted;)try{const h=l.size?[]:await Yd.list(e,t),m=[...new Map([...h,...l.values()].map(g=>[g.runId,g])).values()];l.clear();for(const g of m){let b=s.get(g.runId);if(b||(b=new ent(g),s.set(g.runId,b)),b.cursor>=g.lastSeq&&(b.run=g),b.cursor{o=0,i(""),f()})}catch(v){if(!(v instanceof Yw&&v.status===404&&yu(g)))throw v}}o=0,i(""),f(),await u(1500)}catch(h){if(t.aborted)return;if(h instanceof Yw&&[401,403,404].includes(h.status))throw h;i(Q("developmentRuns.reconnecting")),await tnt(Math.min(1e3*2**o++,15e3),t)}}function rnt({sessionId:e,ownerId:t,onTurns:n,onBusy:i}){const[r,s]=p.useState(null),[o,l]=p.useState(""),[c,u]=p.useState(""),[d,f]=p.useState(!1),[h,m]=p.useState(!1),g=p.useRef({onTurns:n,onBusy:i});g.current={onTurns:n,onBusy:i};const b=p.useRef(0),v=p.useRef([]),y=p.useRef([]),w=p.useRef(null),x=()=>{const C=new Set(v.current.map(N=>{var P;return(P=N.meta)==null?void 0:P.localId}));y.current=y.current.filter(N=>{var P;return!C.has((P=N.meta)==null?void 0:P.localId)}),g.current.onTurns([...v.current,...y.current])},k=p.useRef(!1),S=p.useRef(!1),O=p.useRef(null),A=p.useRef({sessionId:e,ownerId:t});A.current={sessionId:e,ownerId:t},p.useEffect(()=>{b.current+=1,s(null),u(""),l(""),v.current=[],w.current=null;const C=O.current;if(((C==null?void 0:C.session)!==e||C.owner!==t)&&(y.current=[],m(!1),S.current=!1,O.current=null,k.current=!1,f(!1)),e&&x(),!e||!t)return;const N=new AbortController,P=()=>!N.signal.aborted&&A.current.sessionId===e&&A.current.ownerId===t;return int(e,N.signal,(I,D)=>{P()&&(v.current=I,x(),s(D),g.current.onBusy(k.current||!!(D&&!yu(D))),D&&yu(D)&&(m(!1),S.current=!1))},I=>{P()&&l(I)},I=>{P()&&(w.current=I)}).catch(I=>{P()&&u(I instanceof Error?I.message:String(I))}),()=>N.abort()},[e,t]);function E(C,N=e){const P=A.current.ownerId;let I=O.current;return(!I||I.session!==N||I.owner!==P||I.text!==C)&&(I={session:N,owner:P,text:C,id:crypto.randomUUID()},O.current=I),y.current.some(D=>{var _;return((_=D.meta)==null?void 0:_.localId)===`${I.id}:user`})||y.current.push({role:"user",blocks:[{kind:"text",text:C}],meta:{localId:`${I.id}:user`}},{role:"assistant",blocks:[{kind:"progress",text:Q(r&&!yu(r)?"developmentRuns.processing":"developmentRuns.preparing")}],meta:{localId:`${I.id}:assistant`}}),[...y.current]}async function j(C,N=e){var L;if(!C.trim()||k.current||S.current)return!1;k.current=!0,f(!0),u("");const P=A.current.ownerId,I=()=>A.current.ownerId===P&&A.current.sessionId===N;E(C,N),x(),g.current.onBusy(!0);const D=O.current,_=(D==null?void 0:D.session)===N&&D.owner===P&&D.text===C?D:{session:N,owner:P,text:C,id:crypto.randomUUID(),runId:void 0,stopRequested:!1};O.current=_;try{const F=await Yd.list(N),M=F[F.length-1];if(!I())return!1;!_.runId&&M&&!yu(M)&&M.requestId!==_.id&&(_.runId=M.runId);let H;return _.runId?(await Yd.steer(_.runId,C,_.id),H=await Yd.get(_.runId)):H=await Yd.create(N,C,_.id),(_.stopRequested||I()&&S.current)&&(H=await Yd.stop(H.runId)),I()&&(s(H),(L=w.current)==null||L.call(w,H),g.current.onBusy(!yu(H)),O.current=null),!0}catch(F){return I()&&(g.current.onBusy(!!(r&&!yu(r))),u(F instanceof Error?F.message:String(F)),_.stopRequested&&(S.current=!1,m(!1))),!1}finally{I()&&(k.current=!1,f(!1))}}async function T(){S.current=!0,m(!0),u(""),O.current&&(O.current.stopRequested=!0);const C=b.current;try{const P=(await Yd.list(e)).find(I=>!yu(I));if(P){const I=await Yd.stop(P.runId);C===b.current&&s(I)}else!k.current&&C===b.current&&(S.current=!1,m(!1))}catch(N){C===b.current&&(u(N instanceof Error?N.message:String(N)),m(!1),S.current=!1)}}async function R(){if(!r)return;const C=b.current;try{const N=await Yd.resume(r.runId);C===b.current&&(s(N),u(""))}catch(N){C===b.current&&u(N instanceof Error?N.message:String(N))}}return{run:r,connection:o,error:c,submitting:d,stopPending:h,prepare:E,submit:j,stop:T,resume:R}}function dJ(e){return e?["stopping","waiting_user","failed","cancelled"].includes(e.state)?e.statusMessage:e.phase==="reporting"?Q("developmentRuns.reporting"):e.state==="recovering"?e.statusMessage:["outcome_read","delivery"].includes(e.phase)?Q("developmentRuns.packaging"):e.phase==="version"?Q("developmentRuns.savingVersion"):e.phase==="cycle_complete"?Q("developmentRuns.finishing"):e.statusMessage:""}function K2e(e){if(e==null||!Number.isFinite(e)||e<0)return Q("developmentRuns.notReported");const t=Math.round(e);if(t===0)return`<${Q("developmentRuns.durationUnits.milliseconds",{value:"1"})}`;if(t<1e3)return Q("developmentRuns.durationUnits.milliseconds",{value:t.toLocaleString(j8())});const n=Math.round(t/100);return[["hours",Math.floor(n/36e3)],["minutes",Math.floor(n%36e3/600)],["seconds",n%600/10]].filter(([,r])=>r>0).map(([r,s])=>Q(`developmentRuns.durationUnits.${r}`,{value:s.toLocaleString(j8(),{maximumFractionDigits:1})})).join(" ")}const C3=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},fJ=e=>typeof e=="string"?e.replace(/\s+/g," ").trim().slice(0,160):"";function G2e(e){var n;const t=C3(e.args);if(e.itemType==="dynamicToolCall"&&e.name==="submit_build_result")return Q("developmentRuns.submitResult");if(e.itemType==="commandExecution"){const i=Array.isArray(t.commandActions)?t.commandActions.map(C3):[],r=new Set(i.map(c=>c.type));if(i.length&&r.size===1){if(r.has("read"))return Q("developmentRuns.read",{target:"Read project files"});if(r.has("listFiles"))return Q("developmentRuns.listFiles",{target:"List directory"});if(r.has("search"))return Q("developmentRuns.search",{target:"Search project files"})}const s=typeof t.command=="string"?t.command:"",l=(n=[[/\b(?:pytest|vitest|jest)\b|\b(?:npm|pnpm|yarn) (?:run )?test\b/,"Run tests"],[/\b(?:npm|pnpm|yarn) (?:ci|install|add)\b|\b(?:pip|pip3|uv pip) install\b|\buv sync\b/,"Install dependencies"],[/\b(?:ruff|eslint|prettier|pyright|tsc)\b/,"Check code quality"],[/\b(?:npm|pnpm|yarn) (?:run )?build\b|\bpython[^;]* -m build\b/,"Build project"],[/\bgit (?:status|diff|log|show)\b/,"Inspect Git changes"],[/\bgit (?:add|commit)\b/,"Save Git changes"],[/\b(?:curl|wget)\b/,"Send HTTP request"],[/\bcompileall\b/,"Check Python syntax"]].find(([c])=>c.test(s)))==null?void 0:n[1];return l?Q("developmentRuns.command",{target:l}):e.name}if(e.itemType==="fileChange"){const i=Array.isArray(t.changes)?t.changes.map(r=>fJ(C3(r).path)).filter(Boolean):[];return Q("developmentRuns.editFiles",{target:i.join(", ")})}return e.itemType==="webSearch"?Q("developmentRuns.webSearch",{target:fJ(t.query)}):e.name}const snt=e=>["tool","thinking","plan","diff"].includes(e.kind);function ant(e){const t=[];return e.forEach((n,i)=>{if(n.kind==="progress")return;const r=snt(n),s=t[t.length-1];r&&(s!=null&&s.process)?s.blocks.push(n):t.push({id:n.id||`${n.kind}:${i}`,process:r,blocks:[n]})}),t}const hJ="M 15 15 C 15 5, 25 5, 30 15 C 35 25, 45 25, 45 15 C 45 5, 35 5, 30 15 C 25 25, 15 25, 15 15";function av({variant:e="infinity",size:t=e==="ring"?20:32,label:n="加载中",decorative:i=!1,className:r="",style:s}){const o=kD(),l=typeof t=="number"?t/2:`calc(${t} / 2)`,c=typeof t=="number"?t*3/40:`calc(${t} * 3 / 40)`;return a.jsxs("span",{className:`studio-loading studio-loading--${e} ${r}`.trim(),style:s,role:i?void 0:"status","aria-live":i?void 0:"polite","aria-hidden":i||void 0,children:[e==="infinity"?a.jsxs("svg",{className:"studio-loading__infinity",width:typeof t=="number"?t:void 0,height:typeof l=="number"?l:void 0,style:typeof t=="string"?{width:t,height:l}:void 0,viewBox:"0 0 60 30",fill:"none","aria-hidden":"true",children:[a.jsx("path",{className:"studio-loading__track",d:hJ,strokeWidth:"4",strokeLinecap:"round"}),a.jsx(_r.path,{className:"studio-loading__path",d:hJ,strokeWidth:"4",strokeLinecap:"round",strokeDasharray:o?void 0:"100",initial:{strokeDashoffset:100},animate:{strokeDashoffset:o?0:[100,-100]},transition:{duration:o?0:2,repeat:o?0:1/0,ease:"linear"}})]}):a.jsx(_r.div,{className:"studio-loading__ring",style:{width:t,height:t,borderWidth:c},"aria-hidden":"true",animate:{rotate:o?0:360},transition:{duration:o?0:1,repeat:o?0:1/0,ease:"linear"}}),!i&&a.jsx("span",{className:"studio-loading__label",children:n})]})}function ki({className:e="",type:t="button",variant:n="primary",size:i="default",startIcon:r,endIcon:s,iconOnly:o=!1,hoverEffect:l="background",loading:c=!1,disabled:u,children:d,...f}){return a.jsxs("button",{...f,type:t,disabled:u||c,"aria-busy":c||f["aria-busy"],"data-hover-effect":o?l:void 0,className:`studio-button studio-button--${n} studio-button--size-${i}${o?" studio-button--icon-only":""}${c?" studio-button--loading":""} ${e}`.trim(),children:[r&&a.jsx("span",{className:"studio-button__icon","aria-hidden":"true",children:r}),!o&&a.jsx("span",{className:"studio-button__label",children:d}),!o&&s&&a.jsx("span",{className:"studio-button__icon studio-button__end-icon","aria-hidden":"true",children:s}),c&&a.jsx("span",{className:"studio-button__loading","aria-hidden":"true",children:a.jsx(av,{variant:"ring",size:"var(--studio-button-icon-size)",decorative:!0})})]})}function ont({variant:e,...t}){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:e==="warning"?a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"m10.3 4.5-7.6 13a2 2 0 0 0 1.7 3h15.2a2 2 0 0 0 1.7-3l-7.6-13a2 2 0 0 0-3.4 0Z"}),a.jsx("path",{d:"M12 9v4m0 3.5h.01"})]}):a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"12",cy:"12",r:"8.5"}),e==="success"?a.jsx("path",{d:"m8 12 2.7 2.7L16 9.4"}):e==="error"?a.jsx("path",{d:"m9.2 9.2 5.6 5.6m0-5.6-5.6 5.6"}):a.jsx("path",{d:"M12 11v5m0-8h.01"})]})})}function lnt(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m7 7 10 10M17 7 7 17"})})}function cnt({variant:e="info",title:t,description:n,action:i,onDismiss:r,closeLabel:s="关闭通知",className:o="",role:l="status",...c}){return a.jsxs("div",{...c,role:l,className:`studio-toast ${o}`.trim(),"data-variant":e,children:[a.jsx(ont,{variant:e,className:"studio-toast__status"}),a.jsxs("div",{className:"studio-toast__content",children:[t!=null&&a.jsx("div",{className:"studio-toast__title",children:t}),n!=null&&a.jsx("div",{className:"studio-toast__description",children:n}),i!=null&&a.jsx("div",{className:"studio-toast__action",children:i})]}),r&&a.jsx(ki,{variant:"ghost",iconOnly:!0,startIcon:a.jsx(lnt,{}),"aria-label":s,onClick:r,className:"studio-toast__close"})]})}function Uz(){}const unt=Object.freeze([]),Jl=Object.freeze({});function MD(e){p.useEffect(e,unt)}const pJ={};function Td(e,t){const n=p.useRef(pJ);return n.current===pJ&&(n.current=e(t)),n}const dnt=()=>{},ti=typeof document<"u"?p.useLayoutEffect:dnt;function fnt(e,t){return function(i,...r){const s=new URL(e);return s.searchParams.set("code",i.toString()),r.forEach(o=>s.searchParams.append("args[]",o)),`${t} error #${i}; visit ${s} for the full message.`}}const Uc=fnt("https://base-ui.com/production-error","Base UI"),X2e=p.createContext(void 0);function Qz(){const e=p.useContext(X2e);if(!e)throw new Error(Uc(73));return e}var Y2e={exports:{}},Z2e={};/** * @license React * use-sync-external-store-shim/with-selector.production.js * @@ -137,38 +137,38 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var LD=p,fnt=XP;function hnt(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var pnt=typeof Object.is=="function"?Object.is:hnt,mnt=fnt.useSyncExternalStore,gnt=LD.useRef,bnt=LD.useEffect,ynt=LD.useMemo,vnt=LD.useDebugValue;Y2e.useSyncExternalStoreWithSelector=function(e,t,n,i,r){var s=gnt(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=ynt(function(){function c(m){if(!u){if(u=!0,d=m,m=i(m),r!==void 0&&o.hasValue){var g=o.value;if(r(g,m))return f=g}return f=m}if(g=f,pnt(d,m))return g;var b=i(m);return r!==void 0&&r(g,b)?(d=m,g):(d=m,f=b)}var u=!1,d,f,h=n===void 0?null:n;return[function(){return c(t())},h===null?void 0:function(){return c(h())}]},[t,n,i,r]);var l=mnt(e,s[0],s[1]);return bnt(function(){o.hasValue=!0,o.value=l},[l]),vnt(l),l};X2e.exports=Y2e;var Z2e=X2e.exports;const xnt=N1(Z2e),wnt=parseInt(p.version,10);function zz(e){return wnt>=e}const knt=zz(19),Ont=knt?Ent:Cnt;function J2e(e,t,n,i,r){return Ont(e,t,n,i,r)}function Snt(e,t,n,i,r){const s=p.useCallback(()=>t(e.getSnapshot(),n,i,r),[e,t,n,i,r]);return XP.useSyncExternalStore(e.subscribe,s,s)}function Ent(e,t,n,i,r){return Snt(e,t,n,i,r)}function Cnt(e,t,n,i,r){return Z2e.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,i,r))}class Ant{constructor(t){Zt(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));Zt(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const i of this.listeners){if(n!==this.updateTick)return;i(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,i,r){return J2e(this,t,n,i,r)}}const Vz={..._v},A3=Vz.useInsertionEffect,Tnt=A3&&A3!==Vz.useLayoutEffect?A3:e=>e();function oi(e){const t=Td(_nt).current;return t.next=e,Tnt(t.effect),t.trampoline}function _nt(){const e={next:void 0,callback:jnt,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function jnt(){}class $D extends Ant{constructor(t,n={},i){super(t),this.context=n,this.selectors=i}useSyncedValue(t,n){p.useDebugValue(t);const i=this;ti(()=>{i.state[t]!==n&&i.set(t,n)},[i,t,n])}useSyncedValueWithCleanup(t,n){const i=this;ti(()=>(i.state[t]!==n&&i.set(t,n),()=>{i.set(t,void 0)}),[i,t,n])}useSyncedValues(t){const n=this,i=Object.values(t);ti(()=>{n.update(t)},[n,...i])}useControlledProp(t,n){p.useDebugValue(t);const i=this,r=n!==void 0;ti(()=>{r&&!Object.is(i.state[t],n)&&i.setState({...i.state,[t]:n})},[i,t,n,r])}select(t,n,i,r){const s=this.selectors[t];return s(this.state,n,i,r)}useState(t,n,i,r){return p.useDebugValue(t),J2e(this,this.selectors[t],n,i,r)}useContextCallback(t,n){p.useDebugValue(t);const i=oi(n??Uz);this.context[t]=i}useStateSetter(t){const n=p.useRef(void 0);return n.current===void 0&&(n.current=i=>{this.set(t,i)}),n.current}observe(t,n){let i;typeof t=="function"?i=t:i=this.selectors[t];let r=i(this.state);return n(r,r,this),this.subscribe(s=>{const o=i(s);if(!Object.is(r,o)){const l=r;r=o,n(o,l,this)}})}}function FD(){return typeof window<"u"}function dl(e){return Hz(e)?(e.nodeName||"").toLowerCase():"#document"}function ea(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function pm(e){var t;return(t=(Hz(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Hz(e){return FD()?e instanceof Node||e instanceof ea(e).Node:!1}function Tr(e){return FD()?e instanceof Element||e instanceof ea(e).Element:!1}function Zs(e){return FD()?e instanceof HTMLElement||e instanceof ea(e).HTMLElement:!1}function Zw(e){return!FD()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ea(e).ShadowRoot}function HA(e){const{overflow:t,overflowX:n,overflowY:i,display:r}=Uu(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&r!=="inline"&&r!=="contents"}function Nnt(e){return/^(table|td|th)$/.test(dl(e))}function BD(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Rnt=/transform|translate|scale|rotate|perspective|filter/,Int=/paint|layout|strict|content/,Hb=e=>!!e&&e!=="none";let T3;function qz(e){const t=Tr(e)?Uu(e):e;return Hb(t.transform)||Hb(t.translate)||Hb(t.scale)||Hb(t.rotate)||Hb(t.perspective)||!Wz()&&(Hb(t.backdropFilter)||Hb(t.filter))||Rnt.test(t.willChange||"")||Int.test(t.contain||"")}function Pnt(e){let t=Kg(e);for(;Zs(t)&&!Rg(t);){if(qz(t))return t;if(BD(t))return null;t=Kg(t)}return null}function Wz(){return T3==null&&(T3=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),T3}function Rg(e){return/^(html|body|#document)$/.test(dl(e))}function Uu(e){return ea(e).getComputedStyle(e)}function UD(e){return Tr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Kg(e){if(dl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Zw(e)&&e.host||pm(e);return Zw(t)?t.host:t}function e_e(e){const t=Kg(e);return Rg(t)?(e.ownerDocument||e).body:Zs(t)&&HA(t)?t:e_e(t)}function uC(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=e_e(e),s=r===((i=e.ownerDocument)==null?void 0:i.body),o=ea(r);if(s){const l=Y8(o);return t.concat(o,o.visualViewport||[],HA(r)?r:[],l&&n?uC(l):[])}else return t.concat(r,uC(r,[],n))}function Y8(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function yh(...e){return()=>{for(let t=0;t{e.removeEventListener(t,n,i)}}const Z2=null;let Dnt=class{constructor(){Zt(this,"callbacks",[]);Zt(this,"callbacksCount",0);Zt(this,"nextId",1);Zt(this,"startId",1);Zt(this,"isScheduled",!1);Zt(this,"tick",t=>{var r;this.isScheduled=!1;const n=this.callbacks,i=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,i>0)for(let s=0;s=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}},J2=new Dnt;class Cc{constructor(){Zt(this,"currentId",Z2);Zt(this,"cancel",()=>{this.currentId!==Z2&&(J2.cancel(this.currentId),this.currentId=Z2)});Zt(this,"disposeEffect",()=>this.cancel)}static create(){return new Cc}static request(t){return J2.request(t)}static cancel(t){return J2.cancel(t)}request(t){this.cancel(),this.currentId=J2.request(()=>{this.currentId=Z2,t()})}}function Kz(){const e=Td(Cc.create).current;return MD(e.disposeEffect),e}const fO=0;class Qu{constructor(){Zt(this,"currentId",fO);Zt(this,"clear",()=>{this.currentId!==fO&&(clearTimeout(this.currentId),this.currentId=fO)});Zt(this,"disposeEffect",()=>this.clear)}static create(){return new Qu}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=fO,n()},t)}isStarted(){return this.currentId!==fO}}function ov(){const e=Td(Qu.create).current;return MD(e.disposeEffect),e}let mJ=0;function Mnt(e){return mJ+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${mJ}`}function _3(e,t){if(typeof e=="string")return{description:e};if(typeof e=="function"){const n=e(t);return typeof n=="string"?{description:n}:n}return e}function Lnt(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:$nt,platform:Fnt,maxTouchPoints:Bnt}=Lnt(),QD=$nt.toLowerCase(),dC=Fnt.toLowerCase(),zD=/^i(os$|p)/.test(dC)||dC==="macintel"&&Bnt>1,gJ="android",Z8=dC===gJ||QD.includes(gJ),Unt=!zD&&dC.startsWith("mac");dC.startsWith("win");const Qnt=Unt||zD;var jue;const q1=typeof CSS<"u"&&!!((jue=CSS.supports)!=null&&jue.call(CSS,"-webkit-backdrop-filter:none"));!q1&&QD.includes("firefox");!q1&&QD.includes("chrom");const znt=Qnt,t_e=/jsdom|happydom/.test(QD),J8="data-base-ui-focusable",n_e="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Sc(e){var n;let t=e.activeElement;for(;((n=t==null?void 0:t.shadowRoot)==null?void 0:n.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function ii(e,t){var i;if(!e||!t)return!1;const n=(i=t.getRootNode)==null?void 0:i.call(t);if(e.contains(t))return!0;if(n&&Zw(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function fo(e){return"composedPath"in e?e.composedPath()[0]:e.target}function i_e(e,t){if(!Tr(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,i]of t.entries())if(ii(i,n))return!i.hasAttribute("data-trigger-disabled");return!1}function j3(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Vnt(e){return e.matches("html,body")}function Gz(e){return Zs(e)&&e.matches(n_e)}function Hnt(e){return(e==null?void 0:e.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${n_e}`))!=null}function bJ(e){return e?e.getAttribute("role")==="combobox"&&Gz(e):!1}function eB(e){if(!e||t_e)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function yJ(e){return e?e.hasAttribute(J8)?e:e.querySelector(`[${J8}]`)||e:null}function Gg(e,t,n=!0){return e.filter(r=>r.parentId===t).flatMap(r=>{var s;return[...!n||(s=r.context)!=null&&s.open?[r]:[],...Gg(e,r.id,n)]})}function vJ(e,t){var r;let n=[],i=(r=e.find(s=>s.id===t))==null?void 0:r.parentId;for(;i;){const s=e.find(o=>o.id===i);i=s==null?void 0:s.parentId,s&&(n=n.concat(s))}return n}function qnt(e){e.preventDefault(),e.stopPropagation()}function Wnt(e){return"nativeEvent"in e}function Knt(e){return e.pointerType===""&&e.isTrusted?!0:Z8&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function r_e(e){return t_e?!1:!Z8&&e.width===0&&e.height===0||Z8&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function sw(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Gnt(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const Xnt=["top","right","bottom","left"],Xg=Math.min,Dp=Math.max,tI=Math.round,e_=Math.floor,Mp=e=>({x:e,y:e}),Ynt={left:"right",right:"left",bottom:"top",top:"bottom"};function Xz(e,t,n){return Dp(e,Xg(t,n))}function Eh(e,t){return typeof e=="function"?e(t):e}function kd(e){return e.split("-")[0]}function mm(e){return e.split("-")[1]}function Yz(e){return e==="x"?"y":"x"}function VD(e){return e==="y"?"height":"width"}function pd(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function HD(e){return Yz(pd(e))}function Znt(e,t,n){n===void 0&&(n=!1);const i=mm(e),r=HD(e),s=VD(r);let o=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=nI(o)),[o,nI(o)]}function Jnt(e){const t=nI(e);return[tB(e),t,tB(t)]}function tB(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const xJ=["left","right"],wJ=["right","left"],eit=["top","bottom"],tit=["bottom","top"];function nit(e,t,n){switch(e){case"top":case"bottom":return n?t?wJ:xJ:t?xJ:wJ;case"left":case"right":return t?eit:tit;default:return[]}}function iit(e,t,n,i){const r=mm(e);let s=nit(kd(e),n==="start",i);return r&&(s=s.map(o=>o+"-"+r),t&&(s=s.concat(s.map(tB)))),s}function nI(e){const t=kd(e);return Ynt[t]+e.slice(t.length)}function rit(e){var t,n,i,r;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(i=e.bottom)!=null?i:0,left:(r=e.left)!=null?r:0}}function Zz(e){return typeof e!="number"?rit(e):{top:e,right:e,bottom:e,left:e}}function iI(e){const{x:t,y:n,width:i,height:r}=e;return{width:i,height:r,top:n,left:t,right:t+i,bottom:n+r,x:t,y:n}}function sit(e){return e.visibility==="hidden"||e.visibility==="collapse"}function s_e(e,t=e?Uu(e):null){return!e||!e.isConnected||!t||sit(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const ait='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function oit(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return Zw(n)?n.host:null}function nB(e){for(const t of Array.from(e.children))if(dl(t)==="summary")return t;return null}function lit(e,t){const n=nB(t);return!!n&&(e===n||ii(n,e))}function a_e(e){const t=e?dl(e):"";return e!=null&&e.matches(ait)&&(t!=="summary"||e.parentElement!=null&&dl(e.parentElement)==="details"&&nB(e.parentElement)===e)&&(t!=="details"||nB(e)==null)&&(t!=="input"||e.type!=="hidden")}function o_e(e){if(!a_e(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=oit(t)){const n=t!==e,i=dl(t)==="slot";if(t.hasAttribute("inert")||n&&dl(t)==="details"&&!t.open&&!lit(e,t)||t.hasAttribute("hidden")||!i&&!cit(t,n))return!1}return!0}function cit(e,t){const n=Uu(e);return t?n.display!=="none":s_e(e,n)}function l_e(e){const t=e.tabIndex;if(t<0){const n=dl(e);if(n==="details"||n==="audio"||n==="video"||Zs(e)&&e.isContentEditable)return 0}return t}function N3(e){if(dl(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function uit(e,t){const n=N3(e);if(!n)return!0;const i=t.find(r=>{const s=N3(r);return(s==null?void 0:s.name)===n.name&&s.form===n.form&&s.checked});return i?i===n:t.find(r=>{const s=N3(r);return(s==null?void 0:s.name)===n.name&&s.form===n.form})===n}function c_e(e){if(Zs(e)&&dl(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Zs(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function u_e(e,t){c_e(e).forEach(n=>{a_e(n)&&t.push(n),u_e(n,t)})}function d_e(e,t,n){c_e(e).forEach(i=>{Zs(i)&&i.matches(t)&&n.push(i),d_e(i,t,n)})}function Jz(e){return o_e(e)&&l_e(e)>=0}function f_e(e){const t=[];return u_e(e,t),t.filter(o_e)}function qA(e){const t=f_e(e);return t.filter(n=>l_e(n)>=0&&uit(n,t))}function h_e(e,t){const n=qA(e),i=n.length;if(i===0)return;const r=Sc(Cr(e)),s=n.indexOf(r),o=s===-1?t===1?0:i-1:s+t;return n[o]}function eV(e){return h_e(Cr(e).body,1)||e}function p_e(e){return h_e(Cr(e).body,-1)||e}function m_e(e,t){if(!e)return null;const n=qA(Cr(e).body),i=n.length;if(i===0)return null;const r=n.indexOf(e);if(r===-1)return null;const s=(r+t+i)%i;return n[s]}function dit(e){return m_e(e,1)}function fit(e){return m_e(e,-1)}function aw(e,t){const n=t||e.currentTarget,i=e.relatedTarget;return!i||!ii(n,i)}function hit(e){qA(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function kJ(e){const t=[];d_e(e,"[data-tabindex]",t),t.forEach(n=>{const i=n.dataset.tabindex;delete n.dataset.tabindex,i?n.setAttribute("tabindex",i):n.removeAttribute("tabindex")})}function R3(e){const t=new Map;let n=0,i=0;return e.forEach((r,s)=>{const o=r.transitionStatus==="ending";t.set(r.id,{value:r,domIndex:s,visibleIndex:o?-1:n,offsetY:i}),i+=r.height||0,o||(n+=1)}),t}function I3(e,t){let n=0;return e.map(i=>{if(i.transitionStatus==="ending")return i;const r=n>=t;return n+=1,i.limited===r?i:{...i,limited:r}})}const Bf={toasts:e=>e.toasts,isEmpty:e=>e.toasts.length===0,toast:(e,t)=>{var n;return(n=e.toastMetadata.get(t))==null?void 0:n.value},toastIndex:(e,t)=>{var n;return((n=e.toastMetadata.get(t))==null?void 0:n.domIndex)??-1},toastOffsetY:(e,t)=>{var n;return((n=e.toastMetadata.get(t))==null?void 0:n.offsetY)??0},toastVisibleIndex:(e,t)=>{var n;return((n=e.toastMetadata.get(t))==null?void 0:n.visibleIndex)??-1},focused:e=>e.focused,expanded:e=>e.hovering||e.focused,expandedOrOutOfFocus:e=>e.hovering||e.focused||!e.isWindowFocused,prevFocusElement:e=>e.prevFocusElement};class pit extends $D{constructor(n){super({...n,toastMetadata:R3(n.toasts)},{},Bf);Zt(this,"timers",new Map);Zt(this,"areTimersPaused",!1);Zt(this,"setViewport",n=>{this.set("viewport",n)});Zt(this,"disposeEffect",()=>()=>{this.timers.forEach(n=>{var i;(i=n.timeout)==null||i.clear()}),this.timers.clear()});Zt(this,"addToast",n=>{const{timeout:i,limit:r}=this.state,s=n.id||Mnt("toast");if(n.id){const u=Bf.toast(this.state,n.id);if(u)if(u.transitionStatus==="ending")this.removeToast(n.id,!0);else{const{id:d,transitionStatus:f,...h}=n;return this.updateToastInternal(n.id,h,!0,!0),n.id}}const o={...n,id:s,updateKey:0,transitionStatus:"starting"},l=[o,...this.state.toasts];this.setToasts(I3(l,r));const c=o.timeout??i;return o.type!=="loading"&&c>0&&this.scheduleTimer(s,c,()=>this.closeToast(s)),Bf.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),s});Zt(this,"updateToast",(n,i)=>{this.updateToastInternal(n,i,!1,!0)});Zt(this,"updateToastInternal",(n,i,r=!1,s=!1)=>{const{timeout:o,toasts:l}=this.state,c=Bf.toast(this.state,n);if(!c||c.transitionStatus==="ending")return;const u={...c,...i,...s&&{updateKey:c.updateKey+1}};this.setToasts(l.map(y=>y.id===n?u:y));const d=u.timeout??o,f=c.timeout??o,h=Object.hasOwn(i,"timeout"),m=u.transitionStatus!=="ending"&&u.type!=="loading"&&d>0,g=this.timers.has(n),b=f!==d,v=c.type==="loading";if(!m&&g){this.clearTimer(n);return}m&&(!g||b||h||v||r)&&(this.clearTimer(n),this.scheduleTimer(n,d,()=>this.closeToast(n)),Bf.expandedOrOutOfFocus(this.state)&&this.pauseTimers())});Zt(this,"closeToast",n=>{const i=n===void 0,{limit:r,toasts:s}=this.state;let o;if(i)o=s,this.clearTimers();else{const u=Bf.toast(this.state,n);if(!u)return;o=[u],this.clearTimer(n)}const l=s.map(u=>i||u.id===n?{...u,transitionStatus:"ending",height:0}:u),c=I3(l,r);this.setToasts(c,!c.some(u=>u.transitionStatus!=="ending")),o.forEach(u=>{var d;u.transitionStatus!=="ending"&&((d=u.onClose)==null||d.call(u))}),this.handleFocusManagement(n)});Zt(this,"promiseToast",(n,i)=>{const r=_3(i.loading),s=this.addToast({...r,type:"loading"}),o=n.then(l=>{const c=_3(i.success,l);return this.updateToast(s,{...c,type:"success",timeout:c.timeout}),l}).catch(l=>{const c=_3(i.error,l);return this.updateToast(s,{...c,type:"error",timeout:c.timeout}),Promise.reject(l)});return{}.hasOwnProperty.call(i,"setPromise")&&i.setPromise(o),o});Zt(this,"handleDocumentPointerDown",n=>{if(n.pointerType!=="touch")return;const i=fo(n);ii(this.state.viewport,i)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))})}syncProviderProps(n,i){const r=this.state.limit!==i;if(this.state.timeout===n&&!r)return;const s={timeout:n,limit:i};if(r){const o=I3(this.state.toasts,i);s.toasts=o,s.toastMetadata=R3(o)}this.update(s)}removeToast(n,i=!1){var l;const r=Bf.toastIndex(this.state,n);if(r===-1)return;const s=this.state.toasts[r];i||(l=s==null?void 0:s.onRemove)==null||l.call(s);const o=[...this.state.toasts];o.splice(r,1),this.setToasts(o)}pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(n=>{n.timeout&&(n.timeout.clear(),n.remaining=Math.max(n.remaining-(Date.now()-n.start),0))}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((n,i)=>{n.remaining=n.remaining>0?n.remaining:n.delay,n.timeout??(n.timeout=Qu.create()),n.timeout.start(n.remaining,()=>{this.handleTimerFired(i),n.callback()}),n.start=Date.now()}))}restoreFocusToPrevElement(){var n;(n=this.state.prevFocusElement)==null||n.focus({preventScroll:!0})}scheduleTimer(n,i,r){const s=Date.now(),l=!Bf.expandedOrOutOfFocus(this.state)?Qu.create():void 0;l==null||l.start(i,()=>{this.handleTimerFired(n),r()}),this.timers.set(n,{timeout:l,start:s,delay:i,remaining:i,callback:r})}clearTimers(){this.timers.forEach(n=>{var i;(i=n.timeout)==null||i.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(n){var r;const i=this.timers.get(n);(r=i==null?void 0:i.timeout)==null||r.clear(),this.timers.delete(n),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(n){this.timers.delete(n),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){this.timers.size===0&&(this.areTimersPaused=!1)}setToasts(n,i=n.length===0){const r={toasts:n,toastMetadata:R3(n)};i&&(r.hovering=!1,r.focused=!1),this.update(r)}handleFocusManagement(n){var c,u;const i=Sc(Cr(this.state.viewport));if(!this.state.viewport||!ii(this.state.viewport,i)||!eB(i))return;if(n===void 0){this.restoreFocusToPrevElement();return}const r=Bf.toasts(this.state),s=Bf.toastIndex(this.state,n),o=(d,f)=>{for(let h=d;h>=0&&hnew pit({timeout:i,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return MD(o.disposeEffect),p.useEffect(function(){return s?s[" subscribe"](({action:u,options:d})=>{const f=d.id;u==="promise"&&d.promise?o.promiseToast(d.promise,d):u==="update"&&f?o.updateToast(f,d):u==="close"?o.closeToast(f):o.addToast(d)}):void 0},[o,s]),a.jsxs(G2e.Provider,{value:o,children:[a.jsx(git,{store:o,timeout:i,limit:r}),n]})};function git(e){const{store:t,timeout:n,limit:i}=e;return ti(()=>{t.syncProviderProps(n,i)},[t,n,i]),null}const bit={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},g_e={...bit,position:"fixed",top:0,left:0},lv=p.forwardRef(function(t,n){const[i,r]=p.useState();ti(()=>{znt&&q1&&r("button")},[]);const s={tabIndex:0,role:i};return a.jsx("span",{...t,ref:n,style:g_e,"aria-hidden":i?void 0:!0,...s,"data-base-ui-focus-guard":""})});function Jw(e,t,n,i){const r=Td(b_e).current;return vit(r,e,t,n,i)&&y_e(r,[e,t,n,i]),r.callback}function yit(e){const t=Td(b_e).current;return xit(t,e)&&y_e(t,e),t.callback}function b_e(){return{callback:null,cleanup:null,refs:[]}}function vit(e,t,n,i,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==i||e.refs[3]!==r}function xit(e,t){return e.refs.length!==t.length||e.refs.some((n,i)=>n!==t[i])}function y_e(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const i=Array(t.length).fill(null);for(let r=0;r{for(let r=0;r=65&&r<=90&&(typeof t=="function"||typeof t>"u")}function iV(e){return typeof e=="function"}function w_e(e,t){return iV(e)?e(t):e??tV}function Cit(e,t){return t?e?(...n)=>{const i=n[0];if(S_e(i)){const s=i;sI(s);const o=t(...n);return s.baseUIHandlerPrevented||e==null||e(...n),o}const r=t(...n);return e==null||e(...n),r}:k_e(t):e}function k_e(e){return e&&((...t)=>{const n=t[0];return S_e(n)&&sI(n),e(...t)})}function sI(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function O_e(e,t){return t?e?t+" "+e:t:e}function S_e(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Da(e,t,n={}){const i=t.render,r=Ait(t,n);if(n.enabled===!1)return null;const s=n.state??Jl;return jit(e,i,r,s)}function Ait(e,t={}){const{className:n,style:i,render:r}=e,{state:s=Jl,ref:o,props:l,stateAttributesMapping:c,enabled:u=!0}=t,d=u?kit(n,s):void 0,f=u?v_e(i,s):void 0,h=u?wit(s,c):Jl,m=u&&l?Tit(l):void 0,g=u?iB(h,m)??{}:Jl;return typeof document<"u"&&(u?Array.isArray(o)?g.ref=yit([g.ref,OJ(r),...o]):g.ref=Jw(g.ref,OJ(r),o):Jw(null,null)),u?(d!==void 0&&(g.className=O_e(g.className,d)),f!==void 0&&(g.style=iB(g.style,f)),g):Jl}function Tit(e){return Array.isArray(e)?Oit(e):nV(void 0,e)}const _it=Symbol.for("react.lazy");function jit(e,t,n,i){if(t){if(typeof t=="function")return t(n,i);const r=nV(n,t.props);r.ref=n.ref;let s=t;return(s==null?void 0:s.$$typeof)===_it&&(s=p.Children.toArray(t)[0]),p.cloneElement(s,r)}if(e&&typeof e=="string")return Nit(e,n);throw new Error(Uc(8))}function Nit(e,t){return e==="button"?p.createElement("button",{type:"button",...t,key:t.key}):e==="img"?p.createElement("img",{alt:"",...t,key:t.key}):p.createElement(e,t)}const Rit=p.forwardRef(function(t,n){var F;const{render:i,className:r,style:s,children:o,...l}=t,c=Qz(),u=ov(),d=p.useRef(!1),f=p.useRef(!1),h=p.useRef(!1),m=c.useState("isEmpty"),g=c.useState("toasts"),b=c.useState("focused"),v=c.useState("expanded"),y=c.useState("prevFocusElement"),w=(F=g[0])==null?void 0:F.height,x=g.some(M=>M.transitionStatus==="ending"),k=g.filter(M=>M.priority==="high");p.useEffect(()=>{const M=c.state.viewport;if(!M||m)return;const H=ea(M),q=Cr(M);function U(J){J.key==="F6"&&fo(J)!==M&&(J.preventDefault(),c.set("prevFocusElement",Sc(q)),M==null||M.focus({preventScroll:!0}),c.pauseTimers(),c.set("focused",!0))}function Z(J){fo(J)===H&&(c.set("isWindowFocused",!1),c.pauseTimers())}function z(J){if(J.relatedTarget)return;const ne=fo(J),W=Sc(Cr(M));(ne===H||!ii(M,ne)||!eB(W))&&c.resumeTimers(),u.start(0,()=>c.set("isWindowFocused",!0))}return yh(Di(H,"keydown",U),Di(H,"blur",Z,!0),Di(H,"focus",z,!0),Di(q,"pointerdown",c.handleDocumentPointerDown,!0))},[c,u,m]);function S(M){var q,U;d.current=!0;const H=M.relatedTarget===c.state.viewport?g.find(Z=>Z.transitionStatus!=="ending"&&!Z.limited):void 0;H?(U=(q=H.ref)==null?void 0:q.current)==null||U.focus():c.restoreFocusToPrevElement()}function O(M){M.key==="Tab"&&M.shiftKey&&fo(M.nativeEvent)===c.state.viewport&&(M.preventDefault(),c.restoreFocusToPrevElement())}function A(){c.state.toasts.some(H=>H.transitionStatus==="ending")||h.current||!f.current||(c.state.isWindowFocused&&c.resumeTimers(),c.set("hovering",!1),f.current=!1)}p.useEffect(A,[x,c]);function E(){c.pauseTimers(),c.set("hovering",!0),f.current=!1}function j(){c.state.isWindowFocused&&c.resumeTimers()}function T(){f.current=!0,A()}function R(M){M.pointerType==="touch"&&(h.current=!0)}function C(M){M.pointerType==="touch"&&(h.current=!1,A())}function N(){if(d.current){d.current=!1;return}b||eB(Sc(Cr(c.state.viewport)))&&(c.set("focused",!0),c.pauseTimers())}function P(M){!b||ii(c.state.viewport,M.relatedTarget)||(c.set("focused",!1),j())}const I={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:E,onMouseMove:E,onMouseLeave:T,onFocus:N,onBlur:P,onKeyDown:O,onClick:N,onPointerDown:R,onPointerUp:C,onPointerCancel:C,style:{"--toast-frontmost-height":w?`${w}px`:void 0}},D={expanded:v},_=!m&&y&&a.jsx(lv,{onFocus:S}),L=Da("div",t,{ref:[n,c.setViewport],state:D,props:[I,l,{children:a.jsxs(p.Fragment,{children:[_,o,_]})}]});return a.jsxs(p.Fragment,{children:[_,L,!b&&k.length>0&&a.jsx("div",{style:g_e,children:k.map(M=>a.jsxs("div",{role:"alert","aria-atomic":!0,children:[a.jsx("div",{children:M.title}),a.jsx("div",{children:M.description})]},M.id))})]})});function rV(e){return zz(19)?e:e?"true":void 0}const E_e=p.createContext(void 0);function Iit(){const e=p.useContext(E_e);if(!e)throw new Error(Uc(66));return e}let aI=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({});const Pit={"data-starting-style":""},Dit={"data-ending-style":""},qD={transitionStatus(e){return e==="starting"?Pit:e==="ending"?Dit:null}};function op(e){return e==null?e:"current"in e?e.current:e}function sV(e,t=!1){const n=Kz();return oi((i,r=null)=>{n.cancel();const s=op(e);if(s==null)return;const o=s,l=()=>{vi.flushSync(i)};if(typeof o.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function c(){Promise.all(o.getAnimations().map(u=>u.finished)).then(()=>{r!=null&&r.aborted||l()},()=>{if(r!=null&&r.aborted)return;if(o.getAnimations().some(d=>d.pending||d.playState!=="finished")){c();return}l()})}if(t){const u="data-starting-style";if(!o.hasAttribute(u)){n.request(c);return}const d=new MutationObserver(()=>{o.hasAttribute(u)||(d.disconnect(),c())});d.observe(o,{attributes:!0,attributeFilter:[u]}),r==null||r.addEventListener("abort",()=>d.disconnect(),{once:!0});return}n.request(c)})}function WA(e){const{enabled:t=!0,open:n,ref:i,onComplete:r}=e,s=oi(r),o=sV(i,n);p.useEffect(()=>{if(!t)return;const l=new AbortController;return o(s,l.signal),()=>{l.abort()}},[t,n,s,o])}const Mit=500,Lit={style:{transition:"none"}},aV="data-base-ui-click-trigger",$it="data-base-ui-swipe-ignore",Fit="data-swipe-ignore",Bit=`[${$it}]`,Uit=`[${Fit}]`,Qit={fallbackAxisSide:"end"},zit={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function P3(e,t,n){switch(e){case"up":return-n;case"down":return n;case"left":return-t;case"right":return t;default:return 0}}function Vit(e){const n=ea(e).getComputedStyle(e).transform;let i=0,r=0,s=1;if(n&&n!=="none"){const o=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(o){const l=o[1].split(", ").map(parseFloat);l.length===6?(i=l[4],r=l[5],s=Math.sqrt(l[0]*l[0]+l[1]*l[1])):l.length===16&&(i=l[12],r=l[13],s=l[0])}}return{x:i,y:r,scale:s}}const Hit={...qD,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},SJ=40,qit=10,EJ=.5,Wit=1,Kit=`${Bit},${Uit}`,Git=p.forwardRef(function(t,n){var Ge;const{toast:i,render:r,className:s,swipeDirection:o=["down","right"],style:l,...c}=t,u=((Ge=i.positionerProps)==null?void 0:Ge.anchor)!==void 0;let d=[];u||(d=Array.isArray(o)?o:[o]);const f=d.length>0,h=Qz(),[m,g]=p.useState(void 0),[b,v]=p.useState(!1),[y,w]=p.useState(!1),[x,k]=p.useState({x:0,y:0}),[S,O]=p.useState({x:0,y:0,scale:1}),[A,E]=p.useState(),[j,T]=p.useState(),[R,C]=p.useState(null),N=p.useRef(null),P=p.useRef(void 0),I=p.useRef({x:0,y:0}),D=p.useRef({x:0,y:0,scale:1}),_=p.useRef(void 0),L=p.useRef(0),F=p.useRef(!1),M=p.useRef({x:0,y:0}),H=p.useRef(!1),q=p.useRef({x:0,y:0}),U=p.useRef(null),Z=p.useRef(null),z=h.useState("toastIndex",i.id),J=h.useState("toastVisibleIndex",i.id),ne=h.useState("toastOffsetY",i.id),W=h.useState("focused"),X=h.useState("expanded");WA({open:i.transitionStatus!=="ending",ref:N,onComplete(){i.transitionStatus==="ending"&&h.removeToast(i.id)}});const le=oi((De=!1)=>{const se=N.current;if(!se)return;const ce=se.style.height;se.style.height="auto";const ye=se.offsetHeight;se.style.height=ce;function Ae(){h.updateToastInternal(i.id,{ref:N,height:ye,transitionStatus:void 0})}De?vi.flushSync(Ae):Ae()});ti(()=>{const De=P.current;i.transitionStatus!=="starting"&&De===i.id||(De!==void 0&&(g(void 0),O({x:0,y:0,scale:1}),V({x:0,y:0})),P.current=i.id,le())},[le,i.id,i.transitionStatus]);function V(De){q.current=De,k(De)}ti(()=>()=>{var De;(De=Z.current)==null||De.abort()},[]);function Y(De,se){const ce=Ee=>Ee>0?Ee**EJ:-(Math.abs(Ee)**EJ),ye=De>0&&!d.includes("right")||De<0&&!d.includes("left"),Ae=se>0&&!d.includes("down")||se<0&&!d.includes("up");return{x:ye?ce(De):De,y:Ae?ce(se):se}}const K=oi(De=>{var Ce;if(De.pointerId!==U.current)return;U.current=null,(Ce=Z.current)==null||Ce.abort(),Z.current=null,v(!1),w(!1),C(null);const se=D.current;if(De.type==="pointercancel"||F.current){V({x:se.x,y:se.y}),g(void 0);return}const ce=q.current,ye=ce.x-se.x,Ae=ce.y-se.y;let Ee;for(const Be of d)if(P3(Be,ye,Ae)>SJ){Ee=Be;break}Ee?(g(Ee),h.closeToast(i.id)):(V({x:se.x,y:se.y}),g(void 0))});function ue(De){var Be,he;if(De.button!==0)return;De.pointerType==="touch"&&h.pauseTimers();const se=fo(De.nativeEvent);if(se==null?void 0:se.closest(`button,a,input,textarea,[role="button"],${Kit}`))return;F.current=!1,_.current=void 0,L.current=0,U.current=De.pointerId,I.current={x:De.clientX,y:De.clientY},M.current=I.current;const ye=De.currentTarget,Ae=Vit(ye);D.current=Ae,O(Ae),V({x:Ae.x,y:Ae.y}),h.set("hovering",!0),v(!0),w(!1),C(null),H.current=!0,(Be=Z.current)==null||Be.abort();const Ee=new AbortController;Z.current=Ee;const Ce=Cr(ye);Ce.addEventListener("pointerup",K,{signal:Ee.signal}),Ce.addEventListener("pointercancel",K,{signal:Ee.signal}),(he=ye.setPointerCapture)==null||he.call(ye,De.pointerId)}function te(De){if(De.pointerId!==U.current)return;De.preventDefault(),H.current&&(I.current={x:De.clientX,y:De.clientY},H.current=!1);const{clientY:se,clientX:ce,movementX:ye,movementY:Ae}=De;(Ae<0&&se>M.current.y||Ae>0&&seM.current.x||ye>0&&ce=Wit){w(!0);const Lt=d.includes("left")||d.includes("right"),qe=d.includes("up")||d.includes("down");if(Lt&&qe){const yt=Math.abs(Ee),je=Math.abs(Ce);ie=yt>je?"horizontal":"vertical",C(ie)}}let we;if(!_.current)ie==="vertical"?Ce>0?we="down":Ce<0&&(we="up"):ie==="horizontal"?Ee>0?we="right":Ee<0&&(we="left"):Math.abs(Ee)>=Math.abs(Ce)?we=Ee>0?"right":"left":we=Ce>0?"down":"up",we&&d.includes(we)&&(_.current=we,L.current=P3(we,Ee,Ce),g(we));else{const St=_.current,Lt=P3(St,he,Be);Lt>SJ?(F.current=!1,g(St)):!(d.includes("left")&&d.includes("right"))&&!(d.includes("up")&&d.includes("down"))&&L.current-Lt>=qit&&(F.current=!0)}const Re=Y(Ee,Ce);let Ue=D.current.x,_t=D.current.y;const Pt=d.includes("left")||d.includes("right"),Gt=d.includes("up")||d.includes("down");ie!=="vertical"&&Pt&&(Ue+=Re.x),ie!=="horizontal"&&Gt&&(_t+=Re.y),V({x:Ue,y:_t})}function Oe(De){if(De.key==="Escape"){if(!N.current||!ii(N.current,Sc(Cr(N.current))))return;h.closeToast(i.id)}}p.useEffect(()=>{const De=N.current;if(!f||!De)return;function se(ce){U.current===null||!ii(De,fo(ce))||ce.preventDefault()}return Di(De,"touchmove",se,{passive:!1})},[f]);function fe(){const De=x.x-S.x,se=x.y-S.y;return{transition:b?"none":void 0,transform:b?`translateX(${x.x}px) translateY(${x.y}px) scale(${S.scale})`:void 0,"--toast-swipe-movement-x":`${De}px`,"--toast-swipe-movement-y":`${se}px`}}const pe=i.priority==="high",Se={role:pe?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":A,"aria-describedby":j,"aria-hidden":pe&&!W?!0:void 0,onPointerDown:f?ue:void 0,onPointerMove:f?te:void 0,onPointerUp:f?K:void 0,onPointerCancel:f?K:void 0,onKeyDown:Oe,inert:rV(i.limited),style:{...fe(),"--toast-index":i.transitionStatus==="ending"?z:J,"--toast-offset-y":`${ne}px`,"--toast-height":i.height?`${i.height}px`:void 0}},ve=p.useMemo(()=>({toast:i,setTitleId:E,setDescriptionId:T,recalculateHeight:le,visibleIndex:J,expanded:X}),[i,E,T,le,J,X]),Le={transitionStatus:i.transitionStatus,expanded:X,limited:i.limited||!1,type:i.type,swiping:b,swipeDirection:m},He=Da("div",t,{ref:[n,N],state:Le,stateAttributesMapping:Hit,props:[Se,c]});return a.jsx(E_e.Provider,{value:ve,children:He})});let CJ=0;function Xit(e,t="mui"){const[n,i]=p.useState(e),r=e||n;return p.useEffect(()=>{n==null&&(CJ+=1,i(`${t}-${CJ}`))},[n,t]),r}const AJ=Vz.useId;function KA(e,t){if(AJ!==void 0){const n=AJ();return e??(t?`${t}-${n}`:n)}return Xit(e,t)}function C_e(e){return e==null||typeof e=="boolean"||e===""?!1:Array.isArray(e)?e.some(C_e):!0}function Yit(e){return p.isValidElement(e)&&C_e(e.props.children)}function A_e(e,t,n){const{toast:i,setTitleId:r,setDescriptionId:s}=Iit(),o=n==="title"?r:s,l=t??(n==="title"?i.title:i.description);return{id:KA(e),children:l,type:i.type,setId:o}}function T_e(e,t,n){const i=Yit(e);return ti(()=>{if(i)return n(t),()=>{n(r=>r===t?void 0:r)}},[i,t,n]),i?e:null}const Zit=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:o,children:l,...c}=t,{id:u,children:d,type:f,setId:h}=A_e(o,l,"description"),g=Da("p",t,{ref:n,state:{type:f},props:{...c,id:u,children:d}});return T_e(g,u,h)}),Jit=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:o,children:l,...c}=t,{id:u,children:d,type:f,setId:h}=A_e(o,l,"title"),g=Da("h2",t,{ref:n,state:{type:f},props:{...c,id:u,children:d}});return T_e(g,u,h)}),ert=p.createContext(void 0);function trt(e=!1){const t=p.useContext(ert);if(t===void 0&&!e)throw new Error(Uc(16));return t}function nrt(e){const{focusableWhenDisabled:t,disabled:n,composite:i=!1,tabIndex:r=0,isNativeButton:s}=e,o=i&&t!==!1,l=i&&t===!1;return{props:p.useMemo(()=>{const u={onKeyDown(d){n&&t&&d.key!=="Tab"&&d.preventDefault()}};return i||(u.tabIndex=r,!s&&n&&(u.tabIndex=t?r:-1)),(s&&(t||o)||!s&&n)&&(u["aria-disabled"]=n),s&&(!t||l)&&(u.disabled=n),u},[i,n,t,o,l,s,r])}}function D3(e,t,{detail:n=0}={}){e.dispatchEvent(new(ea(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function WD(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:i=0,native:r=!0,composite:s}=e,o=p.useRef(null),l=trt(!0),c=s??l!==void 0,{props:u}=nrt({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:i,isNativeButton:r}),d=p.useCallback(()=>{const m=o.current;M3(m)&&c&&t&&u.disabled===void 0&&m.disabled&&(m.disabled=!1)},[t,u.disabled,c]);ti(d,[d]);const f=p.useCallback((m={})=>{const{onClick:g,onMouseDown:b,onKeyUp:v,onKeyDown:y,onPointerDown:w,...x}=m;return nV({onClick(k){if(t){k.preventDefault();return}g==null||g(k)},onMouseDown(k){t||b==null||b(k)},onKeyDown(k){if(t||(sI(k),y==null||y(k),k.baseUIHandlerPrevented))return;const S=k.target===k.currentTarget,O=k.currentTarget,A=M3(O),E=!r&&irt(O),j=S&&(r?A:!E),T=k.key==="Enter",R=k.key===" ",C=O.getAttribute("role"),N=(C==null?void 0:C.startsWith("menuitem"))||C==="option"||C==="gridcell";if(S&&c&&R){if(k.defaultPrevented&&N)return;k.preventDefault(),(!r||A)&&(k.preventBaseUIHandler(),D3(O,k));return}if(!j||r||!R&&!T){S&&E&&R&&k.preventDefault();return}k.defaultPrevented||(k.preventDefault(),T&&(k.preventBaseUIHandler(),D3(O,k)))},onKeyUp(k){if(!t){if(sI(k),v==null||v(k),k.target===k.currentTarget&&r&&c&&M3(k.currentTarget)&&k.key===" "){k.preventDefault();return}k.baseUIHandlerPrevented||k.target===k.currentTarget&&!r&&!c&&!k.defaultPrevented&&k.key===" "&&(k.preventBaseUIHandler(),D3(k.currentTarget,k))}},onPointerDown(k){if(t){k.preventDefault();return}w==null||w(k)}},r?{type:"button"}:{role:"button"},u,x)},[t,u,c,r]),h=oi(m=>{o.current=m,d()});return{getButtonProps:f,buttonRef:h}}function M3(e){return Zs(e)&&e.tagName==="BUTTON"}function irt(e){return Zs(e)&&e.tagName==="A"&&!!e.href}const __e="none",e1="trigger-press",vu="trigger-hover",j_e="outside-press",N_e="close-press",fC="focus-out",R_e="escape-key",I_e="imperative-action";function pa(e,t,n,i){let r=!1,s=!1;const o=Jl;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){s=!0},get isCanceled(){return r},get isPropagationAllowed(){return s},trigger:n,...o}}function oI(e){return`data-base-ui-${e}`}const P_e=p.createContext(null),D_e=()=>p.useContext(P_e),rrt=oI("portal");function M_e(e={}){const{ref:t,container:n,componentProps:i=Jl,elementProps:r}=e,s=KA(),o=D_e(),l=o==null?void 0:o.portalNode,[c,u]=p.useState(null),[d,f]=p.useState(null),h=oi(v=>{v!==null&&f(v)}),m=p.useRef(null);ti(()=>{if(n===null){m.current&&(m.current=null,f(null),u(null));return}const v=(n&&(Hz(n)?n:n.current))??l??document.body;if(v==null){m.current&&(m.current=null,f(null),u(null));return}m.current!==v&&(m.current=v,f(null),u(v))},[n,l]);const g=Da("div",i,{ref:[t,h],props:[{id:s,[rrt]:""},r]}),b=c&&g?vi.createPortal(g,c):null;return{node:d,nodeId:p.isValidElement(g)?g.props.id:void 0,subtree:b}}const L_e=p.forwardRef(function(t,n){const{render:i,className:r,style:s,children:o,container:l,...c}=t,{node:u,nodeId:d,subtree:f}=M_e({container:l,ref:n,componentProps:t,elementProps:c}),h=p.useRef(null),m=p.useRef(null),g=p.useRef(null),b=p.useRef(null),[v,y]=p.useState(null),w=p.useRef(!1),x=v==null?void 0:v.modal,k=v==null?void 0:v.open,S=!!v&&!v.modal&&v.open&&!!u;p.useEffect(()=>{if(!u||x)return;function A(E){u&&E.relatedTarget&&aw(E)&&(E.type==="focusin"?w.current&&(kJ(u),w.current=!1):(hit(u),w.current=!0))}return yh(Di(u,"focusin",A,!0),Di(u,"focusout",A,!0))},[u,x]),ti(()=>{!u||k!==!0||!w.current||(kJ(u),w.current=!1)},[k,u]);const O=p.useMemo(()=>({beforeOutsideRef:h,afterOutsideRef:m,beforeInsideRef:g,afterInsideRef:b,portalNode:u,setFocusManagerState:y}),[u]);return a.jsxs(p.Fragment,{children:[f,a.jsxs(P_e.Provider,{value:O,children:[S&&u&&a.jsx(lv,{"data-type":"outside",ref:h,onFocus:A=>{var E;if(aw(A,u))(E=g.current)==null||E.focus();else{const j=v?v.domReference:null,T=p_e(j);T==null||T.focus()}}}),S&&u&&a.jsx("span",{"aria-owns":d,style:zit}),u&&vi.createPortal(o,u),S&&u&&a.jsx(lv,{"data-type":"outside",ref:m,onFocus:A=>{var E;if(aw(A,u))(E=b.current)==null||E.focus();else{const j=v?v.domReference:null,T=eV(j);T==null||T.focus(),v!=null&&v.closeOnFocusOut&&(v==null||v.onOpenChange(!1,pa(fC,A.nativeEvent)))}}})]})]})}),srt=p.forwardRef(function(t,n){const{children:i,container:r,className:s,render:o,style:l,...c}=t,{node:u,subtree:d}=M_e({container:r,ref:n,componentProps:t,elementProps:c});return!d&&!u?null:a.jsxs(p.Fragment,{children:[d,u&&vi.createPortal(i,u)]})}),art=p.forwardRef(function(t,n){return a.jsx(srt,{ref:n,...t})});function Gl(e){const t=Td(ort,e).current;return t.next=e,ti(t.effect),t}function ort(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function lrt(e,t){return t!=null&&!sw(t)?0:typeof e=="function"?e():e}function rB(e,t,n){const i=lrt(e,n);return typeof i=="number"?i:i==null?void 0:i[t]}function TJ(e){return typeof e=="function"?e():e}function $_e(e,t){return t||e==="click"||e==="mousedown"}function crt(e){return(e==null?void 0:e.includes("mouse"))&&e!=="mousedown"}let t_=0;function L3(e,t={}){const{preventScroll:n=!1,sync:i=!1,shouldFocus:r}=t;cancelAnimationFrame(t_);function s(){r&&!r()||e==null||e.focus({preventScroll:n})}if(i)return s(),Uz;const o=requestAnimationFrame(s);return t_=o,()=>{t_===o&&(cancelAnimationFrame(o),t_=0)}}const $3={inert:new WeakMap,"aria-hidden":new WeakMap},_J="data-base-ui-inert",sB={inert:new WeakSet,"aria-hidden":new WeakSet};let hO=new WeakMap,F3=0;function urt(e){return sB[e]}function F_e(e){return e?Zw(e)?e.host:F_e(e.parentNode):null}const jJ=(e,t)=>t.map(n=>{if(e.contains(n))return n;const i=F_e(n);return e.contains(i)?i:null}).filter(n=>n!=null),NJ=e=>{const t=new Set;return e.forEach(n=>{let i=n;for(;i&&!t.has(i);)t.add(i),i=i.parentNode}),t},RJ=(e,t,n)=>{const i=[],r=s=>{!s||n.has(s)||Array.from(s.children).forEach(o=>{dl(o)!=="script"&&(t.has(o)?r(o):i.push(o))})};return r(e),i};function drt(e,t,n,i,{mark:r=!0}){let s=null;i?s="inert":n&&(s="aria-hidden");let o=null,l=null;const c=jJ(t,e),u=r?RJ(t,NJ(c),new Set(c)):[],d=[],f=[];if(s){const h=$3[s],m=urt(s);l=m,o=h;const g=jJ(t,Array.from(t.querySelectorAll("[aria-live]"))),b=c.concat(g);RJ(t,NJ(b),new Set(b)).forEach(y=>{const w=y.getAttribute(s),x=w!==null&&w!=="false",k=(h.get(y)||0)+1;h.set(y,k),d.push(y),k===1&&x&&m.add(y),x||y.setAttribute(s,s==="inert"?"":"true")})}return r&&u.forEach(h=>{const m=(hO.get(h)||0)+1;hO.set(h,m),f.push(h),m===1&&h.setAttribute(_J,"")}),F3+=1,()=>{o&&d.forEach(h=>{const g=(o.get(h)||0)-1;o.set(h,g),g||(!(l!=null&&l.has(h))&&s&&h.removeAttribute(s),l==null||l.delete(h))}),r&&f.forEach(h=>{const m=(hO.get(h)||0)-1;hO.set(h,m),m||h.removeAttribute(_J)}),F3-=1,F3||($3.inert=new WeakMap,$3["aria-hidden"]=new WeakMap,sB.inert=new WeakSet,sB["aria-hidden"]=new WeakSet,hO=new WeakMap)}}function IJ(e,t={}){const{ariaHidden:n=!1,inert:i=!1,mark:r=!0}=t,s=Cr(e[0]).body;return drt(e,s,n,i,{mark:r})}function B_e(){const e=new Map;return{emit(t,n){var i;(i=e.get(t))==null||i.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var i;(i=e.get(t))==null||i.delete(n)}}}class frt{constructor(){Zt(this,"nodesRef",{current:[]});Zt(this,"events",B_e())}addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(i=>i===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const U_e=p.createContext(null),Q_e=p.createContext(null),KD=()=>{var e;return((e=p.useContext(U_e))==null?void 0:e.id)||null},W1=e=>{const t=p.useContext(Q_e);return e??t};function hrt(e){const t=KA(),n=W1(e),i=KD();return ti(()=>{if(!t)return;const r={id:t,parentId:i};return n==null||n.addNode(r),()=>{n==null||n.removeNode(r)}},[n,t,i]),t}function prt(e){const{children:t,id:n}=e,i=KD();return a.jsx(U_e.Provider,{value:p.useMemo(()=>({id:n,parentId:i}),[n,i]),children:t})}function mrt(e){const{children:t,externalTree:n}=e,i=Td(()=>n??new frt).current;return a.jsx(Q_e.Provider,{value:i,children:t})}function grt(e,t){const n=ea(fo(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const PJ=20;let pg=[];function oV(){pg=pg.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function DJ(e){oV(),e&&dl(e)!=="body"&&(pg.push(new WeakRef(e)),pg.length>PJ&&(pg=pg.slice(-PJ)))}function MJ(){var e;return oV(),(e=pg[pg.length-1])==null?void 0:e.deref()}function brt(e){return e?Jz(e)?e:qA(e)[0]||e:null}function LJ(e){var r;if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!((r=e.getAttribute("role"))!=null&&r.includes("dialog")))return;const n=f_e(e).filter(s=>{const o=s.getAttribute("data-tabindex")||"";return Jz(s)||s.hasAttribute("data-tabindex")&&!o.startsWith("-")}),i=e.getAttribute("tabindex");n.length===0?i!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(i!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function z_e(e){const{context:t,children:n,disabled:i=!1,initialFocus:r=!0,returnFocus:s=!0,restoreFocus:o=!1,modal:l=!0,closeOnFocusOut:c=!0,openInteractionType:u="",nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:h,externalTree:m,getInsideElements:g}=e,b="rootStore"in t?t.rootStore:t,v=b.useState("open"),y=b.useState("domReferenceElement"),w=b.useState("floatingElement"),{events:x,dataRef:k}=b.context,S=oi(()=>{var Y;return(Y=k.current.floatingContext)==null?void 0:Y.nodeId}),O=r===!1,A=bJ(y)&&O,E=Gl(r),j=Gl(s),T=Gl(u),R=Gl(v),C=W1(m),N=D_e(),P=p.useRef(!1),I=p.useRef(!1),D=p.useRef(!1),_=p.useRef(null),L=p.useRef(""),F=p.useRef(""),M=p.useRef(null),H=p.useRef(null),q=Jw(M,h,N==null?void 0:N.beforeInsideRef),U=Jw(H,N==null?void 0:N.afterInsideRef),Z=ov(),z=ov(),J=Kz(),ne=N!=null,W=yJ(w),X=oi((Y=W)=>Y?qA(Y):[]),le=oi(()=>(g==null?void 0:g().filter(Y=>Y!=null))??[]);p.useEffect(()=>{if(i||!l)return;function Y(ue){ue.key==="Tab"&&ii(W,Sc(Cr(W)))&&X().length===0&&!A&&qnt(ue)}const K=Cr(W);return Di(K,"keydown",Y)},[i,W,l,A,X]),p.useEffect(()=>{if(i||!v)return;const Y=Cr(W);function K(){D.current=!1}function ue(Oe){const fe=fo(Oe),pe=le(),Se=ii(w,fe)||ii(y,fe)||ii(N==null?void 0:N.portalNode,fe)||pe.some(ve=>ve===fe||ii(ve,fe));D.current=!Se,F.current=Oe.pointerType||"keyboard",fe!=null&&fe.closest(`[${aV}]`)&&(I.current=!0,z.start(0,()=>{I.current=!1}))}function te(){F.current="keyboard"}return yh(Di(Y,"pointerdown",ue,!0),Di(Y,"pointerup",K,!0),Di(Y,"pointercancel",K,!0),Di(Y,"keydown",te,!0),K)},[i,w,y,W,v,N,z,le]),p.useEffect(()=>{if(i||!c)return;const Y=Cr(W);function K(){I.current=!0,z.start(0,()=>{I.current=!1})}function ue(pe){const Se=fo(pe);Jz(Se)&&(_.current=Se)}function te(pe){const Se=pe.relatedTarget,ve=pe.currentTarget,Le=fo(pe);l&&Se==null&&Le!=null&&ii(w,Le)&&DJ(Le),queueMicrotask(()=>{const He=S(),Ge=b.context.triggerElements,De=le(),se=(Se==null?void 0:Se.hasAttribute(oI("focus-guard")))&&[M.current,H.current,N==null?void 0:N.beforeInsideRef.current,N==null?void 0:N.afterInsideRef.current,N==null?void 0:N.beforeOutsideRef.current,N==null?void 0:N.afterOutsideRef.current,op(f),op(d)].includes(Se),ce=!(ii(y,Se)||ii(w,Se)||ii(Se,w)||ii(N==null?void 0:N.portalNode,Se)||De.some(ye=>ye===Se||ii(ye,Se))||Ge.hasMatchingElement(ye=>ii(ye,Se))||se||C&&(Gg(C.nodesRef.current,He).find(ye=>{var Ae,Ee;return ii((Ae=ye.context)==null?void 0:Ae.elements.floating,Se)||ii((Ee=ye.context)==null?void 0:Ee.elements.domReference,Se)})||vJ(C.nodesRef.current,He).find(ye=>{var Ae,Ee,Ce;return[(Ae=ye.context)==null?void 0:Ae.elements.floating,yJ((Ee=ye.context)==null?void 0:Ee.elements.floating)].includes(Se)||((Ce=ye.context)==null?void 0:Ce.elements.domReference)===Se})));if(ve===y&&W&&LJ(W),o&&ve!==y&&!s_e(Le)&&Sc(Y)===Y.body){if(Zs(W)&&(W.focus(),o==="popup")){J.request(()=>{W.focus()});return}const ye=X(),Ae=_.current,Ee=(Ae&&ye.includes(Ae)?Ae:null)||ye[ye.length-1]||W;Zs(Ee)&&Ee.focus()}if(k.current.insideReactTree){k.current.insideReactTree=!1;return}(A||!l)&&Se&&ce&&!I.current&&(A||Se!==MJ())&&(P.current=!0,b.setOpen(!1,pa(fC,pe)))})}function Oe(){D.current||(k.current.insideReactTree=!0,Z.start(0,()=>{k.current.insideReactTree=!1}))}const fe=Zs(y)?y:null;if(!(!w&&!fe))return yh(fe&&Di(fe,"focusout",te),fe&&Di(fe,"pointerdown",K),w&&Di(w,"focusin",ue),w&&Di(w,"focusout",te),w&&N&&Di(w,"focusout",Oe,!0))},[i,y,w,W,l,C,N,b,c,o,X,A,S,k,Z,z,J,d,f,le]),p.useEffect(()=>{var ve,Le,He;if(i||!w||!v)return;const Y=Array.from(((ve=N==null?void 0:N.portalNode)==null?void 0:ve.querySelectorAll(`[${oI("portal")}]`))||[]),ue=(He=(Le=(C?vJ(C.nodesRef.current,S()):[]).find(Ge=>{var De;return bJ(((De=Ge.context)==null?void 0:De.elements.domReference)||null)}))==null?void 0:Le.context)==null?void 0:He.elements.domReference,Oe=[...[w,...Y,M.current,H.current,N==null?void 0:N.beforeOutsideRef.current,N==null?void 0:N.afterOutsideRef.current,...le()],ue,op(f),op(d),A?y:null].filter(Ge=>Ge!=null),fe=IJ(Oe,{ariaHidden:l||A,mark:!1}),pe=[w,...Y].filter(Ge=>Ge!=null),Se=IJ(pe);return()=>{Se(),fe()}},[v,i,y,w,l,N,A,C,S,d,f,le]),ti(()=>{if(!v||i||!Zs(W))return;L.current="",F.current="";const Y=Cr(W),K=Sc(Y);queueMicrotask(()=>{const ue=E.current,te=typeof ue=="function"?ue(T.current||""):ue;if(te===void 0||te===!1||ii(W,K))return;let fe=null;const pe=()=>(fe==null&&(fe=X(W)),fe[0]||W);let Se;te===!0||te===null?Se=pe():Se=op(te),Se=Se||pe();const ve=ii(W,Sc(Y));L3(Se,{preventScroll:Se===W,shouldFocus(){if(!R.current)return!1;if(ve)return!0;const Le=Sc(Y);return!(Le!==Se&&ii(W,Le))}})})},[i,v,W,X,E,T,R]),ti(()=>{if(i||!W)return;const Y=Cr(W),K=Sc(Y),ue=T.current==null;DJ(K);function te(fe){if(fe.open||(L.current=grt(fe.nativeEvent,F.current)),fe.reason===vu&&fe.nativeEvent.type==="mouseleave"&&(P.current=!0),fe.reason===j_e)if(fe.nested)P.current=!1;else if(Knt(fe.nativeEvent)||r_e(fe.nativeEvent))P.current=!1;else{let pe=!1;Cr(W).createElement("div").focus({get preventScroll(){return pe=!0,!1}}),pe?P.current=!1:P.current=!0}}x.on("openchange",te);function Oe(fe){const pe=j.current;let Se=typeof pe=="function"?pe(fe):pe;if(Se===void 0||Se===!1)return null;Se===null&&(Se=!0);const ve=y!=null&&y.isConnected?y:null,Le=K!=null&&K.isConnected&&dl(K)!=="body"?K:null;let He=ue?Le||ve:ve||Le;return He||(He=MJ()||null),typeof Se=="boolean"?He:op(Se)||He||null}return()=>{x.off("openchange",te);const fe=Sc(Y),pe=le(),Se=ii(w,fe)||pe.some(Ge=>Ge===fe||ii(Ge,fe))||C&&Gg(C.nodesRef.current,S(),!1).some(Ge=>{var De;return ii((De=Ge.context)==null?void 0:De.elements.floating,fe)}),ve=j.current,Le=L.current,He=Oe(Le);queueMicrotask(()=>{const Ge=brt(He),De=typeof ve!="boolean";if(ve&&!P.current&&Zs(Ge)&&(!(!De&&Ge!==fe&&fe!==Y.body)||Se)){const se={preventScroll:!0};Le==="keyboard"&&(se.focusVisible=!0),Ge.focus(se)}P.current=!1})}},[i,w,W,j,T,x,C,y,S,le]),ti(()=>{if(!q1||v||!w)return;const Y=Sc(Cr(w));!Zs(Y)||!Gz(Y)||ii(w,Y)&&Y.blur()},[v,w]),ti(()=>{if(!(i||!N))return N.setFocusManagerState({modal:l,closeOnFocusOut:c,open:v,onOpenChange:b.setOpen,domReference:y}),()=>{N.setFocusManagerState(null)}},[i,N,l,v,b,c,y]),ti(()=>{if(!(i||!W))return LJ(W),()=>{queueMicrotask(oV)}},[i,W]);const V=!i&&(l?!A:!0)&&(ne||l);return a.jsxs(p.Fragment,{children:[V&&a.jsx(lv,{"data-type":"inside",ref:q,onFocus:Y=>{var K;if(l){const ue=X();L3(ue[ue.length-1])}else if(N!=null&&N.portalNode)if(P.current=!1,aw(Y,N.portalNode)){const ue=eV(y);ue==null||ue.focus()}else(K=op(f??N.beforeOutsideRef))==null||K.focus()}}),n,V&&a.jsx(lv,{"data-type":"inside",ref:U,onFocus:Y=>{var K;if(l)L3(X()[0]);else if(N!=null&&N.portalNode)if(c&&(P.current=!0),aw(Y,N.portalNode)){const ue=p_e(y);ue==null||ue.focus()}else(K=op(d??N.afterOutsideRef))==null||K.focus()}})]})}function V_e(e,t={}){const{enabled:n=!0,event:i="click",toggle:r=!0,ignoreMouse:s=!1,stickIfOpen:o=!0,touchOpenDelay:l=0,reason:c=e1}=t,u="rootStore"in e?e.rootStore:e,d=u.context.dataRef,f=p.useRef(void 0),h=Kz(),m=ov(),g=p.useMemo(()=>{function b(y,w,x,k){const S=pa(c,w,x);y&&k==="touch"&&l>0?m.start(l,()=>{u.setOpen(!0,S)}):u.setOpen(y,S)}function v(y,w,x){const k=d.current.openEvent,S=u.select("domReferenceElement")!==w;return y&&S||!y||!r?!0:k&&o?!x(k.type):!1}return{onPointerDown(y){f.current=sw(y.pointerType,!0)&&r_e(y.nativeEvent)?"virtual":y.pointerType},onMouseDown(y){const w=f.current,x=y.nativeEvent,k=u.select("open");if(y.button!==0||i==="click"||sw(w,!0)&&s)return;const S=v(k,y.currentTarget,E=>E==="click"||E==="mousedown"),O=fo(x);if(Gz(O)){b(S,x,O,w);return}const A=y.currentTarget;h.request(()=>{b(S,x,A,w)})},onClick(y){if(i==="mousedown-only")return;const w=f.current;if(i==="mousedown"&&w){f.current=void 0;return}if(sw(w,!0)&&s)return;const x=u.select("open"),k=v(x,y.currentTarget,S=>S==="click"||S==="mousedown"||S==="keydown"||S==="keyup");b(k,y.nativeEvent,y.currentTarget,w)},onKeyDown(){f.current=void 0}}},[d,i,s,c,u,o,r,h,m,l]);return p.useMemo(()=>n?{reference:g}:Jl,[n,g])}function yrt(){return!1}function vrt(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function H_e(e,t={}){const{enabled:n=!0,escapeKey:i=!0,outsidePress:r=!0,outsidePressEvent:s="sloppy",referencePress:o=yrt,bubbles:l,externalTree:c}=t,u="rootStore"in e?e.rootStore:e,d=u.useState("open"),f=u.useState("floatingElement"),{dataRef:h}=u.context,m=W1(c),g=oi(typeof r=="function"?r:()=>!1),b=typeof r=="function"?g:r,v=b!==!1,y=oi(()=>s),{escapeKey:w,outsidePress:x}=vrt(l),k=p.useRef(!1),S=p.useRef(!1),O=p.useRef(!1),A=p.useRef(!1),E=p.useRef(""),j=p.useRef(null),T=ov(),R=ov(),C=oi(()=>{R.clear(),h.current.insideReactTree=!1}),N=oi(q=>{var z;const U=(z=h.current.floatingContext)==null?void 0:z.nodeId;return(m?Gg(m.nodesRef.current,U):[]).some(J=>{var ne;return((ne=J.context)==null?void 0:ne.open)&&!J.context.dataRef.current[q]})}),P=oi(q=>j3(q,u.select("floatingElement"))||j3(q,u.select("domReferenceElement"))),I=oi(q=>{o()&&u.setOpen(!1,pa(e1,q.nativeEvent))}),D=oi(q=>{if(!d||!n||!i||q.key!=="Escape"||A.current||!w&&N("__escapeKeyBubbles"))return;const U=Wnt(q)?q.nativeEvent:q,Z=pa(R_e,U);u.setOpen(!1,Z),Z.isCanceled||q.preventDefault(),!w&&!Z.isPropagationAllowed&&q.stopPropagation()}),_=oi(()=>{h.current.insideReactTree=!0,R.start(0,C)}),L=oi(q=>{if(!d||!n||q.button!==0)return;const U=fo(q.nativeEvent);ii(u.select("floatingElement"),U)&&(k.current||(k.current=!0,S.current=!1))}),F=oi(q=>{!d||!n||(q.defaultPrevented||q.nativeEvent.defaultPrevented)&&k.current&&(S.current=!0)});p.useEffect(()=>{if(!d||!n)return C;h.current.__escapeKeyBubbles=w,h.current.__outsidePressBubbles=x;const q=new Qu,U=new Qu;function Z(){q.clear(),A.current=!0}function z(){q.start(q1?5:0,()=>{A.current=!1})}function J(){O.current=!0,U.start(0,()=>{O.current=!1})}function ne(){k.current=!1,S.current=!1}function W(){const De=E.current,se=De==="pen"||!De?"mouse":De,ce=y(),ye=typeof ce=="function"?ce():ce;return typeof ye=="string"?ye:ye[se]}function X(De){const se=W();return se==="intentional"&&De.type!=="click"||se==="sloppy"&&De.type==="click"}function le(De){var ye;const se=(ye=h.current.floatingContext)==null?void 0:ye.nodeId,ce=m&&Gg(m.nodesRef.current,se).some(Ae=>{var Ee;return j3(De,(Ee=Ae.context)==null?void 0:Ee.elements.floating)});return P(De)||ce}function V(De){if(X(De)){De.type!=="click"&&!P(De)&&(U.clear(),O.current=!1),C();return}if(h.current.insideReactTree){C();return}const se=fo(De),ce=`[${oI("inert")}]`,ye=Tr(se)?se.getRootNode():null,Ae=Array.from((Zw(ye)?ye:Cr(u.select("floatingElement"))).querySelectorAll(ce)),Ee=u.context.triggerElements;if(se&&(Ee.hasElement(se)||Ee.hasMatchingElement(Be=>ii(Be,se))))return;let Ce=Tr(se)?se:null;for(;Ce&&!Rg(Ce);){const Be=Kg(Ce);if(Rg(Be)||!Tr(Be))break;Ce=Be}if(!(Ae.length&&Tr(se)&&!Vnt(se)&&!ii(se,u.select("floatingElement"))&&Ae.every(Be=>!ii(Ce,Be)))){if(Zs(se)&&!("touches"in De)){const Be=Rg(se),he=Uu(se),ie=/auto|scroll/,we=Be||ie.test(he.overflowX),Re=Be||ie.test(he.overflowY),Ue=we&&se.clientWidth>0&&se.scrollWidth>se.clientWidth,_t=Re&&se.clientHeight>0&&se.scrollHeight>se.clientHeight,Pt=he.direction==="rtl",Gt=_t&&(Pt?De.offsetX<=se.offsetWidth-se.clientWidth:De.offsetX>se.clientWidth),St=Ue&&De.offsetY>se.clientHeight;if(Gt||St)return}if(!le(De)){if(W()==="intentional"&&O.current){U.clear(),O.current=!1;return}typeof b=="function"&&!b(De)||N("__outsidePressBubbles")||(u.setOpen(!1,pa(j_e,De)),C())}}}function Y(De){W()!=="sloppy"||De.pointerType==="touch"||!u.select("open")||!n||P(De)||V(De)}function K(De){if(W()!=="sloppy"||!u.select("open")||!n||P(De))return;const se=De.touches[0];se&&(j.current={startTime:Date.now(),startX:se.clientX,startY:se.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},T.start(1e3,()=>{j.current&&(j.current.dismissOnTouchEnd=!1,j.current.dismissOnMouseDown=!1)}))}function ue(De,se){const ce=fo(De);if(!ce)return;const ye=Di(ce,De.type,()=>{se(De),ye()})}function te(De){E.current="touch",ue(De,K)}function Oe(De){T.clear(),De.type==="pointerdown"&&(E.current=De.pointerType),!(De.type==="mousedown"&&j.current&&!j.current.dismissOnMouseDown)&&ue(De,se=>{se.type==="pointerdown"?Y(se):V(se)})}function fe(De){if(!k.current)return;const se=S.current;if(ne(),W()==="intentional"){if(De.type==="pointercancel"){se&&J();return}if(!le(De)){if(se){J();return}typeof b=="function"&&!b(De)||(U.clear(),O.current=!0,C())}}}function pe(De){if(W()!=="sloppy"||!j.current||P(De))return;const se=De.touches[0];if(!se)return;const ce=Math.abs(se.clientX-j.current.startX),ye=Math.abs(se.clientY-j.current.startY),Ae=Math.sqrt(ce*ce+ye*ye);Ae>5&&(j.current.dismissOnTouchEnd=!0),Ae>10&&(V(De),T.clear(),j.current=null)}function Se(De){ue(De,pe)}function ve(De){W()!=="sloppy"||!j.current||P(De)||(j.current.dismissOnTouchEnd&&V(De),T.clear(),j.current=null)}function Le(De){ue(De,ve)}const He=Cr(f),Ge=yh(i&&yh(Di(He,"keydown",D),Di(He,"compositionstart",Z),Di(He,"compositionend",z)),v&&yh(Di(He,"click",Oe,!0),Di(He,"pointerdown",Oe,!0),Di(He,"pointerup",fe,!0),Di(He,"pointercancel",fe,!0),Di(He,"mousedown",Oe,!0),Di(He,"mouseup",fe,!0),Di(He,"touchstart",te,!0),Di(He,"touchmove",Se,!0),Di(He,"touchend",Le,!0)));return()=>{Ge(),q.clear(),U.clear(),ne(),O.current=!1,C()}},[h,f,i,v,b,d,n,w,x,D,C,y,N,P,m,u,T]);const M=p.useMemo(()=>({onKeyDown:D,onPointerDown:I,onClick:I}),[D,I]),H=p.useMemo(()=>({onKeyDown:D,onPointerDown:F,onMouseDown:F,onClickCapture:_,onMouseDownCapture(q){_(),L(q)},onPointerDownCapture(q){_(),L(q)},onMouseUpCapture:_,onTouchEndCapture:_,onTouchMoveCapture:_}),[D,_,L,F]);return p.useMemo(()=>n?{reference:M,floating:H,trigger:M}:{},[n,M,H])}function $J(e,t,n){let{reference:i,floating:r}=e;const s=pd(t),o=HD(t),l=VD(o),c=kd(t),u=s==="y",d=i.x+i.width/2-r.width/2,f=i.y+i.height/2-r.height/2,h=i[l]/2-r[l]/2;let m;switch(c){case"top":m={x:d,y:i.y-r.height};break;case"bottom":m={x:d,y:i.y+i.height};break;case"right":m={x:i.x+i.width,y:f};break;case"left":m={x:i.x-r.width,y:f};break;default:m={x:i.x,y:i.y}}const g=mm(t);return g&&(m[o]+=h*(g==="end"?1:-1)*(n&&u?-1:1)),m}async function xrt(e,t){var n;t===void 0&&(t={});const{x:i,y:r,platform:s,rects:o,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=Eh(t,e),g=Zz(m),v=l[h?f==="floating"?"reference":"floating":f],y=iI(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),w=f==="floating"?{x:i,y:r,width:o.floating.width,height:o.floating.height}:o.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),k=await(s.isElement==null?void 0:s.isElement(x))&&await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1},S=iI(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:x,strategy:c}):w);return{top:(y.top-S.top+g.top)/k.y,bottom:(S.bottom-y.bottom+g.bottom)/k.y,left:(y.left-S.left+g.left)/k.x,right:(S.right-y.right+g.right)/k.x}}const wrt=50,krt=async(e,t,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:xrt},c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:f}=$J(u,i,c),h=i,m=0;const g={};for(let b=0;b({name:"arrow",options:e,async fn(t){const{x:n,y:i,placement:r,rects:s,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=Eh(e,t)||{};if(u==null)return{};const f=Zz(d),h={x:n,y:i},m=HD(r),g=VD(m),b=await o.getDimensions(u),v=m==="y",y=v?"top":"left",w=v?"bottom":"right",x=v?"clientHeight":"clientWidth",k=s.reference[g]+s.reference[m]-h[m]-s.floating[g],S=h[m]-s.reference[m],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let A=O?O[x]:0;(!A||!await(o.isElement==null?void 0:o.isElement(O)))&&(A=l.floating[x]||s.floating[g]);const E=k/2-S/2,j=A/2-b[g]/2-1,T=Xg(f[y],j),R=Xg(f[w],j),C=A-b[g]-R,N=A/2-b[g]/2+E,P=Xz(T,N,C),I=!c.arrow&&mm(r)!=null&&N!==P&&s.reference[g]/2-(NP<=0)){var R,C;const P=(((R=s.flip)==null?void 0:R.index)||0)+1,I=A[P];if(I&&(!(f==="alignment"?w!==pd(I):!1)||T.every(L=>pd(L.placement)===w?L.overflows[0]>0:!0)))return{data:{index:P,overflows:T},reset:{placement:I}};let D=(C=T.filter(_=>_.overflows[0]<=0).sort((_,L)=>_.overflows[1]-L.overflows[1])[0])==null?void 0:C.placement;if(!D)switch(m){case"bestFit":{var N;const _=(N=T.filter(L=>{if(O){const F=pd(L.placement);return F===w||F==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(F=>F>0).reduce((F,M)=>F+M,0)]).sort((L,F)=>L[1]-F[1])[0])==null?void 0:N[0];_&&(D=_);break}case"initialPlacement":D=l;break}if(r!==D)return{reset:{placement:D}}}return{}}}};function FJ(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function BJ(e){return Xnt.some(t=>e[t]>=0)}const Ert=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:i}=t,{strategy:r="referenceHidden",...s}=Eh(e,t);switch(r){case"referenceHidden":{const o=await i.detectOverflow(t,{...s,elementContext:"reference"}),l=FJ(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:BJ(l)}}}case"escaped":{const o=await i.detectOverflow(t,{...s,altBoundary:!0}),l=FJ(o,n.floating);return{data:{escapedOffsets:l,escaped:BJ(l)}}}default:return{}}}}},q_e=new Set(["left","top"]);async function Crt(e,t){const{placement:n,platform:i,elements:r}=e,s=await(i.isRTL==null?void 0:i.isRTL(r.floating)),o=kd(n),l=mm(n),c=pd(n)==="y",u=q_e.has(o)?-1:1,d=s&&c?-1:1,f=Eh(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof g=="number"&&(m=l==="end"?g*-1:g),c?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const Art=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,i;const{x:r,y:s,placement:o,middlewareData:l}=t,c=await Crt(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(i=l.arrow)!=null&&i.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:o}}}}},Trt=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:i,placement:r,platform:s}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:c={fn:w=>{let{x,y:k}=w;return{x,y:k}}},...u}=Eh(e,t),d={x:n,y:i},f=await s.detectOverflow(t,u),h=pd(r),m=Yz(h);let g=d[m],b=d[h];const v=(w,x)=>Xz(x+f[w==="y"?"top":"left"],x,x-f[w==="y"?"bottom":"right"]);o&&(g=v(m,g)),l&&(b=v(h,b));const y=c.fn({...t,[m]:g,[h]:b});return{...y,data:{x:y.x-n,y:y.y-i,enabled:{[m]:o,[h]:l}}}}}},_rt=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,i;const{x:r,y:s,placement:o,rects:l,middlewareData:c}=t,{offset:u=0,mainAxis:d=!0,crossAxis:f=!0}=Eh(e,t),h={x:r,y:s},m=pd(o),g=Yz(m);let b=h[g],v=h[m];const y=Eh(u,t),w=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:(n=y.mainAxis)!=null?n:0,crossAxis:(i=y.crossAxis)!=null?i:0};if(d){const S=g==="y"?"height":"width",O=l.reference[g]-l.floating[S]+w.mainAxis,A=l.reference[g]+l.reference[S]-w.mainAxis;bA&&(b=A)}if(f){var x,k;const S=g==="y"?"width":"height",O=q_e.has(kd(o)),A=l.reference[m]-l.floating[S]+(O&&((x=c.offset)==null?void 0:x[m])||0)+(O?0:w.crossAxis),E=l.reference[m]+l.reference[S]+(O?0:((k=c.offset)==null?void 0:k[m])||0)-(O?w.crossAxis:0);vE&&(v=E)}return{[g]:b,[m]:v}}}},jrt=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:i,platform:r,elements:s}=t,{apply:o=()=>{},...l}=Eh(e,t),c=await r.detectOverflow(t,l),u=kd(n),d=mm(n),f=pd(n)==="y",{width:h,height:m}=i.floating;let g,b;u==="top"||u==="bottom"?(g=u,b=d===(await(r.isRTL==null?void 0:r.isRTL(s.floating))?"start":"end")?"left":"right"):(b=u,g=d==="end"?"top":"bottom");const v=m-c.top-c.bottom,y=h-c.left-c.right,w=Xg(m-c[g],v),x=Xg(h-c[b],y),k=t.middlewareData.shift,S=!k;let O=w,A=x;k!=null&&k.enabled.x&&(A=y),k!=null&&k.enabled.y&&(O=v),S&&!d&&(f?A=h-2*Dp(c.left,c.right):O=m-2*Dp(c.top,c.bottom)),await o({...t,availableWidth:A,availableHeight:O});const E=await r.getDimensions(s.floating);return h!==E.width||m!==E.height?{reset:{rects:!0}}:{}}}};function W_e(e){const t=Uu(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const r=Zs(e),s=r?e.offsetWidth:n,o=r?e.offsetHeight:i,l=tI(n)!==s||tI(i)!==o;return l&&(n=s,i=o),{width:n,height:i,$:l}}function lV(e){return Tr(e)?e:e.contextElement}function ow(e){const t=lV(e);if(!Zs(t))return Mp(1);const n=t.getBoundingClientRect(),{width:i,height:r,$:s}=W_e(t);let o=(s?tI(n.width):n.width)/i,l=(s?tI(n.height):n.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const Nrt=Mp(0);function K_e(e){const t=ea(e);return!Wz()||!t.visualViewport?Nrt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Rrt(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ea(e)}function cv(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=lV(e);let o=Mp(1);t&&(i?Tr(i)&&(o=ow(i)):o=ow(e));const l=Rrt(s,n,i)?K_e(s):Mp(0);let c=(r.left+l.x)/o.x,u=(r.top+l.y)/o.y,d=r.width/o.x,f=r.height/o.y;if(s&&i){const h=ea(s),m=Tr(i)?ea(i):i;let g=h,b=Y8(g);for(;b&&m!==g;){const v=ow(b),y=b.getBoundingClientRect(),w=Uu(b),x=y.left+(b.clientLeft+parseFloat(w.paddingLeft))*v.x,k=y.top+(b.clientTop+parseFloat(w.paddingTop))*v.y;c*=v.x,u*=v.y,d*=v.x,f*=v.y,c+=x,u+=k,g=ea(b),b=Y8(g)}}return iI({width:d,height:f,x:c,y:u})}function GD(e,t){const n=UD(e).scrollLeft;return t?t.left+n:cv(pm(e)).left+n}function G_e(e,t){const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-GD(e,n),r=n.top+t.scrollTop;return{x:i,y:r}}function Irt(e){let{elements:t,rect:n,offsetParent:i,strategy:r}=e;const s=r==="fixed",o=pm(i),l=t?BD(t.floating):!1;if(i===o||l&&s)return n;let c={scrollLeft:0,scrollTop:0},u=Mp(1);const d=Mp(0),f=Zs(i);if((f||!s)&&((dl(i)!=="body"||HA(o))&&(c=UD(i)),f)){const m=cv(i);u=ow(i),d.x=m.x+i.clientLeft,d.y=m.y+i.clientTop}const h=o&&!f&&!s?G_e(o,c):Mp(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+h.x,y:n.y*u.y-c.scrollTop*u.y+d.y+h.y}}function Prt(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Drt(e){const t=UD(e),n=e.ownerDocument.body,i=Dp(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=Dp(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-t.scrollLeft+GD(e);const o=-t.scrollTop;return Uu(n).direction==="rtl"&&(s+=Dp(e.clientWidth,n.clientWidth)-i),{width:i,height:r,x:s,y:o}}const Mrt=25;function Lrt(e,t,n){n===void 0&&(n="viewport");const i=n==="layoutViewport",r=ea(e),s=pm(e),o=r.visualViewport;let l=s.clientWidth,c=s.clientHeight,u=0,d=0;if(o){const h=!Wz()||t==="fixed";i?h||(u=-o.offsetLeft,d=-o.offsetTop):(l=o.width,c=o.height,h&&(u=o.offsetLeft,d=o.offsetTop))}if(GD(s)<=0){const h=s.ownerDocument,m=h.body,g=getComputedStyle(m),b=h.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,v=Math.abs(s.clientWidth-m.clientWidth-b),y=getComputedStyle(s).scrollbarGutter==="stable both-edges"?v/2:v;y<=Mrt&&(l-=y)}return{width:l,height:c,x:u,y:d}}function $rt(e,t){const n=cv(e,!0,t==="fixed"),i=n.top+e.clientTop,r=n.left+e.clientLeft,s=ow(e),o=e.clientWidth*s.x,l=e.clientHeight*s.y,c=r*s.x,u=i*s.y;return{width:o,height:l,x:c,y:u}}function UJ(e,t,n){let i;if(t==="viewport"||t==="layoutViewport")i=Lrt(e,n,t);else if(t==="document")i=Drt(pm(e));else if(Tr(t))i=$rt(t,n);else{const r=K_e(e);i={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return iI(i)}function Frt(e,t){const n=t.get(e);if(n)return n;let i=uC(e,[],!1).filter(l=>Tr(l)&&dl(l)!=="body"),r=null;const s=Uu(e).position==="fixed";let o=s?Kg(e):e;for(;Tr(o)&&!Rg(o);){const l=Uu(o),c=qz(o),u=r?r.position:s?"fixed":"";!c&&(u==="fixed"||u==="absolute"&&l.position==="static")?i=i.filter(f=>f!==o):r=l,o=Kg(o)}return t.set(e,i),i}function Brt(e){let{element:t,boundary:n,rootBoundary:i,strategy:r}=e;const o=[...n==="clippingAncestors"?BD(t)?[]:Frt(t,this._c):[].concat(n),i],l=UJ(t,o[0],r);let c=l.top,u=l.right,d=l.bottom,f=l.left;for(let h=1;h{l(!1,1e-7)},1e3)}A=!1}try{i=new IntersectionObserver(E,{...O,root:s.ownerDocument})}catch{i=new IntersectionObserver(E,O)}i.observe(e)}const c=ea(e),u=()=>l(n);return c.addEventListener("resize",u),l(!0),()=>{c.removeEventListener("resize",u),o()}}function aB(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=i,u=lV(e),d=r||s?[...u?uC(u):[],...t?uC(t):[]]:[];d.forEach(y=>{r&&y.addEventListener("scroll",n),s&&y.addEventListener("resize",n)});const f=u&&l?qrt(u,n,s):null;let h=-1,m=null;o&&(m=new ResizeObserver(y=>{let[w]=y;w&&w.target===u&&m&&t&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),n()}),u&&!c&&m.observe(u),t&&m.observe(t));let g,b=c?cv(e):null;c&&v();function v(){const y=cv(e);b&&!Y_e(b,y)&&n(),b=y,g=requestAnimationFrame(v)}return n(),()=>{var y;d.forEach(w=>{r&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),f==null||f(),(y=m)==null||y.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const Wrt=Art,Krt=Trt,Grt=Srt,Xrt=jrt,Yrt=Ert,zJ=Ort,Zrt=_rt,Jrt=(e,t,n)=>{const i=new Map,r=n??{},s={...Hrt,...r.platform,_c:i};return krt(e,t,{...r,platform:s})};var est=typeof document<"u",tst=function(){},pN=est?p.useLayoutEffect:tst;function lI(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,i,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(i=n;i--!==0;)if(!lI(e[i],t[i]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(t,r[i]))return!1;for(i=n;i--!==0;){const s=r[i];if(!(s==="_owner"&&e.$$typeof)&&!lI(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Z_e(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function VJ(e,t){const n=Z_e(e);return Math.round(t*n)/n}function U3(e){const t=p.useRef(e);return pN(()=>{t.current=e}),t}function J_e(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:i=[],platform:r,elements:{reference:s,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=p.useState(i);lI(h,i)||m(i);const[g,b]=p.useState(null),[v,y]=p.useState(null),w=p.useCallback(L=>{L!==O.current&&(O.current=L,b(L))},[]),x=p.useCallback(L=>{L!==A.current&&(A.current=L,y(L))},[]),k=s||g,S=o||v,O=p.useRef(null),A=p.useRef(null),E=p.useRef(d),j=c!=null,T=U3(c),R=U3(r),C=U3(u),N=p.useCallback(()=>{if(!O.current||!A.current)return;const L={placement:t,strategy:n,middleware:h};R.current&&(L.platform=R.current),Jrt(O.current,A.current,L).then(F=>{const M={...F,isPositioned:C.current!==!1};P.current&&!lI(E.current,M)&&(E.current=M,vi.flushSync(()=>{f(M)}))})},[h,t,n,R,C]);pN(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(L=>({...L,isPositioned:!1})))},[u]);const P=p.useRef(!1);pN(()=>(P.current=!0,()=>{P.current=!1}),[]),pN(()=>{if(k&&(O.current=k),S&&(A.current=S),k&&S){if(T.current)return T.current(k,S,N);N()}},[k,S,N,T,j]);const I=p.useMemo(()=>({reference:O,floating:A,setReference:w,setFloating:x}),[w,x]),D=p.useMemo(()=>({reference:k,floating:S}),[k,S]),_=p.useMemo(()=>{const L={position:n,left:0,top:0};if(!D.floating)return L;const F=VJ(D.floating,d.x),M=VJ(D.floating,d.y);return l?{...L,transform:"translate("+F+"px, "+M+"px)",...Z_e(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:M}},[n,l,D.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:N,refs:I,elements:D,floatingStyles:_}),[d,N,I,D,_])}const nst=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:i,padding:r}=typeof e=="function"?e(n):e;return i&&t(i)?i.current!=null?zJ({element:i.current,padding:r}).fn(n):{}:i?zJ({element:i,padding:r}).fn(n):{}}}},eje=(e,t)=>{const n=Wrt(e);return{name:n.name,fn:n.fn,options:[e,t]}},tje=(e,t)=>{const n=Krt(e);return{name:n.name,fn:n.fn,options:[e,t]}},nje=(e,t)=>({fn:Zrt(e).fn,options:[e,t]}),ije=(e,t)=>{const n=Grt(e);return{name:n.name,fn:n.fn,options:[e,t]}},rje=(e,t)=>{const n=Xrt(e);return{name:n.name,fn:n.fn,options:[e,t]}},ist=(e,t)=>{const n=Yrt(e);return{name:n.name,fn:n.fn,options:[e,t]}},rst=(e,t)=>{const n=nst(e);return{name:n.name,fn:n.fn,options:[e,t]}},sst={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class cV extends $D{constructor(n){const{syncOnly:i,nested:r,onOpenChange:s,triggerElements:o,...l}=n;super({...l,positionReference:l.referenceElement,domReferenceElement:l.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:B_e(),nested:r,triggerElements:o},sst);Zt(this,"syncOpenEvent",(n,i)=>{(!n||!this.state.open||i!=null&&Gnt(i))&&(this.context.dataRef.current.openEvent=n?i:void 0)});Zt(this,"dispatchOpenChange",(n,i)=>{this.syncOpenEvent(n,i.event);const r={open:n,reason:i.reason,nativeEvent:i.event,nested:this.context.nested,triggerElement:i.trigger};this.context.events.emit("openchange",r)});Zt(this,"setOpen",(n,i)=>{var r,s,o,l;if(this.syncOnly){(s=(r=this.context).onOpenChange)==null||s.call(r,n,i);return}this.dispatchOpenChange(n,i),(l=(o=this.context).onOpenChange)==null||l.call(o,n,i)});this.syncOnly=i}}function ast(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:i,floatingId:r,nested:s,onOpenChange:o}=e,l=t.useState("open"),c=t.useState("activeTriggerElement"),u=t.useState(n?"popupElement":"positionerElement"),d=t.context.triggerElements,f=o,h=p.useRef(null);i===void 0&&h.current===null&&(h.current=new cV({open:l,transitionStatus:void 0,referenceElement:c,floatingElement:u,triggerElements:d,onOpenChange:f,floatingId:r,syncOnly:!0,nested:s}));const m=i??h.current;return t.useSyncedValue("floatingId",r),ti(()=>{const g={open:l,floatingId:r,referenceElement:c,floatingElement:u};Tr(c)&&(g.domReferenceElement=c),m.state.positionReference===m.state.referenceElement&&(g.positionReference=c),m.update(g)},[l,r,c,u,m]),m.context.onOpenChange=f,m.context.nested=s,m}function sje(e,t=!1,n=!1){const[i,r]=p.useState(e&&t?"idle":void 0),[s,o]=p.useState(e);return e&&!s&&(o(!0),r("starting")),!e&&s&&i!=="ending"&&!n&&r("ending"),!e&&!s&&i==="ending"&&r(void 0),ti(()=>{if(!e&&s&&i!=="ending"&&n){const l=Cc.request(()=>{r("ending")});return()=>{Cc.cancel(l)}}},[e,s,i,n]),ti(()=>{if(!e||t)return;const l=Cc.request(()=>{r(void 0)});return()=>{Cc.cancel(l)}},[t,e]),ti(()=>{if(!e||!t)return;e&&s&&i!=="idle"&&r("starting");const l=Cc.request(()=>{r("idle")});return()=>{Cc.cancel(l)}},[t,e,s,i]),{mounted:s,setMounted:o,transitionStatus:i}}const aje={tabIndex:-1,[J8]:""};function oje(e){return t=>t==="touch"?e.current:!0}function lje(e,t=!1){const n=KA(),i=KD()!=null,r=Td(()=>e(n,i)).current;return ast({popupStore:r,treatPopupAsFloatingElement:t,floatingRootContext:r.state.floatingRootContext,floatingId:n,nested:i,onOpenChange:r.setOpen}),r}function cje({handle:e,store:t}){return ti(()=>e.attachStore(t),[e,t]),null}function ost(e,t){const n=p.useRef(null),i=p.useRef(null);return p.useCallback(r=>{if(e===void 0)return;let s=!1;if(n.current!==null){const o=n.current,l=i.current,c=t.context.triggerElements.getById(o);l&&c===l&&(t.context.triggerElements.delete(o),s=!0),n.current=null,i.current=null}if(r!==null&&(n.current=e,i.current=r,t.context.triggerElements.add(e,r),s=!0),s){const o=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==o&&t.set("triggerCount",o)}},[t,e])}function uje(e,t,n,i=!1){t?e.preventUnmountingOnClose=!1:i&&(e.preventUnmountingOnClose=!0);const r=(n==null?void 0:n.id)??null;(r||t)&&(e.activeTriggerId=r,e.activeTriggerElement=n??null)}function lst(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function dje(e,t,n,i){const r=n.useState("isMountedByTrigger",e),s=ost(e,n),o=oi(c=>{const u=n.select("open"),d=n.select("activeTriggerId");if(d===e){n.update({activeTriggerElement:c,...u?i:null});return}d==null&&u&&n.update({activeTriggerId:e,activeTriggerElement:c,...i})}),l=p.useCallback(c=>{s(c),c&&o(c)},[s,o]);return ti(()=>{r&&n.update({activeTriggerElement:t.current,...i})},[r,n,t,...Object.values(i)]),{registerTrigger:l,isMountedByThisTrigger:r}}function fje(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,i=p.useRef(null),r=e.useState("open"),s=e.useState("triggerCount"),o=e.useState("activeTriggerId"),l=e.useState("activeTriggerElement");ti(()=>{if(!r){i.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const c=e.context.triggerElements.size,u={};e.state.triggerCount!==c&&(u.triggerCount=c);const d=e.select("activeTriggerId");let f=null;if(d){const h=e.context.triggerElements.getById(d);if(h)i.current=d,h!==e.state.activeTriggerElement&&(u.activeTriggerElement=h);else{for(const[m,g]of e.context.triggerElements.entries())if(g===e.state.activeTriggerElement){u.activeTriggerId=m,u.activeTriggerElement=g,i.current=m;break}u.activeTriggerId===void 0&&(i.current===d?f=d:i.current=null)}}else i.current=null;if(!f&&!d&&c===1){const h=e.context.triggerElements.entries().next();if(!h.done){const[m,g]=h.value;u.activeTriggerId=m,u.activeTriggerElement=g,i.current=m}}(u.triggerCount!==void 0||u.activeTriggerId!==void 0||u.activeTriggerElement!==void 0)&&e.update(u),f&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===f&&!e.context.triggerElements.getById(f)){const h=pa(__e);e.setOpen(!1,h),h.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[r,e,s,o,l,n])}function hje(e,t,n){const{mounted:i,setMounted:r,transitionStatus:s}=sje(e),o=t.useState("preventUnmountingOnClose"),l=e?!1:o;t.useSyncedValues({mounted:i,transitionStatus:s,preventUnmountingOnClose:l});const c=oi(()=>{var u,d;r(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n==null||n(),(d=(u=t.context).onOpenChangeComplete)==null||d.call(u,!1)});return WA({enabled:i&&!e&&!l,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:s}}function pje(e,t){e.useSyncedValues(t),ti(()=>()=>{e.update({activeTriggerProps:Jl,inactiveTriggerProps:Jl,popupProps:Jl})},[e])}function mje(e,t){ti(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),ti(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class uV{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function cst(){return new cV({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new uV,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function gje(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:cst(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Jl,inactiveTriggerProps:Jl,popupProps:Jl}}function bje(e,t,n=!1){return new cV({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}const rE=e=>e.triggerIdProp??e.activeTriggerId,dV=e=>e.openProp??e.open,HJ=e=>{var n;return(((n=e.popupElement)==null?void 0:n.id)??e.floatingId)||void 0};function yje(e,t){return t!==void 0&&dV(e)&&rE(e)===t}function ust(e,t){return yje(e,t)?!0:t!==void 0&&dV(e)&&rE(e)==null&&e.triggerCount===1}const vje={open:dV,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:rE,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:HJ,isTriggerActive:(e,t)=>t!==void 0&&rE(e)===t,isOpenedByTrigger:(e,t)=>yje(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&rE(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>ust(e,t)?HJ(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function xje(e){const t=p.useCallback(i=>e===void 0?Uz:e.subscribeStore(i),[e]),n=p.useCallback(()=>e===void 0?void 0:e.store,[e]);return XP.useSyncExternalStore(t,n,()=>e==null?void 0:e.serverStore)}function dst(e){return fst(e,e.rootContext)}function fst(e,t){const{nodeId:n,externalTree:i}=e,r=t.useState("referenceElement"),s=t.useState("floatingElement"),o=t.useState("domReferenceElement"),l=t.useState("open"),c=t.useState("floatingId"),[u,d]=p.useState(null),[f,h]=p.useState(void 0),[m,g]=p.useState(void 0),b=p.useRef(null),v=W1(i),y=p.useMemo(()=>({reference:r,floating:s,domReference:o}),[r,s,o]),w=J_e({...e,elements:{...y,...u&&{reference:u}}}),x=Tr(f)?f:null,k=m===void 0?t.state.floatingElement:m;t.useSyncedValue("referenceElement",f??null),t.useSyncedValue("domReferenceElement",f===void 0?o:x),t.useSyncedValue("floatingElement",k);const S=p.useCallback(R=>{const C=Tr(R)?{getBoundingClientRect:()=>R.getBoundingClientRect(),getClientRects:()=>R.getClientRects(),contextElement:R}:R;d(C),w.refs.setReference(C)},[w.refs]),O=p.useCallback(R=>{(Tr(R)||R===null)&&(b.current=R,h(R)),(Tr(w.refs.reference.current)||w.refs.reference.current===null||R!==null&&!Tr(R))&&w.refs.setReference(R)},[w.refs,h]),A=p.useCallback(R=>{g(R),w.refs.setFloating(R)},[w.refs]),E=p.useMemo(()=>({...w.refs,setReference:O,setFloating:A,setPositionReference:S,domReference:b}),[w.refs,O,A,S]),j=p.useMemo(()=>({...w.elements,domReference:o}),[w.elements,o]),T=p.useMemo(()=>({...w,dataRef:t.context.dataRef,open:l,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:E,elements:j,nodeId:n,rootStore:t}),[w,E,j,n,t,l,c]);return ti(()=>{o&&(b.current=o)},[o]),ti(()=>{t.context.dataRef.current.floatingContext=T;const R=v==null?void 0:v.nodesRef.current.find(C=>C.id===n);R&&(R.context=T)}),p.useMemo(()=>({...w,context:T,refs:E,elements:j,rootStore:t}),[w,E,j,T,t])}class fV{constructor(){Zt(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});Zt(this,"disposeEffect",()=>this.dispose);this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Qu,this.restTimeout=new Qu,this.handleCloseOptions=void 0}static create(){return new fV}}const cI=new WeakMap;function uI(e){var n,i,r;if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&cI.get(t)===e&&((n=e.pointerEventsScopeElement)==null||n.style.removeProperty("pointer-events"),(i=e.pointerEventsReferenceElement)==null||i.style.removeProperty("pointer-events"),(r=e.pointerEventsFloatingElement)==null||r.style.removeProperty("pointer-events"),cI.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function wje(e,t){const{scopeElement:n,referenceElement:i,floatingElement:r}=t,s=cI.get(n);s&&s!==e&&uI(s),uI(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=i,e.pointerEventsFloatingElement=r,cI.set(n,e),n.style.pointerEvents="none",i.style.pointerEvents="auto",r.style.pointerEvents="auto"}function kje(e){const t=e.context.dataRef.current,n=Td(()=>t.hoverInteractionState??fV.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),MD(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function hst(e,t={}){const{enabled:n=!0,closeDelay:i=0,nodeId:r}=t,s="rootStore"in e?e.rootStore:e,o=s.useState("open"),l=s.useState("floatingElement"),c=s.useState("domReferenceElement"),{dataRef:u}=s.context,d=W1(),f=KD(),h=kje(s),m=ov(),g=oi(()=>{var y;return $_e((y=u.current.openEvent)==null?void 0:y.type,h.interactedInside)}),b=oi(()=>{var y;return crt((y=u.current.openEvent)==null?void 0:y.type)}),v=oi(()=>{uI(h)});ti(()=>{o||(h.pointerType=void 0,h.restTimeoutPending=!1,h.interactedInside=!1,v())},[o,h,v]),p.useEffect(()=>v,[v]),ti(()=>{var y,w,x,k,S;if(n&&o&&(y=h.handleCloseOptions)!=null&&y.blockPointerEvents&&b()&&Tr(c)&&l){const O=c,A=l,E=Cr(l),j=(x=(w=d==null?void 0:d.nodesRef.current.find(N=>N.id===f))==null?void 0:w.context)==null?void 0:x.elements.floating;j&&(j.style.pointerEvents="");const T=h.pointerEventsScopeElement!==A?h.pointerEventsScopeElement:null,R=j!==A?j:null,C=((S=(k=h.handleCloseOptions)==null?void 0:k.getScope)==null?void 0:S.call(k))??T??R??O.closest("[data-rootownerid]")??E.body;return wje(h,{scopeElement:C,referenceElement:O,floatingElement:A}),()=>{v()}}},[n,o,c,l,h,b,d,f,v]),p.useEffect(()=>{if(!n)return;function y(){return!!(d&&f&&Gg(d.nodesRef.current,f).length>0)}function w(E){const j=rB(i,"close",h.pointerType),T=()=>{s.setOpen(!1,pa(vu,E)),d==null||d.events.emit("floating.closed",E)};j?h.openChangeTimeout.start(j,T):(h.openChangeTimeout.clear(),T())}function x(E){const j=fo(E);if(!Hnt(j)){h.interactedInside=!1;return}h.interactedInside=(j==null?void 0:j.closest("[aria-haspopup]"))!=null}function k(){h.openChangeTimeout.clear(),m.clear(),d==null||d.events.off("floating.closed",O),v()}function S(E){var C;if(y()&&d){d.events.on("floating.closed",O);return}if(i_e(E.relatedTarget,s.context.triggerElements))return;const j=((C=u.current.floatingContext)==null?void 0:C.nodeId)??r,T=E.relatedTarget;if(!(d&&j&&Tr(T)&&Gg(d.nodesRef.current,j,!1).some(N=>{var P;return ii((P=N.context)==null?void 0:P.elements.floating,T)}))){if(h.handler){h.handler(E);return}v(),b()&&!g()&&w(E)}}function O(E){!d||!f||y()||m.start(0,()=>{d.events.off("floating.closed",O),s.setOpen(!1,pa(vu,E)),d.events.emit("floating.closed",E)})}const A=l;return yh(A&&Di(A,"mouseenter",k),A&&Di(A,"mouseleave",S),A&&Di(A,"pointerdown",x,!0),()=>{d==null||d.events.off("floating.closed",O)})},[n,l,s,u,i,r,b,g,v,h,d,f,m])}const pst={current:null};function mst(e,t={}){var D;const{enabled:n=!0,delay:i=0,handleClose:r=null,mouseOnly:s=!1,restMs:o=0,move:l=!0,triggerElementRef:c=pst,externalTree:u,isActiveTrigger:d=!0,getHandleCloseContext:f,isClosing:h,shouldOpen:m,guardStaleOpen:g=!1}=t,b="rootStore"in e?e.rootStore:e,{dataRef:v,events:y}=b.context,w=W1(u),x=kje(b),k=p.useRef(!1),S=Gl(r),O=Gl(i),A=Gl(o),E=Gl(n),j=Gl(m),T=Gl(h),R=oi(()=>{var _;return $_e((_=v.current.openEvent)==null?void 0:_.type,x.interactedInside)}),C=oi(()=>{var _;return((_=j.current)==null?void 0:_.call(j))!==!1}),N=oi((_,L,F)=>{const M=b.context.triggerElements;if(M.hasElement(L))return!_||!ii(_,L);if(!Tr(F))return!1;const H=F;return M.hasMatchingElement(q=>ii(q,H))&&(!_||!ii(_,H))}),P=oi(()=>{if(!x.handler)return;Cr(b.select("domReferenceElement")).removeEventListener("mousemove",x.handler),x.handler=void 0}),I=oi(()=>{uI(x)});return d&&(x.handleCloseOptions=(D=S.current)==null?void 0:D.__options),p.useEffect(()=>P,[P]),p.useEffect(()=>{if(!n)return;function _(L){L.open?k.current=!1:(k.current=L.reason===vu,P(),x.openChangeTimeout.clear(),x.restTimeout.clear(),x.blockMouseMove=!0,x.restTimeoutPending=!1)}return y.on("openchange",_),()=>{y.off("openchange",_)}},[n,y,x,P]),p.useEffect(()=>{if(!n)return;function _(U,Z=!0){const z=rB(O.current,"close",x.pointerType);z?x.openChangeTimeout.start(z,()=>{b.setOpen(!1,pa(vu,U)),w==null||w.events.emit("floating.closed",U)}):Z&&(x.openChangeTimeout.clear(),b.setOpen(!1,pa(vu,U)),w==null||w.events.emit("floating.closed",U))}const L=c.current??(d?b.select("domReferenceElement"):null);if(!Tr(L))return;function F(U){var pe;if(x.openChangeTimeout.clear(),x.blockMouseMove=!1,s&&!sw(x.pointerType))return;const Z=TJ(A.current),z=rB(O.current,"open",x.pointerType),J=fo(U),ne=U.currentTarget??null,W=b.select("domReferenceElement");let X=ne;if(Tr(J)&&!b.context.triggerElements.hasElement(J)){for(const Se of b.context.triggerElements.elements())if(ii(Se,J)){X=Se;break}}Tr(ne)&&Tr(W)&&!b.context.triggerElements.hasElement(ne)&&ii(ne,W)&&(X=W);const le=X==null?!1:N(W,X,J),V=b.select("open"),Y=((pe=T.current)==null?void 0:pe.call(T))??b.select("transitionStatus")==="ending",K=!V&&Y&&k.current,ue=!le&&Tr(X)&&Tr(W)&&ii(W,X)&&K,te=Z>0&&!z,Oe=le&&(V||K)||ue,fe=!V||le;if(Oe){C()&&b.setOpen(!0,pa(vu,U,X));return}te||(z?x.openChangeTimeout.start(z,()=>{fe&&C()&&b.setOpen(!0,pa(vu,U,X))}):fe&&C()&&b.setOpen(!0,pa(vu,U,X)))}function M(U){if(R()){I();return}P();const Z=b.select("domReferenceElement"),z=Cr(Z);x.restTimeout.clear(),x.restTimeoutPending=!1;const J=v.current.floatingContext??(f==null?void 0:f());if(i_e(U.relatedTarget,b.context.triggerElements))return;if(S.current&&J){b.select("open")||x.openChangeTimeout.clear();const W=c.current;x.handler=S.current({...J,tree:w,x:U.clientX,y:U.clientY,onClose(){I(),P(),E.current&&!R()&&W===b.select("domReferenceElement")&&_(U,!0)}}),z.addEventListener("mousemove",x.handler),x.handler(U);return}(x.pointerType==="touch"?!ii(b.select("floatingElement"),U.relatedTarget):!0)&&_(U)}function H(U){ii(L,U.relatedTarget)||(x.openChangeTimeout.clear(),x.restTimeout.clear(),x.restTimeoutPending=!1)}const q=g?Di(L,"mouseout",H):void 0;return l?yh(Di(L,"mousemove",F,{once:!0}),Di(L,"mouseenter",F),Di(L,"mouseleave",M),q):yh(Di(L,"mouseenter",F),Di(L,"mouseleave",M),q)},[P,I,v,O,b,n,S,x,d,N,R,s,l,A,c,w,E,f,T,C,g]),p.useMemo(()=>{if(!n)return;function _(L){x.pointerType=L.pointerType}return{onPointerDown:_,onPointerEnter:_,onMouseMove(L){var J,ne,W;const{nativeEvent:F}=L,M=L.currentTarget,H=b.select("domReferenceElement"),q=b.select("open"),U=N(H,M,L.target);if(s&&!sw(x.pointerType))return;if(q&&U&&((J=x.handleCloseOptions)!=null&&J.blockPointerEvents)){const X=b.select("floatingElement");if(X){const le=((W=(ne=x.handleCloseOptions)==null?void 0:ne.getScope)==null?void 0:W.call(ne))??M.ownerDocument.body;wje(x,{scopeElement:le,referenceElement:M,floatingElement:X})}}const Z=TJ(A.current);if(q&&!U||Z===0||!U&&x.restTimeoutPending&&L.movementX**2+L.movementY**2<2)return;x.restTimeout.clear();function z(){if(x.restTimeoutPending=!1,R())return;const X=b.select("open");!x.blockMouseMove&&(!X||U)&&C()&&b.setOpen(!0,pa(vu,F,M))}x.pointerType==="touch"?vi.flushSync(()=>{z()}):U&&q?z():(x.restTimeoutPending=!0,x.restTimeout.start(Z,z))}}},[n,x,R,N,s,b,A,C])}const qJ=.1,gst=qJ*qJ,Kr=.5;function n_(e,t,n,i,r,s){return i>=t!=s>=t&&e<=(r-n)*(t-i)/(s-i)+n}function i_(e,t,n,i,r,s,o,l,c,u){let d=!1;return n_(e,t,n,i,r,s)&&(d=!d),n_(e,t,r,s,o,l)&&(d=!d),n_(e,t,o,l,c,u)&&(d=!d),n_(e,t,c,u,n,i)&&(d=!d),d}function bst(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function r_(e,t,n,i,r,s){const o=Math.min(n,r),l=Math.max(n,r),c=Math.min(i,s),u=Math.max(i,s);return e>=o&&e<=l&&t>=c&&t<=u}function yst(e={}){const{blockPointerEvents:t=!1}=e,n=new Qu,i=({x:r,y:s,placement:o,elements:l,onClose:c,nodeId:u,tree:d})=>{const f=o==null?void 0:o.split("-")[0];let h=!1,m=null,g=null,b=typeof performance<"u"?performance.now():0;function v(w,x){const k=performance.now(),S=k-b;if(m===null||g===null||S===0)return m=w,g=x,b=k,!1;const O=w-m,A=x-g,E=O*O+A*A,j=S*S*gst;return m=w,g=x,b=k,E0)}function N(){C()||y()}if(C())return;const P=k.getBoundingClientRect(),I=S.getBoundingClientRect(),D=r>I.right-I.width/2,_=s>I.bottom-I.height/2,L=I.width>P.width,F=I.height>P.height,M=(L?P:I).left,H=(L?P:I).right,q=(F?P:I).top,U=(F?P:I).bottom;if(f==="top"&&s>=P.bottom-1||f==="bottom"&&s<=P.top+1||f==="left"&&r>=P.right-1||f==="right"&&r<=P.left+1){N();return}let Z=!1;switch(f){case"top":Z=r_(O,A,M,P.top+1,H,I.bottom-1);break;case"bottom":Z=r_(O,A,M,I.top+1,H,P.bottom-1);break;case"left":Z=r_(O,A,I.right-1,U,P.left+1,q);break;case"right":Z=r_(O,A,P.right-1,U,I.left+1,q);break}if(Z)return;if(h&&!bst(O,A,P)){N();return}if(!j&&v(O,A)){N();return}let z=!1;switch(f){case"top":{const J=L?Kr/2:Kr*4,ne=L||D?r+J:r-J,W=L?r-J:D?r+J:r-J,X=s+Kr+1,le=D||L?I.bottom-Kr:I.top,V=D?L?I.bottom-Kr:I.top:I.bottom-Kr;z=i_(O,A,ne,X,W,X,I.left,le,I.right,V);break}case"bottom":{const J=L?Kr/2:Kr*4,ne=L||D?r+J:r-J,W=L?r-J:D?r+J:r-J,X=s-Kr,le=D||L?I.top+Kr:I.bottom,V=D?L?I.top+Kr:I.bottom:I.top+Kr;z=i_(O,A,ne,X,W,X,I.left,le,I.right,V);break}case"left":{const J=F?Kr/2:Kr*4,ne=F||_?s+J:s-J,W=F?s-J:_?s+J:s-J,X=r+Kr+1,le=_||F?I.right-Kr:I.left,V=_?F?I.right-Kr:I.left:I.right-Kr;z=i_(O,A,le,I.top,V,I.bottom,X,ne,X,W);break}case"right":{const J=F?Kr/2:Kr*4,ne=F||_?s+J:s-J,W=F?s-J:_?s+J:s-J,X=r-Kr,le=_||F?I.left+Kr:I.right,V=_?F?I.left+Kr:I.right:I.left+Kr;z=i_(O,A,X,ne,X,W,le,I.top,V,I.bottom);break}}z?h||n.start(40,N):N()}};return i.__options={...e,blockPointerEvents:t},i}const vst=p.createContext(void 0);function xst(){const e=p.useContext(vst);return(e==null?void 0:e.direction)??"ltr"}const wst=e=>({name:"arrow",options:e,async fn(t){var F,M;const{x:n,y:i,placement:r,rects:s,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0,offsetParent:f="real"}=Eh(e,t)||{};if(u==null)return{};const h=Zz(d),m={x:n,y:i},g=HD(r),b=VD(g),v=await o.getDimensions(u),y=g==="y",w=y?"top":"left",x=y?"bottom":"right",k=y?"clientHeight":"clientWidth",S=s.reference[b]+s.reference[g]-m[g]-s.floating[b],O=m[g]-s.reference[g],A=f==="real"?await((F=o.getOffsetParent)==null?void 0:F.call(o,u)):l.floating;let E=l.floating[k]||s.floating[b];(!E||!await((M=o.isElement)==null?void 0:M.call(o,A)))&&(E=l.floating[k]||s.floating[b]);const j=S/2-O/2,T=E/2-v[b]/2-1,R=Math.min(h[w],T),C=Math.min(h[x],T),N=R,P=E-v[b]-C,I=E/2-v[b]/2+j,D=Xz(N,I,P),_=!c.arrow&&mm(r)!=null&&I!==D&&s.reference[b]/2-(I({...wst(e),options:[e,t]}),Ost={name:"hide",async fn(e){const{width:t,height:n,x:i,y:r}=e.rects.reference,s=t===0&&n===0&&i===0&&r===0,o=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||s}}}},Sst={sideX:"left",sideY:"top"},WJ="--available-width",KJ="--available-height";function Oje(e,t,n){const i=e==="inline-start"||e==="inline-end";return{top:"top",right:i?n?"inline-start":"inline-end":"right",bottom:"bottom",left:i?n?"inline-end":"inline-start":"left"}[t]}function GJ(e,t,n){const{rects:i,placement:r}=e;return{side:Oje(t,kd(r),n),align:mm(r)||"center",anchor:{width:i.reference.width,height:i.reference.height},positioner:{width:i.floating.width,height:i.floating.height}}}function Est(e){return Cst(e,dst)}function Cst(e,t){var qe,yt;const{anchor:n,positionMethod:i="absolute",side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:l=0,collisionBoundary:c,collisionPadding:u=5,sticky:d=!1,arrowPadding:f=5,disableAnchorTracking:h=!1,inline:m,keepMounted:g=!1,floatingRootContext:b,mounted:v,collisionAvoidance:y,shift:w,nodeId:x,adaptiveOrigin:k,lazyFlip:S=!1,externalTree:O}=e,[A,E]=p.useState(null);!v&&A!==null&&E(null);const j=y.side||"flip",T=y.align||"flip",R=y.fallbackAxisSide||"end",C=(w==null?void 0:w.crossAxis)??!1,N=w==null?void 0:w.rootBoundary,P=typeof n=="function"?n:void 0,I=oi(P),D=P?I:n,_=Gl(n),L=Gl(v),M=xst()==="rtl",H=A||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":M?"left":"right","inline-start":M?"right":"left"}[r],q=o==="center"?H:`${H}-${o}`;let U=u;typeof U=="number"?U={top:U,right:U,bottom:U,left:U}:U&&(U={top:U.top||0,right:U.right||0,bottom:U.bottom||0,left:U.left||0});const Z=1,z=r==="bottom"?Z:0,J=r==="top"?Z:0,ne=r==="right"?Z:0,W=r==="left"?Z:0,X={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:U},le=p.useRef(null),V=Gl(s),Y=Gl(l),K=typeof s!="function"?s:0,ue=typeof l!="function"?l:0,te=[];m&&te.push(m),te.push(eje(je=>{const kt=GJ(je,r,M),Tt=typeof V.current=="function"?V.current(kt):V.current,fn=typeof Y.current=="function"?Y.current(kt):Y.current;return{mainAxis:Tt,crossAxis:fn,alignmentAxis:fn}},[K,ue,M,r]));const Oe=T==="none"&&j!=="shift",fe=!Oe&&(d||C||j==="shift"),pe=j==="none"?null:ije({...X,padding:{top:U.top+Z+z,right:U.right+Z+W,bottom:U.bottom+Z+J,left:U.left+Z+ne},mainAxis:!C&&j==="flip",crossAxis:T==="flip"?"alignment":!1,fallbackAxisSideDirection:R}),Se=Oe?null:tje({...X,rootBoundary:N,mainAxis:T!=="none",crossAxis:fe,limiter:d||C?void 0:nje(je=>{if(!le.current)return{};const{width:kt,height:Tt}=le.current.getBoundingClientRect(),fn=pd(kd(je.placement)),tn=fn==="y"?kt:Tt,We=fn==="y"?U.left+U.right:U.top+U.bottom;return{offset:tn/2+We/2}})},[X,d,C,N,U,T]);j==="shift"||T==="shift"||o==="center"?te.push(Se,pe):te.push(pe,Se),te.push(rje({...X,apply({elements:{floating:je},availableWidth:kt,availableHeight:Tt,rects:fn}){if(!L.current)return;const tn=je.style;tn.setProperty(WJ,`${kt}px`),tn.setProperty(KJ,`${Tt}px`);const We=ea(je).devicePixelRatio||1,{x:vt,y:Ke,width:ot,height:it}=fn.reference,tt=(Math.round((vt+ot)*We)-Math.round(vt*We))/We,Ct=(Math.round((Ke+it)*We)-Math.round(Ke*We))/We;tn.setProperty("--anchor-width",`${tt}px`),tn.setProperty("--anchor-height",`${Ct}px`)}}),kst(je=>({element:le.current||Cr(je.elements.floating).createElement("div"),padding:f,offsetParent:"floating"}),[f]),{name:"transformOrigin",fn(je){var Je,lt,hn;const{elements:kt,middlewareData:Tt,placement:fn,rects:tn,y:We}=je,vt=kd(fn),Ke=pd(vt),ot=le.current,it=((Je=Tt.arrow)==null?void 0:Je.x)||0,tt=((lt=Tt.arrow)==null?void 0:lt.y)||0,Ct=(ot==null?void 0:ot.clientWidth)||0,Ot=(ot==null?void 0:ot.clientHeight)||0,Bt=it+Ct/2,Dt=tt+Ot/2,Ze=Math.abs(((hn=Tt.shift)==null?void 0:hn.y)||0),bt=tn.reference.height/2,gt=typeof s=="function"?s(GJ(je,r,M)):s,an=Ze>gt,Ft={top:`${Bt}px calc(100% + ${gt}px)`,bottom:`${Bt}px ${-gt}px`,left:`calc(100% + ${gt}px) ${Dt}px`,right:`${-gt}px ${Dt}px`}[vt],cn=`${Bt}px ${tn.reference.y+bt-We}px`;return kt.floating.style.setProperty("--transform-origin",fe&&Ke==="y"&&an?cn:Ft),{}}},Ost,k),ti(()=>{!v&&b&&b.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[v,b]);const ve=p.useMemo(()=>({elementResize:!h&&typeof ResizeObserver<"u",layoutShift:!h&&typeof IntersectionObserver<"u"}),[h]),{refs:Le,elements:He,x:Ge,y:De,middlewareData:se,update:ce,placement:ye,context:Ae,isPositioned:Ee,floatingStyles:Ce}=t({rootContext:b,open:g?v:void 0,placement:q,middleware:te,strategy:i,whileElementsMounted:g?void 0:(...je)=>aB(...je,ve),nodeId:x,externalTree:O}),{sideX:Be,sideY:he}=se.adaptiveOrigin||Sst,ie=Ee?i:"fixed",we=p.useMemo(()=>{let je;return Ee?k?je={position:ie,[Be]:Ge,[he]:De}:je={...Ce,position:ie}:je={position:ie,top:0,left:0},je[WJ]="100vw",je[KJ]="100vh",Ee||(je.opacity=0),je},[k,ie,Be,Ge,he,De,Ce,Ee]),Re=p.useRef(null);ti(()=>{if(!v)return;const je=_.current,kt=typeof je=="function"?je():je,fn=(XJ(kt)?kt.current:kt)||null||null;fn!==Re.current&&(Le.setPositionReference(fn),Re.current=fn)},[v,Le,D,_]),p.useEffect(()=>{if(!v)return;const je=_.current;typeof je!="function"&&XJ(je)&&je.current!==Re.current&&(Le.setPositionReference(je.current),Re.current=je.current)},[v,Le,D,_]),p.useEffect(()=>{if(g&&v&&He.reference&&He.floating)return aB(He.reference,He.floating,ce,ve)},[g,v,He,ce,ve]);const Ue=kd(ye),_t=Oje(r,Ue,M),Pt=mm(ye)||"center",Gt=!!((qe=se.hide)!=null&&qe.referenceHidden);ti(()=>{S&&v&&Ee&&Ue!==H&&E(Ue)},[S,v,Ee,Ue,H]);const St=p.useMemo(()=>{var je,kt;return{position:"absolute",top:(je=se.arrow)==null?void 0:je.y,left:(kt=se.arrow)==null?void 0:kt.x}},[se.arrow]),Lt=((yt=se.arrow)==null?void 0:yt.centerOffset)!==0;return p.useMemo(()=>({positionerStyles:we,arrowStyles:St,arrowRef:le,arrowUncentered:Lt,side:_t,align:Pt,physicalSide:Ue,anchorHidden:Gt,refs:Le,context:Ae,isPositioned:Ee,update:ce}),[we,St,le,Lt,_t,Pt,Ue,Gt,Le,Ae,Ee,ce])}function XJ(e){return e!=null&&"current"in e}(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=aI.startingStyle]="startingStyle",e[e.endingStyle=aI.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({});const Ast={"data-popup-open":""},Tst={"data-popup-open":"","data-pressed":""},_st={"data-open":""},jst={"data-closed":""},Nst={"data-anchor-hidden":""},Sje={open(e){return e?Ast:null}},Rst={open(e){return e?Tst:null}},hV={open(e){return e?_st:jst},anchorHidden(e){return e?Nst:null}},Eje={...hV,...qD};function Cje(e){return e==="starting"?Lit:Jl}function Ist(e,t,{styles:n,transitionStatus:i,props:r,refs:s,hidden:o,inert:l=!1}){const c={...n};return l&&(c.pointerEvents="none"),Da("div",e,{state:t,ref:s,props:[{role:"presentation",hidden:o,style:c},Cje(i),r],stateAttributesMapping:hV})}function Aje(){const e=Qz(),t=e.useState("toasts");return p.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function gf({orientation:e="vertical",maxHeight:t,hideScrollbar:n=!1,fadeEdges:i=!1,contentClassName:r="",className:s="",style:o,children:l,hasMore:c=!1,onLoadMore:u,threshold:d=24,onScroll:f,ref:h,...m}){const[g,b]=p.useState(!1),[v,y]=p.useState(!1),[w,x]=p.useState({top:!1,bottom:!1}),k=p.useRef(null),S=p.useRef(null),O=i&&e!=="horizontal",A=!!u&&e!=="horizontal";p.useImperativeHandle(h,()=>k.current,[]),p.useEffect(()=>()=>{var T;(T=S.current)==null||T.abort()},[]);const E=p.useCallback(()=>{const T=k.current;if(!O||!T)return;const R=T.scrollHeight-T.clientHeight,C=R>1&&T.scrollTop>1,N=R>1&&R-T.scrollTop>1;x(P=>P.top===C&&P.bottom===N?P:{top:C,bottom:N})},[O]);p.useEffect(()=>{const T=k.current;if(!O||!T)return;const R=new ResizeObserver(E);R.observe(T);for(const C of T.children)R.observe(C);return E(),()=>R.disconnect()},[O,A,E]);async function j(){if(!u||!c||S.current)return;const T=new AbortController;S.current=T,b(!0),y(!1);try{await u(T.signal)}catch{T.signal.aborted||y(!0)}finally{T.signal.aborted||b(!1),S.current===T&&(S.current=null)}}return a.jsxs("div",{...m,ref:k,className:`studio-scroll-area ${s}`.trim(),"data-orientation":e,"data-hide-scrollbar":n||void 0,"data-fade-edges":O&&(w.top||w.bottom)||void 0,"data-fade-top":O&&w.top||void 0,"data-fade-bottom":O&&w.bottom||void 0,style:{maxHeight:t,...o},onScroll:T=>{f==null||f(T),E();const R=T.currentTarget;!T.defaultPrevented&&e!=="horizontal"&&!v&&R.scrollTop>0&&R.scrollHeight-R.clientHeight-R.scrollTop<=Math.max(0,d)&&j()},children:[a.jsx("div",{className:`studio-scroll-area__content ${r}`.trim(),"aria-busy":u?g:void 0,children:l}),u&&e!=="horizontal"&&a.jsx(a.Fragment,{children:a.jsxs("div",{className:"studio-scroll-area__footer",children:[g?a.jsx(av,{size:24}):a.jsx("span",{role:"status","aria-live":"polite",children:v?"加载失败":c?"向下滚动加载更多":"已加载全部"}),!g&&c&&a.jsx("button",{type:"button",onClick:()=>void j(),children:v?"重试":"加载更多"})]})})]})}function Pst(){const{add:e,close:t}=Aje();return{add:p.useCallback(({id:i,title:r,description:s,variant:o="info",duration:l,action:c,closeLabel:u,onClose:d})=>e({id:i,title:r,description:s,timeout:l,priority:"low",onClose:d,data:{variant:o,action:c,closeLabel:u}}),[e]),dismiss:t}}function Dst({position:e,label:t}){const{toasts:n,close:i}=Aje();return a.jsx(art,{children:a.jsx(Rit,{className:"studio-toast-viewport","data-position":e,"data-empty":n.length===0||void 0,"aria-label":t,render:a.jsx(gf,{contentClassName:"studio-toast-viewport__stack"}),children:n.map(r=>{var s,o,l;return a.jsx(Git,{toast:r,className:"studio-toast-root",swipeDirection:[],children:a.jsx(lnt,{role:"presentation",variant:(s=r.data)==null?void 0:s.variant,title:r.title!=null?a.jsx(Jit,{render:a.jsx("div",{}),children:r.title}):void 0,description:r.description!=null?a.jsx(Zit,{render:a.jsx("div",{}),children:r.description}):void 0,action:(o=r.data)==null?void 0:o.action,closeLabel:(l=r.data)==null?void 0:l.closeLabel,onDismiss:()=>i(r.id)})},r.id)})})})}function Mst({children:e,duration:t=4e3,position:n="top-center",label:i="通知"}){return a.jsxs(mit,{timeout:t,limit:3,children:[e,a.jsx(Dst,{position:n,label:i})]})}function Lst({ownerId:e,sessionId:t,onOpen:n,hideNotices:i,refreshKey:r,onUpdate:s}){const{t:o}=_e("sandbox"),l=Pst(),c=p.useRef(new Map),u=p.useRef(new Map),d=p.useRef(null),f=p.useRef({sessionId:t,onOpen:n,toast:l,t:o,hideNotices:i,onUpdate:s});return f.current={sessionId:t,onOpen:n,toast:l,t:o,hideNotices:i,onUpdate:s},p.useEffect(()=>{if(i){f.current.toast.dismiss(),u.current.clear();return}for(const h of c.current.values())h.sessionId===t&&(f.current.toast.dismiss(h.runId),u.current.delete(h.runId))},[t,i]),p.useEffect(()=>{var h;(h=d.current)==null||h.call(d)},[r]),p.useEffect(()=>{if(!e)return;const h=new AbortController,m=c.current,g=u.current,b=new Set;let v,y=!1,w=[],x="";const k=(A,E=x)=>{var j,T;x=E,h.signal.aborted||(T=(j=f.current).onUpdate)==null||T.call(j,{ownerId:e,runs:w,loading:A,error:E})},S=A=>{const{toast:E,t:j,sessionId:T,onOpen:R}=f.current;if(!h.signal.aborted){if(f.current.hideNotices||A.sessionId===T){E.dismiss(A.runId),g.delete(A.runId);return}b.has(A.runId)||g.get(A.runId)===A.state||(g.set(A.runId,A.state),E.add({id:A.runId,duration:0,title:j(`taskNotice.${A.state}`),description:A.message.slice(0,80),variant:A.state==="succeeded"?"success":A.state==="failed"?"error":"info",closeLabel:j("taskNotice.hide"),onClose:()=>b.add(A.runId),action:a.jsx(ki,{variant:"secondary",onClick:()=>{R(A.sessionId,h.signal).catch(C=>{h.signal.aborted||E.add({id:"task-open-error",variant:"error",description:C instanceof Error?C.message:String(C)})})},children:j("taskNotice.open")})}))}},O=async(A=!1)=>{if(!(y||h.signal.aborted)){clearTimeout(v),y=!0,A&&k(!0);try{const E=await Yd.active(h.signal);if(h.signal.aborted)return;w=E,k(!1,"");const j=new Set(E.map(T=>T.runId));for(const T of m.values())if(!j.has(T.runId)&&!yu(T)){let R;try{R=await Yd.get(T.runId,h.signal)}catch(C){if(C instanceof Yw&&C.status===404){m.delete(T.runId),g.delete(T.runId),f.current.toast.dismiss(T.runId);continue}throw C}if(h.signal.aborted)return;m.set(R.runId,R),S(R)}for(const T of E)m.set(T.runId,T),S(T);f.current.toast.dismiss("task-connection")}catch(E){if(h.signal.aborted)return;E instanceof Yw&&[401,403].includes(E.status)&&(w=[],m.clear(),g.clear(),f.current.toast.dismiss()),k(!1,E instanceof Error?E.message:f.current.t("taskNotice.reconnecting")),!h.signal.aborted&&m.size&&!f.current.hideNotices&&f.current.toast.add({id:"task-connection",duration:0,description:f.current.t("taskNotice.reconnecting")})}finally{y=!1,h.signal.aborted||(v=setTimeout(O,3e3))}}};return d.current=()=>{O(!0)},k(!0),O(),()=>{h.abort(),clearTimeout(v),d.current=null,f.current.toast.dismiss()}},[e]),null}function $st(e){const{t}=_e("sandbox");return a.jsx(Mst,{position:"bottom-right",label:t("taskNotice.label"),children:a.jsx(Lst,{...e},e.ownerId)})}const hC=["super_admin","admin","developer","user"];class pC extends Error{constructor(t,n){super(t),this.code=t,this.status=n}}async function Tje(e){let t;try{t=await e.json()}catch{throw new pC("invalid_response",e.status)}if(!e.ok){const n=t&&typeof t=="object"&&"code"in t&&typeof t.code=="string"?t.code:"request_failed";throw new pC(n,e.status)}return t}function _je(e){return!e||typeof e!="object"?!1:"id"in e&&typeof e.id=="string"&&"name"in e&&typeof e.name=="string"&&"email"in e&&typeof e.email=="string"&&"role"in e&&hC.some(t=>t===e.role)&&"status"in e&&typeof e.status=="string"&&"lastLogin"in e&&typeof e.lastLogin=="string"&&"protected"in e&&typeof e.protected=="boolean"&&"currentUser"in e&&typeof e.currentUser=="boolean"&&"roleConflict"in e&&typeof e.roleConflict=="boolean"}async function Fst(e){const t=new URLSearchParams({page:String(e.page),pageSize:"20",query:e.query});e.role&&t.set("role",e.role);const n=await Tje(await yn(`/web/users?${t}`,{signal:e.signal,cache:"no-store"}));if(!n||typeof n!="object"||!("items"in n)||!Array.isArray(n.items)||!n.items.every(_je)||!("total"in n)||typeof n.total!="number"||!("poolTotal"in n)||typeof n.poolTotal!="number"||!("page"in n)||typeof n.page!="number"||!("pageSize"in n)||typeof n.pageSize!="number"||!("userPoolId"in n)||typeof n.userPoolId!="string"||!("clientId"in n)||typeof n.clientId!="string"||!("provider"in n)||!["volcengine","byteplus"].includes(String(n.provider)))throw new pC("invalid_response",502);return n}async function Bst(e,t,n){const i=await Tje(await yn(`/web/users/${encodeURIComponent(e.id)}/role`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({role:t,expectedRole:e.role}),signal:n}));if(!i||typeof i!="object"||!("user"in i)||!_je(i.user))throw new pC("invalid_response",502);return i.user}function Ust(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m7 9.5 5 5 5-5"})})}function Qst(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6.5 12.5 3.5 3.5 7.5-8"})})}function bf({ariaLabel:e,value:t,valueLabel:n,placeholder:i,options:r,disabled:s=!1,searchValue:o,searchPlaceholder:l,loading:c=!1,hasMore:u=!1,emptyMessage:d,onSearchChange:f,onLoadMore:h,onChange:m}){const{t:g}=_e("ui"),b=l??g("deploymentSelect.searchPlaceholder"),v=d??g("deploymentSelect.emptyMessage"),y=p.useId(),w=p.useRef(null),x=p.useRef(null),k=p.useRef(null),S=p.useRef(null),O=p.useRef([]),[A,E]=p.useState(!1),[j,T]=p.useState(0),R=r.find(L=>L.value===t),C=(R==null?void 0:R.label)??(t?n:void 0),N=o!==void 0&&!!f,P=()=>{E(!1),N&&o&&(f==null||f(""))};p.useEffect(()=>{if(!A)return;const L=F=>{F.target instanceof Node&&w.current&&!w.current.contains(F.target)&&P()};return window.addEventListener("pointerdown",L),()=>window.removeEventListener("pointerdown",L)},[A,f,o,N]),p.useEffect(()=>{var L,F;if(A){if(N){(L=k.current)==null||L.focus();return}(F=O.current[j])==null||F.focus()}},[A,N]),p.useEffect(()=>{var L;!A||N&&document.activeElement===k.current||(L=O.current[j])==null||L.focus()},[j,A,N]),p.useEffect(()=>{T(L=>Math.min(L,Math.max(0,r.length-1)))},[r.length]),p.useEffect(()=>{if(!A||!u||c||!h)return;const L=window.requestAnimationFrame(()=>{const F=S.current;F&&F.scrollHeight<=F.clientHeight+1&&h()});return()=>window.cancelAnimationFrame(L)},[u,c,h,A,r.length]);const I=(L=1)=>{const F=r.findIndex(H=>H.value===t),M=F>=0?F:L===1?0:Math.max(0,r.length-1);T(M),E(!0)},D=L=>{r.length!==0&&T((L+r.length)%r.length)},_=L=>{var F;m(L.value),P(),(F=x.current)==null||F.focus()};return a.jsxs("div",{className:"pp-deployment-select",ref:w,onKeyDown:L=>{var M,H;const F=L.target===k.current;if(L.key==="Escape"&&A){L.preventDefault(),P(),(M=x.current)==null||M.focus();return}if(L.key==="Tab"){P();return}if(F){L.key==="ArrowDown"&&r.length>0&&(L.preventDefault(),T(0),(H=O.current[0])==null||H.focus());return}L.key==="ArrowDown"?(L.preventDefault(),A?D(j+1):I(1)):L.key==="ArrowUp"?(L.preventDefault(),A?D(j-1):I(-1)):A&&L.key==="Home"?(L.preventDefault(),T(0)):A&&L.key==="End"&&(L.preventDefault(),T(Math.max(0,r.length-1)))},children:[a.jsxs("button",{ref:x,type:"button",className:"pp-deployment-select-trigger","aria-label":e,"aria-haspopup":"listbox","aria-expanded":A,"aria-controls":A?y:void 0,disabled:s,onClick:()=>{A?P():I()},children:[a.jsx("span",{className:C?void 0:"is-placeholder",children:C??i}),a.jsx(Ust,{className:`pp-deployment-select-chevron${A?" is-open":""}`})]}),A&&a.jsxs("div",{className:"pp-deployment-select-menu",children:[N&&a.jsx("div",{className:"pp-deployment-select-search",children:a.jsx("input",{ref:k,type:"search",value:o,"aria-label":g("deploymentSelect.searchAriaLabel",{label:e}),placeholder:b,autoComplete:"off",onChange:L=>f==null?void 0:f(L.currentTarget.value)})}),a.jsx("div",{id:y,ref:S,className:"pp-deployment-select-options",role:"listbox","aria-label":e,"aria-busy":c||void 0,onScroll:L=>{if(!u||c||!h)return;const F=L.currentTarget;F.scrollHeight-F.scrollTop-F.clientHeight<=24&&h()},children:r.map((L,F)=>{const M=L.value===t;return a.jsxs("button",{ref:H=>{O.current[F]=H},type:"button",role:"option","aria-selected":M,tabIndex:F===j?0:-1,className:`pp-deployment-select-option${M?" is-selected":""}`,title:L.metadata?[L.label,L.description,L.metadata].filter(Boolean).join(` -`):L.description,onFocus:()=>T(F),onClick:()=>_(L),children:[a.jsxs("span",{className:"pp-deployment-select-copy",children:[a.jsxs("span",{className:"pp-deployment-select-name",children:[L.label,L.badge&&a.jsx("span",{className:"pp-deployment-select-badge",children:L.badge})]}),L.description&&a.jsx("small",{className:L.metadata?"pp-deployment-select-description":void 0,children:L.description}),L.metadata&&a.jsx("small",{className:"pp-deployment-select-metadata",children:L.metadata})]}),M&&a.jsx(Qst,{})]},L.value)})}),c&&a.jsx("div",{className:"pp-deployment-select-state","aria-live":"polite",children:g("deploymentSelect.loadingMore")}),!c&&r.length===0&&a.jsx("div",{className:"pp-deployment-select-state",children:v})]})]})}function XD({label:e,onClick:t}){return a.jsx("button",{type:"button",className:"page-back-button","aria-label":e,title:e,onClick:t,children:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m14.5 6-6 6 6 6"})})})}function on({as:e="span",className:t="",duration:n=4,spread:i=20,children:r,style:s,...o}){const l=Math.min(Math.max(i,5),45);return a.jsx(e,{className:`text-shimmer${t?` ${t}`:""}`,style:{...s,backgroundImage:`linear-gradient(to right, hsl(var(--muted-foreground)) ${50-l}%, hsl(var(--foreground)) 50%, hsl(var(--muted-foreground)) ${50+l}%)`,animationDuration:`${n}s`},...o,children:r})}function zst(){return a.jsx("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M16 7a6.5 6.5 0 1 0 .2 5M16 3.5V7h-3.5"})})}function jje(e){return e instanceof pC?e.code:"request_failed"}function Vst({user:e,onClose:t,onSaved:n}){const{t:i,i18n:r}=_e("users"),s=p.useRef(null),o=p.useRef(null),l=p.useId(),c=p.useId(),[u,d]=p.useState(e.role),[f,h]=p.useState(!1),[m,g]=p.useState("");p.useEffect(()=>{const v=s.current,y=document.activeElement;return v==null||v.showModal(),()=>{var w;(w=o.current)==null||w.abort(),v==null||v.close(),y instanceof HTMLElement&&y.isConnected&&y.focus()}},[]);const b=async()=>{if(f||u===e.role&&!e.roleConflict)return;const v=new AbortController;o.current=v,h(!0),g("");try{const y=await Bst(e,u,v.signal);v.signal.aborted||n(y)}catch(y){v.signal.aborted||g(i(`errors.${jje(y)}`,{defaultValue:i("errors.request_failed")}))}finally{v.signal.aborted||h(!1)}};return a.jsxs("dialog",{ref:s,className:"user-role-dialog","aria-labelledby":l,"aria-describedby":c,"aria-busy":f,onCancel:v=>{v.preventDefault(),f||t()},children:[a.jsxs("header",{children:[a.jsx("h2",{id:l,children:i("changeRole")}),a.jsx("button",{type:"button",className:"users-close",onClick:t,disabled:f,"aria-label":i("close"),children:a.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:a.jsx("path",{d:"m5 5 10 10M15 5 5 15"})})})]}),a.jsxs("div",{className:"user-role-dialog-body",children:[a.jsxs("div",{className:"users-account",children:[a.jsx("strong",{children:e.name}),a.jsx("span",{children:e.email||e.id})]}),a.jsx("label",{className:"users-field-label",children:i("role")}),a.jsx(bf,{ariaLabel:i("role"),placeholder:i("role"),value:u,disabled:f,options:hC.map(v=>({value:v,label:i(`roles.${v}`),description:i(`descriptions.${v}`)})),onChange:v=>{const y=hC.find(w=>w===v);y&&d(y)}},r.resolvedLanguage),a.jsx("p",{id:c,className:"users-help",children:i("effectiveAfterRefresh")}),m?a.jsx("p",{className:"users-error",role:"alert",children:m}):null]}),a.jsxs("footer",{children:[a.jsx("button",{className:"users-button",type:"button",disabled:f,onClick:t,children:i("cancel")}),a.jsx("button",{className:"users-button is-primary",type:"button",disabled:f||u===e.role&&!e.roleConflict,onClick:()=>void b(),children:i(f?"saving":"save")})]})]})}function Hst({onBack:e}){const{t,i18n:n}=_e("users"),[i,r]=p.useState(null),[s,o]=p.useState(!0),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(""),[m,g]=p.useState(""),[b,v]=p.useState(1),[y,w]=p.useState(0),[x,k]=p.useState(null),[S,O]=p.useState(null),[A,E]=p.useState(null);p.useEffect(()=>{const C=new AbortController;return o(!0),c(""),Fst({page:b,query:f,role:m,signal:C.signal}).then(N=>{if(!C.signal.aborted){if(N.total>0&&N.items.length===0&&b>1){v(1);return}r(N),E(new Date)}}).catch(N=>{C.signal.aborted||c(jje(N))}).finally(()=>{C.signal.aborted||o(!1)}),()=>C.abort()},[b,f,m,y]);const j=C=>{C.preventDefault(),h(u.trim()),v(1),w(N=>N+1)},T=C=>{if(!C)return t("neverLoggedIn");const N=Number(C),P=new Date(Number.isFinite(N)&&N>0?N<1e12?N*1e3:N:C);return Number.isNaN(P.getTime())?t("unknown"):P.toLocaleString(n.resolvedLanguage,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})},R=Math.max(1,Math.ceil(((i==null?void 0:i.total)??0)/20));return a.jsxs("section",{className:"users-page","aria-labelledby":"users-title",children:[a.jsxs("header",{className:"users-page-header",children:[a.jsx(XD,{label:t("back"),onClick:e}),a.jsx("h1",{id:"users-title",children:t("title")}),i?a.jsx("span",{className:"users-count",children:t("memberCount",{count:i.poolTotal})}):null]}),a.jsxs("div",{className:"users-content",children:[i?a.jsxs("div",{className:"users-pool",children:[a.jsx("span",{children:i.provider==="byteplus"?"BytePlus Identity":t("volcengineIdentity")}),a.jsxs("span",{className:"users-pool-id",title:i.userPoolId,children:[t("pool")," ",i.userPoolId]})]}):null,a.jsxs("div",{className:"users-toolbar",children:[a.jsxs("form",{className:"users-search",onSubmit:j,children:[a.jsx("input",{value:u,onChange:C=>d(C.target.value),onKeyDown:C=>{C.key==="Enter"&&(C.nativeEvent.isComposing||C.keyCode===229)&&C.preventDefault()},"aria-label":t("searchPlaceholder"),placeholder:t("searchPlaceholder"),maxLength:200}),a.jsx("button",{type:"submit",className:"users-button",disabled:s,children:t("search")})]}),a.jsx("div",{className:"users-role-filter",children:a.jsx(bf,{ariaLabel:t("filterRole"),placeholder:t("allRoles"),value:m,options:[{value:"",label:t("allRoles")},...hC.map(C=>({value:C,label:t(`roles.${C}`)}))],onChange:C=>{const N=hC.find(P=>P===C);g(N??""),v(1)}})}),a.jsxs("button",{type:"button",className:"users-button users-refresh",disabled:s,onClick:()=>{O(null),w(C=>C+1)},children:[a.jsx(zst,{}),a.jsx("span",{children:t("refresh")})]})]}),a.jsx("div",{className:"users-feedback","aria-live":"polite",children:s?a.jsx(on,{children:t("loading")}):S?a.jsx("span",{children:t("saved",{name:S.name,role:t(`roles.${S.role}`)})}):A?a.jsx("span",{children:t("updatedAt",{time:A.toLocaleTimeString(n.resolvedLanguage,{hour:"2-digit",minute:"2-digit",hour12:!1})})}):null}),l?a.jsxs("div",{className:"users-error users-error-banner",role:"alert",children:[a.jsx("span",{children:t(`errors.${l}`,{defaultValue:t("errors.request_failed")})}),a.jsx("button",{type:"button",className:"users-button",onClick:()=>w(C=>C+1),children:t("retry")})]}):null,a.jsxs("div",{className:"users-table-wrap","aria-busy":s,children:[a.jsxs("table",{className:"users-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:t("user")}),a.jsx("th",{scope:"col",children:t("role")}),a.jsx("th",{scope:"col",children:t("status")}),a.jsx("th",{scope:"col",children:t("lastLogin")}),a.jsx("th",{scope:"col",children:a.jsx("span",{className:"sr-only",children:t("actions")})})]})}),a.jsx("tbody",{children:i==null?void 0:i.items.map(C=>{var N;return a.jsxs("tr",{children:[a.jsx("td",{"data-label":t("user"),children:a.jsxs("div",{className:"users-person",children:[a.jsx("span",{className:"users-avatar","aria-hidden":"true",children:(N=Array.from(C.name)[0])==null?void 0:N.toUpperCase()}),a.jsxs("div",{className:"users-account",children:[a.jsxs("strong",{children:[C.name,C.currentUser?a.jsx("span",{className:"users-self",children:t("you")}):null]}),a.jsx("span",{title:C.email||C.id,children:C.email||C.id})]})]})}),a.jsxs("td",{"data-label":t("role"),children:[a.jsx("span",{className:`users-role-badge${C.role==="super_admin"?" is-super":""}`,children:t(`roles.${C.role}`)}),C.roleConflict?a.jsx("span",{className:"users-inline-warning",children:t("roleConflict")}):null]}),a.jsx("td",{"data-label":t("status"),children:a.jsx("span",{className:"users-status",children:t(`states.${C.status}`,{defaultValue:t("unknown")})})}),a.jsx("td",{"data-label":t("lastLogin"),className:"users-last-login",children:T(C.lastLogin)}),a.jsx("td",{className:"users-actions",children:C.protected?a.jsx("span",{className:"users-protected",title:t("protectedExplanation"),children:t("initialAdministrator")}):a.jsx("button",{type:"button",className:"users-button is-text",disabled:s||!!l||C.currentUser,onClick:()=>{O(null),k(C)},children:t("changeRole")})})]},C.id)})})]}),!s&&!l&&(i==null?void 0:i.items.length)===0?a.jsxs("div",{className:"users-empty",children:[a.jsx("strong",{children:t("noUsers")}),a.jsx("span",{children:t(f||m?"tryAnotherSearch":"poolEmpty")})]}):null,s&&!i?a.jsx("div",{className:"users-empty",children:a.jsx(on,{children:t("loading")})}):null]}),i?a.jsxs("footer",{className:"users-pagination",children:[a.jsx("span",{children:t("resultCount",{count:i.total})}),a.jsxs("div",{children:[a.jsx("button",{type:"button",className:"users-button",disabled:b<=1||s,onClick:()=>v(C=>C-1),children:t("previous")}),a.jsxs("span",{children:[b," / ",R]}),a.jsx("button",{type:"button",className:"users-button",disabled:b>=R||s,onClick:()=>v(C=>C+1),children:t("next")})]})]}):null]}),x?a.jsx(Vst,{user:x,onClose:()=>k(null),onSaved:C=>{k(null),O(C),w(N=>N+1)}}):null]})}const Nje=p.createContext(null);function qst(e){if(!e||/[?#]/.test(e))return null;try{const t=decodeURIComponent(e);return!/^\/data\/(output|workspace)\/.+/.test(t)||t.endsWith("/")||/[\\\u0000-\u001f\u007f]/.test(t)||t.split("/").some(n=>n==="."||n==="..")?null:t}catch{return null}}function Wst({appName:e,sessionId:t,path:n,children:i}){const{t:r}=_e("conversation"),s=p.useRef(null),[o,l]=p.useState(!1),[c,u]=p.useState(!1);p.useEffect(()=>(l(!1),u(!1),()=>{var f;(f=s.current)==null||f.abort(),s.current=null}),[e,t,n]);async function d(){if(s.current)return;const f=new AbortController;s.current=f,l(!0),u(!1);try{const h=await hTe(e,t,n,f.signal);if(f.signal.aborted)return;const m=URL.createObjectURL(h),g=document.createElement("a");try{g.href=m,g.download=n.slice(n.lastIndexOf("/")+1),document.body.appendChild(g),g.click()}finally{g.remove(),window.setTimeout(()=>URL.revokeObjectURL(m),0)}}catch{f.signal.aborted||u(!0)}finally{s.current===f&&(s.current=null,l(!1))}}return a.jsxs(a.Fragment,{children:[a.jsxs("a",{className:"sandbox-file-download",href:encodeURI(n),"aria-disabled":o,"aria-busy":o,onClick:f=>{f.preventDefault(),d()},children:[a.jsx("span",{"aria-hidden":"true",children:"↓"}),a.jsxs("span",{children:[r(o?"markdown.downloading":"markdown.downloadFile")," · ",i]})]}),c&&a.jsxs("span",{role:"alert",children:[" ",r("markdown.downloadFailed")]})]})}const Kst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M5.293 12.707a1 1 0 0 1 0-1.414l5-5a1 1 0 1 1 1.414 1.414L8.414 11H18a1 1 0 1 1 0 2H8.414l3.293 3.293a1 1 0 0 1-1.414 1.414l-5-5Z",clipRule:"evenodd"})}),Gst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M18.707 12.707a1 1 0 0 0 0-1.414l-5-5a1 1 0 1 0-1.414 1.414L15.586 11H6a1 1 0 1 0 0 2h9.586l-3.293 3.293a1 1 0 0 0 1.414 1.414l5-5Z",clipRule:"evenodd"})}),Xst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M4.47192 2.5C5.02421 2.5 5.47192 2.94772 5.47192 3.5V5.07196C7.17065 3.47759 9.45675 2.5 11.9719 2.5C17.2186 2.5 21.4719 6.75329 21.4719 12C21.4719 17.2467 17.2186 21.5 11.9719 21.5C7.10262 21.5 3.0902 17.8375 2.53692 13.1164C2.47264 12.5679 2.8652 12.0711 3.41373 12.0068C3.96226 11.9425 4.45904 12.3351 4.52333 12.8836C4.95991 16.6089 8.12901 19.5 11.9719 19.5C16.1141 19.5 19.4719 16.1421 19.4719 12C19.4719 7.85786 16.1141 4.5 11.9719 4.5C9.75153 4.5 7.75552 5.46469 6.38146 7H9.00003C9.55232 7 10 7.44772 10 8C10 8.55228 9.55232 9 9.00003 9H4.47192C3.93256 9 3.49293 8.57299 3.47265 8.03859C3.47175 8.01771 3.47151 7.99677 3.47192 7.9758V3.5C3.47192 2.94772 3.91964 2.5 4.47192 2.5Z",fill:"currentColor"})}),YD=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M2.55823 12C2.55823 6.75329 6.81152 2.5 12.0582 2.5C14.5734 2.5 16.8595 3.47759 18.5582 5.07197V3.5C18.5582 2.94772 19.0059 2.5 19.5582 2.5C20.1105 2.5 20.5582 2.94772 20.5582 3.5V7.97591C20.5586 7.99622 20.5584 8.01651 20.5576 8.03674C20.5382 8.572 20.0982 9 19.5582 9H15.0582C14.5059 9 14.0582 8.55228 14.0582 8C14.0582 7.44772 14.5059 7 15.0582 7H17.6487C16.2746 5.46469 14.2786 4.5 12.0582 4.5C7.91609 4.5 4.55823 7.85786 4.55823 12C4.55823 16.1421 7.91609 19.5 12.0582 19.5C15.9011 19.5 19.0702 16.6089 19.5068 12.8836C19.5711 12.3351 20.0679 11.9425 20.6164 12.0068C21.165 12.0711 21.5575 12.5679 21.4932 13.1164C20.94 17.8375 16.9275 21.5 12.0582 21.5C6.81152 21.5 2.55823 17.2467 2.55823 12Z",fill:"currentColor"})}),s_=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M16.243 6.757a1 1 0 0 1 1 1v7.072a1 1 0 0 1-2 0v-4.657L8.464 16.95a1 1 0 0 1-1.414-1.414l6.778-6.779H9.172a1 1 0 0 1 0-2h7.07Z",clipRule:"evenodd"})}),Yst=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M10.663 6.3872C10.8152 6.29068 11 6.40984 11 6.59007V8C11 8.55229 11.4477 9 12 9C12.5523 9 13 8.55229 13 8V6.59007C13 6.40984 13.1848 6.29068 13.337 6.3872C14.036 6.83047 14.5 7.61105 14.5 8.5C14.5 9.53284 13.8737 10.4194 12.9801 10.8006C12.9932 10.865 13 10.9317 13 11V13C13 13.5523 12.5523 14 12 14C11.4477 14 11 13.5523 11 13V11C11 10.9317 11.0068 10.865 11.0199 10.8006C10.1263 10.4194 9.5 9.53284 9.5 8.5C9.5 7.61105 9.96397 6.83047 10.663 6.3872Z",fill:"currentColor"}),a.jsx("path",{d:"M17.9754 4.01031C17.8588 4.00078 17.6965 4.00001 17.4 4.00001H9.8C8.94342 4.00001 8.36113 4.00078 7.91104 4.03756C7.47262 4.07338 7.24842 4.1383 7.09202 4.21799C6.7157 4.40974 6.40973 4.7157 6.21799 5.09202C6.1383 5.24842 6.07337 5.47263 6.03755 5.91104C6.00078 6.36113 6 6.94343 6 7.80001V16.1707C6.31278 16.0602 6.64937 16 7 16H18L18 4.60001C18 4.30348 17.9992 4.14122 17.9897 4.02464C17.9893 4.02 17.9889 4.0156 17.9886 4.01145C17.9844 4.01107 17.98 4.01069 17.9754 4.01031ZM17.657 18H7C6.44772 18 6 18.4477 6 19C6 19.5523 6.44772 20 7 20H17.657C17.5343 19.3301 17.5343 18.6699 17.657 18ZM4 19L4 7.75871C3.99999 6.95374 3.99998 6.28937 4.04419 5.74818C4.09012 5.18608 4.18868 4.66938 4.43597 4.18404C4.81947 3.43139 5.43139 2.81947 6.18404 2.43598C6.66937 2.18869 7.18608 2.09012 7.74818 2.0442C8.28937 1.99998 8.95373 1.99999 9.7587 2L17.4319 2C17.6843 1.99997 17.9301 1.99994 18.1382 2.01695C18.3668 2.03563 18.6366 2.07969 18.908 2.21799C19.2843 2.40974 19.5903 2.7157 19.782 3.09203C19.9203 3.36345 19.9644 3.63318 19.9831 3.86178C20.0001 4.06994 20 4.31574 20 4.56812L20 17C20 17.1325 19.9736 17.2638 19.9225 17.386C19.4458 18.5253 19.4458 19.4747 19.9225 20.614C20.0517 20.9227 20.0179 21.2755 19.8325 21.5541C19.6471 21.8326 19.3346 22 19 22H7C5.34315 22 4 20.6569 4 19Z",fill:"currentColor"})]}),mC=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M18.063 5.674a1 1 0 0 1 .263 1.39l-7.5 11a1 1 0 0 1-1.533.143l-4.5-4.5a1 1 0 1 1 1.414-1.414l3.647 3.647 6.82-10.003a1 1 0 0 1 1.39-.263Z",clipRule:"evenodd"})}),Rje=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM16.0755 7.93219C16.5272 8.25003 16.6356 8.87383 16.3178 9.32549L11.5678 16.0755C11.3931 16.3237 11.1152 16.4792 10.8123 16.4981C10.5093 16.517 10.2142 16.3973 10.0101 16.1727L7.51006 13.4227C7.13855 13.014 7.16867 12.3816 7.57733 12.0101C7.98598 11.6386 8.61843 11.6687 8.98994 12.0773L10.6504 13.9039L14.6822 8.17451C15 7.72284 15.6238 7.61436 16.0755 7.93219Z",fill:"currentColor"})}),Zst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 9",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.292893 0.292893C0.683418 -0.0976311 1.31658 -0.0976311 1.70711 0.292893L8 6.58579L14.2929 0.292894C14.6834 -0.0976305 15.3166 -0.0976304 15.7071 0.292894C16.0976 0.683418 16.0976 1.31658 15.7071 1.70711L8.70711 8.70711C8.31658 9.09763 7.68342 9.09763 7.29289 8.70711L0.292893 1.70711C-0.0976311 1.31658 -0.0976311 0.683417 0.292893 0.292893Z"})}),Jst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M15.707 4.293a1 1 0 0 1 0 1.414L9.414 12l6.293 6.293a1 1 0 0 1-1.414 1.414l-7-7a1 1 0 0 1 0-1.414l7-7a1 1 0 0 1 1.414 0Z",clipRule:"evenodd"})}),eat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M8.293 4.293a1 1 0 0 1 1.414 0l7 7a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414-1.414L14.586 12 8.293 5.707a1 1 0 0 1 0-1.414Z",clipRule:"evenodd"})}),pV=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM12 6C12.5523 6 13 6.44772 13 7V12C13 12.2652 12.8946 12.5196 12.7071 12.7071L10.2071 15.2071C9.81658 15.5976 9.18342 15.5976 8.79289 15.2071C8.40237 14.8166 8.40237 14.1834 8.79289 13.7929L11 11.5858V7C11 6.44772 11.4477 6 12 6Z",fill:"currentColor"})}),tat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12.659 9.753a1 1 0 0 1-1.318 0l-4-3.5A1 1 0 1 1 8.66 4.747L12 7.671l3.341-2.924a1 1 0 1 1 1.318 1.506l-4 3.5Zm-4.002 9.501a1 1 0 1 1-1.314-1.508l4-3.485a1 1 0 0 1 1.314 0l4 3.485a1 1 0 1 1-1.314 1.508L12 16.34l-3.343 2.913Z"})}),Ije=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12.7587 2H16.2413C17.0463 1.99999 17.7106 1.99998 18.2518 2.04419C18.8139 2.09012 19.3306 2.18868 19.816 2.43597C20.5686 2.81947 21.1805 3.43139 21.564 4.18404C21.8113 4.66937 21.9099 5.18608 21.9558 5.74817C22 6.28936 22 6.95372 22 7.75868V11.2413C22 12.0463 22 12.7106 21.9558 13.2518C21.9099 13.8139 21.8113 14.3306 21.564 14.816C21.1805 15.5686 20.5686 16.1805 19.816 16.564C19.3306 16.8113 18.8139 16.9099 18.2518 16.9558C17.8906 16.9853 17.4745 16.9951 16.9984 16.9984C16.9951 17.4745 16.9853 17.8906 16.9558 18.2518C16.9099 18.8139 16.8113 19.3306 16.564 19.816C16.1805 20.5686 15.5686 21.1805 14.816 21.564C14.3306 21.8113 13.8139 21.9099 13.2518 21.9558C12.7106 22 12.0463 22 11.2413 22H7.75868C6.95372 22 6.28936 22 5.74818 21.9558C5.18608 21.9099 4.66937 21.8113 4.18404 21.564C3.43139 21.1805 2.81947 20.5686 2.43597 19.816C2.18868 19.3306 2.09012 18.8139 2.04419 18.2518C1.99998 17.7106 1.99999 17.0463 2 16.2413V12.7587C1.99999 11.9537 1.99998 11.2894 2.04419 10.7482C2.09012 10.1861 2.18868 9.66937 2.43597 9.18404C2.81947 8.43139 3.43139 7.81947 4.18404 7.43598C4.66937 7.18868 5.18608 7.09012 5.74817 7.04419C6.10939 7.01468 6.52548 7.00487 7.00162 7.00162C7.00487 6.52548 7.01468 6.10939 7.04419 5.74817C7.09012 5.18608 7.18868 4.66937 7.43598 4.18404C7.81947 3.43139 8.43139 2.81947 9.18404 2.43597C9.66937 2.18868 10.1861 2.09012 10.7482 2.04419C11.2894 1.99998 11.9537 1.99999 12.7587 2ZM9.00176 7L11.2413 7C12.0463 6.99999 12.7106 6.99998 13.2518 7.04419C13.8139 7.09012 14.3306 7.18868 14.816 7.43598C15.5686 7.81947 16.1805 8.43139 16.564 9.18404C16.8113 9.66937 16.9099 10.1861 16.9558 10.7482C17 11.2894 17 11.9537 17 12.7587V14.9982C17.4455 14.9951 17.7954 14.9864 18.089 14.9624C18.5274 14.9266 18.7516 14.8617 18.908 14.782C19.2843 14.5903 19.5903 14.2843 19.782 13.908C19.8617 13.7516 19.9266 13.5274 19.9624 13.089C19.9992 12.6389 20 12.0566 20 11.2V7.8C20 6.94342 19.9992 6.36113 19.9624 5.91104C19.9266 5.47262 19.8617 5.24842 19.782 5.09202C19.5903 4.7157 19.2843 4.40973 18.908 4.21799C18.7516 4.1383 18.5274 4.07337 18.089 4.03755C17.6389 4.00078 17.0566 4 16.2 4H12.8C11.9434 4 11.3611 4.00078 10.911 4.03755C10.4726 4.07337 10.2484 4.1383 10.092 4.21799C9.7157 4.40973 9.40973 4.7157 9.21799 5.09202C9.1383 5.24842 9.07337 5.47262 9.03755 5.91104C9.01357 6.20463 9.00489 6.55447 9.00176 7ZM5.91104 9.03755C5.47262 9.07337 5.24842 9.1383 5.09202 9.21799C4.7157 9.40973 4.40973 9.7157 4.21799 10.092C4.1383 10.2484 4.07337 10.4726 4.03755 10.911C4.00078 11.3611 4 11.9434 4 12.8V16.2C4 17.0566 4.00078 17.6389 4.03755 18.089C4.07337 18.5274 4.1383 18.7516 4.21799 18.908C4.40973 19.2843 4.7157 19.5903 5.09202 19.782C5.24842 19.8617 5.47262 19.9266 5.91104 19.9624C6.36113 19.9992 6.94342 20 7.8 20H11.2C12.0566 20 12.6389 19.9992 13.089 19.9624C13.5274 19.9266 13.7516 19.8617 13.908 19.782C14.2843 19.5903 14.5903 19.2843 14.782 18.908C14.8617 18.7516 14.9266 18.5274 14.9624 18.089C14.9992 17.6389 15 17.0566 15 16.2V12.8C15 11.9434 14.9992 11.3611 14.9624 10.911C14.9266 10.4726 14.8617 10.2484 14.782 10.092C14.5903 9.7157 14.2843 9.40973 13.908 9.21799C13.7516 9.1383 13.5274 9.07337 13.089 9.03755C12.6389 9.00078 12.0566 9 11.2 9H7.8C6.94342 9 6.36113 9.00078 5.91104 9.03755Z",fill:"currentColor"})}),nat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M10.556 4a1 1 0 0 0-.97.751l-.292 1.14h5.421l-.293-1.14A1 1 0 0 0 13.453 4h-2.897Zm6.224 1.892-.421-1.639A3 3 0 0 0 13.453 2h-2.897A3 3 0 0 0 7.65 4.253l-.421 1.639H4a1 1 0 1 0 0 2h.1l1.215 11.425A3 3 0 0 0 8.3 22h7.4a3 3 0 0 0 2.984-2.683l1.214-11.425H20a1 1 0 1 0 0-2h-3.22Zm1.108 2H6.112l1.192 11.214A1 1 0 0 0 8.3 20h7.4a1 1 0 0 0 .995-.894l1.192-11.214ZM10 10a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0v-5a1 1 0 0 1 1-1Zm4 0a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0v-5a1 1 0 0 1 1-1Z",clipRule:"evenodd"})}),iat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M3 12a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm7 0a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm7 0a2 2 0 1 1 4 0 2 2 0 0 1-4 0Z"})}),rat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 10 16",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.34151 0.747423C4.71854 0.417526 5.28149 0.417526 5.65852 0.747423L9.65852 4.24742C10.0742 4.61111 10.1163 5.24287 9.75259 5.6585C9.38891 6.07414 8.75715 6.11626 8.34151 5.75258L5.00001 2.82877L1.65852 5.75258C1.24288 6.11626 0.61112 6.07414 0.247438 5.6585C-0.116244 5.24287 -0.0741267 4.61111 0.34151 4.24742L4.34151 0.747423ZM0.246065 10.3578C0.608879 9.94139 1.24055 9.89795 1.65695 10.2608L5.00001 13.1737L8.34308 10.2608C8.75948 9.89795 9.39115 9.94139 9.75396 10.3578C10.1168 10.7742 10.0733 11.4058 9.65695 11.7687L5.65695 15.2539C5.28043 15.582 4.7196 15.582 4.34308 15.2539L0.343082 11.7687C-0.0733128 11.4058 -0.116749 10.7742 0.246065 10.3578Z"})}),sat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M16.793 2.793a3.121 3.121 0 1 1 4.414 4.414l-8.5 8.5A1 1 0 0 1 12 16H9a1 1 0 0 1-1-1v-3a1 1 0 0 1 .293-.707l8.5-8.5Zm3 1.414a1.121 1.121 0 0 0-1.586 0L10 12.414V14h1.586l8.207-8.207a1.121 1.121 0 0 0 0-1.586ZM6 5a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-4a1 1 0 1 1 2 0v4a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h4a1 1 0 1 1 0 2H6Z",clipRule:"evenodd"})}),aat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M12 7a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0V8h-3a1 1 0 0 1-1-1Zm-5 5a1 1 0 0 1 1 1v3h3a1 1 0 1 1 0 2H7a1 1 0 0 1-1-1v-4a1 1 0 0 1 1-1Z",clipRule:"evenodd"})}),oat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8-10C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm4.465 6.763a1 1 0 0 0-1.228-1.228l-5.5 1.5a1 1 0 0 0-.702.702l-1.5 5.5a1 1 0 0 0 1.228 1.228l5.5-1.5a1 1 0 0 0 .702-.702l1.5-5.5Zm-6.54 5.312.89-3.26 3.26-.89-.89 3.26-3.26.89Z",clipRule:"evenodd"})}),lat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M14.4472 7.10558C14.9412 7.35257 15.1414 7.95324 14.8944 8.44722L10.8944 16.4472C10.6474 16.9412 10.0468 17.1414 9.55279 16.8944C9.05881 16.6474 8.85858 16.0468 9.10557 15.5528L13.1056 7.55279C13.3526 7.05881 13.9532 6.85859 14.4472 7.10558ZM6.6 7.20001C7.04183 7.53138 7.13137 8.15818 6.8 8.60001L4.25 12L6.8 15.4C7.13137 15.8418 7.04183 16.4686 6.6 16.8C6.15817 17.1314 5.53137 17.0418 5.2 16.6L2.2 12.6C1.93333 12.2444 1.93333 11.7556 2.2 11.4L5.2 7.40001C5.53137 6.95818 6.15817 6.86863 6.6 7.20001ZM17.4 7.20001C17.8418 6.86863 18.4686 6.95818 18.8 7.40001L21.8 11.4C22.0667 11.7556 22.0667 12.2444 21.8 12.6L18.8 16.6C18.4686 17.0418 17.8418 17.1314 17.4 16.8C16.9582 16.4686 16.8686 15.8418 17.2 15.4L19.75 12L17.2 8.60001C16.8686 8.15818 16.9582 7.53138 17.4 7.20001Z",fill:"currentColor"})}),Pje=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M13 12a1 1 0 1 0-2 0v4a1 1 0 1 0 2 0v-4Zm-1-2.5A1.25 1.25 0 1 0 12 7a1.25 1.25 0 0 0 0 2.5Z"}),a.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z",clipRule:"evenodd"})]}),cat=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M7.79289 9.04289C8.18342 8.65237 8.81658 8.65237 9.20711 9.04289L11.4571 11.2929C11.8476 11.6834 11.8476 12.3166 11.4571 12.7071L9.20711 14.9571C8.81658 15.3476 8.18342 15.3476 7.79289 14.9571C7.40237 14.5666 7.40237 13.9334 7.79289 13.5429L9.33579 12L7.79289 10.4571C7.40237 10.0666 7.40237 9.43342 7.79289 9.04289ZM12.25 14.25C12.25 13.6977 12.6977 13.25 13.25 13.25H15.5C16.0523 13.25 16.5 13.6977 16.5 14.25C16.5 14.8023 16.0523 15.25 15.5 15.25H13.25C12.6977 15.25 12.25 14.8023 12.25 14.25Z",fill:"currentColor"}),a.jsx("path",{d:"M2 8C2 5.79086 3.79086 4 6 4C6.55228 4 7 4.44772 7 5C7 5.55228 6.55228 6 6 6C4.89543 6 4 6.89543 4 8V16C4 17.1046 4.89543 18 6 18C6.55228 18 7 18.4477 7 19C7 19.5523 6.55228 20 6 20C3.79086 20 2 18.2091 2 16V8ZM17 5C17 4.44772 17.4477 4 18 4C20.2091 4 22 5.79086 22 8V16C22 18.2091 20.2091 20 18 20C17.4477 20 17 19.5523 17 19C17 18.4477 17.4477 18 18 18C19.1046 18 20 17.1046 20 16V8C20 6.89543 19.1046 6 18 6C17.4477 6 17 5.55228 17 5Z",fill:"currentColor"})]}),uat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M6 12C6 11.4477 6.44772 11 7 11H17C17.5523 11 18 11.4477 18 12C18 12.5523 17.5523 13 17 13H7C6.44772 13 6 12.5523 6 12Z",fill:"currentColor"})}),dat=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M12.75 9.50001C12.75 9.08579 13.0858 8.75001 13.5 8.75001H14.5C14.9142 8.75001 15.25 9.08579 15.25 9.50001V14.5C15.25 14.9142 14.9142 15.25 14.5 15.25H13.5C13.0858 15.25 12.75 14.9142 12.75 14.5V9.50001Z",fill:"currentColor"}),a.jsx("path",{d:"M9.50001 8.75001C9.08579 8.75001 8.75001 9.08579 8.75001 9.50001V14.5C8.75001 14.9142 9.08579 15.25 9.50001 15.25H10.5C10.9142 15.25 11.25 14.9142 11.25 14.5V9.50001C11.25 9.08579 10.9142 8.75001 10.5 8.75001H9.50001Z",fill:"currentColor"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.97144 12C1.97144 6.46138 6.46138 1.97144 12 1.97144C17.5386 1.97144 22.0286 6.46138 22.0286 12C22.0286 17.5386 17.5386 22.0286 12 22.0286C6.46138 22.0286 1.97144 17.5386 1.97144 12ZM12 4.02858C7.59751 4.02858 4.02858 7.59751 4.02858 12C4.02858 16.4025 7.59751 19.9714 12 19.9714C16.4025 19.9714 19.9714 16.4025 19.9714 12C19.9714 7.59751 16.4025 4.02858 12 4.02858Z",fill:"currentColor"})]}),YJ=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M9.5 9.33165V14.6683C9.5 15.4595 10.3752 15.9373 11.0408 15.5095L15.1915 12.8412C15.8038 12.4475 15.8038 11.5524 15.1915 11.1588L11.0408 8.49047C10.3752 8.06265 9.5 8.54049 9.5 9.33165Z",fill:"currentColor"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12Z",fill:"currentColor"})]}),fat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M8 16.7229V7.27711C8 6.29075 9.08894 5.69298 9.9211 6.22254L17.3428 10.9454C18.1147 11.4366 18.1147 12.5634 17.3428 13.0546L9.92109 17.7775C9.08894 18.3071 8 17.7093 8 16.7229Z",fill:"currentColor"})}),Dje=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M12 5a1 1 0 0 1 1 1v5h5a1 1 0 1 1 0 2h-5v5a1 1 0 1 1-2 0v-5H6a1 1 0 1 1 0-2h5V6a1 1 0 0 1 1-1Z",clipRule:"evenodd"})}),Mje=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12 3C12.5523 3 13 3.44772 13 4L13 11H20C20.5523 11 21 11.4477 21 12C21 12.5523 20.5523 13 20 13L13 13L13 20C13 20.5523 12.5523 21 12 21C11.4477 21 11 20.5523 11 20L11 13L4 13C3.44772 13 3 12.5523 3 12C3 11.4477 3.44772 11 4 11L11 11L11 4C11 3.44772 11.4477 3 12 3Z",fill:"currentColor"})}),hat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12 6C12.5523 6 13 6.44772 13 7V11H17C17.5523 11 18 11.4477 18 12C18 12.5523 17.5523 13 17 13H13V17C13 17.5523 12.5523 18 12 18C11.4477 18 11 17.5523 11 17V13H7C6.44772 13 6 12.5523 6 12C6 11.4477 6.44772 11 7 11H11V7C11 6.44772 11.4477 6 12 6Z",fill:"currentColor"})}),pat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.875 4.5C7.35418 4.5 4.5 7.35418 4.5 10.875C4.5 14.3958 7.35418 17.25 10.875 17.25C14.3958 17.25 17.25 14.3958 17.25 10.875C17.25 7.35418 14.3958 4.5 10.875 4.5ZM2.5 10.875C2.5 6.24962 6.24962 2.5 10.875 2.5C15.5004 2.5 19.25 6.24962 19.25 10.875C19.25 12.8273 18.582 14.6236 17.462 16.0478L21.2071 19.7929C21.5976 20.1834 21.5976 20.8166 21.2071 21.2071C20.8166 21.5976 20.1834 21.5976 19.7929 21.2071L16.0478 17.462C14.6236 18.582 12.8273 19.25 10.875 19.25C6.24962 19.25 2.5 15.5004 2.5 10.875Z",fill:"currentColor"})}),mat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M11.2929 3.29289C11.6834 2.90237 12.3166 2.90237 12.7071 3.29289L16.7071 7.29289C17.0976 7.68342 17.0976 8.31658 16.7071 8.70711C16.3166 9.09763 15.6834 9.09763 15.2929 8.70711L13 6.41421V15C13 15.5523 12.5523 16 12 16C11.4477 16 11 15.5523 11 15V6.41421L8.70711 8.70711C8.31658 9.09763 7.68342 9.09763 7.29289 8.70711C6.90237 8.31658 6.90237 7.68342 7.29289 7.29289L11.2929 3.29289ZM4 14C4.55229 14 5 14.4477 5 15V15.2C5 16.0566 5.00078 16.6389 5.03755 17.089C5.07337 17.5274 5.1383 17.7516 5.21799 17.908C5.40973 18.2843 5.7157 18.5903 6.09202 18.782C6.24842 18.8617 6.47262 18.9266 6.91104 18.9624C7.36113 18.9992 7.94342 19 8.8 19H15.2C16.0566 19 16.6389 18.9992 17.089 18.9624C17.5274 18.9266 17.7516 18.8617 17.908 18.782C18.2843 18.5903 18.5903 18.2843 18.782 17.908C18.8617 17.7516 18.9266 17.5274 18.9624 17.089C18.9992 16.6389 19 16.0566 19 15.2V15C19 14.4477 19.4477 14 20 14C20.5523 14 21 14.4477 21 15V15.2413C21 16.0463 21 16.7106 20.9558 17.2518C20.9099 17.8139 20.8113 18.3306 20.564 18.816C20.1805 19.5686 19.5686 20.1805 18.816 20.564C18.3306 20.8113 17.8139 20.9099 17.2518 20.9558C16.7106 21 16.0463 21 15.2413 21H8.75868C7.95372 21 7.28936 21 6.74817 20.9558C6.18608 20.9099 5.66937 20.8113 5.18404 20.564C4.43139 20.1805 3.81947 19.5686 3.43597 18.816C3.18868 18.3306 3.09012 17.8139 3.04419 17.2518C2.99998 16.7106 2.99999 16.0463 3 15.2413L3 15C3 14.4477 3.44772 14 4 14Z",fill:"currentColor"})}),gat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M6 8C6 6.89543 6.89543 6 8 6H16C17.1046 6 18 6.89543 18 8V16C18 17.1046 17.1046 18 16 18H8C6.89543 18 6 17.1046 6 16V8Z",fill:"currentColor"})}),bat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M14.5 4a5.5 5.5 0 0 0-5.078 7.616 1 1 0 0 1-.216 1.092l-4.749 4.75a1.475 1.475 0 0 0 2.086 2.085l4.749-4.749a1 1 0 0 1 1.092-.216A5.5 5.5 0 0 0 20 9.414l-1.293 1.293a3.828 3.828 0 1 1-5.414-5.414L14.585 4H14.5ZM7 9.5a7.5 7.5 0 0 1 9.969-7.084 1 1 0 0 1 .378 1.651l-2.64 2.64a1.829 1.829 0 0 0 2.586 2.586l2.64-2.64a1 1 0 0 1 1.651.378 7.5 7.5 0 0 1-9.328 9.627l-4.299 4.3a3.475 3.475 0 0 1-4.914-4.915l4.299-4.299A7.497 7.497 0 0 1 7 9.5Z"})}),mN=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M8.99805 16.796C8.99805 15.4164 7.87961 14.2979 6.5 14.2979C5.12039 14.2979 4.00195 15.4164 4.00195 16.796C4.00196 18.1756 5.1204 19.294 6.5 19.294C7.8796 19.294 8.99804 18.1756 8.99805 16.796ZM19.748 15.0479C19.748 14.7729 19.525 14.5499 19.25 14.5499H15.75C15.475 14.5499 15.252 14.7729 15.252 15.0479V18.5479C15.252 18.823 15.475 19.046 15.75 19.046H19.25C19.525 19.046 19.748 18.823 19.748 18.5479V15.0479ZM10.0469 3.45125C11.077 2.15921 13.0849 2.20276 14.0498 3.58113L16.4189 6.96492L16.5205 7.12215C17.5046 8.76341 16.3301 10.9023 14.3691 10.9024H9.63086C7.60676 10.9023 6.42029 8.62316 7.58105 6.96492L9.9502 3.58113L10.0469 3.45125ZM12.4082 4.73055C12.2223 4.46497 11.842 4.44826 11.6318 4.68074L11.5918 4.73055L9.22266 8.11433C8.99176 8.44435 9.22808 8.89744 9.63086 8.89754H14.3691C14.7468 8.89745 14.9774 8.49957 14.8145 8.17781L14.7773 8.11433L12.4082 4.73055ZM11.002 16.796C11.0019 19.2824 8.98638 21.2979 6.5 21.2979C4.01362 21.2979 1.99806 19.2824 1.99805 16.796C1.99805 14.3096 4.01361 12.294 6.5 12.294C8.98639 12.294 11.002 14.3096 11.002 16.796ZM21.752 18.5479C21.752 19.9297 20.6318 21.0499 19.25 21.0499H15.75C14.3682 21.0499 13.248 19.9297 13.248 18.5479V15.0479C13.2481 13.6662 14.3682 12.546 15.75 12.546H19.25C20.6318 12.546 21.7519 13.6662 21.752 15.0479V18.5479Z",fill:"currentColor"})}),yat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5555 4C10.099 4 9.70052 4.30906 9.58693 4.75114L9.29382 5.8919H14.715L14.4219 4.75114C14.3083 4.30906 13.9098 4 13.4533 4H10.5555ZM16.7799 5.8919L16.3589 4.25342C16.0182 2.92719 14.8226 2 13.4533 2H10.5555C9.18616 2 7.99062 2.92719 7.64985 4.25342L7.22886 5.8919H4C3.44772 5.8919 3 6.33961 3 6.8919C3 7.44418 3.44772 7.8919 4 7.8919H4.10069L5.31544 19.3172C5.47763 20.8427 6.76455 22 8.29863 22H15.7014C17.2354 22 18.5224 20.8427 18.6846 19.3172L19.8993 7.8919H20C20.5523 7.8919 21 7.44418 21 6.8919C21 6.33961 20.5523 5.8919 20 5.8919H16.7799ZM17.888 7.8919H6.11196L7.30423 19.1057C7.3583 19.6142 7.78727 20 8.29863 20H15.7014C16.2127 20 16.6417 19.6142 16.6958 19.1057L17.888 7.8919ZM10 10C10.5523 10 11 10.4477 11 11V16C11 16.5523 10.5523 17 10 17C9.44772 17 9 16.5523 9 16V11C9 10.4477 9.44772 10 10 10ZM14 10C14.5523 10 15 10.4477 15 11V16C15 16.5523 14.5523 17 14 17C13.4477 17 13 16.5523 13 16V11C13 10.4477 13.4477 10 14 10Z"})}),vat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M7.5 5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5ZM3 7.5a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM17 6a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm-4 2a4 4 0 1 1 8 0 4 4 0 0 1-8 0Zm-8.96 8.247C3.137 17.048 2.5 18.271 2.5 20a1 1 0 1 1-2 0c0-2.271.862-4.049 2.21-5.248C4.042 13.57 5.788 13 7.5 13s3.459.57 4.79 1.752c1.348 1.2 2.21 2.977 2.21 5.248a1 1 0 1 1-2 0c0-1.729-.638-2.952-1.54-3.753C10.042 15.43 8.788 15 7.5 15s-2.541.43-3.46 1.247Zm15.757-.607c-1.009-.638-2.338-.807-3.526-.472a1 1 0 0 1-.542-1.925c1.695-.478 3.616-.255 5.136.706 1.558.984 2.635 2.707 2.635 5.051a1 1 0 1 1-2 0c0-1.665-.732-2.746-1.703-3.36Z",clipRule:"evenodd"})}),Lje=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M10.42 2.006a4 4 0 0 1 3.159 0c.674.29 1.188.822 1.667 1.456.474.627 1 1.473 1.653 2.523l3.542 5.696c.72 1.16 1.3 2.09 1.682 2.854.384.766.654 1.517.59 2.292a4 4 0 0 1-1.604 2.886c-.625.463-1.405.63-2.258.709-.85.078-1.945.078-3.311.078H8.46c-1.366 0-2.46 0-3.31-.078-.854-.078-1.634-.246-2.26-.71a4 4 0 0 1-1.603-2.885c-.064-.775.206-1.526.59-2.292.383-.764.961-1.694 1.682-2.854l3.542-5.696c.653-1.05 1.18-1.896 1.653-2.523.48-.634.993-1.166 1.667-1.456Zm2.37 1.838a2 2 0 0 0-1.58 0c-.192.083-.448.28-.86.825-.413.544-.891 1.312-1.577 2.415l-3.488 5.61c-.755 1.214-1.283 2.066-1.62 2.737-.34.678-.402 1.02-.385 1.232a2 2 0 0 0 .802 1.443c.171.127.494.255 1.25.324.748.069 1.75.07 3.18.07h6.976c1.43 0 2.432-.001 3.18-.07.756-.069 1.079-.197 1.25-.324a2 2 0 0 0 .802-1.443c.017-.212-.045-.554-.385-1.232-.337-.671-.865-1.523-1.62-2.737l-3.488-5.61c-.686-1.103-1.164-1.87-1.576-2.415-.413-.546-.67-.742-.861-.825"}),a.jsx("path",{d:"M12 7.5a1 1 0 0 1 1 1v3a1 1 0 1 1-2 0v-3a1 1 0 0 1 1-1M10.851 15a1.15 1.15 0 1 1 2.3 0 1.15 1.15 0 0 1-2.3 0"})]}),mV=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M5.636 5.636a1 1 0 0 1 1.414 0l4.95 4.95 4.95-4.95a1 1 0 0 1 1.414 1.414L13.414 12l4.95 4.95a1 1 0 0 1-1.414 1.414L12 13.414l-4.95 4.95a1 1 0 0 1-1.414-1.414l4.95-4.95-4.95-4.95a1 1 0 0 1 0-1.414Z",clipRule:"evenodd"})});/** + */var LD=p,hnt=XP;function pnt(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var mnt=typeof Object.is=="function"?Object.is:pnt,gnt=hnt.useSyncExternalStore,bnt=LD.useRef,ynt=LD.useEffect,vnt=LD.useMemo,xnt=LD.useDebugValue;Z2e.useSyncExternalStoreWithSelector=function(e,t,n,i,r){var s=bnt(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=vnt(function(){function c(m){if(!u){if(u=!0,d=m,m=i(m),r!==void 0&&o.hasValue){var g=o.value;if(r(g,m))return f=g}return f=m}if(g=f,mnt(d,m))return g;var b=i(m);return r!==void 0&&r(g,b)?(d=m,g):(d=m,f=b)}var u=!1,d,f,h=n===void 0?null:n;return[function(){return c(t())},h===null?void 0:function(){return c(h())}]},[t,n,i,r]);var l=gnt(e,s[0],s[1]);return ynt(function(){o.hasValue=!0,o.value=l},[l]),xnt(l),l};Y2e.exports=Z2e;var J2e=Y2e.exports;const wnt=N1(J2e),knt=parseInt(p.version,10);function zz(e){return knt>=e}const Ont=zz(19),Snt=Ont?Cnt:Ant;function e_e(e,t,n,i,r){return Snt(e,t,n,i,r)}function Ent(e,t,n,i,r){const s=p.useCallback(()=>t(e.getSnapshot(),n,i,r),[e,t,n,i,r]);return XP.useSyncExternalStore(e.subscribe,s,s)}function Cnt(e,t,n,i,r){return Ent(e,t,n,i,r)}function Ant(e,t,n,i,r){return J2e.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,i,r))}class Tnt{constructor(t){Zt(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));Zt(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const i of this.listeners){if(n!==this.updateTick)return;i(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,i,r){return e_e(this,t,n,i,r)}}const Vz={..._v},A3=Vz.useInsertionEffect,_nt=A3&&A3!==Vz.useLayoutEffect?A3:e=>e();function oi(e){const t=Td(jnt).current;return t.next=e,_nt(t.effect),t.trampoline}function jnt(){const e={next:void 0,callback:Nnt,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function Nnt(){}class $D extends Tnt{constructor(t,n={},i){super(t),this.context=n,this.selectors=i}useSyncedValue(t,n){p.useDebugValue(t);const i=this;ti(()=>{i.state[t]!==n&&i.set(t,n)},[i,t,n])}useSyncedValueWithCleanup(t,n){const i=this;ti(()=>(i.state[t]!==n&&i.set(t,n),()=>{i.set(t,void 0)}),[i,t,n])}useSyncedValues(t){const n=this,i=Object.values(t);ti(()=>{n.update(t)},[n,...i])}useControlledProp(t,n){p.useDebugValue(t);const i=this,r=n!==void 0;ti(()=>{r&&!Object.is(i.state[t],n)&&i.setState({...i.state,[t]:n})},[i,t,n,r])}select(t,n,i,r){const s=this.selectors[t];return s(this.state,n,i,r)}useState(t,n,i,r){return p.useDebugValue(t),e_e(this,this.selectors[t],n,i,r)}useContextCallback(t,n){p.useDebugValue(t);const i=oi(n??Uz);this.context[t]=i}useStateSetter(t){const n=p.useRef(void 0);return n.current===void 0&&(n.current=i=>{this.set(t,i)}),n.current}observe(t,n){let i;typeof t=="function"?i=t:i=this.selectors[t];let r=i(this.state);return n(r,r,this),this.subscribe(s=>{const o=i(s);if(!Object.is(r,o)){const l=r;r=o,n(o,l,this)}})}}function FD(){return typeof window<"u"}function dl(e){return Hz(e)?(e.nodeName||"").toLowerCase():"#document"}function ea(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function pm(e){var t;return(t=(Hz(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Hz(e){return FD()?e instanceof Node||e instanceof ea(e).Node:!1}function Tr(e){return FD()?e instanceof Element||e instanceof ea(e).Element:!1}function Zs(e){return FD()?e instanceof HTMLElement||e instanceof ea(e).HTMLElement:!1}function Zw(e){return!FD()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ea(e).ShadowRoot}function HA(e){const{overflow:t,overflowX:n,overflowY:i,display:r}=Uu(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&r!=="inline"&&r!=="contents"}function Rnt(e){return/^(table|td|th)$/.test(dl(e))}function BD(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Int=/transform|translate|scale|rotate|perspective|filter/,Pnt=/paint|layout|strict|content/,Hb=e=>!!e&&e!=="none";let T3;function qz(e){const t=Tr(e)?Uu(e):e;return Hb(t.transform)||Hb(t.translate)||Hb(t.scale)||Hb(t.rotate)||Hb(t.perspective)||!Wz()&&(Hb(t.backdropFilter)||Hb(t.filter))||Int.test(t.willChange||"")||Pnt.test(t.contain||"")}function Dnt(e){let t=Kg(e);for(;Zs(t)&&!Rg(t);){if(qz(t))return t;if(BD(t))return null;t=Kg(t)}return null}function Wz(){return T3==null&&(T3=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),T3}function Rg(e){return/^(html|body|#document)$/.test(dl(e))}function Uu(e){return ea(e).getComputedStyle(e)}function UD(e){return Tr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Kg(e){if(dl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Zw(e)&&e.host||pm(e);return Zw(t)?t.host:t}function t_e(e){const t=Kg(e);return Rg(t)?(e.ownerDocument||e).body:Zs(t)&&HA(t)?t:t_e(t)}function uC(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=t_e(e),s=r===((i=e.ownerDocument)==null?void 0:i.body),o=ea(r);if(s){const l=Y8(o);return t.concat(o,o.visualViewport||[],HA(r)?r:[],l&&n?uC(l):[])}else return t.concat(r,uC(r,[],n))}function Y8(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function yh(...e){return()=>{for(let t=0;t{e.removeEventListener(t,n,i)}}const Z2=null;let Mnt=class{constructor(){Zt(this,"callbacks",[]);Zt(this,"callbacksCount",0);Zt(this,"nextId",1);Zt(this,"startId",1);Zt(this,"isScheduled",!1);Zt(this,"tick",t=>{var r;this.isScheduled=!1;const n=this.callbacks,i=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,i>0)for(let s=0;s=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}},J2=new Mnt;class Cc{constructor(){Zt(this,"currentId",Z2);Zt(this,"cancel",()=>{this.currentId!==Z2&&(J2.cancel(this.currentId),this.currentId=Z2)});Zt(this,"disposeEffect",()=>this.cancel)}static create(){return new Cc}static request(t){return J2.request(t)}static cancel(t){return J2.cancel(t)}request(t){this.cancel(),this.currentId=J2.request(()=>{this.currentId=Z2,t()})}}function Kz(){const e=Td(Cc.create).current;return MD(e.disposeEffect),e}const fO=0;class Qu{constructor(){Zt(this,"currentId",fO);Zt(this,"clear",()=>{this.currentId!==fO&&(clearTimeout(this.currentId),this.currentId=fO)});Zt(this,"disposeEffect",()=>this.clear)}static create(){return new Qu}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=fO,n()},t)}isStarted(){return this.currentId!==fO}}function ov(){const e=Td(Qu.create).current;return MD(e.disposeEffect),e}let mJ=0;function Lnt(e){return mJ+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${mJ}`}function _3(e,t){if(typeof e=="string")return{description:e};if(typeof e=="function"){const n=e(t);return typeof n=="string"?{description:n}:n}return e}function $nt(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:Fnt,platform:Bnt,maxTouchPoints:Unt}=$nt(),QD=Fnt.toLowerCase(),dC=Bnt.toLowerCase(),zD=/^i(os$|p)/.test(dC)||dC==="macintel"&&Unt>1,gJ="android",Z8=dC===gJ||QD.includes(gJ),Qnt=!zD&&dC.startsWith("mac");dC.startsWith("win");const znt=Qnt||zD;var Nue;const q1=typeof CSS<"u"&&!!((Nue=CSS.supports)!=null&&Nue.call(CSS,"-webkit-backdrop-filter:none"));!q1&&QD.includes("firefox");!q1&&QD.includes("chrom");const Vnt=znt,n_e=/jsdom|happydom/.test(QD),J8="data-base-ui-focusable",i_e="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Sc(e){var n;let t=e.activeElement;for(;((n=t==null?void 0:t.shadowRoot)==null?void 0:n.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function ii(e,t){var i;if(!e||!t)return!1;const n=(i=t.getRootNode)==null?void 0:i.call(t);if(e.contains(t))return!0;if(n&&Zw(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function fo(e){return"composedPath"in e?e.composedPath()[0]:e.target}function r_e(e,t){if(!Tr(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,i]of t.entries())if(ii(i,n))return!i.hasAttribute("data-trigger-disabled");return!1}function j3(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Hnt(e){return e.matches("html,body")}function Gz(e){return Zs(e)&&e.matches(i_e)}function qnt(e){return(e==null?void 0:e.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${i_e}`))!=null}function bJ(e){return e?e.getAttribute("role")==="combobox"&&Gz(e):!1}function eB(e){if(!e||n_e)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function yJ(e){return e?e.hasAttribute(J8)?e:e.querySelector(`[${J8}]`)||e:null}function Gg(e,t,n=!0){return e.filter(r=>r.parentId===t).flatMap(r=>{var s;return[...!n||(s=r.context)!=null&&s.open?[r]:[],...Gg(e,r.id,n)]})}function vJ(e,t){var r;let n=[],i=(r=e.find(s=>s.id===t))==null?void 0:r.parentId;for(;i;){const s=e.find(o=>o.id===i);i=s==null?void 0:s.parentId,s&&(n=n.concat(s))}return n}function Wnt(e){e.preventDefault(),e.stopPropagation()}function Knt(e){return"nativeEvent"in e}function Gnt(e){return e.pointerType===""&&e.isTrusted?!0:Z8&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function s_e(e){return n_e?!1:!Z8&&e.width===0&&e.height===0||Z8&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function sw(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Xnt(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const Ynt=["top","right","bottom","left"],Xg=Math.min,Dp=Math.max,tI=Math.round,e_=Math.floor,Mp=e=>({x:e,y:e}),Znt={left:"right",right:"left",bottom:"top",top:"bottom"};function Xz(e,t,n){return Dp(e,Xg(t,n))}function Eh(e,t){return typeof e=="function"?e(t):e}function kd(e){return e.split("-")[0]}function mm(e){return e.split("-")[1]}function Yz(e){return e==="x"?"y":"x"}function VD(e){return e==="y"?"height":"width"}function pd(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function HD(e){return Yz(pd(e))}function Jnt(e,t,n){n===void 0&&(n=!1);const i=mm(e),r=HD(e),s=VD(r);let o=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=nI(o)),[o,nI(o)]}function eit(e){const t=nI(e);return[tB(e),t,tB(t)]}function tB(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const xJ=["left","right"],wJ=["right","left"],tit=["top","bottom"],nit=["bottom","top"];function iit(e,t,n){switch(e){case"top":case"bottom":return n?t?wJ:xJ:t?xJ:wJ;case"left":case"right":return t?tit:nit;default:return[]}}function rit(e,t,n,i){const r=mm(e);let s=iit(kd(e),n==="start",i);return r&&(s=s.map(o=>o+"-"+r),t&&(s=s.concat(s.map(tB)))),s}function nI(e){const t=kd(e);return Znt[t]+e.slice(t.length)}function sit(e){var t,n,i,r;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(i=e.bottom)!=null?i:0,left:(r=e.left)!=null?r:0}}function Zz(e){return typeof e!="number"?sit(e):{top:e,right:e,bottom:e,left:e}}function iI(e){const{x:t,y:n,width:i,height:r}=e;return{width:i,height:r,top:n,left:t,right:t+i,bottom:n+r,x:t,y:n}}function ait(e){return e.visibility==="hidden"||e.visibility==="collapse"}function a_e(e,t=e?Uu(e):null){return!e||!e.isConnected||!t||ait(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const oit='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function lit(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return Zw(n)?n.host:null}function nB(e){for(const t of Array.from(e.children))if(dl(t)==="summary")return t;return null}function cit(e,t){const n=nB(t);return!!n&&(e===n||ii(n,e))}function o_e(e){const t=e?dl(e):"";return e!=null&&e.matches(oit)&&(t!=="summary"||e.parentElement!=null&&dl(e.parentElement)==="details"&&nB(e.parentElement)===e)&&(t!=="details"||nB(e)==null)&&(t!=="input"||e.type!=="hidden")}function l_e(e){if(!o_e(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=lit(t)){const n=t!==e,i=dl(t)==="slot";if(t.hasAttribute("inert")||n&&dl(t)==="details"&&!t.open&&!cit(e,t)||t.hasAttribute("hidden")||!i&&!uit(t,n))return!1}return!0}function uit(e,t){const n=Uu(e);return t?n.display!=="none":a_e(e,n)}function c_e(e){const t=e.tabIndex;if(t<0){const n=dl(e);if(n==="details"||n==="audio"||n==="video"||Zs(e)&&e.isContentEditable)return 0}return t}function N3(e){if(dl(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function dit(e,t){const n=N3(e);if(!n)return!0;const i=t.find(r=>{const s=N3(r);return(s==null?void 0:s.name)===n.name&&s.form===n.form&&s.checked});return i?i===n:t.find(r=>{const s=N3(r);return(s==null?void 0:s.name)===n.name&&s.form===n.form})===n}function u_e(e){if(Zs(e)&&dl(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Zs(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function d_e(e,t){u_e(e).forEach(n=>{o_e(n)&&t.push(n),d_e(n,t)})}function f_e(e,t,n){u_e(e).forEach(i=>{Zs(i)&&i.matches(t)&&n.push(i),f_e(i,t,n)})}function Jz(e){return l_e(e)&&c_e(e)>=0}function h_e(e){const t=[];return d_e(e,t),t.filter(l_e)}function qA(e){const t=h_e(e);return t.filter(n=>c_e(n)>=0&&dit(n,t))}function p_e(e,t){const n=qA(e),i=n.length;if(i===0)return;const r=Sc(Cr(e)),s=n.indexOf(r),o=s===-1?t===1?0:i-1:s+t;return n[o]}function eV(e){return p_e(Cr(e).body,1)||e}function m_e(e){return p_e(Cr(e).body,-1)||e}function g_e(e,t){if(!e)return null;const n=qA(Cr(e).body),i=n.length;if(i===0)return null;const r=n.indexOf(e);if(r===-1)return null;const s=(r+t+i)%i;return n[s]}function fit(e){return g_e(e,1)}function hit(e){return g_e(e,-1)}function aw(e,t){const n=t||e.currentTarget,i=e.relatedTarget;return!i||!ii(n,i)}function pit(e){qA(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function kJ(e){const t=[];f_e(e,"[data-tabindex]",t),t.forEach(n=>{const i=n.dataset.tabindex;delete n.dataset.tabindex,i?n.setAttribute("tabindex",i):n.removeAttribute("tabindex")})}function R3(e){const t=new Map;let n=0,i=0;return e.forEach((r,s)=>{const o=r.transitionStatus==="ending";t.set(r.id,{value:r,domIndex:s,visibleIndex:o?-1:n,offsetY:i}),i+=r.height||0,o||(n+=1)}),t}function I3(e,t){let n=0;return e.map(i=>{if(i.transitionStatus==="ending")return i;const r=n>=t;return n+=1,i.limited===r?i:{...i,limited:r}})}const Bf={toasts:e=>e.toasts,isEmpty:e=>e.toasts.length===0,toast:(e,t)=>{var n;return(n=e.toastMetadata.get(t))==null?void 0:n.value},toastIndex:(e,t)=>{var n;return((n=e.toastMetadata.get(t))==null?void 0:n.domIndex)??-1},toastOffsetY:(e,t)=>{var n;return((n=e.toastMetadata.get(t))==null?void 0:n.offsetY)??0},toastVisibleIndex:(e,t)=>{var n;return((n=e.toastMetadata.get(t))==null?void 0:n.visibleIndex)??-1},focused:e=>e.focused,expanded:e=>e.hovering||e.focused,expandedOrOutOfFocus:e=>e.hovering||e.focused||!e.isWindowFocused,prevFocusElement:e=>e.prevFocusElement};class mit extends $D{constructor(n){super({...n,toastMetadata:R3(n.toasts)},{},Bf);Zt(this,"timers",new Map);Zt(this,"areTimersPaused",!1);Zt(this,"setViewport",n=>{this.set("viewport",n)});Zt(this,"disposeEffect",()=>()=>{this.timers.forEach(n=>{var i;(i=n.timeout)==null||i.clear()}),this.timers.clear()});Zt(this,"addToast",n=>{const{timeout:i,limit:r}=this.state,s=n.id||Lnt("toast");if(n.id){const u=Bf.toast(this.state,n.id);if(u)if(u.transitionStatus==="ending")this.removeToast(n.id,!0);else{const{id:d,transitionStatus:f,...h}=n;return this.updateToastInternal(n.id,h,!0,!0),n.id}}const o={...n,id:s,updateKey:0,transitionStatus:"starting"},l=[o,...this.state.toasts];this.setToasts(I3(l,r));const c=o.timeout??i;return o.type!=="loading"&&c>0&&this.scheduleTimer(s,c,()=>this.closeToast(s)),Bf.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),s});Zt(this,"updateToast",(n,i)=>{this.updateToastInternal(n,i,!1,!0)});Zt(this,"updateToastInternal",(n,i,r=!1,s=!1)=>{const{timeout:o,toasts:l}=this.state,c=Bf.toast(this.state,n);if(!c||c.transitionStatus==="ending")return;const u={...c,...i,...s&&{updateKey:c.updateKey+1}};this.setToasts(l.map(y=>y.id===n?u:y));const d=u.timeout??o,f=c.timeout??o,h=Object.hasOwn(i,"timeout"),m=u.transitionStatus!=="ending"&&u.type!=="loading"&&d>0,g=this.timers.has(n),b=f!==d,v=c.type==="loading";if(!m&&g){this.clearTimer(n);return}m&&(!g||b||h||v||r)&&(this.clearTimer(n),this.scheduleTimer(n,d,()=>this.closeToast(n)),Bf.expandedOrOutOfFocus(this.state)&&this.pauseTimers())});Zt(this,"closeToast",n=>{const i=n===void 0,{limit:r,toasts:s}=this.state;let o;if(i)o=s,this.clearTimers();else{const u=Bf.toast(this.state,n);if(!u)return;o=[u],this.clearTimer(n)}const l=s.map(u=>i||u.id===n?{...u,transitionStatus:"ending",height:0}:u),c=I3(l,r);this.setToasts(c,!c.some(u=>u.transitionStatus!=="ending")),o.forEach(u=>{var d;u.transitionStatus!=="ending"&&((d=u.onClose)==null||d.call(u))}),this.handleFocusManagement(n)});Zt(this,"promiseToast",(n,i)=>{const r=_3(i.loading),s=this.addToast({...r,type:"loading"}),o=n.then(l=>{const c=_3(i.success,l);return this.updateToast(s,{...c,type:"success",timeout:c.timeout}),l}).catch(l=>{const c=_3(i.error,l);return this.updateToast(s,{...c,type:"error",timeout:c.timeout}),Promise.reject(l)});return{}.hasOwnProperty.call(i,"setPromise")&&i.setPromise(o),o});Zt(this,"handleDocumentPointerDown",n=>{if(n.pointerType!=="touch")return;const i=fo(n);ii(this.state.viewport,i)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))})}syncProviderProps(n,i){const r=this.state.limit!==i;if(this.state.timeout===n&&!r)return;const s={timeout:n,limit:i};if(r){const o=I3(this.state.toasts,i);s.toasts=o,s.toastMetadata=R3(o)}this.update(s)}removeToast(n,i=!1){var l;const r=Bf.toastIndex(this.state,n);if(r===-1)return;const s=this.state.toasts[r];i||(l=s==null?void 0:s.onRemove)==null||l.call(s);const o=[...this.state.toasts];o.splice(r,1),this.setToasts(o)}pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(n=>{n.timeout&&(n.timeout.clear(),n.remaining=Math.max(n.remaining-(Date.now()-n.start),0))}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((n,i)=>{n.remaining=n.remaining>0?n.remaining:n.delay,n.timeout??(n.timeout=Qu.create()),n.timeout.start(n.remaining,()=>{this.handleTimerFired(i),n.callback()}),n.start=Date.now()}))}restoreFocusToPrevElement(){var n;(n=this.state.prevFocusElement)==null||n.focus({preventScroll:!0})}scheduleTimer(n,i,r){const s=Date.now(),l=!Bf.expandedOrOutOfFocus(this.state)?Qu.create():void 0;l==null||l.start(i,()=>{this.handleTimerFired(n),r()}),this.timers.set(n,{timeout:l,start:s,delay:i,remaining:i,callback:r})}clearTimers(){this.timers.forEach(n=>{var i;(i=n.timeout)==null||i.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(n){var r;const i=this.timers.get(n);(r=i==null?void 0:i.timeout)==null||r.clear(),this.timers.delete(n),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(n){this.timers.delete(n),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){this.timers.size===0&&(this.areTimersPaused=!1)}setToasts(n,i=n.length===0){const r={toasts:n,toastMetadata:R3(n)};i&&(r.hovering=!1,r.focused=!1),this.update(r)}handleFocusManagement(n){var c,u;const i=Sc(Cr(this.state.viewport));if(!this.state.viewport||!ii(this.state.viewport,i)||!eB(i))return;if(n===void 0){this.restoreFocusToPrevElement();return}const r=Bf.toasts(this.state),s=Bf.toastIndex(this.state,n),o=(d,f)=>{for(let h=d;h>=0&&hnew mit({timeout:i,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return MD(o.disposeEffect),p.useEffect(function(){return s?s[" subscribe"](({action:u,options:d})=>{const f=d.id;u==="promise"&&d.promise?o.promiseToast(d.promise,d):u==="update"&&f?o.updateToast(f,d):u==="close"?o.closeToast(f):o.addToast(d)}):void 0},[o,s]),a.jsxs(X2e.Provider,{value:o,children:[a.jsx(bit,{store:o,timeout:i,limit:r}),n]})};function bit(e){const{store:t,timeout:n,limit:i}=e;return ti(()=>{t.syncProviderProps(n,i)},[t,n,i]),null}const yit={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},b_e={...yit,position:"fixed",top:0,left:0},lv=p.forwardRef(function(t,n){const[i,r]=p.useState();ti(()=>{Vnt&&q1&&r("button")},[]);const s={tabIndex:0,role:i};return a.jsx("span",{...t,ref:n,style:b_e,"aria-hidden":i?void 0:!0,...s,"data-base-ui-focus-guard":""})});function Jw(e,t,n,i){const r=Td(y_e).current;return xit(r,e,t,n,i)&&v_e(r,[e,t,n,i]),r.callback}function vit(e){const t=Td(y_e).current;return wit(t,e)&&v_e(t,e),t.callback}function y_e(){return{callback:null,cleanup:null,refs:[]}}function xit(e,t,n,i,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==i||e.refs[3]!==r}function wit(e,t){return e.refs.length!==t.length||e.refs.some((n,i)=>n!==t[i])}function v_e(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const i=Array(t.length).fill(null);for(let r=0;r{for(let r=0;r=65&&r<=90&&(typeof t=="function"||typeof t>"u")}function iV(e){return typeof e=="function"}function k_e(e,t){return iV(e)?e(t):e??tV}function Ait(e,t){return t?e?(...n)=>{const i=n[0];if(E_e(i)){const s=i;sI(s);const o=t(...n);return s.baseUIHandlerPrevented||e==null||e(...n),o}const r=t(...n);return e==null||e(...n),r}:O_e(t):e}function O_e(e){return e&&((...t)=>{const n=t[0];return E_e(n)&&sI(n),e(...t)})}function sI(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function S_e(e,t){return t?e?t+" "+e:t:e}function E_e(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Da(e,t,n={}){const i=t.render,r=Tit(t,n);if(n.enabled===!1)return null;const s=n.state??Jl;return Nit(e,i,r,s)}function Tit(e,t={}){const{className:n,style:i,render:r}=e,{state:s=Jl,ref:o,props:l,stateAttributesMapping:c,enabled:u=!0}=t,d=u?Oit(n,s):void 0,f=u?x_e(i,s):void 0,h=u?kit(s,c):Jl,m=u&&l?_it(l):void 0,g=u?iB(h,m)??{}:Jl;return typeof document<"u"&&(u?Array.isArray(o)?g.ref=vit([g.ref,OJ(r),...o]):g.ref=Jw(g.ref,OJ(r),o):Jw(null,null)),u?(d!==void 0&&(g.className=S_e(g.className,d)),f!==void 0&&(g.style=iB(g.style,f)),g):Jl}function _it(e){return Array.isArray(e)?Sit(e):nV(void 0,e)}const jit=Symbol.for("react.lazy");function Nit(e,t,n,i){if(t){if(typeof t=="function")return t(n,i);const r=nV(n,t.props);r.ref=n.ref;let s=t;return(s==null?void 0:s.$$typeof)===jit&&(s=p.Children.toArray(t)[0]),p.cloneElement(s,r)}if(e&&typeof e=="string")return Rit(e,n);throw new Error(Uc(8))}function Rit(e,t){return e==="button"?p.createElement("button",{type:"button",...t,key:t.key}):e==="img"?p.createElement("img",{alt:"",...t,key:t.key}):p.createElement(e,t)}const Iit=p.forwardRef(function(t,n){var F;const{render:i,className:r,style:s,children:o,...l}=t,c=Qz(),u=ov(),d=p.useRef(!1),f=p.useRef(!1),h=p.useRef(!1),m=c.useState("isEmpty"),g=c.useState("toasts"),b=c.useState("focused"),v=c.useState("expanded"),y=c.useState("prevFocusElement"),w=(F=g[0])==null?void 0:F.height,x=g.some(M=>M.transitionStatus==="ending"),k=g.filter(M=>M.priority==="high");p.useEffect(()=>{const M=c.state.viewport;if(!M||m)return;const H=ea(M),q=Cr(M);function U(J){J.key==="F6"&&fo(J)!==M&&(J.preventDefault(),c.set("prevFocusElement",Sc(q)),M==null||M.focus({preventScroll:!0}),c.pauseTimers(),c.set("focused",!0))}function Z(J){fo(J)===H&&(c.set("isWindowFocused",!1),c.pauseTimers())}function z(J){if(J.relatedTarget)return;const ne=fo(J),W=Sc(Cr(M));(ne===H||!ii(M,ne)||!eB(W))&&c.resumeTimers(),u.start(0,()=>c.set("isWindowFocused",!0))}return yh(Di(H,"keydown",U),Di(H,"blur",Z,!0),Di(H,"focus",z,!0),Di(q,"pointerdown",c.handleDocumentPointerDown,!0))},[c,u,m]);function S(M){var q,U;d.current=!0;const H=M.relatedTarget===c.state.viewport?g.find(Z=>Z.transitionStatus!=="ending"&&!Z.limited):void 0;H?(U=(q=H.ref)==null?void 0:q.current)==null||U.focus():c.restoreFocusToPrevElement()}function O(M){M.key==="Tab"&&M.shiftKey&&fo(M.nativeEvent)===c.state.viewport&&(M.preventDefault(),c.restoreFocusToPrevElement())}function A(){c.state.toasts.some(H=>H.transitionStatus==="ending")||h.current||!f.current||(c.state.isWindowFocused&&c.resumeTimers(),c.set("hovering",!1),f.current=!1)}p.useEffect(A,[x,c]);function E(){c.pauseTimers(),c.set("hovering",!0),f.current=!1}function j(){c.state.isWindowFocused&&c.resumeTimers()}function T(){f.current=!0,A()}function R(M){M.pointerType==="touch"&&(h.current=!0)}function C(M){M.pointerType==="touch"&&(h.current=!1,A())}function N(){if(d.current){d.current=!1;return}b||eB(Sc(Cr(c.state.viewport)))&&(c.set("focused",!0),c.pauseTimers())}function P(M){!b||ii(c.state.viewport,M.relatedTarget)||(c.set("focused",!1),j())}const I={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:E,onMouseMove:E,onMouseLeave:T,onFocus:N,onBlur:P,onKeyDown:O,onClick:N,onPointerDown:R,onPointerUp:C,onPointerCancel:C,style:{"--toast-frontmost-height":w?`${w}px`:void 0}},D={expanded:v},_=!m&&y&&a.jsx(lv,{onFocus:S}),L=Da("div",t,{ref:[n,c.setViewport],state:D,props:[I,l,{children:a.jsxs(p.Fragment,{children:[_,o,_]})}]});return a.jsxs(p.Fragment,{children:[_,L,!b&&k.length>0&&a.jsx("div",{style:b_e,children:k.map(M=>a.jsxs("div",{role:"alert","aria-atomic":!0,children:[a.jsx("div",{children:M.title}),a.jsx("div",{children:M.description})]},M.id))})]})});function rV(e){return zz(19)?e:e?"true":void 0}const C_e=p.createContext(void 0);function Pit(){const e=p.useContext(C_e);if(!e)throw new Error(Uc(66));return e}let aI=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({});const Dit={"data-starting-style":""},Mit={"data-ending-style":""},qD={transitionStatus(e){return e==="starting"?Dit:e==="ending"?Mit:null}};function op(e){return e==null?e:"current"in e?e.current:e}function sV(e,t=!1){const n=Kz();return oi((i,r=null)=>{n.cancel();const s=op(e);if(s==null)return;const o=s,l=()=>{vi.flushSync(i)};if(typeof o.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function c(){Promise.all(o.getAnimations().map(u=>u.finished)).then(()=>{r!=null&&r.aborted||l()},()=>{if(r!=null&&r.aborted)return;if(o.getAnimations().some(d=>d.pending||d.playState!=="finished")){c();return}l()})}if(t){const u="data-starting-style";if(!o.hasAttribute(u)){n.request(c);return}const d=new MutationObserver(()=>{o.hasAttribute(u)||(d.disconnect(),c())});d.observe(o,{attributes:!0,attributeFilter:[u]}),r==null||r.addEventListener("abort",()=>d.disconnect(),{once:!0});return}n.request(c)})}function WA(e){const{enabled:t=!0,open:n,ref:i,onComplete:r}=e,s=oi(r),o=sV(i,n);p.useEffect(()=>{if(!t)return;const l=new AbortController;return o(s,l.signal),()=>{l.abort()}},[t,n,s,o])}const Lit=500,$it={style:{transition:"none"}},aV="data-base-ui-click-trigger",Fit="data-base-ui-swipe-ignore",Bit="data-swipe-ignore",Uit=`[${Fit}]`,Qit=`[${Bit}]`,zit={fallbackAxisSide:"end"},Vit={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function P3(e,t,n){switch(e){case"up":return-n;case"down":return n;case"left":return-t;case"right":return t;default:return 0}}function Hit(e){const n=ea(e).getComputedStyle(e).transform;let i=0,r=0,s=1;if(n&&n!=="none"){const o=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(o){const l=o[1].split(", ").map(parseFloat);l.length===6?(i=l[4],r=l[5],s=Math.sqrt(l[0]*l[0]+l[1]*l[1])):l.length===16&&(i=l[12],r=l[13],s=l[0])}}return{x:i,y:r,scale:s}}const qit={...qD,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},SJ=40,Wit=10,EJ=.5,Kit=1,Git=`${Uit},${Qit}`,Xit=p.forwardRef(function(t,n){var Ke;const{toast:i,render:r,className:s,swipeDirection:o=["down","right"],style:l,...c}=t,u=((Ke=i.positionerProps)==null?void 0:Ke.anchor)!==void 0;let d=[];u||(d=Array.isArray(o)?o:[o]);const f=d.length>0,h=Qz(),[m,g]=p.useState(void 0),[b,v]=p.useState(!1),[y,w]=p.useState(!1),[x,k]=p.useState({x:0,y:0}),[S,O]=p.useState({x:0,y:0,scale:1}),[A,E]=p.useState(),[j,T]=p.useState(),[R,C]=p.useState(null),N=p.useRef(null),P=p.useRef(void 0),I=p.useRef({x:0,y:0}),D=p.useRef({x:0,y:0,scale:1}),_=p.useRef(void 0),L=p.useRef(0),F=p.useRef(!1),M=p.useRef({x:0,y:0}),H=p.useRef(!1),q=p.useRef({x:0,y:0}),U=p.useRef(null),Z=p.useRef(null),z=h.useState("toastIndex",i.id),J=h.useState("toastVisibleIndex",i.id),ne=h.useState("toastOffsetY",i.id),W=h.useState("focused"),X=h.useState("expanded");WA({open:i.transitionStatus!=="ending",ref:N,onComplete(){i.transitionStatus==="ending"&&h.removeToast(i.id)}});const ce=oi((Me=!1)=>{const re=N.current;if(!re)return;const ue=re.style.height;re.style.height="auto";const be=re.offsetHeight;re.style.height=ue;function Ce(){h.updateToastInternal(i.id,{ref:N,height:be,transitionStatus:void 0})}Me?vi.flushSync(Ce):Ce()});ti(()=>{const Me=P.current;i.transitionStatus!=="starting"&&Me===i.id||(Me!==void 0&&(g(void 0),O({x:0,y:0,scale:1}),V({x:0,y:0})),P.current=i.id,ce())},[ce,i.id,i.transitionStatus]);function V(Me){q.current=Me,k(Me)}ti(()=>()=>{var Me;(Me=Z.current)==null||Me.abort()},[]);function Y(Me,re){const ue=Ee=>Ee>0?Ee**EJ:-(Math.abs(Ee)**EJ),be=Me>0&&!d.includes("right")||Me<0&&!d.includes("left"),Ce=re>0&&!d.includes("down")||re<0&&!d.includes("up");return{x:be?ue(Me):Me,y:Ce?ue(re):re}}const K=oi(Me=>{var Ve;if(Me.pointerId!==U.current)return;U.current=null,(Ve=Z.current)==null||Ve.abort(),Z.current=null,v(!1),w(!1),C(null);const re=D.current;if(Me.type==="pointercancel"||F.current){V({x:re.x,y:re.y}),g(void 0);return}const ue=q.current,be=ue.x-re.x,Ce=ue.y-re.y;let Ee;for(const Ge of d)if(P3(Ge,be,Ce)>SJ){Ee=Ge;break}Ee?(g(Ee),h.closeToast(i.id)):(V({x:re.x,y:re.y}),g(void 0))});function de(Me){var Ge,ye;if(Me.button!==0)return;Me.pointerType==="touch"&&h.pauseTimers();const re=fo(Me.nativeEvent);if(re==null?void 0:re.closest(`button,a,input,textarea,[role="button"],${Git}`))return;F.current=!1,_.current=void 0,L.current=0,U.current=Me.pointerId,I.current={x:Me.clientX,y:Me.clientY},M.current=I.current;const be=Me.currentTarget,Ce=Hit(be);D.current=Ce,O(Ce),V({x:Ce.x,y:Ce.y}),h.set("hovering",!0),v(!0),w(!1),C(null),H.current=!0,(Ge=Z.current)==null||Ge.abort();const Ee=new AbortController;Z.current=Ee;const Ve=Cr(be);Ve.addEventListener("pointerup",K,{signal:Ee.signal}),Ve.addEventListener("pointercancel",K,{signal:Ee.signal}),(ye=be.setPointerCapture)==null||ye.call(be,Me.pointerId)}function ee(Me){if(Me.pointerId!==U.current)return;Me.preventDefault(),H.current&&(I.current={x:Me.clientX,y:Me.clientY},H.current=!1);const{clientY:re,clientX:ue,movementX:be,movementY:Ce}=Me;(Ce<0&&re>M.current.y||Ce>0&&reM.current.x||be>0&&ue=Kit){w(!0);const $t=d.includes("left")||d.includes("right"),He=d.includes("up")||d.includes("down");if($t&&He){const yt=Math.abs(Ee),je=Math.abs(Ve);oe=yt>je?"horizontal":"vertical",C(oe)}}let ie;if(!_.current)oe==="vertical"?Ve>0?ie="down":Ve<0&&(ie="up"):oe==="horizontal"?Ee>0?ie="right":Ee<0&&(ie="left"):Math.abs(Ee)>=Math.abs(Ve)?ie=Ee>0?"right":"left":ie=Ve>0?"down":"up",ie&&d.includes(ie)&&(_.current=ie,L.current=P3(ie,Ee,Ve),g(ie));else{const Et=_.current,$t=P3(Et,ye,Ge);$t>SJ?(F.current=!1,g(Et)):!(d.includes("left")&&d.includes("right"))&&!(d.includes("up")&&d.includes("down"))&&L.current-$t>=Wit&&(F.current=!0)}const Ae=Y(Ee,Ve);let Re=D.current.x,St=D.current.y;const Nt=d.includes("left")||d.includes("right"),Dt=d.includes("up")||d.includes("down");oe!=="vertical"&&Nt&&(Re+=Ae.x),oe!=="horizontal"&&Dt&&(St+=Ae.y),V({x:Re,y:St})}function Oe(Me){if(Me.key==="Escape"){if(!N.current||!ii(N.current,Sc(Cr(N.current))))return;h.closeToast(i.id)}}p.useEffect(()=>{const Me=N.current;if(!f||!Me)return;function re(ue){U.current===null||!ii(Me,fo(ue))||ue.preventDefault()}return Di(Me,"touchmove",re,{passive:!1})},[f]);function he(){const Me=x.x-S.x,re=x.y-S.y;return{transition:b?"none":void 0,transform:b?`translateX(${x.x}px) translateY(${x.y}px) scale(${S.scale})`:void 0,"--toast-swipe-movement-x":`${Me}px`,"--toast-swipe-movement-y":`${re}px`}}const ge=i.priority==="high",Se={role:ge?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":A,"aria-describedby":j,"aria-hidden":ge&&!W?!0:void 0,onPointerDown:f?de:void 0,onPointerMove:f?ee:void 0,onPointerUp:f?K:void 0,onPointerCancel:f?K:void 0,onKeyDown:Oe,inert:rV(i.limited),style:{...he(),"--toast-index":i.transitionStatus==="ending"?z:J,"--toast-offset-y":`${ne}px`,"--toast-height":i.height?`${i.height}px`:void 0}},xe=p.useMemo(()=>({toast:i,setTitleId:E,setDescriptionId:T,recalculateHeight:ce,visibleIndex:J,expanded:X}),[i,E,T,ce,J,X]),Pe={transitionStatus:i.transitionStatus,expanded:X,limited:i.limited||!1,type:i.type,swiping:b,swipeDirection:m},Ue=Da("div",t,{ref:[n,N],state:Pe,stateAttributesMapping:qit,props:[Se,c]});return a.jsx(C_e.Provider,{value:xe,children:Ue})});let CJ=0;function Yit(e,t="mui"){const[n,i]=p.useState(e),r=e||n;return p.useEffect(()=>{n==null&&(CJ+=1,i(`${t}-${CJ}`))},[n,t]),r}const AJ=Vz.useId;function KA(e,t){if(AJ!==void 0){const n=AJ();return e??(t?`${t}-${n}`:n)}return Yit(e,t)}function A_e(e){return e==null||typeof e=="boolean"||e===""?!1:Array.isArray(e)?e.some(A_e):!0}function Zit(e){return p.isValidElement(e)&&A_e(e.props.children)}function T_e(e,t,n){const{toast:i,setTitleId:r,setDescriptionId:s}=Pit(),o=n==="title"?r:s,l=t??(n==="title"?i.title:i.description);return{id:KA(e),children:l,type:i.type,setId:o}}function __e(e,t,n){const i=Zit(e);return ti(()=>{if(i)return n(t),()=>{n(r=>r===t?void 0:r)}},[i,t,n]),i?e:null}const Jit=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:o,children:l,...c}=t,{id:u,children:d,type:f,setId:h}=T_e(o,l,"description"),g=Da("p",t,{ref:n,state:{type:f},props:{...c,id:u,children:d}});return __e(g,u,h)}),ert=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:o,children:l,...c}=t,{id:u,children:d,type:f,setId:h}=T_e(o,l,"title"),g=Da("h2",t,{ref:n,state:{type:f},props:{...c,id:u,children:d}});return __e(g,u,h)}),trt=p.createContext(void 0);function nrt(e=!1){const t=p.useContext(trt);if(t===void 0&&!e)throw new Error(Uc(16));return t}function irt(e){const{focusableWhenDisabled:t,disabled:n,composite:i=!1,tabIndex:r=0,isNativeButton:s}=e,o=i&&t!==!1,l=i&&t===!1;return{props:p.useMemo(()=>{const u={onKeyDown(d){n&&t&&d.key!=="Tab"&&d.preventDefault()}};return i||(u.tabIndex=r,!s&&n&&(u.tabIndex=t?r:-1)),(s&&(t||o)||!s&&n)&&(u["aria-disabled"]=n),s&&(!t||l)&&(u.disabled=n),u},[i,n,t,o,l,s,r])}}function D3(e,t,{detail:n=0}={}){e.dispatchEvent(new(ea(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function WD(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:i=0,native:r=!0,composite:s}=e,o=p.useRef(null),l=nrt(!0),c=s??l!==void 0,{props:u}=irt({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:i,isNativeButton:r}),d=p.useCallback(()=>{const m=o.current;M3(m)&&c&&t&&u.disabled===void 0&&m.disabled&&(m.disabled=!1)},[t,u.disabled,c]);ti(d,[d]);const f=p.useCallback((m={})=>{const{onClick:g,onMouseDown:b,onKeyUp:v,onKeyDown:y,onPointerDown:w,...x}=m;return nV({onClick(k){if(t){k.preventDefault();return}g==null||g(k)},onMouseDown(k){t||b==null||b(k)},onKeyDown(k){if(t||(sI(k),y==null||y(k),k.baseUIHandlerPrevented))return;const S=k.target===k.currentTarget,O=k.currentTarget,A=M3(O),E=!r&&rrt(O),j=S&&(r?A:!E),T=k.key==="Enter",R=k.key===" ",C=O.getAttribute("role"),N=(C==null?void 0:C.startsWith("menuitem"))||C==="option"||C==="gridcell";if(S&&c&&R){if(k.defaultPrevented&&N)return;k.preventDefault(),(!r||A)&&(k.preventBaseUIHandler(),D3(O,k));return}if(!j||r||!R&&!T){S&&E&&R&&k.preventDefault();return}k.defaultPrevented||(k.preventDefault(),T&&(k.preventBaseUIHandler(),D3(O,k)))},onKeyUp(k){if(!t){if(sI(k),v==null||v(k),k.target===k.currentTarget&&r&&c&&M3(k.currentTarget)&&k.key===" "){k.preventDefault();return}k.baseUIHandlerPrevented||k.target===k.currentTarget&&!r&&!c&&!k.defaultPrevented&&k.key===" "&&(k.preventBaseUIHandler(),D3(k.currentTarget,k))}},onPointerDown(k){if(t){k.preventDefault();return}w==null||w(k)}},r?{type:"button"}:{role:"button"},u,x)},[t,u,c,r]),h=oi(m=>{o.current=m,d()});return{getButtonProps:f,buttonRef:h}}function M3(e){return Zs(e)&&e.tagName==="BUTTON"}function rrt(e){return Zs(e)&&e.tagName==="A"&&!!e.href}const j_e="none",e1="trigger-press",vu="trigger-hover",N_e="outside-press",R_e="close-press",fC="focus-out",I_e="escape-key",P_e="imperative-action";function pa(e,t,n,i){let r=!1,s=!1;const o=Jl;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){s=!0},get isCanceled(){return r},get isPropagationAllowed(){return s},trigger:n,...o}}function oI(e){return`data-base-ui-${e}`}const D_e=p.createContext(null),M_e=()=>p.useContext(D_e),srt=oI("portal");function L_e(e={}){const{ref:t,container:n,componentProps:i=Jl,elementProps:r}=e,s=KA(),o=M_e(),l=o==null?void 0:o.portalNode,[c,u]=p.useState(null),[d,f]=p.useState(null),h=oi(v=>{v!==null&&f(v)}),m=p.useRef(null);ti(()=>{if(n===null){m.current&&(m.current=null,f(null),u(null));return}const v=(n&&(Hz(n)?n:n.current))??l??document.body;if(v==null){m.current&&(m.current=null,f(null),u(null));return}m.current!==v&&(m.current=v,f(null),u(v))},[n,l]);const g=Da("div",i,{ref:[t,h],props:[{id:s,[srt]:""},r]}),b=c&&g?vi.createPortal(g,c):null;return{node:d,nodeId:p.isValidElement(g)?g.props.id:void 0,subtree:b}}const $_e=p.forwardRef(function(t,n){const{render:i,className:r,style:s,children:o,container:l,...c}=t,{node:u,nodeId:d,subtree:f}=L_e({container:l,ref:n,componentProps:t,elementProps:c}),h=p.useRef(null),m=p.useRef(null),g=p.useRef(null),b=p.useRef(null),[v,y]=p.useState(null),w=p.useRef(!1),x=v==null?void 0:v.modal,k=v==null?void 0:v.open,S=!!v&&!v.modal&&v.open&&!!u;p.useEffect(()=>{if(!u||x)return;function A(E){u&&E.relatedTarget&&aw(E)&&(E.type==="focusin"?w.current&&(kJ(u),w.current=!1):(pit(u),w.current=!0))}return yh(Di(u,"focusin",A,!0),Di(u,"focusout",A,!0))},[u,x]),ti(()=>{!u||k!==!0||!w.current||(kJ(u),w.current=!1)},[k,u]);const O=p.useMemo(()=>({beforeOutsideRef:h,afterOutsideRef:m,beforeInsideRef:g,afterInsideRef:b,portalNode:u,setFocusManagerState:y}),[u]);return a.jsxs(p.Fragment,{children:[f,a.jsxs(D_e.Provider,{value:O,children:[S&&u&&a.jsx(lv,{"data-type":"outside",ref:h,onFocus:A=>{var E;if(aw(A,u))(E=g.current)==null||E.focus();else{const j=v?v.domReference:null,T=m_e(j);T==null||T.focus()}}}),S&&u&&a.jsx("span",{"aria-owns":d,style:Vit}),u&&vi.createPortal(o,u),S&&u&&a.jsx(lv,{"data-type":"outside",ref:m,onFocus:A=>{var E;if(aw(A,u))(E=b.current)==null||E.focus();else{const j=v?v.domReference:null,T=eV(j);T==null||T.focus(),v!=null&&v.closeOnFocusOut&&(v==null||v.onOpenChange(!1,pa(fC,A.nativeEvent)))}}})]})]})}),art=p.forwardRef(function(t,n){const{children:i,container:r,className:s,render:o,style:l,...c}=t,{node:u,subtree:d}=L_e({container:r,ref:n,componentProps:t,elementProps:c});return!d&&!u?null:a.jsxs(p.Fragment,{children:[d,u&&vi.createPortal(i,u)]})}),ort=p.forwardRef(function(t,n){return a.jsx(art,{ref:n,...t})});function Gl(e){const t=Td(lrt,e).current;return t.next=e,ti(t.effect),t}function lrt(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function crt(e,t){return t!=null&&!sw(t)?0:typeof e=="function"?e():e}function rB(e,t,n){const i=crt(e,n);return typeof i=="number"?i:i==null?void 0:i[t]}function TJ(e){return typeof e=="function"?e():e}function F_e(e,t){return t||e==="click"||e==="mousedown"}function urt(e){return(e==null?void 0:e.includes("mouse"))&&e!=="mousedown"}let t_=0;function L3(e,t={}){const{preventScroll:n=!1,sync:i=!1,shouldFocus:r}=t;cancelAnimationFrame(t_);function s(){r&&!r()||e==null||e.focus({preventScroll:n})}if(i)return s(),Uz;const o=requestAnimationFrame(s);return t_=o,()=>{t_===o&&(cancelAnimationFrame(o),t_=0)}}const $3={inert:new WeakMap,"aria-hidden":new WeakMap},_J="data-base-ui-inert",sB={inert:new WeakSet,"aria-hidden":new WeakSet};let hO=new WeakMap,F3=0;function drt(e){return sB[e]}function B_e(e){return e?Zw(e)?e.host:B_e(e.parentNode):null}const jJ=(e,t)=>t.map(n=>{if(e.contains(n))return n;const i=B_e(n);return e.contains(i)?i:null}).filter(n=>n!=null),NJ=e=>{const t=new Set;return e.forEach(n=>{let i=n;for(;i&&!t.has(i);)t.add(i),i=i.parentNode}),t},RJ=(e,t,n)=>{const i=[],r=s=>{!s||n.has(s)||Array.from(s.children).forEach(o=>{dl(o)!=="script"&&(t.has(o)?r(o):i.push(o))})};return r(e),i};function frt(e,t,n,i,{mark:r=!0}){let s=null;i?s="inert":n&&(s="aria-hidden");let o=null,l=null;const c=jJ(t,e),u=r?RJ(t,NJ(c),new Set(c)):[],d=[],f=[];if(s){const h=$3[s],m=drt(s);l=m,o=h;const g=jJ(t,Array.from(t.querySelectorAll("[aria-live]"))),b=c.concat(g);RJ(t,NJ(b),new Set(b)).forEach(y=>{const w=y.getAttribute(s),x=w!==null&&w!=="false",k=(h.get(y)||0)+1;h.set(y,k),d.push(y),k===1&&x&&m.add(y),x||y.setAttribute(s,s==="inert"?"":"true")})}return r&&u.forEach(h=>{const m=(hO.get(h)||0)+1;hO.set(h,m),f.push(h),m===1&&h.setAttribute(_J,"")}),F3+=1,()=>{o&&d.forEach(h=>{const g=(o.get(h)||0)-1;o.set(h,g),g||(!(l!=null&&l.has(h))&&s&&h.removeAttribute(s),l==null||l.delete(h))}),r&&f.forEach(h=>{const m=(hO.get(h)||0)-1;hO.set(h,m),m||h.removeAttribute(_J)}),F3-=1,F3||($3.inert=new WeakMap,$3["aria-hidden"]=new WeakMap,sB.inert=new WeakSet,sB["aria-hidden"]=new WeakSet,hO=new WeakMap)}}function IJ(e,t={}){const{ariaHidden:n=!1,inert:i=!1,mark:r=!0}=t,s=Cr(e[0]).body;return frt(e,s,n,i,{mark:r})}function U_e(){const e=new Map;return{emit(t,n){var i;(i=e.get(t))==null||i.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var i;(i=e.get(t))==null||i.delete(n)}}}class hrt{constructor(){Zt(this,"nodesRef",{current:[]});Zt(this,"events",U_e())}addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(i=>i===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const Q_e=p.createContext(null),z_e=p.createContext(null),KD=()=>{var e;return((e=p.useContext(Q_e))==null?void 0:e.id)||null},W1=e=>{const t=p.useContext(z_e);return e??t};function prt(e){const t=KA(),n=W1(e),i=KD();return ti(()=>{if(!t)return;const r={id:t,parentId:i};return n==null||n.addNode(r),()=>{n==null||n.removeNode(r)}},[n,t,i]),t}function mrt(e){const{children:t,id:n}=e,i=KD();return a.jsx(Q_e.Provider,{value:p.useMemo(()=>({id:n,parentId:i}),[n,i]),children:t})}function grt(e){const{children:t,externalTree:n}=e,i=Td(()=>n??new hrt).current;return a.jsx(z_e.Provider,{value:i,children:t})}function brt(e,t){const n=ea(fo(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const PJ=20;let pg=[];function oV(){pg=pg.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function DJ(e){oV(),e&&dl(e)!=="body"&&(pg.push(new WeakRef(e)),pg.length>PJ&&(pg=pg.slice(-PJ)))}function MJ(){var e;return oV(),(e=pg[pg.length-1])==null?void 0:e.deref()}function yrt(e){return e?Jz(e)?e:qA(e)[0]||e:null}function LJ(e){var r;if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!((r=e.getAttribute("role"))!=null&&r.includes("dialog")))return;const n=h_e(e).filter(s=>{const o=s.getAttribute("data-tabindex")||"";return Jz(s)||s.hasAttribute("data-tabindex")&&!o.startsWith("-")}),i=e.getAttribute("tabindex");n.length===0?i!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(i!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function V_e(e){const{context:t,children:n,disabled:i=!1,initialFocus:r=!0,returnFocus:s=!0,restoreFocus:o=!1,modal:l=!0,closeOnFocusOut:c=!0,openInteractionType:u="",nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:h,externalTree:m,getInsideElements:g}=e,b="rootStore"in t?t.rootStore:t,v=b.useState("open"),y=b.useState("domReferenceElement"),w=b.useState("floatingElement"),{events:x,dataRef:k}=b.context,S=oi(()=>{var Y;return(Y=k.current.floatingContext)==null?void 0:Y.nodeId}),O=r===!1,A=bJ(y)&&O,E=Gl(r),j=Gl(s),T=Gl(u),R=Gl(v),C=W1(m),N=M_e(),P=p.useRef(!1),I=p.useRef(!1),D=p.useRef(!1),_=p.useRef(null),L=p.useRef(""),F=p.useRef(""),M=p.useRef(null),H=p.useRef(null),q=Jw(M,h,N==null?void 0:N.beforeInsideRef),U=Jw(H,N==null?void 0:N.afterInsideRef),Z=ov(),z=ov(),J=Kz(),ne=N!=null,W=yJ(w),X=oi((Y=W)=>Y?qA(Y):[]),ce=oi(()=>(g==null?void 0:g().filter(Y=>Y!=null))??[]);p.useEffect(()=>{if(i||!l)return;function Y(de){de.key==="Tab"&&ii(W,Sc(Cr(W)))&&X().length===0&&!A&&Wnt(de)}const K=Cr(W);return Di(K,"keydown",Y)},[i,W,l,A,X]),p.useEffect(()=>{if(i||!v)return;const Y=Cr(W);function K(){D.current=!1}function de(Oe){const he=fo(Oe),ge=ce(),Se=ii(w,he)||ii(y,he)||ii(N==null?void 0:N.portalNode,he)||ge.some(xe=>xe===he||ii(xe,he));D.current=!Se,F.current=Oe.pointerType||"keyboard",he!=null&&he.closest(`[${aV}]`)&&(I.current=!0,z.start(0,()=>{I.current=!1}))}function ee(){F.current="keyboard"}return yh(Di(Y,"pointerdown",de,!0),Di(Y,"pointerup",K,!0),Di(Y,"pointercancel",K,!0),Di(Y,"keydown",ee,!0),K)},[i,w,y,W,v,N,z,ce]),p.useEffect(()=>{if(i||!c)return;const Y=Cr(W);function K(){I.current=!0,z.start(0,()=>{I.current=!1})}function de(ge){const Se=fo(ge);Jz(Se)&&(_.current=Se)}function ee(ge){const Se=ge.relatedTarget,xe=ge.currentTarget,Pe=fo(ge);l&&Se==null&&Pe!=null&&ii(w,Pe)&&DJ(Pe),queueMicrotask(()=>{const Ue=S(),Ke=b.context.triggerElements,Me=ce(),re=(Se==null?void 0:Se.hasAttribute(oI("focus-guard")))&&[M.current,H.current,N==null?void 0:N.beforeInsideRef.current,N==null?void 0:N.afterInsideRef.current,N==null?void 0:N.beforeOutsideRef.current,N==null?void 0:N.afterOutsideRef.current,op(f),op(d)].includes(Se),ue=!(ii(y,Se)||ii(w,Se)||ii(Se,w)||ii(N==null?void 0:N.portalNode,Se)||Me.some(be=>be===Se||ii(be,Se))||Ke.hasMatchingElement(be=>ii(be,Se))||re||C&&(Gg(C.nodesRef.current,Ue).find(be=>{var Ce,Ee;return ii((Ce=be.context)==null?void 0:Ce.elements.floating,Se)||ii((Ee=be.context)==null?void 0:Ee.elements.domReference,Se)})||vJ(C.nodesRef.current,Ue).find(be=>{var Ce,Ee,Ve;return[(Ce=be.context)==null?void 0:Ce.elements.floating,yJ((Ee=be.context)==null?void 0:Ee.elements.floating)].includes(Se)||((Ve=be.context)==null?void 0:Ve.elements.domReference)===Se})));if(xe===y&&W&&LJ(W),o&&xe!==y&&!a_e(Pe)&&Sc(Y)===Y.body){if(Zs(W)&&(W.focus(),o==="popup")){J.request(()=>{W.focus()});return}const be=X(),Ce=_.current,Ee=(Ce&&be.includes(Ce)?Ce:null)||be[be.length-1]||W;Zs(Ee)&&Ee.focus()}if(k.current.insideReactTree){k.current.insideReactTree=!1;return}(A||!l)&&Se&&ue&&!I.current&&(A||Se!==MJ())&&(P.current=!0,b.setOpen(!1,pa(fC,ge)))})}function Oe(){D.current||(k.current.insideReactTree=!0,Z.start(0,()=>{k.current.insideReactTree=!1}))}const he=Zs(y)?y:null;if(!(!w&&!he))return yh(he&&Di(he,"focusout",ee),he&&Di(he,"pointerdown",K),w&&Di(w,"focusin",de),w&&Di(w,"focusout",ee),w&&N&&Di(w,"focusout",Oe,!0))},[i,y,w,W,l,C,N,b,c,o,X,A,S,k,Z,z,J,d,f,ce]),p.useEffect(()=>{var xe,Pe,Ue;if(i||!w||!v)return;const Y=Array.from(((xe=N==null?void 0:N.portalNode)==null?void 0:xe.querySelectorAll(`[${oI("portal")}]`))||[]),de=(Ue=(Pe=(C?vJ(C.nodesRef.current,S()):[]).find(Ke=>{var Me;return bJ(((Me=Ke.context)==null?void 0:Me.elements.domReference)||null)}))==null?void 0:Pe.context)==null?void 0:Ue.elements.domReference,Oe=[...[w,...Y,M.current,H.current,N==null?void 0:N.beforeOutsideRef.current,N==null?void 0:N.afterOutsideRef.current,...ce()],de,op(f),op(d),A?y:null].filter(Ke=>Ke!=null),he=IJ(Oe,{ariaHidden:l||A,mark:!1}),ge=[w,...Y].filter(Ke=>Ke!=null),Se=IJ(ge);return()=>{Se(),he()}},[v,i,y,w,l,N,A,C,S,d,f,ce]),ti(()=>{if(!v||i||!Zs(W))return;L.current="",F.current="";const Y=Cr(W),K=Sc(Y);queueMicrotask(()=>{const de=E.current,ee=typeof de=="function"?de(T.current||""):de;if(ee===void 0||ee===!1||ii(W,K))return;let he=null;const ge=()=>(he==null&&(he=X(W)),he[0]||W);let Se;ee===!0||ee===null?Se=ge():Se=op(ee),Se=Se||ge();const xe=ii(W,Sc(Y));L3(Se,{preventScroll:Se===W,shouldFocus(){if(!R.current)return!1;if(xe)return!0;const Pe=Sc(Y);return!(Pe!==Se&&ii(W,Pe))}})})},[i,v,W,X,E,T,R]),ti(()=>{if(i||!W)return;const Y=Cr(W),K=Sc(Y),de=T.current==null;DJ(K);function ee(he){if(he.open||(L.current=brt(he.nativeEvent,F.current)),he.reason===vu&&he.nativeEvent.type==="mouseleave"&&(P.current=!0),he.reason===N_e)if(he.nested)P.current=!1;else if(Gnt(he.nativeEvent)||s_e(he.nativeEvent))P.current=!1;else{let ge=!1;Cr(W).createElement("div").focus({get preventScroll(){return ge=!0,!1}}),ge?P.current=!1:P.current=!0}}x.on("openchange",ee);function Oe(he){const ge=j.current;let Se=typeof ge=="function"?ge(he):ge;if(Se===void 0||Se===!1)return null;Se===null&&(Se=!0);const xe=y!=null&&y.isConnected?y:null,Pe=K!=null&&K.isConnected&&dl(K)!=="body"?K:null;let Ue=de?Pe||xe:xe||Pe;return Ue||(Ue=MJ()||null),typeof Se=="boolean"?Ue:op(Se)||Ue||null}return()=>{x.off("openchange",ee);const he=Sc(Y),ge=ce(),Se=ii(w,he)||ge.some(Ke=>Ke===he||ii(Ke,he))||C&&Gg(C.nodesRef.current,S(),!1).some(Ke=>{var Me;return ii((Me=Ke.context)==null?void 0:Me.elements.floating,he)}),xe=j.current,Pe=L.current,Ue=Oe(Pe);queueMicrotask(()=>{const Ke=yrt(Ue),Me=typeof xe!="boolean";if(xe&&!P.current&&Zs(Ke)&&(!(!Me&&Ke!==he&&he!==Y.body)||Se)){const re={preventScroll:!0};Pe==="keyboard"&&(re.focusVisible=!0),Ke.focus(re)}P.current=!1})}},[i,w,W,j,T,x,C,y,S,ce]),ti(()=>{if(!q1||v||!w)return;const Y=Sc(Cr(w));!Zs(Y)||!Gz(Y)||ii(w,Y)&&Y.blur()},[v,w]),ti(()=>{if(!(i||!N))return N.setFocusManagerState({modal:l,closeOnFocusOut:c,open:v,onOpenChange:b.setOpen,domReference:y}),()=>{N.setFocusManagerState(null)}},[i,N,l,v,b,c,y]),ti(()=>{if(!(i||!W))return LJ(W),()=>{queueMicrotask(oV)}},[i,W]);const V=!i&&(l?!A:!0)&&(ne||l);return a.jsxs(p.Fragment,{children:[V&&a.jsx(lv,{"data-type":"inside",ref:q,onFocus:Y=>{var K;if(l){const de=X();L3(de[de.length-1])}else if(N!=null&&N.portalNode)if(P.current=!1,aw(Y,N.portalNode)){const de=eV(y);de==null||de.focus()}else(K=op(f??N.beforeOutsideRef))==null||K.focus()}}),n,V&&a.jsx(lv,{"data-type":"inside",ref:U,onFocus:Y=>{var K;if(l)L3(X()[0]);else if(N!=null&&N.portalNode)if(c&&(P.current=!0),aw(Y,N.portalNode)){const de=m_e(y);de==null||de.focus()}else(K=op(d??N.afterOutsideRef))==null||K.focus()}})]})}function H_e(e,t={}){const{enabled:n=!0,event:i="click",toggle:r=!0,ignoreMouse:s=!1,stickIfOpen:o=!0,touchOpenDelay:l=0,reason:c=e1}=t,u="rootStore"in e?e.rootStore:e,d=u.context.dataRef,f=p.useRef(void 0),h=Kz(),m=ov(),g=p.useMemo(()=>{function b(y,w,x,k){const S=pa(c,w,x);y&&k==="touch"&&l>0?m.start(l,()=>{u.setOpen(!0,S)}):u.setOpen(y,S)}function v(y,w,x){const k=d.current.openEvent,S=u.select("domReferenceElement")!==w;return y&&S||!y||!r?!0:k&&o?!x(k.type):!1}return{onPointerDown(y){f.current=sw(y.pointerType,!0)&&s_e(y.nativeEvent)?"virtual":y.pointerType},onMouseDown(y){const w=f.current,x=y.nativeEvent,k=u.select("open");if(y.button!==0||i==="click"||sw(w,!0)&&s)return;const S=v(k,y.currentTarget,E=>E==="click"||E==="mousedown"),O=fo(x);if(Gz(O)){b(S,x,O,w);return}const A=y.currentTarget;h.request(()=>{b(S,x,A,w)})},onClick(y){if(i==="mousedown-only")return;const w=f.current;if(i==="mousedown"&&w){f.current=void 0;return}if(sw(w,!0)&&s)return;const x=u.select("open"),k=v(x,y.currentTarget,S=>S==="click"||S==="mousedown"||S==="keydown"||S==="keyup");b(k,y.nativeEvent,y.currentTarget,w)},onKeyDown(){f.current=void 0}}},[d,i,s,c,u,o,r,h,m,l]);return p.useMemo(()=>n?{reference:g}:Jl,[n,g])}function vrt(){return!1}function xrt(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function q_e(e,t={}){const{enabled:n=!0,escapeKey:i=!0,outsidePress:r=!0,outsidePressEvent:s="sloppy",referencePress:o=vrt,bubbles:l,externalTree:c}=t,u="rootStore"in e?e.rootStore:e,d=u.useState("open"),f=u.useState("floatingElement"),{dataRef:h}=u.context,m=W1(c),g=oi(typeof r=="function"?r:()=>!1),b=typeof r=="function"?g:r,v=b!==!1,y=oi(()=>s),{escapeKey:w,outsidePress:x}=xrt(l),k=p.useRef(!1),S=p.useRef(!1),O=p.useRef(!1),A=p.useRef(!1),E=p.useRef(""),j=p.useRef(null),T=ov(),R=ov(),C=oi(()=>{R.clear(),h.current.insideReactTree=!1}),N=oi(q=>{var z;const U=(z=h.current.floatingContext)==null?void 0:z.nodeId;return(m?Gg(m.nodesRef.current,U):[]).some(J=>{var ne;return((ne=J.context)==null?void 0:ne.open)&&!J.context.dataRef.current[q]})}),P=oi(q=>j3(q,u.select("floatingElement"))||j3(q,u.select("domReferenceElement"))),I=oi(q=>{o()&&u.setOpen(!1,pa(e1,q.nativeEvent))}),D=oi(q=>{if(!d||!n||!i||q.key!=="Escape"||A.current||!w&&N("__escapeKeyBubbles"))return;const U=Knt(q)?q.nativeEvent:q,Z=pa(I_e,U);u.setOpen(!1,Z),Z.isCanceled||q.preventDefault(),!w&&!Z.isPropagationAllowed&&q.stopPropagation()}),_=oi(()=>{h.current.insideReactTree=!0,R.start(0,C)}),L=oi(q=>{if(!d||!n||q.button!==0)return;const U=fo(q.nativeEvent);ii(u.select("floatingElement"),U)&&(k.current||(k.current=!0,S.current=!1))}),F=oi(q=>{!d||!n||(q.defaultPrevented||q.nativeEvent.defaultPrevented)&&k.current&&(S.current=!0)});p.useEffect(()=>{if(!d||!n)return C;h.current.__escapeKeyBubbles=w,h.current.__outsidePressBubbles=x;const q=new Qu,U=new Qu;function Z(){q.clear(),A.current=!0}function z(){q.start(q1?5:0,()=>{A.current=!1})}function J(){O.current=!0,U.start(0,()=>{O.current=!1})}function ne(){k.current=!1,S.current=!1}function W(){const Me=E.current,re=Me==="pen"||!Me?"mouse":Me,ue=y(),be=typeof ue=="function"?ue():ue;return typeof be=="string"?be:be[re]}function X(Me){const re=W();return re==="intentional"&&Me.type!=="click"||re==="sloppy"&&Me.type==="click"}function ce(Me){var be;const re=(be=h.current.floatingContext)==null?void 0:be.nodeId,ue=m&&Gg(m.nodesRef.current,re).some(Ce=>{var Ee;return j3(Me,(Ee=Ce.context)==null?void 0:Ee.elements.floating)});return P(Me)||ue}function V(Me){if(X(Me)){Me.type!=="click"&&!P(Me)&&(U.clear(),O.current=!1),C();return}if(h.current.insideReactTree){C();return}const re=fo(Me),ue=`[${oI("inert")}]`,be=Tr(re)?re.getRootNode():null,Ce=Array.from((Zw(be)?be:Cr(u.select("floatingElement"))).querySelectorAll(ue)),Ee=u.context.triggerElements;if(re&&(Ee.hasElement(re)||Ee.hasMatchingElement(Ge=>ii(Ge,re))))return;let Ve=Tr(re)?re:null;for(;Ve&&!Rg(Ve);){const Ge=Kg(Ve);if(Rg(Ge)||!Tr(Ge))break;Ve=Ge}if(!(Ce.length&&Tr(re)&&!Hnt(re)&&!ii(re,u.select("floatingElement"))&&Ce.every(Ge=>!ii(Ve,Ge)))){if(Zs(re)&&!("touches"in Me)){const Ge=Rg(re),ye=Uu(re),oe=/auto|scroll/,ie=Ge||oe.test(ye.overflowX),Ae=Ge||oe.test(ye.overflowY),Re=ie&&re.clientWidth>0&&re.scrollWidth>re.clientWidth,St=Ae&&re.clientHeight>0&&re.scrollHeight>re.clientHeight,Nt=ye.direction==="rtl",Dt=St&&(Nt?Me.offsetX<=re.offsetWidth-re.clientWidth:Me.offsetX>re.clientWidth),Et=Re&&Me.offsetY>re.clientHeight;if(Dt||Et)return}if(!ce(Me)){if(W()==="intentional"&&O.current){U.clear(),O.current=!1;return}typeof b=="function"&&!b(Me)||N("__outsidePressBubbles")||(u.setOpen(!1,pa(N_e,Me)),C())}}}function Y(Me){W()!=="sloppy"||Me.pointerType==="touch"||!u.select("open")||!n||P(Me)||V(Me)}function K(Me){if(W()!=="sloppy"||!u.select("open")||!n||P(Me))return;const re=Me.touches[0];re&&(j.current={startTime:Date.now(),startX:re.clientX,startY:re.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},T.start(1e3,()=>{j.current&&(j.current.dismissOnTouchEnd=!1,j.current.dismissOnMouseDown=!1)}))}function de(Me,re){const ue=fo(Me);if(!ue)return;const be=Di(ue,Me.type,()=>{re(Me),be()})}function ee(Me){E.current="touch",de(Me,K)}function Oe(Me){T.clear(),Me.type==="pointerdown"&&(E.current=Me.pointerType),!(Me.type==="mousedown"&&j.current&&!j.current.dismissOnMouseDown)&&de(Me,re=>{re.type==="pointerdown"?Y(re):V(re)})}function he(Me){if(!k.current)return;const re=S.current;if(ne(),W()==="intentional"){if(Me.type==="pointercancel"){re&&J();return}if(!ce(Me)){if(re){J();return}typeof b=="function"&&!b(Me)||(U.clear(),O.current=!0,C())}}}function ge(Me){if(W()!=="sloppy"||!j.current||P(Me))return;const re=Me.touches[0];if(!re)return;const ue=Math.abs(re.clientX-j.current.startX),be=Math.abs(re.clientY-j.current.startY),Ce=Math.sqrt(ue*ue+be*be);Ce>5&&(j.current.dismissOnTouchEnd=!0),Ce>10&&(V(Me),T.clear(),j.current=null)}function Se(Me){de(Me,ge)}function xe(Me){W()!=="sloppy"||!j.current||P(Me)||(j.current.dismissOnTouchEnd&&V(Me),T.clear(),j.current=null)}function Pe(Me){de(Me,xe)}const Ue=Cr(f),Ke=yh(i&&yh(Di(Ue,"keydown",D),Di(Ue,"compositionstart",Z),Di(Ue,"compositionend",z)),v&&yh(Di(Ue,"click",Oe,!0),Di(Ue,"pointerdown",Oe,!0),Di(Ue,"pointerup",he,!0),Di(Ue,"pointercancel",he,!0),Di(Ue,"mousedown",Oe,!0),Di(Ue,"mouseup",he,!0),Di(Ue,"touchstart",ee,!0),Di(Ue,"touchmove",Se,!0),Di(Ue,"touchend",Pe,!0)));return()=>{Ke(),q.clear(),U.clear(),ne(),O.current=!1,C()}},[h,f,i,v,b,d,n,w,x,D,C,y,N,P,m,u,T]);const M=p.useMemo(()=>({onKeyDown:D,onPointerDown:I,onClick:I}),[D,I]),H=p.useMemo(()=>({onKeyDown:D,onPointerDown:F,onMouseDown:F,onClickCapture:_,onMouseDownCapture(q){_(),L(q)},onPointerDownCapture(q){_(),L(q)},onMouseUpCapture:_,onTouchEndCapture:_,onTouchMoveCapture:_}),[D,_,L,F]);return p.useMemo(()=>n?{reference:M,floating:H,trigger:M}:{},[n,M,H])}function $J(e,t,n){let{reference:i,floating:r}=e;const s=pd(t),o=HD(t),l=VD(o),c=kd(t),u=s==="y",d=i.x+i.width/2-r.width/2,f=i.y+i.height/2-r.height/2,h=i[l]/2-r[l]/2;let m;switch(c){case"top":m={x:d,y:i.y-r.height};break;case"bottom":m={x:d,y:i.y+i.height};break;case"right":m={x:i.x+i.width,y:f};break;case"left":m={x:i.x-r.width,y:f};break;default:m={x:i.x,y:i.y}}const g=mm(t);return g&&(m[o]+=h*(g==="end"?1:-1)*(n&&u?-1:1)),m}async function wrt(e,t){var n;t===void 0&&(t={});const{x:i,y:r,platform:s,rects:o,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=Eh(t,e),g=Zz(m),v=l[h?f==="floating"?"reference":"floating":f],y=iI(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),w=f==="floating"?{x:i,y:r,width:o.floating.width,height:o.floating.height}:o.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),k=await(s.isElement==null?void 0:s.isElement(x))&&await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1},S=iI(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:x,strategy:c}):w);return{top:(y.top-S.top+g.top)/k.y,bottom:(S.bottom-y.bottom+g.bottom)/k.y,left:(y.left-S.left+g.left)/k.x,right:(S.right-y.right+g.right)/k.x}}const krt=50,Ort=async(e,t,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:wrt},c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:f}=$J(u,i,c),h=i,m=0;const g={};for(let b=0;b({name:"arrow",options:e,async fn(t){const{x:n,y:i,placement:r,rects:s,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=Eh(e,t)||{};if(u==null)return{};const f=Zz(d),h={x:n,y:i},m=HD(r),g=VD(m),b=await o.getDimensions(u),v=m==="y",y=v?"top":"left",w=v?"bottom":"right",x=v?"clientHeight":"clientWidth",k=s.reference[g]+s.reference[m]-h[m]-s.floating[g],S=h[m]-s.reference[m],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let A=O?O[x]:0;(!A||!await(o.isElement==null?void 0:o.isElement(O)))&&(A=l.floating[x]||s.floating[g]);const E=k/2-S/2,j=A/2-b[g]/2-1,T=Xg(f[y],j),R=Xg(f[w],j),C=A-b[g]-R,N=A/2-b[g]/2+E,P=Xz(T,N,C),I=!c.arrow&&mm(r)!=null&&N!==P&&s.reference[g]/2-(NP<=0)){var R,C;const P=(((R=s.flip)==null?void 0:R.index)||0)+1,I=A[P];if(I&&(!(f==="alignment"?w!==pd(I):!1)||T.every(L=>pd(L.placement)===w?L.overflows[0]>0:!0)))return{data:{index:P,overflows:T},reset:{placement:I}};let D=(C=T.filter(_=>_.overflows[0]<=0).sort((_,L)=>_.overflows[1]-L.overflows[1])[0])==null?void 0:C.placement;if(!D)switch(m){case"bestFit":{var N;const _=(N=T.filter(L=>{if(O){const F=pd(L.placement);return F===w||F==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(F=>F>0).reduce((F,M)=>F+M,0)]).sort((L,F)=>L[1]-F[1])[0])==null?void 0:N[0];_&&(D=_);break}case"initialPlacement":D=l;break}if(r!==D)return{reset:{placement:D}}}return{}}}};function FJ(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function BJ(e){return Ynt.some(t=>e[t]>=0)}const Crt=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:i}=t,{strategy:r="referenceHidden",...s}=Eh(e,t);switch(r){case"referenceHidden":{const o=await i.detectOverflow(t,{...s,elementContext:"reference"}),l=FJ(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:BJ(l)}}}case"escaped":{const o=await i.detectOverflow(t,{...s,altBoundary:!0}),l=FJ(o,n.floating);return{data:{escapedOffsets:l,escaped:BJ(l)}}}default:return{}}}}},W_e=new Set(["left","top"]);async function Art(e,t){const{placement:n,platform:i,elements:r}=e,s=await(i.isRTL==null?void 0:i.isRTL(r.floating)),o=kd(n),l=mm(n),c=pd(n)==="y",u=W_e.has(o)?-1:1,d=s&&c?-1:1,f=Eh(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof g=="number"&&(m=l==="end"?g*-1:g),c?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const Trt=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,i;const{x:r,y:s,placement:o,middlewareData:l}=t,c=await Art(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(i=l.arrow)!=null&&i.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:o}}}}},_rt=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:i,placement:r,platform:s}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:c={fn:w=>{let{x,y:k}=w;return{x,y:k}}},...u}=Eh(e,t),d={x:n,y:i},f=await s.detectOverflow(t,u),h=pd(r),m=Yz(h);let g=d[m],b=d[h];const v=(w,x)=>Xz(x+f[w==="y"?"top":"left"],x,x-f[w==="y"?"bottom":"right"]);o&&(g=v(m,g)),l&&(b=v(h,b));const y=c.fn({...t,[m]:g,[h]:b});return{...y,data:{x:y.x-n,y:y.y-i,enabled:{[m]:o,[h]:l}}}}}},jrt=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,i;const{x:r,y:s,placement:o,rects:l,middlewareData:c}=t,{offset:u=0,mainAxis:d=!0,crossAxis:f=!0}=Eh(e,t),h={x:r,y:s},m=pd(o),g=Yz(m);let b=h[g],v=h[m];const y=Eh(u,t),w=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:(n=y.mainAxis)!=null?n:0,crossAxis:(i=y.crossAxis)!=null?i:0};if(d){const S=g==="y"?"height":"width",O=l.reference[g]-l.floating[S]+w.mainAxis,A=l.reference[g]+l.reference[S]-w.mainAxis;bA&&(b=A)}if(f){var x,k;const S=g==="y"?"width":"height",O=W_e.has(kd(o)),A=l.reference[m]-l.floating[S]+(O&&((x=c.offset)==null?void 0:x[m])||0)+(O?0:w.crossAxis),E=l.reference[m]+l.reference[S]+(O?0:((k=c.offset)==null?void 0:k[m])||0)-(O?w.crossAxis:0);vE&&(v=E)}return{[g]:b,[m]:v}}}},Nrt=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:i,platform:r,elements:s}=t,{apply:o=()=>{},...l}=Eh(e,t),c=await r.detectOverflow(t,l),u=kd(n),d=mm(n),f=pd(n)==="y",{width:h,height:m}=i.floating;let g,b;u==="top"||u==="bottom"?(g=u,b=d===(await(r.isRTL==null?void 0:r.isRTL(s.floating))?"start":"end")?"left":"right"):(b=u,g=d==="end"?"top":"bottom");const v=m-c.top-c.bottom,y=h-c.left-c.right,w=Xg(m-c[g],v),x=Xg(h-c[b],y),k=t.middlewareData.shift,S=!k;let O=w,A=x;k!=null&&k.enabled.x&&(A=y),k!=null&&k.enabled.y&&(O=v),S&&!d&&(f?A=h-2*Dp(c.left,c.right):O=m-2*Dp(c.top,c.bottom)),await o({...t,availableWidth:A,availableHeight:O});const E=await r.getDimensions(s.floating);return h!==E.width||m!==E.height?{reset:{rects:!0}}:{}}}};function K_e(e){const t=Uu(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const r=Zs(e),s=r?e.offsetWidth:n,o=r?e.offsetHeight:i,l=tI(n)!==s||tI(i)!==o;return l&&(n=s,i=o),{width:n,height:i,$:l}}function lV(e){return Tr(e)?e:e.contextElement}function ow(e){const t=lV(e);if(!Zs(t))return Mp(1);const n=t.getBoundingClientRect(),{width:i,height:r,$:s}=K_e(t);let o=(s?tI(n.width):n.width)/i,l=(s?tI(n.height):n.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const Rrt=Mp(0);function G_e(e){const t=ea(e);return!Wz()||!t.visualViewport?Rrt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Irt(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ea(e)}function cv(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=lV(e);let o=Mp(1);t&&(i?Tr(i)&&(o=ow(i)):o=ow(e));const l=Irt(s,n,i)?G_e(s):Mp(0);let c=(r.left+l.x)/o.x,u=(r.top+l.y)/o.y,d=r.width/o.x,f=r.height/o.y;if(s&&i){const h=ea(s),m=Tr(i)?ea(i):i;let g=h,b=Y8(g);for(;b&&m!==g;){const v=ow(b),y=b.getBoundingClientRect(),w=Uu(b),x=y.left+(b.clientLeft+parseFloat(w.paddingLeft))*v.x,k=y.top+(b.clientTop+parseFloat(w.paddingTop))*v.y;c*=v.x,u*=v.y,d*=v.x,f*=v.y,c+=x,u+=k,g=ea(b),b=Y8(g)}}return iI({width:d,height:f,x:c,y:u})}function GD(e,t){const n=UD(e).scrollLeft;return t?t.left+n:cv(pm(e)).left+n}function X_e(e,t){const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-GD(e,n),r=n.top+t.scrollTop;return{x:i,y:r}}function Prt(e){let{elements:t,rect:n,offsetParent:i,strategy:r}=e;const s=r==="fixed",o=pm(i),l=t?BD(t.floating):!1;if(i===o||l&&s)return n;let c={scrollLeft:0,scrollTop:0},u=Mp(1);const d=Mp(0),f=Zs(i);if((f||!s)&&((dl(i)!=="body"||HA(o))&&(c=UD(i)),f)){const m=cv(i);u=ow(i),d.x=m.x+i.clientLeft,d.y=m.y+i.clientTop}const h=o&&!f&&!s?X_e(o,c):Mp(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+h.x,y:n.y*u.y-c.scrollTop*u.y+d.y+h.y}}function Drt(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Mrt(e){const t=UD(e),n=e.ownerDocument.body,i=Dp(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=Dp(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-t.scrollLeft+GD(e);const o=-t.scrollTop;return Uu(n).direction==="rtl"&&(s+=Dp(e.clientWidth,n.clientWidth)-i),{width:i,height:r,x:s,y:o}}const Lrt=25;function $rt(e,t,n){n===void 0&&(n="viewport");const i=n==="layoutViewport",r=ea(e),s=pm(e),o=r.visualViewport;let l=s.clientWidth,c=s.clientHeight,u=0,d=0;if(o){const h=!Wz()||t==="fixed";i?h||(u=-o.offsetLeft,d=-o.offsetTop):(l=o.width,c=o.height,h&&(u=o.offsetLeft,d=o.offsetTop))}if(GD(s)<=0){const h=s.ownerDocument,m=h.body,g=getComputedStyle(m),b=h.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,v=Math.abs(s.clientWidth-m.clientWidth-b),y=getComputedStyle(s).scrollbarGutter==="stable both-edges"?v/2:v;y<=Lrt&&(l-=y)}return{width:l,height:c,x:u,y:d}}function Frt(e,t){const n=cv(e,!0,t==="fixed"),i=n.top+e.clientTop,r=n.left+e.clientLeft,s=ow(e),o=e.clientWidth*s.x,l=e.clientHeight*s.y,c=r*s.x,u=i*s.y;return{width:o,height:l,x:c,y:u}}function UJ(e,t,n){let i;if(t==="viewport"||t==="layoutViewport")i=$rt(e,n,t);else if(t==="document")i=Mrt(pm(e));else if(Tr(t))i=Frt(t,n);else{const r=G_e(e);i={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return iI(i)}function Brt(e,t){const n=t.get(e);if(n)return n;let i=uC(e,[],!1).filter(l=>Tr(l)&&dl(l)!=="body"),r=null;const s=Uu(e).position==="fixed";let o=s?Kg(e):e;for(;Tr(o)&&!Rg(o);){const l=Uu(o),c=qz(o),u=r?r.position:s?"fixed":"";!c&&(u==="fixed"||u==="absolute"&&l.position==="static")?i=i.filter(f=>f!==o):r=l,o=Kg(o)}return t.set(e,i),i}function Urt(e){let{element:t,boundary:n,rootBoundary:i,strategy:r}=e;const o=[...n==="clippingAncestors"?BD(t)?[]:Brt(t,this._c):[].concat(n),i],l=UJ(t,o[0],r);let c=l.top,u=l.right,d=l.bottom,f=l.left;for(let h=1;h{l(!1,1e-7)},1e3)}A=!1}try{i=new IntersectionObserver(E,{...O,root:s.ownerDocument})}catch{i=new IntersectionObserver(E,O)}i.observe(e)}const c=ea(e),u=()=>l(n);return c.addEventListener("resize",u),l(!0),()=>{c.removeEventListener("resize",u),o()}}function aB(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=i,u=lV(e),d=r||s?[...u?uC(u):[],...t?uC(t):[]]:[];d.forEach(y=>{r&&y.addEventListener("scroll",n),s&&y.addEventListener("resize",n)});const f=u&&l?Wrt(u,n,s):null;let h=-1,m=null;o&&(m=new ResizeObserver(y=>{let[w]=y;w&&w.target===u&&m&&t&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),n()}),u&&!c&&m.observe(u),t&&m.observe(t));let g,b=c?cv(e):null;c&&v();function v(){const y=cv(e);b&&!Z_e(b,y)&&n(),b=y,g=requestAnimationFrame(v)}return n(),()=>{var y;d.forEach(w=>{r&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),f==null||f(),(y=m)==null||y.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const Krt=Trt,Grt=_rt,Xrt=Ert,Yrt=Nrt,Zrt=Crt,zJ=Srt,Jrt=jrt,est=(e,t,n)=>{const i=new Map,r=n??{},s={...qrt,...r.platform,_c:i};return Ort(e,t,{...r,platform:s})};var tst=typeof document<"u",nst=function(){},pN=tst?p.useLayoutEffect:nst;function lI(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,i,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(i=n;i--!==0;)if(!lI(e[i],t[i]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(t,r[i]))return!1;for(i=n;i--!==0;){const s=r[i];if(!(s==="_owner"&&e.$$typeof)&&!lI(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function J_e(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function VJ(e,t){const n=J_e(e);return Math.round(t*n)/n}function U3(e){const t=p.useRef(e);return pN(()=>{t.current=e}),t}function eje(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:i=[],platform:r,elements:{reference:s,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=p.useState(i);lI(h,i)||m(i);const[g,b]=p.useState(null),[v,y]=p.useState(null),w=p.useCallback(L=>{L!==O.current&&(O.current=L,b(L))},[]),x=p.useCallback(L=>{L!==A.current&&(A.current=L,y(L))},[]),k=s||g,S=o||v,O=p.useRef(null),A=p.useRef(null),E=p.useRef(d),j=c!=null,T=U3(c),R=U3(r),C=U3(u),N=p.useCallback(()=>{if(!O.current||!A.current)return;const L={placement:t,strategy:n,middleware:h};R.current&&(L.platform=R.current),est(O.current,A.current,L).then(F=>{const M={...F,isPositioned:C.current!==!1};P.current&&!lI(E.current,M)&&(E.current=M,vi.flushSync(()=>{f(M)}))})},[h,t,n,R,C]);pN(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(L=>({...L,isPositioned:!1})))},[u]);const P=p.useRef(!1);pN(()=>(P.current=!0,()=>{P.current=!1}),[]),pN(()=>{if(k&&(O.current=k),S&&(A.current=S),k&&S){if(T.current)return T.current(k,S,N);N()}},[k,S,N,T,j]);const I=p.useMemo(()=>({reference:O,floating:A,setReference:w,setFloating:x}),[w,x]),D=p.useMemo(()=>({reference:k,floating:S}),[k,S]),_=p.useMemo(()=>{const L={position:n,left:0,top:0};if(!D.floating)return L;const F=VJ(D.floating,d.x),M=VJ(D.floating,d.y);return l?{...L,transform:"translate("+F+"px, "+M+"px)",...J_e(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:M}},[n,l,D.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:N,refs:I,elements:D,floatingStyles:_}),[d,N,I,D,_])}const ist=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:i,padding:r}=typeof e=="function"?e(n):e;return i&&t(i)?i.current!=null?zJ({element:i.current,padding:r}).fn(n):{}:i?zJ({element:i,padding:r}).fn(n):{}}}},tje=(e,t)=>{const n=Krt(e);return{name:n.name,fn:n.fn,options:[e,t]}},nje=(e,t)=>{const n=Grt(e);return{name:n.name,fn:n.fn,options:[e,t]}},ije=(e,t)=>({fn:Jrt(e).fn,options:[e,t]}),rje=(e,t)=>{const n=Xrt(e);return{name:n.name,fn:n.fn,options:[e,t]}},sje=(e,t)=>{const n=Yrt(e);return{name:n.name,fn:n.fn,options:[e,t]}},rst=(e,t)=>{const n=Zrt(e);return{name:n.name,fn:n.fn,options:[e,t]}},sst=(e,t)=>{const n=ist(e);return{name:n.name,fn:n.fn,options:[e,t]}},ast={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class cV extends $D{constructor(n){const{syncOnly:i,nested:r,onOpenChange:s,triggerElements:o,...l}=n;super({...l,positionReference:l.referenceElement,domReferenceElement:l.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:U_e(),nested:r,triggerElements:o},ast);Zt(this,"syncOpenEvent",(n,i)=>{(!n||!this.state.open||i!=null&&Xnt(i))&&(this.context.dataRef.current.openEvent=n?i:void 0)});Zt(this,"dispatchOpenChange",(n,i)=>{this.syncOpenEvent(n,i.event);const r={open:n,reason:i.reason,nativeEvent:i.event,nested:this.context.nested,triggerElement:i.trigger};this.context.events.emit("openchange",r)});Zt(this,"setOpen",(n,i)=>{var r,s,o,l;if(this.syncOnly){(s=(r=this.context).onOpenChange)==null||s.call(r,n,i);return}this.dispatchOpenChange(n,i),(l=(o=this.context).onOpenChange)==null||l.call(o,n,i)});this.syncOnly=i}}function ost(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:i,floatingId:r,nested:s,onOpenChange:o}=e,l=t.useState("open"),c=t.useState("activeTriggerElement"),u=t.useState(n?"popupElement":"positionerElement"),d=t.context.triggerElements,f=o,h=p.useRef(null);i===void 0&&h.current===null&&(h.current=new cV({open:l,transitionStatus:void 0,referenceElement:c,floatingElement:u,triggerElements:d,onOpenChange:f,floatingId:r,syncOnly:!0,nested:s}));const m=i??h.current;return t.useSyncedValue("floatingId",r),ti(()=>{const g={open:l,floatingId:r,referenceElement:c,floatingElement:u};Tr(c)&&(g.domReferenceElement=c),m.state.positionReference===m.state.referenceElement&&(g.positionReference=c),m.update(g)},[l,r,c,u,m]),m.context.onOpenChange=f,m.context.nested=s,m}function aje(e,t=!1,n=!1){const[i,r]=p.useState(e&&t?"idle":void 0),[s,o]=p.useState(e);return e&&!s&&(o(!0),r("starting")),!e&&s&&i!=="ending"&&!n&&r("ending"),!e&&!s&&i==="ending"&&r(void 0),ti(()=>{if(!e&&s&&i!=="ending"&&n){const l=Cc.request(()=>{r("ending")});return()=>{Cc.cancel(l)}}},[e,s,i,n]),ti(()=>{if(!e||t)return;const l=Cc.request(()=>{r(void 0)});return()=>{Cc.cancel(l)}},[t,e]),ti(()=>{if(!e||!t)return;e&&s&&i!=="idle"&&r("starting");const l=Cc.request(()=>{r("idle")});return()=>{Cc.cancel(l)}},[t,e,s,i]),{mounted:s,setMounted:o,transitionStatus:i}}const oje={tabIndex:-1,[J8]:""};function lje(e){return t=>t==="touch"?e.current:!0}function cje(e,t=!1){const n=KA(),i=KD()!=null,r=Td(()=>e(n,i)).current;return ost({popupStore:r,treatPopupAsFloatingElement:t,floatingRootContext:r.state.floatingRootContext,floatingId:n,nested:i,onOpenChange:r.setOpen}),r}function uje({handle:e,store:t}){return ti(()=>e.attachStore(t),[e,t]),null}function lst(e,t){const n=p.useRef(null),i=p.useRef(null);return p.useCallback(r=>{if(e===void 0)return;let s=!1;if(n.current!==null){const o=n.current,l=i.current,c=t.context.triggerElements.getById(o);l&&c===l&&(t.context.triggerElements.delete(o),s=!0),n.current=null,i.current=null}if(r!==null&&(n.current=e,i.current=r,t.context.triggerElements.add(e,r),s=!0),s){const o=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==o&&t.set("triggerCount",o)}},[t,e])}function dje(e,t,n,i=!1){t?e.preventUnmountingOnClose=!1:i&&(e.preventUnmountingOnClose=!0);const r=(n==null?void 0:n.id)??null;(r||t)&&(e.activeTriggerId=r,e.activeTriggerElement=n??null)}function cst(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function fje(e,t,n,i){const r=n.useState("isMountedByTrigger",e),s=lst(e,n),o=oi(c=>{const u=n.select("open"),d=n.select("activeTriggerId");if(d===e){n.update({activeTriggerElement:c,...u?i:null});return}d==null&&u&&n.update({activeTriggerId:e,activeTriggerElement:c,...i})}),l=p.useCallback(c=>{s(c),c&&o(c)},[s,o]);return ti(()=>{r&&n.update({activeTriggerElement:t.current,...i})},[r,n,t,...Object.values(i)]),{registerTrigger:l,isMountedByThisTrigger:r}}function hje(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,i=p.useRef(null),r=e.useState("open"),s=e.useState("triggerCount"),o=e.useState("activeTriggerId"),l=e.useState("activeTriggerElement");ti(()=>{if(!r){i.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const c=e.context.triggerElements.size,u={};e.state.triggerCount!==c&&(u.triggerCount=c);const d=e.select("activeTriggerId");let f=null;if(d){const h=e.context.triggerElements.getById(d);if(h)i.current=d,h!==e.state.activeTriggerElement&&(u.activeTriggerElement=h);else{for(const[m,g]of e.context.triggerElements.entries())if(g===e.state.activeTriggerElement){u.activeTriggerId=m,u.activeTriggerElement=g,i.current=m;break}u.activeTriggerId===void 0&&(i.current===d?f=d:i.current=null)}}else i.current=null;if(!f&&!d&&c===1){const h=e.context.triggerElements.entries().next();if(!h.done){const[m,g]=h.value;u.activeTriggerId=m,u.activeTriggerElement=g,i.current=m}}(u.triggerCount!==void 0||u.activeTriggerId!==void 0||u.activeTriggerElement!==void 0)&&e.update(u),f&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===f&&!e.context.triggerElements.getById(f)){const h=pa(j_e);e.setOpen(!1,h),h.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[r,e,s,o,l,n])}function pje(e,t,n){const{mounted:i,setMounted:r,transitionStatus:s}=aje(e),o=t.useState("preventUnmountingOnClose"),l=e?!1:o;t.useSyncedValues({mounted:i,transitionStatus:s,preventUnmountingOnClose:l});const c=oi(()=>{var u,d;r(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n==null||n(),(d=(u=t.context).onOpenChangeComplete)==null||d.call(u,!1)});return WA({enabled:i&&!e&&!l,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:s}}function mje(e,t){e.useSyncedValues(t),ti(()=>()=>{e.update({activeTriggerProps:Jl,inactiveTriggerProps:Jl,popupProps:Jl})},[e])}function gje(e,t){ti(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),ti(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class uV{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function ust(){return new cV({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new uV,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function bje(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:ust(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Jl,inactiveTriggerProps:Jl,popupProps:Jl}}function yje(e,t,n=!1){return new cV({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}const rE=e=>e.triggerIdProp??e.activeTriggerId,dV=e=>e.openProp??e.open,HJ=e=>{var n;return(((n=e.popupElement)==null?void 0:n.id)??e.floatingId)||void 0};function vje(e,t){return t!==void 0&&dV(e)&&rE(e)===t}function dst(e,t){return vje(e,t)?!0:t!==void 0&&dV(e)&&rE(e)==null&&e.triggerCount===1}const xje={open:dV,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:rE,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:HJ,isTriggerActive:(e,t)=>t!==void 0&&rE(e)===t,isOpenedByTrigger:(e,t)=>vje(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&rE(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>dst(e,t)?HJ(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function wje(e){const t=p.useCallback(i=>e===void 0?Uz:e.subscribeStore(i),[e]),n=p.useCallback(()=>e===void 0?void 0:e.store,[e]);return XP.useSyncExternalStore(t,n,()=>e==null?void 0:e.serverStore)}function fst(e){return hst(e,e.rootContext)}function hst(e,t){const{nodeId:n,externalTree:i}=e,r=t.useState("referenceElement"),s=t.useState("floatingElement"),o=t.useState("domReferenceElement"),l=t.useState("open"),c=t.useState("floatingId"),[u,d]=p.useState(null),[f,h]=p.useState(void 0),[m,g]=p.useState(void 0),b=p.useRef(null),v=W1(i),y=p.useMemo(()=>({reference:r,floating:s,domReference:o}),[r,s,o]),w=eje({...e,elements:{...y,...u&&{reference:u}}}),x=Tr(f)?f:null,k=m===void 0?t.state.floatingElement:m;t.useSyncedValue("referenceElement",f??null),t.useSyncedValue("domReferenceElement",f===void 0?o:x),t.useSyncedValue("floatingElement",k);const S=p.useCallback(R=>{const C=Tr(R)?{getBoundingClientRect:()=>R.getBoundingClientRect(),getClientRects:()=>R.getClientRects(),contextElement:R}:R;d(C),w.refs.setReference(C)},[w.refs]),O=p.useCallback(R=>{(Tr(R)||R===null)&&(b.current=R,h(R)),(Tr(w.refs.reference.current)||w.refs.reference.current===null||R!==null&&!Tr(R))&&w.refs.setReference(R)},[w.refs,h]),A=p.useCallback(R=>{g(R),w.refs.setFloating(R)},[w.refs]),E=p.useMemo(()=>({...w.refs,setReference:O,setFloating:A,setPositionReference:S,domReference:b}),[w.refs,O,A,S]),j=p.useMemo(()=>({...w.elements,domReference:o}),[w.elements,o]),T=p.useMemo(()=>({...w,dataRef:t.context.dataRef,open:l,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:E,elements:j,nodeId:n,rootStore:t}),[w,E,j,n,t,l,c]);return ti(()=>{o&&(b.current=o)},[o]),ti(()=>{t.context.dataRef.current.floatingContext=T;const R=v==null?void 0:v.nodesRef.current.find(C=>C.id===n);R&&(R.context=T)}),p.useMemo(()=>({...w,context:T,refs:E,elements:j,rootStore:t}),[w,E,j,T,t])}class fV{constructor(){Zt(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});Zt(this,"disposeEffect",()=>this.dispose);this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Qu,this.restTimeout=new Qu,this.handleCloseOptions=void 0}static create(){return new fV}}const cI=new WeakMap;function uI(e){var n,i,r;if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&cI.get(t)===e&&((n=e.pointerEventsScopeElement)==null||n.style.removeProperty("pointer-events"),(i=e.pointerEventsReferenceElement)==null||i.style.removeProperty("pointer-events"),(r=e.pointerEventsFloatingElement)==null||r.style.removeProperty("pointer-events"),cI.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function kje(e,t){const{scopeElement:n,referenceElement:i,floatingElement:r}=t,s=cI.get(n);s&&s!==e&&uI(s),uI(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=i,e.pointerEventsFloatingElement=r,cI.set(n,e),n.style.pointerEvents="none",i.style.pointerEvents="auto",r.style.pointerEvents="auto"}function Oje(e){const t=e.context.dataRef.current,n=Td(()=>t.hoverInteractionState??fV.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),MD(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function pst(e,t={}){const{enabled:n=!0,closeDelay:i=0,nodeId:r}=t,s="rootStore"in e?e.rootStore:e,o=s.useState("open"),l=s.useState("floatingElement"),c=s.useState("domReferenceElement"),{dataRef:u}=s.context,d=W1(),f=KD(),h=Oje(s),m=ov(),g=oi(()=>{var y;return F_e((y=u.current.openEvent)==null?void 0:y.type,h.interactedInside)}),b=oi(()=>{var y;return urt((y=u.current.openEvent)==null?void 0:y.type)}),v=oi(()=>{uI(h)});ti(()=>{o||(h.pointerType=void 0,h.restTimeoutPending=!1,h.interactedInside=!1,v())},[o,h,v]),p.useEffect(()=>v,[v]),ti(()=>{var y,w,x,k,S;if(n&&o&&(y=h.handleCloseOptions)!=null&&y.blockPointerEvents&&b()&&Tr(c)&&l){const O=c,A=l,E=Cr(l),j=(x=(w=d==null?void 0:d.nodesRef.current.find(N=>N.id===f))==null?void 0:w.context)==null?void 0:x.elements.floating;j&&(j.style.pointerEvents="");const T=h.pointerEventsScopeElement!==A?h.pointerEventsScopeElement:null,R=j!==A?j:null,C=((S=(k=h.handleCloseOptions)==null?void 0:k.getScope)==null?void 0:S.call(k))??T??R??O.closest("[data-rootownerid]")??E.body;return kje(h,{scopeElement:C,referenceElement:O,floatingElement:A}),()=>{v()}}},[n,o,c,l,h,b,d,f,v]),p.useEffect(()=>{if(!n)return;function y(){return!!(d&&f&&Gg(d.nodesRef.current,f).length>0)}function w(E){const j=rB(i,"close",h.pointerType),T=()=>{s.setOpen(!1,pa(vu,E)),d==null||d.events.emit("floating.closed",E)};j?h.openChangeTimeout.start(j,T):(h.openChangeTimeout.clear(),T())}function x(E){const j=fo(E);if(!qnt(j)){h.interactedInside=!1;return}h.interactedInside=(j==null?void 0:j.closest("[aria-haspopup]"))!=null}function k(){h.openChangeTimeout.clear(),m.clear(),d==null||d.events.off("floating.closed",O),v()}function S(E){var C;if(y()&&d){d.events.on("floating.closed",O);return}if(r_e(E.relatedTarget,s.context.triggerElements))return;const j=((C=u.current.floatingContext)==null?void 0:C.nodeId)??r,T=E.relatedTarget;if(!(d&&j&&Tr(T)&&Gg(d.nodesRef.current,j,!1).some(N=>{var P;return ii((P=N.context)==null?void 0:P.elements.floating,T)}))){if(h.handler){h.handler(E);return}v(),b()&&!g()&&w(E)}}function O(E){!d||!f||y()||m.start(0,()=>{d.events.off("floating.closed",O),s.setOpen(!1,pa(vu,E)),d.events.emit("floating.closed",E)})}const A=l;return yh(A&&Di(A,"mouseenter",k),A&&Di(A,"mouseleave",S),A&&Di(A,"pointerdown",x,!0),()=>{d==null||d.events.off("floating.closed",O)})},[n,l,s,u,i,r,b,g,v,h,d,f,m])}const mst={current:null};function gst(e,t={}){var D;const{enabled:n=!0,delay:i=0,handleClose:r=null,mouseOnly:s=!1,restMs:o=0,move:l=!0,triggerElementRef:c=mst,externalTree:u,isActiveTrigger:d=!0,getHandleCloseContext:f,isClosing:h,shouldOpen:m,guardStaleOpen:g=!1}=t,b="rootStore"in e?e.rootStore:e,{dataRef:v,events:y}=b.context,w=W1(u),x=Oje(b),k=p.useRef(!1),S=Gl(r),O=Gl(i),A=Gl(o),E=Gl(n),j=Gl(m),T=Gl(h),R=oi(()=>{var _;return F_e((_=v.current.openEvent)==null?void 0:_.type,x.interactedInside)}),C=oi(()=>{var _;return((_=j.current)==null?void 0:_.call(j))!==!1}),N=oi((_,L,F)=>{const M=b.context.triggerElements;if(M.hasElement(L))return!_||!ii(_,L);if(!Tr(F))return!1;const H=F;return M.hasMatchingElement(q=>ii(q,H))&&(!_||!ii(_,H))}),P=oi(()=>{if(!x.handler)return;Cr(b.select("domReferenceElement")).removeEventListener("mousemove",x.handler),x.handler=void 0}),I=oi(()=>{uI(x)});return d&&(x.handleCloseOptions=(D=S.current)==null?void 0:D.__options),p.useEffect(()=>P,[P]),p.useEffect(()=>{if(!n)return;function _(L){L.open?k.current=!1:(k.current=L.reason===vu,P(),x.openChangeTimeout.clear(),x.restTimeout.clear(),x.blockMouseMove=!0,x.restTimeoutPending=!1)}return y.on("openchange",_),()=>{y.off("openchange",_)}},[n,y,x,P]),p.useEffect(()=>{if(!n)return;function _(U,Z=!0){const z=rB(O.current,"close",x.pointerType);z?x.openChangeTimeout.start(z,()=>{b.setOpen(!1,pa(vu,U)),w==null||w.events.emit("floating.closed",U)}):Z&&(x.openChangeTimeout.clear(),b.setOpen(!1,pa(vu,U)),w==null||w.events.emit("floating.closed",U))}const L=c.current??(d?b.select("domReferenceElement"):null);if(!Tr(L))return;function F(U){var ge;if(x.openChangeTimeout.clear(),x.blockMouseMove=!1,s&&!sw(x.pointerType))return;const Z=TJ(A.current),z=rB(O.current,"open",x.pointerType),J=fo(U),ne=U.currentTarget??null,W=b.select("domReferenceElement");let X=ne;if(Tr(J)&&!b.context.triggerElements.hasElement(J)){for(const Se of b.context.triggerElements.elements())if(ii(Se,J)){X=Se;break}}Tr(ne)&&Tr(W)&&!b.context.triggerElements.hasElement(ne)&&ii(ne,W)&&(X=W);const ce=X==null?!1:N(W,X,J),V=b.select("open"),Y=((ge=T.current)==null?void 0:ge.call(T))??b.select("transitionStatus")==="ending",K=!V&&Y&&k.current,de=!ce&&Tr(X)&&Tr(W)&&ii(W,X)&&K,ee=Z>0&&!z,Oe=ce&&(V||K)||de,he=!V||ce;if(Oe){C()&&b.setOpen(!0,pa(vu,U,X));return}ee||(z?x.openChangeTimeout.start(z,()=>{he&&C()&&b.setOpen(!0,pa(vu,U,X))}):he&&C()&&b.setOpen(!0,pa(vu,U,X)))}function M(U){if(R()){I();return}P();const Z=b.select("domReferenceElement"),z=Cr(Z);x.restTimeout.clear(),x.restTimeoutPending=!1;const J=v.current.floatingContext??(f==null?void 0:f());if(r_e(U.relatedTarget,b.context.triggerElements))return;if(S.current&&J){b.select("open")||x.openChangeTimeout.clear();const W=c.current;x.handler=S.current({...J,tree:w,x:U.clientX,y:U.clientY,onClose(){I(),P(),E.current&&!R()&&W===b.select("domReferenceElement")&&_(U,!0)}}),z.addEventListener("mousemove",x.handler),x.handler(U);return}(x.pointerType==="touch"?!ii(b.select("floatingElement"),U.relatedTarget):!0)&&_(U)}function H(U){ii(L,U.relatedTarget)||(x.openChangeTimeout.clear(),x.restTimeout.clear(),x.restTimeoutPending=!1)}const q=g?Di(L,"mouseout",H):void 0;return l?yh(Di(L,"mousemove",F,{once:!0}),Di(L,"mouseenter",F),Di(L,"mouseleave",M),q):yh(Di(L,"mouseenter",F),Di(L,"mouseleave",M),q)},[P,I,v,O,b,n,S,x,d,N,R,s,l,A,c,w,E,f,T,C,g]),p.useMemo(()=>{if(!n)return;function _(L){x.pointerType=L.pointerType}return{onPointerDown:_,onPointerEnter:_,onMouseMove(L){var J,ne,W;const{nativeEvent:F}=L,M=L.currentTarget,H=b.select("domReferenceElement"),q=b.select("open"),U=N(H,M,L.target);if(s&&!sw(x.pointerType))return;if(q&&U&&((J=x.handleCloseOptions)!=null&&J.blockPointerEvents)){const X=b.select("floatingElement");if(X){const ce=((W=(ne=x.handleCloseOptions)==null?void 0:ne.getScope)==null?void 0:W.call(ne))??M.ownerDocument.body;kje(x,{scopeElement:ce,referenceElement:M,floatingElement:X})}}const Z=TJ(A.current);if(q&&!U||Z===0||!U&&x.restTimeoutPending&&L.movementX**2+L.movementY**2<2)return;x.restTimeout.clear();function z(){if(x.restTimeoutPending=!1,R())return;const X=b.select("open");!x.blockMouseMove&&(!X||U)&&C()&&b.setOpen(!0,pa(vu,F,M))}x.pointerType==="touch"?vi.flushSync(()=>{z()}):U&&q?z():(x.restTimeoutPending=!0,x.restTimeout.start(Z,z))}}},[n,x,R,N,s,b,A,C])}const qJ=.1,bst=qJ*qJ,Kr=.5;function n_(e,t,n,i,r,s){return i>=t!=s>=t&&e<=(r-n)*(t-i)/(s-i)+n}function i_(e,t,n,i,r,s,o,l,c,u){let d=!1;return n_(e,t,n,i,r,s)&&(d=!d),n_(e,t,r,s,o,l)&&(d=!d),n_(e,t,o,l,c,u)&&(d=!d),n_(e,t,c,u,n,i)&&(d=!d),d}function yst(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function r_(e,t,n,i,r,s){const o=Math.min(n,r),l=Math.max(n,r),c=Math.min(i,s),u=Math.max(i,s);return e>=o&&e<=l&&t>=c&&t<=u}function vst(e={}){const{blockPointerEvents:t=!1}=e,n=new Qu,i=({x:r,y:s,placement:o,elements:l,onClose:c,nodeId:u,tree:d})=>{const f=o==null?void 0:o.split("-")[0];let h=!1,m=null,g=null,b=typeof performance<"u"?performance.now():0;function v(w,x){const k=performance.now(),S=k-b;if(m===null||g===null||S===0)return m=w,g=x,b=k,!1;const O=w-m,A=x-g,E=O*O+A*A,j=S*S*bst;return m=w,g=x,b=k,E0)}function N(){C()||y()}if(C())return;const P=k.getBoundingClientRect(),I=S.getBoundingClientRect(),D=r>I.right-I.width/2,_=s>I.bottom-I.height/2,L=I.width>P.width,F=I.height>P.height,M=(L?P:I).left,H=(L?P:I).right,q=(F?P:I).top,U=(F?P:I).bottom;if(f==="top"&&s>=P.bottom-1||f==="bottom"&&s<=P.top+1||f==="left"&&r>=P.right-1||f==="right"&&r<=P.left+1){N();return}let Z=!1;switch(f){case"top":Z=r_(O,A,M,P.top+1,H,I.bottom-1);break;case"bottom":Z=r_(O,A,M,I.top+1,H,P.bottom-1);break;case"left":Z=r_(O,A,I.right-1,U,P.left+1,q);break;case"right":Z=r_(O,A,P.right-1,U,I.left+1,q);break}if(Z)return;if(h&&!yst(O,A,P)){N();return}if(!j&&v(O,A)){N();return}let z=!1;switch(f){case"top":{const J=L?Kr/2:Kr*4,ne=L||D?r+J:r-J,W=L?r-J:D?r+J:r-J,X=s+Kr+1,ce=D||L?I.bottom-Kr:I.top,V=D?L?I.bottom-Kr:I.top:I.bottom-Kr;z=i_(O,A,ne,X,W,X,I.left,ce,I.right,V);break}case"bottom":{const J=L?Kr/2:Kr*4,ne=L||D?r+J:r-J,W=L?r-J:D?r+J:r-J,X=s-Kr,ce=D||L?I.top+Kr:I.bottom,V=D?L?I.top+Kr:I.bottom:I.top+Kr;z=i_(O,A,ne,X,W,X,I.left,ce,I.right,V);break}case"left":{const J=F?Kr/2:Kr*4,ne=F||_?s+J:s-J,W=F?s-J:_?s+J:s-J,X=r+Kr+1,ce=_||F?I.right-Kr:I.left,V=_?F?I.right-Kr:I.left:I.right-Kr;z=i_(O,A,ce,I.top,V,I.bottom,X,ne,X,W);break}case"right":{const J=F?Kr/2:Kr*4,ne=F||_?s+J:s-J,W=F?s-J:_?s+J:s-J,X=r-Kr,ce=_||F?I.left+Kr:I.right,V=_?F?I.left+Kr:I.right:I.left+Kr;z=i_(O,A,X,ne,X,W,ce,I.top,V,I.bottom);break}}z?h||n.start(40,N):N()}};return i.__options={...e,blockPointerEvents:t},i}const xst=p.createContext(void 0);function wst(){const e=p.useContext(xst);return(e==null?void 0:e.direction)??"ltr"}const kst=e=>({name:"arrow",options:e,async fn(t){var F,M;const{x:n,y:i,placement:r,rects:s,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0,offsetParent:f="real"}=Eh(e,t)||{};if(u==null)return{};const h=Zz(d),m={x:n,y:i},g=HD(r),b=VD(g),v=await o.getDimensions(u),y=g==="y",w=y?"top":"left",x=y?"bottom":"right",k=y?"clientHeight":"clientWidth",S=s.reference[b]+s.reference[g]-m[g]-s.floating[b],O=m[g]-s.reference[g],A=f==="real"?await((F=o.getOffsetParent)==null?void 0:F.call(o,u)):l.floating;let E=l.floating[k]||s.floating[b];(!E||!await((M=o.isElement)==null?void 0:M.call(o,A)))&&(E=l.floating[k]||s.floating[b]);const j=S/2-O/2,T=E/2-v[b]/2-1,R=Math.min(h[w],T),C=Math.min(h[x],T),N=R,P=E-v[b]-C,I=E/2-v[b]/2+j,D=Xz(N,I,P),_=!c.arrow&&mm(r)!=null&&I!==D&&s.reference[b]/2-(I({...kst(e),options:[e,t]}),Sst={name:"hide",async fn(e){const{width:t,height:n,x:i,y:r}=e.rects.reference,s=t===0&&n===0&&i===0&&r===0,o=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||s}}}},Est={sideX:"left",sideY:"top"},WJ="--available-width",KJ="--available-height";function Sje(e,t,n){const i=e==="inline-start"||e==="inline-end";return{top:"top",right:i?n?"inline-start":"inline-end":"right",bottom:"bottom",left:i?n?"inline-end":"inline-start":"left"}[t]}function GJ(e,t,n){const{rects:i,placement:r}=e;return{side:Sje(t,kd(r),n),align:mm(r)||"center",anchor:{width:i.reference.width,height:i.reference.height},positioner:{width:i.floating.width,height:i.floating.height}}}function Cst(e){return Ast(e,fst)}function Ast(e,t){var He,yt;const{anchor:n,positionMethod:i="absolute",side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:l=0,collisionBoundary:c,collisionPadding:u=5,sticky:d=!1,arrowPadding:f=5,disableAnchorTracking:h=!1,inline:m,keepMounted:g=!1,floatingRootContext:b,mounted:v,collisionAvoidance:y,shift:w,nodeId:x,adaptiveOrigin:k,lazyFlip:S=!1,externalTree:O}=e,[A,E]=p.useState(null);!v&&A!==null&&E(null);const j=y.side||"flip",T=y.align||"flip",R=y.fallbackAxisSide||"end",C=(w==null?void 0:w.crossAxis)??!1,N=w==null?void 0:w.rootBoundary,P=typeof n=="function"?n:void 0,I=oi(P),D=P?I:n,_=Gl(n),L=Gl(v),M=wst()==="rtl",H=A||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":M?"left":"right","inline-start":M?"right":"left"}[r],q=o==="center"?H:`${H}-${o}`;let U=u;typeof U=="number"?U={top:U,right:U,bottom:U,left:U}:U&&(U={top:U.top||0,right:U.right||0,bottom:U.bottom||0,left:U.left||0});const Z=1,z=r==="bottom"?Z:0,J=r==="top"?Z:0,ne=r==="right"?Z:0,W=r==="left"?Z:0,X={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:U},ce=p.useRef(null),V=Gl(s),Y=Gl(l),K=typeof s!="function"?s:0,de=typeof l!="function"?l:0,ee=[];m&&ee.push(m),ee.push(tje(je=>{const kt=GJ(je,r,M),_t=typeof V.current=="function"?V.current(kt):V.current,fn=typeof Y.current=="function"?Y.current(kt):Y.current;return{mainAxis:_t,crossAxis:fn,alignmentAxis:fn}},[K,de,M,r]));const Oe=T==="none"&&j!=="shift",he=!Oe&&(d||C||j==="shift"),ge=j==="none"?null:rje({...X,padding:{top:U.top+Z+z,right:U.right+Z+W,bottom:U.bottom+Z+J,left:U.left+Z+ne},mainAxis:!C&&j==="flip",crossAxis:T==="flip"?"alignment":!1,fallbackAxisSideDirection:R}),Se=Oe?null:nje({...X,rootBoundary:N,mainAxis:T!=="none",crossAxis:he,limiter:d||C?void 0:ije(je=>{if(!ce.current)return{};const{width:kt,height:_t}=ce.current.getBoundingClientRect(),fn=pd(kd(je.placement)),tn=fn==="y"?kt:_t,qe=fn==="y"?U.left+U.right:U.top+U.bottom;return{offset:tn/2+qe/2}})},[X,d,C,N,U,T]);j==="shift"||T==="shift"||o==="center"?ee.push(Se,ge):ee.push(ge,Se),ee.push(sje({...X,apply({elements:{floating:je},availableWidth:kt,availableHeight:_t,rects:fn}){if(!L.current)return;const tn=je.style;tn.setProperty(WJ,`${kt}px`),tn.setProperty(KJ,`${_t}px`);const qe=ea(je).devicePixelRatio||1,{x:vt,y:We,width:ot,height:it}=fn.reference,tt=(Math.round((vt+ot)*qe)-Math.round(vt*qe))/qe,At=(Math.round((We+it)*qe)-Math.round(We*qe))/qe;tn.setProperty("--anchor-width",`${tt}px`),tn.setProperty("--anchor-height",`${At}px`)}}),Ost(je=>({element:ce.current||Cr(je.elements.floating).createElement("div"),padding:f,offsetParent:"floating"}),[f]),{name:"transformOrigin",fn(je){var Je,lt,hn;const{elements:kt,middlewareData:_t,placement:fn,rects:tn,y:qe}=je,vt=kd(fn),We=pd(vt),ot=ce.current,it=((Je=_t.arrow)==null?void 0:Je.x)||0,tt=((lt=_t.arrow)==null?void 0:lt.y)||0,At=(ot==null?void 0:ot.clientWidth)||0,Ot=(ot==null?void 0:ot.clientHeight)||0,Ut=it+At/2,Mt=tt+Ot/2,Ze=Math.abs(((hn=_t.shift)==null?void 0:hn.y)||0),bt=tn.reference.height/2,gt=typeof s=="function"?s(GJ(je,r,M)):s,an=Ze>gt,Bt={top:`${Ut}px calc(100% + ${gt}px)`,bottom:`${Ut}px ${-gt}px`,left:`calc(100% + ${gt}px) ${Mt}px`,right:`${-gt}px ${Mt}px`}[vt],cn=`${Ut}px ${tn.reference.y+bt-qe}px`;return kt.floating.style.setProperty("--transform-origin",he&&We==="y"&&an?cn:Bt),{}}},Sst,k),ti(()=>{!v&&b&&b.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[v,b]);const xe=p.useMemo(()=>({elementResize:!h&&typeof ResizeObserver<"u",layoutShift:!h&&typeof IntersectionObserver<"u"}),[h]),{refs:Pe,elements:Ue,x:Ke,y:Me,middlewareData:re,update:ue,placement:be,context:Ce,isPositioned:Ee,floatingStyles:Ve}=t({rootContext:b,open:g?v:void 0,placement:q,middleware:ee,strategy:i,whileElementsMounted:g?void 0:(...je)=>aB(...je,xe),nodeId:x,externalTree:O}),{sideX:Ge,sideY:ye}=re.adaptiveOrigin||Est,oe=Ee?i:"fixed",ie=p.useMemo(()=>{let je;return Ee?k?je={position:oe,[Ge]:Ke,[ye]:Me}:je={...Ve,position:oe}:je={position:oe,top:0,left:0},je[WJ]="100vw",je[KJ]="100vh",Ee||(je.opacity=0),je},[k,oe,Ge,Ke,ye,Me,Ve,Ee]),Ae=p.useRef(null);ti(()=>{if(!v)return;const je=_.current,kt=typeof je=="function"?je():je,fn=(XJ(kt)?kt.current:kt)||null||null;fn!==Ae.current&&(Pe.setPositionReference(fn),Ae.current=fn)},[v,Pe,D,_]),p.useEffect(()=>{if(!v)return;const je=_.current;typeof je!="function"&&XJ(je)&&je.current!==Ae.current&&(Pe.setPositionReference(je.current),Ae.current=je.current)},[v,Pe,D,_]),p.useEffect(()=>{if(g&&v&&Ue.reference&&Ue.floating)return aB(Ue.reference,Ue.floating,ue,xe)},[g,v,Ue,ue,xe]);const Re=kd(be),St=Sje(r,Re,M),Nt=mm(be)||"center",Dt=!!((He=re.hide)!=null&&He.referenceHidden);ti(()=>{S&&v&&Ee&&Re!==H&&E(Re)},[S,v,Ee,Re,H]);const Et=p.useMemo(()=>{var je,kt;return{position:"absolute",top:(je=re.arrow)==null?void 0:je.y,left:(kt=re.arrow)==null?void 0:kt.x}},[re.arrow]),$t=((yt=re.arrow)==null?void 0:yt.centerOffset)!==0;return p.useMemo(()=>({positionerStyles:ie,arrowStyles:Et,arrowRef:ce,arrowUncentered:$t,side:St,align:Nt,physicalSide:Re,anchorHidden:Dt,refs:Pe,context:Ce,isPositioned:Ee,update:ue}),[ie,Et,ce,$t,St,Nt,Re,Dt,Pe,Ce,Ee,ue])}function XJ(e){return e!=null&&"current"in e}(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=aI.startingStyle]="startingStyle",e[e.endingStyle=aI.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({});const Tst={"data-popup-open":""},_st={"data-popup-open":"","data-pressed":""},jst={"data-open":""},Nst={"data-closed":""},Rst={"data-anchor-hidden":""},Eje={open(e){return e?Tst:null}},Ist={open(e){return e?_st:null}},hV={open(e){return e?jst:Nst},anchorHidden(e){return e?Rst:null}},Cje={...hV,...qD};function Aje(e){return e==="starting"?$it:Jl}function Pst(e,t,{styles:n,transitionStatus:i,props:r,refs:s,hidden:o,inert:l=!1}){const c={...n};return l&&(c.pointerEvents="none"),Da("div",e,{state:t,ref:s,props:[{role:"presentation",hidden:o,style:c},Aje(i),r],stateAttributesMapping:hV})}function Tje(){const e=Qz(),t=e.useState("toasts");return p.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function gf({orientation:e="vertical",maxHeight:t,hideScrollbar:n=!1,fadeEdges:i=!1,contentClassName:r="",className:s="",style:o,children:l,hasMore:c=!1,onLoadMore:u,threshold:d=24,onScroll:f,ref:h,...m}){const[g,b]=p.useState(!1),[v,y]=p.useState(!1),[w,x]=p.useState({top:!1,bottom:!1}),k=p.useRef(null),S=p.useRef(null),O=i&&e!=="horizontal",A=!!u&&e!=="horizontal";p.useImperativeHandle(h,()=>k.current,[]),p.useEffect(()=>()=>{var T;(T=S.current)==null||T.abort()},[]);const E=p.useCallback(()=>{const T=k.current;if(!O||!T)return;const R=T.scrollHeight-T.clientHeight,C=R>1&&T.scrollTop>1,N=R>1&&R-T.scrollTop>1;x(P=>P.top===C&&P.bottom===N?P:{top:C,bottom:N})},[O]);p.useEffect(()=>{const T=k.current;if(!O||!T)return;const R=new ResizeObserver(E);R.observe(T);for(const C of T.children)R.observe(C);return E(),()=>R.disconnect()},[O,A,E]);async function j(){if(!u||!c||S.current)return;const T=new AbortController;S.current=T,b(!0),y(!1);try{await u(T.signal)}catch{T.signal.aborted||y(!0)}finally{T.signal.aborted||b(!1),S.current===T&&(S.current=null)}}return a.jsxs("div",{...m,ref:k,className:`studio-scroll-area ${s}`.trim(),"data-orientation":e,"data-hide-scrollbar":n||void 0,"data-fade-edges":O&&(w.top||w.bottom)||void 0,"data-fade-top":O&&w.top||void 0,"data-fade-bottom":O&&w.bottom||void 0,style:{maxHeight:t,...o},onScroll:T=>{f==null||f(T),E();const R=T.currentTarget;!T.defaultPrevented&&e!=="horizontal"&&!v&&R.scrollTop>0&&R.scrollHeight-R.clientHeight-R.scrollTop<=Math.max(0,d)&&j()},children:[a.jsx("div",{className:`studio-scroll-area__content ${r}`.trim(),"aria-busy":u?g:void 0,children:l}),u&&e!=="horizontal"&&a.jsx(a.Fragment,{children:a.jsxs("div",{className:"studio-scroll-area__footer",children:[g?a.jsx(av,{size:24}):a.jsx("span",{role:"status","aria-live":"polite",children:v?"加载失败":c?"向下滚动加载更多":"已加载全部"}),!g&&c&&a.jsx("button",{type:"button",onClick:()=>void j(),children:v?"重试":"加载更多"})]})})]})}function Dst(){const{add:e,close:t}=Tje();return{add:p.useCallback(({id:i,title:r,description:s,variant:o="info",duration:l,action:c,closeLabel:u,onClose:d})=>e({id:i,title:r,description:s,timeout:l,priority:"low",onClose:d,data:{variant:o,action:c,closeLabel:u}}),[e]),dismiss:t}}function Mst({position:e,label:t}){const{toasts:n,close:i}=Tje();return a.jsx(ort,{children:a.jsx(Iit,{className:"studio-toast-viewport","data-position":e,"data-empty":n.length===0||void 0,"aria-label":t,render:a.jsx(gf,{contentClassName:"studio-toast-viewport__stack"}),children:n.map(r=>{var s,o,l;return a.jsx(Xit,{toast:r,className:"studio-toast-root",swipeDirection:[],children:a.jsx(cnt,{role:"presentation",variant:(s=r.data)==null?void 0:s.variant,title:r.title!=null?a.jsx(ert,{render:a.jsx("div",{}),children:r.title}):void 0,description:r.description!=null?a.jsx(Jit,{render:a.jsx("div",{}),children:r.description}):void 0,action:(o=r.data)==null?void 0:o.action,closeLabel:(l=r.data)==null?void 0:l.closeLabel,onDismiss:()=>i(r.id)})},r.id)})})})}function Lst({children:e,duration:t=4e3,position:n="top-center",label:i="通知"}){return a.jsxs(git,{timeout:t,limit:3,children:[e,a.jsx(Mst,{position:n,label:i})]})}function $st({ownerId:e,sessionId:t,onOpen:n,hideNotices:i,refreshKey:r,onUpdate:s}){const{t:o}=_e("sandbox"),l=Dst(),c=p.useRef(new Map),u=p.useRef(new Map),d=p.useRef(null),f=p.useRef({sessionId:t,onOpen:n,toast:l,t:o,hideNotices:i,onUpdate:s});return f.current={sessionId:t,onOpen:n,toast:l,t:o,hideNotices:i,onUpdate:s},p.useEffect(()=>{if(i){f.current.toast.dismiss(),u.current.clear();return}for(const h of c.current.values())h.sessionId===t&&(f.current.toast.dismiss(h.runId),u.current.delete(h.runId))},[t,i]),p.useEffect(()=>{var h;(h=d.current)==null||h.call(d)},[r]),p.useEffect(()=>{if(!e)return;const h=new AbortController,m=c.current,g=u.current,b=new Set;let v,y=!1,w=[],x="";const k=(A,E=x)=>{var j,T;x=E,h.signal.aborted||(T=(j=f.current).onUpdate)==null||T.call(j,{ownerId:e,runs:w,loading:A,error:E})},S=A=>{const{toast:E,t:j,sessionId:T,onOpen:R}=f.current;if(!h.signal.aborted){if(f.current.hideNotices||A.sessionId===T){E.dismiss(A.runId),g.delete(A.runId);return}b.has(A.runId)||g.get(A.runId)===A.state||(g.set(A.runId,A.state),E.add({id:A.runId,duration:0,title:j(`taskNotice.${A.state}`),description:A.message.slice(0,80),variant:A.state==="succeeded"?"success":A.state==="failed"?"error":"info",closeLabel:j("taskNotice.hide"),onClose:()=>b.add(A.runId),action:a.jsx(ki,{variant:"secondary",onClick:()=>{R(A.sessionId,h.signal).catch(C=>{h.signal.aborted||E.add({id:"task-open-error",variant:"error",description:C instanceof Error?C.message:String(C)})})},children:j("taskNotice.open")})}))}},O=async(A=!1)=>{if(!(y||h.signal.aborted)){clearTimeout(v),y=!0,A&&k(!0);try{const E=await Yd.active(h.signal);if(h.signal.aborted)return;w=E,k(!1,"");const j=new Set(E.map(T=>T.runId));for(const T of m.values())if(!j.has(T.runId)&&!yu(T)){let R;try{R=await Yd.get(T.runId,h.signal)}catch(C){if(C instanceof Yw&&C.status===404){m.delete(T.runId),g.delete(T.runId),f.current.toast.dismiss(T.runId);continue}throw C}if(h.signal.aborted)return;m.set(R.runId,R),S(R)}for(const T of E)m.set(T.runId,T),S(T);f.current.toast.dismiss("task-connection")}catch(E){if(h.signal.aborted)return;E instanceof Yw&&[401,403].includes(E.status)&&(w=[],m.clear(),g.clear(),f.current.toast.dismiss()),k(!1,E instanceof Error?E.message:f.current.t("taskNotice.reconnecting")),!h.signal.aborted&&m.size&&!f.current.hideNotices&&f.current.toast.add({id:"task-connection",duration:0,description:f.current.t("taskNotice.reconnecting")})}finally{y=!1,h.signal.aborted||(v=setTimeout(O,3e3))}}};return d.current=()=>{O(!0)},k(!0),O(),()=>{h.abort(),clearTimeout(v),d.current=null,f.current.toast.dismiss()}},[e]),null}function Fst(e){const{t}=_e("sandbox");return a.jsx(Lst,{position:"bottom-right",label:t("taskNotice.label"),children:a.jsx($st,{...e},e.ownerId)})}const hC=["super_admin","admin","developer","user"];class pC extends Error{constructor(t,n){super(t),this.code=t,this.status=n}}async function _je(e){let t;try{t=await e.json()}catch{throw new pC("invalid_response",e.status)}if(!e.ok){const n=t&&typeof t=="object"&&"code"in t&&typeof t.code=="string"?t.code:"request_failed";throw new pC(n,e.status)}return t}function jje(e){return!e||typeof e!="object"?!1:"id"in e&&typeof e.id=="string"&&"name"in e&&typeof e.name=="string"&&"email"in e&&typeof e.email=="string"&&"role"in e&&hC.some(t=>t===e.role)&&"status"in e&&typeof e.status=="string"&&"lastLogin"in e&&typeof e.lastLogin=="string"&&"protected"in e&&typeof e.protected=="boolean"&&"currentUser"in e&&typeof e.currentUser=="boolean"&&"roleConflict"in e&&typeof e.roleConflict=="boolean"}async function Bst(e){const t=new URLSearchParams({page:String(e.page),pageSize:"20",query:e.query});e.role&&t.set("role",e.role);const n=await _je(await yn(`/web/users?${t}`,{signal:e.signal,cache:"no-store"}));if(!n||typeof n!="object"||!("items"in n)||!Array.isArray(n.items)||!n.items.every(jje)||!("total"in n)||typeof n.total!="number"||!("poolTotal"in n)||typeof n.poolTotal!="number"||!("page"in n)||typeof n.page!="number"||!("pageSize"in n)||typeof n.pageSize!="number"||!("userPoolId"in n)||typeof n.userPoolId!="string"||!("clientId"in n)||typeof n.clientId!="string"||!("provider"in n)||!["volcengine","byteplus"].includes(String(n.provider)))throw new pC("invalid_response",502);return n}async function Ust(e,t,n){const i=await _je(await yn(`/web/users/${encodeURIComponent(e.id)}/role`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({role:t,expectedRole:e.role}),signal:n}));if(!i||typeof i!="object"||!("user"in i)||!jje(i.user))throw new pC("invalid_response",502);return i.user}function Qst(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m7 9.5 5 5 5-5"})})}function zst(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6.5 12.5 3.5 3.5 7.5-8"})})}function bf({ariaLabel:e,value:t,valueLabel:n,placeholder:i,options:r,disabled:s=!1,searchValue:o,searchPlaceholder:l,loading:c=!1,hasMore:u=!1,emptyMessage:d,onSearchChange:f,onLoadMore:h,onChange:m}){const{t:g}=_e("ui"),b=l??g("deploymentSelect.searchPlaceholder"),v=d??g("deploymentSelect.emptyMessage"),y=p.useId(),w=p.useRef(null),x=p.useRef(null),k=p.useRef(null),S=p.useRef(null),O=p.useRef([]),[A,E]=p.useState(!1),[j,T]=p.useState(0),R=r.find(L=>L.value===t),C=(R==null?void 0:R.label)??(t?n:void 0),N=o!==void 0&&!!f,P=()=>{E(!1),N&&o&&(f==null||f(""))};p.useEffect(()=>{if(!A)return;const L=F=>{F.target instanceof Node&&w.current&&!w.current.contains(F.target)&&P()};return window.addEventListener("pointerdown",L),()=>window.removeEventListener("pointerdown",L)},[A,f,o,N]),p.useEffect(()=>{var L,F;if(A){if(N){(L=k.current)==null||L.focus();return}(F=O.current[j])==null||F.focus()}},[A,N]),p.useEffect(()=>{var L;!A||N&&document.activeElement===k.current||(L=O.current[j])==null||L.focus()},[j,A,N]),p.useEffect(()=>{T(L=>Math.min(L,Math.max(0,r.length-1)))},[r.length]),p.useEffect(()=>{if(!A||!u||c||!h)return;const L=window.requestAnimationFrame(()=>{const F=S.current;F&&F.scrollHeight<=F.clientHeight+1&&h()});return()=>window.cancelAnimationFrame(L)},[u,c,h,A,r.length]);const I=(L=1)=>{const F=r.findIndex(H=>H.value===t),M=F>=0?F:L===1?0:Math.max(0,r.length-1);T(M),E(!0)},D=L=>{r.length!==0&&T((L+r.length)%r.length)},_=L=>{var F;m(L.value),P(),(F=x.current)==null||F.focus()};return a.jsxs("div",{className:"pp-deployment-select",ref:w,onKeyDown:L=>{var M,H;const F=L.target===k.current;if(L.key==="Escape"&&A){L.preventDefault(),P(),(M=x.current)==null||M.focus();return}if(L.key==="Tab"){P();return}if(F){L.key==="ArrowDown"&&r.length>0&&(L.preventDefault(),T(0),(H=O.current[0])==null||H.focus());return}L.key==="ArrowDown"?(L.preventDefault(),A?D(j+1):I(1)):L.key==="ArrowUp"?(L.preventDefault(),A?D(j-1):I(-1)):A&&L.key==="Home"?(L.preventDefault(),T(0)):A&&L.key==="End"&&(L.preventDefault(),T(Math.max(0,r.length-1)))},children:[a.jsxs("button",{ref:x,type:"button",className:"pp-deployment-select-trigger","aria-label":e,"aria-haspopup":"listbox","aria-expanded":A,"aria-controls":A?y:void 0,disabled:s,onClick:()=>{A?P():I()},children:[a.jsx("span",{className:C?void 0:"is-placeholder",children:C??i}),a.jsx(Qst,{className:`pp-deployment-select-chevron${A?" is-open":""}`})]}),A&&a.jsxs("div",{className:"pp-deployment-select-menu",children:[N&&a.jsx("div",{className:"pp-deployment-select-search",children:a.jsx("input",{ref:k,type:"search",value:o,"aria-label":g("deploymentSelect.searchAriaLabel",{label:e}),placeholder:b,autoComplete:"off",onChange:L=>f==null?void 0:f(L.currentTarget.value)})}),a.jsx("div",{id:y,ref:S,className:"pp-deployment-select-options",role:"listbox","aria-label":e,"aria-busy":c||void 0,onScroll:L=>{if(!u||c||!h)return;const F=L.currentTarget;F.scrollHeight-F.scrollTop-F.clientHeight<=24&&h()},children:r.map((L,F)=>{const M=L.value===t;return a.jsxs("button",{ref:H=>{O.current[F]=H},type:"button",role:"option","aria-selected":M,tabIndex:F===j?0:-1,className:`pp-deployment-select-option${M?" is-selected":""}`,title:L.metadata?[L.label,L.description,L.metadata].filter(Boolean).join(` +`):L.description,onFocus:()=>T(F),onClick:()=>_(L),children:[a.jsxs("span",{className:"pp-deployment-select-copy",children:[a.jsxs("span",{className:"pp-deployment-select-name",children:[L.label,L.badge&&a.jsx("span",{className:"pp-deployment-select-badge",children:L.badge})]}),L.description&&a.jsx("small",{className:L.metadata?"pp-deployment-select-description":void 0,children:L.description}),L.metadata&&a.jsx("small",{className:"pp-deployment-select-metadata",children:L.metadata})]}),M&&a.jsx(zst,{})]},L.value)})}),c&&a.jsx("div",{className:"pp-deployment-select-state","aria-live":"polite",children:g("deploymentSelect.loadingMore")}),!c&&r.length===0&&a.jsx("div",{className:"pp-deployment-select-state",children:v})]})]})}function XD({label:e,onClick:t}){return a.jsx("button",{type:"button",className:"page-back-button","aria-label":e,title:e,onClick:t,children:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m14.5 6-6 6 6 6"})})})}function on({as:e="span",className:t="",duration:n=4,spread:i=20,children:r,style:s,...o}){const l=Math.min(Math.max(i,5),45);return a.jsx(e,{className:`text-shimmer${t?` ${t}`:""}`,style:{...s,backgroundImage:`linear-gradient(to right, hsl(var(--muted-foreground)) ${50-l}%, hsl(var(--foreground)) 50%, hsl(var(--muted-foreground)) ${50+l}%)`,animationDuration:`${n}s`},...o,children:r})}function Vst(){return a.jsx("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M16 7a6.5 6.5 0 1 0 .2 5M16 3.5V7h-3.5"})})}function Nje(e){return e instanceof pC?e.code:"request_failed"}function Hst({user:e,onClose:t,onSaved:n}){const{t:i,i18n:r}=_e("users"),s=p.useRef(null),o=p.useRef(null),l=p.useId(),c=p.useId(),[u,d]=p.useState(e.role),[f,h]=p.useState(!1),[m,g]=p.useState("");p.useEffect(()=>{const v=s.current,y=document.activeElement;return v==null||v.showModal(),()=>{var w;(w=o.current)==null||w.abort(),v==null||v.close(),y instanceof HTMLElement&&y.isConnected&&y.focus()}},[]);const b=async()=>{if(f||u===e.role&&!e.roleConflict)return;const v=new AbortController;o.current=v,h(!0),g("");try{const y=await Ust(e,u,v.signal);v.signal.aborted||n(y)}catch(y){v.signal.aborted||g(i(`errors.${Nje(y)}`,{defaultValue:i("errors.request_failed")}))}finally{v.signal.aborted||h(!1)}};return a.jsxs("dialog",{ref:s,className:"user-role-dialog","aria-labelledby":l,"aria-describedby":c,"aria-busy":f,onCancel:v=>{v.preventDefault(),f||t()},children:[a.jsxs("header",{children:[a.jsx("h2",{id:l,children:i("changeRole")}),a.jsx("button",{type:"button",className:"users-close",onClick:t,disabled:f,"aria-label":i("close"),children:a.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:a.jsx("path",{d:"m5 5 10 10M15 5 5 15"})})})]}),a.jsxs("div",{className:"user-role-dialog-body",children:[a.jsxs("div",{className:"users-account",children:[a.jsx("strong",{children:e.name}),a.jsx("span",{children:e.email||e.id})]}),a.jsx("label",{className:"users-field-label",children:i("role")}),a.jsx(bf,{ariaLabel:i("role"),placeholder:i("role"),value:u,disabled:f,options:hC.map(v=>({value:v,label:i(`roles.${v}`),description:i(`descriptions.${v}`)})),onChange:v=>{const y=hC.find(w=>w===v);y&&d(y)}},r.resolvedLanguage),a.jsx("p",{id:c,className:"users-help",children:i("effectiveAfterRefresh")}),m?a.jsx("p",{className:"users-error",role:"alert",children:m}):null]}),a.jsxs("footer",{children:[a.jsx("button",{className:"users-button",type:"button",disabled:f,onClick:t,children:i("cancel")}),a.jsx("button",{className:"users-button is-primary",type:"button",disabled:f||u===e.role&&!e.roleConflict,onClick:()=>void b(),children:i(f?"saving":"save")})]})]})}function qst({onBack:e}){const{t,i18n:n}=_e("users"),[i,r]=p.useState(null),[s,o]=p.useState(!0),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(""),[m,g]=p.useState(""),[b,v]=p.useState(1),[y,w]=p.useState(0),[x,k]=p.useState(null),[S,O]=p.useState(null),[A,E]=p.useState(null);p.useEffect(()=>{const C=new AbortController;return o(!0),c(""),Bst({page:b,query:f,role:m,signal:C.signal}).then(N=>{if(!C.signal.aborted){if(N.total>0&&N.items.length===0&&b>1){v(1);return}r(N),E(new Date)}}).catch(N=>{C.signal.aborted||c(Nje(N))}).finally(()=>{C.signal.aborted||o(!1)}),()=>C.abort()},[b,f,m,y]);const j=C=>{C.preventDefault(),h(u.trim()),v(1),w(N=>N+1)},T=C=>{if(!C)return t("neverLoggedIn");const N=Number(C),P=new Date(Number.isFinite(N)&&N>0?N<1e12?N*1e3:N:C);return Number.isNaN(P.getTime())?t("unknown"):P.toLocaleString(n.resolvedLanguage,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})},R=Math.max(1,Math.ceil(((i==null?void 0:i.total)??0)/20));return a.jsxs("section",{className:"users-page","aria-labelledby":"users-title",children:[a.jsxs("header",{className:"users-page-header",children:[a.jsx(XD,{label:t("back"),onClick:e}),a.jsx("h1",{id:"users-title",children:t("title")}),i?a.jsx("span",{className:"users-count",children:t("memberCount",{count:i.poolTotal})}):null]}),a.jsxs("div",{className:"users-content",children:[i?a.jsxs("div",{className:"users-pool",children:[a.jsx("span",{children:i.provider==="byteplus"?"BytePlus Identity":t("volcengineIdentity")}),a.jsxs("span",{className:"users-pool-id",title:i.userPoolId,children:[t("pool")," ",i.userPoolId]})]}):null,a.jsxs("div",{className:"users-toolbar",children:[a.jsxs("form",{className:"users-search",onSubmit:j,children:[a.jsx("input",{value:u,onChange:C=>d(C.target.value),onKeyDown:C=>{C.key==="Enter"&&(C.nativeEvent.isComposing||C.keyCode===229)&&C.preventDefault()},"aria-label":t("searchPlaceholder"),placeholder:t("searchPlaceholder"),maxLength:200}),a.jsx("button",{type:"submit",className:"users-button",disabled:s,children:t("search")})]}),a.jsx("div",{className:"users-role-filter",children:a.jsx(bf,{ariaLabel:t("filterRole"),placeholder:t("allRoles"),value:m,options:[{value:"",label:t("allRoles")},...hC.map(C=>({value:C,label:t(`roles.${C}`)}))],onChange:C=>{const N=hC.find(P=>P===C);g(N??""),v(1)}})}),a.jsxs("button",{type:"button",className:"users-button users-refresh",disabled:s,onClick:()=>{O(null),w(C=>C+1)},children:[a.jsx(Vst,{}),a.jsx("span",{children:t("refresh")})]})]}),a.jsx("div",{className:"users-feedback","aria-live":"polite",children:s?a.jsx(on,{children:t("loading")}):S?a.jsx("span",{children:t("saved",{name:S.name,role:t(`roles.${S.role}`)})}):A?a.jsx("span",{children:t("updatedAt",{time:A.toLocaleTimeString(n.resolvedLanguage,{hour:"2-digit",minute:"2-digit",hour12:!1})})}):null}),l?a.jsxs("div",{className:"users-error users-error-banner",role:"alert",children:[a.jsx("span",{children:t(`errors.${l}`,{defaultValue:t("errors.request_failed")})}),a.jsx("button",{type:"button",className:"users-button",onClick:()=>w(C=>C+1),children:t("retry")})]}):null,a.jsxs("div",{className:"users-table-wrap","aria-busy":s,children:[a.jsxs("table",{className:"users-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:t("user")}),a.jsx("th",{scope:"col",children:t("role")}),a.jsx("th",{scope:"col",children:t("status")}),a.jsx("th",{scope:"col",children:t("lastLogin")}),a.jsx("th",{scope:"col",children:a.jsx("span",{className:"sr-only",children:t("actions")})})]})}),a.jsx("tbody",{children:i==null?void 0:i.items.map(C=>{var N;return a.jsxs("tr",{children:[a.jsx("td",{"data-label":t("user"),children:a.jsxs("div",{className:"users-person",children:[a.jsx("span",{className:"users-avatar","aria-hidden":"true",children:(N=Array.from(C.name)[0])==null?void 0:N.toUpperCase()}),a.jsxs("div",{className:"users-account",children:[a.jsxs("strong",{children:[C.name,C.currentUser?a.jsx("span",{className:"users-self",children:t("you")}):null]}),a.jsx("span",{title:C.email||C.id,children:C.email||C.id})]})]})}),a.jsxs("td",{"data-label":t("role"),children:[a.jsx("span",{className:`users-role-badge${C.role==="super_admin"?" is-super":""}`,children:t(`roles.${C.role}`)}),C.roleConflict?a.jsx("span",{className:"users-inline-warning",children:t("roleConflict")}):null]}),a.jsx("td",{"data-label":t("status"),children:a.jsx("span",{className:"users-status",children:t(`states.${C.status}`,{defaultValue:t("unknown")})})}),a.jsx("td",{"data-label":t("lastLogin"),className:"users-last-login",children:T(C.lastLogin)}),a.jsx("td",{className:"users-actions",children:C.protected?a.jsx("span",{className:"users-protected",title:t("protectedExplanation"),children:t("initialAdministrator")}):a.jsx("button",{type:"button",className:"users-button is-text",disabled:s||!!l||C.currentUser,onClick:()=>{O(null),k(C)},children:t("changeRole")})})]},C.id)})})]}),!s&&!l&&(i==null?void 0:i.items.length)===0?a.jsxs("div",{className:"users-empty",children:[a.jsx("strong",{children:t("noUsers")}),a.jsx("span",{children:t(f||m?"tryAnotherSearch":"poolEmpty")})]}):null,s&&!i?a.jsx("div",{className:"users-empty",children:a.jsx(on,{children:t("loading")})}):null]}),i?a.jsxs("footer",{className:"users-pagination",children:[a.jsx("span",{children:t("resultCount",{count:i.total})}),a.jsxs("div",{children:[a.jsx("button",{type:"button",className:"users-button",disabled:b<=1||s,onClick:()=>v(C=>C-1),children:t("previous")}),a.jsxs("span",{children:[b," / ",R]}),a.jsx("button",{type:"button",className:"users-button",disabled:b>=R||s,onClick:()=>v(C=>C+1),children:t("next")})]})]}):null]}),x?a.jsx(Hst,{user:x,onClose:()=>k(null),onSaved:C=>{k(null),O(C),w(N=>N+1)}}):null]})}const Rje=p.createContext(null);function Wst(e){if(!e||/[?#]/.test(e))return null;try{const t=decodeURIComponent(e);return!/^\/data\/(output|workspace)\/.+/.test(t)||t.endsWith("/")||/[\\\u0000-\u001f\u007f]/.test(t)||t.split("/").some(n=>n==="."||n==="..")?null:t}catch{return null}}function Kst({appName:e,sessionId:t,path:n,children:i}){const{t:r}=_e("conversation"),s=p.useRef(null),[o,l]=p.useState(!1),[c,u]=p.useState(!1);p.useEffect(()=>(l(!1),u(!1),()=>{var f;(f=s.current)==null||f.abort(),s.current=null}),[e,t,n]);async function d(){if(s.current)return;const f=new AbortController;s.current=f,l(!0),u(!1);try{const h=await pTe(e,t,n,f.signal);if(f.signal.aborted)return;const m=URL.createObjectURL(h),g=document.createElement("a");try{g.href=m,g.download=n.slice(n.lastIndexOf("/")+1),document.body.appendChild(g),g.click()}finally{g.remove(),window.setTimeout(()=>URL.revokeObjectURL(m),0)}}catch{f.signal.aborted||u(!0)}finally{s.current===f&&(s.current=null,l(!1))}}return a.jsxs(a.Fragment,{children:[a.jsxs("a",{className:"sandbox-file-download",href:encodeURI(n),"aria-disabled":o,"aria-busy":o,onClick:f=>{f.preventDefault(),d()},children:[a.jsx("span",{"aria-hidden":"true",children:"↓"}),a.jsxs("span",{children:[r(o?"markdown.downloading":"markdown.downloadFile")," · ",i]})]}),c&&a.jsxs("span",{role:"alert",children:[" ",r("markdown.downloadFailed")]})]})}const Gst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M5.293 12.707a1 1 0 0 1 0-1.414l5-5a1 1 0 1 1 1.414 1.414L8.414 11H18a1 1 0 1 1 0 2H8.414l3.293 3.293a1 1 0 0 1-1.414 1.414l-5-5Z",clipRule:"evenodd"})}),Xst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M18.707 12.707a1 1 0 0 0 0-1.414l-5-5a1 1 0 1 0-1.414 1.414L15.586 11H6a1 1 0 1 0 0 2h9.586l-3.293 3.293a1 1 0 0 0 1.414 1.414l5-5Z",clipRule:"evenodd"})}),Yst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M4.47192 2.5C5.02421 2.5 5.47192 2.94772 5.47192 3.5V5.07196C7.17065 3.47759 9.45675 2.5 11.9719 2.5C17.2186 2.5 21.4719 6.75329 21.4719 12C21.4719 17.2467 17.2186 21.5 11.9719 21.5C7.10262 21.5 3.0902 17.8375 2.53692 13.1164C2.47264 12.5679 2.8652 12.0711 3.41373 12.0068C3.96226 11.9425 4.45904 12.3351 4.52333 12.8836C4.95991 16.6089 8.12901 19.5 11.9719 19.5C16.1141 19.5 19.4719 16.1421 19.4719 12C19.4719 7.85786 16.1141 4.5 11.9719 4.5C9.75153 4.5 7.75552 5.46469 6.38146 7H9.00003C9.55232 7 10 7.44772 10 8C10 8.55228 9.55232 9 9.00003 9H4.47192C3.93256 9 3.49293 8.57299 3.47265 8.03859C3.47175 8.01771 3.47151 7.99677 3.47192 7.9758V3.5C3.47192 2.94772 3.91964 2.5 4.47192 2.5Z",fill:"currentColor"})}),YD=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M2.55823 12C2.55823 6.75329 6.81152 2.5 12.0582 2.5C14.5734 2.5 16.8595 3.47759 18.5582 5.07197V3.5C18.5582 2.94772 19.0059 2.5 19.5582 2.5C20.1105 2.5 20.5582 2.94772 20.5582 3.5V7.97591C20.5586 7.99622 20.5584 8.01651 20.5576 8.03674C20.5382 8.572 20.0982 9 19.5582 9H15.0582C14.5059 9 14.0582 8.55228 14.0582 8C14.0582 7.44772 14.5059 7 15.0582 7H17.6487C16.2746 5.46469 14.2786 4.5 12.0582 4.5C7.91609 4.5 4.55823 7.85786 4.55823 12C4.55823 16.1421 7.91609 19.5 12.0582 19.5C15.9011 19.5 19.0702 16.6089 19.5068 12.8836C19.5711 12.3351 20.0679 11.9425 20.6164 12.0068C21.165 12.0711 21.5575 12.5679 21.4932 13.1164C20.94 17.8375 16.9275 21.5 12.0582 21.5C6.81152 21.5 2.55823 17.2467 2.55823 12Z",fill:"currentColor"})}),s_=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M16.243 6.757a1 1 0 0 1 1 1v7.072a1 1 0 0 1-2 0v-4.657L8.464 16.95a1 1 0 0 1-1.414-1.414l6.778-6.779H9.172a1 1 0 0 1 0-2h7.07Z",clipRule:"evenodd"})}),Zst=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M10.663 6.3872C10.8152 6.29068 11 6.40984 11 6.59007V8C11 8.55229 11.4477 9 12 9C12.5523 9 13 8.55229 13 8V6.59007C13 6.40984 13.1848 6.29068 13.337 6.3872C14.036 6.83047 14.5 7.61105 14.5 8.5C14.5 9.53284 13.8737 10.4194 12.9801 10.8006C12.9932 10.865 13 10.9317 13 11V13C13 13.5523 12.5523 14 12 14C11.4477 14 11 13.5523 11 13V11C11 10.9317 11.0068 10.865 11.0199 10.8006C10.1263 10.4194 9.5 9.53284 9.5 8.5C9.5 7.61105 9.96397 6.83047 10.663 6.3872Z",fill:"currentColor"}),a.jsx("path",{d:"M17.9754 4.01031C17.8588 4.00078 17.6965 4.00001 17.4 4.00001H9.8C8.94342 4.00001 8.36113 4.00078 7.91104 4.03756C7.47262 4.07338 7.24842 4.1383 7.09202 4.21799C6.7157 4.40974 6.40973 4.7157 6.21799 5.09202C6.1383 5.24842 6.07337 5.47263 6.03755 5.91104C6.00078 6.36113 6 6.94343 6 7.80001V16.1707C6.31278 16.0602 6.64937 16 7 16H18L18 4.60001C18 4.30348 17.9992 4.14122 17.9897 4.02464C17.9893 4.02 17.9889 4.0156 17.9886 4.01145C17.9844 4.01107 17.98 4.01069 17.9754 4.01031ZM17.657 18H7C6.44772 18 6 18.4477 6 19C6 19.5523 6.44772 20 7 20H17.657C17.5343 19.3301 17.5343 18.6699 17.657 18ZM4 19L4 7.75871C3.99999 6.95374 3.99998 6.28937 4.04419 5.74818C4.09012 5.18608 4.18868 4.66938 4.43597 4.18404C4.81947 3.43139 5.43139 2.81947 6.18404 2.43598C6.66937 2.18869 7.18608 2.09012 7.74818 2.0442C8.28937 1.99998 8.95373 1.99999 9.7587 2L17.4319 2C17.6843 1.99997 17.9301 1.99994 18.1382 2.01695C18.3668 2.03563 18.6366 2.07969 18.908 2.21799C19.2843 2.40974 19.5903 2.7157 19.782 3.09203C19.9203 3.36345 19.9644 3.63318 19.9831 3.86178C20.0001 4.06994 20 4.31574 20 4.56812L20 17C20 17.1325 19.9736 17.2638 19.9225 17.386C19.4458 18.5253 19.4458 19.4747 19.9225 20.614C20.0517 20.9227 20.0179 21.2755 19.8325 21.5541C19.6471 21.8326 19.3346 22 19 22H7C5.34315 22 4 20.6569 4 19Z",fill:"currentColor"})]}),mC=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M18.063 5.674a1 1 0 0 1 .263 1.39l-7.5 11a1 1 0 0 1-1.533.143l-4.5-4.5a1 1 0 1 1 1.414-1.414l3.647 3.647 6.82-10.003a1 1 0 0 1 1.39-.263Z",clipRule:"evenodd"})}),Ije=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM16.0755 7.93219C16.5272 8.25003 16.6356 8.87383 16.3178 9.32549L11.5678 16.0755C11.3931 16.3237 11.1152 16.4792 10.8123 16.4981C10.5093 16.517 10.2142 16.3973 10.0101 16.1727L7.51006 13.4227C7.13855 13.014 7.16867 12.3816 7.57733 12.0101C7.98598 11.6386 8.61843 11.6687 8.98994 12.0773L10.6504 13.9039L14.6822 8.17451C15 7.72284 15.6238 7.61436 16.0755 7.93219Z",fill:"currentColor"})}),Jst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 9",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.292893 0.292893C0.683418 -0.0976311 1.31658 -0.0976311 1.70711 0.292893L8 6.58579L14.2929 0.292894C14.6834 -0.0976305 15.3166 -0.0976304 15.7071 0.292894C16.0976 0.683418 16.0976 1.31658 15.7071 1.70711L8.70711 8.70711C8.31658 9.09763 7.68342 9.09763 7.29289 8.70711L0.292893 1.70711C-0.0976311 1.31658 -0.0976311 0.683417 0.292893 0.292893Z"})}),eat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M15.707 4.293a1 1 0 0 1 0 1.414L9.414 12l6.293 6.293a1 1 0 0 1-1.414 1.414l-7-7a1 1 0 0 1 0-1.414l7-7a1 1 0 0 1 1.414 0Z",clipRule:"evenodd"})}),tat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M8.293 4.293a1 1 0 0 1 1.414 0l7 7a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414-1.414L14.586 12 8.293 5.707a1 1 0 0 1 0-1.414Z",clipRule:"evenodd"})}),pV=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM12 6C12.5523 6 13 6.44772 13 7V12C13 12.2652 12.8946 12.5196 12.7071 12.7071L10.2071 15.2071C9.81658 15.5976 9.18342 15.5976 8.79289 15.2071C8.40237 14.8166 8.40237 14.1834 8.79289 13.7929L11 11.5858V7C11 6.44772 11.4477 6 12 6Z",fill:"currentColor"})}),nat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12.659 9.753a1 1 0 0 1-1.318 0l-4-3.5A1 1 0 1 1 8.66 4.747L12 7.671l3.341-2.924a1 1 0 1 1 1.318 1.506l-4 3.5Zm-4.002 9.501a1 1 0 1 1-1.314-1.508l4-3.485a1 1 0 0 1 1.314 0l4 3.485a1 1 0 1 1-1.314 1.508L12 16.34l-3.343 2.913Z"})}),Pje=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12.7587 2H16.2413C17.0463 1.99999 17.7106 1.99998 18.2518 2.04419C18.8139 2.09012 19.3306 2.18868 19.816 2.43597C20.5686 2.81947 21.1805 3.43139 21.564 4.18404C21.8113 4.66937 21.9099 5.18608 21.9558 5.74817C22 6.28936 22 6.95372 22 7.75868V11.2413C22 12.0463 22 12.7106 21.9558 13.2518C21.9099 13.8139 21.8113 14.3306 21.564 14.816C21.1805 15.5686 20.5686 16.1805 19.816 16.564C19.3306 16.8113 18.8139 16.9099 18.2518 16.9558C17.8906 16.9853 17.4745 16.9951 16.9984 16.9984C16.9951 17.4745 16.9853 17.8906 16.9558 18.2518C16.9099 18.8139 16.8113 19.3306 16.564 19.816C16.1805 20.5686 15.5686 21.1805 14.816 21.564C14.3306 21.8113 13.8139 21.9099 13.2518 21.9558C12.7106 22 12.0463 22 11.2413 22H7.75868C6.95372 22 6.28936 22 5.74818 21.9558C5.18608 21.9099 4.66937 21.8113 4.18404 21.564C3.43139 21.1805 2.81947 20.5686 2.43597 19.816C2.18868 19.3306 2.09012 18.8139 2.04419 18.2518C1.99998 17.7106 1.99999 17.0463 2 16.2413V12.7587C1.99999 11.9537 1.99998 11.2894 2.04419 10.7482C2.09012 10.1861 2.18868 9.66937 2.43597 9.18404C2.81947 8.43139 3.43139 7.81947 4.18404 7.43598C4.66937 7.18868 5.18608 7.09012 5.74817 7.04419C6.10939 7.01468 6.52548 7.00487 7.00162 7.00162C7.00487 6.52548 7.01468 6.10939 7.04419 5.74817C7.09012 5.18608 7.18868 4.66937 7.43598 4.18404C7.81947 3.43139 8.43139 2.81947 9.18404 2.43597C9.66937 2.18868 10.1861 2.09012 10.7482 2.04419C11.2894 1.99998 11.9537 1.99999 12.7587 2ZM9.00176 7L11.2413 7C12.0463 6.99999 12.7106 6.99998 13.2518 7.04419C13.8139 7.09012 14.3306 7.18868 14.816 7.43598C15.5686 7.81947 16.1805 8.43139 16.564 9.18404C16.8113 9.66937 16.9099 10.1861 16.9558 10.7482C17 11.2894 17 11.9537 17 12.7587V14.9982C17.4455 14.9951 17.7954 14.9864 18.089 14.9624C18.5274 14.9266 18.7516 14.8617 18.908 14.782C19.2843 14.5903 19.5903 14.2843 19.782 13.908C19.8617 13.7516 19.9266 13.5274 19.9624 13.089C19.9992 12.6389 20 12.0566 20 11.2V7.8C20 6.94342 19.9992 6.36113 19.9624 5.91104C19.9266 5.47262 19.8617 5.24842 19.782 5.09202C19.5903 4.7157 19.2843 4.40973 18.908 4.21799C18.7516 4.1383 18.5274 4.07337 18.089 4.03755C17.6389 4.00078 17.0566 4 16.2 4H12.8C11.9434 4 11.3611 4.00078 10.911 4.03755C10.4726 4.07337 10.2484 4.1383 10.092 4.21799C9.7157 4.40973 9.40973 4.7157 9.21799 5.09202C9.1383 5.24842 9.07337 5.47262 9.03755 5.91104C9.01357 6.20463 9.00489 6.55447 9.00176 7ZM5.91104 9.03755C5.47262 9.07337 5.24842 9.1383 5.09202 9.21799C4.7157 9.40973 4.40973 9.7157 4.21799 10.092C4.1383 10.2484 4.07337 10.4726 4.03755 10.911C4.00078 11.3611 4 11.9434 4 12.8V16.2C4 17.0566 4.00078 17.6389 4.03755 18.089C4.07337 18.5274 4.1383 18.7516 4.21799 18.908C4.40973 19.2843 4.7157 19.5903 5.09202 19.782C5.24842 19.8617 5.47262 19.9266 5.91104 19.9624C6.36113 19.9992 6.94342 20 7.8 20H11.2C12.0566 20 12.6389 19.9992 13.089 19.9624C13.5274 19.9266 13.7516 19.8617 13.908 19.782C14.2843 19.5903 14.5903 19.2843 14.782 18.908C14.8617 18.7516 14.9266 18.5274 14.9624 18.089C14.9992 17.6389 15 17.0566 15 16.2V12.8C15 11.9434 14.9992 11.3611 14.9624 10.911C14.9266 10.4726 14.8617 10.2484 14.782 10.092C14.5903 9.7157 14.2843 9.40973 13.908 9.21799C13.7516 9.1383 13.5274 9.07337 13.089 9.03755C12.6389 9.00078 12.0566 9 11.2 9H7.8C6.94342 9 6.36113 9.00078 5.91104 9.03755Z",fill:"currentColor"})}),iat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M10.556 4a1 1 0 0 0-.97.751l-.292 1.14h5.421l-.293-1.14A1 1 0 0 0 13.453 4h-2.897Zm6.224 1.892-.421-1.639A3 3 0 0 0 13.453 2h-2.897A3 3 0 0 0 7.65 4.253l-.421 1.639H4a1 1 0 1 0 0 2h.1l1.215 11.425A3 3 0 0 0 8.3 22h7.4a3 3 0 0 0 2.984-2.683l1.214-11.425H20a1 1 0 1 0 0-2h-3.22Zm1.108 2H6.112l1.192 11.214A1 1 0 0 0 8.3 20h7.4a1 1 0 0 0 .995-.894l1.192-11.214ZM10 10a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0v-5a1 1 0 0 1 1-1Zm4 0a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0v-5a1 1 0 0 1 1-1Z",clipRule:"evenodd"})}),rat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M3 12a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm7 0a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm7 0a2 2 0 1 1 4 0 2 2 0 0 1-4 0Z"})}),sat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 10 16",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.34151 0.747423C4.71854 0.417526 5.28149 0.417526 5.65852 0.747423L9.65852 4.24742C10.0742 4.61111 10.1163 5.24287 9.75259 5.6585C9.38891 6.07414 8.75715 6.11626 8.34151 5.75258L5.00001 2.82877L1.65852 5.75258C1.24288 6.11626 0.61112 6.07414 0.247438 5.6585C-0.116244 5.24287 -0.0741267 4.61111 0.34151 4.24742L4.34151 0.747423ZM0.246065 10.3578C0.608879 9.94139 1.24055 9.89795 1.65695 10.2608L5.00001 13.1737L8.34308 10.2608C8.75948 9.89795 9.39115 9.94139 9.75396 10.3578C10.1168 10.7742 10.0733 11.4058 9.65695 11.7687L5.65695 15.2539C5.28043 15.582 4.7196 15.582 4.34308 15.2539L0.343082 11.7687C-0.0733128 11.4058 -0.116749 10.7742 0.246065 10.3578Z"})}),aat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M16.793 2.793a3.121 3.121 0 1 1 4.414 4.414l-8.5 8.5A1 1 0 0 1 12 16H9a1 1 0 0 1-1-1v-3a1 1 0 0 1 .293-.707l8.5-8.5Zm3 1.414a1.121 1.121 0 0 0-1.586 0L10 12.414V14h1.586l8.207-8.207a1.121 1.121 0 0 0 0-1.586ZM6 5a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-4a1 1 0 1 1 2 0v4a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h4a1 1 0 1 1 0 2H6Z",clipRule:"evenodd"})}),oat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M12 7a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0V8h-3a1 1 0 0 1-1-1Zm-5 5a1 1 0 0 1 1 1v3h3a1 1 0 1 1 0 2H7a1 1 0 0 1-1-1v-4a1 1 0 0 1 1-1Z",clipRule:"evenodd"})}),lat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8-10C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm4.465 6.763a1 1 0 0 0-1.228-1.228l-5.5 1.5a1 1 0 0 0-.702.702l-1.5 5.5a1 1 0 0 0 1.228 1.228l5.5-1.5a1 1 0 0 0 .702-.702l1.5-5.5Zm-6.54 5.312.89-3.26 3.26-.89-.89 3.26-3.26.89Z",clipRule:"evenodd"})}),cat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M14.4472 7.10558C14.9412 7.35257 15.1414 7.95324 14.8944 8.44722L10.8944 16.4472C10.6474 16.9412 10.0468 17.1414 9.55279 16.8944C9.05881 16.6474 8.85858 16.0468 9.10557 15.5528L13.1056 7.55279C13.3526 7.05881 13.9532 6.85859 14.4472 7.10558ZM6.6 7.20001C7.04183 7.53138 7.13137 8.15818 6.8 8.60001L4.25 12L6.8 15.4C7.13137 15.8418 7.04183 16.4686 6.6 16.8C6.15817 17.1314 5.53137 17.0418 5.2 16.6L2.2 12.6C1.93333 12.2444 1.93333 11.7556 2.2 11.4L5.2 7.40001C5.53137 6.95818 6.15817 6.86863 6.6 7.20001ZM17.4 7.20001C17.8418 6.86863 18.4686 6.95818 18.8 7.40001L21.8 11.4C22.0667 11.7556 22.0667 12.2444 21.8 12.6L18.8 16.6C18.4686 17.0418 17.8418 17.1314 17.4 16.8C16.9582 16.4686 16.8686 15.8418 17.2 15.4L19.75 12L17.2 8.60001C16.8686 8.15818 16.9582 7.53138 17.4 7.20001Z",fill:"currentColor"})}),Dje=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M13 12a1 1 0 1 0-2 0v4a1 1 0 1 0 2 0v-4Zm-1-2.5A1.25 1.25 0 1 0 12 7a1.25 1.25 0 0 0 0 2.5Z"}),a.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z",clipRule:"evenodd"})]}),uat=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M7.79289 9.04289C8.18342 8.65237 8.81658 8.65237 9.20711 9.04289L11.4571 11.2929C11.8476 11.6834 11.8476 12.3166 11.4571 12.7071L9.20711 14.9571C8.81658 15.3476 8.18342 15.3476 7.79289 14.9571C7.40237 14.5666 7.40237 13.9334 7.79289 13.5429L9.33579 12L7.79289 10.4571C7.40237 10.0666 7.40237 9.43342 7.79289 9.04289ZM12.25 14.25C12.25 13.6977 12.6977 13.25 13.25 13.25H15.5C16.0523 13.25 16.5 13.6977 16.5 14.25C16.5 14.8023 16.0523 15.25 15.5 15.25H13.25C12.6977 15.25 12.25 14.8023 12.25 14.25Z",fill:"currentColor"}),a.jsx("path",{d:"M2 8C2 5.79086 3.79086 4 6 4C6.55228 4 7 4.44772 7 5C7 5.55228 6.55228 6 6 6C4.89543 6 4 6.89543 4 8V16C4 17.1046 4.89543 18 6 18C6.55228 18 7 18.4477 7 19C7 19.5523 6.55228 20 6 20C3.79086 20 2 18.2091 2 16V8ZM17 5C17 4.44772 17.4477 4 18 4C20.2091 4 22 5.79086 22 8V16C22 18.2091 20.2091 20 18 20C17.4477 20 17 19.5523 17 19C17 18.4477 17.4477 18 18 18C19.1046 18 20 17.1046 20 16V8C20 6.89543 19.1046 6 18 6C17.4477 6 17 5.55228 17 5Z",fill:"currentColor"})]}),dat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M6 12C6 11.4477 6.44772 11 7 11H17C17.5523 11 18 11.4477 18 12C18 12.5523 17.5523 13 17 13H7C6.44772 13 6 12.5523 6 12Z",fill:"currentColor"})}),fat=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M12.75 9.50001C12.75 9.08579 13.0858 8.75001 13.5 8.75001H14.5C14.9142 8.75001 15.25 9.08579 15.25 9.50001V14.5C15.25 14.9142 14.9142 15.25 14.5 15.25H13.5C13.0858 15.25 12.75 14.9142 12.75 14.5V9.50001Z",fill:"currentColor"}),a.jsx("path",{d:"M9.50001 8.75001C9.08579 8.75001 8.75001 9.08579 8.75001 9.50001V14.5C8.75001 14.9142 9.08579 15.25 9.50001 15.25H10.5C10.9142 15.25 11.25 14.9142 11.25 14.5V9.50001C11.25 9.08579 10.9142 8.75001 10.5 8.75001H9.50001Z",fill:"currentColor"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.97144 12C1.97144 6.46138 6.46138 1.97144 12 1.97144C17.5386 1.97144 22.0286 6.46138 22.0286 12C22.0286 17.5386 17.5386 22.0286 12 22.0286C6.46138 22.0286 1.97144 17.5386 1.97144 12ZM12 4.02858C7.59751 4.02858 4.02858 7.59751 4.02858 12C4.02858 16.4025 7.59751 19.9714 12 19.9714C16.4025 19.9714 19.9714 16.4025 19.9714 12C19.9714 7.59751 16.4025 4.02858 12 4.02858Z",fill:"currentColor"})]}),YJ=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M9.5 9.33165V14.6683C9.5 15.4595 10.3752 15.9373 11.0408 15.5095L15.1915 12.8412C15.8038 12.4475 15.8038 11.5524 15.1915 11.1588L11.0408 8.49047C10.3752 8.06265 9.5 8.54049 9.5 9.33165Z",fill:"currentColor"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12Z",fill:"currentColor"})]}),hat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M8 16.7229V7.27711C8 6.29075 9.08894 5.69298 9.9211 6.22254L17.3428 10.9454C18.1147 11.4366 18.1147 12.5634 17.3428 13.0546L9.92109 17.7775C9.08894 18.3071 8 17.7093 8 16.7229Z",fill:"currentColor"})}),Mje=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M12 5a1 1 0 0 1 1 1v5h5a1 1 0 1 1 0 2h-5v5a1 1 0 1 1-2 0v-5H6a1 1 0 1 1 0-2h5V6a1 1 0 0 1 1-1Z",clipRule:"evenodd"})}),Lje=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12 3C12.5523 3 13 3.44772 13 4L13 11H20C20.5523 11 21 11.4477 21 12C21 12.5523 20.5523 13 20 13L13 13L13 20C13 20.5523 12.5523 21 12 21C11.4477 21 11 20.5523 11 20L11 13L4 13C3.44772 13 3 12.5523 3 12C3 11.4477 3.44772 11 4 11L11 11L11 4C11 3.44772 11.4477 3 12 3Z",fill:"currentColor"})}),pat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12 6C12.5523 6 13 6.44772 13 7V11H17C17.5523 11 18 11.4477 18 12C18 12.5523 17.5523 13 17 13H13V17C13 17.5523 12.5523 18 12 18C11.4477 18 11 17.5523 11 17V13H7C6.44772 13 6 12.5523 6 12C6 11.4477 6.44772 11 7 11H11V7C11 6.44772 11.4477 6 12 6Z",fill:"currentColor"})}),mat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.875 4.5C7.35418 4.5 4.5 7.35418 4.5 10.875C4.5 14.3958 7.35418 17.25 10.875 17.25C14.3958 17.25 17.25 14.3958 17.25 10.875C17.25 7.35418 14.3958 4.5 10.875 4.5ZM2.5 10.875C2.5 6.24962 6.24962 2.5 10.875 2.5C15.5004 2.5 19.25 6.24962 19.25 10.875C19.25 12.8273 18.582 14.6236 17.462 16.0478L21.2071 19.7929C21.5976 20.1834 21.5976 20.8166 21.2071 21.2071C20.8166 21.5976 20.1834 21.5976 19.7929 21.2071L16.0478 17.462C14.6236 18.582 12.8273 19.25 10.875 19.25C6.24962 19.25 2.5 15.5004 2.5 10.875Z",fill:"currentColor"})}),gat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M11.2929 3.29289C11.6834 2.90237 12.3166 2.90237 12.7071 3.29289L16.7071 7.29289C17.0976 7.68342 17.0976 8.31658 16.7071 8.70711C16.3166 9.09763 15.6834 9.09763 15.2929 8.70711L13 6.41421V15C13 15.5523 12.5523 16 12 16C11.4477 16 11 15.5523 11 15V6.41421L8.70711 8.70711C8.31658 9.09763 7.68342 9.09763 7.29289 8.70711C6.90237 8.31658 6.90237 7.68342 7.29289 7.29289L11.2929 3.29289ZM4 14C4.55229 14 5 14.4477 5 15V15.2C5 16.0566 5.00078 16.6389 5.03755 17.089C5.07337 17.5274 5.1383 17.7516 5.21799 17.908C5.40973 18.2843 5.7157 18.5903 6.09202 18.782C6.24842 18.8617 6.47262 18.9266 6.91104 18.9624C7.36113 18.9992 7.94342 19 8.8 19H15.2C16.0566 19 16.6389 18.9992 17.089 18.9624C17.5274 18.9266 17.7516 18.8617 17.908 18.782C18.2843 18.5903 18.5903 18.2843 18.782 17.908C18.8617 17.7516 18.9266 17.5274 18.9624 17.089C18.9992 16.6389 19 16.0566 19 15.2V15C19 14.4477 19.4477 14 20 14C20.5523 14 21 14.4477 21 15V15.2413C21 16.0463 21 16.7106 20.9558 17.2518C20.9099 17.8139 20.8113 18.3306 20.564 18.816C20.1805 19.5686 19.5686 20.1805 18.816 20.564C18.3306 20.8113 17.8139 20.9099 17.2518 20.9558C16.7106 21 16.0463 21 15.2413 21H8.75868C7.95372 21 7.28936 21 6.74817 20.9558C6.18608 20.9099 5.66937 20.8113 5.18404 20.564C4.43139 20.1805 3.81947 19.5686 3.43597 18.816C3.18868 18.3306 3.09012 17.8139 3.04419 17.2518C2.99998 16.7106 2.99999 16.0463 3 15.2413L3 15C3 14.4477 3.44772 14 4 14Z",fill:"currentColor"})}),bat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M6 8C6 6.89543 6.89543 6 8 6H16C17.1046 6 18 6.89543 18 8V16C18 17.1046 17.1046 18 16 18H8C6.89543 18 6 17.1046 6 16V8Z",fill:"currentColor"})}),yat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M14.5 4a5.5 5.5 0 0 0-5.078 7.616 1 1 0 0 1-.216 1.092l-4.749 4.75a1.475 1.475 0 0 0 2.086 2.085l4.749-4.749a1 1 0 0 1 1.092-.216A5.5 5.5 0 0 0 20 9.414l-1.293 1.293a3.828 3.828 0 1 1-5.414-5.414L14.585 4H14.5ZM7 9.5a7.5 7.5 0 0 1 9.969-7.084 1 1 0 0 1 .378 1.651l-2.64 2.64a1.829 1.829 0 0 0 2.586 2.586l2.64-2.64a1 1 0 0 1 1.651.378 7.5 7.5 0 0 1-9.328 9.627l-4.299 4.3a3.475 3.475 0 0 1-4.914-4.915l4.299-4.299A7.497 7.497 0 0 1 7 9.5Z"})}),mN=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M8.99805 16.796C8.99805 15.4164 7.87961 14.2979 6.5 14.2979C5.12039 14.2979 4.00195 15.4164 4.00195 16.796C4.00196 18.1756 5.1204 19.294 6.5 19.294C7.8796 19.294 8.99804 18.1756 8.99805 16.796ZM19.748 15.0479C19.748 14.7729 19.525 14.5499 19.25 14.5499H15.75C15.475 14.5499 15.252 14.7729 15.252 15.0479V18.5479C15.252 18.823 15.475 19.046 15.75 19.046H19.25C19.525 19.046 19.748 18.823 19.748 18.5479V15.0479ZM10.0469 3.45125C11.077 2.15921 13.0849 2.20276 14.0498 3.58113L16.4189 6.96492L16.5205 7.12215C17.5046 8.76341 16.3301 10.9023 14.3691 10.9024H9.63086C7.60676 10.9023 6.42029 8.62316 7.58105 6.96492L9.9502 3.58113L10.0469 3.45125ZM12.4082 4.73055C12.2223 4.46497 11.842 4.44826 11.6318 4.68074L11.5918 4.73055L9.22266 8.11433C8.99176 8.44435 9.22808 8.89744 9.63086 8.89754H14.3691C14.7468 8.89745 14.9774 8.49957 14.8145 8.17781L14.7773 8.11433L12.4082 4.73055ZM11.002 16.796C11.0019 19.2824 8.98638 21.2979 6.5 21.2979C4.01362 21.2979 1.99806 19.2824 1.99805 16.796C1.99805 14.3096 4.01361 12.294 6.5 12.294C8.98639 12.294 11.002 14.3096 11.002 16.796ZM21.752 18.5479C21.752 19.9297 20.6318 21.0499 19.25 21.0499H15.75C14.3682 21.0499 13.248 19.9297 13.248 18.5479V15.0479C13.2481 13.6662 14.3682 12.546 15.75 12.546H19.25C20.6318 12.546 21.7519 13.6662 21.752 15.0479V18.5479Z",fill:"currentColor"})}),vat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5555 4C10.099 4 9.70052 4.30906 9.58693 4.75114L9.29382 5.8919H14.715L14.4219 4.75114C14.3083 4.30906 13.9098 4 13.4533 4H10.5555ZM16.7799 5.8919L16.3589 4.25342C16.0182 2.92719 14.8226 2 13.4533 2H10.5555C9.18616 2 7.99062 2.92719 7.64985 4.25342L7.22886 5.8919H4C3.44772 5.8919 3 6.33961 3 6.8919C3 7.44418 3.44772 7.8919 4 7.8919H4.10069L5.31544 19.3172C5.47763 20.8427 6.76455 22 8.29863 22H15.7014C17.2354 22 18.5224 20.8427 18.6846 19.3172L19.8993 7.8919H20C20.5523 7.8919 21 7.44418 21 6.8919C21 6.33961 20.5523 5.8919 20 5.8919H16.7799ZM17.888 7.8919H6.11196L7.30423 19.1057C7.3583 19.6142 7.78727 20 8.29863 20H15.7014C16.2127 20 16.6417 19.6142 16.6958 19.1057L17.888 7.8919ZM10 10C10.5523 10 11 10.4477 11 11V16C11 16.5523 10.5523 17 10 17C9.44772 17 9 16.5523 9 16V11C9 10.4477 9.44772 10 10 10ZM14 10C14.5523 10 15 10.4477 15 11V16C15 16.5523 14.5523 17 14 17C13.4477 17 13 16.5523 13 16V11C13 10.4477 13.4477 10 14 10Z"})}),xat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M7.5 5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5ZM3 7.5a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM17 6a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm-4 2a4 4 0 1 1 8 0 4 4 0 0 1-8 0Zm-8.96 8.247C3.137 17.048 2.5 18.271 2.5 20a1 1 0 1 1-2 0c0-2.271.862-4.049 2.21-5.248C4.042 13.57 5.788 13 7.5 13s3.459.57 4.79 1.752c1.348 1.2 2.21 2.977 2.21 5.248a1 1 0 1 1-2 0c0-1.729-.638-2.952-1.54-3.753C10.042 15.43 8.788 15 7.5 15s-2.541.43-3.46 1.247Zm15.757-.607c-1.009-.638-2.338-.807-3.526-.472a1 1 0 0 1-.542-1.925c1.695-.478 3.616-.255 5.136.706 1.558.984 2.635 2.707 2.635 5.051a1 1 0 1 1-2 0c0-1.665-.732-2.746-1.703-3.36Z",clipRule:"evenodd"})}),$je=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M10.42 2.006a4 4 0 0 1 3.159 0c.674.29 1.188.822 1.667 1.456.474.627 1 1.473 1.653 2.523l3.542 5.696c.72 1.16 1.3 2.09 1.682 2.854.384.766.654 1.517.59 2.292a4 4 0 0 1-1.604 2.886c-.625.463-1.405.63-2.258.709-.85.078-1.945.078-3.311.078H8.46c-1.366 0-2.46 0-3.31-.078-.854-.078-1.634-.246-2.26-.71a4 4 0 0 1-1.603-2.885c-.064-.775.206-1.526.59-2.292.383-.764.961-1.694 1.682-2.854l3.542-5.696c.653-1.05 1.18-1.896 1.653-2.523.48-.634.993-1.166 1.667-1.456Zm2.37 1.838a2 2 0 0 0-1.58 0c-.192.083-.448.28-.86.825-.413.544-.891 1.312-1.577 2.415l-3.488 5.61c-.755 1.214-1.283 2.066-1.62 2.737-.34.678-.402 1.02-.385 1.232a2 2 0 0 0 .802 1.443c.171.127.494.255 1.25.324.748.069 1.75.07 3.18.07h6.976c1.43 0 2.432-.001 3.18-.07.756-.069 1.079-.197 1.25-.324a2 2 0 0 0 .802-1.443c.017-.212-.045-.554-.385-1.232-.337-.671-.865-1.523-1.62-2.737l-3.488-5.61c-.686-1.103-1.164-1.87-1.576-2.415-.413-.546-.67-.742-.861-.825"}),a.jsx("path",{d:"M12 7.5a1 1 0 0 1 1 1v3a1 1 0 1 1-2 0v-3a1 1 0 0 1 1-1M10.851 15a1.15 1.15 0 1 1 2.3 0 1.15 1.15 0 0 1-2.3 0"})]}),mV=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M5.636 5.636a1 1 0 0 1 1.414 0l4.95 4.95 4.95-4.95a1 1 0 0 1 1.414 1.414L13.414 12l4.95 4.95a1 1 0 0 1-1.414 1.414L12 13.414l-4.95 4.95a1 1 0 0 1-1.414-1.414l4.95-4.95-4.95-4.95a1 1 0 0 1 0-1.414Z",clipRule:"evenodd"})});/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xat=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),$je=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim();/** + */const wat=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Fje=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim();/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */var wat={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 kat={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kat=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:r="",children:s,iconNode:o,...l},c)=>p.createElement("svg",{ref:c,...wat,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:$je("lucide",r),...l},[...o.map(([u,d])=>p.createElement(u,d)),...Array.isArray(s)?s:[s]]));/** + */const Oat=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:r="",children:s,iconNode:o,...l},c)=>p.createElement("svg",{ref:c,...kat,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:Fje("lucide",r),...l},[...o.map(([u,d])=>p.createElement(u,d)),...Array.isArray(s)?s:[s]]));/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Cn=(e,t)=>{const n=p.forwardRef(({className:i,...r},s)=>p.createElement(kat,{ref:s,iconNode:t,className:$je(`lucide-${xat(e)}`,i),...r}));return n.displayName=`${e}`,n};/** + */const Cn=(e,t)=>{const n=p.forwardRef(({className:i,...r},s)=>p.createElement(Oat,{ref:s,iconNode:t,className:Fje(`lucide-${wat(e)}`,i),...r}));return n.displayName=`${e}`,n};/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Fje=Cn("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** + */const Bje=Cn("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Oat=Cn("ArrowRightLeft",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]);/** + */const Sat=Cn("ArrowRightLeft",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -178,27 +178,27 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Sat=Cn("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** + */const Eat=Cn("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Bje=Cn("AtSign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]);/** + */const Uje=Cn("AtSign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Uje=Cn("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** + */const Qje=Cn("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Eat=Cn("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/** + */const Cat=Cn("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Cat=Cn("Boxes",[["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"}]]);/** + */const Aat=Cn("Boxes",[["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"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -208,12 +208,12 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Aat=Cn("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + */const Tat=Cn("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Tat=Cn("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** + */const _at=Cn("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -228,7 +228,7 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _at=Cn("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + */const jat=Cn("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -238,12 +238,12 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const jat=Cn("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** + */const Nat=Cn("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Nat=Cn("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/** + */const Rat=Cn("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -253,12 +253,12 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Rat=Cn("CornerDownRight",[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]]);/** + */const Iat=Cn("CornerDownRight",[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Iat=Cn("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** + */const Pat=Cn("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -283,17 +283,17 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Pat=Cn("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + */const Dat=Cn("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Dat=Cn("FileDown",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/** + */const Mat=Cn("FileDown",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Mat=Cn("FilePlus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/** + */const Lat=Cn("FilePlus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -303,22 +303,22 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Lat=Cn("FileType2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 13v-1h6v1",key:"1dh9dg"}],["path",{d:"M5 12v6",key:"150t9c"}],["path",{d:"M4 18h2",key:"1xrofg"}]]);/** + */const $at=Cn("FileType2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 13v-1h6v1",key:"1dh9dg"}],["path",{d:"M5 12v6",key:"150t9c"}],["path",{d:"M4 18h2",key:"1xrofg"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Qje=Cn("FileVideo2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["rect",{width:"8",height:"6",x:"2",y:"12",rx:"1",key:"1a6c1e"}],["path",{d:"m10 15.5 4 2.5v-6l-4 2.5",key:"t7cp39"}]]);/** + */const zje=Cn("FileVideo2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["rect",{width:"8",height:"6",x:"2",y:"12",rx:"1",key:"1a6c1e"}],["path",{d:"m10 15.5 4 2.5v-6l-4 2.5",key:"t7cp39"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $at=Cn("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/** + */const Fat=Cn("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Fat=Cn("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/** + */const Bat=Cn("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -328,17 +328,17 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Bat=Cn("Folder",[["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"}]]);/** + */const Uat=Cn("Folder",[["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"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Uat=Cn("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** + */const Qat=Cn("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Qat=Cn("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/** + */const zat=Cn("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -358,12 +358,12 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const zje=Cn("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** + */const Vje=Cn("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const zat=Cn("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/** + */const Vat=Cn("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -373,12 +373,12 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Vat=Cn("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/** + */const Hat=Cn("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Hat=Cn("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** + */const qat=Cn("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -388,32 +388,32 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const qat=Cn("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** + */const Wat=Cn("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Vje=Cn("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** + */const Hje=Cn("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Wat=Cn("MonitorPlay",[["path",{d:"M10 7.75a.75.75 0 0 1 1.142-.638l3.664 2.249a.75.75 0 0 1 0 1.278l-3.664 2.25a.75.75 0 0 1-1.142-.64z",key:"1pctta"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]]);/** + */const Kat=Cn("MonitorPlay",[["path",{d:"M10 7.75a.75.75 0 0 1 1.142-.638l3.664 2.249a.75.75 0 0 1 0 1.278l-3.664 2.25a.75.75 0 0 1-1.142-.64z",key:"1pctta"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Kat=Cn("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/** + */const Gat=Cn("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Gat=Cn("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** + */const Xat=Cn("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Hje=Cn("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** + */const qje=Cn("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -423,17 +423,17 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Xat=Cn("RefreshCw",[["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"}]]);/** + */const Yat=Cn("RefreshCw",[["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"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const qje=Cn("Repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]);/** + */const Wje=Cn("Repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Yat=Cn("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/** + */const Zat=Cn("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -443,7 +443,7 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Zat=Cn("Shapes",[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]);/** + */const Jat=Cn("Shapes",[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -458,7 +458,7 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Jat=Cn("Split",[["path",{d:"M16 3h5v5",key:"1806ms"}],["path",{d:"M8 3H3v5",key:"15dfkv"}],["path",{d:"M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3",key:"1qrqzj"}],["path",{d:"m15 9 6-6",key:"ko1vev"}]]);/** + */const eot=Cn("Split",[["path",{d:"M16 3h5v5",key:"1806ms"}],["path",{d:"M8 3H3v5",key:"15dfkv"}],["path",{d:"M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3",key:"1qrqzj"}],["path",{d:"m15 9 6-6",key:"ko1vev"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -468,18 +468,18 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const eot=Cn("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + */const tot=Cn("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const tot=Cn("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** + */const not=Cn("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Bo=Cn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),eee=Object.freeze({totalTokenCount:0,promptTokenCount:0,candidatesTokenCount:0,thoughtsTokenCount:0,cachedContentTokenCount:0}),oE=Object.freeze({modelName:"",current:eee,cumulative:eee}),not={totalTokenCount:"total_token_count",promptTokenCount:"prompt_token_count",candidatesTokenCount:"candidates_token_count",thoughtsTokenCount:"thoughts_token_count",cachedContentTokenCount:"cached_content_token_count"},iot=24,rot=64,sot=16;function a_(e){var l,c;const t=e.trim();if(!t)return 0;const n=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/gu,i=((l=t.match(n))==null?void 0:l.length)??0,r=t.replace(n," "),s=(r.match(/[A-Za-z0-9_]+/g)??[]).reduce((u,d)=>u+Math.max(1,Math.ceil(d.length/4)),0),o=((c=r.match(/[^\sA-Za-z0-9_]/g))==null?void 0:c.length)??0;return i+s+o}function aot(e){var l,c,u;const t=((l=e.instruction)==null?void 0:l.trim())??"",n=((c=e.tools)==null?void 0:c.filter(d=>d.trim()))??[],i=((u=e.skills)==null?void 0:u.filter(d=>d.name.trim()))??[],r=a_(t),s=n.reduce((d,f)=>d+rot+a_(f),0),o=i.reduce((d,f)=>d+sot+a_(f.name)+a_(f.description??""),0);return iot+r+s+o}function oot({usage:e,contextWindow:t,estimatedSystemTokens:n}){const i=Math.max(1,Math.round(t)),r=Math.max(0,e.current.promptTokenCount),s=Math.max(r,e.current.totalTokenCount),o=Math.min(i,r>0?Math.min(r,Math.max(0,n??0)):Math.max(0,n??0)),l=Math.max(0,r-o),c=r>0?Math.max(0,s-r):Math.max(0,s),u=r>0?s:o+c;return{systemTokens:o,inputTokens:l,outputTokens:c,remainingTokens:Math.max(0,i-u),usedTokens:u,contextWindow:i}}function lot(e){const t=[{kind:"system",tokens:e.systemTokens},{kind:"input",tokens:e.inputTokens},{kind:"output",tokens:e.outputTokens},{kind:"remaining",tokens:e.remainingTokens}],n=e.contextWindow/100;let i=0;const r=t.map(s=>{const o=i;return i+=s.tokens,{...s,start:o,end:i}});return Array.from({length:100},(s,o)=>{const l=o*n,c=l+n,u=r.flatMap(d=>{const f=Math.max(0,Math.min(c,d.end)-Math.max(l,d.start));return f>0?[{kind:d.kind,share:f/n}]:[]});return{index:o,slices:u}})}function pO(e,t){const n=e,i=n[t]??n[not[t]];return typeof i=="number"&&Number.isFinite(i)&&i>0?Math.round(i):0}function cot(e){const t=pO(e,"promptTokenCount"),n=pO(e,"candidatesTokenCount"),i=pO(e,"thoughtsTokenCount");return{totalTokenCount:pO(e,"totalTokenCount")||t+n+i,promptTokenCount:t,candidatesTokenCount:n,thoughtsTokenCount:i,cachedContentTokenCount:pO(e,"cachedContentTokenCount")}}function uot(e,t){return{totalTokenCount:e.totalTokenCount+t.totalTokenCount,promptTokenCount:e.promptTokenCount+t.promptTokenCount,candidatesTokenCount:e.candidatesTokenCount+t.candidatesTokenCount,thoughtsTokenCount:e.thoughtsTokenCount+t.thoughtsTokenCount,cachedContentTokenCount:e.cachedContentTokenCount+t.cachedContentTokenCount}}function vV(e,t){if(!t)return e;const n=typeof t.modelVersion=="string"?t.modelVersion.trim():"",i=typeof t.model_version=="string"?t.model_version.trim():"",r=n||i||e.modelName,s=t.usageMetadata??t.usage_metadata;if(!s)return r===e.modelName?e:{...e,modelName:r};const o=cot(s);return o.totalTokenCount===0?r===e.modelName?e:{...e,modelName:r}:{modelName:r,current:o,cumulative:uot(e.cumulative,o)}}function tee(e){return e.reduce((t,n)=>vV(t,n),oE)}function nee(e){return e.blocks.flatMap(t=>t.kind==="tool"?[{name:t.name,args:t.args,response:t.response,done:t.done}]:[])}function dot(e){const t=e.attributes;return String(t["invocation.id"]??t["gen_ai.invocation.id"]??t["gcp.vertex.agent.invocation_id"]??"")}function fot(e,t){if(!t)return e;const n=new Set(e.filter(r=>dot(r)===t).map(r=>r.trace_id)),i=e.filter(r=>n.has(r.trace_id));return i.length>0?i:e}function dv(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function mg(e){return typeof e=="string"?e:""}function Wje(e,t){return e==="pending"||e==="running"||e==="completed"||e==="failed"?e:t}function hot(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return{}}const n=dv(t)??{};return dv(n.result)??n}function pot(e){var n;const t=(n=dv(e))==null?void 0:n.branches;return Array.isArray(t)?t.map(i=>{var r;return mg((r=dv(i))==null?void 0:r.label)}):[]}function Kje(e,t,n){const i=pot(e),r=hot(t),s=Array.isArray(r.branches)?r.branches:[],o=n==="running"?"running":"pending";return{branches:[0,1].map(c=>{const u=dv(s[c])??{};return{label:mg(u.label)||i[c]||`方向 ${c+1}`,content:mg(u.content),status:Wje(u.status,o),error:mg(u.error)}})}}function mot(e){const t=dv(e),n=dv(t==null?void 0:t.veadkStudioToolProgress);return!n||n.toolName!=="branch_compare"||typeof n.branchIndex!="number"||n.branchIndex<0||n.branchIndex>1?null:{toolName:"branch_compare",requestId:mg(n.requestId),branchIndex:n.branchIndex,label:mg(n.label),delta:mg(n.delta),status:Wje(n.status,"running"),error:mg(n.error)||void 0}}function got(e,t,n){return{branches:Kje(e,t,"running").branches.map((s,o)=>o===n.branchIndex?{...s,label:n.label||s.label,content:s.content+n.delta,status:n.status,error:n.error??s.error}:s)}}function Yo(e,t){return bn.t(`blocks.codexProgress.${e}`,{ns:"conversation",...t})}const Gje=28e4;function iee(e){try{return JSON.stringify(e).length}catch{return Gje}}function bot(e){const t=e.slice(-200);let n=t.reduce((i,r)=>i+iee(r),0);for(;t.length>1&&n>Gje;)n-=iee(t.shift());return t}function Cu(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function ir(e){return typeof e=="string"?e:""}function xV(e,t=""){const n=ir(e).toLowerCase();return t.endsWith(".failed")||["failed","error","declined","cancelled"].includes(n)?"failed":t.endsWith(".completed")||["completed","done","success"].includes(n)?"completed":"running"}function Xje(e){if(e.response!==void 0)return e.response;if(e.result!==void 0)return e.result;const t=e.aggregatedOutput??e.aggregated_output??e.output,n=e.exitCode??e.exit_code;if(!(t===void 0&&n===void 0))return{...t!==void 0?{output:t}:{},...n!==void 0?{exitCode:n}:{}}}function Yje(e){if(e.args!==void 0)return e.args;if(e.arguments!==void 0)return e.arguments;if(e.input!==void 0)return e.input;const t=ir(e.command),n=ir(e.cwd);if(t||n)return{...t?{command:t}:{},...n?{cwd:n}:{}};if(e.changes!==void 0)return{changes:e.changes};if(e.approval!==void 0)return e.approval}function uy(e,t,n,i,r){return{kind:"tool",name:e,callId:t,args:i,response:r,done:n!=="running",status:n,...n==="failed"?{defaultOpen:!0}:{}}}function Zje(e){const t=ir(e.id||e.itemId||e.item_id),n=ir(e.kind);if(!t||!n)return null;const i=xV(e.status),r=ir(e.text||e.detail||e.delta),s=!ir(e.text||e.detail)&&typeof e.delta=="string";if(n==="thinking"||n==="reasoning")return r?{id:t,block:{kind:"thinking",text:r,done:i!=="running",thoughtKind:n==="reasoning"?"reasoning":"thought"},appendText:s}:null;if(n==="commentary")return r?{id:t,block:{kind:"text",text:r},appendText:s}:null;if(["message","text","assistant_final","final"].includes(n))return r?{id:t,block:{kind:"text",text:r},appendText:s,finalAnswer:!0}:null;if(n==="plan"){const o=Array.isArray(e.plan)?e.plan:[];return{id:t,block:{kind:"plan",title:ir(e.title)||Yo("planTitle"),summary:r||void 0,items:o.flatMap(l=>{const c=Cu(l),u=ir(c==null?void 0:c.text);if(!u)return[];const d=ir(c==null?void 0:c.status);return[{text:u,status:["pending","in_progress","completed","failed"].includes(d)?d:"pending"}]}),done:i!=="running"}}}if(["tool","command","command_execution","commandExecution","file_change","fileChange","mcp_tool_call","mcpToolCall","collab_tool_call","web_search","approval","status"].includes(n)){const o=Yo(n==="file_change"||n==="fileChange"?"fallback.fileChange":n==="approval"?"fallback.approval":n==="status"?"fallback.status":"fallback.command"),l=Yje(e),c=Xje(e)??(n==="status"&&r||void 0);return{id:t,block:uy(ir(e.name||e.title)||o,t,i,l,c)}}return null}function Jje(e){const t=ir(e.type),n=Cu(e.item),i=ir(n==null?void 0:n.type),r=ir((n==null?void 0:n.id)||e.id)||(t==="turn.failed"?"turn":"");if(!r)return null;const s=xV(n==null?void 0:n.status,t);if(i==="reasoning"||i==="agent_message"){const o=ir(n==null?void 0:n.text);return o?{id:r,block:i==="reasoning"?{kind:"thinking",text:o,done:s!=="running",thoughtKind:"reasoning"}:{kind:"text",text:o},...i==="agent_message"&&(n==null?void 0:n.phase)!=="commentary"?{finalAnswer:!0}:{}}:null}if(i==="todo_list"){const l=(Array.isArray(n==null?void 0:n.items)?n.items:[]).flatMap(c=>{const u=Cu(c),d=ir(u==null?void 0:u.text);if(!d)return[];const f=ir(u==null?void 0:u.status).toLowerCase(),h=(u==null?void 0:u.completed)===!0||["completed","done"].includes(f)?"completed":["failed","error"].includes(f)?"failed":["in_progress","running"].includes(f)?"in_progress":"pending";return[{text:d,status:h}]});return l.length?{id:r,block:{kind:"plan",title:Yo("planTitle"),summary:Yo("planSummary",{completed:l.filter(c=>c.status==="completed").length,total:l.length}),items:l,done:s!=="running"}}:null}if(i==="command_execution"){const o=Yo(`command.${s}`);return{id:r,block:uy(o,r,s,Yje(n??{}),Xje(n??{}))}}if(i==="file_change"){const o=Array.isArray(n==null?void 0:n.changes)?n.changes:[],l=o.length?Yo("projectFiles",{count:o.length}):Yo("projectFile"),c=Yo(`fileChange.${s}`,{subject:l});return{id:r,block:uy(c,r,s,o.length?{changes:o}:void 0)}}if(i==="mcp_tool_call"){const o=[ir(n==null?void 0:n.server),ir(n==null?void 0:n.tool)].filter(Boolean).join("/")||Yo("externalTool"),l=Yo(`mcp.${s}`,{tool:o}),c=Cu(n==null?void 0:n.error),u=(n==null?void 0:n.result)!==void 0?n.result:ir(c==null?void 0:c.message)||void 0;return{id:r,block:uy(l,r,s,n==null?void 0:n.arguments,u)}}if(i==="collab_tool_call"){const o=ir(n==null?void 0:n.tool),l=["spawn_agent","send_input","wait","close_agent"].includes(o)?o:"default",c=Yo(`collaboration.${l}.${s}`),u=Object.fromEntries(["tool","receiver_thread_ids","prompt"].filter(d=>(n==null?void 0:n[d])!==void 0).map(d=>[d,n==null?void 0:n[d]]));return{id:r,block:uy(c,r,s,Object.keys(u).length?u:void 0,n==null?void 0:n.agents_states)}}if(i==="web_search"){const o=Yo(`webSearch.${s}`),l=Object.fromEntries(["query","action"].filter(c=>(n==null?void 0:n[c])!==void 0).map(c=>[c,n==null?void 0:n[c]]));return{id:r,block:uy(o,r,s,Object.keys(l).length?l:void 0)}}if(i==="error"||t==="error"||t==="turn.failed"){const o=Cu(e.error),l=ir((n==null?void 0:n.message)||e.message||(o==null?void 0:o.message))||Yo("errorDetail");return{id:r,block:uy(Yo("errorTitle"),r,"failed",void 0,l)}}return null}function yot(e){const t=Cu(e),n=Cu(t==null?void 0:t.veadkStudioToolProgress);if(!n||n.kind!=="codex")return null;const i=ir(n.toolName),r=ir(n.requestId);if(!i||!r)return null;const s=Cu(n.event??n.activity);if(!s)return null;const o=Cu(s.item)||ir(s.type)?Jje(s):Zje(s);if(!o)return null;const l=ir(n.title||n.label),c=ir(s.agentSessionId??s.agent_session_id),u=ir(s.sandboxSessionId??s.sandbox_session_id),d=ir(s.threadId??s.thread_id),f=xV(s.status,ir(s.type)),m=ir(s.kind)==="status"&&f!=="running"?f:void 0;return{toolName:i,requestId:r,...l?{title:l}:{},...c?{agentSessionId:c}:{},...u?{sandboxSessionId:u}:{},...d?{threadId:d}:{},...m?{terminalStatus:m}:{},event:o}}function vot(e,t){const n=Cu(t),i=Cu((n==null?void 0:n.codexActivity)??(n==null?void 0:n.codex_activity));if(!i)return e;const r=ir(i.title)||(e==null?void 0:e.title)||"Codex Sandbox",s=ir(i.agentSessionId??i.agent_session_id)||(e==null?void 0:e.agentSessionId),o=ir(i.sandboxSessionId??i.sandbox_session_id)||(e==null?void 0:e.sandboxSessionId),l=ir(i.threadId??i.thread_id)||(e==null?void 0:e.threadId);let c={title:r,...s?{agentSessionId:s}:{},...o?{sandboxSessionId:o}:{},...l?{threadId:l}:{},items:(e==null?void 0:e.items.slice())??[]};const u=Array.isArray(i.events)?i.events:[];for(const d of u){const f=Cu(d);if(!f)continue;const h=Cu(f.item)||ir(f.type)?Jje(f):Zje(f);h&&(h.finalAnswer||(c=lB(c,{title:r,...s?{agentSessionId:s}:{},...o?{sandboxSessionId:o}:{},...l?{threadId:l}:{},event:h})))}return c}function lB(e,t){const n=(e==null?void 0:e.items.slice())??[],i=n.findIndex(r=>r.id===t.event.id);if(i>=0){const r=n[i].block,s=t.event.block;t.event.appendText&&r.kind==="text"&&s.kind==="text"?n[i]={id:t.event.id,block:{...s,text:r.text+s.text}}:t.event.appendText&&r.kind==="thinking"&&s.kind==="thinking"?n[i]={id:t.event.id,block:{...s,text:r.text+s.text}}:n[i]={id:t.event.id,block:s}}else n.push({id:t.event.id,block:t.event.block});return{title:t.title||(e==null?void 0:e.title)||"Codex Sandbox",...t.agentSessionId||e!=null&&e.agentSessionId?{agentSessionId:t.agentSessionId||(e==null?void 0:e.agentSessionId)}:{},...t.sandboxSessionId||e!=null&&e.sandboxSessionId?{sandboxSessionId:t.sandboxSessionId||(e==null?void 0:e.sandboxSessionId)}:{},...t.threadId||e!=null&&e.threadId?{threadId:t.threadId||(e==null?void 0:e.threadId)}:{},items:bot(n)}}const cB="send_a2ui_json_to_client",uB="validated_a2ui_json",yN="adk_request_credential",Q3="transfer_to_agent";function xot(e){var i,r,s,o;const t=e,n=((i=t==null?void 0:t.exchangedAuthCredential)==null?void 0:i.oauth2)??((r=t==null?void 0:t.exchanged_auth_credential)==null?void 0:r.oauth2)??((s=t==null?void 0:t.rawAuthCredential)==null?void 0:s.oauth2)??((o=t==null?void 0:t.raw_auth_credential)==null?void 0:o.oauth2);return(n==null?void 0:n.authUri)??(n==null?void 0:n.auth_uri)}function dB(){return{blocks:[],liveStart:0,pendingCodexProgress:[]}}const wot=2048;function ree(e,t){if(t.event.finalAnswer)return"applied";let n=-1;for(let i=e.length-1;i>=0;i-=1){const r=e[i];if(!(r.kind!=="tool"||r.name!==t.toolName)){if(r.callId===t.requestId)return r.done?"completed":(r.codexActivity=lB(r.codexActivity,t),r.status=t.terminalStatus??"running",t.terminalStatus&&(r.done=!0),"applied");if(!r.done){if(n>=0)return"unmatched";n=i}}}if(n>=0){const i=e[n];return i.kind!=="tool"?"unmatched":(i.codexActivity=lB(i.codexActivity,t),i.status=t.terminalStatus??"running",t.terminalStatus&&(i.done=!0),"applied")}return"unmatched"}function kot(e){if(!e||typeof e!="object"||Array.isArray(e))return"completed";const t=e,n=typeof t.status=="string"?t.status.toLowerCase():"";return t.ok===!1||["error","failed","denied","declined","cancelled","timeout"].includes(n)?"failed":"completed"}function see(e){if(!e||typeof e!="object"||Array.isArray(e))return"";const t=e;return t.ok!==!0||typeof t.message!="string"?"":t.message.trim()}const bC=e=>e.functionCall??e.function_call,Zg=e=>e.functionResponse??e.function_response;function K1(e){const t=e.customMetadata??e.custom_metadata;return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function Oot(e,t){const n=e[t];return n&&typeof n=="object"&&!Array.isArray(n)?n:{}}function rg(e,t){const n=e[t];return typeof n=="string"?n:""}function eNe(e){return Oot(K1(e),"mpa")}function wV(e){const t=K1(e),n=eNe(e);return rg(t,"eventType")||rg(t,"event_type")||rg(n,"eventType")||rg(n,"event_type")||rg(n,"kind")}function lw(e){const t=K1(e),n=eNe(e);return rg(t,"source")==="sandbox"||rg(n,"source")==="sandbox"}function tNe(e){const t=wV(e);return t==="usage.updated"||t==="usage"}function fI(e){var t;return(((t=e.content)==null?void 0:t.parts)??[]).some(n=>{const i=Zg(n),r=i==null?void 0:i.response;return(i==null?void 0:i.name)==="sandbox_task"&&r&&typeof r=="object"&&!Array.isArray(r)&&r.finalAlreadyEmitted===!0})}function aee(e){for(const t of e)t.kind!=="tool"||t.name!=="sandbox_task"||t.done||(t.done=!0,t.status="completed")}function Sot(e,t){if(e===t)return!0;const n=new Set(["exec_command","commandExecution","command_execution","Run command"]);return n.has(e)&&n.has(t)}function oee(e,t=!1){const n=e&&typeof e=="object"?String(e.status??"").toLowerCase():"",i=["failed","error","cancelled","denied","timeout"].includes(n)||(e==null?void 0:e.ok)===!1,r=["running","started","working"].includes(n);return{done:i||!(t||r),status:i?"failed":t||r?"running":"completed"}}function Eot(e){return e.flatMap(t=>{var n;return t.kind!=="tool"||t.name!=="delegate_to_codex_sandbox"||!((n=t.codexActivity)!=null&&n.items.length)?[t]:[{kind:"activity-source",label:t.codexActivity.title||"Codex Sandbox"},...t.codexActivity.items.map(({block:i})=>i.kind==="tool"?{...i,source:"codex-sandbox"}:i)]})}function Cot(e){if(!e||typeof e!="object")return"";const t=e,n=t.agentName??t.agent_name;return typeof n=="string"?n:""}function Aot(e){return e.replace(/-/g,"+").replace(/_/g,"/")}function XA(e){const t=[];for(const[n,i]of e.entries()){const r=i.partMetadata??i.part_metadata,s=r==null?void 0:r.veadkTransport;if((s==null?void 0:s.hidden)===!0)continue;const o=r==null?void 0:r.veadkMedia;if(typeof(o==null?void 0:o.uri)=="string"){t.push({id:String(o.id??o.uri),mimeType:typeof o.mimeType=="string"?o.mimeType:void 0,uri:o.uri,name:typeof o.name=="string"?o.name:void 0,sizeBytes:typeof o.sizeBytes=="number"?o.sizeBytes:void 0});continue}const l=i.inlineData??i.inline_data;if(l&&l.data){t.push({id:`inline-${n}-${l.displayName??l.display_name??"media"}`,mimeType:l.mimeType??l.mime_type,data:Aot(l.data),name:l.displayName??l.display_name});continue}const c=i.fileData??i.file_data,u=(c==null?void 0:c.fileUri)??(c==null?void 0:c.file_uri);c&&u&&t.push({id:u,mimeType:c.mimeType??c.mime_type,uri:u,name:c.displayName??c.display_name})}return t}function Hy(e){const t=e.partMetadata??e.part_metadata,n=t==null?void 0:t.veadkTransport;return(n==null?void 0:n.hideText)===!0?void 0:e.text}const Tot=new Set(["llm","sequential","parallel","loop","a2a"]);function _ot(e){var t;for(const n of e){const i=(t=n.partMetadata??n.part_metadata)==null?void 0:t.veadkInvocation;if(!i||typeof i!="object")continue;const r=i,s=Array.isArray(r.skills)?r.skills.flatMap(c=>{if(!c||typeof c!="object")return[];const u=c;return typeof u.name=="string"?[{name:u.name,description:typeof u.description=="string"?u.description:""}]:[]}):[];let o;const l=r.targetAgent;if(l&&typeof l=="object"){const c=l,u=c.type;typeof c.name=="string"&&typeof u=="string"&&Tot.has(u)&&Array.isArray(c.path)&&(o={name:c.name,description:typeof c.description=="string"?c.description:"",type:u,path:c.path.filter(d=>typeof d=="string")})}if(s.length>0||o)return{skills:s,targetAgent:o}}}function jot(e,t){if(!t.length)return;const n=e[e.length-1];(n==null?void 0:n.kind)==="attachment"?n.files.push(...t):e.push({kind:"attachment",files:t})}function Not(e,t){if(!t.length)return;const n=e[e.length-1];if((n==null?void 0:n.kind)==="artifact"){for(const i of t)n.files.some(r=>r.filename===i.filename&&r.version===i.version)||n.files.push(i);return}e.push({kind:"artifact",files:t})}function z3(e,t,n,i){const r=e[e.length-1];r&&r.kind===t&&(r.kind!=="thinking"||r.thoughtKind===i)?r.text+=n:e.push(t==="thinking"?{kind:t,text:n,done:!1,thoughtKind:i}:{kind:t,text:n})}function V3(e){const t=e.customMetadata??e.custom_metadata;if(t&&typeof t=="object"){const n=t.thoughtKind;if(n==="reasoning"||n==="thought")return n}return"reasoning"}function mO(e){for(const t of e)t.kind==="thinking"&&(t.done=!0)}function nNe(e,t,n={}){var h,m,g,b,v,y;const i=e.blocks.map(w=>({...w}));let r=e.liveStart,s=e.pendingCodexProgress.slice();if(tNe(t)&&!n.mpaA2a)return{blocks:i,liveStart:r,pendingCodexProgress:s};if(fI(t))return aee(i),mO(i),{blocks:i,liveStart:r,pendingCodexProgress:s};const o=((h=t.content)==null?void 0:h.parts)??[],l=o.flatMap(w=>{const x=mot(w.partMetadata??w.part_metadata);return x?[x]:[]}),c=o.flatMap(w=>{const x=yot(w.partMetadata??w.part_metadata);return x?[x]:[]});if(l.length>0||c.length>0){for(const w of l)for(let x=i.length-1;x>=0;x-=1){const k=i[x];if(!(k.kind!=="tool"||k.done||k.name!==w.toolName||w.requestId&&k.callId&&k.callId!==w.requestId)){k.response=got(k.args,k.response,w),k.status="running";break}}for(const w of c)ree(i,w)==="unmatched"&&(s=[...s,w].slice(-64));return{blocks:i,liveStart:r,pendingCodexProgress:s}}const u=o.some(w=>bC(w)||Zg(w));if(t.partial&&!u){for(const w of o){const x=Hy(w),k=n.mpaA2a&&w.thought?rg(K1(t),"reasoningSegmentId"):"";if(k&&typeof x=="string"&&x){const S=i.find(O=>O.kind==="thinking"&&O.reasoningSegmentId===k);(S==null?void 0:S.kind)==="thinking"?S.text+=x:i.push({kind:"thinking",text:x,done:!1,thoughtKind:V3(t),reasoningSegmentId:k});continue}typeof x=="string"&&x&&z3(i,w.thought?"thinking":"text",x,w.thought?V3(t):void 0)}return{blocks:i,liveStart:r,pendingCodexProgress:s}}const d=n.mpaA2a&&!o.some(w=>w.thought&&Hy(w))?i.slice(r).filter(w=>w.kind==="thinking"):[];i.length=r,i.push(...d);for(const w of o){const x=bC(w),k=Zg(w),S=XA([w]),O=Hy(w);if(typeof O=="string"&&O)z3(i,w.thought?"thinking":"text",O,w.thought?V3(t):void 0);else if(S.length)mO(i),jot(i,S);else if(x)if(mO(i),x.name===Q3){const A=Cot(x.args)||((m=t.actions)==null?void 0:m.transferToAgent)||((g=t.actions)==null?void 0:g.transfer_to_agent)||bn.t("app:common.unknownAgent");i.push({kind:"agent-transfer",agentName:A,done:!1})}else{if(x.name==="sandbox_task"&&lw(t))continue;if(x.name===yN){const A=x.args??{},E=A.authConfig??A.auth_config??A,T=String(A.functionCallId??A.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;i.push({kind:"auth",callId:x.id??"",label:T,authUri:xot(E),authConfig:E,done:!1})}else{const A=x.id?[...i].reverse().find(j=>j.kind==="tool"&&j.callId===x.id):void 0;if((A==null?void 0:A.kind)==="tool"){A.name=x.name??A.name,A.args=x.args??A.args,A.response===void 0&&(A.done=!1,A.status="running");continue}const E={kind:"tool",name:x.name??"",callId:x.id,args:x.args,done:!1};if(i.push(E),E.callId){const j=[];for(const T of s)T.toolName===E.name&&T.requestId===E.callId?ree(i,T):j.push(T);s=j}}}else if(k){if(mO(i),k.name===Q3)for(let E=i.length-1;E>=0;E--){const j=i[E];if(j.kind==="agent-transfer"&&!j.done){j.done=!0;break}}if(k.name===yN)for(let E=i.length-1;E>=0;E--){const j=i[E];if(j.kind==="auth"&&!j.done){j.done=!0;break}}let A=!1;for(let E=i.length-1;E>=0;E--){const j=i[E],T=j.kind==="tool"&&j.name==="delegate_to_codex_sandbox";if(j.kind==="tool"&&(!j.done||T||k.id&&j.callId===k.id)&&(k.id&&j.callId&&j.callId===k.id||(!k.id||!j.callId)&&Sot(j.name,k.name??""))){const R=T?see(j.response):"",C=oee(k.response,t.partial===!0);if(j.done=C.done,j.response=k.response,j.status=C.status,T){j.codexActivity=vot(j.codexActivity,k.response),j.status=C.status==="running"?"running":kot(k.response);const N=see(k.response);N&&N!==R&&z3(i,"text",N)}A=!0;break}}if(!A&&k.name!==Q3&&k.name!==yN&&k.name!==cB){const E=oee(k.response,t.partial===!0);i.push({kind:"tool",name:k.name??"",callId:k.id,response:k.response,done:E.done,status:E.status})}if(k.name===cB){const E=((b=k.response)==null?void 0:b[uB])??[];if(E.length){const j=i[i.length-1];j&&j.kind==="a2ui"?j.messages.push(...E):i.push({kind:"a2ui",messages:E})}}}}const f=((v=t.actions)==null?void 0:v.artifactDelta)??((y=t.actions)==null?void 0:y.artifact_delta);return f&&Not(i,Object.entries(f).map(([w,x])=>({filename:w,version:x}))),lw(t)&&wV(t)==="invocation.completed"&&aee(i),mO(i),r=i.length,{blocks:i,liveStart:r,pendingCodexProgress:s}}function Rot(e,t){var u,d,f,h,m,g;if(e.partial===!0)return!1;if(fI(e))return!0;const n=((u=e.content)==null?void 0:u.parts)??[],i=n.some(b=>{const v=Hy(b);return!b.thought&&typeof v=="string"&&v.trim().length>0||XA([b]).length>0}),r=n.some(b=>{var y;const v=Zg(b);return(v==null?void 0:v.name)===cB&&Array.isArray((y=v.response)==null?void 0:y[uB])&&v.response[uB].length>0}),s=((d=e.actions)==null?void 0:d.artifactDelta)??((f=e.actions)==null?void 0:f.artifact_delta),o=!!(s&&Object.keys(s).length>0),l=!!(((h=e.actions)==null?void 0:h.endOfAgent)??((m=e.actions)==null?void 0:m.end_of_agent)??((g=e.actions)==null?void 0:g.escalate)),c=t.some(b=>b.kind==="text"||b.kind==="attachment"||b.kind==="artifact"||b.kind==="a2ui"||b.kind==="delivery");return i||r||o||l&&c}function iNe(e){var n;const t=(n=e.customMetadata??e.custom_metadata)==null?void 0:n.a2aStatus;return typeof t=="string"?t:void 0}function lee(e){var n,i,r;if(iNe(e))return!0;const t=((n=e.actions)==null?void 0:n.artifactDelta)??((i=e.actions)==null?void 0:i.artifact_delta);return t&&Object.keys(t).length>0?!0:(((r=e.content)==null?void 0:r.parts)??[]).some(s=>!!(Hy(s)||XA([s]).length>0||bC(s)||Zg(s)))}function Iot(e,t){var o;const n=K1(t),i=((o=t.content)==null?void 0:o.parts)??[];if(t.partial!==!1||n.projectionSource!=="a2a-artifact"||lw(t)||!i.length||t.actions||!i.every(l=>l.thought&&typeof l.text=="string"&&!bC(l)&&!Zg(l)&&XA([l]).length===0))return e;const r=e.blocks[e.blocks.length-1],s=i.map(l=>l.text).join("").trim();return(r==null?void 0:r.kind)!=="thinking"||!r.text.trim()||!s.startsWith(r.text.trim())?e:{...e,liveStart:e.blocks.length-1}}function Pot(e,t,n,i){const r=e[t];if(!r||r.role!=="assistant"||i.turnIsStreaming||n(r))return!1;if(!i.mpaA2a)return!0;let s=t;for(;s>0&&e[s-1].role!=="user";)s-=1;let o=t+1;for(;oc.blocks.length>0)}function Dot(e){var t,n;return e.author!=="user"&&((t=e.content)==null?void 0:t.role)!=="user"?!1:!(((n=e.content)==null?void 0:n.parts)??[]).some(i=>bC(i)||Zg(i))}function vN(e="adk-stream",t,n={}){var h,m,g,b;let i=0;const r=new Map,s=new Set,o=[];let l,c,u={...(h=t==null?void 0:t.meta)==null?void 0:h.mpaUsage};const d=v=>{if(!n.mpaA2a||!(v.usageMetadata??v.usage_metadata))return!1;const y=vV(oE,v).current.totalTokenCount;if(!y)return!1;const w=K1(v),x=JSON.stringify([w.source??"outer",w.requestId??"",v.invocationId??v.invocation_id??"",v.id||JSON.stringify(v.usageMetadata??v.usage_metadata)]);return Object.prototype.hasOwnProperty.call(u,x)?!1:(u={...u,[x]:y},!0)},f=(v,y)=>`${y}\0${v}`;if((t==null?void 0:t.role)==="assistant"){const v=((m=t.meta)==null?void 0:m.author)??"",y=((g=t.meta)==null?void 0:g.invocationId)??"",w=((b=t.meta)==null?void 0:b.localId)??`${e}-${i++}`,x=dB();x.blocks=t.blocks,x.liveStart=t.blocks.length,l=f(v,y),r.set(l,{acc:x,localId:w,meta:{...t.meta,localId:w,streaming:!0,eventId:void 0}})}return{project(v){var R,C,N;if(Dot(v))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};const y=d(v);if(n.mpaA2a&&!lee(v)&&!((C=(R=v.content)==null?void 0:R.parts)!=null&&C.length))return y&&c?(c={...c,meta:{...c.meta,mpaUsage:u}},{turn:c,completed:!1}):{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(tNe(v)&&!n.mpaA2a)return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(v.id&&s.has(v.id))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};v.id&&(s.add(v.id),o.push(v.id),o.length>wot&&s.delete(o.shift()));const w=v.author&&v.author!=="user"?v.author:"",x=v.invocationId??v.invocation_id??"";let k=lw(v)?"":w,S=f(k,x),O=r.get(S);if(!O&&lw(v)&&x){const P=[...r.entries()].find(([I])=>I.startsWith(`${x}\0`));P&&(S=P[0],O=P[1],k=O.meta.author??"")}if(!O&&l){const P=r.get(l);P&&(!P.meta.author||P.meta.author===k)&&(r.delete(l),l=void 0,O=P)}if(!O&&fI(v))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(!O&&!lee(v))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(!O){const P=`${e}-${i++}`;O={acc:dB(),localId:P,meta:{author:k||void 0,invocationId:x||void 0}}}O.acc=nNe(n.mpaA2a?Iot(O.acc,v):O.acc,v,n);const A=v.usageMetadata??v.usage_metadata,E=Rot(v,O.acc.blocks);O.meta={...O.meta,author:k||O.meta.author,localId:O.localId,streaming:!E,a2aStatus:iNe(v),tokens:(A==null?void 0:A.totalTokenCount)||O.meta.tokens,...n.mpaA2a?{mpaUsage:u,mpaFinalAnswer:lw(v)&&wV(v)==="invocation.completed"?(((N=v.content)==null?void 0:N.parts)??[]).filter(P=>!P.thought).map(P=>Hy(P)??"").join("").trim()||void 0:O.meta.mpaFinalAnswer}:{},ts:v.timestamp||O.meta.ts,invocationId:x||O.meta.invocationId,eventId:E&&v.id?v.id:O.meta.eventId};const j={role:"assistant",blocks:O.acc.blocks,meta:O.meta},T=E&&fI(v);return E&&!T?(r.delete(S),l=void 0):r.set(S,O),n.mpaA2a&&(c=j),{turn:j,completed:E}},finish(){const v=[...r.values()].map(y=>({role:"assistant",blocks:y.acc.blocks.map(w=>w.kind==="thinking"?{...w,done:!0}:w),meta:{...y.meta,streaming:!1,...n.mpaA2a?{mpaUsage:u}:{}}}));return r.clear(),v}}}function Sy(e,t){var s;const n=(s=t.meta)==null?void 0:s.localId;if(!n)return[...e,t];const i=e.findIndex(o=>{var l;return((l=o.meta)==null?void 0:l.localId)===n});if(i<0)return[...e,t];const r=e.slice();return r[i]=t,r}function cee(e,t={},n={}){var l;let i=[],r=0;const s=()=>vN(`adk-history-${r++}`,void 0,n);let o=s();for(const c of e)if(c.author==="user"){const d=((l=c.content)==null?void 0:l.parts)??[];if(d.some(b=>{var v;return((v=Zg(b))==null?void 0:v.name)===yN})){for(let b=i.length-1;b>=0;b--)if(i[b].role==="assistant"){for(let v=i[b].blocks.length-1;v>=0;v--){const y=i[b].blocks[v];if(y.kind==="auth"){y.done=!0;break}}break}}const f=d.map(Hy).filter(b=>!!b).join(""),h=XA(d),m=_ot(d);if(!f&&!h.length&&!m)continue;for(const b of o.finish())i=Sy(i,b);const g=[];m&&g.push({kind:"invocation",value:m}),h.length&&g.push({kind:"attachment",files:h}),f&&g.push({kind:"text",text:f}),i.push({role:"user",blocks:g,meta:{ts:c.timestamp}}),o=s()}else{const d=o.project(c);d.ignored||(i=Sy(i,d.turn))}for(const c of o.finish())i=Sy(i,c);for(const c of i){const u=c.meta,d=u==null?void 0:u.eventId;if(!d)continue;const f=t[`veadk_feedback:${d}`];if(!f||typeof f!="object")continue;const h=f;h.rating!=="good"&&h.rating!=="bad"||(u.feedback=f)}return i}function tM(e,t=bn.t("app:titles.newConversation")){var n,i;for(const r of e??[])if(r.author==="user"||((n=r.content)==null?void 0:n.role)==="user"){const s=(((i=r.content)==null?void 0:i.parts)??[]).map(o=>o.text).find(Boolean);if(s)return s}return t}function Mot(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return e[t]}function Lot(e,t,n){var s;if(!n||!t.some(o=>{var l;return o.role==="assistant"&&((l=o.meta)==null?void 0:l.eventId)===n}))return e;const r=Mot(e);return((s=r==null?void 0:r.meta)==null?void 0:s.eventId)!==n?e:t}function rNe(e,t,n){if(e.name===t||e.id===t)return(n==null?void 0:n.type)==="parallel"?n:void 0;for(const i of e.children){const r=rNe(i,t,e);if(r)return r}}function $ot(e,t){var o,l;if(e.role!=="assistant"||!t)return;const n=(o=e.meta)==null?void 0:o.author;if(!n)return;const i=rNe(t,n);if(!i)return;const r=i.id||i.path.join("/")||i.name;return{key:`${((l=e.meta)==null?void 0:l.invocationId)??""}::${r}`,parent:i.name}}function Fot(e,t){const n=[];return e.forEach((i,r)=>{const s=$ot(i,t),o=n[n.length-1];if(s&&(o==null?void 0:o.groupKey)===s.key){o.turnIndexes.push(r);return}n.push({key:s?`parallel-${s.key}-${r}`:`turn-${r}`,turnIndexes:[r],parallelParent:s==null?void 0:s.parent,groupKey:s==null?void 0:s.key})}),n.map(({groupKey:i,...r})=>r)}function Bot(e,t,n){var r,s,o,l,c;if(!t)return e;const i=[];for(let u=0;u{var S;return(S=k.meta)!=null&&S.mpaFinalAnswer?[k.meta.mpaFinalAnswer.trim()]:[]})),m=f.map(k=>{var O;const S=k.blocks.filter(A=>A.kind==="text").map(A=>A.text).join("").trim();return!((O=k.meta)!=null&&O.mpaFinalAnswer)&&S&&h.has(S)?{...k,blocks:k.blocks.filter(A=>A.kind!=="text")}:k}),g=[...m].reverse().find(k=>k.blocks.some(S=>S.kind==="text"&&S.text.trim()))??f[f.length-1],b={},v=new Map,y=f.some(k=>{var S;return(S=k.meta)==null?void 0:S.mpaUsage});for(const k of f){for(const[O,A]of Object.entries(((r=k.meta)==null?void 0:r.mpaUsage)??{}))b[O]=Math.max(b[O]??0,A);const S=(s=k.meta)==null?void 0:s.tokens;if(typeof S=="number"&&Number.isFinite(S)&&S>=0){const O=((o=k.meta)==null?void 0:o.invocationId)||"unidentified";v.set(O,Math.max(v.get(O)??0,S))}}const w=y?Object.values(b):[...v.values()],x=f.flatMap(k=>{var S;return(S=k.meta)!=null&&S.ts?[k.meta.ts]:[]});i.push({role:"assistant",blocks:m.flatMap(k=>k.blocks),meta:{...g.meta,localId:(l=d.meta)==null?void 0:l.localId,author:void 0,streaming:u===e.length&&n||f.some(k=>{var S;return((S=k.meta)==null?void 0:S.streaming)===!0}),a2aStatus:(c=f[f.length-1].meta)==null?void 0:c.a2aStatus,ts:x.length?Math.max(...x):void 0,tokens:w.length?w.reduce((k,S)=>k+S,0):void 0,...y?{mpaUsage:b}:{}}})}return i}function Uot(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"9",cy:"8",r:"3.25"}),a.jsx("path",{d:"M2.75 20v-1.5a6.25 6.25 0 0 1 12.5 0V20M16 5.25a3.25 3.25 0 0 1 0 6.5M18 14a5.5 5.5 0 0 1 3.25 5V20"})]})}function sNe(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t{const t=p.Children.toArray(e),n=[];let i="";const r=()=>{i!==""&&(n.push(i),i="")};for(const s of t)if(!(s==null||typeof s=="boolean")){if(typeof s=="string"||typeof s=="number"){i+=String(s);continue}r(),n.push(s)}return r(),n},kV=e=>{const t=Qot(e),n=p.Children.count(t);return p.Children.map(t,i=>{if(typeof i=="string"&&i.trim())return n<=1?i:a.jsx("span",{children:i});if(p.isValidElement(i)){const r=i,{children:s,...o}=r.props;return s!=null?p.cloneElement(r,o,kV(s)):r}return i})},zot="_Badge_1viyg_1",Vot={Badge:zot},Za=({children:e,className:t,variant:n="soft",color:i="secondary",size:r="sm",pill:s,...o})=>a.jsx("div",{className:qi(Vot.Badge,t),"data-color":i,"data-size":r,"data-pill":s?"":void 0,"data-variant":n,...o,children:kV(e)});var Hot=typeof lg=="object"&&lg&&lg.Object===Object&&lg,qot=typeof self=="object"&&self&&self.Object===Object&&self;Hot||qot||Function("return this")();var Wot=typeof window<"u"?p.useLayoutEffect:p.useEffect;function Kot(){const e=p.useRef(!1);return p.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),p.useCallback(()=>e.current,[])}var uee={width:void 0,height:void 0};function aNe(e){const{ref:t,box:n="content-box"}=e,[{width:i,height:r},s]=p.useState(uee),o=Kot(),l=p.useRef({...uee}),c=p.useRef(void 0);return c.current=e.onResize,p.useEffect(()=>{if(!t.current||typeof window>"u"||!("ResizeObserver"in window))return;const u=new ResizeObserver(([d])=>{const f=n==="border-box"?"borderBoxSize":n==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",h=dee(d,f,"inlineSize"),m=dee(d,f,"blockSize");if(l.current.width!==h||l.current.height!==m){const b={width:h,height:m};l.current.width=h,l.current.height=m,c.current?c.current(b):o()&&s(b)}});return u.observe(t.current,{box:n}),()=>{u.disconnect()}},[n,t,o]),{width:i,height:r}}function dee(e,t,n){return e[t]?Array.isArray(e[t])?e[t][0][n]:e[t][n]:t==="contentBoxSize"?e.contentRect[n==="inlineSize"?"width":"height"]:void 0}function OV(e,t){const n=p.useRef(e);Wot(()=>{n.current=e},[e]),p.useEffect(()=>{if(!t&&t!==0)return;const i=setTimeout(()=>{n.current()},t);return()=>{clearTimeout(i)}},[t])}const Got={DEV:!1,MODE:"production"},cw=typeof import.meta<"u"?Got:void 0,Xot=!!(cw!=null&&cw.DEV),Yot=typeof navigator<"u"&&/(jsdom|happy-dom)/i.test(navigator.userAgent)||typeof globalThis.happyDOM=="object",oNe=(cw==null?void 0:cw.MODE)==="test"||Yot,Zot=typeof window<"u",lNe=typeof document<"u",Jot=Zot&&lNe,SV=e=>{const t=e.currentTarget;if(!(t instanceof HTMLElement))return;const n=t.offsetWidth;let i=.985;n<=80?i=.96:n<=150?i=.97:n<=220?i=.98:n>600&&(i=.995),t.style.setProperty("--scale",i.toString())},hI=(e,t)=>{const n=()=>{const o=setTimeout(e);return()=>{clearTimeout(o)}};if(!Jot||typeof window.requestAnimationFrame!="function"||lNe&&document.visibilityState==="hidden")return n();let r=2,s=window.requestAnimationFrame(function o(){r-=1,r===0?e():s=window.requestAnimationFrame(o)});return()=>{typeof window.cancelAnimationFrame=="function"&&window.cancelAnimationFrame(s)}},Fv=e=>Object.keys(e).reduce((n,i)=>{const r=e[i];if(r||r===0){const s=i.startsWith("--")?"":"--",o=typeof r=="number"?`${r}px`:r;n[`${s}${i}`]=o}return n},{}),H3=e=>typeof e=="number"?`${e}deg`:e,q3=e=>String(e),o_=e=>`${e}ms`,W3=({x:e,y:t,scale:n,rotate:i,skewX:r,skewY:s}={})=>{const o=[e==null?null:`translateX(${e}px)`,t==null?null:`translateY(${t}px)`,n==null?null:`scale(${n})`,i==null?null:`rotate(${H3(i)})`,r==null?null:`skewX(${H3(r)})`,s==null?null:`skewY(${H3(s)})`].filter(Boolean);return o.length?o.join(" "):"none"},K3=({blur:e}={})=>{const t=[e==null?null:`blur(${e}px)`].filter(Boolean);return t.length?t.join(" "):"none"},Lp=e=>{e.preventDefault()},cNe=e=>e.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex^="-"]), [contenteditable]'),elt="_LoadingIndicator_7yl6f_1",tlt={LoadingIndicator:elt},YA=({className:e,size:t,strokeWidth:n,style:i,...r})=>a.jsx("div",{...r,className:qi(tlt.LoadingIndicator,e),style:i||Fv({"indicator-size":t,"indicator-stroke":n})});var nlt=Object.defineProperty,EV=(e,t)=>nlt(e,"name",{value:t,configurable:!0});function fB(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}EV(fB,"setRef");function uNe(...e){return t=>{let n=!1;const i=e.map(r=>{const s=fB(r,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;rilt(e,"name",{value:t,configurable:!0});function Yp(e){const t=p.forwardRef((n,i)=>{let{children:r,...s}=n,o=null,l=!1;const c=[];hB(r)&&typeof l_=="function"&&(r=l_(r._payload)),p.Children.forEach(r,h=>{var m;if(gNe(h)){l=!0;const g=h;let b="child"in g.props?g.props.child:g.props.children;hB(b)&&typeof l_=="function"&&(b=l_(b._payload)),o=rlt(g,b),c.push((m=o==null?void 0:o.props)==null?void 0:m.children)}else c.push(h)}),o?o=p.cloneElement(o,void 0,c):!l&&p.Children.count(r)===1&&p.isValidElement(r)&&(o=r);const u=o?mNe(o):void 0,d=Rr(i,u);if(!o){if(r||r===0)throw new Error(l?olt(e):alt(e));return r}const f=pNe(s,o.props??{});return o.type!==p.Fragment&&(f.ref=i?d:u),p.cloneElement(o,f)});return t.displayName=`${e}.Slot`,t}Sf(Yp,"createSlot");var dNe=Yp("Slot"),fNe=Symbol.for("radix.slottable");function hNe(e){const t=Sf(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=fNe,t}Sf(hNe,"createSlottable");var rlt=Sf((e,t)=>{if("child"in e.props){const n=e.props.child;return p.isValidElement(n)?p.cloneElement(n,void 0,e.props.children(n.props.children)):null}return p.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function pNe(e,t){const n={...t};for(const i in t){const r=e[i],s=t[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...l)=>{const c=s(...l);return r(...l),c}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}Sf(pNe,"mergeProps");function mNe(e){var i,r;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Sf(mNe,"getElementRef");function gNe(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fNe}Sf(gNe,"isSlottable");var slt=Symbol.for("react.lazy");function hB(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===slt&&"_payload"in e&&bNe(e._payload)}Sf(hB,"isLazyComponent");function bNe(e){return typeof e=="object"&&e!==null&&"then"in e}Sf(bNe,"isPromiseLike");var alt=Sf(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),olt=Sf(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),l_=_v[" use ".trim().toString()],llt=Object.defineProperty,clt=(e,t)=>llt(e,"name",{value:t,configurable:!0}),ult=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Jr=ult.reduce((e,t)=>{const n=Yp(`Primitive.${t}`),i=p.forwardRef((r,s)=>{const{asChild:o,...l}=r,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:s})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function CV(e,t){e&&vi.flushSync(()=>e.dispatchEvent(t))}clt(CV,"dispatchDiscreteCustomEvent");var dlt=Object.defineProperty,flt=(e,t)=>dlt(e,"name",{value:t,configurable:!0}),hlt=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),plt=p.forwardRef(flt(function(t,n){return a.jsx(Jr.span,{...t,ref:n,style:{...hlt,...t.style}})},"VisuallyHidden")),mlt=plt,glt=Object.defineProperty,ud=(e,t)=>glt(e,"name",{value:t,configurable:!0});function blt(e,t){const n=p.createContext(t);n.displayName=e+"Context";const i=ud(s=>{const{children:o,...l}=s,c=p.useMemo(()=>l,Object.values(l));return a.jsx(n.Provider,{value:c,children:o})},"Provider");i.displayName=e+"Provider";function r(s,o={}){const{optional:l=!1}=o,c=p.useContext(n);if(c)return c;if(t!==void 0)return t;if(!l)throw new Error(`\`${s}\` must be used within \`${e}\``)}return ud(r,"useContext"),[i,r]}ud(blt,"createContext");function Qc(e,t=[]){let n=[];function i(s,o){const l=p.createContext(o);l.displayName=s+"Context";const c=n.length;n=[...n,o];const u=ud(f=>{var y;const{scope:h,children:m,...g}=f,b=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,v=p.useMemo(()=>g,Object.values(g));return a.jsx(b.Provider,{value:v,children:m})},"Provider");u.displayName=s+"Provider";function d(f,h,m={}){var y;const{optional:g=!1}=m,b=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,v=p.useContext(b);if(v)return v;if(o!==void 0)return o;if(!g)throw new Error(`\`${f}\` must be used within \`${s}\``)}return ud(d,"useContext"),[u,d]}ud(i,"createContext");const r=ud(()=>{const s=n.map(o=>p.createContext(o));return ud(function(l){const c=(l==null?void 0:l[e])||s;return p.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])},"useScope")},"createScope");return r.scopeName=e,[i,yNe(r,...t)]}ud(Qc,"createContextScope");function yNe(...e){const t=e[0];if(e.length===1)return t;const n=ud(()=>{const i=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return ud(function(s){const o=i.reduce((l,{useScope:c,scopeName:u})=>{const f=c(s)[`__scope${u}`];return{...l,...f}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}ud(yNe,"composeContextScopes");var ylt=Object.defineProperty,Io=(e,t)=>ylt(e,"name",{value:t,configurable:!0});function AV(e){const t=e+"CollectionProvider",[n,i]=Qc(t),[r,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=Io(b=>{const{scope:v,children:y}=b,w=p.useRef(null),x=p.useRef(new Map).current;return a.jsx(r,{scope:v,itemMap:x,collectionRef:w,children:y})},"CollectionProvider");o.displayName=t;const l=e+"CollectionSlot",c=Yp(l),u=p.forwardRef((b,v)=>{const{scope:y,children:w}=b,x=s(l,y),k=Rr(v,x.collectionRef);return a.jsx(c,{ref:k,children:w})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=Yp(d),m=p.forwardRef((b,v)=>{const{scope:y,children:w,...x}=b,k=p.useRef(null),S=Rr(v,k),O=s(d,y);return p.useEffect(()=>(O.itemMap.set(k,{ref:k,...x}),()=>void O.itemMap.delete(k))),a.jsx(h,{[f]:"",ref:S,children:w})});m.displayName=d;function g(b){const v=s(e+"CollectionConsumer",b);return p.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const x=Array.from(w.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((O,A)=>x.indexOf(O.ref.current)-x.indexOf(A.ref.current))},[v.collectionRef,v.itemMap])}return Io(g,"useCollection"),[{Provider:o,Slot:u,ItemSlot:m},g,i]}Io(AV,"createCollection");var fee=new WeakMap,Ha,bu,G3=(bu=class extends Map{constructor(n){super(n);$G(this,Ha);w5(this,Ha,[...super.keys()]),fee.set(this,!0)}set(n,i){return fee.get(this)&&(this.has(n)?kl(this,Ha)[kl(this,Ha).indexOf(n)]=n:kl(this,Ha).push(n)),super.set(n,i),this}insert(n,i,r){const s=this.has(i),o=kl(this,Ha).length,l=TV(n);let c=l>=0?l:o+l;const u=c<0||c>=o?-1:c;if(u===this.size||s&&u===this.size-1||u===-1)return this.set(i,r),this;const d=this.size+(s?0:1);l<0&&c++;const f=[...kl(this,Ha)];let h,m=!1;for(let g=c;g=this.size&&(s=this.size-1),this.at(s)}keyFrom(n,i){const r=this.indexOf(n);if(r===-1)return;let s=r+i;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(n,i){let r=0;for(const s of this){if(Reflect.apply(n,i,[s,r,this]))return s;r++}}findIndex(n,i){let r=0;for(const s of this){if(Reflect.apply(n,i,[s,r,this]))return r;r++}return-1}filter(n,i){const r=[];let s=0;for(const o of this)Reflect.apply(n,i,[o,s,this])&&r.push(o),s++;return new bu(r)}map(n,i){const r=[];let s=0;for(const o of this)r.push([o[0],Reflect.apply(n,i,[o,s,this])]),s++;return new bu(r)}reduce(...n){const[i,r]=n;let s=0,o=r??this.at(0);for(const l of this)s===0&&n.length===1?o=l:o=Reflect.apply(i,this,[o,l,s,this]),s++;return o}reduceRight(...n){const[i,r]=n;let s=r??this.at(-1);for(let o=this.size-1;o>=0;o--){const l=this.at(o);o===this.size-1&&n.length===1?s=l:s=Reflect.apply(i,this,[s,l,o,this])}return s}toSorted(n){const i=[...this.entries()].sort(n);return new bu(i)}toReversed(){const n=new bu;for(let i=this.size-1;i>=0;i--){const r=this.keyAt(i),s=this.get(r);n.set(r,s)}return n}toSpliced(...n){const i=[...this.entries()];return i.splice(...n),new bu(i)}slice(n,i){const r=new bu;let s=this.size-1;if(n===void 0)return r;n<0&&(n=n+this.size),i!==void 0&&i>0&&(s=i-1);for(let o=n;o<=s;o++){const l=this.keyAt(o),c=this.get(l);r.set(l,c)}return r}every(n,i){let r=0;for(const s of this){if(!Reflect.apply(n,i,[s,r,this]))return!1;r++}return!0}some(n,i){let r=0;for(const s of this){if(Reflect.apply(n,i,[s,r,this]))return!0;r++}return!1}},Ha=new WeakMap,Io(bu,"OrderedDict"),bu);function xN(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=vNe(e,t);return n===-1?void 0:e[n]}Io(xN,"at");function vNe(e,t){const n=e.length,i=TV(t),r=i>=0?i:n+i;return r<0||r>=n?-1:r}Io(vNe,"toSafeIndex");function TV(e){return e!==e||e===0?0:Math.trunc(e)}Io(TV,"toSafeInteger");function vlt(e){const t=e+"CollectionProvider",[n,i]=Qc(t),[r,s]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new G3,setItemMap:Io(()=>{},"setItemMap")}),o=Io(({state:x,...k})=>x?a.jsx(c,{...k,state:x}):a.jsx(l,{...k}),"CollectionProvider");o.displayName=t;const l=Io(x=>{const k=v();return a.jsx(c,{...x,state:k})},"CollectionInit");l.displayName=t+"Init";const c=Io(x=>{const{scope:k,children:S,state:O}=x,A=p.useRef(null),[E,j]=p.useState(null),T=Rr(A,j),[R,C]=O;return p.useEffect(()=>{if(!E)return;const N=kNe(()=>{});return N.observe(E,{childList:!0,subtree:!0}),()=>{N.disconnect()}},[E]),a.jsx(r,{scope:k,itemMap:R,setItemMap:C,collectionRef:T,collectionRefObject:A,collectionElement:E,children:S})},"CollectionProviderImpl");c.displayName=t+"Impl";const u=e+"CollectionSlot",d=Yp(u),f=p.forwardRef((x,k)=>{const{scope:S,children:O}=x,A=s(u,S),E=Rr(k,A.collectionRef);return a.jsx(d,{ref:E,children:O})});f.displayName=u;const h=e+"CollectionItemSlot",m="data-radix-collection-item",g=Yp(h),b=p.forwardRef((x,k)=>{const{scope:S,children:O,...A}=x,E=p.useRef(null),[j,T]=p.useState(null),R=Rr(k,E,T),C=s(h,S),{setItemMap:N}=C,P=p.useRef(A);xNe(P.current,A)||(P.current=A);const I=P.current;return p.useEffect(()=>{const D=I;return N(_=>j?_.has(j)?_.set(j,{...D,element:j}).toSorted(pB):(_.set(j,{...D,element:j}),_.toSorted(pB)):_),()=>{N(_=>!j||!_.has(j)?_:(_.delete(j),new G3(_)))}},[j,I,N]),a.jsx(g,{[m]:"",ref:R,children:O})});b.displayName=h;function v(){return p.useState(new G3)}Io(v,"useInitCollection");function y(x){const{itemMap:k}=s(e+"CollectionConsumer",x);return k}return Io(y,"useCollection"),[{Provider:o,Slot:f,ItemSlot:b},{createCollectionScope:i,useCollection:y,useInitCollection:v}]}Io(vlt,"createCollection");function xNe(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}Io(xNe,"shallowEqual");function wNe(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Io(wNe,"isElementPreceding");function pB(e,t){return!e[1].element||!t[1].element?0:wNe(e[1].element,t[1].element)?-1:1}Io(pB,"sortByDocumentPosition");function kNe(e){return new MutationObserver(n=>{for(const i of n)if(i.type==="childList"){e();return}})}Io(kNe,"getChildListObserver");var xlt=Object.defineProperty,G1=(e,t)=>xlt(e,"name",{value:t,configurable:!0}),ONe=!!(typeof window<"u"&&window.document&&window.document.createElement);function Un(e,t,{checkForDefaultPrevented:n=!0}={}){return G1(function(r){if(e==null||e(r),n===!1||!r||!r.defaultPrevented)return t==null?void 0:t(r)},"handleEvent")}G1(Un,"composeEventHandlers");function wlt(e){var t;if(!ONe)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}G1(wlt,"getOwnerWindow");function mB(e){if(!ONe)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}G1(mB,"getOwnerDocument");function SNe(e,t=!1){const{activeElement:n}=mB(e);if(!(n!=null&&n.nodeName))return null;if(ENe(n)&&n.contentDocument)return SNe(n.contentDocument.body,t);if(t){const i=n.getAttribute("aria-activedescendant");if(i){const r=mB(n).getElementById(i);if(r)return r}}return n}G1(SNe,"getActiveElement");function ENe(e){return e.tagName==="IFRAME"}G1(ENe,"isFrame");var Od=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},klt=Object.defineProperty,Olt=(e,t)=>klt(e,"name",{value:t,configurable:!0}),hee=_v[" useEffectEvent ".trim().toString()],pee=_v[" useInsertionEffect ".trim().toString()];function CNe(e){if(typeof hee=="function")return hee(e);const t=p.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof pee=="function"?pee(()=>{t.current=e}):Od(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)},[])}Olt(CNe,"useEffectEvent");var Slt=Object.defineProperty,ZA=(e,t)=>Slt(e,"name",{value:t,configurable:!0}),Elt=_v[" useInsertionEffect ".trim().toString()]||Od;function Id({prop:e,defaultProp:t,onChange:n=ZA(()=>{},"onChange"),caller:i}){const[r,s,o]=ANe({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:r,u=p.useCallback(d=>{var f;if(l){const h=TNe(d)?d(e):d;h!==e&&((f=o.current)==null||f.call(o,h))}else s(d)},[l,e,s,o]);return[c,u]}ZA(Id,"useControllableState");function ANe({defaultProp:e,onChange:t}){const[n,i]=p.useState(e),r=p.useRef(n),s=p.useRef(t);return Elt(()=>{s.current=t},[t]),p.useEffect(()=>{var o;r.current!==n&&((o=s.current)==null||o.call(s,n),r.current=n)},[n,r]),[n,i,s]}ZA(ANe,"useUncontrolledState");function TNe(e){return typeof e=="function"}ZA(TNe,"isFunction");var mee=Symbol("RADIX:SYNC_STATE");function Clt(e,t,n,i){const{prop:r,defaultProp:s,onChange:o,caller:l}=t,c=r!==void 0,u=CNe(o),d=[{...n,state:s}];i&&d.push(i);const[f,h]=p.useReducer((v,y)=>{if(y.type===mee)return{...v,state:y.state};const w=e(v,y);return c&&!Object.is(w.state,v.state)&&u(w.state),w},...d),m=f.state,g=p.useRef(m);p.useEffect(()=>{g.current!==m&&(g.current=m,c||u(m))},[m,g,c]);const b=p.useMemo(()=>r!==void 0?{...f,state:r}:f,[f,r]);return p.useEffect(()=>{c&&!Object.is(r,f.state)&&h({type:mee,state:r})},[r,f.state,c]),[b,h]}ZA(Clt,"useControllableStateReducer");var Alt=Object.defineProperty,Zp=(e,t)=>Alt(e,"name",{value:t,configurable:!0});function _Ne(e,t){return p.useReducer((n,i)=>t[n][i]??n,e)}Zp(_Ne,"useStateMachine");var Rh=Zp(e=>{const{present:t,children:n}=e,i=jNe(t),r=typeof n=="function"?n({present:i.isPresent}):p.Children.only(n),s=NNe(i.ref,RNe(r));return typeof n=="function"||i.isPresent?p.cloneElement(r,{ref:s}):null},"Presence");function jNe(e){const[t,n]=p.useState(),i=p.useRef(null),r=p.useRef(e),s=p.useRef("none"),o=p.useRef(void 0),l=e?"mounted":"unmounted",[c,u]=_Ne(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{c==="mounted"?(s.current=o.current??ox(i.current),o.current=void 0):s.current="none"},[c]),Od(()=>{const d=i.current,f=r.current;if(f!==e){const m=s.current,g=ox(d);e?(o.current=g,u("MOUNT")):g==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,u]),Od(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,h=Zp(g=>{const v=ox(i.current).includes(CSS.escape(g.animationName));if(g.target===t&&v&&(u("ANIMATION_END"),!r.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},"handleAnimationEnd"),m=Zp(g=>{g.target===t&&(s.current=ox(i.current))},"handleAnimationStart");return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:p.useCallback(d=>{if(d){const f=getComputedStyle(d);i.current=f,o.current=ox(f)}else i.current=null;n(d)},[])}}Zp(jNe,"usePresence");function gB(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Zp(gB,"setRef");function NNe(...e){const t=p.useRef(e);return t.current=e,p.useCallback(n=>{const i=t.current;let r=!1;const s=i.map(o=>{const l=gB(o,n);return!r&&typeof l=="function"&&(r=!0),l});if(r)return()=>{for(let o=0;oTlt(e,"name",{value:t,configurable:!0}),jlt=_v[" useId ".trim().toString()]||(()=>{}),Nlt=0;function Jg(e){const[t,n]=p.useState(jlt());return Od(()=>{e||n(i=>i??String(Nlt++))},[e]),e||(t?`radix-${t}`:"")}_lt(Jg,"useId");var Rlt=Object.defineProperty,Ilt=(e,t)=>Rlt(e,"name",{value:t,configurable:!0}),Plt=p.createContext(void 0);function JA(e){const t=p.useContext(Plt);return e||t||"ltr"}Ilt(JA,"useDirection");var Dlt=Object.defineProperty,Mlt=(e,t)=>Dlt(e,"name",{value:t,configurable:!0});function yf(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)},[])}Mlt(yf,"useCallbackRef");var Llt=Object.defineProperty,No=(e,t)=>Llt(e,"name",{value:t,configurable:!0}),bB="dismissableLayer.update",$lt="dismissableLayer.pointerDownOutside",Flt="dismissableLayer.focusOutside",gee,INe=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),_V=p.forwardRef(No(function(t,n){const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:c,onDismiss:u,...d}=t,f=p.useContext(INe),[h,m]=p.useState(null),g=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=p.useState({}),v=Rr(n,m),y=Array.from(f.layers),[w]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),x=w?y.indexOf(w):-1,k=h?y.indexOf(h):-1,S=f.layersWithOutsidePointerEventsDisabled.size>0,O=k>=x,A=p.useRef(!1),E=PNe(C=>{o==null||o(C),c==null||c(C),C.defaultPrevented||u==null||u()},{ownerDocument:g,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:A,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:p.useCallback(C=>{if(!(C instanceof Node))return!1;const N=[...f.branches].some(P=>P.contains(C));return O&&!N},[f.branches,O])}),j=DNe(C=>{if(r&&A.current)return;const N=C.target;[...f.branches].some(I=>I.contains(N))||(l==null||l(C),c==null||c(C),C.defaultPrevented||u==null||u())},g),T=h?k===y.length-1:!1,R=yf(C=>{C.key==="Escape"&&(s==null||s(C),!C.defaultPrevented&&u&&(C.preventDefault(),u()))});return p.useEffect(()=>{if(T)return g.addEventListener("keydown",R,{capture:!0}),()=>g.removeEventListener("keydown",R,{capture:!0})},[g,T,R]),p.useEffect(()=>{if(h)return i&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(gee=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),yB(),()=>{i&&(f.layersWithOutsidePointerEventsDisabled.delete(h),f.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=gee))}},[h,g,i,f]),p.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),yB())},[h,f]),p.useEffect(()=>{const C=No(()=>b({}),"handleUpdate");return document.addEventListener(bB,C),()=>document.removeEventListener(bB,C)},[]),a.jsx(Jr.div,{...d,ref:v,style:{pointerEvents:S?O?"auto":"none":void 0,...t.style},onFocusCapture:Un(t.onFocusCapture,j.onFocusCapture),onBlurCapture:Un(t.onBlurCapture,j.onBlurCapture),onPointerDownCapture:Un(t.onPointerDownCapture,E.onPointerDownCapture)})},"DismissableLayer"));function Blt(){const e=p.useContext(INe),[t,n]=p.useState(null);return p.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}No(Blt,"useDismissableLayerSurface");var Ult=No(()=>!0,"IS_TRUE");function PNe(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:r,dismissableSurfaces:s,shouldHandlePointerDownOutside:o=Ult}=t,l=yf(e),c=p.useRef(!1),u=p.useRef(!1),d=p.useRef(new Map),f=p.useRef(()=>{});return p.useEffect(()=>{function h(){u.current=!1,r.current=!1,d.current.clear()}No(h,"resetOutsideInteraction");function m(){return Array.from(d.current.values()).some(Boolean)}No(m,"isOutsideInteractionIntercepted");function g(x){if(!u.current)return;const k=x.target;k instanceof Node&&[...s].some(O=>O.contains(k))||d.current.set(x.type,!0),x.type==="click"&&window.setTimeout(()=>{u.current&&f.current()},0)}No(g,"handleInteractionCapture");function b(x){u.current&&d.current.set(x.type,!1)}No(b,"handleInteractionBubble");const v=No(x=>{if(x.target&&!c.current){let k=function(){n.removeEventListener("click",f.current);const O=m();h(),O||jV($lt,l,S,{discrete:!0})};if(No(k,"handleAndDispatchPointerDownOutsideEvent"),!o(x.target)){n.removeEventListener("click",f.current),h(),c.current=!1;return}const S={originalEvent:x};u.current=!0,r.current=i&&x.button===0,d.current.clear(),!i||x.button!==0?k():(n.removeEventListener("click",f.current),f.current=k,n.addEventListener("click",f.current,{once:!0}))}else n.removeEventListener("click",f.current),h();c.current=!1},"handlePointerDown"),y=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const x of y)n.addEventListener(x,g,!0),n.addEventListener(x,b);const w=window.setTimeout(()=>{n.addEventListener("pointerdown",v)},0);return()=>{window.clearTimeout(w),n.removeEventListener("pointerdown",v),n.removeEventListener("click",f.current);for(const x of y)n.removeEventListener(x,g,!0),n.removeEventListener(x,b)}},[n,l,i,r,s,o]),{onPointerDownCapture:No(()=>c.current=!0,"onPointerDownCapture")}}No(PNe,"usePointerDownOutside");function DNe(e,t=globalThis==null?void 0:globalThis.document){const n=yf(e),i=p.useRef(!1);return p.useEffect(()=>{const r=No(s=>{s.target&&!i.current&&jV(Flt,n,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:No(()=>i.current=!0,"onFocusCapture"),onBlurCapture:No(()=>i.current=!1,"onBlurCapture")}}No(DNe,"useFocusOutside");function yB(){const e=new CustomEvent(bB);document.dispatchEvent(e)}No(yB,"dispatchUpdate");function jV(e,t,n,{discrete:i}){const r=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),i?CV(r,s):r.dispatchEvent(s)}No(jV,"handleAndDispatchCustomEvent");var Qlt=Object.defineProperty,tc=(e,t)=>Qlt(e,"name",{value:t,configurable:!0}),X3="focusScope.autoFocusOnMount",Y3="focusScope.autoFocusOnUnmount",bee={bubbles:!1,cancelable:!0},MNe=p.forwardRef(tc(function(t,n){const{loop:i=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...l}=t,[c,u]=p.useState(null),d=yf(s),f=yf(o),h=p.useRef(null),m=Rr(n,u),g=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let v=function(k){if(g.paused||!c)return;const S=k.target;c.contains(S)?h.current=S:pp(h.current,{select:!0})},y=function(k){if(g.paused||!c)return;const S=k.relatedTarget;S!==null&&(c.contains(S)||pp(h.current,{select:!0}))},w=function(k){if(document.activeElement===document.body)for(const O of k)O.removedNodes.length>0&&pp(c)};tc(v,"handleFocusIn"),tc(y,"handleFocusOut"),tc(w,"handleMutations"),document.addEventListener("focusin",v),document.addEventListener("focusout",y);const x=new MutationObserver(w);return c&&x.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",y),x.disconnect()}}},[r,c,g.paused]),p.useEffect(()=>{if(c){yee.add(g);const v=document.activeElement;if(!c.contains(v)){const w=new CustomEvent(X3,bee);c.addEventListener(X3,d),c.dispatchEvent(w),w.defaultPrevented||(LNe(QNe(NV(c)),{select:!0}),document.activeElement===v&&pp(c))}return()=>{c.removeEventListener(X3,d),setTimeout(()=>{const w=new CustomEvent(Y3,bee);c.addEventListener(Y3,f),c.dispatchEvent(w),w.defaultPrevented||pp(v??document.body,{select:!0}),c.removeEventListener(Y3,f),yee.remove(g)},0)}}},[c,d,f,g]);const b=p.useCallback(v=>{if(!i&&!r||g.paused)return;const y=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,w=document.activeElement;if(y&&w){const x=v.currentTarget,[k,S]=$Ne(x);k&&S?!v.shiftKey&&w===S?(v.preventDefault(),i&&pp(k,{select:!0})):v.shiftKey&&w===k&&(v.preventDefault(),i&&pp(S,{select:!0})):w===x&&v.preventDefault()}},[i,r,g.paused]);return a.jsx(Jr.div,{tabIndex:-1,...l,ref:m,onKeyDown:b})},"FocusScope"));function LNe(e,{select:t=!1}={}){const n=document.activeElement;for(const i of e)if(pp(i,{select:t}),document.activeElement!==n)return}tc(LNe,"focusFirst");function $Ne(e){const t=NV(e),n=vB(t,e),i=vB(t.reverse(),e);return[n,i]}tc($Ne,"getTabbableEdges");function NV(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:tc(i=>{const r=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||r?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}tc(NV,"getTabbableCandidates");function vB(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const i of e)if(!(n?!i.checkVisibility({checkVisibilityCSS:!0}):FNe(i,{upTo:t})))return i}tc(vB,"findVisible");function FNe(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}tc(FNe,"isHidden");function BNe(e){return e instanceof HTMLInputElement&&"select"in e}tc(BNe,"isSelectableInput");function pp(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&BNe(e)&&t&&e.select()}}tc(pp,"focus");var yee=UNe();function UNe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=xB(e,t),e.unshift(t)},remove(t){var n;e=xB(e,t),(n=e[0])==null||n.resume()}}}tc(UNe,"createFocusScopesStack");function xB(e,t){const n=[...e],i=n.indexOf(t);return i!==-1&&n.splice(i,1),n}tc(xB,"arrayRemove");function QNe(e){return e.filter(t=>t.tagName!=="A")}tc(QNe,"removeLinks");var zlt=Object.defineProperty,Vlt=(e,t)=>zlt(e,"name",{value:t,configurable:!0}),RV=p.forwardRef(Vlt(function(t,n){var c;const{container:i,...r}=t,[s,o]=p.useState(!1);Od(()=>o(!0),[]);const l=i||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return l?vi.createPortal(a.jsx(Jr.div,{...r,ref:n}),l):null},"Portal")),Hlt=Object.defineProperty,IV=(e,t)=>Hlt(e,"name",{value:t,configurable:!0}),c_=0,Uf=null;function qlt(e){return nM(),e.children}IV(qlt,"FocusGuards");function nM(){p.useEffect(()=>{Uf||(Uf={start:wB(),end:wB()});const{start:e,end:t}=Uf;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),c_++,()=>{c_===1&&(Uf==null||Uf.start.remove(),Uf==null||Uf.end.remove(),Uf=null),c_=Math.max(0,c_-1)}},[])}IV(nM,"useFocusGuards");function wB(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}IV(wB,"createFocusGuard");var eh=function(){return eh=Object.assign||function(t){for(var n,i=1,r=arguments.length;i"u")return cct;var t=uct(e),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,i-n+t[2]-t[0])}},fct=qNe(),uw="data-scroll-locked",hct=function(e,t,n,i){var r=e.left,s=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),` - .`.concat(Klt,` { + */const Bo=Cn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),eee=Object.freeze({totalTokenCount:0,promptTokenCount:0,candidatesTokenCount:0,thoughtsTokenCount:0,cachedContentTokenCount:0}),oE=Object.freeze({modelName:"",current:eee,cumulative:eee}),iot={totalTokenCount:"total_token_count",promptTokenCount:"prompt_token_count",candidatesTokenCount:"candidates_token_count",thoughtsTokenCount:"thoughts_token_count",cachedContentTokenCount:"cached_content_token_count"},rot=24,sot=64,aot=16;function a_(e){var l,c;const t=e.trim();if(!t)return 0;const n=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/gu,i=((l=t.match(n))==null?void 0:l.length)??0,r=t.replace(n," "),s=(r.match(/[A-Za-z0-9_]+/g)??[]).reduce((u,d)=>u+Math.max(1,Math.ceil(d.length/4)),0),o=((c=r.match(/[^\sA-Za-z0-9_]/g))==null?void 0:c.length)??0;return i+s+o}function oot(e){var l,c,u;const t=((l=e.instruction)==null?void 0:l.trim())??"",n=((c=e.tools)==null?void 0:c.filter(d=>d.trim()))??[],i=((u=e.skills)==null?void 0:u.filter(d=>d.name.trim()))??[],r=a_(t),s=n.reduce((d,f)=>d+sot+a_(f),0),o=i.reduce((d,f)=>d+aot+a_(f.name)+a_(f.description??""),0);return rot+r+s+o}function lot({usage:e,contextWindow:t,estimatedSystemTokens:n}){const i=Math.max(1,Math.round(t)),r=Math.max(0,e.current.promptTokenCount),s=Math.max(r,e.current.totalTokenCount),o=Math.min(i,r>0?Math.min(r,Math.max(0,n??0)):Math.max(0,n??0)),l=Math.max(0,r-o),c=r>0?Math.max(0,s-r):Math.max(0,s),u=r>0?s:o+c;return{systemTokens:o,inputTokens:l,outputTokens:c,remainingTokens:Math.max(0,i-u),usedTokens:u,contextWindow:i}}function cot(e){const t=[{kind:"system",tokens:e.systemTokens},{kind:"input",tokens:e.inputTokens},{kind:"output",tokens:e.outputTokens},{kind:"remaining",tokens:e.remainingTokens}],n=e.contextWindow/100;let i=0;const r=t.map(s=>{const o=i;return i+=s.tokens,{...s,start:o,end:i}});return Array.from({length:100},(s,o)=>{const l=o*n,c=l+n,u=r.flatMap(d=>{const f=Math.max(0,Math.min(c,d.end)-Math.max(l,d.start));return f>0?[{kind:d.kind,share:f/n}]:[]});return{index:o,slices:u}})}function pO(e,t){const n=e,i=n[t]??n[iot[t]];return typeof i=="number"&&Number.isFinite(i)&&i>0?Math.round(i):0}function uot(e){const t=pO(e,"promptTokenCount"),n=pO(e,"candidatesTokenCount"),i=pO(e,"thoughtsTokenCount");return{totalTokenCount:pO(e,"totalTokenCount")||t+n+i,promptTokenCount:t,candidatesTokenCount:n,thoughtsTokenCount:i,cachedContentTokenCount:pO(e,"cachedContentTokenCount")}}function dot(e,t){return{totalTokenCount:e.totalTokenCount+t.totalTokenCount,promptTokenCount:e.promptTokenCount+t.promptTokenCount,candidatesTokenCount:e.candidatesTokenCount+t.candidatesTokenCount,thoughtsTokenCount:e.thoughtsTokenCount+t.thoughtsTokenCount,cachedContentTokenCount:e.cachedContentTokenCount+t.cachedContentTokenCount}}function vV(e,t){if(!t)return e;const n=typeof t.modelVersion=="string"?t.modelVersion.trim():"",i=typeof t.model_version=="string"?t.model_version.trim():"",r=n||i||e.modelName,s=t.usageMetadata??t.usage_metadata;if(!s)return r===e.modelName?e:{...e,modelName:r};const o=uot(s);return o.totalTokenCount===0?r===e.modelName?e:{...e,modelName:r}:{modelName:r,current:o,cumulative:dot(e.cumulative,o)}}function tee(e){return e.reduce((t,n)=>vV(t,n),oE)}function nee(e){return e.blocks.flatMap(t=>t.kind==="tool"?[{name:t.name,args:t.args,response:t.response,done:t.done}]:[])}function fot(e){const t=e.attributes;return String(t["invocation.id"]??t["gen_ai.invocation.id"]??t["gcp.vertex.agent.invocation_id"]??"")}function hot(e,t){if(!t)return e;const n=new Set(e.filter(r=>fot(r)===t).map(r=>r.trace_id)),i=e.filter(r=>n.has(r.trace_id));return i.length>0?i:e}function dv(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function mg(e){return typeof e=="string"?e:""}function Kje(e,t){return e==="pending"||e==="running"||e==="completed"||e==="failed"?e:t}function pot(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return{}}const n=dv(t)??{};return dv(n.result)??n}function mot(e){var n;const t=(n=dv(e))==null?void 0:n.branches;return Array.isArray(t)?t.map(i=>{var r;return mg((r=dv(i))==null?void 0:r.label)}):[]}function Gje(e,t,n){const i=mot(e),r=pot(t),s=Array.isArray(r.branches)?r.branches:[],o=n==="running"?"running":"pending";return{branches:[0,1].map(c=>{const u=dv(s[c])??{};return{label:mg(u.label)||i[c]||`方向 ${c+1}`,content:mg(u.content),status:Kje(u.status,o),error:mg(u.error)}})}}function got(e){const t=dv(e),n=dv(t==null?void 0:t.veadkStudioToolProgress);return!n||n.toolName!=="branch_compare"||typeof n.branchIndex!="number"||n.branchIndex<0||n.branchIndex>1?null:{toolName:"branch_compare",requestId:mg(n.requestId),branchIndex:n.branchIndex,label:mg(n.label),delta:mg(n.delta),status:Kje(n.status,"running"),error:mg(n.error)||void 0}}function bot(e,t,n){return{branches:Gje(e,t,"running").branches.map((s,o)=>o===n.branchIndex?{...s,label:n.label||s.label,content:s.content+n.delta,status:n.status,error:n.error??s.error}:s)}}function Yo(e,t){return bn.t(`blocks.codexProgress.${e}`,{ns:"conversation",...t})}const Xje=28e4;function iee(e){try{return JSON.stringify(e).length}catch{return Xje}}function yot(e){const t=e.slice(-200);let n=t.reduce((i,r)=>i+iee(r),0);for(;t.length>1&&n>Xje;)n-=iee(t.shift());return t}function Cu(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function ir(e){return typeof e=="string"?e:""}function xV(e,t=""){const n=ir(e).toLowerCase();return t.endsWith(".failed")||["failed","error","declined","cancelled"].includes(n)?"failed":t.endsWith(".completed")||["completed","done","success"].includes(n)?"completed":"running"}function Yje(e){if(e.response!==void 0)return e.response;if(e.result!==void 0)return e.result;const t=e.aggregatedOutput??e.aggregated_output??e.output,n=e.exitCode??e.exit_code;if(!(t===void 0&&n===void 0))return{...t!==void 0?{output:t}:{},...n!==void 0?{exitCode:n}:{}}}function Zje(e){if(e.args!==void 0)return e.args;if(e.arguments!==void 0)return e.arguments;if(e.input!==void 0)return e.input;const t=ir(e.command),n=ir(e.cwd);if(t||n)return{...t?{command:t}:{},...n?{cwd:n}:{}};if(e.changes!==void 0)return{changes:e.changes};if(e.approval!==void 0)return e.approval}function uy(e,t,n,i,r){return{kind:"tool",name:e,callId:t,args:i,response:r,done:n!=="running",status:n,...n==="failed"?{defaultOpen:!0}:{}}}function Jje(e){const t=ir(e.id||e.itemId||e.item_id),n=ir(e.kind);if(!t||!n)return null;const i=xV(e.status),r=ir(e.text||e.detail||e.delta),s=!ir(e.text||e.detail)&&typeof e.delta=="string";if(n==="thinking"||n==="reasoning")return r?{id:t,block:{kind:"thinking",text:r,done:i!=="running",thoughtKind:n==="reasoning"?"reasoning":"thought"},appendText:s}:null;if(n==="commentary")return r?{id:t,block:{kind:"text",text:r},appendText:s}:null;if(["message","text","assistant_final","final"].includes(n))return r?{id:t,block:{kind:"text",text:r},appendText:s,finalAnswer:!0}:null;if(n==="plan"){const o=Array.isArray(e.plan)?e.plan:[];return{id:t,block:{kind:"plan",title:ir(e.title)||Yo("planTitle"),summary:r||void 0,items:o.flatMap(l=>{const c=Cu(l),u=ir(c==null?void 0:c.text);if(!u)return[];const d=ir(c==null?void 0:c.status);return[{text:u,status:["pending","in_progress","completed","failed"].includes(d)?d:"pending"}]}),done:i!=="running"}}}if(["tool","command","command_execution","commandExecution","file_change","fileChange","mcp_tool_call","mcpToolCall","collab_tool_call","web_search","approval","status"].includes(n)){const o=Yo(n==="file_change"||n==="fileChange"?"fallback.fileChange":n==="approval"?"fallback.approval":n==="status"?"fallback.status":"fallback.command"),l=Zje(e),c=Yje(e)??(n==="status"&&r||void 0);return{id:t,block:uy(ir(e.name||e.title)||o,t,i,l,c)}}return null}function eNe(e){const t=ir(e.type),n=Cu(e.item),i=ir(n==null?void 0:n.type),r=ir((n==null?void 0:n.id)||e.id)||(t==="turn.failed"?"turn":"");if(!r)return null;const s=xV(n==null?void 0:n.status,t);if(i==="reasoning"||i==="agent_message"){const o=ir(n==null?void 0:n.text);return o?{id:r,block:i==="reasoning"?{kind:"thinking",text:o,done:s!=="running",thoughtKind:"reasoning"}:{kind:"text",text:o},...i==="agent_message"&&(n==null?void 0:n.phase)!=="commentary"?{finalAnswer:!0}:{}}:null}if(i==="todo_list"){const l=(Array.isArray(n==null?void 0:n.items)?n.items:[]).flatMap(c=>{const u=Cu(c),d=ir(u==null?void 0:u.text);if(!d)return[];const f=ir(u==null?void 0:u.status).toLowerCase(),h=(u==null?void 0:u.completed)===!0||["completed","done"].includes(f)?"completed":["failed","error"].includes(f)?"failed":["in_progress","running"].includes(f)?"in_progress":"pending";return[{text:d,status:h}]});return l.length?{id:r,block:{kind:"plan",title:Yo("planTitle"),summary:Yo("planSummary",{completed:l.filter(c=>c.status==="completed").length,total:l.length}),items:l,done:s!=="running"}}:null}if(i==="command_execution"){const o=Yo(`command.${s}`);return{id:r,block:uy(o,r,s,Zje(n??{}),Yje(n??{}))}}if(i==="file_change"){const o=Array.isArray(n==null?void 0:n.changes)?n.changes:[],l=o.length?Yo("projectFiles",{count:o.length}):Yo("projectFile"),c=Yo(`fileChange.${s}`,{subject:l});return{id:r,block:uy(c,r,s,o.length?{changes:o}:void 0)}}if(i==="mcp_tool_call"){const o=[ir(n==null?void 0:n.server),ir(n==null?void 0:n.tool)].filter(Boolean).join("/")||Yo("externalTool"),l=Yo(`mcp.${s}`,{tool:o}),c=Cu(n==null?void 0:n.error),u=(n==null?void 0:n.result)!==void 0?n.result:ir(c==null?void 0:c.message)||void 0;return{id:r,block:uy(l,r,s,n==null?void 0:n.arguments,u)}}if(i==="collab_tool_call"){const o=ir(n==null?void 0:n.tool),l=["spawn_agent","send_input","wait","close_agent"].includes(o)?o:"default",c=Yo(`collaboration.${l}.${s}`),u=Object.fromEntries(["tool","receiver_thread_ids","prompt"].filter(d=>(n==null?void 0:n[d])!==void 0).map(d=>[d,n==null?void 0:n[d]]));return{id:r,block:uy(c,r,s,Object.keys(u).length?u:void 0,n==null?void 0:n.agents_states)}}if(i==="web_search"){const o=Yo(`webSearch.${s}`),l=Object.fromEntries(["query","action"].filter(c=>(n==null?void 0:n[c])!==void 0).map(c=>[c,n==null?void 0:n[c]]));return{id:r,block:uy(o,r,s,Object.keys(l).length?l:void 0)}}if(i==="error"||t==="error"||t==="turn.failed"){const o=Cu(e.error),l=ir((n==null?void 0:n.message)||e.message||(o==null?void 0:o.message))||Yo("errorDetail");return{id:r,block:uy(Yo("errorTitle"),r,"failed",void 0,l)}}return null}function vot(e){const t=Cu(e),n=Cu(t==null?void 0:t.veadkStudioToolProgress);if(!n||n.kind!=="codex")return null;const i=ir(n.toolName),r=ir(n.requestId);if(!i||!r)return null;const s=Cu(n.event??n.activity);if(!s)return null;const o=Cu(s.item)||ir(s.type)?eNe(s):Jje(s);if(!o)return null;const l=ir(n.title||n.label),c=ir(s.agentSessionId??s.agent_session_id),u=ir(s.sandboxSessionId??s.sandbox_session_id),d=ir(s.threadId??s.thread_id),f=xV(s.status,ir(s.type)),m=ir(s.kind)==="status"&&f!=="running"?f:void 0;return{toolName:i,requestId:r,...l?{title:l}:{},...c?{agentSessionId:c}:{},...u?{sandboxSessionId:u}:{},...d?{threadId:d}:{},...m?{terminalStatus:m}:{},event:o}}function xot(e,t){const n=Cu(t),i=Cu((n==null?void 0:n.codexActivity)??(n==null?void 0:n.codex_activity));if(!i)return e;const r=ir(i.title)||(e==null?void 0:e.title)||"Codex Sandbox",s=ir(i.agentSessionId??i.agent_session_id)||(e==null?void 0:e.agentSessionId),o=ir(i.sandboxSessionId??i.sandbox_session_id)||(e==null?void 0:e.sandboxSessionId),l=ir(i.threadId??i.thread_id)||(e==null?void 0:e.threadId);let c={title:r,...s?{agentSessionId:s}:{},...o?{sandboxSessionId:o}:{},...l?{threadId:l}:{},items:(e==null?void 0:e.items.slice())??[]};const u=Array.isArray(i.events)?i.events:[];for(const d of u){const f=Cu(d);if(!f)continue;const h=Cu(f.item)||ir(f.type)?eNe(f):Jje(f);h&&(h.finalAnswer||(c=lB(c,{title:r,...s?{agentSessionId:s}:{},...o?{sandboxSessionId:o}:{},...l?{threadId:l}:{},event:h})))}return c}function lB(e,t){const n=(e==null?void 0:e.items.slice())??[],i=n.findIndex(r=>r.id===t.event.id);if(i>=0){const r=n[i].block,s=t.event.block;t.event.appendText&&r.kind==="text"&&s.kind==="text"?n[i]={id:t.event.id,block:{...s,text:r.text+s.text}}:t.event.appendText&&r.kind==="thinking"&&s.kind==="thinking"?n[i]={id:t.event.id,block:{...s,text:r.text+s.text}}:n[i]={id:t.event.id,block:s}}else n.push({id:t.event.id,block:t.event.block});return{title:t.title||(e==null?void 0:e.title)||"Codex Sandbox",...t.agentSessionId||e!=null&&e.agentSessionId?{agentSessionId:t.agentSessionId||(e==null?void 0:e.agentSessionId)}:{},...t.sandboxSessionId||e!=null&&e.sandboxSessionId?{sandboxSessionId:t.sandboxSessionId||(e==null?void 0:e.sandboxSessionId)}:{},...t.threadId||e!=null&&e.threadId?{threadId:t.threadId||(e==null?void 0:e.threadId)}:{},items:yot(n)}}const cB="send_a2ui_json_to_client",uB="validated_a2ui_json",yN="adk_request_credential",Q3="transfer_to_agent";function wot(e){var i,r,s,o;const t=e,n=((i=t==null?void 0:t.exchangedAuthCredential)==null?void 0:i.oauth2)??((r=t==null?void 0:t.exchanged_auth_credential)==null?void 0:r.oauth2)??((s=t==null?void 0:t.rawAuthCredential)==null?void 0:s.oauth2)??((o=t==null?void 0:t.raw_auth_credential)==null?void 0:o.oauth2);return(n==null?void 0:n.authUri)??(n==null?void 0:n.auth_uri)}function dB(){return{blocks:[],liveStart:0,pendingCodexProgress:[]}}const kot=2048;function ree(e,t){if(t.event.finalAnswer)return"applied";let n=-1;for(let i=e.length-1;i>=0;i-=1){const r=e[i];if(!(r.kind!=="tool"||r.name!==t.toolName)){if(r.callId===t.requestId)return r.done?"completed":(r.codexActivity=lB(r.codexActivity,t),r.status=t.terminalStatus??"running",t.terminalStatus&&(r.done=!0),"applied");if(!r.done){if(n>=0)return"unmatched";n=i}}}if(n>=0){const i=e[n];return i.kind!=="tool"?"unmatched":(i.codexActivity=lB(i.codexActivity,t),i.status=t.terminalStatus??"running",t.terminalStatus&&(i.done=!0),"applied")}return"unmatched"}function Oot(e){if(!e||typeof e!="object"||Array.isArray(e))return"completed";const t=e,n=typeof t.status=="string"?t.status.toLowerCase():"";return t.ok===!1||["error","failed","denied","declined","cancelled","timeout"].includes(n)?"failed":"completed"}function see(e){if(!e||typeof e!="object"||Array.isArray(e))return"";const t=e;return t.ok!==!0||typeof t.message!="string"?"":t.message.trim()}const bC=e=>e.functionCall??e.function_call,Zg=e=>e.functionResponse??e.function_response;function K1(e){const t=e.customMetadata??e.custom_metadata;return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function Sot(e,t){const n=e[t];return n&&typeof n=="object"&&!Array.isArray(n)?n:{}}function rg(e,t){const n=e[t];return typeof n=="string"?n:""}function tNe(e){return Sot(K1(e),"mpa")}function wV(e){const t=K1(e),n=tNe(e);return rg(t,"eventType")||rg(t,"event_type")||rg(n,"eventType")||rg(n,"event_type")||rg(n,"kind")}function lw(e){const t=K1(e),n=tNe(e);return rg(t,"source")==="sandbox"||rg(n,"source")==="sandbox"}function nNe(e){const t=wV(e);return t==="usage.updated"||t==="usage"}function fI(e){var t;return(((t=e.content)==null?void 0:t.parts)??[]).some(n=>{const i=Zg(n),r=i==null?void 0:i.response;return(i==null?void 0:i.name)==="sandbox_task"&&r&&typeof r=="object"&&!Array.isArray(r)&&r.finalAlreadyEmitted===!0})}function aee(e){for(const t of e)t.kind!=="tool"||t.name!=="sandbox_task"||t.done||(t.done=!0,t.status="completed")}function Eot(e,t){if(e===t)return!0;const n=new Set(["exec_command","commandExecution","command_execution","Run command"]);return n.has(e)&&n.has(t)}function oee(e,t=!1){const n=e&&typeof e=="object"?String(e.status??"").toLowerCase():"",i=["failed","error","cancelled","denied","timeout"].includes(n)||(e==null?void 0:e.ok)===!1,r=["running","started","working"].includes(n);return{done:i||!(t||r),status:i?"failed":t||r?"running":"completed"}}function Cot(e){return e.flatMap(t=>{var n;return t.kind!=="tool"||t.name!=="delegate_to_codex_sandbox"||!((n=t.codexActivity)!=null&&n.items.length)?[t]:[{kind:"activity-source",label:t.codexActivity.title||"Codex Sandbox"},...t.codexActivity.items.map(({block:i})=>i.kind==="tool"?{...i,source:"codex-sandbox"}:i)]})}function Aot(e){if(!e||typeof e!="object")return"";const t=e,n=t.agentName??t.agent_name;return typeof n=="string"?n:""}function Tot(e){return e.replace(/-/g,"+").replace(/_/g,"/")}function XA(e){const t=[];for(const[n,i]of e.entries()){const r=i.partMetadata??i.part_metadata,s=r==null?void 0:r.veadkTransport;if((s==null?void 0:s.hidden)===!0)continue;const o=r==null?void 0:r.veadkMedia;if(typeof(o==null?void 0:o.uri)=="string"){t.push({id:String(o.id??o.uri),mimeType:typeof o.mimeType=="string"?o.mimeType:void 0,uri:o.uri,name:typeof o.name=="string"?o.name:void 0,sizeBytes:typeof o.sizeBytes=="number"?o.sizeBytes:void 0});continue}const l=i.inlineData??i.inline_data;if(l&&l.data){t.push({id:`inline-${n}-${l.displayName??l.display_name??"media"}`,mimeType:l.mimeType??l.mime_type,data:Tot(l.data),name:l.displayName??l.display_name});continue}const c=i.fileData??i.file_data,u=(c==null?void 0:c.fileUri)??(c==null?void 0:c.file_uri);c&&u&&t.push({id:u,mimeType:c.mimeType??c.mime_type,uri:u,name:c.displayName??c.display_name})}return t}function Hy(e){const t=e.partMetadata??e.part_metadata,n=t==null?void 0:t.veadkTransport;return(n==null?void 0:n.hideText)===!0?void 0:e.text}const _ot=new Set(["llm","sequential","parallel","loop","a2a"]);function jot(e){var t;for(const n of e){const i=(t=n.partMetadata??n.part_metadata)==null?void 0:t.veadkInvocation;if(!i||typeof i!="object")continue;const r=i,s=Array.isArray(r.skills)?r.skills.flatMap(c=>{if(!c||typeof c!="object")return[];const u=c;return typeof u.name=="string"?[{name:u.name,description:typeof u.description=="string"?u.description:""}]:[]}):[];let o;const l=r.targetAgent;if(l&&typeof l=="object"){const c=l,u=c.type;typeof c.name=="string"&&typeof u=="string"&&_ot.has(u)&&Array.isArray(c.path)&&(o={name:c.name,description:typeof c.description=="string"?c.description:"",type:u,path:c.path.filter(d=>typeof d=="string")})}if(s.length>0||o)return{skills:s,targetAgent:o}}}function Not(e,t){if(!t.length)return;const n=e[e.length-1];(n==null?void 0:n.kind)==="attachment"?n.files.push(...t):e.push({kind:"attachment",files:t})}function Rot(e,t){if(!t.length)return;const n=e[e.length-1];if((n==null?void 0:n.kind)==="artifact"){for(const i of t)n.files.some(r=>r.filename===i.filename&&r.version===i.version)||n.files.push(i);return}e.push({kind:"artifact",files:t})}function z3(e,t,n,i){const r=e[e.length-1];r&&r.kind===t&&(r.kind!=="thinking"||r.thoughtKind===i)?r.text+=n:e.push(t==="thinking"?{kind:t,text:n,done:!1,thoughtKind:i}:{kind:t,text:n})}function V3(e){const t=e.customMetadata??e.custom_metadata;if(t&&typeof t=="object"){const n=t.thoughtKind;if(n==="reasoning"||n==="thought")return n}return"reasoning"}function mO(e){for(const t of e)t.kind==="thinking"&&(t.done=!0)}function iNe(e,t,n={}){var h,m,g,b,v,y;const i=e.blocks.map(w=>({...w}));let r=e.liveStart,s=e.pendingCodexProgress.slice();if(nNe(t)&&!n.mpaA2a)return{blocks:i,liveStart:r,pendingCodexProgress:s};if(fI(t))return aee(i),mO(i),{blocks:i,liveStart:r,pendingCodexProgress:s};const o=((h=t.content)==null?void 0:h.parts)??[],l=o.flatMap(w=>{const x=got(w.partMetadata??w.part_metadata);return x?[x]:[]}),c=o.flatMap(w=>{const x=vot(w.partMetadata??w.part_metadata);return x?[x]:[]});if(l.length>0||c.length>0){for(const w of l)for(let x=i.length-1;x>=0;x-=1){const k=i[x];if(!(k.kind!=="tool"||k.done||k.name!==w.toolName||w.requestId&&k.callId&&k.callId!==w.requestId)){k.response=bot(k.args,k.response,w),k.status="running";break}}for(const w of c)ree(i,w)==="unmatched"&&(s=[...s,w].slice(-64));return{blocks:i,liveStart:r,pendingCodexProgress:s}}const u=o.some(w=>bC(w)||Zg(w));if(t.partial&&!u){for(const w of o){const x=Hy(w),k=n.mpaA2a&&w.thought?rg(K1(t),"reasoningSegmentId"):"";if(k&&typeof x=="string"&&x){const S=i.find(O=>O.kind==="thinking"&&O.reasoningSegmentId===k);(S==null?void 0:S.kind)==="thinking"?S.text+=x:i.push({kind:"thinking",text:x,done:!1,thoughtKind:V3(t),reasoningSegmentId:k});continue}typeof x=="string"&&x&&z3(i,w.thought?"thinking":"text",x,w.thought?V3(t):void 0)}return{blocks:i,liveStart:r,pendingCodexProgress:s}}const d=n.mpaA2a&&!o.some(w=>w.thought&&Hy(w))?i.slice(r).filter(w=>w.kind==="thinking"):[];i.length=r,i.push(...d);for(const w of o){const x=bC(w),k=Zg(w),S=XA([w]),O=Hy(w);if(typeof O=="string"&&O)z3(i,w.thought?"thinking":"text",O,w.thought?V3(t):void 0);else if(S.length)mO(i),Not(i,S);else if(x)if(mO(i),x.name===Q3){const A=Aot(x.args)||((m=t.actions)==null?void 0:m.transferToAgent)||((g=t.actions)==null?void 0:g.transfer_to_agent)||bn.t("app:common.unknownAgent");i.push({kind:"agent-transfer",agentName:A,done:!1})}else{if(x.name==="sandbox_task"&&lw(t))continue;if(x.name===yN){const A=x.args??{},E=A.authConfig??A.auth_config??A,T=String(A.functionCallId??A.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;i.push({kind:"auth",callId:x.id??"",label:T,authUri:wot(E),authConfig:E,done:!1})}else{const A=x.id?[...i].reverse().find(j=>j.kind==="tool"&&j.callId===x.id):void 0;if((A==null?void 0:A.kind)==="tool"){A.name=x.name??A.name,A.args=x.args??A.args,A.response===void 0&&(A.done=!1,A.status="running");continue}const E={kind:"tool",name:x.name??"",callId:x.id,args:x.args,done:!1};if(i.push(E),E.callId){const j=[];for(const T of s)T.toolName===E.name&&T.requestId===E.callId?ree(i,T):j.push(T);s=j}}}else if(k){if(mO(i),k.name===Q3)for(let E=i.length-1;E>=0;E--){const j=i[E];if(j.kind==="agent-transfer"&&!j.done){j.done=!0;break}}if(k.name===yN)for(let E=i.length-1;E>=0;E--){const j=i[E];if(j.kind==="auth"&&!j.done){j.done=!0;break}}let A=!1;for(let E=i.length-1;E>=0;E--){const j=i[E],T=j.kind==="tool"&&j.name==="delegate_to_codex_sandbox";if(j.kind==="tool"&&(!j.done||T||k.id&&j.callId===k.id)&&(k.id&&j.callId&&j.callId===k.id||(!k.id||!j.callId)&&Eot(j.name,k.name??""))){const R=T?see(j.response):"",C=oee(k.response,t.partial===!0);if(j.done=C.done,j.response=k.response,j.status=C.status,T){j.codexActivity=xot(j.codexActivity,k.response),j.status=C.status==="running"?"running":Oot(k.response);const N=see(k.response);N&&N!==R&&z3(i,"text",N)}A=!0;break}}if(!A&&k.name!==Q3&&k.name!==yN&&k.name!==cB){const E=oee(k.response,t.partial===!0);i.push({kind:"tool",name:k.name??"",callId:k.id,response:k.response,done:E.done,status:E.status})}if(k.name===cB){const E=((b=k.response)==null?void 0:b[uB])??[];if(E.length){const j=i[i.length-1];j&&j.kind==="a2ui"?j.messages.push(...E):i.push({kind:"a2ui",messages:E})}}}}const f=((v=t.actions)==null?void 0:v.artifactDelta)??((y=t.actions)==null?void 0:y.artifact_delta);return f&&Rot(i,Object.entries(f).map(([w,x])=>({filename:w,version:x}))),lw(t)&&wV(t)==="invocation.completed"&&aee(i),mO(i),r=i.length,{blocks:i,liveStart:r,pendingCodexProgress:s}}function Iot(e,t){var u,d,f,h,m,g;if(e.partial===!0)return!1;if(fI(e))return!0;const n=((u=e.content)==null?void 0:u.parts)??[],i=n.some(b=>{const v=Hy(b);return!b.thought&&typeof v=="string"&&v.trim().length>0||XA([b]).length>0}),r=n.some(b=>{var y;const v=Zg(b);return(v==null?void 0:v.name)===cB&&Array.isArray((y=v.response)==null?void 0:y[uB])&&v.response[uB].length>0}),s=((d=e.actions)==null?void 0:d.artifactDelta)??((f=e.actions)==null?void 0:f.artifact_delta),o=!!(s&&Object.keys(s).length>0),l=!!(((h=e.actions)==null?void 0:h.endOfAgent)??((m=e.actions)==null?void 0:m.end_of_agent)??((g=e.actions)==null?void 0:g.escalate)),c=t.some(b=>b.kind==="text"||b.kind==="attachment"||b.kind==="artifact"||b.kind==="a2ui"||b.kind==="delivery");return i||r||o||l&&c}function rNe(e){var n;const t=(n=e.customMetadata??e.custom_metadata)==null?void 0:n.a2aStatus;return typeof t=="string"?t:void 0}function lee(e){var n,i,r;if(rNe(e))return!0;const t=((n=e.actions)==null?void 0:n.artifactDelta)??((i=e.actions)==null?void 0:i.artifact_delta);return t&&Object.keys(t).length>0?!0:(((r=e.content)==null?void 0:r.parts)??[]).some(s=>!!(Hy(s)||XA([s]).length>0||bC(s)||Zg(s)))}function Pot(e,t){var o;const n=K1(t),i=((o=t.content)==null?void 0:o.parts)??[];if(t.partial!==!1||n.projectionSource!=="a2a-artifact"||lw(t)||!i.length||t.actions||!i.every(l=>l.thought&&typeof l.text=="string"&&!bC(l)&&!Zg(l)&&XA([l]).length===0))return e;const r=e.blocks[e.blocks.length-1],s=i.map(l=>l.text).join("").trim();return(r==null?void 0:r.kind)!=="thinking"||!r.text.trim()||!s.startsWith(r.text.trim())?e:{...e,liveStart:e.blocks.length-1}}function Dot(e,t,n,i){const r=e[t];if(!r||r.role!=="assistant"||i.turnIsStreaming||n(r))return!1;if(!i.mpaA2a)return!0;let s=t;for(;s>0&&e[s-1].role!=="user";)s-=1;let o=t+1;for(;oc.blocks.length>0)}function Mot(e){var t,n;return e.author!=="user"&&((t=e.content)==null?void 0:t.role)!=="user"?!1:!(((n=e.content)==null?void 0:n.parts)??[]).some(i=>bC(i)||Zg(i))}function vN(e="adk-stream",t,n={}){var h,m,g,b;let i=0;const r=new Map,s=new Set,o=[];let l,c,u={...(h=t==null?void 0:t.meta)==null?void 0:h.mpaUsage};const d=v=>{if(!n.mpaA2a||!(v.usageMetadata??v.usage_metadata))return!1;const y=vV(oE,v).current.totalTokenCount;if(!y)return!1;const w=K1(v),x=JSON.stringify([w.source??"outer",w.requestId??"",v.invocationId??v.invocation_id??"",v.id||JSON.stringify(v.usageMetadata??v.usage_metadata)]);return Object.prototype.hasOwnProperty.call(u,x)?!1:(u={...u,[x]:y},!0)},f=(v,y)=>`${y}\0${v}`;if((t==null?void 0:t.role)==="assistant"){const v=((m=t.meta)==null?void 0:m.author)??"",y=((g=t.meta)==null?void 0:g.invocationId)??"",w=((b=t.meta)==null?void 0:b.localId)??`${e}-${i++}`,x=dB();x.blocks=t.blocks,x.liveStart=t.blocks.length,l=f(v,y),r.set(l,{acc:x,localId:w,meta:{...t.meta,localId:w,streaming:!0,eventId:void 0}})}return{project(v){var R,C,N;if(Mot(v))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};const y=d(v);if(n.mpaA2a&&!lee(v)&&!((C=(R=v.content)==null?void 0:R.parts)!=null&&C.length))return y&&c?(c={...c,meta:{...c.meta,mpaUsage:u}},{turn:c,completed:!1}):{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(nNe(v)&&!n.mpaA2a)return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(v.id&&s.has(v.id))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};v.id&&(s.add(v.id),o.push(v.id),o.length>kot&&s.delete(o.shift()));const w=v.author&&v.author!=="user"?v.author:"",x=v.invocationId??v.invocation_id??"";let k=lw(v)?"":w,S=f(k,x),O=r.get(S);if(!O&&lw(v)&&x){const P=[...r.entries()].find(([I])=>I.startsWith(`${x}\0`));P&&(S=P[0],O=P[1],k=O.meta.author??"")}if(!O&&l){const P=r.get(l);P&&(!P.meta.author||P.meta.author===k)&&(r.delete(l),l=void 0,O=P)}if(!O&&fI(v))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(!O&&!lee(v))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(!O){const P=`${e}-${i++}`;O={acc:dB(),localId:P,meta:{author:k||void 0,invocationId:x||void 0}}}O.acc=iNe(n.mpaA2a?Pot(O.acc,v):O.acc,v,n);const A=v.usageMetadata??v.usage_metadata,E=Iot(v,O.acc.blocks);O.meta={...O.meta,author:k||O.meta.author,localId:O.localId,streaming:!E,a2aStatus:rNe(v),tokens:(A==null?void 0:A.totalTokenCount)||O.meta.tokens,...n.mpaA2a?{mpaUsage:u,mpaFinalAnswer:lw(v)&&wV(v)==="invocation.completed"?(((N=v.content)==null?void 0:N.parts)??[]).filter(P=>!P.thought).map(P=>Hy(P)??"").join("").trim()||void 0:O.meta.mpaFinalAnswer}:{},ts:v.timestamp||O.meta.ts,invocationId:x||O.meta.invocationId,eventId:E&&v.id?v.id:O.meta.eventId};const j={role:"assistant",blocks:O.acc.blocks,meta:O.meta},T=E&&fI(v);return E&&!T?(r.delete(S),l=void 0):r.set(S,O),n.mpaA2a&&(c=j),{turn:j,completed:E}},finish(){const v=[...r.values()].map(y=>({role:"assistant",blocks:y.acc.blocks.map(w=>w.kind==="thinking"?{...w,done:!0}:w),meta:{...y.meta,streaming:!1,...n.mpaA2a?{mpaUsage:u}:{}}}));return r.clear(),v}}}function Sy(e,t){var s;const n=(s=t.meta)==null?void 0:s.localId;if(!n)return[...e,t];const i=e.findIndex(o=>{var l;return((l=o.meta)==null?void 0:l.localId)===n});if(i<0)return[...e,t];const r=e.slice();return r[i]=t,r}function cee(e,t={},n={}){var l;let i=[],r=0;const s=()=>vN(`adk-history-${r++}`,void 0,n);let o=s();for(const c of e)if(c.author==="user"){const d=((l=c.content)==null?void 0:l.parts)??[];if(d.some(b=>{var v;return((v=Zg(b))==null?void 0:v.name)===yN})){for(let b=i.length-1;b>=0;b--)if(i[b].role==="assistant"){for(let v=i[b].blocks.length-1;v>=0;v--){const y=i[b].blocks[v];if(y.kind==="auth"){y.done=!0;break}}break}}const f=d.map(Hy).filter(b=>!!b).join(""),h=XA(d),m=jot(d);if(!f&&!h.length&&!m)continue;for(const b of o.finish())i=Sy(i,b);const g=[];m&&g.push({kind:"invocation",value:m}),h.length&&g.push({kind:"attachment",files:h}),f&&g.push({kind:"text",text:f}),i.push({role:"user",blocks:g,meta:{ts:c.timestamp}}),o=s()}else{const d=o.project(c);d.ignored||(i=Sy(i,d.turn))}for(const c of o.finish())i=Sy(i,c);for(const c of i){const u=c.meta,d=u==null?void 0:u.eventId;if(!d)continue;const f=t[`veadk_feedback:${d}`];if(!f||typeof f!="object")continue;const h=f;h.rating!=="good"&&h.rating!=="bad"||(u.feedback=f)}return i}function tM(e,t=bn.t("app:titles.newConversation")){var n,i;for(const r of e??[])if(r.author==="user"||((n=r.content)==null?void 0:n.role)==="user"){const s=(((i=r.content)==null?void 0:i.parts)??[]).map(o=>o.text).find(Boolean);if(s)return s}return t}function Lot(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return e[t]}function $ot(e,t,n){var s;if(!n||!t.some(o=>{var l;return o.role==="assistant"&&((l=o.meta)==null?void 0:l.eventId)===n}))return e;const r=Lot(e);return((s=r==null?void 0:r.meta)==null?void 0:s.eventId)!==n?e:t}function sNe(e,t,n){if(e.name===t||e.id===t)return(n==null?void 0:n.type)==="parallel"?n:void 0;for(const i of e.children){const r=sNe(i,t,e);if(r)return r}}function Fot(e,t){var o,l;if(e.role!=="assistant"||!t)return;const n=(o=e.meta)==null?void 0:o.author;if(!n)return;const i=sNe(t,n);if(!i)return;const r=i.id||i.path.join("/")||i.name;return{key:`${((l=e.meta)==null?void 0:l.invocationId)??""}::${r}`,parent:i.name}}function Bot(e,t){const n=[];return e.forEach((i,r)=>{const s=Fot(i,t),o=n[n.length-1];if(s&&(o==null?void 0:o.groupKey)===s.key){o.turnIndexes.push(r);return}n.push({key:s?`parallel-${s.key}-${r}`:`turn-${r}`,turnIndexes:[r],parallelParent:s==null?void 0:s.parent,groupKey:s==null?void 0:s.key})}),n.map(({groupKey:i,...r})=>r)}function Uot(e,t,n){var r,s,o,l,c;if(!t)return e;const i=[];for(let u=0;u{var S;return(S=k.meta)!=null&&S.mpaFinalAnswer?[k.meta.mpaFinalAnswer.trim()]:[]})),m=f.map(k=>{var O;const S=k.blocks.filter(A=>A.kind==="text").map(A=>A.text).join("").trim();return!((O=k.meta)!=null&&O.mpaFinalAnswer)&&S&&h.has(S)?{...k,blocks:k.blocks.filter(A=>A.kind!=="text")}:k}),g=[...m].reverse().find(k=>k.blocks.some(S=>S.kind==="text"&&S.text.trim()))??f[f.length-1],b={},v=new Map,y=f.some(k=>{var S;return(S=k.meta)==null?void 0:S.mpaUsage});for(const k of f){for(const[O,A]of Object.entries(((r=k.meta)==null?void 0:r.mpaUsage)??{}))b[O]=Math.max(b[O]??0,A);const S=(s=k.meta)==null?void 0:s.tokens;if(typeof S=="number"&&Number.isFinite(S)&&S>=0){const O=((o=k.meta)==null?void 0:o.invocationId)||"unidentified";v.set(O,Math.max(v.get(O)??0,S))}}const w=y?Object.values(b):[...v.values()],x=f.flatMap(k=>{var S;return(S=k.meta)!=null&&S.ts?[k.meta.ts]:[]});i.push({role:"assistant",blocks:m.flatMap(k=>k.blocks),meta:{...g.meta,localId:(l=d.meta)==null?void 0:l.localId,author:void 0,streaming:u===e.length&&n||f.some(k=>{var S;return((S=k.meta)==null?void 0:S.streaming)===!0}),a2aStatus:(c=f[f.length-1].meta)==null?void 0:c.a2aStatus,ts:x.length?Math.max(...x):void 0,tokens:w.length?w.reduce((k,S)=>k+S,0):void 0,...y?{mpaUsage:b}:{}}})}return i}function Qot(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"9",cy:"8",r:"3.25"}),a.jsx("path",{d:"M2.75 20v-1.5a6.25 6.25 0 0 1 12.5 0V20M16 5.25a3.25 3.25 0 0 1 0 6.5M18 14a5.5 5.5 0 0 1 3.25 5V20"})]})}function aNe(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t{const t=p.Children.toArray(e),n=[];let i="";const r=()=>{i!==""&&(n.push(i),i="")};for(const s of t)if(!(s==null||typeof s=="boolean")){if(typeof s=="string"||typeof s=="number"){i+=String(s);continue}r(),n.push(s)}return r(),n},kV=e=>{const t=zot(e),n=p.Children.count(t);return p.Children.map(t,i=>{if(typeof i=="string"&&i.trim())return n<=1?i:a.jsx("span",{children:i});if(p.isValidElement(i)){const r=i,{children:s,...o}=r.props;return s!=null?p.cloneElement(r,o,kV(s)):r}return i})},Vot="_Badge_1viyg_1",Hot={Badge:Vot},Za=({children:e,className:t,variant:n="soft",color:i="secondary",size:r="sm",pill:s,...o})=>a.jsx("div",{className:qi(Hot.Badge,t),"data-color":i,"data-size":r,"data-pill":s?"":void 0,"data-variant":n,...o,children:kV(e)});var qot=typeof lg=="object"&&lg&&lg.Object===Object&&lg,Wot=typeof self=="object"&&self&&self.Object===Object&&self;qot||Wot||Function("return this")();var Kot=typeof window<"u"?p.useLayoutEffect:p.useEffect;function Got(){const e=p.useRef(!1);return p.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),p.useCallback(()=>e.current,[])}var uee={width:void 0,height:void 0};function oNe(e){const{ref:t,box:n="content-box"}=e,[{width:i,height:r},s]=p.useState(uee),o=Got(),l=p.useRef({...uee}),c=p.useRef(void 0);return c.current=e.onResize,p.useEffect(()=>{if(!t.current||typeof window>"u"||!("ResizeObserver"in window))return;const u=new ResizeObserver(([d])=>{const f=n==="border-box"?"borderBoxSize":n==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",h=dee(d,f,"inlineSize"),m=dee(d,f,"blockSize");if(l.current.width!==h||l.current.height!==m){const b={width:h,height:m};l.current.width=h,l.current.height=m,c.current?c.current(b):o()&&s(b)}});return u.observe(t.current,{box:n}),()=>{u.disconnect()}},[n,t,o]),{width:i,height:r}}function dee(e,t,n){return e[t]?Array.isArray(e[t])?e[t][0][n]:e[t][n]:t==="contentBoxSize"?e.contentRect[n==="inlineSize"?"width":"height"]:void 0}function OV(e,t){const n=p.useRef(e);Kot(()=>{n.current=e},[e]),p.useEffect(()=>{if(!t&&t!==0)return;const i=setTimeout(()=>{n.current()},t);return()=>{clearTimeout(i)}},[t])}const Xot={DEV:!1,MODE:"production"},cw=typeof import.meta<"u"?Xot:void 0,Yot=!!(cw!=null&&cw.DEV),Zot=typeof navigator<"u"&&/(jsdom|happy-dom)/i.test(navigator.userAgent)||typeof globalThis.happyDOM=="object",lNe=(cw==null?void 0:cw.MODE)==="test"||Zot,Jot=typeof window<"u",cNe=typeof document<"u",elt=Jot&&cNe,SV=e=>{const t=e.currentTarget;if(!(t instanceof HTMLElement))return;const n=t.offsetWidth;let i=.985;n<=80?i=.96:n<=150?i=.97:n<=220?i=.98:n>600&&(i=.995),t.style.setProperty("--scale",i.toString())},hI=(e,t)=>{const n=()=>{const o=setTimeout(e);return()=>{clearTimeout(o)}};if(!elt||typeof window.requestAnimationFrame!="function"||cNe&&document.visibilityState==="hidden")return n();let r=2,s=window.requestAnimationFrame(function o(){r-=1,r===0?e():s=window.requestAnimationFrame(o)});return()=>{typeof window.cancelAnimationFrame=="function"&&window.cancelAnimationFrame(s)}},Fv=e=>Object.keys(e).reduce((n,i)=>{const r=e[i];if(r||r===0){const s=i.startsWith("--")?"":"--",o=typeof r=="number"?`${r}px`:r;n[`${s}${i}`]=o}return n},{}),H3=e=>typeof e=="number"?`${e}deg`:e,q3=e=>String(e),o_=e=>`${e}ms`,W3=({x:e,y:t,scale:n,rotate:i,skewX:r,skewY:s}={})=>{const o=[e==null?null:`translateX(${e}px)`,t==null?null:`translateY(${t}px)`,n==null?null:`scale(${n})`,i==null?null:`rotate(${H3(i)})`,r==null?null:`skewX(${H3(r)})`,s==null?null:`skewY(${H3(s)})`].filter(Boolean);return o.length?o.join(" "):"none"},K3=({blur:e}={})=>{const t=[e==null?null:`blur(${e}px)`].filter(Boolean);return t.length?t.join(" "):"none"},Lp=e=>{e.preventDefault()},uNe=e=>e.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex^="-"]), [contenteditable]'),tlt="_LoadingIndicator_7yl6f_1",nlt={LoadingIndicator:tlt},YA=({className:e,size:t,strokeWidth:n,style:i,...r})=>a.jsx("div",{...r,className:qi(nlt.LoadingIndicator,e),style:i||Fv({"indicator-size":t,"indicator-stroke":n})});var ilt=Object.defineProperty,EV=(e,t)=>ilt(e,"name",{value:t,configurable:!0});function fB(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}EV(fB,"setRef");function dNe(...e){return t=>{let n=!1;const i=e.map(r=>{const s=fB(r,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;rrlt(e,"name",{value:t,configurable:!0});function Yp(e){const t=p.forwardRef((n,i)=>{let{children:r,...s}=n,o=null,l=!1;const c=[];hB(r)&&typeof l_=="function"&&(r=l_(r._payload)),p.Children.forEach(r,h=>{var m;if(bNe(h)){l=!0;const g=h;let b="child"in g.props?g.props.child:g.props.children;hB(b)&&typeof l_=="function"&&(b=l_(b._payload)),o=slt(g,b),c.push((m=o==null?void 0:o.props)==null?void 0:m.children)}else c.push(h)}),o?o=p.cloneElement(o,void 0,c):!l&&p.Children.count(r)===1&&p.isValidElement(r)&&(o=r);const u=o?gNe(o):void 0,d=Rr(i,u);if(!o){if(r||r===0)throw new Error(l?llt(e):olt(e));return r}const f=mNe(s,o.props??{});return o.type!==p.Fragment&&(f.ref=i?d:u),p.cloneElement(o,f)});return t.displayName=`${e}.Slot`,t}Sf(Yp,"createSlot");var fNe=Yp("Slot"),hNe=Symbol.for("radix.slottable");function pNe(e){const t=Sf(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=hNe,t}Sf(pNe,"createSlottable");var slt=Sf((e,t)=>{if("child"in e.props){const n=e.props.child;return p.isValidElement(n)?p.cloneElement(n,void 0,e.props.children(n.props.children)):null}return p.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function mNe(e,t){const n={...t};for(const i in t){const r=e[i],s=t[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...l)=>{const c=s(...l);return r(...l),c}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}Sf(mNe,"mergeProps");function gNe(e){var i,r;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Sf(gNe,"getElementRef");function bNe(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hNe}Sf(bNe,"isSlottable");var alt=Symbol.for("react.lazy");function hB(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===alt&&"_payload"in e&&yNe(e._payload)}Sf(hB,"isLazyComponent");function yNe(e){return typeof e=="object"&&e!==null&&"then"in e}Sf(yNe,"isPromiseLike");var olt=Sf(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),llt=Sf(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),l_=_v[" use ".trim().toString()],clt=Object.defineProperty,ult=(e,t)=>clt(e,"name",{value:t,configurable:!0}),dlt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Jr=dlt.reduce((e,t)=>{const n=Yp(`Primitive.${t}`),i=p.forwardRef((r,s)=>{const{asChild:o,...l}=r,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:s})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function CV(e,t){e&&vi.flushSync(()=>e.dispatchEvent(t))}ult(CV,"dispatchDiscreteCustomEvent");var flt=Object.defineProperty,hlt=(e,t)=>flt(e,"name",{value:t,configurable:!0}),plt=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),mlt=p.forwardRef(hlt(function(t,n){return a.jsx(Jr.span,{...t,ref:n,style:{...plt,...t.style}})},"VisuallyHidden")),glt=mlt,blt=Object.defineProperty,ud=(e,t)=>blt(e,"name",{value:t,configurable:!0});function ylt(e,t){const n=p.createContext(t);n.displayName=e+"Context";const i=ud(s=>{const{children:o,...l}=s,c=p.useMemo(()=>l,Object.values(l));return a.jsx(n.Provider,{value:c,children:o})},"Provider");i.displayName=e+"Provider";function r(s,o={}){const{optional:l=!1}=o,c=p.useContext(n);if(c)return c;if(t!==void 0)return t;if(!l)throw new Error(`\`${s}\` must be used within \`${e}\``)}return ud(r,"useContext"),[i,r]}ud(ylt,"createContext");function Qc(e,t=[]){let n=[];function i(s,o){const l=p.createContext(o);l.displayName=s+"Context";const c=n.length;n=[...n,o];const u=ud(f=>{var y;const{scope:h,children:m,...g}=f,b=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,v=p.useMemo(()=>g,Object.values(g));return a.jsx(b.Provider,{value:v,children:m})},"Provider");u.displayName=s+"Provider";function d(f,h,m={}){var y;const{optional:g=!1}=m,b=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,v=p.useContext(b);if(v)return v;if(o!==void 0)return o;if(!g)throw new Error(`\`${f}\` must be used within \`${s}\``)}return ud(d,"useContext"),[u,d]}ud(i,"createContext");const r=ud(()=>{const s=n.map(o=>p.createContext(o));return ud(function(l){const c=(l==null?void 0:l[e])||s;return p.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])},"useScope")},"createScope");return r.scopeName=e,[i,vNe(r,...t)]}ud(Qc,"createContextScope");function vNe(...e){const t=e[0];if(e.length===1)return t;const n=ud(()=>{const i=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return ud(function(s){const o=i.reduce((l,{useScope:c,scopeName:u})=>{const f=c(s)[`__scope${u}`];return{...l,...f}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}ud(vNe,"composeContextScopes");var vlt=Object.defineProperty,Io=(e,t)=>vlt(e,"name",{value:t,configurable:!0});function AV(e){const t=e+"CollectionProvider",[n,i]=Qc(t),[r,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=Io(b=>{const{scope:v,children:y}=b,w=p.useRef(null),x=p.useRef(new Map).current;return a.jsx(r,{scope:v,itemMap:x,collectionRef:w,children:y})},"CollectionProvider");o.displayName=t;const l=e+"CollectionSlot",c=Yp(l),u=p.forwardRef((b,v)=>{const{scope:y,children:w}=b,x=s(l,y),k=Rr(v,x.collectionRef);return a.jsx(c,{ref:k,children:w})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=Yp(d),m=p.forwardRef((b,v)=>{const{scope:y,children:w,...x}=b,k=p.useRef(null),S=Rr(v,k),O=s(d,y);return p.useEffect(()=>(O.itemMap.set(k,{ref:k,...x}),()=>void O.itemMap.delete(k))),a.jsx(h,{[f]:"",ref:S,children:w})});m.displayName=d;function g(b){const v=s(e+"CollectionConsumer",b);return p.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const x=Array.from(w.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((O,A)=>x.indexOf(O.ref.current)-x.indexOf(A.ref.current))},[v.collectionRef,v.itemMap])}return Io(g,"useCollection"),[{Provider:o,Slot:u,ItemSlot:m},g,i]}Io(AV,"createCollection");var fee=new WeakMap,Ha,bu,G3=(bu=class extends Map{constructor(n){super(n);$G(this,Ha);w5(this,Ha,[...super.keys()]),fee.set(this,!0)}set(n,i){return fee.get(this)&&(this.has(n)?kl(this,Ha)[kl(this,Ha).indexOf(n)]=n:kl(this,Ha).push(n)),super.set(n,i),this}insert(n,i,r){const s=this.has(i),o=kl(this,Ha).length,l=TV(n);let c=l>=0?l:o+l;const u=c<0||c>=o?-1:c;if(u===this.size||s&&u===this.size-1||u===-1)return this.set(i,r),this;const d=this.size+(s?0:1);l<0&&c++;const f=[...kl(this,Ha)];let h,m=!1;for(let g=c;g=this.size&&(s=this.size-1),this.at(s)}keyFrom(n,i){const r=this.indexOf(n);if(r===-1)return;let s=r+i;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(n,i){let r=0;for(const s of this){if(Reflect.apply(n,i,[s,r,this]))return s;r++}}findIndex(n,i){let r=0;for(const s of this){if(Reflect.apply(n,i,[s,r,this]))return r;r++}return-1}filter(n,i){const r=[];let s=0;for(const o of this)Reflect.apply(n,i,[o,s,this])&&r.push(o),s++;return new bu(r)}map(n,i){const r=[];let s=0;for(const o of this)r.push([o[0],Reflect.apply(n,i,[o,s,this])]),s++;return new bu(r)}reduce(...n){const[i,r]=n;let s=0,o=r??this.at(0);for(const l of this)s===0&&n.length===1?o=l:o=Reflect.apply(i,this,[o,l,s,this]),s++;return o}reduceRight(...n){const[i,r]=n;let s=r??this.at(-1);for(let o=this.size-1;o>=0;o--){const l=this.at(o);o===this.size-1&&n.length===1?s=l:s=Reflect.apply(i,this,[s,l,o,this])}return s}toSorted(n){const i=[...this.entries()].sort(n);return new bu(i)}toReversed(){const n=new bu;for(let i=this.size-1;i>=0;i--){const r=this.keyAt(i),s=this.get(r);n.set(r,s)}return n}toSpliced(...n){const i=[...this.entries()];return i.splice(...n),new bu(i)}slice(n,i){const r=new bu;let s=this.size-1;if(n===void 0)return r;n<0&&(n=n+this.size),i!==void 0&&i>0&&(s=i-1);for(let o=n;o<=s;o++){const l=this.keyAt(o),c=this.get(l);r.set(l,c)}return r}every(n,i){let r=0;for(const s of this){if(!Reflect.apply(n,i,[s,r,this]))return!1;r++}return!0}some(n,i){let r=0;for(const s of this){if(Reflect.apply(n,i,[s,r,this]))return!0;r++}return!1}},Ha=new WeakMap,Io(bu,"OrderedDict"),bu);function xN(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=xNe(e,t);return n===-1?void 0:e[n]}Io(xN,"at");function xNe(e,t){const n=e.length,i=TV(t),r=i>=0?i:n+i;return r<0||r>=n?-1:r}Io(xNe,"toSafeIndex");function TV(e){return e!==e||e===0?0:Math.trunc(e)}Io(TV,"toSafeInteger");function xlt(e){const t=e+"CollectionProvider",[n,i]=Qc(t),[r,s]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new G3,setItemMap:Io(()=>{},"setItemMap")}),o=Io(({state:x,...k})=>x?a.jsx(c,{...k,state:x}):a.jsx(l,{...k}),"CollectionProvider");o.displayName=t;const l=Io(x=>{const k=v();return a.jsx(c,{...x,state:k})},"CollectionInit");l.displayName=t+"Init";const c=Io(x=>{const{scope:k,children:S,state:O}=x,A=p.useRef(null),[E,j]=p.useState(null),T=Rr(A,j),[R,C]=O;return p.useEffect(()=>{if(!E)return;const N=ONe(()=>{});return N.observe(E,{childList:!0,subtree:!0}),()=>{N.disconnect()}},[E]),a.jsx(r,{scope:k,itemMap:R,setItemMap:C,collectionRef:T,collectionRefObject:A,collectionElement:E,children:S})},"CollectionProviderImpl");c.displayName=t+"Impl";const u=e+"CollectionSlot",d=Yp(u),f=p.forwardRef((x,k)=>{const{scope:S,children:O}=x,A=s(u,S),E=Rr(k,A.collectionRef);return a.jsx(d,{ref:E,children:O})});f.displayName=u;const h=e+"CollectionItemSlot",m="data-radix-collection-item",g=Yp(h),b=p.forwardRef((x,k)=>{const{scope:S,children:O,...A}=x,E=p.useRef(null),[j,T]=p.useState(null),R=Rr(k,E,T),C=s(h,S),{setItemMap:N}=C,P=p.useRef(A);wNe(P.current,A)||(P.current=A);const I=P.current;return p.useEffect(()=>{const D=I;return N(_=>j?_.has(j)?_.set(j,{...D,element:j}).toSorted(pB):(_.set(j,{...D,element:j}),_.toSorted(pB)):_),()=>{N(_=>!j||!_.has(j)?_:(_.delete(j),new G3(_)))}},[j,I,N]),a.jsx(g,{[m]:"",ref:R,children:O})});b.displayName=h;function v(){return p.useState(new G3)}Io(v,"useInitCollection");function y(x){const{itemMap:k}=s(e+"CollectionConsumer",x);return k}return Io(y,"useCollection"),[{Provider:o,Slot:f,ItemSlot:b},{createCollectionScope:i,useCollection:y,useInitCollection:v}]}Io(xlt,"createCollection");function wNe(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}Io(wNe,"shallowEqual");function kNe(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Io(kNe,"isElementPreceding");function pB(e,t){return!e[1].element||!t[1].element?0:kNe(e[1].element,t[1].element)?-1:1}Io(pB,"sortByDocumentPosition");function ONe(e){return new MutationObserver(n=>{for(const i of n)if(i.type==="childList"){e();return}})}Io(ONe,"getChildListObserver");var wlt=Object.defineProperty,G1=(e,t)=>wlt(e,"name",{value:t,configurable:!0}),SNe=!!(typeof window<"u"&&window.document&&window.document.createElement);function Un(e,t,{checkForDefaultPrevented:n=!0}={}){return G1(function(r){if(e==null||e(r),n===!1||!r||!r.defaultPrevented)return t==null?void 0:t(r)},"handleEvent")}G1(Un,"composeEventHandlers");function klt(e){var t;if(!SNe)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}G1(klt,"getOwnerWindow");function mB(e){if(!SNe)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}G1(mB,"getOwnerDocument");function ENe(e,t=!1){const{activeElement:n}=mB(e);if(!(n!=null&&n.nodeName))return null;if(CNe(n)&&n.contentDocument)return ENe(n.contentDocument.body,t);if(t){const i=n.getAttribute("aria-activedescendant");if(i){const r=mB(n).getElementById(i);if(r)return r}}return n}G1(ENe,"getActiveElement");function CNe(e){return e.tagName==="IFRAME"}G1(CNe,"isFrame");var Od=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},Olt=Object.defineProperty,Slt=(e,t)=>Olt(e,"name",{value:t,configurable:!0}),hee=_v[" useEffectEvent ".trim().toString()],pee=_v[" useInsertionEffect ".trim().toString()];function ANe(e){if(typeof hee=="function")return hee(e);const t=p.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof pee=="function"?pee(()=>{t.current=e}):Od(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)},[])}Slt(ANe,"useEffectEvent");var Elt=Object.defineProperty,ZA=(e,t)=>Elt(e,"name",{value:t,configurable:!0}),Clt=_v[" useInsertionEffect ".trim().toString()]||Od;function Id({prop:e,defaultProp:t,onChange:n=ZA(()=>{},"onChange"),caller:i}){const[r,s,o]=TNe({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:r,u=p.useCallback(d=>{var f;if(l){const h=_Ne(d)?d(e):d;h!==e&&((f=o.current)==null||f.call(o,h))}else s(d)},[l,e,s,o]);return[c,u]}ZA(Id,"useControllableState");function TNe({defaultProp:e,onChange:t}){const[n,i]=p.useState(e),r=p.useRef(n),s=p.useRef(t);return Clt(()=>{s.current=t},[t]),p.useEffect(()=>{var o;r.current!==n&&((o=s.current)==null||o.call(s,n),r.current=n)},[n,r]),[n,i,s]}ZA(TNe,"useUncontrolledState");function _Ne(e){return typeof e=="function"}ZA(_Ne,"isFunction");var mee=Symbol("RADIX:SYNC_STATE");function Alt(e,t,n,i){const{prop:r,defaultProp:s,onChange:o,caller:l}=t,c=r!==void 0,u=ANe(o),d=[{...n,state:s}];i&&d.push(i);const[f,h]=p.useReducer((v,y)=>{if(y.type===mee)return{...v,state:y.state};const w=e(v,y);return c&&!Object.is(w.state,v.state)&&u(w.state),w},...d),m=f.state,g=p.useRef(m);p.useEffect(()=>{g.current!==m&&(g.current=m,c||u(m))},[m,g,c]);const b=p.useMemo(()=>r!==void 0?{...f,state:r}:f,[f,r]);return p.useEffect(()=>{c&&!Object.is(r,f.state)&&h({type:mee,state:r})},[r,f.state,c]),[b,h]}ZA(Alt,"useControllableStateReducer");var Tlt=Object.defineProperty,Zp=(e,t)=>Tlt(e,"name",{value:t,configurable:!0});function jNe(e,t){return p.useReducer((n,i)=>t[n][i]??n,e)}Zp(jNe,"useStateMachine");var Rh=Zp(e=>{const{present:t,children:n}=e,i=NNe(t),r=typeof n=="function"?n({present:i.isPresent}):p.Children.only(n),s=RNe(i.ref,INe(r));return typeof n=="function"||i.isPresent?p.cloneElement(r,{ref:s}):null},"Presence");function NNe(e){const[t,n]=p.useState(),i=p.useRef(null),r=p.useRef(e),s=p.useRef("none"),o=p.useRef(void 0),l=e?"mounted":"unmounted",[c,u]=jNe(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{c==="mounted"?(s.current=o.current??ox(i.current),o.current=void 0):s.current="none"},[c]),Od(()=>{const d=i.current,f=r.current;if(f!==e){const m=s.current,g=ox(d);e?(o.current=g,u("MOUNT")):g==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,u]),Od(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,h=Zp(g=>{const v=ox(i.current).includes(CSS.escape(g.animationName));if(g.target===t&&v&&(u("ANIMATION_END"),!r.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},"handleAnimationEnd"),m=Zp(g=>{g.target===t&&(s.current=ox(i.current))},"handleAnimationStart");return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:p.useCallback(d=>{if(d){const f=getComputedStyle(d);i.current=f,o.current=ox(f)}else i.current=null;n(d)},[])}}Zp(NNe,"usePresence");function gB(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Zp(gB,"setRef");function RNe(...e){const t=p.useRef(e);return t.current=e,p.useCallback(n=>{const i=t.current;let r=!1;const s=i.map(o=>{const l=gB(o,n);return!r&&typeof l=="function"&&(r=!0),l});if(r)return()=>{for(let o=0;o_lt(e,"name",{value:t,configurable:!0}),Nlt=_v[" useId ".trim().toString()]||(()=>{}),Rlt=0;function Jg(e){const[t,n]=p.useState(Nlt());return Od(()=>{e||n(i=>i??String(Rlt++))},[e]),e||(t?`radix-${t}`:"")}jlt(Jg,"useId");var Ilt=Object.defineProperty,Plt=(e,t)=>Ilt(e,"name",{value:t,configurable:!0}),Dlt=p.createContext(void 0);function JA(e){const t=p.useContext(Dlt);return e||t||"ltr"}Plt(JA,"useDirection");var Mlt=Object.defineProperty,Llt=(e,t)=>Mlt(e,"name",{value:t,configurable:!0});function yf(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)},[])}Llt(yf,"useCallbackRef");var $lt=Object.defineProperty,No=(e,t)=>$lt(e,"name",{value:t,configurable:!0}),bB="dismissableLayer.update",Flt="dismissableLayer.pointerDownOutside",Blt="dismissableLayer.focusOutside",gee,PNe=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),_V=p.forwardRef(No(function(t,n){const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:c,onDismiss:u,...d}=t,f=p.useContext(PNe),[h,m]=p.useState(null),g=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=p.useState({}),v=Rr(n,m),y=Array.from(f.layers),[w]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),x=w?y.indexOf(w):-1,k=h?y.indexOf(h):-1,S=f.layersWithOutsidePointerEventsDisabled.size>0,O=k>=x,A=p.useRef(!1),E=DNe(C=>{o==null||o(C),c==null||c(C),C.defaultPrevented||u==null||u()},{ownerDocument:g,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:A,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:p.useCallback(C=>{if(!(C instanceof Node))return!1;const N=[...f.branches].some(P=>P.contains(C));return O&&!N},[f.branches,O])}),j=MNe(C=>{if(r&&A.current)return;const N=C.target;[...f.branches].some(I=>I.contains(N))||(l==null||l(C),c==null||c(C),C.defaultPrevented||u==null||u())},g),T=h?k===y.length-1:!1,R=yf(C=>{C.key==="Escape"&&(s==null||s(C),!C.defaultPrevented&&u&&(C.preventDefault(),u()))});return p.useEffect(()=>{if(T)return g.addEventListener("keydown",R,{capture:!0}),()=>g.removeEventListener("keydown",R,{capture:!0})},[g,T,R]),p.useEffect(()=>{if(h)return i&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(gee=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),yB(),()=>{i&&(f.layersWithOutsidePointerEventsDisabled.delete(h),f.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=gee))}},[h,g,i,f]),p.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),yB())},[h,f]),p.useEffect(()=>{const C=No(()=>b({}),"handleUpdate");return document.addEventListener(bB,C),()=>document.removeEventListener(bB,C)},[]),a.jsx(Jr.div,{...d,ref:v,style:{pointerEvents:S?O?"auto":"none":void 0,...t.style},onFocusCapture:Un(t.onFocusCapture,j.onFocusCapture),onBlurCapture:Un(t.onBlurCapture,j.onBlurCapture),onPointerDownCapture:Un(t.onPointerDownCapture,E.onPointerDownCapture)})},"DismissableLayer"));function Ult(){const e=p.useContext(PNe),[t,n]=p.useState(null);return p.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}No(Ult,"useDismissableLayerSurface");var Qlt=No(()=>!0,"IS_TRUE");function DNe(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:r,dismissableSurfaces:s,shouldHandlePointerDownOutside:o=Qlt}=t,l=yf(e),c=p.useRef(!1),u=p.useRef(!1),d=p.useRef(new Map),f=p.useRef(()=>{});return p.useEffect(()=>{function h(){u.current=!1,r.current=!1,d.current.clear()}No(h,"resetOutsideInteraction");function m(){return Array.from(d.current.values()).some(Boolean)}No(m,"isOutsideInteractionIntercepted");function g(x){if(!u.current)return;const k=x.target;k instanceof Node&&[...s].some(O=>O.contains(k))||d.current.set(x.type,!0),x.type==="click"&&window.setTimeout(()=>{u.current&&f.current()},0)}No(g,"handleInteractionCapture");function b(x){u.current&&d.current.set(x.type,!1)}No(b,"handleInteractionBubble");const v=No(x=>{if(x.target&&!c.current){let k=function(){n.removeEventListener("click",f.current);const O=m();h(),O||jV(Flt,l,S,{discrete:!0})};if(No(k,"handleAndDispatchPointerDownOutsideEvent"),!o(x.target)){n.removeEventListener("click",f.current),h(),c.current=!1;return}const S={originalEvent:x};u.current=!0,r.current=i&&x.button===0,d.current.clear(),!i||x.button!==0?k():(n.removeEventListener("click",f.current),f.current=k,n.addEventListener("click",f.current,{once:!0}))}else n.removeEventListener("click",f.current),h();c.current=!1},"handlePointerDown"),y=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const x of y)n.addEventListener(x,g,!0),n.addEventListener(x,b);const w=window.setTimeout(()=>{n.addEventListener("pointerdown",v)},0);return()=>{window.clearTimeout(w),n.removeEventListener("pointerdown",v),n.removeEventListener("click",f.current);for(const x of y)n.removeEventListener(x,g,!0),n.removeEventListener(x,b)}},[n,l,i,r,s,o]),{onPointerDownCapture:No(()=>c.current=!0,"onPointerDownCapture")}}No(DNe,"usePointerDownOutside");function MNe(e,t=globalThis==null?void 0:globalThis.document){const n=yf(e),i=p.useRef(!1);return p.useEffect(()=>{const r=No(s=>{s.target&&!i.current&&jV(Blt,n,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:No(()=>i.current=!0,"onFocusCapture"),onBlurCapture:No(()=>i.current=!1,"onBlurCapture")}}No(MNe,"useFocusOutside");function yB(){const e=new CustomEvent(bB);document.dispatchEvent(e)}No(yB,"dispatchUpdate");function jV(e,t,n,{discrete:i}){const r=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),i?CV(r,s):r.dispatchEvent(s)}No(jV,"handleAndDispatchCustomEvent");var zlt=Object.defineProperty,tc=(e,t)=>zlt(e,"name",{value:t,configurable:!0}),X3="focusScope.autoFocusOnMount",Y3="focusScope.autoFocusOnUnmount",bee={bubbles:!1,cancelable:!0},LNe=p.forwardRef(tc(function(t,n){const{loop:i=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...l}=t,[c,u]=p.useState(null),d=yf(s),f=yf(o),h=p.useRef(null),m=Rr(n,u),g=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let v=function(k){if(g.paused||!c)return;const S=k.target;c.contains(S)?h.current=S:pp(h.current,{select:!0})},y=function(k){if(g.paused||!c)return;const S=k.relatedTarget;S!==null&&(c.contains(S)||pp(h.current,{select:!0}))},w=function(k){if(document.activeElement===document.body)for(const O of k)O.removedNodes.length>0&&pp(c)};tc(v,"handleFocusIn"),tc(y,"handleFocusOut"),tc(w,"handleMutations"),document.addEventListener("focusin",v),document.addEventListener("focusout",y);const x=new MutationObserver(w);return c&&x.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",y),x.disconnect()}}},[r,c,g.paused]),p.useEffect(()=>{if(c){yee.add(g);const v=document.activeElement;if(!c.contains(v)){const w=new CustomEvent(X3,bee);c.addEventListener(X3,d),c.dispatchEvent(w),w.defaultPrevented||($Ne(zNe(NV(c)),{select:!0}),document.activeElement===v&&pp(c))}return()=>{c.removeEventListener(X3,d),setTimeout(()=>{const w=new CustomEvent(Y3,bee);c.addEventListener(Y3,f),c.dispatchEvent(w),w.defaultPrevented||pp(v??document.body,{select:!0}),c.removeEventListener(Y3,f),yee.remove(g)},0)}}},[c,d,f,g]);const b=p.useCallback(v=>{if(!i&&!r||g.paused)return;const y=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,w=document.activeElement;if(y&&w){const x=v.currentTarget,[k,S]=FNe(x);k&&S?!v.shiftKey&&w===S?(v.preventDefault(),i&&pp(k,{select:!0})):v.shiftKey&&w===k&&(v.preventDefault(),i&&pp(S,{select:!0})):w===x&&v.preventDefault()}},[i,r,g.paused]);return a.jsx(Jr.div,{tabIndex:-1,...l,ref:m,onKeyDown:b})},"FocusScope"));function $Ne(e,{select:t=!1}={}){const n=document.activeElement;for(const i of e)if(pp(i,{select:t}),document.activeElement!==n)return}tc($Ne,"focusFirst");function FNe(e){const t=NV(e),n=vB(t,e),i=vB(t.reverse(),e);return[n,i]}tc(FNe,"getTabbableEdges");function NV(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:tc(i=>{const r=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||r?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}tc(NV,"getTabbableCandidates");function vB(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const i of e)if(!(n?!i.checkVisibility({checkVisibilityCSS:!0}):BNe(i,{upTo:t})))return i}tc(vB,"findVisible");function BNe(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}tc(BNe,"isHidden");function UNe(e){return e instanceof HTMLInputElement&&"select"in e}tc(UNe,"isSelectableInput");function pp(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&UNe(e)&&t&&e.select()}}tc(pp,"focus");var yee=QNe();function QNe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=xB(e,t),e.unshift(t)},remove(t){var n;e=xB(e,t),(n=e[0])==null||n.resume()}}}tc(QNe,"createFocusScopesStack");function xB(e,t){const n=[...e],i=n.indexOf(t);return i!==-1&&n.splice(i,1),n}tc(xB,"arrayRemove");function zNe(e){return e.filter(t=>t.tagName!=="A")}tc(zNe,"removeLinks");var Vlt=Object.defineProperty,Hlt=(e,t)=>Vlt(e,"name",{value:t,configurable:!0}),RV=p.forwardRef(Hlt(function(t,n){var c;const{container:i,...r}=t,[s,o]=p.useState(!1);Od(()=>o(!0),[]);const l=i||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return l?vi.createPortal(a.jsx(Jr.div,{...r,ref:n}),l):null},"Portal")),qlt=Object.defineProperty,IV=(e,t)=>qlt(e,"name",{value:t,configurable:!0}),c_=0,Uf=null;function Wlt(e){return nM(),e.children}IV(Wlt,"FocusGuards");function nM(){p.useEffect(()=>{Uf||(Uf={start:wB(),end:wB()});const{start:e,end:t}=Uf;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),c_++,()=>{c_===1&&(Uf==null||Uf.start.remove(),Uf==null||Uf.end.remove(),Uf=null),c_=Math.max(0,c_-1)}},[])}IV(nM,"useFocusGuards");function wB(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}IV(wB,"createFocusGuard");var eh=function(){return eh=Object.assign||function(t){for(var n,i=1,r=arguments.length;i"u")return uct;var t=dct(e),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,i-n+t[2]-t[0])}},hct=WNe(),uw="data-scroll-locked",pct=function(e,t,n,i){var r=e.left,s=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),` + .`.concat(Glt,` { overflow: hidden `).concat(i,`; padding-right: `).concat(l,"px ").concat(i,`; } @@ -513,113 +513,113 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== } body[`).concat(uw,`] { - `).concat(Glt,": ").concat(l,`px; + `).concat(Xlt,": ").concat(l,`px; } -`)},xee=function(){var e=parseInt(document.body.getAttribute(uw)||"0",10);return isFinite(e)?e:0},pct=function(){p.useEffect(function(){return document.body.setAttribute(uw,(xee()+1).toString()),function(){var e=xee()-1;e<=0?document.body.removeAttribute(uw):document.body.setAttribute(uw,e.toString())}},[])},mct=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,r=i===void 0?"margin":i;pct();var s=p.useMemo(function(){return dct(r)},[r]);return p.createElement(fct,{styles:hct(s,!t,r,n?"":"!important")})},kB=!1;if(typeof window<"u")try{var u_=Object.defineProperty({},"passive",{get:function(){return kB=!0,!0}});window.addEventListener("test",u_,u_),window.removeEventListener("test",u_,u_)}catch{kB=!1}var M0=kB?{passive:!1}:!1,gct=function(e){return e.tagName==="TEXTAREA"},WNe=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!gct(e)&&n[t]==="visible")},bct=function(e){return WNe(e,"overflowY")},yct=function(e){return WNe(e,"overflowX")},wee=function(e,t){var n=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var r=KNe(e,i);if(r){var s=GNe(e,i),o=s[1],l=s[2];if(o>l)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},vct=function(e){var t=e.scrollTop,n=e.scrollHeight,i=e.clientHeight;return[t,n,i]},xct=function(e){var t=e.scrollLeft,n=e.scrollWidth,i=e.clientWidth;return[t,n,i]},KNe=function(e,t){return e==="v"?bct(t):yct(t)},GNe=function(e,t){return e==="v"?vct(t):xct(t)},wct=function(e,t){return e==="h"&&t==="rtl"?-1:1},kct=function(e,t,n,i,r){var s=wct(e,window.getComputedStyle(t).direction),o=s*i,l=n.target,c=t.contains(l),u=!1,d=o>0,f=0,h=0;do{if(!l)break;var m=GNe(e,l),g=m[0],b=m[1],v=m[2],y=b-v-s*g;(g||y)&&KNe(e,l)&&(f+=y,h+=g);var w=l.parentNode;l=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&Math.abs(f)<1||!d&&Math.abs(h)<1)&&(u=!0),u},d_=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},kee=function(e){return[e.deltaX,e.deltaY]},Oee=function(e){return e&&"current"in e?e.current:e},Oct=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Sct=function(e){return` +`)},xee=function(){var e=parseInt(document.body.getAttribute(uw)||"0",10);return isFinite(e)?e:0},mct=function(){p.useEffect(function(){return document.body.setAttribute(uw,(xee()+1).toString()),function(){var e=xee()-1;e<=0?document.body.removeAttribute(uw):document.body.setAttribute(uw,e.toString())}},[])},gct=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,r=i===void 0?"margin":i;mct();var s=p.useMemo(function(){return fct(r)},[r]);return p.createElement(hct,{styles:pct(s,!t,r,n?"":"!important")})},kB=!1;if(typeof window<"u")try{var u_=Object.defineProperty({},"passive",{get:function(){return kB=!0,!0}});window.addEventListener("test",u_,u_),window.removeEventListener("test",u_,u_)}catch{kB=!1}var M0=kB?{passive:!1}:!1,bct=function(e){return e.tagName==="TEXTAREA"},KNe=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!bct(e)&&n[t]==="visible")},yct=function(e){return KNe(e,"overflowY")},vct=function(e){return KNe(e,"overflowX")},wee=function(e,t){var n=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var r=GNe(e,i);if(r){var s=XNe(e,i),o=s[1],l=s[2];if(o>l)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},xct=function(e){var t=e.scrollTop,n=e.scrollHeight,i=e.clientHeight;return[t,n,i]},wct=function(e){var t=e.scrollLeft,n=e.scrollWidth,i=e.clientWidth;return[t,n,i]},GNe=function(e,t){return e==="v"?yct(t):vct(t)},XNe=function(e,t){return e==="v"?xct(t):wct(t)},kct=function(e,t){return e==="h"&&t==="rtl"?-1:1},Oct=function(e,t,n,i,r){var s=kct(e,window.getComputedStyle(t).direction),o=s*i,l=n.target,c=t.contains(l),u=!1,d=o>0,f=0,h=0;do{if(!l)break;var m=XNe(e,l),g=m[0],b=m[1],v=m[2],y=b-v-s*g;(g||y)&&GNe(e,l)&&(f+=y,h+=g);var w=l.parentNode;l=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&Math.abs(f)<1||!d&&Math.abs(h)<1)&&(u=!0),u},d_=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},kee=function(e){return[e.deltaX,e.deltaY]},Oee=function(e){return e&&"current"in e?e.current:e},Sct=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ect=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},Ect=0,L0=[];function Cct(e){var t=p.useRef([]),n=p.useRef([0,0]),i=p.useRef(),r=p.useState(Ect++)[0],s=p.useState(qNe)[0],o=p.useRef(e);p.useEffect(function(){o.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var b=Wlt([e.lockRef.current],(e.shards||[]).map(Oee),!0).filter(Boolean);return b.forEach(function(v){return v.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),b.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var l=p.useCallback(function(b,v){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!o.current.allowPinchZoom;var y=d_(b),w=n.current,x="deltaX"in b?b.deltaX:w[0]-y[0],k="deltaY"in b?b.deltaY:w[1]-y[1],S,O=b.target,A=Math.abs(x)>Math.abs(k)?"h":"v";if("touches"in b&&A==="h"&&O.type==="range")return!1;var E=window.getSelection(),j=E&&E.anchorNode,T=j?j===O||j.contains(O):!1;if(T)return!1;var R=wee(A,O);if(!R)return!0;if(R?S=A:(S=A==="v"?"h":"v",R=wee(A,O)),!R)return!1;if(!i.current&&"changedTouches"in b&&(x||k)&&(i.current=S),!S)return!0;var C=i.current||S;return kct(C,v,b,C==="h"?x:k)},[]),c=p.useCallback(function(b){var v=b;if(!(!L0.length||L0[L0.length-1]!==s)){var y="deltaY"in v?kee(v):d_(v),w=t.current.filter(function(S){return S.name===v.type&&(S.target===v.target||v.target===S.shadowParent)&&Oct(S.delta,y)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var x=(o.current.shards||[]).map(Oee).filter(Boolean).filter(function(S){return S.contains(v.target)}),k=x.length>0?l(v,x[0]):!o.current.noIsolation;k&&v.cancelable&&v.preventDefault()}}},[]),u=p.useCallback(function(b,v,y,w){var x={name:b,delta:v,target:y,should:w,shadowParent:Act(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(k){return k!==x})},1)},[]),d=p.useCallback(function(b){n.current=d_(b),i.current=void 0},[]),f=p.useCallback(function(b){u(b.type,kee(b),b.target,l(b,e.lockRef.current))},[]),h=p.useCallback(function(b){u(b.type,d_(b),b.target,l(b,e.lockRef.current))},[]);p.useEffect(function(){return L0.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,M0),document.addEventListener("touchmove",c,M0),document.addEventListener("touchstart",d,M0),function(){L0=L0.filter(function(b){return b!==s}),document.removeEventListener("wheel",c,M0),document.removeEventListener("touchmove",c,M0),document.removeEventListener("touchstart",d,M0)}},[]);var m=e.removeScrollBar,g=e.inert;return p.createElement(p.Fragment,null,g?p.createElement(s,{styles:Sct(r)}):null,m?p.createElement(mct,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Act(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Tct=nct(HNe,Cct);var PV=p.forwardRef(function(e,t){return p.createElement(iM,eh({},e,{ref:t,sideCar:Tct}))});PV.classNames=iM.classNames;var _ct=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},$0=new WeakMap,f_=new WeakMap,h_={},t4=0,XNe=function(e){return e&&(e.host||XNe(e.parentNode))},jct=function(e,t){return t.map(function(n){if(e.contains(n))return n;var i=XNe(n);return i&&e.contains(i)?i:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Nct=function(e,t,n,i){var r=jct(t,Array.isArray(e)?e:[e]);h_[n]||(h_[n]=new WeakMap);var s=h_[n],o=[],l=new Set,c=new Set(r),u=function(f){!f||l.has(f)||(l.add(f),u(f.parentNode))};r.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(h){if(l.has(h))d(h);else try{var m=h.getAttribute(i),g=m!==null&&m!=="false",b=($0.get(h)||0)+1,v=(s.get(h)||0)+1;$0.set(h,b),s.set(h,v),o.push(h),b===1&&g&&f_.set(h,!0),v===1&&h.setAttribute(n,"true"),g||h.setAttribute(i,"true")}catch(y){console.error("aria-hidden: cannot operate on ",h,y)}})};return d(t),l.clear(),t4++,function(){o.forEach(function(f){var h=$0.get(f)-1,m=s.get(f)-1;$0.set(f,h),s.set(f,m),h||(f_.has(f)||f.removeAttribute(i),f_.delete(f)),m||f.removeAttribute(n)}),t4--,t4||($0=new WeakMap,$0=new WeakMap,f_=new WeakMap,h_={})}},YNe=function(e,t,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),r=_ct(e);return r?(i.push.apply(i,Array.from(r.querySelectorAll("[aria-live], script"))),Nct(i,r,n,"aria-hidden")):function(){return null}},Rct=Object.defineProperty,Ict=(e,t)=>Rct(e,"name",{value:t,configurable:!0});function eT(e){const[t,n]=p.useState(void 0);return Od(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let o,l;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else n(void 0)},[e]),t}Ict(eT,"useSize");var Pct=Object.defineProperty,Jp=(e,t)=>Pct(e,"name",{value:t,configurable:!0}),DV="Checkbox",[Dct,khn]=Qc(DV),[Mct,MV]=Dct(DV);function ZNe(e){const{__scopeCheckbox:t,checked:n,children:i,defaultChecked:r,disabled:s,form:o,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,m]=Id({prop:n,defaultProp:r??!1,onChange:c,caller:DV}),[g,b]=p.useState(null),[v,y]=p.useState(null),w=p.useRef(!1),[x,k]=p.useReducer(A=>A+1,0),S=g?!!o||!!g.closest("form"):!0,O={checked:h,disabled:s,setChecked:m,control:g,setControl:b,name:l,form:o,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:x,onUserInteraction:k,required:u,defaultChecked:$p(r)?!1:r,isFormControl:S,bubbleInput:v,setBubbleInput:y};return a.jsx(Mct,{scope:t,...O,children:JNe(f)?f(O):i})}Jp(ZNe,"CheckboxProvider");var Lct="CheckboxTrigger",$ct=p.forwardRef(Jp(function({__scopeCheckbox:t,onKeyDown:n,onClick:i,...r},s){const{control:o,value:l,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:g,isFormControl:b,bubbleInput:v}=MV(Lct,t),y=Rr(s,f),w=p.useRef(u);return p.useEffect(()=>{const x=o==null?void 0:o.form;if(x){const k=Jp(()=>h(w.current),"reset");return x.addEventListener("reset",k),()=>x.removeEventListener("reset",k)}},[o,h]),a.jsx(Jr.button,{type:"button",role:"checkbox","aria-checked":$p(u)?"mixed":u,"aria-required":d,"data-state":LV(u),"data-disabled":c?"":void 0,disabled:c,value:l,...r,ref:y,onKeyDown:Un(n,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:Un(i,x=>{g(),h(k=>$p(k)?!0:!k),v&&b&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})})},"CheckboxTrigger")),Fct=p.forwardRef(Jp(function(t,n){const{__scopeCheckbox:i,name:r,checked:s,defaultChecked:o,required:l,disabled:c,value:u,onCheckedChange:d,form:f,...h}=t;return a.jsx(ZNe,{__scopeCheckbox:i,checked:s,defaultChecked:o,disabled:c,required:l,onCheckedChange:d,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>a.jsxs(a.Fragment,{children:[a.jsx($ct,{...h,ref:n,__scopeCheckbox:i}),m&&a.jsx(zct,{__scopeCheckbox:i})]})})},"Checkbox")),Bct="CheckboxIndicator",Uct=p.forwardRef(Jp(function(t,n){const{__scopeCheckbox:i,forceMount:r,...s}=t,o=MV(Bct,i);return a.jsx(Rh,{present:r||$p(o.checked)||o.checked===!0,children:a.jsx(Jr.span,{"data-state":LV(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...t.style}})})},"CheckboxIndicator")),Qct="CheckboxBubbleInput",zct=p.forwardRef(Jp(function({__scopeCheckbox:t,onClick:n,...i},r){const{control:s,hasConsumerStoppedPropagationRef:o,userInteractionCount:l,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:g,bubbleInput:b,setBubbleInput:v}=MV(Qct,t),y=Rr(r,v),w=eT(s),x=p.useRef(!1),k=p.useRef(c),S=p.useRef(l);p.useEffect(()=>{const A=b;if(!A)return;const E=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(E,"checked").set,R=l!==S.current;S.current=l;const C=k.current!==c;k.current=c;const N=!(R&&o.current);if(C&&T){x.current=!R;const P=new Event("click",{bubbles:N});A.indeterminate=$p(c),T.call(A,$p(c)?!1:c),A.dispatchEvent(P),x.current=!1}},[b,c,o,l]);const O=p.useRef($p(c)?!1:c);return a.jsx(Jr.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??O.current,required:d,disabled:f,name:h,value:m,form:g,...i,tabIndex:-1,ref:y,onClick:Un(n,A=>{x.current&&A.stopPropagation()}),style:{...i.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function JNe(e){return typeof e=="function"}Jp(JNe,"isFunction");function $p(e){return e==="indeterminate"}Jp($p,"isIndeterminate");function LV(e){return $p(e)?"indeterminate":e?"checked":"unchecked"}Jp(LV,"getState");var Vct=Object.defineProperty,Ig=(e,t)=>Vct(e,"name",{value:t,configurable:!0}),eRe="Popper",[tRe,X1]=Qc(eRe),[Hct,nRe]=tRe(eRe),qct=Ig(e=>{const{__scopePopper:t,children:n}=e,[i,r]=p.useState(null),[s,o]=p.useState(void 0);return a.jsx(Hct,{scope:t,anchor:i,onAnchorChange:r,placementState:s,setPlacementState:o,children:n})},"Popper"),Wct="PopperAnchor",Kct=p.forwardRef(Ig(function(t,n){const{__scopePopper:i,virtualRef:r,...s}=t,o=nRe(Wct,i),l=p.useRef(null),c=o.onAnchorChange,u=p.useCallback(b=>{l.current=b,b&&c(b)},[c]),d=Rr(n,u),f=p.useRef(null);p.useEffect(()=>{if(!r)return;const b=f.current;f.current=r.current,b!==f.current&&c(f.current)});const h=o.placementState&&rM(o.placementState),m=h==null?void 0:h[0],g=h==null?void 0:h[1];return r?null:a.jsx(Jr.div,{"data-radix-popper-side":m,"data-radix-popper-align":g,...s,ref:d})},"PopperAnchor")),iRe="PopperContent",[Gct,Ohn]=tRe(iRe),Xct=p.forwardRef(Ig(function(t,n){var X,le,V,Y,K,ue,te;const{__scopePopper:i,side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:b,...v}=t,y=nRe(iRe,i),[w,x]=p.useState(null),k=Rr(n,x),[S,O]=p.useState(null),A=eT(S),E=(A==null?void 0:A.width)??0,j=(A==null?void 0:A.height)??0,T=r+(o!=="center"?"-"+o:""),R=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},C=Array.isArray(d)?d:[d],N=C.length>0,P={padding:R,boundary:C.filter(rRe),altBoundary:N},{refs:I,floatingStyles:D,placement:_,isPositioned:L,middlewareData:F}=J_e({strategy:"fixed",placement:T,whileElementsMounted:Ig((...Oe)=>aB(...Oe,{animationFrame:g==="always"}),"whileElementsMounted"),elements:{reference:y.anchor},middleware:[eje({mainAxis:s+j,alignmentAxis:l}),u&&tje({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?nje():void 0,...P}),u&&ije({...P}),rje({...P,apply:Ig(({elements:Oe,rects:fe,availableWidth:pe,availableHeight:Se})=>{const{width:ve,height:Le}=fe.reference,He=Oe.floating.style;He.setProperty("--radix-popper-available-width",`${pe}px`),He.setProperty("--radix-popper-available-height",`${Se}px`),He.setProperty("--radix-popper-anchor-width",`${ve}px`),He.setProperty("--radix-popper-anchor-height",`${Le}px`)},"apply")}),S&&rst({element:S,padding:c}),Yct({arrowWidth:E,arrowHeight:j}),m&&ist({strategy:"referenceHidden",...P,boundary:N?P.boundary:void 0})]}),M=y.setPlacementState;Od(()=>(M(_),()=>{M(void 0)}),[_,M]);const[H,q]=rM(_),U=yf(b);Od(()=>{L&&(U==null||U())},[L,U]);const Z=(X=F.arrow)==null?void 0:X.x,z=(le=F.arrow)==null?void 0:le.y,J=((V=F.arrow)==null?void 0:V.centerOffset)!==0,[ne,W]=p.useState();return Od(()=>{w&&W(window.getComputedStyle(w).zIndex)},[w]),a.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:L?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[(Y=F.transformOrigin)==null?void 0:Y.x,(K=F.transformOrigin)==null?void 0:K.y].join(" "),...((ue=F.hide)==null?void 0:ue.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:a.jsx(Gct,{scope:i,placedSide:H,placedAlign:q,onArrowChange:O,arrowX:Z,arrowY:z,shouldHideArrow:J,children:a.jsx(Jr.div,{"data-side":H,"data-align":q,...v,ref:k,style:{...v.style,animation:L?(te=v.style)==null?void 0:te.animation:"none"}})})})},"PopperContent"));function rRe(e){return e!==null}Ig(rRe,"isNotNull");var Yct=Ig(e=>({name:"transformOrigin",options:e,fn(t){var v,y,w;const{placement:n,rects:i,middlewareData:r}=t,o=((v=r.arrow)==null?void 0:v.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,d]=rM(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((y=r.arrow)==null?void 0:y.x)??0)+l/2,m=(((w=r.arrow)==null?void 0:w.y)??0)+c/2;let g="",b="";return u==="bottom"?(g=o?f:`${h}px`,b=`${-c}px`):u==="top"?(g=o?f:`${h}px`,b=`${i.floating.height+c}px`):u==="right"?(g=`${-c}px`,b=o?f:`${m}px`):u==="left"&&(g=`${i.floating.width+c}px`,b=o?f:`${m}px`),{data:{x:g,y:b}}}}),"transformOrigin");function rM(e){const[t,n="center"]=e.split("-");return[t,n]}Ig(rM,"getSideAndAlignFromPlacement");var sM=qct,$V=Kct,FV=Xct,Zct=Object.defineProperty,BV=(e,t)=>Zct(e,"name",{value:t,configurable:!0}),n4=!1;function sRe(){const[e,t]=p.useState(n4);return p.useEffect(()=>{n4||(n4=!0,t(!0))},[]),e}BV(sRe,"useIsHydrated");var aRe=_v[" useSyncExternalStore ".trim().toString()];function oRe(){return()=>{}}BV(oRe,"subscribe");function lRe(){return aRe(oRe,()=>!0,()=>!1)}BV(lRe,"useIsHydratedModern");var Jct=typeof aRe=="function"?lRe:sRe,eut=Object.defineProperty,Bv=(e,t)=>eut(e,"name",{value:t,configurable:!0}),i4="rovingFocusGroup.onEntryFocus",tut={bubbles:!1,cancelable:!0},aM="RovingFocusGroup",[OB,cRe,nut]=AV(aM),[iut,Y1]=Qc(aM,[nut]),[rut,sut]=iut(aM),aut=p.forwardRef(Bv(function(t,n){return a.jsx(OB.Provider,{scope:t.__scopeRovingFocusGroup,children:a.jsx(OB.Slot,{scope:t.__scopeRovingFocusGroup,children:a.jsx(out,{...t,ref:n})})})},"RovingFocusGroup")),out=p.forwardRef(Bv(function(t,n){const{__scopeRovingFocusGroup:i,orientation:r,loop:s=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...h}=t,m=p.useRef(null),g=Rr(n,m),b=JA(o),[v,y]=Id({prop:l,defaultProp:c??null,onChange:u,caller:aM}),[w,x]=p.useState(!1),k=yf(d),S=cRe(i),O=p.useRef(!1),[A,E]=p.useState(0);return p.useEffect(()=>{const j=m.current;if(j)return j.addEventListener(i4,k),()=>j.removeEventListener(i4,k)},[k]),a.jsx(rut,{scope:i,orientation:r,dir:b,loop:s,currentTabStopId:v,onItemFocus:p.useCallback(j=>y(j),[y]),onItemShiftTab:p.useCallback(()=>x(!0),[]),onFocusableItemAdd:p.useCallback(()=>E(j=>j+1),[]),onFocusableItemRemove:p.useCallback(()=>E(j=>j-1),[]),children:a.jsx(Jr.div,{tabIndex:w||A===0?-1:0,"data-orientation":r,...h,ref:g,style:{outline:"none",...t.style},onMouseDown:Un(t.onMouseDown,()=>{O.current=!0}),onFocus:Un(t.onFocus,j=>{const T=!O.current;if(j.target===j.currentTarget&&T&&!w){const R=new CustomEvent(i4,tut);if(j.currentTarget.dispatchEvent(R),!R.defaultPrevented){const C=S().filter(_=>_.focusable),N=C.find(_=>_.active),P=C.find(_=>_.id===v),D=[N,P,...C].filter(Boolean).map(_=>_.ref.current);UV(D,f)}}O.current=!1}),onBlur:Un(t.onBlur,()=>x(!1))})})},"RovingFocusGroupImpl")),lut="RovingFocusGroupItem",cut=p.forwardRef(Bv(function(t,n){const{__scopeRovingFocusGroup:i,focusable:r=!0,active:s=!1,tabStopId:o,children:l,...c}=t,u=Jg(),d=o||u,f=sut(lut,i),h=f.currentTabStopId===d,m=cRe(i),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:v}=f,y=Jct();return Od(()=>{if(!(!y||!r))return g(),()=>b()},[y,r,g,b]),p.useEffect(()=>{if(!(y||!r))return g(),()=>b()},[y,r,g,b]),a.jsx(OB.ItemSlot,{scope:i,id:d,focusable:r,active:s,children:a.jsx(Jr.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...c,ref:n,onMouseDown:Un(t.onMouseDown,w=>{r?f.onItemFocus(d):w.preventDefault()}),onFocus:Un(t.onFocus,()=>f.onItemFocus(d)),onKeyDown:Un(t.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){f.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const x=dRe(w,f.orientation,f.dir);if(x!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let S=m().filter(O=>O.focusable).map(O=>O.ref.current);if(x==="last")S.reverse();else if(x==="prev"||x==="next"){x==="prev"&&S.reverse();const O=S.indexOf(w.currentTarget);S=f.loop?fRe(S,O+1):S.slice(O+1)}setTimeout(()=>UV(S))}}),children:typeof l=="function"?l({isCurrentTabStop:h,hasTabStop:v!=null}):l})})},"RovingFocusGroupItem")),uut={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function uRe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Bv(uRe,"getDirectionAwareKey");function dRe(e,t,n){const i=uRe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return uut[i]}Bv(dRe,"getFocusIntent");function UV(e,t=!1){const n=document.activeElement;for(const i of e)if(i===n||(i.focus({preventScroll:t}),document.activeElement!==n))return}Bv(UV,"focusFirst");function fRe(e,t){return e.map((n,i)=>e[(t+i)%e.length])}Bv(fRe,"wrapArray");var QV=aut,zV=cut,dut=Object.defineProperty,br=(e,t)=>dut(e,"name",{value:t,configurable:!0}),SB=["Enter"," "],fut=["ArrowDown","PageUp","Home"],hRe=["ArrowUp","PageDown","End"],hut=[...fut,...hRe],put={ltr:[...SB,"ArrowRight"],rtl:[...SB,"ArrowLeft"]},mut={ltr:["ArrowLeft"],rtl:["ArrowRight"]},oM="Menu",[yC,gut,but]=AV(oM),[Uv,pRe]=Qc(oM,[but,X1,Y1]),lM=X1(),mRe=Y1(),[gRe,Ob]=Uv(oM),[yut,tT]=Uv(oM),vut=br(e=>{const{__scopeMenu:t,open:n=!1,children:i,dir:r,onOpenChange:s,modal:o=!0}=e,l=lM(t),[c,u]=p.useState(null),d=p.useRef(!1),f=yf(s),h=JA(r);return p.useEffect(()=>{const m=br(()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},"handleKeyDown"),g=br(()=>d.current=!1,"handlePointer");return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),p.useEffect(()=>{if(!n)return;const m=br(()=>f(!1),"handleBlur");return window.addEventListener("blur",m),()=>window.removeEventListener("blur",m)},[n,f]),a.jsx(sM,{...l,children:a.jsx(gRe,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:a.jsx(yut,{scope:t,onClose:p.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:o,children:i})})})},"Menu"),bRe=p.forwardRef(br(function(t,n){const{__scopeMenu:i,...r}=t,s=lM(i);return a.jsx($V,{...s,...r,ref:n})},"MenuAnchor")),yRe="MenuPortal",[xut,vRe]=Uv(yRe,{forceMount:void 0}),wut=br(e=>{const{__scopeMenu:t,forceMount:n,children:i,container:r}=e,s=Ob(yRe,t);return a.jsx(xut,{scope:t,forceMount:n,children:a.jsx(Rh,{present:n||s.open,children:a.jsx(RV,{asChild:!0,container:r,children:i})})})},"MenuPortal"),df="MenuContent",[kut,VV]=Uv(df),Out=p.forwardRef(br(function(t,n){const i=vRe(df,t.__scopeMenu),{forceMount:r=i.forceMount,...s}=t,o=Ob(df,t.__scopeMenu),l=tT(df,t.__scopeMenu);return a.jsx(yC.Provider,{scope:t.__scopeMenu,children:a.jsx(Rh,{present:r||o.open,children:a.jsx(yC.Slot,{scope:t.__scopeMenu,children:l.modal?a.jsx(Sut,{...s,ref:n}):a.jsx(Eut,{...s,ref:n})})})})},"MenuContent")),Sut=p.forwardRef(br(function(t,n){const i=Ob(df,t.__scopeMenu),r=p.useRef(null),s=Rr(n,r);return p.useEffect(()=>{const o=r.current;if(o)return YNe(o)},[]),a.jsx(HV,{...t,ref:s,trapFocus:i.open,disableOutsidePointerEvents:i.open,disableOutsideScroll:!0,onFocusOutside:Un(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentModal")),Eut=p.forwardRef(br(function(t,n){const i=Ob(df,t.__scopeMenu);return a.jsx(HV,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentNonModal")),Cut=Yp("MenuContent.ScrollLock"),HV=p.forwardRef(br(function(t,n){const{__scopeMenu:i,loop:r=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,disableOutsideScroll:b,...v}=t,y=Ob(df,i),w=tT(df,i),x=lM(i),k=mRe(i),S=gut(i),[O,A]=p.useState(null),E=p.useRef(null),j=Rr(n,E,y.onContentChange),T=p.useRef(0),R=p.useRef(""),C=p.useRef(0),N=p.useRef(null),P=p.useRef("right"),I=p.useRef(0),D=b?PV:p.Fragment,_=b?{as:Cut,allowPinchZoom:!0}:void 0,L=br(M=>{var W,X;const H=R.current+M,q=S().filter(le=>!le.disabled),U=document.activeElement,Z=(W=q.find(le=>le.ref.current===U))==null?void 0:W.textValue,z=q.map(le=>le.textValue),J=ARe(z,H,Z),ne=(X=q.find(le=>le.textValue===J))==null?void 0:X.ref.current;br(function le(V){R.current=V,window.clearTimeout(T.current),V!==""&&(T.current=window.setTimeout(()=>le(""),1e3))},"updateSearch")(H),ne&&setTimeout(()=>ne.focus())},"handleTypeaheadSearch");p.useEffect(()=>()=>window.clearTimeout(T.current),[]),nM();const F=p.useCallback(M=>{var q,U;return P.current===((q=N.current)==null?void 0:q.side)&&_Re(M,(U=N.current)==null?void 0:U.area)},[]);return a.jsx(kut,{scope:i,searchRef:R,onItemEnter:p.useCallback(M=>{F(M)&&M.preventDefault()},[F]),onItemLeave:p.useCallback(M=>{var H;F(M)||((H=E.current)==null||H.focus(),A(null))},[F]),onTriggerLeave:p.useCallback(M=>{F(M)&&M.preventDefault()},[F]),pointerGraceTimerRef:C,onPointerGraceIntentChange:p.useCallback(M=>{N.current=M},[]),children:a.jsx(D,{..._,children:a.jsx(MNe,{asChild:!0,trapped:s,onMountAutoFocus:Un(o,M=>{var H;M.preventDefault(),(H=E.current)==null||H.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:a.jsx(_V,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,children:a.jsx(QV,{asChild:!0,...k,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:O,onCurrentTabStopIdChange:A,onEntryFocus:Un(u,M=>{w.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(FV,{role:"menu","aria-orientation":"vertical","data-state":WV(y.open),"data-radix-menu-content":"",dir:w.dir,...x,...v,ref:j,style:{outline:"none",...v.style},onKeyDown:Un(v.onKeyDown,M=>{const q=M.target.closest("[data-radix-menu-content]")===M.currentTarget,U=M.ctrlKey||M.altKey||M.metaKey,Z=M.key.length===1;q&&(M.key==="Tab"&&M.preventDefault(),!U&&Z&&L(M.key));const z=E.current;if(M.target!==z||!hut.includes(M.key))return;M.preventDefault();const ne=S().filter(W=>!W.disabled).map(W=>W.ref.current);hRe.includes(M.key)&&ne.reverse(),ERe(ne)}),onBlur:Un(t.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(T.current),R.current="")}),onPointerMove:Un(t.onPointerMove,t1(M=>{const H=M.target,q=I.current!==M.clientX;if(M.currentTarget.contains(H)&&q){const U=M.clientX>I.current?"right":"left";P.current=U,I.current=M.clientX}}))})})})})})})},"MenuContentImpl")),Aut=p.forwardRef(br(function(t,n){const{__scopeMenu:i,...r}=t;return a.jsx(Jr.div,{role:"group",...r,ref:n})},"MenuGroup")),EB="MenuItem",See="menu.itemSelect",qV=p.forwardRef(br(function(t,n){const{disabled:i=!1,onSelect:r,...s}=t,o=p.useRef(null),l=tT(EB,t.__scopeMenu),c=VV(EB,t.__scopeMenu),u=Rr(n,o),d=p.useRef(!1),f=br(()=>{const h=o.current;if(!i&&h){const m=new CustomEvent(See,{bubbles:!0,cancelable:!0});h.addEventListener(See,g=>r==null?void 0:r(g),{once:!0}),CV(h,m),m.defaultPrevented?d.current=!1:l.onClose()}},"handleSelect");return a.jsx(xRe,{...s,ref:u,disabled:i,onClick:Un(t.onClick,f),onPointerDown:h=>{var m;(m=t.onPointerDown)==null||m.call(t,h),d.current=!0},onPointerUp:Un(t.onPointerUp,h=>{var m;d.current||(m=h.currentTarget)==null||m.click()}),onKeyDown:Un(t.onKeyDown,h=>{i||h.target!==h.currentTarget||c.searchRef.current!==""&&h.key===" "||SB.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})},"MenuItem")),xRe=p.forwardRef(br(function(t,n){const{__scopeMenu:i,disabled:r=!1,textValue:s,...o}=t,l=VV(EB,i),c=mRe(i),u=p.useRef(null),d=Rr(n,u),[f,h]=p.useState(!1),[m,g]=p.useState("");return p.useEffect(()=>{const b=u.current;b&&g((b.textContent??"").trim())},[o.children]),a.jsx(yC.ItemSlot,{scope:i,disabled:r,textValue:s??m,children:a.jsx(zV,{asChild:!0,...c,focusable:!r,children:a.jsx(Jr.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:d,onPointerMove:Un(t.onPointerMove,t1(b=>{r?l.onItemLeave(b):(l.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Un(t.onPointerLeave,t1(b=>l.onItemLeave(b))),onFocus:Un(t.onFocus,()=>h(!0)),onBlur:Un(t.onBlur,()=>h(!1))})})})},"MenuItemImpl")),Tut=p.forwardRef(br(function(t,n){const{checked:i=!1,onCheckedChange:r,...s}=t;return a.jsx(kRe,{scope:t.__scopeMenu,checked:i,children:a.jsx(qV,{role:"menuitemcheckbox","aria-checked":vC(i)?"mixed":i,...s,ref:n,"data-state":cM(i),onSelect:Un(s.onSelect,()=>r==null?void 0:r(vC(i)?!0:!i),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),_ut="MenuRadioGroup",[jut,Nut]=Uv(_ut,{value:void 0,onValueChange:br(()=>{},"onValueChange")}),Rut=p.forwardRef(br(function(t,n){const{value:i,onValueChange:r,...s}=t,o=yf(r);return a.jsx(jut,{scope:t.__scopeMenu,value:i,onValueChange:o,children:a.jsx(Aut,{...s,ref:n})})},"MenuRadioGroup")),Iut="MenuRadioItem",Put=p.forwardRef(br(function(t,n){const{value:i,...r}=t,s=Nut(Iut,t.__scopeMenu),o=i===s.value;return a.jsx(kRe,{scope:t.__scopeMenu,checked:o,children:a.jsx(qV,{role:"menuitemradio","aria-checked":o,...r,ref:n,"data-state":cM(o),onSelect:Un(r.onSelect,()=>{var l;return(l=s.onValueChange)==null?void 0:l.call(s,i)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),wRe="MenuItemIndicator",[kRe,Dut]=Uv(wRe,{checked:!1}),Mut=p.forwardRef(br(function(t,n){const{__scopeMenu:i,forceMount:r,...s}=t,o=Dut(wRe,i);return a.jsx(Rh,{present:r||vC(o.checked)||o.checked===!0,children:a.jsx(Jr.span,{...s,ref:n,"data-state":cM(o.checked)})})},"MenuItemIndicator")),Lut=p.forwardRef(br(function(t,n){const{__scopeMenu:i,...r}=t;return a.jsx(Jr.div,{role:"separator","aria-orientation":"horizontal",...r,ref:n})},"MenuSeparator")),ORe="MenuSub",[$ut,SRe]=Uv(ORe),Fut=br(e=>{const{__scopeMenu:t,children:n,open:i=!1,onOpenChange:r}=e,s=Ob(ORe,t),o=lM(t),[l,c]=p.useState(null),[u,d]=p.useState(null),f=yf(r);return p.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),a.jsx(sM,{...o,children:a.jsx(gRe,{scope:t,open:i,onOpenChange:f,content:u,onContentChange:d,children:a.jsx($ut,{scope:t,contentId:Jg(),triggerId:Jg(),trigger:l,onTriggerChange:c,children:n})})})},"MenuSub"),p_="MenuSubTrigger",But=p.forwardRef(br(function(t,n){const i=Ob(p_,t.__scopeMenu),r=tT(p_,t.__scopeMenu),s=SRe(p_,t.__scopeMenu),o=VV(p_,t.__scopeMenu),l=p.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=o,d={__scopeMenu:t.__scopeMenu},f=p.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);p.useEffect(()=>f,[f]),p.useEffect(()=>{const m=c.current;return()=>{window.clearTimeout(m),u(null)}},[c,u]);const h=Rr(n,s.onTriggerChange);return a.jsx(bRe,{asChild:!0,...d,children:a.jsx(xRe,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?s.contentId:void 0,"data-state":WV(i.open),...t,ref:h,onClick:m=>{var g;(g=t.onClick)==null||g.call(t,m),!(t.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),i.open||i.onOpenChange(!0))},onPointerMove:Un(t.onPointerMove,t1(m=>{o.onItemEnter(m),!m.defaultPrevented&&!t.disabled&&!i.open&&!l.current&&(o.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{i.onOpenChange(!0),f()},100))})),onPointerLeave:Un(t.onPointerLeave,t1(m=>{var b,v;f();const g=(b=i.content)==null?void 0:b.getBoundingClientRect();if(g){const y=(v=i.content)==null?void 0:v.dataset.side,w=y==="right",x=w?-5:5,k=g[w?"left":"right"],S=g[w?"right":"left"];o.onPointerGraceIntentChange({area:[{x:m.clientX+x,y:m.clientY},{x:k,y:g.top},{x:S,y:g.top},{x:S,y:g.bottom},{x:k,y:g.bottom}],side:y}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(m),m.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Un(t.onKeyDown,m=>{var b;t.disabled||m.target!==m.currentTarget||o.searchRef.current!==""&&m.key===" "||put[r.dir].includes(m.key)&&(i.onOpenChange(!0),(b=i.content)==null||b.focus(),m.preventDefault())})})})},"MenuSubTrigger")),Uut="MenuSubContent",Qut=p.forwardRef(br(function(t,n){const i=vRe(df,t.__scopeMenu),{forceMount:r=i.forceMount,align:s="start",...o}=t,l=Ob(df,t.__scopeMenu),c=tT(df,t.__scopeMenu),u=SRe(Uut,t.__scopeMenu),d=p.useRef(null),f=Rr(n,d);return a.jsx(yC.Provider,{scope:t.__scopeMenu,children:a.jsx(Rh,{present:r||l.open,children:a.jsx(yC.Slot,{scope:t.__scopeMenu,children:a.jsx(HV,{id:u.contentId,"aria-labelledby":u.triggerId,...o,ref:f,align:s,side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{var m;c.isUsingKeyboardRef.current&&((m=d.current)==null||m.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:Un(t.onFocusOutside,h=>{h.target!==u.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:Un(t.onEscapeKeyDown,h=>{c.onClose(),h.preventDefault()}),onKeyDown:Un(t.onKeyDown,h=>{var b;const m=h.currentTarget.contains(h.target),g=mut[c.dir].includes(h.key);m&&g&&(l.onOpenChange(!1),(b=u.trigger)==null||b.focus(),h.preventDefault())})})})})})},"MenuSubContent"));function WV(e){return e?"open":"closed"}br(WV,"getOpenState");function vC(e){return e==="indeterminate"}br(vC,"isIndeterminate");function cM(e){return vC(e)?"indeterminate":e?"checked":"unchecked"}br(cM,"getCheckedState");function ERe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}br(ERe,"focusFirst");function CRe(e,t){return e.map((n,i)=>e[(t+i)%e.length])}br(CRe,"wrapArray");function ARe(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let o=CRe(e,Math.max(s,0));r.length===1&&(o=o.filter(u=>u!==n));const c=o.find(u=>u.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}br(ARe,"getNextMatch");function TRe(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,o=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}br(TRe,"isPointInPolygon");function _Re(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return TRe(n,t)}br(_Re,"isPointerInGraceArea");function t1(e){return t=>t.pointerType==="mouse"?e(t):void 0}br(t1,"whenMouse");var zut=vut,Vut=bRe,Hut=wut,qut=Out,Wut=qV,Kut=Tut,Gut=Rut,Xut=Put,Yut=Mut,Zut=Lut,Jut=Fut,edt=But,tdt=Qut,ndt=Object.defineProperty,Vu=(e,t)=>ndt(e,"name",{value:t,configurable:!0}),KV="DropdownMenu",[idt,Shn]=Qc(KV,[pRe]),Hu=pRe(),[rdt,jRe]=idt(KV),sdt=Vu(e=>{const{__scopeDropdownMenu:t,children:n,dir:i,open:r,defaultOpen:s,onOpenChange:o,modal:l=!0}=e,c=Hu(t),u=p.useRef(null),[d,f]=Id({prop:r,defaultProp:s??!1,onChange:o,caller:KV});return a.jsx(rdt,{scope:t,triggerId:Jg(),triggerRef:u,contentId:Jg(),open:d,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(h=>!h),[f]),modal:l,children:a.jsx(zut,{...c,open:d,onOpenChange:f,dir:i,modal:l,children:n})})},"DropdownMenu"),adt="DropdownMenuTrigger",odt=p.forwardRef(Vu(function(t,n){const{__scopeDropdownMenu:i,disabled:r=!1,...s}=t,o=jRe(adt,i),l=Hu(i),c=Rr(n,o.triggerRef);return a.jsx(Vut,{asChild:!0,...l,children:a.jsx(Jr.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:c,onPointerDown:Un(t.onPointerDown,u=>{!r&&u.button===0&&u.ctrlKey===!1&&(o.onOpenToggle(),o.open||u.preventDefault())}),onKeyDown:Un(t.onKeyDown,u=>{r||(["Enter"," "].includes(u.key)&&o.onOpenToggle(),u.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),ldt=Vu(e=>{const{__scopeDropdownMenu:t,...n}=e,i=Hu(t);return a.jsx(Hut,{...i,...n})},"DropdownMenuPortal"),cdt="DropdownMenuContent",udt=p.forwardRef(Vu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=jRe(cdt,i),o=Hu(i),l=p.useRef(!1);return a.jsx(qut,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...r,ref:n,onCloseAutoFocus:Un(t.onCloseAutoFocus,c=>{var u;l.current||(u=s.triggerRef.current)==null||u.focus(),l.current=!1,c.preventDefault()}),onInteractOutside:Un(t.onInteractOutside,c=>{const u=c.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;(!s.modal||f)&&(l.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),ddt=p.forwardRef(Vu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Hu(i);return a.jsx(Wut,{...s,...r,ref:n})},"DropdownMenuItem")),fdt=p.forwardRef(Vu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Hu(i);return a.jsx(Kut,{...s,...r,ref:n})},"DropdownMenuCheckboxItem")),hdt=p.forwardRef(Vu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Hu(i);return a.jsx(Gut,{...s,...r,ref:n})},"DropdownMenuRadioGroup")),pdt=p.forwardRef(Vu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Hu(i);return a.jsx(Xut,{...s,...r,ref:n})},"DropdownMenuRadioItem")),mdt=p.forwardRef(Vu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Hu(i);return a.jsx(Yut,{...s,...r,ref:n})},"DropdownMenuItemIndicator")),gdt=p.forwardRef(Vu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Hu(i);return a.jsx(Zut,{...s,...r,ref:n})},"DropdownMenuSeparator")),bdt=Vu(e=>{const{__scopeDropdownMenu:t,children:n,open:i,onOpenChange:r,defaultOpen:s}=e,o=Hu(t),[l,c]=Id({prop:i,defaultProp:s??!1,onChange:r,caller:"DropdownMenuSub"});return a.jsx(Jut,{...o,open:l,onOpenChange:c,children:n})},"DropdownMenuSub"),ydt=p.forwardRef(Vu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Hu(i);return a.jsx(edt,{...s,...r,ref:n})},"DropdownMenuSubTrigger")),vdt=p.forwardRef(Vu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Hu(i);return a.jsx(tdt,{...s,...r,ref:n,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuSubContent")),xdt=sdt,wdt=odt,NRe=ldt,kdt=udt,RRe=ddt,Odt=fdt,Sdt=hdt,Edt=pdt,IRe=mdt,Cdt=gdt,Adt=bdt,Tdt=ydt,_dt=vdt,jdt=Object.defineProperty,Sb=(e,t)=>jdt(e,"name",{value:t,configurable:!0}),GV="Popover",[PRe,Ehn]=Qc(GV,[X1]),XV=X1(),[Ndt,Z1]=PRe(GV),Rdt=Sb(e=>{const{__scopePopover:t,children:n,open:i,defaultOpen:r,onOpenChange:s,modal:o=!1}=e,l=XV(t),c=p.useRef(null),[u,d]=p.useState(!1),[f,h]=Id({prop:i,defaultProp:r??!1,onChange:s,caller:GV});return a.jsx(sM,{...l,children:a.jsx(Ndt,{scope:t,contentId:Jg(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:p.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:u,onCustomAnchorAdd:p.useCallback(()=>d(!0),[]),onCustomAnchorRemove:p.useCallback(()=>d(!1),[]),modal:o,children:n})})},"Popover"),Idt="PopoverTrigger",Pdt=p.forwardRef(Sb(function(t,n){const{__scopePopover:i,...r}=t,s=Z1(Idt,i),o=XV(i),l=Rr(n,s.triggerRef),c=a.jsx(Jr.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":YV(s.open),...r,ref:l,onClick:Un(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:a.jsx($V,{asChild:!0,...o,children:c})},"PopoverTrigger")),DRe="PopoverPortal",[Ddt,Mdt]=PRe(DRe,{forceMount:void 0}),Ldt=Sb(e=>{const{__scopePopover:t,forceMount:n,children:i,container:r}=e,s=Z1(DRe,t);return a.jsx(Ddt,{scope:t,forceMount:n,children:a.jsx(Rh,{present:n||s.open,children:a.jsx(RV,{asChild:!0,container:r,children:i})})})},"PopoverPortal"),xC="PopoverContent",$dt=p.forwardRef(Sb(function(t,n){const i=Mdt(xC,t.__scopePopover),{forceMount:r=i.forceMount,...s}=t,o=Z1(xC,t.__scopePopover);return a.jsx(Rh,{present:r||o.open,children:o.modal?a.jsx(Bdt,{...s,ref:n}):a.jsx(Udt,{...s,ref:n})})},"PopoverContent")),Fdt=Yp("PopoverContent.RemoveScroll"),Bdt=p.forwardRef(Sb(function(t,n){const i=Z1(xC,t.__scopePopover),r=p.useRef(null),s=Rr(n,r),o=p.useRef(!1);return p.useEffect(()=>{const l=r.current;if(l)return YNe(l)},[]),a.jsx(PV,{as:Fdt,allowPinchZoom:!0,children:a.jsx(MRe,{...t,ref:s,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Un(t.onCloseAutoFocus,l=>{var c;l.preventDefault(),o.current||(c=i.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Un(t.onPointerDownOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;o.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:Un(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),Udt=p.forwardRef(Sb(function(t,n){const i=Z1(xC,t.__scopePopover),r=p.useRef(!1),s=p.useRef(!1);return a.jsx(MRe,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,c;(l=t.onCloseAutoFocus)==null||l.call(t,o),o.defaultPrevented||(r.current||(c=i.triggerRef.current)==null||c.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var u,d;(u=t.onInteractOutside)==null||u.call(t,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=o.target;((d=i.triggerRef.current)==null?void 0:d.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})},"PopoverContentNonModal")),MRe=p.forwardRef(Sb(function(t,n){const{__scopePopover:i,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,...h}=t,m=Z1(xC,i),g=XV(i);return nM(),a.jsx(MNe,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:a.jsx(_V,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:f,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),deferPointerDownOutside:!0,children:a.jsx(FV,{"data-state":YV(m.open),role:"dialog",id:m.contentId,...g,...h,ref:n,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl"));function YV(e){return e?"open":"closed"}Sb(YV,"getState");var LRe=Rdt,$Re=Pdt,FRe=Ldt,BRe=$dt,Qdt=Object.defineProperty,Tl=(e,t)=>Qdt(e,"name",{value:t,configurable:!0}),URe="Radio",[zdt,QRe]=Qc(URe),[Vdt,uM]=zdt(URe);function zRe(e){const{__scopeRadio:t,checked:n=!1,children:i,disabled:r,form:s,name:o,onCheck:l,required:c,value:u="on",internal_do_not_use_render:d}=e,[f,h]=p.useState(null),[m,g]=p.useState(null),b=p.useRef(!1),[v,y]=p.useReducer(k=>k+1,0),w=f?!!s||!!f.closest("form"):!0,x={checked:n,disabled:r,required:c,name:o,form:s,value:u,control:f,setControl:h,hasConsumerStoppedPropagationRef:b,userInteractionCount:v,onUserInteraction:y,isFormControl:w,bubbleInput:m,setBubbleInput:g,onCheck:Tl(()=>l==null?void 0:l(),"onCheck")};return a.jsx(Vdt,{scope:t,...x,children:VRe(d)?d(x):i})}Tl(zRe,"RadioProvider");var Hdt="RadioTrigger",qdt=p.forwardRef(Tl(function({__scopeRadio:t,onClick:n,...i},r){const{checked:s,disabled:o,value:l,setControl:c,onCheck:u,hasConsumerStoppedPropagationRef:d,onUserInteraction:f,isFormControl:h,bubbleInput:m}=uM(Hdt,t),g=Rr(r,c);return a.jsx(Jr.button,{type:"button",role:"radio","aria-checked":s,"data-state":ZV(s),"data-disabled":o?"":void 0,disabled:o,value:l,...i,ref:g,onClick:Un(n,b=>{s||(f(),u()),m&&h&&(d.current=b.isPropagationStopped(),d.current||b.stopPropagation())})})},"RadioTrigger")),Wdt="RadioIndicator",Kdt=p.forwardRef(Tl(function(t,n){const{__scopeRadio:i,forceMount:r,...s}=t,o=uM(Wdt,i);return a.jsx(Rh,{present:r||o.checked,children:a.jsx(Jr.span,{"data-state":ZV(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:n})})},"RadioIndicator")),Gdt="RadioBubbleInput",Xdt=p.forwardRef(Tl(function({__scopeRadio:t,onClick:n,...i},r){const{control:s,checked:o,required:l,disabled:c,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:m,hasConsumerStoppedPropagationRef:g,userInteractionCount:b}=uM(Gdt,t),v=Rr(r,m),y=eT(s),w=p.useRef(!1),x=p.useRef(o),k=p.useRef(b);p.useEffect(()=>{const O=h;if(!O)return;const A=window.HTMLInputElement.prototype,j=Object.getOwnPropertyDescriptor(A,"checked").set,T=b!==k.current;k.current=b;const R=x.current!==o;x.current=o;const C=!(T&&g.current);if(R&&j){w.current=!T;const N=new Event("click",{bubbles:C});j.call(O,o),O.dispatchEvent(N),w.current=!1}},[h,o,g,b]);const S=p.useRef(o);return a.jsx(Jr.input,{type:"radio","aria-hidden":!0,defaultChecked:S.current,required:l,disabled:c,name:u,value:d,form:f,...i,tabIndex:-1,ref:v,onClick:Un(n,O=>{w.current&&O.stopPropagation()}),style:{...i.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function VRe(e){return typeof e=="function"}Tl(VRe,"isFunction");function ZV(e){return e?"checked":"unchecked"}Tl(ZV,"getState");var Ydt=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],JV="RadioGroup",[Zdt,Chn]=Qc(JV,[Y1,QRe]),HRe=Y1(),dM=QRe(),[Jdt,eft]=Zdt(JV),tft=p.forwardRef(Tl(function(t,n){const{__scopeRadioGroup:i,name:r,form:s,defaultValue:o,value:l,required:c=!1,disabled:u=!1,orientation:d,dir:f,loop:h=!0,onValueChange:m,...g}=t,b=HRe(i),v=JA(f),[y,w]=Id({prop:l,defaultProp:o??null,onChange:m,caller:JV}),[x,k]=p.useState(null),S=Rr(n,k),O=p.useRef(y);return p.useEffect(()=>{const A=s?x==null?void 0:x.ownerDocument.getElementById(s):x==null?void 0:x.closest("form");if(A instanceof HTMLFormElement){const E=Tl(()=>w(O.current),"reset");return A.addEventListener("reset",E),()=>A.removeEventListener("reset",E)}},[x,s,w]),a.jsx(Jdt,{scope:i,name:r,form:s,required:c,disabled:u,value:y,onValueChange:w,children:a.jsx(QV,{asChild:!0,...b,orientation:d,dir:v,loop:h,children:a.jsx(Jr.div,{role:"radiogroup","aria-required":c,"aria-orientation":d,"data-disabled":u?"":void 0,dir:v,...g,ref:S})})})},"RadioGroup")),nft="RadioGroupItemProvider",ift="RadioGroupItemTrigger";function qRe(e){const{__scopeRadioGroup:t,value:n,disabled:i,children:r,internal_do_not_use_render:s}=e,o=eft(nft,t),l=dM(t),c=o.disabled||i;return a.jsx(zRe,{...l,checked:o.value===n,disabled:c,required:o.required,name:o.name,form:o.form,value:n,onCheck:()=>o.onValueChange(n),internal_do_not_use_render:s,children:r})}Tl(qRe,"RadioGroupItemProvider");var rft=p.forwardRef(Tl(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=HRe(i),o=dM(i),{checked:l,disabled:c}=uM(ift,o.__scopeRadio),u=p.useRef(null),d=Rr(n,u),f=p.useRef(!1);return p.useEffect(()=>{const h=Tl(g=>{Ydt.includes(g.key)&&(f.current=!0)},"handleKeyDown"),m=Tl(()=>f.current=!1,"handleKeyUp");return document.addEventListener("keydown",h),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",m)}},[]),a.jsx(zV,{asChild:!0,...s,focusable:!c,active:l,children:a.jsx(qdt,{...o,...r,ref:d,onKeyDown:Un(r.onKeyDown,h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:Un(r.onFocus,()=>{var h;f.current&&((h=u.current)==null||h.click())})})})},"RadioGroupItemTrigger")),sft=p.forwardRef(Tl(function(t,n){const{__scopeRadioGroup:i,value:r,disabled:s,...o}=t;return a.jsx(qRe,{__scopeRadioGroup:i,value:r,disabled:s,internal_do_not_use_render:({isFormControl:l})=>a.jsxs(a.Fragment,{children:[a.jsx(rft,{...o,ref:n,__scopeRadioGroup:i}),l&&a.jsx(aft,{__scopeRadioGroup:i})]})})},"RadioGroupItem")),aft=p.forwardRef(Tl(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=dM(i);return a.jsx(Xdt,{...s,...r,ref:n})},"RadioGroupItemBubbleInput")),oft=p.forwardRef(Tl(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=dM(i);return a.jsx(Kdt,{...s,...r,ref:n})},"RadioGroupIndicator")),lft=Object.defineProperty,eb=(e,t)=>lft(e,"name",{value:t,configurable:!0}),eH="Switch",[cft,Ahn]=Qc(eH),[uft,tH]=cft(eH);function WRe(e){const{__scopeSwitch:t,checked:n,children:i,defaultChecked:r,disabled:s,form:o,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,m]=Id({prop:n,defaultProp:r??!1,onChange:c,caller:eH}),[g,b]=p.useState(null),[v,y]=p.useState(null),w=p.useRef(!1),[x,k]=p.useReducer(A=>A+1,0),S=g?!!o||!!g.closest("form"):!0,O={checked:h,setChecked:m,disabled:s,control:g,setControl:b,name:l,form:o,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:x,onUserInteraction:k,required:u,defaultChecked:r,isFormControl:S,bubbleInput:v,setBubbleInput:y};return a.jsx(uft,{scope:t,...O,children:KRe(f)?f(O):i})}eb(WRe,"SwitchProvider");var dft="SwitchTrigger",fft=p.forwardRef(eb(function({__scopeSwitch:t,onClick:n,...i},r){const{control:s,form:o,value:l,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:g,isFormControl:b,bubbleInput:v}=tH(dft,t),y=Rr(r,f),w=p.useRef(u);return p.useEffect(()=>{const x=o?s==null?void 0:s.ownerDocument.getElementById(o):s==null?void 0:s.form;if(x instanceof HTMLFormElement){const k=eb(()=>h(w.current),"reset");return x.addEventListener("reset",k),()=>x.removeEventListener("reset",k)}},[s,o,h]),a.jsx(Jr.button,{type:"button",role:"switch","aria-checked":u,"aria-required":d,"data-state":nH(u),"data-disabled":c?"":void 0,disabled:c,value:l,...i,ref:y,onClick:Un(n,x=>{g(),h(k=>!k),v&&b&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})})},"SwitchTrigger")),hft=p.forwardRef(eb(function(t,n){const{__scopeSwitch:i,name:r,checked:s,defaultChecked:o,required:l,disabled:c,value:u,onCheckedChange:d,form:f,...h}=t;return a.jsx(WRe,{__scopeSwitch:i,checked:s,defaultChecked:o,disabled:c,required:l,onCheckedChange:d,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>a.jsxs(a.Fragment,{children:[a.jsx(fft,{...h,ref:n,__scopeSwitch:i}),m&&a.jsx(bft,{__scopeSwitch:i})]})})},"Switch")),pft="SwitchThumb",mft=p.forwardRef(eb(function(t,n){const{__scopeSwitch:i,...r}=t,s=tH(pft,i);return a.jsx(Jr.span,{"data-state":nH(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:n})},"SwitchThumb")),gft="SwitchBubbleInput",bft=p.forwardRef(eb(function({__scopeSwitch:t,onClick:n,...i},r){const{control:s,hasConsumerStoppedPropagationRef:o,userInteractionCount:l,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:g,bubbleInput:b,setBubbleInput:v}=tH(gft,t),y=Rr(r,v),w=eT(s),x=p.useRef(!1),k=p.useRef(c),S=p.useRef(l);p.useEffect(()=>{const A=b;if(!A)return;const E=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(E,"checked").set,R=l!==S.current;S.current=l;const C=k.current!==c;k.current=c;const N=!(R&&o.current);if(C&&T){x.current=!R;const P=new Event("click",{bubbles:N});T.call(A,c),A.dispatchEvent(P),x.current=!1}},[b,c,o,l]);const O=p.useRef(c);return a.jsx(Jr.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??O.current,required:d,disabled:f,name:h,value:m,form:g,...i,tabIndex:-1,ref:y,onClick:Un(n,A=>{x.current&&A.stopPropagation()}),style:{...i.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function KRe(e){return typeof e=="function"}eb(KRe,"isFunction");function nH(e){return e?"checked":"unchecked"}eb(nH,"getState");var yft=Object.defineProperty,vft=(e,t)=>yft(e,"name",{value:t,configurable:!0}),xft="Toggle",wft=p.forwardRef(vft(function(t,n){const{pressed:i,defaultPressed:r,onPressedChange:s,...o}=t,[l,c]=Id({prop:i,onChange:s,defaultProp:r??!1,caller:xft});return a.jsx(Jr.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":t.disabled?"":void 0,...o,ref:n,onClick:Un(t.onClick,()=>{t.disabled||c(!l)})})},"Toggle")),kft=Object.defineProperty,tb=(e,t)=>kft(e,"name",{value:t,configurable:!0}),J1="ToggleGroup",[GRe,Thn]=Qc(J1,[Y1]),XRe=Y1(),Oft=p.forwardRef(tb(function(t,n){const{type:i,...r}=t;if(i==="single"){const s=r;return a.jsx(Sft,{role:"radiogroup",...s,ref:n})}if(i==="multiple"){const s=r;return a.jsx(Eft,{role:"toolbar",...s,ref:n})}throw new Error(`Missing prop \`type\` expected on \`${J1}\``)},"ToggleGroup")),[YRe,ZRe]=GRe(J1),Sft=p.forwardRef(tb(function(t,n){const{value:i,defaultValue:r,onValueChange:s=tb(()=>{},"onValueChange"),...o}=t,[l,c]=Id({prop:i,defaultProp:r??"",onChange:s,caller:J1});return a.jsx(YRe,{scope:t.__scopeToggleGroup,type:"single",value:p.useMemo(()=>l?[l]:[],[l]),onItemActivate:c,onItemDeactivate:p.useCallback(()=>c(""),[c]),children:a.jsx(JRe,{...o,ref:n})})},"ToggleGroupImplSingle")),Eft=p.forwardRef(tb(function(t,n){const{value:i,defaultValue:r,onValueChange:s=tb(()=>{},"onValueChange"),...o}=t,[l,c]=Id({prop:i,defaultProp:r??[],onChange:s,caller:J1}),u=p.useCallback(f=>c((h=[])=>[...h,f]),[c]),d=p.useCallback(f=>c((h=[])=>h.filter(m=>m!==f)),[c]);return a.jsx(YRe,{scope:t.__scopeToggleGroup,type:"multiple",value:l,onItemActivate:u,onItemDeactivate:d,children:a.jsx(JRe,{...o,ref:n})})},"ToggleGroupImplMultiple")),[Cft,Aft]=GRe(J1),JRe=p.forwardRef(tb(function(t,n){const{__scopeToggleGroup:i,disabled:r=!1,rovingFocus:s=!0,orientation:o,dir:l,loop:c=!0,...u}=t,d=XRe(i),f=JA(l),h={dir:f,...u};return a.jsx(Cft,{scope:i,rovingFocus:s,disabled:r,children:s?a.jsx(QV,{asChild:!0,...d,orientation:o,dir:f,loop:c,children:a.jsx(Jr.div,{...h,ref:n})}):a.jsx(Jr.div,{...h,ref:n})})},"ToggleGroupImpl")),CB="ToggleGroupItem",Tft=p.forwardRef(tb(function(t,n){const i=ZRe(CB,t.__scopeToggleGroup),r=Aft(CB,t.__scopeToggleGroup),s=XRe(t.__scopeToggleGroup),o=i.value.includes(t.value),l=r.disabled||t.disabled,c={...t,pressed:o,disabled:l},u=p.useRef(null);return r.rovingFocus?a.jsx(zV,{asChild:!0,...s,focusable:!l,active:o,ref:u,children:a.jsx(Eee,{...c,ref:n})}):a.jsx(Eee,{...c,ref:n})},"ToggleGroupItem")),Eee=p.forwardRef(tb(function(t,n){const{__scopeToggleGroup:i,value:r,...s}=t,o=ZRe(CB,i),l={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},c=o.type==="single"?l:void 0;return a.jsx(wft,{...c,...s,ref:n,onPressedChange:u=>{u?o.onItemActivate(r):o.onItemDeactivate(r)}})},"ToggleGroupItemImpl")),_ft=Object.defineProperty,Mo=(e,t)=>_ft(e,"name",{value:t,configurable:!0}),[iH,_hn]=Qc("Tooltip",[X1]),rH=X1(),jft="TooltipProvider",Nft=700,AB="tooltip.open",[Rft,sH]=iH(jft),Ift=Mo(e=>{const{__scopeTooltip:t,delayDuration:n=Nft,skipDelayDuration:i=300,disableHoverableContent:r=!1,children:s}=e,o=p.useRef(!0),l=p.useRef(!1),c=p.useRef(0);return p.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),a.jsx(Rft,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:p.useCallback(()=>{i<=0||(window.clearTimeout(c.current),o.current=!1)},[i]),onClose:p.useCallback(()=>{i<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,i))},[i]),isPointerInTransitRef:l,onPointerInTransitChange:p.useCallback(u=>{l.current=u},[]),disableHoverableContent:r,children:s})},"TooltipProvider"),TB="Tooltip",[Pft,nT]=iH(TB),Dft=Mo(e=>{const{__scopeTooltip:t,children:n,open:i,defaultOpen:r,onOpenChange:s,disableHoverableContent:o,delayDuration:l}=e,c=sH(TB,e.__scopeTooltip),u=rH(t),[d,f]=p.useState(null),[h,m]=p.useState(void 0),g=Jg(),b=p.useRef(0),v=o??c.disableHoverableContent,y=l??c.delayDuration,w=p.useRef(!1),[x,k]=Id({prop:i,defaultProp:r??!1,onChange:Mo(T=>{T?(c.onOpen(),document.dispatchEvent(new CustomEvent(AB))):c.onClose(),s==null||s(T)},"onChange"),caller:TB}),S=p.useMemo(()=>x?w.current?"delayed-open":"instant-open":"closed",[x]),O=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,w.current=!1,k(!0)},[k]),A=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,k(!1)},[k]),E=p.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{w.current=!0,k(!0),b.current=0},y)},[y,k]);p.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]);const j=h??g;return a.jsx(sM,{...u,children:a.jsx(Pft,{scope:t,contentId:j,setContentId:m,open:x,stateAttribute:S,trigger:d,onTriggerChange:f,onTriggerEnter:p.useCallback(()=>{c.isOpenDelayedRef.current?E():O()},[c.isOpenDelayedRef,E,O]),onTriggerLeave:p.useCallback(()=>{v?A():(window.clearTimeout(b.current),b.current=0)},[A,v]),onOpen:O,onClose:A,disableHoverableContent:v,children:n})})},"Tooltip"),Cee="TooltipTrigger",Mft=p.forwardRef(Mo(function(t,n){const{__scopeTooltip:i,...r}=t,s=nT(Cee,i),o=sH(Cee,i),l=rH(i),c=p.useRef(null),u=Rr(n,c,s.onTriggerChange),d=p.useRef(!1),f=p.useRef(!1),h=p.useCallback(()=>d.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),a.jsx($V,{asChild:!0,...l,children:a.jsx(Jr.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:u,onPointerMove:Un(t.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:Un(t.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:Un(t.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Un(t.onFocus,()=>{d.current||s.onOpen()}),onBlur:Un(t.onBlur,s.onClose),onClick:Un(t.onClick,s.onClose)})})},"TooltipTrigger")),eIe="TooltipPortal",[Lft,$ft]=iH(eIe,{forceMount:void 0}),Fft=Mo(e=>{const{__scopeTooltip:t,forceMount:n,children:i,container:r}=e,s=nT(eIe,t);return a.jsx(Lft,{scope:t,forceMount:n,children:a.jsx(Rh,{present:n||s.open,children:a.jsx(RV,{asChild:!0,container:r,children:i})})})},"TooltipPortal"),wC="TooltipContent",Bft=p.forwardRef(Mo(function(t,n){const i=$ft(wC,t.__scopeTooltip),{forceMount:r=i.forceMount,side:s="top",...o}=t,l=nT(wC,t.__scopeTooltip);return a.jsx(Rh,{present:r||l.open,children:l.disableHoverableContent?a.jsx(tIe,{side:s,...o,ref:n}):a.jsx(Uft,{side:s,...o,ref:n})})},"TooltipContent")),Uft=p.forwardRef(Mo(function(t,n){const i=nT(wC,t.__scopeTooltip),r=sH(wC,t.__scopeTooltip),s=p.useRef(null),o=Rr(n,s),[l,c]=p.useState(null),{trigger:u,onClose:d}=i,f=s.current,{onPointerInTransitChange:h}=r,m=p.useCallback(()=>{c(null),h(!1)},[h]),g=p.useCallback((b,v)=>{const y=b.currentTarget,w={x:b.clientX,y:b.clientY},x=nIe(w,y.getBoundingClientRect()),k=iIe(w,x),S=rIe(v.getBoundingClientRect()),O=aIe([...k,...S]);c(O),h(!0)},[h]);return p.useEffect(()=>()=>m(),[m]),p.useEffect(()=>{if(u&&f){const b=Mo(y=>g(y,f),"handleTriggerLeave"),v=Mo(y=>g(y,u),"handleContentLeave");return u.addEventListener("pointerleave",b),f.addEventListener("pointerleave",v),()=>{u.removeEventListener("pointerleave",b),f.removeEventListener("pointerleave",v)}}},[u,f,g,m]),p.useEffect(()=>{if(l){const b=Mo(v=>{const y=v.target,w={x:v.clientX,y:v.clientY},x=(u==null?void 0:u.contains(y))||(f==null?void 0:f.contains(y)),k=!sIe(w,l);x?m():k&&(m(),d())},"handleTrackPointerGrace");return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[u,f,l,d,m]),a.jsx(tIe,{...t,ref:o})},"TooltipContentHoverable")),Qft=hNe("TooltipContent"),tIe=p.forwardRef(Mo(function(t,n){const{__scopeTooltip:i,children:r,"aria-label":s,id:o,onEscapeKeyDown:l,onPointerDownOutside:c,...u}=t,d=nT(wC,i),f=rH(i),{onClose:h}=d;p.useEffect(()=>(document.addEventListener(AB,h),()=>document.removeEventListener(AB,h)),[h]),p.useEffect(()=>{if(d.trigger){const g=Mo(b=>{b.target instanceof Node&&b.target.contains(d.trigger)&&h()},"handleScroll");return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[d.trigger,h]);const{setContentId:m}=d;return Od(()=>(m(o),()=>{m(void 0)}),[o,m]),a.jsx(_V,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:h,children:a.jsxs(FV,{"data-state":d.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:d.contentId,...f,...u,ref:n,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[a.jsx(Qft,{children:r}),s?a.jsx(mlt,{id:d.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl"));function nIe(e,t){const n=Math.abs(t.top-e.y),i=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,i,r,s)){case s:return"left";case r:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}Mo(nIe,"getExitSideFromRect");function iIe(e,t,n=5){const i=[];switch(t){case"top":i.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":i.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":i.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":i.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return i}Mo(iIe,"getPaddedExitPoints");function rIe(e){const{top:t,right:n,bottom:i,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:i},{x:r,y:i}]}Mo(rIe,"getPointsFromRect");function sIe(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,o=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}Mo(sIe,"isPointInPolygon");function aIe(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),oIe(t)}Mo(aIe,"getHull");function oIe(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let i=e.length-1;i>=0;i--){const r=e[i];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}Mo(oIe,"getHullPresorted");var zft=Ift,Vft=Dft,lIe=Mft,Hft=Fft,qft=Bft;function nb(e){const t=p.useRef(e);return t.current=e,t}let n1=[],m_=!1;const Aee=e=>{var t,n;if(e.key==="Escape"){const[i]=n1;i&&(e.preventDefault(),(n=(t=i.callback).current)==null||n.call(t))}},cIe=()=>{n1.length>0&&!m_?(document.body.addEventListener("keydown",Aee),m_=!0):n1.length===0&&m_&&(document.body.removeEventListener("keydown",Aee),m_=!1)},Wft=e=>{n1.unshift(e),cIe()},Kft=({id:e})=>{n1=n1.filter(t=>t.id!==e),cIe()},iT=(e,t)=>{const n=p.useId(),i=nb(t);p.useEffect(()=>{if(!e)return;const r={id:n,callback:i};return Wft(r),()=>Kft(r)},[n,e,i])},Gft=p.createContext(null);function uIe(){const e=p.useContext(Gft);return(e==null?void 0:e.linkComponent)??"a"}function rT(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}const Xft=()=>oNe,Tee=(e,t=!1,n="TransitionGroup")=>{const i=[];return p.Children.forEach(e,r=>{if(r&&typeof r=="object"&&"key"in r&&r.key)i.push(r);else if(t)throw new Error(`Child elements of <${n} /> must include a \`key\``)}),i},F0=()=>{},B0=e=>{const t=p.useRef(e);return t.current=e,p.useCallback(n=>t.current(n),[])};function Yft(e,t,n,i){const r=e.reduce((c,u)=>({...c,[u.key]:1}),{}),s=t.reduce((c,u)=>({...c,[u.component.key]:1}),{}),o=e.filter(c=>!s[c.key]).map(n),l=t.map(c=>({...c,component:e.find(({key:u})=>u===c.component.key)||c.component,shouldRender:!!r[c.component.key]}));return i==="append"?l.concat(o):o.concat(l)}function Zft(e,t,n){if((oNe||Xot)&&t&&n>1)throw new Error(`Cannot use forwardRef with multiple children in <${e} />`)}const Jft="_TransitionGroupChild_1hv1z_1",eht={TransitionGroupChild:Jft},dIe={enter:!1,enterActive:!1,exit:!1,exitActive:!1,interrupted:!1},tht=e=>({...dIe,enter:!e}),nht=(e,t)=>{switch(t.type){case"enter-before":return{enter:!0,enterActive:!1,exit:!1,exitActive:!1,interrupted:e.interrupted||e.exit};case"enter-active":return{enter:!0,enterActive:!0,exit:!1,exitActive:!1,interrupted:!1};case"exit-before":return{enter:!1,enterActive:!1,exit:!0,exitActive:!1,interrupted:e.interrupted||e.enter};case"exit-active":return{enter:!1,enterActive:!1,exit:!0,exitActive:!0,interrupted:!1};case"done":default:return dIe}},iht=({ref:e,as:t,children:n,className:i,transitionId:r,style:s,preventMountTransition:o,shouldRender:l,enterDuration:c,exitDuration:u,removeChild:d,onEnter:f,onEnterActive:h,onEnterComplete:m,onExit:g,onExitActive:b,onExitComplete:v})=>{const[y,w]=p.useReducer(nht,tht(o||!1)),x=p.useRef(!1),k=p.useRef(null),S=p.useRef(c);S.current=c;const O=p.useRef(u);O.current=u;const A=p.useRef(null),E=p.useCallback(j=>{const T=k.current;if(!(!T||j===A.current))switch(A.current=j,j){case"enter":f(T);break;case"enter-active":h(T);break;case"enter-complete":m(T);break;case"exit":g(T);break;case"exit-active":b(T);break;case"exit-complete":v(T);break}},[f,h,m,g,b,v]);return Pi.useLayoutEffect(()=>{if(!l){let R;w({type:"exit-before"}),E("exit");const C=hI(()=>{w({type:"exit-active"}),E("exit-active"),R=window.setTimeout(()=>{E("exit-complete"),d()},O.current)});return()=>{C(),R!==void 0&&clearTimeout(R)}}if(o&&!x.current){x.current=!0;return}let j;w({type:"enter-before"}),E("enter");const T=hI(()=>{w({type:"enter-active"}),E("enter-active"),j=window.setTimeout(()=>{w({type:"done"}),E("enter-complete")},S.current)});return()=>{T(),j!==void 0&&clearTimeout(j)}},[l,o,d,E]),p.useEffect(()=>()=>{x.current=!1},[]),a.jsx(t,{ref:rT([k,e]),className:qi(i,eht.TransitionGroupChild),"data-transition-id":r,style:s,"data-entering":y.enter?"":void 0,"data-entering-active":y.enterActive?"":void 0,"data-exiting":y.exit?"":void 0,"data-exiting-active":y.exitActive?"":void 0,"data-interrupted":y.interrupted?"":void 0,children:n})},rht=e=>{const{enterMountDelay:t,preventMountTransition:n}=e,i=!n&&t!=null?t:null,[r,s]=p.useState(i==null);return OV(()=>s(!0),r?null:i),r?a.jsx(iht,{...e}):null},ek=e=>{const{ref:t,as:n="span",children:i,className:r,transitionId:s,style:o,enterDuration:l=0,exitDuration:c=0,preventInitialTransition:u=!0,enterMountDelay:d,insertMethod:f="append",disableAnimations:h=Xft()}=e,m=B0(e.onEnter??F0),g=B0(e.onEnterActive??F0),b=B0(e.onEnterComplete??F0),v=B0(e.onExit??F0),y=B0(e.onExitActive??F0),w=B0(e.onExitComplete??F0);p.Children.forEach(i,O=>{if(O&&!O.key)throw new Error("Child elements of must include a `key`")});const x=p.useCallback(O=>({component:O,shouldRender:!0,removeChild:()=>{S(A=>A.filter(E=>O.key!==E.component.key))},onEnter:m,onEnterActive:g,onEnterComplete:b,onExit:v,onExitActive:y,onExitComplete:w}),[m,g,b,v,y,w]),[k,S]=p.useState(()=>Tee(i).map(O=>({...x(O),preventMountTransition:u})));return p.useLayoutEffect(()=>{S(O=>{const A=Tee(i);return Yft(A,O,x,f)})},[i,f,x]),Zft("TransitionGroup",t,p.Children.count(i)),h?a.jsx(a.Fragment,{children:p.Children.map(i,O=>a.jsx(n,{ref:t,className:r,style:o,"data-transition-id":s,children:O}))}):a.jsx(a.Fragment,{children:k.map(({component:O,...A})=>a.jsx(rht,{...A,as:n,className:r,transitionId:s,enterDuration:l,exitDuration:c,enterMountDelay:d,style:o,ref:t,children:O},O.key))})},sht="_Button_1864l_1",aht="_ButtonInner_1864l_4",oht="_ButtonLoader_1864l_749",r4={Button:sht,ButtonInner:aht,ButtonLoader:oht},At=e=>{const{type:t="button",color:n="primary",variant:i="solid",pill:r=!0,uniform:s=!1,size:o="md",iconSize:l,gutterSize:c,loading:u,selected:d,block:f,opticallyAlign:h,children:m,className:g,onClick:b,disabled:v,disabledTone:y,inert:w=u,...x}=e,k=v||w,S=p.useCallback(O=>{v||b==null||b(O)},[b,v]);return a.jsxs("button",{type:t,className:qi(r4.Button,g),"data-color":n,"data-variant":i,"data-pill":r?"":void 0,"data-uniform":s?"":void 0,"data-size":o,"data-gutter-size":c,"data-icon-size":l,"data-loading":u?"":void 0,"data-selected":d?"":void 0,"data-block":f?"":void 0,"data-optically-align":h,onPointerEnter:SV,disabled:k,"aria-disabled":k,tabIndex:k?-1:void 0,"data-disabled":v?"":void 0,"data-disabled-tone":v?y:void 0,onClick:S,...x,children:[a.jsx(ek,{className:r4.ButtonLoader,enterDuration:250,exitDuration:150,children:u&&a.jsx(YA,{},"loader")}),a.jsx("span",{className:r4.ButtonInner,children:kV(m)})]})},lht=()=>{var e;return typeof ClipboardItem<"u"&&!!((e=navigator.clipboard)!=null&&e.write)};function cht(e){const{"text/plain":t,...n}=e;return new ClipboardItem({...n,...t?{"text/plain":new Blob([t],{type:"text/plain"})}:null})}async function uht(e,t=document.body){if(typeof e=="string")return _ee(e,t);try{return lht()?(await navigator.clipboard.write([cht(e)]),!0):e["text/plain"]?_ee(e["text/plain"],t):!1}catch{return!1}}async function _ee(e,t=document.body){if(navigator.clipboard)try{return await navigator.clipboard.writeText(e),!0}catch{}const n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.top="0",n.style.left="0",n.style.opacity="0",t.appendChild(n),n.focus(),n.select();let i=!1;try{i=document.execCommand("copy")}catch{}return t.removeChild(n),i}const dht="_TransitionItem_1o7b1_1",fht={TransitionItem:dht},hht=e=>{const{as:t="span",className:n,children:i,preventInitialTransition:r,insertMethod:s,transitionClassName:o,transitionPosition:l="absolute"}=e,{enterTotalDuration:c,exitTotalDuration:u,variables:d}=yht(e);return a.jsx(t,{className:qi("block",l==="absolute"&&"relative",n),"data-transition-position":l,style:d,children:a.jsx(ek,{as:t,className:qi(fht.TransitionItem,o),enterDuration:c,exitDuration:u,insertMethod:s,preventInitialTransition:r,children:i})})},pht=400,mht=500,ght=200,bht=300;function yht({initial:e,enter:t,exit:n,forceCompositeLayer:i}){const r=W3(e),s=W3(t),o=W3(n),l=[r,o,s].some(b=>b!=="none"),c=(t==null?void 0:t.duration)??(l?mht:pht),u=(t==null?void 0:t.timingFunction)??(l?"var(--cubic-enter)":"ease"),d=(n==null?void 0:n.duration)??(l?bht:ght),f=(n==null?void 0:n.timingFunction)??(l?"var(--cubic-exit)":"ease"),h=Fv({"tg-will-change":i?"transform, opacity":"auto","tg-enter-opacity":q3((t==null?void 0:t.opacity)??1),"tg-enter-transform":s,"tg-enter-filter":K3(t),"tg-enter-duration":o_(c),"tg-enter-delay":o_((t==null?void 0:t.delay)??0),"tg-enter-timing-function":u,"tg-exit-opacity":q3((n==null?void 0:n.opacity)??0),"tg-exit-transform":o,"tg-exit-filter":K3(n),"tg-exit-duration":o_(d),"tg-exit-delay":o_((n==null?void 0:n.delay)??0),"tg-exit-timing-function":f,"tg-initial-opacity":q3((e==null?void 0:e.opacity)??(n==null?void 0:n.opacity)??0),"tg-initial-transform":r==="none"?o:r,"tg-initial-filter":K3(e??n??{})}),m=((t==null?void 0:t.delay)??0)+c,g=((n==null?void 0:n.delay)??0)+d;return{enterTotalDuration:m,exitTotalDuration:g,variables:h}}const aH=({children:e,copyValue:t,onClick:n,...i})=>{const[r,s]=p.useState(!1),o=p.useRef(null),l=c=>{r||(s(!0),n==null||n(c),uht(typeof t=="function"?t():t),o.current=window.setTimeout(()=>{s(!1)},1300))};return p.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),a.jsxs(At,{...i,onClick:l,children:[a.jsx(hht,{className:"w-[var(--button-icon-size)] h-[var(--button-icon-size)]",initial:{scale:.6},enter:{scale:1,delay:150,duration:300},exit:{scale:.6,duration:150},forceCompositeLayer:!0,children:r?a.jsx(mC,{},"copied-icon"):a.jsx(Ije,{},"copy-icon")}),typeof e=="function"?e({copied:r}):e]})},vht="_Menu_1t4b0_1",xht="_MenuList_1t4b0_3",wht="_MenuItemContent_1t4b0_53",kht="_MenuItem_1t4b0_53",Oht="_ItemActions_1t4b0_98",Sht="_PressableInner_1t4b0_117",Eht="_Separator_1t4b0_135",Cht="_SubMenuItem_1t4b0_139",Aht="_SubTriggerIcon_1t4b0_141",Tht="_RadioItem_1t4b0_151",_ht="_RadioIndicatorActive_1t4b0_158",jht="_RadioIndicator_1t4b0_158",Nht="_CheckboxItem_1t4b0_249",Rht="_CheckboxIndicator_1t4b0_256",Iht="_CheckboxCircle_1t4b0_269",Ns={Menu:vht,MenuList:xht,MenuItemContent:wht,MenuItem:kht,ItemActions:Oht,PressableInner:Sht,Separator:Eht,SubMenuItem:Cht,SubTriggerIcon:Aht,RadioItem:Tht,RadioIndicatorActive:_ht,RadioIndicator:jht,CheckboxItem:Nht,CheckboxIndicator:Rht,CheckboxCircle:Iht},fIe=p.createContext(null),sT=()=>{const e=p.useContext(fIe);if(!e)throw new Error("Menu components must be wrapped in ");return e},rr=({children:e,forceOpen:t,onOpen:n,onClose:i,modal:r=!1})=>{const[s,o]=p.useState(!1),l=t??s,c=nb(n),u=nb(i),d=p.useCallback(h=>{var m,g;o(h),h?(m=c.current)==null||m.call(c):(g=u.current)==null||g.call(u)},[c,u]);iT(s,()=>{d(!1)});const f=p.useMemo(()=>({open:l,setOpen:d}),[l,d]);return a.jsx(fIe.Provider,{value:f,children:a.jsx(xdt,{open:l,onOpenChange:d,modal:r,children:e})})},Pht=({className:e,children:t,disabled:n,onSelect:i,onClick:r})=>{const{open:s}=sT(),o=l=>{s||l.preventDefault()};return i?a.jsx(RRe,{className:qi(Ns.MenuItem,e),onSelect:i,onClick:r,disabled:n,onPointerMove:o,onPointerLeave:o,children:a.jsx("div",{className:Ns.PressableInner,children:t})}):a.jsx("div",{className:qi(Ns.MenuItemContent,e),children:t})},Dht=({className:e,children:t})=>a.jsx("div",{className:qi(Ns.ItemActions,e),children:t}),Mht=({children:e,onClick:t})=>{const{setOpen:n}=sT();return a.jsx(At,{className:"rounded-sm",color:"secondary",size:"xs",uniform:!0,iconSize:"sm",variant:"ghost",onClick:i=>{i.stopPropagation(),n(!1),t(i)},children:e})},Lht=e=>{const{className:t,children:n,href:i,to:r,disabled:s,as:o,...l}=e,{open:c}=sT(),u=i||r,d=u?/^https?:\/\//.test(u):!0,f=uIe(),h=o||(d?"a":f),m=b=>{c||b.preventDefault()},g=d?{target:"_blank",rel:"noopener noreferrer",href:i??r}:{href:i,to:r};return a.jsx(RRe,{asChild:!0,className:qi(Ns.MenuItem,t),disabled:s,onPointerMove:d?void 0:m,onPointerLeave:d?void 0:m,children:a.jsx(h,{...g,...l,children:a.jsx("span",{className:Ns.PressableInner,children:n})})})},$ht=({className:e})=>a.jsx(Cdt,{className:qi(Ns.Separator,e),role:"separator"}),Fht=({children:e,side:t,sideOffset:n=5,align:i,alignOffset:r,width:s,minWidth:o,maxHeight:l})=>{const{open:c}=sT();return a.jsx(NRe,{forceMount:!0,children:a.jsx(ek,{className:Ns.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:c&&a.jsx(kdt,{forceMount:!0,className:Ns.MenuList,side:t,sideOffset:n,align:i,alignOffset:r??(i==="center"?0:-5),avoidCollisions:!0,collisionPadding:{bottom:30,top:30,left:12,right:12},onEscapeKeyDown:Lp,style:Fv({"menu-width":s,"menu-min-width":o,"menu-max-height":l}),children:e},"dropdown")})})},Bht=({children:e,disabled:t})=>a.jsx(wdt,{asChild:!0,disabled:t,children:e}),hIe=p.createContext(null),pIe=()=>{const e=p.useContext(hIe);if(!e)throw new Error("Submenu components must be wrapped in ");return e},Uht=({children:e,forceOpen:t,onOpen:n,onClose:i})=>{const[r,s]=p.useState(!1),o=p.useRef(null),l=t??r,c=nb(n),u=nb(i),d=p.useCallback(h=>{var m,g;s(h),h?(m=c.current)==null||m.call(c):(g=u.current)==null||g.call(u)},[c,u]);iT(r,()=>{var h;d(!1),(h=o.current)==null||h.focus()});const f=p.useMemo(()=>({open:l,setOpen:d,triggerRef:o}),[l,d]);return a.jsx(hIe.Provider,{value:f,children:a.jsx(Adt,{open:l,onOpenChange:d,children:e})})},Qht=({className:e,children:t,disabled:n})=>{const{open:i}=sT(),{triggerRef:r}=pIe(),s=o=>{i||o.preventDefault()};return a.jsx(Tdt,{ref:r,className:qi(Ns.MenuItem,Ns.SubMenuItem,e),disabled:n,onPointerMove:s,onPointerLeave:s,children:a.jsxs("div",{className:Ns.PressableInner,children:[t,a.jsx(eat,{width:"16",height:"16",className:Ns.SubTriggerIcon})]})})},zht=({children:e,sideOffset:t=4,alignOffset:n=-6,width:i="auto",minWidth:r="auto",maxHeight:s})=>{const{open:o}=pIe();return a.jsx(NRe,{forceMount:!0,children:a.jsx(ek,{className:Ns.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:o&&a.jsx(_dt,{className:Ns.MenuList,sideOffset:t,alignOffset:n,avoidCollisions:!0,collisionPadding:{bottom:30,top:30,left:12,right:12},onEscapeKeyDown:Lp,style:Fv({"menu-width":i,"menu-min-width":r,"menu-max-height":s}),children:e},"submenu")})})},Vht=({children:e,value:t,onChange:n,indicatorPosition:i="end",...r})=>a.jsx(Sdt,{...r,value:t,onValueChange:s=>n(s),"data-indicator-position":i,children:e}),Hht=({className:e,children:t,...n})=>a.jsx(Edt,{className:qi(Ns.MenuItem,Ns.RadioItem,e),...n,children:a.jsxs("div",{className:Ns.PressableInner,children:[a.jsx("div",{className:Ns.RadioIndicator,children:a.jsx(IRe,{className:Ns.RadioIndicatorActive})}),t]})}),qht=({className:e,children:t,indicatorPosition:n="end",indicatorVariant:i="solid",...r})=>a.jsx(Odt,{className:qi(Ns.MenuItem,Ns.CheckboxItem,e),...r,"data-indicator-position":n,"data-indicator-variant":i,children:a.jsxs("div",{className:Ns.PressableInner,children:[a.jsx("div",{className:Ns.CheckboxIndicator,children:a.jsx(IRe,{children:i==="ghost"?a.jsx(mC,{className:"size-4"}):a.jsx("div",{className:Ns.CheckboxCircle,children:a.jsx(mC,{className:"size-4"})})})}),t]})});rr.Content=Fht;rr.Item=Pht;rr.ItemActions=Dht;rr.ItemAction=Mht;rr.Link=Lht;rr.Separator=$ht;rr.Trigger=Bht;rr.Sub=Uht;rr.SubTrigger=Qht;rr.SubContent=zht;rr.CheckboxItem=qht;rr.RadioGroup=Vht;rr.RadioItem=Hht;const Wht="_Tooltip_16g2y_1",Kht="_TriggerDecorator_16g2y_73",mIe={Tooltip:Wht,TriggerDecorator:Kht},Ca=e=>{const{ref:t,children:n,content:i,forceOpen:r=i===null?!1:void 0,maxWidth:s=300,openDelay:o=150,interactive:l=!1,compact:c=!1,preventUnintentionalClickToClose:u,align:d,alignOffset:f=0,side:h,sideOffset:m=5,gutterSize:g="md",contentClassName:b,onPointerDown:v,onClick:y,...w}=e,[x,k]=p.useState(!1),[S,O]=p.useState(!1);OV(()=>O(!1),S?400:null);const A=r??x,E=T=>{typeof r!="boolean"&&(k(T),u&&O(T))},j=T=>{u&&S&&(T.preventDefault(),T.stopPropagation())};return a.jsxs(gIe,{open:A,delayDuration:o,onOpenChange:E,disableHoverableContent:!l,children:[a.jsx(lIe,{asChild:!0,children:a.jsx(dNe,{...w,ref:t,onPointerDown:T=>{j(T),v==null||v(T)},onClick:T=>{j(T),y==null||y(T)},children:n})}),a.jsx(bIe,{maxWidth:s,compact:c,align:d,alignOffset:f,side:h,sideOffset:m,gutterSize:g,className:b,children:i})]})},gIe=({children:e,open:t,onOpenChange:n,...i})=>(iT(t,()=>{n(!1)}),a.jsx(zft,{children:a.jsx(Vft,{open:t,onOpenChange:n,...i,children:e})})),bIe=({children:e,maxWidth:t=300,compact:n=!1,clickable:i=void 0,alignOffset:r=0,sideOffset:s=5,gutterSize:o="md",className:l,style:c,...u})=>a.jsx(Hft,{children:a.jsx(qft,{...u,className:qi(mIe.Tooltip,l),"data-compact":n,"data-clickable":i,"data-gutter-size":o,alignOffset:r,sideOffset:s,collisionPadding:15,hideWhenDetached:!0,style:{...c,maxWidth:t},onEscapeKeyDown:Lp,children:e})}),Ght=({children:e,asChild:t=!0,...n})=>a.jsx(lIe,{asChild:t,...n,children:e}),Xht=e=>{const{children:t,className:n,focusable:i=!0,ref:r,...s}=e,o=typeof t=="string";return a.jsx(dNe,{ref:r,...s,className:qi(mIe.TriggerDecorator,n),tabIndex:i?0:void 0,children:o?a.jsx("span",{children:t}):t})};Ca.Root=gIe;Ca.Content=bIe;Ca.Trigger=Ght;Ca.TriggerDecorator=Xht;const Yht=50,jee=48;function Zht(e){return(e.events??[]).flatMap(t=>{var r,s;const i=(((r=t.content)==null?void 0:r.parts)??[]).map(o=>typeof o.text=="string"?o.text:"").filter(Boolean).join("");return i?[{text:i,role:t.author??((s=t.content)==null?void 0:s.role)??"",ts:t.timestamp}]:[]})}function Jht(e){var t,n;for(const i of e.events??[])if(i.author==="user"||((t=i.content)==null?void 0:t.role)==="user"){const r=(((n=i.content)==null?void 0:n.parts)??[]).map(s=>s.text).find(Boolean);if(r)return r}return Q("search.untitledSession")}function ept(e,t,n){const i=Math.max(0,t-jee),r=Math.min(e.length,t+n+jee);return(i>0?"…":"")+e.slice(i,r).trim()+(r{var c;if((c=l.events)!=null&&c.length)return l;try{return await lC(t,e,l.id)}catch{return l}})),o=[];for(const l of s)for(const{text:c,role:u,ts:d}of Zht(l)){const f=c.toLowerCase().indexOf(i);if(f!==-1){o.push({type:"session",appId:t,sessionId:l.id,title:Jht(l),snippet:ept(c,f,i.length),role:u,ts:d??l.lastUpdateTime});break}}return o.sort((l,c)=>(c.ts??0)-(l.ts??0)),o.slice(0,Yht)}async function npt(e,t){if(!e||!t.trim())return{results:[]};let n;try{n=await ETe(e,t.trim())}catch(o){const l=String(o);return{results:[],note:l.includes("404")?Q("search.webUnavailable"):Q("search.webFailed",{message:l})}}const{mounted:i,results:r,error:s}=n;return i?s?{results:[],note:s}:{results:r.map((o,l)=>({type:"web",index:l,title:o.title,url:o.url,siteName:o.siteName,summary:o.summary}))}:{results:[],note:Q("search.webNotMounted")}}async function ipt(e,t,n,i){if(!t||!i.trim())return{results:[]};const r=await STe(t,e,i.trim(),n);if(!r.mounted)return{results:[],note:Q(e==="knowledge"?"search.knowledgeNotMounted":"search.memoryNotMounted")};if(r.error)return{results:[],note:r.error};const s=r.sourceName??Q(e==="knowledge"?"search.knowledge":"search.longTermMemory");return{results:r.results.map((o,l)=>e==="knowledge"?{type:"knowledge",index:l,content:o.content,sourceName:s,sourceType:r.sourceType}:{type:"memory",index:l,content:o.content,sourceName:s,sourceType:r.sourceType,author:o.author,ts:o.timestamp})}}async function rpt(e,t,n){return e==="session"?{results:await tpt(n.userId,n.appId,t)}:e==="web"?npt(n.appId,t):ipt(e,n.appId,n.userId,t)}function yIe({mirrored:e=!1}){return a.jsxs("g",{opacity:"0.5",transform:e?"translate(20 0) scale(-1 1)":void 0,children:[a.jsx("path",{className:"sidebar-panel-glyph__divider",d:"M5.938 6.833c.11 0 .249.102.249.292v6.042c0 .19-.14.291-.249.291s-.248-.101-.248-.291V7.125c0-.19.139-.292.248-.292Z",strokeWidth:"1.167"}),a.jsx("path",{className:"sidebar-panel-glyph__frame",d:"M14.5 3.75h-9a3 3 0 0 0-3 3v6.857a3 3 0 0 0 3 3h9a3 3 0 0 0 3-3V6.75a3 3 0 0 0-3-3Z",strokeWidth:"1.667",strokeLinecap:"round",strokeLinejoin:"round"})]})}function spt(e){return a.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:a.jsx(yIe,{})})}function apt(e){return a.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:a.jsx(yIe,{mirrored:!0})})}function opt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 8.333c.368 0 .667.299.667.667v2h2a.667.667 0 0 1 0 1.333h-2v2a.667.667 0 0 1-1.334 0v-2h-2a.667.667 0 0 1 0-1.333h2V9c0-.368.299-.667.667-.667ZM7.667 1c3.49 0 6.383 2.554 6.913 5.896a.667.667 0 0 1-1.317.208 5.667 5.667 0 1 0-9.708 4.424.67.67 0 0 1 .07.12.667.667 0 0 1-.13.834l-.95.853 4.788-.002a.667.667 0 0 1 0 1.334l-5.657.002c-.917 0-1.35-1.131-.67-1.744l1.163-1.045A6.97 6.97 0 0 1 .667 8c0-3.866 3.134-7 7-7Z",fill:"currentColor"})})}function lpt(e){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"7.333",cy:"7.333",r:"5.333"}),a.jsx("path",{d:"m11.133 11.133 2.867 2.867"})]})}function cpt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8 0.667c4.05 0 7.334 3.283 7.334 7.333 0 4.05-3.284 7.334-7.334 7.334S0.667 12.05 0.667 8 3.95 0.667 8 0.667Zm0 1.333a6 6 0 1 0 0 12A6 6 0 0 0 8 2ZM6.167 6c.368 0 .667.299.667.667v2a.667.667 0 0 1-1.334 0v-2c0-.368.299-.667.667-.667Zm3.666 0c.368 0 .667.299.667.667v2a.667.667 0 0 1-1.333 0v-2c0-.368.298-.667.666-.667Z",fill:"currentColor"})})}function vIe(e){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M7.58 2.6a.667.667 0 0 0-.667-.667h-.666a.667.667 0 0 0-.667.667v10.667c0 .368.299.666.667.666h.666a.667.667 0 0 0 .667-.666V2.6Zm1.333 10.667A2 2 0 0 1 6.913 15.267h-.666a2 2 0 0 1-2-2V2.6a2 2 0 0 1 2-2h.666a2 2 0 0 1 2 2v10.667Z",fill:"currentColor"}),a.jsx("path",{d:"M11.88 5.045a.667.667 0 0 0-.801-.514l-.653.136a.667.667 0 0 0-.504.786l1.85 8.092c.081.358.44.589.8.514l.653-.137a.667.667 0 0 0 .504-.786L11.88 5.045Zm3.155 7.82a2 2 0 0 1-1.512 2.358l-.653.136a2 2 0 0 1-2.403-1.541L8.617 5.726a2 2 0 0 1 1.513-2.358l.652-.136a2 2 0 0 1 2.404 1.541l1.849 8.092Z",fill:"currentColor"}),a.jsx("path",{d:"M4.247 2.6a.667.667 0 0 0-.667-.667h-.667a.667.667 0 0 0-.666.667v10.667c0 .368.298.666.666.666h.667a.667.667 0 0 0 .667-.666V2.6ZM5.58 13.267a2 2 0 0 1-2 2h-.667a2 2 0 0 1-2-2V2.6a2 2 0 0 1 2-2h.667a2 2 0 0 1 2 2v10.667Z",fill:"currentColor"})]})}function xIe(e){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M3.25 2.25h6l3.5 3.5v8H3.25v-11Z"}),a.jsx("path",{d:"M9.25 2.25v3.5h3.5M5.5 8.25h5M5.5 10.75h4"})]})}function upt({className:e="icon"}){return a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[a.jsx("path",{d:"M16.4 10.7a5.7 5.7 0 1 1-1.67-4.03"}),a.jsx("path",{d:"M15.25 15.25 19.6 19.6"})]})}function dpt({open:e}){return a.jsx("svg",{className:`search-source-chevron ${e?"open":""}`,viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:a.jsx("path",{d:"m3.25 4.75 2.75 2.5 2.75-2.5"})})}function fpt({active:e=!1,onClick:t}){const{t:n}=_e("workspaceTools");return a.jsxs("button",{className:`new-chat${e?" is-active":""}`,onClick:t,"aria-label":n("search.nav"),"aria-current":e?"page":void 0,title:n("search.nav"),children:[a.jsx(lpt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:n("search.nav")})]})}function hpt(e,t,n,i){const r=!!e,s=new Set((t==null?void 0:t.searchSources)??[]),o=l=>r?n?i("search.checkingCapabilities"):i("search.notMounted",{label:l}):i("search.selectAgent");return[{id:"session",label:i("search.sources.session"),ready:r,unavailableLabel:i("search.selectAgent")},{id:"web",label:i("search.sources.web"),ready:r&&s.has("web"),description:i("search.webDescription"),unavailableLabel:o(" web_search")},{id:"knowledge",label:i("search.sources.knowledge"),ready:r&&s.has("knowledge"),unavailableLabel:o(i("search.sources.knowledge"))},{id:"memory",label:i("search.sources.memory"),ready:r&&s.has("memory"),unavailableLabel:o(i("search.sources.memory"))}]}function pI(e,t){return{context_search:"Context Search",local:t("search.backendLocal"),mem0:"Mem0",milvus:"Milvus",opensearch:"OpenSearch",openviking:"OpenViking",redis:"Redis",tos_vector:"TOS Vector",viking:"VikingDB"}[e.toLowerCase()]??e}function Nee(e,t){return e?new Date(e*1e3).toLocaleString(t,{timeZone:"Asia/Shanghai",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):""}function ppt({userId:e,appId:t,agentInfo:n,capabilitiesLoading:i,agentLabel:r,onOpenSession:s}){var L,F;const{t:o,i18n:l}=_e("workspaceTools"),c=l.resolvedLanguage||l.language,[u,d]=p.useState("session"),[f,h]=p.useState(""),[m,g]=p.useState([]),[b,v]=p.useState(),[y,w]=p.useState(!1),[x,k]=p.useState(!1),[S,O]=p.useState(!1),A=p.useRef(0),E=p.useRef(null),j=hpt(t,n,i,o),T=j.find(M=>M.id===u),R=u==="knowledge"?(L=n==null?void 0:n.components)==null?void 0:L.find(M=>M.source==="knowledgebase"||M.kind==="knowledgebase"):u==="memory"?(F=n==null?void 0:n.components)==null?void 0:F.find(M=>M.source==="long_term_memory"||M.kind==="memory"):void 0;p.useEffect(()=>{A.current+=1,d("session"),g([]),v(void 0),k(!1),w(!1),O(!1)},[t]),p.useEffect(()=>{if(!S)return;function M(H){var q;(q=E.current)!=null&&q.contains(H.target)||O(!1)}return document.addEventListener("pointerdown",M),()=>document.removeEventListener("pointerdown",M)},[S]);async function C(M,H){var z;const q=M.trim();if(!q||!((z=j.find(J=>J.id===H))!=null&&z.ready))return;const U=++A.current;w(!0),k(!0);let Z;try{Z=await rpt(H,q,{userId:e,appId:t})}catch(J){const ne=J instanceof Error?J.message:String(J);Z={results:[],note:o("search.failed",{message:ne})}}U===A.current&&(g(Z.results),v(Z.note),w(!1))}function N(M){A.current+=1,h(M),g([]),v(void 0),k(!1),w(!1)}function P(M){A.current+=1,d(M),O(!1),g([]),v(void 0),k(!1),w(!1)}const I=!!(T!=null&&T.ready),D=t?u==="web"?o("search.placeholder.web"):u==="knowledge"?o("search.placeholder.knowledge",{name:(R==null?void 0:R.name)??o("search.placeholder.knowledgeFallback")}):u==="memory"?o("search.placeholder.memory",{name:(R==null?void 0:R.name)??o("search.placeholder.memoryFallback")}):o("search.placeholder.session"):o("search.placeholder.selectAgent"),_=R!=null&&R.backend?pI(R.backend,o):"";return a.jsxs("div",{className:"search",children:[a.jsxs("div",{className:"search-box",children:[a.jsxs("div",{className:"search-source-picker-wrap",ref:E,children:[a.jsxs("button",{className:"search-source-picker",type:"button","aria-label":o("search.sourceTypeAria",{label:(T==null?void 0:T.label)??o("search.notSelected")}),"aria-haspopup":"listbox","aria-expanded":S,onClick:()=>O(M=>!M),children:[a.jsx("span",{children:(T==null?void 0:T.label)??o("search.sourceType")}),_&&a.jsx("small",{children:_}),a.jsx(dpt,{open:S})]}),S&&a.jsx("div",{className:"search-source-menu",role:"listbox","aria-label":o("search.selectSource"),children:j.map(M=>{var U,Z;const H=M.id==="knowledge"?(U=n==null?void 0:n.components)==null?void 0:U.find(z=>z.source==="knowledgebase"||z.kind==="knowledgebase"):M.id==="memory"?(Z=n==null?void 0:n.components)==null?void 0:Z.find(z=>z.source==="long_term_memory"||z.kind==="memory"):void 0,q=H?[H.name,H.backend?pI(H.backend,o):""].filter(Boolean).join(" · "):M.ready?M.description:M.unavailableLabel;return a.jsxs("button",{type:"button",role:"option","aria-selected":u===M.id,disabled:!M.ready,onClick:()=>P(M.id),children:[a.jsx("span",{children:M.label}),q&&a.jsx("small",{children:q})]},M.id)})})]}),a.jsx("span",{className:"search-box-divider","aria-hidden":!0}),a.jsx("input",{className:"search-input",value:f,onChange:M=>N(M.target.value),onKeyDown:M=>{M.key==="Enter"&&(M.preventDefault(),C(f,u))},placeholder:D,disabled:!I,autoFocus:!0}),a.jsx("button",{className:"search-go",onClick:()=>void C(f,u),disabled:!f.trim()||y,"aria-label":o("search.nav"),children:y?a.jsx(Vi,{className:"icon spin"}):a.jsx(upt,{className:"icon"})})]}),a.jsx("div",{className:"search-results",children:I?x?y?null:b?a.jsx("div",{className:"search-empty",children:b}):m.length===0&&x?a.jsx("div",{className:"search-empty",children:o("search.noResults",{query:f.trim()})}):m.map((M,H)=>a.jsx(mpt,{result:M,agentLabel:r,onOpen:s,locale:c},H)):a.jsx("div",{className:"search-empty",children:o(u==="web"?"search.instructions.web":u==="knowledge"?"search.instructions.knowledge":u==="memory"?"search.instructions.memory":"search.instructions.session")}):a.jsx("div",{className:"search-empty",children:t?i?o("search.loadingCapabilities"):(T==null?void 0:T.unavailableLabel)??o("search.sourceUnavailable"):o("search.noAgentHint")})})]})}function mpt({result:e,agentLabel:t,onOpen:n,locale:i}){const{t:r}=_e("workspaceTools");switch(e.type){case"session":return a.jsxs("button",{className:"search-result",onClick:()=>n(e.appId,e.sessionId),children:[a.jsx(Vje,{className:"search-result-icon"}),a.jsxs("div",{className:"search-result-body",children:[a.jsxs("div",{className:"search-result-head",children:[a.jsx("span",{className:"search-result-title",children:e.title}),a.jsxs("span",{className:"search-result-meta",children:[t(e.appId),e.ts?` · ${Nee(e.ts,i)}`:""]})]}),a.jsx("div",{className:"search-result-snippet",children:e.snippet})]})]});case"web":return a.jsxs("a",{className:"search-result",href:e.url||void 0,target:"_blank",rel:"noreferrer noopener",children:[a.jsx(eM,{className:"search-result-icon"}),a.jsxs("div",{className:"search-result-body",children:[a.jsxs("div",{className:"search-result-head",children:[a.jsx("span",{className:"search-result-title",children:e.title||e.url}),a.jsxs("span",{className:"search-result-meta",children:[e.siteName,e.url&&a.jsx(uv,{className:"search-result-ext"})]})]}),e.summary&&a.jsx("div",{className:"search-result-snippet",children:e.summary})]})]});case"knowledge":return a.jsxs("div",{className:"search-result search-result-static",children:[a.jsx(Ree,{source:"knowledge"}),a.jsxs("div",{className:"search-result-body",children:[a.jsxs("div",{className:"search-result-head",children:[a.jsx("span",{className:"search-result-title",children:r("search.knowledgeFragment",{index:e.index+1})}),a.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${pI(e.sourceType,r)}`:""]})]}),a.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});case"memory":return a.jsxs("div",{className:"search-result search-result-static",children:[a.jsx(Ree,{source:"memory"}),a.jsxs("div",{className:"search-result-body",children:[a.jsxs("div",{className:"search-result-head",children:[a.jsx("span",{className:"search-result-title",children:r("search.memoryFragment",{index:e.index+1})}),a.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${pI(e.sourceType,r)}`:"",e.ts?` · ${Nee(e.ts,i)}`:""]})]}),a.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});default:return null}}function Ree({source:e,className:t="search-result-icon"}){return e==="knowledge"?a.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[a.jsx("path",{d:"M5 5.5h10.5A3.5 3.5 0 0 1 19 9v9.5H8.5A3.5 3.5 0 0 1 5 15V5.5Z"}),a.jsx("path",{d:"M8.25 9h7.5M8.25 12.25h6"})]}):a.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[a.jsx("path",{d:"M12 4.5a7.5 7.5 0 1 0 7.5 7.5"}),a.jsx("path",{d:"M12 8a4 4 0 1 0 4 4M12 11.3a.7.7 0 1 0 0 1.4.7.7 0 0 0 0-1.4Z"})]})}function gpt({filled:e=!1,...t}){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[a.jsx("rect",{x:"3.5",y:"9.3",width:"4.5",height:"10.2",rx:"1.5"}),a.jsx("path",{d:"M8 10.2 11.3 4.8c.5-.8 1.7-.45 1.7.5v3.8h4.2a2.1 2.1 0 0 1 2.04 2.6l-1.4 5.75A2.1 2.1 0 0 1 15.8 19H8"})]})}function bpt({filled:e=!1,...t}){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"4.5",height:"10.2",rx:"1.5"}),a.jsx("path",{d:"M8 13.8 11.3 19.2c.5.8 1.7.45 1.7-.5v-3.8h4.2a2.1 2.1 0 0 0 2.04-2.6l-1.4-5.75A2.1 2.1 0 0 0 15.8 5H8"})]})}function wIe(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5.25 4.25h9.5a2.5 2.5 0 0 1 2.5 2.5v3.5"}),a.jsx("path",{d:"M13.25 17.75h-8a2.5 2.5 0 0 1-2.5-2.5v-8a3 3 0 0 1 3-3"}),a.jsx("path",{d:"M7 8.25h5.5M7 11.75h3.25"}),a.jsx("path",{d:"m13.35 16.65.42-2.16 4.76-4.76a1.35 1.35 0 0 1 1.91 1.91l-4.76 4.76-2.33.25Z"}),a.jsx("path",{d:"m17.65 10.6 1.9 1.9"})]})}const fM="/assets/media/logo-DCsNZy-k.svg",oH="data:image/svg+xml,%3csvg%20width='28'%20height='23'%20viewBox='0%200%2028%2023'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17.1957%209.44218C17.0253%209.58161%2016.7774%209.47317%2016.7774%209.24079V8.01696V0.611967C16.7774%200.395085%2016.514%200.271152%2016.3591%200.410576L6.04172%209.16334C5.87132%209.30276%205.62345%209.19432%205.62345%208.96194V2.98218C5.62345%202.81178%205.48403%202.67235%205.31362%202.67235H0.309832C0.139424%202.67235%200%202.81178%200%202.98218V21.7115C0%2021.9284%200.263357%2022.0524%200.418273%2021.9129L10.7202%2013.1602C10.8906%2013.0207%2011.1385%2013.1292%2011.1385%2013.3616V22.0059C11.1385%2022.2228%2011.4018%2022.3467%2011.5567%2022.2073L21.8586%2013.4545C22.0291%2013.3151%2022.2769%2013.4235%2022.2769%2013.6559V19.6357C22.2769%2019.8061%2022.4163%2019.9455%2022.5868%2019.9455H27.5905C27.7609%2019.9455%2027.9004%2019.8061%2027.9004%2019.6357V0.890816C27.9004%200.673934%2027.637%200.550001%2027.4821%200.689425L17.1957%209.44218Z'%20fill='%230066FC'/%3e%3c/svg%3e";function ypt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M8.5 4.5H6a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-13a2 2 0 0 0-2-2h-2.5"}),a.jsx("rect",{x:"8.5",y:"2.5",width:"7",height:"4",rx:"1.5"}),a.jsx("path",{d:"m8 13 2.5 2.5L16 10"})]})}const Iee="(max-width: 860px)";function Pee({title:e}){const t=p.useRef(null),n=p.useRef(null),[i,r]=p.useState(0);p.useLayoutEffect(()=>{const l=t.current,c=n.current;if(!l||!c)return;const u=()=>{const f=Math.max(0,Math.ceil(c.scrollWidth-l.clientWidth));r(h=>h===f?h:f)};u();const d=new ResizeObserver(u);return d.observe(l),d.observe(c),()=>d.disconnect()},[e]);const s=Math.min(12,Math.max(4.8,3.6+i/36)),o={"--history-title-translate":`-${i}px`,"--history-title-duration":`${s.toFixed(2)}s`};return a.jsx("span",{ref:t,className:`history-title${i>0?" is-overflowing":""}`,style:o,children:a.jsx("span",{ref:n,className:"history-title-text",children:e})})}function vpt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"7",cy:"7",r:"2.25"}),a.jsx("circle",{cx:"17",cy:"7",r:"2.25"}),a.jsx("circle",{cx:"7",cy:"17",r:"2.25"}),a.jsx("circle",{cx:"17",cy:"17",r:"2.25"})]})}function xpt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"12",cy:"12",r:"8.25"}),a.jsx("path",{d:"M3.75 12h16.5M12 3.75c2.1 2.2 3.2 4.95 3.2 8.25S14.1 18.05 12 20.25M12 3.75C9.9 5.95 8.8 8.7 8.8 12s1.1 6.05 3.2 8.25"})]})}function wpt(e){let t=2166136261;for(const i of e)t^=i.charCodeAt(0),t=Math.imul(t,16777619);const n=t>>>0;return{"--avatar-hue-a":194+n%22,"--avatar-hue-b":214+(n>>>6)%25,"--avatar-hue-c":176+(n>>>12)%25,"--avatar-x":`${22+(n>>>18)%55}%`,"--avatar-y":`${18+(n>>>24)%58}%`}}const kpt={super_admin:"account.roles.super_admin",admin:"account.roles.admin",developer:"account.roles.developer",user:"account.roles.user"};function Opt({activePage:e,access:t,userInfo:n,onAgentKitCli:i,onDeveloperResources:r,onSystemInfo:s,onIssueFeedback:o,onLogout:l}){const{t:c,i18n:u}=_e(["sidebar","common"]),[d,f]=p.useState("");if(!n)return null;const h=ket(n)||c("sidebar:account.defaultUser"),m=typeof n.email=="string"?n.email.trim():"",g=wpt(h),b=Oet(n),v=b===d?"":b,y=OA(u.resolvedLanguage??u.language)??kA;return a.jsx("div",{className:"sidebar-user",children:a.jsxs("div",{className:"sidebar-user-row",children:[a.jsxs(rr,{modal:!0,children:[a.jsx(rr.Trigger,{children:a.jsxs("button",{type:"button",className:"sidebar-user-btn",title:h,children:[a.jsx("span",{className:`account-avatar${v?" has-image":""}`,style:g,"aria-hidden":"true",children:v?a.jsx("img",{className:"account-avatar-image",src:v,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>f(v)}):null}),a.jsx("span",{className:"sidebar-user-identity",children:a.jsx("span",{className:"sidebar-user-name",children:h})})]})}),a.jsxs(rr.Content,{side:"top",align:"start",sideOffset:4,minWidth:216,children:[a.jsxs("div",{className:"account-menu-head",children:[a.jsx("span",{className:`account-avatar account-avatar--lg${v?" has-image":""}`,style:g,"aria-hidden":"true",children:v?a.jsx("img",{className:"account-avatar-image",src:v,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>f(v)}):null}),a.jsxs("div",{className:"account-id",children:[a.jsxs("div",{className:"account-name-row",children:[a.jsx("div",{className:"account-name",children:h}),a.jsx(Za,{color:"secondary",size:"sm",variant:"soft",pill:!0,children:c(`sidebar:${kpt[t.role]}`)})]}),m&&m!==h&&a.jsx("div",{className:"account-sub",children:m})]})]}),a.jsxs(rr.Item,{className:"account-menu-action",onSelect:s,children:[a.jsx(gm,{className:"icon","aria-hidden":"true"}),c("sidebar:account.systemInfo")]}),a.jsxs(rr.Sub,{children:[a.jsx(rr.SubTrigger,{className:"account-menu-action",children:a.jsxs("span",{className:"account-menu-action__label",children:[a.jsx(xpt,{className:"icon"}),c("sidebar:account.language")]})}),a.jsx(rr.SubContent,{sideOffset:6,minWidth:136,children:a.jsx(rr.RadioGroup,{value:y,onChange:w=>{jqe(w)},indicatorPosition:"end",children:NU.map(w=>a.jsx(rr.RadioItem,{value:w,children:c(`common:languageNames.${w}`)},w))})})]}),a.jsxs(rr.Item,{className:"account-menu-action",onSelect:o,children:[a.jsx(wIe,{className:"icon"}),c("sidebar:account.issueFeedback")]}),a.jsxs(rr.Item,{className:"account-menu-action",onSelect:l,children:[a.jsx(Hat,{className:"icon","aria-hidden":"true"}),c("sidebar:account.logout")]})]})]}),a.jsxs("div",{className:"sidebar-user-shortcuts","aria-label":c("sidebar:account.shortcuts"),children:[a.jsx(Ca,{compact:!0,content:c("sidebar:account.tryCli"),children:a.jsx("button",{type:"button",className:"sidebar-user-shortcut",onClick:i,"aria-label":c("sidebar:account.tryCli"),children:a.jsx(cat,{className:"icon"})})}),a.jsx(Ca,{compact:!0,content:c("sidebar:account.developerResources"),children:a.jsx("button",{type:"button",className:`sidebar-user-shortcut${e==="developer-resources"?" is-active":""}`,onClick:r,"aria-label":c("sidebar:account.developerResources"),"aria-current":e==="developer-resources"?"page":void 0,children:a.jsx(Yst,{className:"icon"})})})]})]})})}function Spt({branding:e,cloudProvider:t,sessions:n,currentSessionId:i,activePage:r,features:s,access:o,streamingSids:l,evaluatingSids:c,sandboxHistory:u,onNewChat:d,onSearch:f,onQuickCreate:h,onLibrary:m,onReviewCenter:g,onAddAgent:b,onMyAgents:v,onWorkspace:y,onApplications:w,onCronJobs:x,onAgentKitCli:k,onDeveloperResources:S,onSystemInfo:O,onUserManagement:A,onIssueFeedback:E,onPickSession:j,onDeleteSession:T,userInfo:R,onLogout:C}){const{t:N}=_e("sidebar"),P=z=>(s==null?void 0:s[z])!==!1,I=o.role==="admin"||o.role==="super_admin",D=o.capabilities.manageUsers&&!!A,[_,L]=p.useState(null),F=p.useRef(typeof window<"u"&&window.matchMedia(Iee).matches),[M,H]=p.useState(F.current),q=n.map(z=>({id:z.id,title:z.title||tM(z.events,N("history.newConversation")),createdAt:(z.lastUpdateTime??0)*1e3})).sort((z,J)=>J.createdAt-z.createdAt),U=()=>{F.current=!1,H(z=>!z),L(null)};p.useEffect(()=>{const z=window.matchMedia(Iee),J=ne=>{ne.matches?H(W=>W||(F.current=!0,!0)):F.current&&(F.current=!1,H(!1))};return z.addEventListener("change",J),()=>z.removeEventListener("change",J)},[]);const Z=t==="byteplus"?oH:fM;return a.jsxs("aside",{className:`sidebar ${M?"is-collapsed":""}`,children:[a.jsxs("div",{className:"sidebar-top",children:[a.jsxs("div",{className:"sidebar-brand-row",children:[a.jsxs("button",{type:"button",className:"brand",onClick:d,"aria-label":N("navigation.home"),title:N("navigation.home"),children:[a.jsx("img",{className:"brand-logo",src:e.logoUrl||Z,width:20,height:20,alt:"","aria-hidden":!0}),a.jsx("span",{className:"brand-title",children:e.title})]}),a.jsx("button",{type:"button",className:"sidebar-collapse-toggle",onClick:U,"aria-label":N(M?"navigation.expand":"navigation.collapse"),title:N(M?"navigation.expand":"navigation.collapse"),children:M?a.jsx(apt,{className:"icon"}):a.jsx(spt,{className:"icon"})})]}),a.jsxs("nav",{className:"sidebar-nav","aria-label":N("navigation.label"),children:[P("newChat")&&a.jsxs("button",{className:`new-chat new-chat--conversation${r==="new-chat"?" is-active":""}`,onClick:d,"aria-label":N("navigation.newChat"),"aria-current":r==="new-chat"?"page":void 0,title:N("navigation.newChat"),children:[a.jsx(opt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.newChat")})]}),P("search")&&a.jsx(fpt,{active:r==="search",onClick:f}),a.jsxs("button",{className:`new-chat new-chat--agents${r==="agents"?" is-active":""}`,onClick:v,"aria-label":N("navigation.agents"),"aria-current":r==="agents"?"page":void 0,title:N("navigation.agents"),children:[a.jsx(cpt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.agents")})]}),a.jsxs("button",{className:`new-chat new-chat--workspaces${r==="workspaces"?" is-active":""}`,onClick:y,"aria-label":N("navigation.workspaces"),"aria-current":r==="workspaces"?"page":void 0,title:N("navigation.workspaces"),children:[a.jsx(Eat,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.workspaces")})]}),a.jsxs("button",{className:`new-chat new-chat--library${r==="library"?" is-active":""}`,onClick:m,"aria-label":N("navigation.library"),"aria-current":r==="library"?"page":void 0,title:N("navigation.library"),children:[a.jsx(vIe,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.library")})]}),a.jsxs("button",{className:`new-chat new-chat--cronjobs${r==="cronjobs"?" is-active":""}`,onClick:x,"aria-label":N("navigation.cronjobs"),"aria-current":r==="cronjobs"?"page":void 0,title:N("navigation.cronjobs"),children:[a.jsx(pV,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.cronjobs")})]}),a.jsxs("button",{className:`new-chat new-chat--applications${r==="applications"?" is-active":""}`,onClick:w,"aria-label":N("navigation.automations"),"aria-current":r==="applications"?"page":void 0,title:N("navigation.automations"),children:[a.jsx(vpt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.automations")})]})]}),I||D?a.jsxs("nav",{className:"sidebar-nav sidebar-nav--administration","aria-label":N("navigation.administration"),children:[a.jsx("div",{className:"sidebar-nav-group-title","aria-hidden":"true",children:N("navigation.administration")}),I?a.jsxs("button",{type:"button",className:`new-chat new-chat--review-center${r==="review-center"?" is-active":""}`,onClick:g,"aria-label":N("navigation.reviewCenter"),"aria-current":r==="review-center"?"page":void 0,title:N("navigation.reviewCenter"),children:[a.jsx(ypt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.reviewCenter")})]}):null,D?a.jsxs("button",{type:"button",className:`new-chat${r==="users"?" is-active":""}`,onClick:A,"aria-label":N("navigation.users"),"aria-current":r==="users"?"page":void 0,title:N("navigation.users"),children:[a.jsx(Uot,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.users")})]}):null]}):null]}),P("history")&&a.jsxs("div",{className:"sidebar-history",children:[a.jsxs("div",{className:"history-head",children:[a.jsx("span",{children:N("history.title")}),P("newChat")&&a.jsx("button",{type:"button",className:"history-new-chat",onClick:(u==null?void 0:u.onNew)??d,disabled:u==null?void 0:u.newDisabled,"aria-label":N("history.create"),title:N("history.create"),children:a.jsx(ec,{className:"icon"})})]}),a.jsx("div",{className:"history-list",children:u?a.jsxs(a.Fragment,{children:[u.loading&&u.threads.length===0?a.jsx("div",{className:"history-empty",role:"status",children:N("history.loading")}):null,u.error?a.jsx("div",{className:"history-error",role:"alert",children:u.error}):null,!u.loading&&!u.error&&u.threads.length===0?a.jsx("div",{className:"history-empty",children:N("history.empty")}):null,u.threads.map(z=>{const J=z.id===u.currentThreadId,ne=z.name||z.preview||`Thread ${z.id.slice(0,8)}`,W=z.id===u.busyThreadId;return a.jsxs("div",{className:`history-item ${J?"active":""}`,children:[a.jsxs("button",{type:"button",className:"history-item-btn",onClick:()=>u.onSelect(z.id),"aria-current":J?"page":void 0,title:ne,disabled:W,children:[a.jsx(Pee,{title:ne}),J?a.jsx("span",{className:"history-current-badge",children:N("history.current")}):null]}),a.jsx("button",{type:"button",className:"history-more","aria-label":N("history.manage",{title:ne}),title:N("history.more"),disabled:W,onClick:()=>L(X=>X===z.id?null:z.id),children:a.jsx(ZJ,{className:"icon"})}),_===z.id?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"menu-scrim",onClick:()=>L(null)}),a.jsx("div",{className:"history-menu",children:a.jsxs("button",{type:"button",className:"menu-item menu-item--danger",onClick:()=>{L(null),u.onDelete(z)},children:[a.jsx(Yg,{className:"icon"})," ",N("history.delete")]})})]}):null]},z.id)}),u.hasMore?a.jsx("button",{type:"button",className:"history-load-more",disabled:u.loading,onClick:u.onLoadMore,children:u.loading?N("history.loadingMore"):N("history.loadMore")}):null]}):a.jsxs(a.Fragment,{children:[q.length===0?a.jsx("div",{className:"history-empty",children:N("history.empty")}):null,q.map(z=>{const J=z.id===i,ne=(l==null?void 0:l.has(z.id))===!0,W=!ne&&(c==null?void 0:c.has(z.id))===!0;return a.jsxs("div",{className:`history-item ${J?"active":""}`,children:[a.jsxs("button",{className:"history-item-btn",onClick:()=>j(z.id),"aria-current":J?"page":void 0,title:z.title,children:[a.jsx(Pee,{title:z.title}),W&&a.jsxs("span",{className:"history-evaluating-status",title:N("history.evaluatingTitle"),children:[a.jsx("span",{className:"history-evaluating","aria-hidden":"true"}),N("history.evaluating")]})]}),a.jsxs("div",{className:"history-action-slot",children:[ne?a.jsx(YA,{className:"history-streaming-indicator",size:12,role:"status","aria-label":N("history.generating")}):null,a.jsx("button",{type:"button",className:"history-more","aria-label":N("history.manage",{title:z.title}),title:N("history.more"),onClick:()=>L(X=>X===z.id?null:z.id),children:a.jsx(ZJ,{className:"icon"})})]}),_===z.id&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"menu-scrim",onClick:()=>L(null)}),a.jsx("div",{className:"history-menu",children:a.jsxs("button",{type:"button",className:"menu-item menu-item--danger",onClick:()=>{L(null),T(z.id)},children:[a.jsx(Yg,{className:"icon"})," ",N("history.delete")]})})]})]},z.id)})]})})]}),a.jsx("div",{className:"sidebar-footer",children:a.jsx(Opt,{activePage:r,access:o,userInfo:R,onAgentKitCli:k,onDeveloperResources:S,onSystemInfo:O,onIssueFeedback:E,onLogout:C})})]})}const Ept={name:"studio_share_space"},Cpt={name:"studio_review_space"},kIe={share:Ept,review:Cpt},Apt=kIe.share.name,OIe=kIe.review.name,Tpt=[Apt,OIe];function SIe(e){return Tpt.includes(e.trim().toLowerCase())}function _pt(e){return e.name===OIe}const jpt="/web/skill-management";class i1 extends Error{constructor(t,n,i="SKILL_MANAGEMENT_ERROR",r="",s,o=""){super(t),this.status=n,this.code=i,this.statusText=r,this.originalError=s,this.rawResponse=o,this.name="SkillManagementApiError"}}async function lc(e,t={},n=eo){return fetch(Na(`${jpt}${e}`),{...t,headers:hl(oc(t.headers)),signal:po(t.signal,n)})}async function aT(e,t){let n=t,i="SKILL_MANAGEMENT_ERROR",r;const s=await e.text().catch(()=>"");try{const o=JSON.parse(s);typeof o.detail=="string"?n=o.detail:o.detail&&(n=o.detail.message||t,i=o.detail.code||i,r=o.detail.originalError)}catch{s.trim()&&(n=Q("common.fallbackWithDetail",{fallback:t,detail:s.trim()}))}return new i1(n,e.status,i,e.statusText,r,s)}async function cc(e,t){if(!e.ok)throw await aT(e,t);return e.json()}async function Npt(e){const t=new URLSearchParams({region:e.region,page:String(e.page),page_size:String(e.pageSize)});return e.project&&t.set("project",e.project),cc(await lc(`/spaces?${t}`,{signal:e.signal}),Q("skills.listSpacesFailed"))}async function Rpt(e){if(SIe(e.name))throw new i1(Q("skills.reservedSpaceName"),409,"SKILL_SPACE_RESERVED_IDENTITY");return cc(await lc("/spaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Q("skills.createSpaceFailed"))}async function Ipt(e){const t=new URLSearchParams({region:e.region});return cc(await lc(`/shared-space/ensure?${t}`,{method:"POST",signal:e.signal}),Q("skills.sharedSpaceFailed"))}async function Ppt(e){return cc(await lc(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/review`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({region:e.region,version:e.version})},yr),Q("skills.submitReviewFailed"))}async function Dpt(e){const t=new URLSearchParams({region:e.region});return cc(await lc(`/reviews?${t}`,{signal:e.signal}),Q("skills.listReviewsFailed"))}async function Mpt(e){const t=new URLSearchParams({region:e.region});return cc(await lc(`/reviews/${encodeURIComponent(e.id)}/files?${t}`,{signal:e.signal},yr),Q("skills.reviewFilesFailed"))}async function Lpt(e){return cc(await lc(`/reviews/${encodeURIComponent(e.id)}/decision`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({region:e.region,decision:e.decision,reason:e.reason||"",comment:e.comment||""})},yr),Q("skills.decideReviewFailed"))}async function $pt(e){const t=new URLSearchParams({region:e.region});return cc(await lc(`/spaces/${encodeURIComponent(e.spaceId)}/reviews?${t}`,{signal:e.signal}),Q("skills.listReviewsFailed"))}async function Fpt(e){if(SIe(e.name))throw new i1(Q("skills.reservedSpaceName"),409,"SKILL_SPACE_RESERVED_IDENTITY");return cc(await lc(`/spaces/${encodeURIComponent(e.spaceId)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e.name,description:e.description,region:e.region})}),Q("skills.updateSpaceFailed"))}async function Bpt(e){const t=new URLSearchParams({region:e.region});await cc(await lc(`/spaces/${encodeURIComponent(e.spaceId)}?${t}`,{method:"DELETE"}),Q("skills.deleteSpaceFailed"))}async function Upt(e){const t=new URLSearchParams({region:e.region});return e.project&&t.set("project",e.project),cc(await lc(`/spaces/${encodeURIComponent(e.spaceId)}/skills?${t}`,{method:"POST",headers:{"Content-Type":"application/zip"},body:e.file},yr),Q("skills.uploadFailed"))}async function Qpt(e){return cc(await lc("/validate",{method:"POST",headers:{"Content-Type":"application/zip"},body:e},yr),Q("skills.validateFailed"))}async function zpt(e){const t=new URLSearchParams({region:e.region});await cc(await lc(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}?${t}`,{method:"DELETE"}),Q("skills.deleteFailed"))}async function EIe(e){const t=new URLSearchParams({region:e.region});e.version&&t.set("version",e.version),e.skillSpaceName&&t.set("skill_space_name",e.skillSpaceName),e.skillName&&t.set("skill_name",e.skillName);const n=await cc(await lc(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/files?${t}`),Q("skills.listFilesFailed"));return Array.isArray(n.files)?n.files:[]}async function Vpt(e){var l;const t=new URLSearchParams({region:e.region});e.version&&t.set("version",e.version),e.skillSpaceName&&t.set("skill_space_name",e.skillSpaceName),e.skillName&&t.set("skill_name",e.skillName);const n=await lc(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/archive?${t}`,{},yr);n.ok||await cc(n,Q("skills.downloadFailed"));const r=((l=(n.headers.get("content-disposition")||"").match(/filename="([^"]+)"/))==null?void 0:l[1])||`${e.fallbackName}.zip`,s=URL.createObjectURL(await n.blob()),o=document.createElement("a");o.href=s,o.download=r,o.click(),URL.revokeObjectURL(s)}bn.hasResourceBundle("en-US","create")||bn.addResourceBundle("en-US","create",rhe,!0,!0);bn.hasResourceBundle("zh-CN","create")||bn.addResourceBundle("zh-CN","create",u0e,!0,!0);function Yt(e,t={}){return bn.t(e,{...t,ns:"create"})}function Nc(e){var t;return((t=e==null?void 0:e.displayName)==null?void 0:t.trim())||(e==null?void 0:e.name)||""}async function hM(e,t){const n=await fetch(Na(e),{headers:hl(oc({accept:"application/json"})),signal:po(t,eo)});if(!n.ok)throw await aT(n,Yt("helpers.skills.agentKitRequestFailed"));return n.json()}async function CIe(){return((await hM("/web/skill-spaces")).items||[]).filter(t=>!_pt(t))}async function AIe(e,t){const n=t?`?region=${encodeURIComponent(t)}`:"";return(await hM(`/web/skill-spaces/${encodeURIComponent(e)}/skills${n}`)).items||[]}async function TIe(e,t){const n=new URLSearchParams({region:t.region,page:String(t.page),page_size:String(t.pageSize)});return t.project&&n.set("project",t.project),hM(`/web/skill-spaces/${encodeURIComponent(e)}/skills?${n.toString()}`,t.signal)}async function Hpt(e,t,n,i,r,s,o){const l=[];n&&l.push(`version=${encodeURIComponent(n)}`),i&&l.push(`region=${encodeURIComponent(i)}`),r&&l.push(`project=${encodeURIComponent(r)}`),s&&l.push(`skill_name=${encodeURIComponent(s)}`),o&&l.push(`skill_space_name=${encodeURIComponent(o)}`);const c=l.length>0?`?${l.join("&")}`:"";return hM(`/web/skill-spaces/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}${c}`)}function qpt(e,t){const n=Ey(t);return{source:"skillspace",id:`ss:${e.id}/${n}/${t.version}`,name:t.skillName,description:t.skillDescription,folder:t.skillName,skillSpaceId:e.id,skillSpaceName:e.name,skillSpaceRegion:e.region,skillId:n,version:t.version}}function Ey(e){return e.skillId||e.skillName}function Wpt(e,t,n="volcengine"){return n==="byteplus"?"":`https://console.volcengine.com/agentkit/${(t||"cn-beijing")==="cn-beijing"?"cn":"cn-shanghai"}/skillspace/detail/${encodeURIComponent(e)}`}const Kpt="data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='visible'%20style='display:%20block;'%20width='7.93649'%20height='8'%20viewBox='0%200%207.93649%208'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20id='Resizer'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.21499%200L0%207.27273L0.721499%208L7.93649%200.727273L7.21499%200ZM6.86867%203.99988L3.98268%206.90897L4.70418%207.63625L7.59017%204.72715L6.86867%203.99988Z'%20fill='%23737A87'/%3e%3c/svg%3e";function _Ie({className:e="",counter:t,maxHeight:n,...i}){return a.jsxs("div",{className:`studio-textarea ${e}`.trim(),"data-counter":t!=null||void 0,style:{maxHeight:n},children:[a.jsx("textarea",{...i,className:"studio-textarea__input"}),t!=null&&a.jsx("span",{className:"studio-textarea__counter",children:t}),a.jsx("img",{className:"studio-textarea__resizer",src:Kpt,alt:"","aria-hidden":"true"})]})}async function jIe(e,t,n){const i=new URLSearchParams({region:e.region}),r=await fetch(Na(`/web/skill-management/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/document?${i}`),{...t,headers:hl(oc(t.headers)),signal:po(e.signal,n)});if(!r.ok)throw await aT(r,"SKILL_DOCUMENT_REQUEST_FAILED");return r.json()}function Gpt(e){return jIe(e,{},eo)}function Xpt(e){return jIe(e,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:e.content,baseVersion:e.baseVersion})},yr)}function Ypt({target:e,onClose:t,onSaved:n}){const{t:i}=_e("workspaceTools"),[r,s]=p.useState(null),[o,l]=p.useState(""),[c,u]=p.useState(!0),[d,f]=p.useState(!1),[h,m]=p.useState(""),[g,b]=p.useState(0),[v,y]=p.useState(!1),w=p.useId(),x=p.useRef(null),k=p.useRef(!1),S=p.useRef(!0),O=p.useRef({dirty:!1,onClose:t});O.current={dirty:r!==null&&o!==r.content,onClose:t};const A=p.useRef(null);function E(){k.current||(O.current.dirty?y(!0):O.current.onClose())}p.useEffect(()=>{var N,P;S.current=!0;const T=window.document.activeElement instanceof HTMLElement?window.document.activeElement:null,R=window.document.body.style.overflow;window.document.body.style.overflow="hidden",(P=(N=x.current)==null?void 0:N.querySelector("button"))==null||P.focus();function C(I){var _,L;if(I.isComposing||(I.key==="Escape"&&(I.preventDefault(),E()),I.key!=="Tab"))return;const D=Array.from(((_=x.current)==null?void 0:_.querySelectorAll('button:not([disabled]),textarea:not([disabled]),[tabindex="0"]'))??[]);D.length&&(I.shiftKey&&window.document.activeElement===D[0]?(I.preventDefault(),(L=D[D.length-1])==null||L.focus()):!I.shiftKey&&window.document.activeElement===D[D.length-1]&&(I.preventDefault(),D[0].focus()))}return window.addEventListener("keydown",C),()=>{var I;S.current=!1,(I=A.current)==null||I.abort(),window.removeEventListener("keydown",C),window.document.body.style.overflow=R,T!=null&&T.isConnected&&T.focus()}},[]),p.useEffect(()=>{const T=new AbortController;return u(!0),m(""),Gpt({...e,signal:T.signal}).then(R=>{T.signal.aborted||(s(R),l(R.content))}).catch(()=>{T.signal.aborted||m("documentLoadFailed")}).finally(()=>{T.signal.aborted||u(!1)}),()=>T.abort()},[e,g]);async function j(){if(k.current||!(r!=null&&r.canUpdate)||o===r.content||!o.trim())return;k.current=!0,f(!0),m("");const T=new AbortController;A.current=T;try{await Xpt({...e,content:o,baseVersion:r.baseVersion,signal:T.signal}),S.current&&(n(),t())}catch(R){S.current&&m(R instanceof i1&&R.status===409?"documentConflict":R instanceof i1&&R.status===403?"accessDenied":"documentSaveFailed")}finally{k.current=!1,S.current&&f(!1)}}return vi.createPortal(a.jsx("div",{className:"mpa-skill-editor-backdrop",children:a.jsxs("section",{className:"mpa-skill-editor",role:"dialog","aria-modal":"true","aria-labelledby":w,ref:x,children:[a.jsxs("header",{children:[a.jsxs("h2",{id:w,children:[e.name," · SKILL.md"]}),a.jsx(ki,{variant:"ghost",disabled:d,onClick:E,children:i("agentTopology.close")})]}),a.jsx("p",{className:"mpa-skill-editor-hint",children:i("agentTopology.documentEditHint")}),c?a.jsx("p",{role:"status",children:i("agentTopology.documentLoading")}):r?a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[r.baseVersion," ·"," ",i(r.canUpdate?"agentTopology.documentWritable":"agentTopology.documentReadOnly")]}),a.jsx(_Ie,{"aria-label":"SKILL.md",value:o,readOnly:!r.canUpdate,disabled:d,maxLength:262144,spellCheck:!1,onChange:T=>l(T.currentTarget.value)})]}):null,h&&a.jsx("p",{role:"alert",children:i(`agentTopology.${h}`)}),v&&a.jsxs("div",{role:"alert",children:[a.jsx("p",{children:i("agentTopology.discardDocument")}),a.jsx(ki,{variant:"outline",onClick:()=>y(!1),children:i("agentTopology.keepEditing")}),a.jsx(ki,{variant:"secondary",onClick:t,children:i("agentTopology.discardChanges")})]}),a.jsxs("footer",{children:[!r&&!c&&a.jsx(ki,{variant:"outline",onClick:()=>b(T=>T+1),children:i("agentTopology.refresh")}),(r==null?void 0:r.canUpdate)&&a.jsx(ki,{loading:d,disabled:c||o===r.content||!o.trim(),onClick:()=>void j(),children:i("agentTopology.saveDocument")})]})]})}),window.document.body)}function kC(e){return e.trimEnd().replace(/[。.]+$/,"")}function NIe({selected:e,onChange:t,cloudProvider:n="volcengine"}){const{t:i}=_e("create"),[r,s]=p.useState([]),[o,l]=p.useState([]),[c,u]=p.useState(""),[d,f]=p.useState(!0),[h,m]=p.useState(!1),[g,b]=p.useState(null);p.useEffect(()=>{let k=!1;return(async()=>{f(!0),b(null);try{const S=await CIe();k||(s(S),S.length>0&&u(S[0].id))}catch(S){k||b(S instanceof Error?S.message:i("skills.space.loadError"))}finally{k||f(!1)}})(),()=>{k=!0}},[i]),p.useEffect(()=>{if(!c){l([]);return}const k=r.find(O=>O.id===c);let S=!1;return(async()=>{m(!0),b(null);try{const O=await AIe(c,k==null?void 0:k.region);S||l(O)}catch(O){S||b(O instanceof Error?O.message:i("skills.space.loadError"))}finally{S||m(!1)}})(),()=>{S=!0}},[c,r,i]);const v=r.find(k=>k.id===c),y=v?Wpt(v.id,v.region,n):"",w=(k,S)=>e.some(O=>O.source==="skillspace"&&O.skillId===k&&(O.version||"")===S),x=k=>{if(!v)return;const S=Ey(k);if(w(S,k.version))t(e.filter(O=>!(O.source==="skillspace"&&O.skillId===S&&(O.version||"")===k.version)));else{const O=qpt(v,k);t([...e,{source:"skillspace",folder:O.folder||k.skillName,name:O.name,description:O.description,skillSpaceId:O.skillSpaceId,skillSpaceName:O.skillSpaceName,skillSpaceRegion:O.skillSpaceRegion,skillId:O.skillId,version:O.version}])}};return a.jsx("div",{className:"cw-skillspace",children:d?a.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[a.jsx(Vi,{className:"cw-i cw-spin"})," ",i("skills.space.loadingSpaces")]}):g?a.jsxs("div",{className:"cw-banner",children:[a.jsx(gm,{className:"cw-i"}),a.jsx("span",{children:g})]}):r.length===0?a.jsx("p",{className:"cw-empty-line",children:i("skills.space.noSpaces")}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"cw-skillspace-header",children:[a.jsx("select",{className:"cw-input cw-skillspace-select",value:c,onChange:k=>u(k.target.value),"aria-label":i("skills.space.selectSpace"),children:r.map(k=>a.jsxs("option",{value:k.id,children:[Nc(k)||k.id,k.description?` — ${kC(k.description)}`:""]},k.id))}),v&&a.jsxs(a.Fragment,{children:[v.region&&a.jsx("span",{className:"cw-skillspace-region-label",title:v.region,children:Sh(v.region,n)}),y&&a.jsx("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:"cw-button cw-button-secondary cw-skillspace-console-link",title:i("skills.space.openConsole"),"aria-label":i("skills.space.openConsole"),children:a.jsx(uv,{className:"cw-i cw-i-sm"})})]})]}),h?a.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[a.jsx(Vi,{className:"cw-i cw-spin"})," ",i("skills.space.loadingSkills")]}):o.length===0?a.jsx("p",{className:"cw-empty-line",children:i("skills.space.noSkills")}):a.jsx("div",{className:"cw-skill-results",children:o.map(k=>{const S=Ey(k),O=w(S,k.version);return a.jsxs("button",{type:"button",className:`cw-skill-result ${O?"is-on":""}`,onClick:()=>x(k),"aria-pressed":O,children:[a.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:O?a.jsx(Of,{className:"cw-i cw-i-sm"}):a.jsx(ec,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:"cw-skill-result-meta",children:[a.jsxs("span",{className:"cw-skill-result-name",children:[k.skillName,k.version&&a.jsxs("span",{className:"cw-skill-result-version",children:[" ","v",k.version]})]}),k.skillDescription&&a.jsx("span",{className:"cw-skill-result-desc",children:kC(k.skillDescription)}),a.jsxs("span",{className:"cw-skill-result-repo",children:[a.jsx(Nat,{className:"cw-i cw-i-sm"})," ",Nc(v)||c]})]})]},`${S}/${k.version}`)})})]})})}function oT(e,t){return e.map(n=>({...n,get label(){return Yt(`${t}.${n.id}.label`)},get desc(){return Yt(`${t}.${n.id}.description`)}}))}function md(e,t){const n={...e};for(const[i,r]of Object.entries(t))Object.defineProperty(n,i,{configurable:!0,enumerable:!0,get:()=>Yt(r)});return n}const RIe="https://ark.cn-beijing.volces.com/api/v3/";md({key:"MODEL_AGENT_NAME",required:!1,placeholder:"doubao-seed-1-6-250615"},{comment:"traditional.catalog.env.modelAgentName.comment"});const ON=[md({key:"MODEL_EMBEDDING_NAME",required:!1,placeholder:"doubao-embedding-vision-250615"},{comment:"traditional.catalog.env.embeddingModelName.comment"}),{key:"MODEL_EMBEDDING_DIM",required:!1,placeholder:"2048"},{key:"MODEL_EMBEDDING_API_BASE",required:!1,placeholder:RIe}],mI=[],gI={get label(){return Yt("traditional.catalog.links.console")},url:"https://console.volcengine.com/vikingdb/openviking"},Zpt={get label(){return Yt("traditional.catalog.links.documentation")},url:"https://github.com/volcengine/OpenViking/blob/main/docs/zh/api/05-sessions.md"},IIe="https://api.vikingdb.cn-beijing.volces.com/openviking",Jpt=`{ +`)},Cct=0,L0=[];function Act(e){var t=p.useRef([]),n=p.useRef([0,0]),i=p.useRef(),r=p.useState(Cct++)[0],s=p.useState(WNe)[0],o=p.useRef(e);p.useEffect(function(){o.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var b=Klt([e.lockRef.current],(e.shards||[]).map(Oee),!0).filter(Boolean);return b.forEach(function(v){return v.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),b.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var l=p.useCallback(function(b,v){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!o.current.allowPinchZoom;var y=d_(b),w=n.current,x="deltaX"in b?b.deltaX:w[0]-y[0],k="deltaY"in b?b.deltaY:w[1]-y[1],S,O=b.target,A=Math.abs(x)>Math.abs(k)?"h":"v";if("touches"in b&&A==="h"&&O.type==="range")return!1;var E=window.getSelection(),j=E&&E.anchorNode,T=j?j===O||j.contains(O):!1;if(T)return!1;var R=wee(A,O);if(!R)return!0;if(R?S=A:(S=A==="v"?"h":"v",R=wee(A,O)),!R)return!1;if(!i.current&&"changedTouches"in b&&(x||k)&&(i.current=S),!S)return!0;var C=i.current||S;return Oct(C,v,b,C==="h"?x:k)},[]),c=p.useCallback(function(b){var v=b;if(!(!L0.length||L0[L0.length-1]!==s)){var y="deltaY"in v?kee(v):d_(v),w=t.current.filter(function(S){return S.name===v.type&&(S.target===v.target||v.target===S.shadowParent)&&Sct(S.delta,y)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var x=(o.current.shards||[]).map(Oee).filter(Boolean).filter(function(S){return S.contains(v.target)}),k=x.length>0?l(v,x[0]):!o.current.noIsolation;k&&v.cancelable&&v.preventDefault()}}},[]),u=p.useCallback(function(b,v,y,w){var x={name:b,delta:v,target:y,should:w,shadowParent:Tct(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(k){return k!==x})},1)},[]),d=p.useCallback(function(b){n.current=d_(b),i.current=void 0},[]),f=p.useCallback(function(b){u(b.type,kee(b),b.target,l(b,e.lockRef.current))},[]),h=p.useCallback(function(b){u(b.type,d_(b),b.target,l(b,e.lockRef.current))},[]);p.useEffect(function(){return L0.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,M0),document.addEventListener("touchmove",c,M0),document.addEventListener("touchstart",d,M0),function(){L0=L0.filter(function(b){return b!==s}),document.removeEventListener("wheel",c,M0),document.removeEventListener("touchmove",c,M0),document.removeEventListener("touchstart",d,M0)}},[]);var m=e.removeScrollBar,g=e.inert;return p.createElement(p.Fragment,null,g?p.createElement(s,{styles:Ect(r)}):null,m?p.createElement(gct,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Tct(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const _ct=ict(qNe,Act);var PV=p.forwardRef(function(e,t){return p.createElement(iM,eh({},e,{ref:t,sideCar:_ct}))});PV.classNames=iM.classNames;var jct=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},$0=new WeakMap,f_=new WeakMap,h_={},t4=0,YNe=function(e){return e&&(e.host||YNe(e.parentNode))},Nct=function(e,t){return t.map(function(n){if(e.contains(n))return n;var i=YNe(n);return i&&e.contains(i)?i:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Rct=function(e,t,n,i){var r=Nct(t,Array.isArray(e)?e:[e]);h_[n]||(h_[n]=new WeakMap);var s=h_[n],o=[],l=new Set,c=new Set(r),u=function(f){!f||l.has(f)||(l.add(f),u(f.parentNode))};r.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(h){if(l.has(h))d(h);else try{var m=h.getAttribute(i),g=m!==null&&m!=="false",b=($0.get(h)||0)+1,v=(s.get(h)||0)+1;$0.set(h,b),s.set(h,v),o.push(h),b===1&&g&&f_.set(h,!0),v===1&&h.setAttribute(n,"true"),g||h.setAttribute(i,"true")}catch(y){console.error("aria-hidden: cannot operate on ",h,y)}})};return d(t),l.clear(),t4++,function(){o.forEach(function(f){var h=$0.get(f)-1,m=s.get(f)-1;$0.set(f,h),s.set(f,m),h||(f_.has(f)||f.removeAttribute(i),f_.delete(f)),m||f.removeAttribute(n)}),t4--,t4||($0=new WeakMap,$0=new WeakMap,f_=new WeakMap,h_={})}},ZNe=function(e,t,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),r=jct(e);return r?(i.push.apply(i,Array.from(r.querySelectorAll("[aria-live], script"))),Rct(i,r,n,"aria-hidden")):function(){return null}},Ict=Object.defineProperty,Pct=(e,t)=>Ict(e,"name",{value:t,configurable:!0});function eT(e){const[t,n]=p.useState(void 0);return Od(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let o,l;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else n(void 0)},[e]),t}Pct(eT,"useSize");var Dct=Object.defineProperty,Jp=(e,t)=>Dct(e,"name",{value:t,configurable:!0}),DV="Checkbox",[Mct,khn]=Qc(DV),[Lct,MV]=Mct(DV);function JNe(e){const{__scopeCheckbox:t,checked:n,children:i,defaultChecked:r,disabled:s,form:o,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,m]=Id({prop:n,defaultProp:r??!1,onChange:c,caller:DV}),[g,b]=p.useState(null),[v,y]=p.useState(null),w=p.useRef(!1),[x,k]=p.useReducer(A=>A+1,0),S=g?!!o||!!g.closest("form"):!0,O={checked:h,disabled:s,setChecked:m,control:g,setControl:b,name:l,form:o,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:x,onUserInteraction:k,required:u,defaultChecked:$p(r)?!1:r,isFormControl:S,bubbleInput:v,setBubbleInput:y};return a.jsx(Lct,{scope:t,...O,children:eRe(f)?f(O):i})}Jp(JNe,"CheckboxProvider");var $ct="CheckboxTrigger",Fct=p.forwardRef(Jp(function({__scopeCheckbox:t,onKeyDown:n,onClick:i,...r},s){const{control:o,value:l,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:g,isFormControl:b,bubbleInput:v}=MV($ct,t),y=Rr(s,f),w=p.useRef(u);return p.useEffect(()=>{const x=o==null?void 0:o.form;if(x){const k=Jp(()=>h(w.current),"reset");return x.addEventListener("reset",k),()=>x.removeEventListener("reset",k)}},[o,h]),a.jsx(Jr.button,{type:"button",role:"checkbox","aria-checked":$p(u)?"mixed":u,"aria-required":d,"data-state":LV(u),"data-disabled":c?"":void 0,disabled:c,value:l,...r,ref:y,onKeyDown:Un(n,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:Un(i,x=>{g(),h(k=>$p(k)?!0:!k),v&&b&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})})},"CheckboxTrigger")),Bct=p.forwardRef(Jp(function(t,n){const{__scopeCheckbox:i,name:r,checked:s,defaultChecked:o,required:l,disabled:c,value:u,onCheckedChange:d,form:f,...h}=t;return a.jsx(JNe,{__scopeCheckbox:i,checked:s,defaultChecked:o,disabled:c,required:l,onCheckedChange:d,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>a.jsxs(a.Fragment,{children:[a.jsx(Fct,{...h,ref:n,__scopeCheckbox:i}),m&&a.jsx(Vct,{__scopeCheckbox:i})]})})},"Checkbox")),Uct="CheckboxIndicator",Qct=p.forwardRef(Jp(function(t,n){const{__scopeCheckbox:i,forceMount:r,...s}=t,o=MV(Uct,i);return a.jsx(Rh,{present:r||$p(o.checked)||o.checked===!0,children:a.jsx(Jr.span,{"data-state":LV(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...t.style}})})},"CheckboxIndicator")),zct="CheckboxBubbleInput",Vct=p.forwardRef(Jp(function({__scopeCheckbox:t,onClick:n,...i},r){const{control:s,hasConsumerStoppedPropagationRef:o,userInteractionCount:l,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:g,bubbleInput:b,setBubbleInput:v}=MV(zct,t),y=Rr(r,v),w=eT(s),x=p.useRef(!1),k=p.useRef(c),S=p.useRef(l);p.useEffect(()=>{const A=b;if(!A)return;const E=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(E,"checked").set,R=l!==S.current;S.current=l;const C=k.current!==c;k.current=c;const N=!(R&&o.current);if(C&&T){x.current=!R;const P=new Event("click",{bubbles:N});A.indeterminate=$p(c),T.call(A,$p(c)?!1:c),A.dispatchEvent(P),x.current=!1}},[b,c,o,l]);const O=p.useRef($p(c)?!1:c);return a.jsx(Jr.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??O.current,required:d,disabled:f,name:h,value:m,form:g,...i,tabIndex:-1,ref:y,onClick:Un(n,A=>{x.current&&A.stopPropagation()}),style:{...i.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function eRe(e){return typeof e=="function"}Jp(eRe,"isFunction");function $p(e){return e==="indeterminate"}Jp($p,"isIndeterminate");function LV(e){return $p(e)?"indeterminate":e?"checked":"unchecked"}Jp(LV,"getState");var Hct=Object.defineProperty,Ig=(e,t)=>Hct(e,"name",{value:t,configurable:!0}),tRe="Popper",[nRe,X1]=Qc(tRe),[qct,iRe]=nRe(tRe),Wct=Ig(e=>{const{__scopePopper:t,children:n}=e,[i,r]=p.useState(null),[s,o]=p.useState(void 0);return a.jsx(qct,{scope:t,anchor:i,onAnchorChange:r,placementState:s,setPlacementState:o,children:n})},"Popper"),Kct="PopperAnchor",Gct=p.forwardRef(Ig(function(t,n){const{__scopePopper:i,virtualRef:r,...s}=t,o=iRe(Kct,i),l=p.useRef(null),c=o.onAnchorChange,u=p.useCallback(b=>{l.current=b,b&&c(b)},[c]),d=Rr(n,u),f=p.useRef(null);p.useEffect(()=>{if(!r)return;const b=f.current;f.current=r.current,b!==f.current&&c(f.current)});const h=o.placementState&&rM(o.placementState),m=h==null?void 0:h[0],g=h==null?void 0:h[1];return r?null:a.jsx(Jr.div,{"data-radix-popper-side":m,"data-radix-popper-align":g,...s,ref:d})},"PopperAnchor")),rRe="PopperContent",[Xct,Ohn]=nRe(rRe),Yct=p.forwardRef(Ig(function(t,n){var X,ce,V,Y,K,de,ee;const{__scopePopper:i,side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:b,...v}=t,y=iRe(rRe,i),[w,x]=p.useState(null),k=Rr(n,x),[S,O]=p.useState(null),A=eT(S),E=(A==null?void 0:A.width)??0,j=(A==null?void 0:A.height)??0,T=r+(o!=="center"?"-"+o:""),R=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},C=Array.isArray(d)?d:[d],N=C.length>0,P={padding:R,boundary:C.filter(sRe),altBoundary:N},{refs:I,floatingStyles:D,placement:_,isPositioned:L,middlewareData:F}=eje({strategy:"fixed",placement:T,whileElementsMounted:Ig((...Oe)=>aB(...Oe,{animationFrame:g==="always"}),"whileElementsMounted"),elements:{reference:y.anchor},middleware:[tje({mainAxis:s+j,alignmentAxis:l}),u&&nje({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?ije():void 0,...P}),u&&rje({...P}),sje({...P,apply:Ig(({elements:Oe,rects:he,availableWidth:ge,availableHeight:Se})=>{const{width:xe,height:Pe}=he.reference,Ue=Oe.floating.style;Ue.setProperty("--radix-popper-available-width",`${ge}px`),Ue.setProperty("--radix-popper-available-height",`${Se}px`),Ue.setProperty("--radix-popper-anchor-width",`${xe}px`),Ue.setProperty("--radix-popper-anchor-height",`${Pe}px`)},"apply")}),S&&sst({element:S,padding:c}),Zct({arrowWidth:E,arrowHeight:j}),m&&rst({strategy:"referenceHidden",...P,boundary:N?P.boundary:void 0})]}),M=y.setPlacementState;Od(()=>(M(_),()=>{M(void 0)}),[_,M]);const[H,q]=rM(_),U=yf(b);Od(()=>{L&&(U==null||U())},[L,U]);const Z=(X=F.arrow)==null?void 0:X.x,z=(ce=F.arrow)==null?void 0:ce.y,J=((V=F.arrow)==null?void 0:V.centerOffset)!==0,[ne,W]=p.useState();return Od(()=>{w&&W(window.getComputedStyle(w).zIndex)},[w]),a.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:L?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[(Y=F.transformOrigin)==null?void 0:Y.x,(K=F.transformOrigin)==null?void 0:K.y].join(" "),...((de=F.hide)==null?void 0:de.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:a.jsx(Xct,{scope:i,placedSide:H,placedAlign:q,onArrowChange:O,arrowX:Z,arrowY:z,shouldHideArrow:J,children:a.jsx(Jr.div,{"data-side":H,"data-align":q,...v,ref:k,style:{...v.style,animation:L?(ee=v.style)==null?void 0:ee.animation:"none"}})})})},"PopperContent"));function sRe(e){return e!==null}Ig(sRe,"isNotNull");var Zct=Ig(e=>({name:"transformOrigin",options:e,fn(t){var v,y,w;const{placement:n,rects:i,middlewareData:r}=t,o=((v=r.arrow)==null?void 0:v.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,d]=rM(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((y=r.arrow)==null?void 0:y.x)??0)+l/2,m=(((w=r.arrow)==null?void 0:w.y)??0)+c/2;let g="",b="";return u==="bottom"?(g=o?f:`${h}px`,b=`${-c}px`):u==="top"?(g=o?f:`${h}px`,b=`${i.floating.height+c}px`):u==="right"?(g=`${-c}px`,b=o?f:`${m}px`):u==="left"&&(g=`${i.floating.width+c}px`,b=o?f:`${m}px`),{data:{x:g,y:b}}}}),"transformOrigin");function rM(e){const[t,n="center"]=e.split("-");return[t,n]}Ig(rM,"getSideAndAlignFromPlacement");var sM=Wct,$V=Gct,FV=Yct,Jct=Object.defineProperty,BV=(e,t)=>Jct(e,"name",{value:t,configurable:!0}),n4=!1;function aRe(){const[e,t]=p.useState(n4);return p.useEffect(()=>{n4||(n4=!0,t(!0))},[]),e}BV(aRe,"useIsHydrated");var oRe=_v[" useSyncExternalStore ".trim().toString()];function lRe(){return()=>{}}BV(lRe,"subscribe");function cRe(){return oRe(lRe,()=>!0,()=>!1)}BV(cRe,"useIsHydratedModern");var eut=typeof oRe=="function"?cRe:aRe,tut=Object.defineProperty,Bv=(e,t)=>tut(e,"name",{value:t,configurable:!0}),i4="rovingFocusGroup.onEntryFocus",nut={bubbles:!1,cancelable:!0},aM="RovingFocusGroup",[OB,uRe,iut]=AV(aM),[rut,Y1]=Qc(aM,[iut]),[sut,aut]=rut(aM),out=p.forwardRef(Bv(function(t,n){return a.jsx(OB.Provider,{scope:t.__scopeRovingFocusGroup,children:a.jsx(OB.Slot,{scope:t.__scopeRovingFocusGroup,children:a.jsx(lut,{...t,ref:n})})})},"RovingFocusGroup")),lut=p.forwardRef(Bv(function(t,n){const{__scopeRovingFocusGroup:i,orientation:r,loop:s=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...h}=t,m=p.useRef(null),g=Rr(n,m),b=JA(o),[v,y]=Id({prop:l,defaultProp:c??null,onChange:u,caller:aM}),[w,x]=p.useState(!1),k=yf(d),S=uRe(i),O=p.useRef(!1),[A,E]=p.useState(0);return p.useEffect(()=>{const j=m.current;if(j)return j.addEventListener(i4,k),()=>j.removeEventListener(i4,k)},[k]),a.jsx(sut,{scope:i,orientation:r,dir:b,loop:s,currentTabStopId:v,onItemFocus:p.useCallback(j=>y(j),[y]),onItemShiftTab:p.useCallback(()=>x(!0),[]),onFocusableItemAdd:p.useCallback(()=>E(j=>j+1),[]),onFocusableItemRemove:p.useCallback(()=>E(j=>j-1),[]),children:a.jsx(Jr.div,{tabIndex:w||A===0?-1:0,"data-orientation":r,...h,ref:g,style:{outline:"none",...t.style},onMouseDown:Un(t.onMouseDown,()=>{O.current=!0}),onFocus:Un(t.onFocus,j=>{const T=!O.current;if(j.target===j.currentTarget&&T&&!w){const R=new CustomEvent(i4,nut);if(j.currentTarget.dispatchEvent(R),!R.defaultPrevented){const C=S().filter(_=>_.focusable),N=C.find(_=>_.active),P=C.find(_=>_.id===v),D=[N,P,...C].filter(Boolean).map(_=>_.ref.current);UV(D,f)}}O.current=!1}),onBlur:Un(t.onBlur,()=>x(!1))})})},"RovingFocusGroupImpl")),cut="RovingFocusGroupItem",uut=p.forwardRef(Bv(function(t,n){const{__scopeRovingFocusGroup:i,focusable:r=!0,active:s=!1,tabStopId:o,children:l,...c}=t,u=Jg(),d=o||u,f=aut(cut,i),h=f.currentTabStopId===d,m=uRe(i),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:v}=f,y=eut();return Od(()=>{if(!(!y||!r))return g(),()=>b()},[y,r,g,b]),p.useEffect(()=>{if(!(y||!r))return g(),()=>b()},[y,r,g,b]),a.jsx(OB.ItemSlot,{scope:i,id:d,focusable:r,active:s,children:a.jsx(Jr.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...c,ref:n,onMouseDown:Un(t.onMouseDown,w=>{r?f.onItemFocus(d):w.preventDefault()}),onFocus:Un(t.onFocus,()=>f.onItemFocus(d)),onKeyDown:Un(t.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){f.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const x=fRe(w,f.orientation,f.dir);if(x!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let S=m().filter(O=>O.focusable).map(O=>O.ref.current);if(x==="last")S.reverse();else if(x==="prev"||x==="next"){x==="prev"&&S.reverse();const O=S.indexOf(w.currentTarget);S=f.loop?hRe(S,O+1):S.slice(O+1)}setTimeout(()=>UV(S))}}),children:typeof l=="function"?l({isCurrentTabStop:h,hasTabStop:v!=null}):l})})},"RovingFocusGroupItem")),dut={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function dRe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Bv(dRe,"getDirectionAwareKey");function fRe(e,t,n){const i=dRe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return dut[i]}Bv(fRe,"getFocusIntent");function UV(e,t=!1){const n=document.activeElement;for(const i of e)if(i===n||(i.focus({preventScroll:t}),document.activeElement!==n))return}Bv(UV,"focusFirst");function hRe(e,t){return e.map((n,i)=>e[(t+i)%e.length])}Bv(hRe,"wrapArray");var QV=out,zV=uut,fut=Object.defineProperty,br=(e,t)=>fut(e,"name",{value:t,configurable:!0}),SB=["Enter"," "],hut=["ArrowDown","PageUp","Home"],pRe=["ArrowUp","PageDown","End"],put=[...hut,...pRe],mut={ltr:[...SB,"ArrowRight"],rtl:[...SB,"ArrowLeft"]},gut={ltr:["ArrowLeft"],rtl:["ArrowRight"]},oM="Menu",[yC,but,yut]=AV(oM),[Uv,mRe]=Qc(oM,[yut,X1,Y1]),lM=X1(),gRe=Y1(),[bRe,Ob]=Uv(oM),[vut,tT]=Uv(oM),xut=br(e=>{const{__scopeMenu:t,open:n=!1,children:i,dir:r,onOpenChange:s,modal:o=!0}=e,l=lM(t),[c,u]=p.useState(null),d=p.useRef(!1),f=yf(s),h=JA(r);return p.useEffect(()=>{const m=br(()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},"handleKeyDown"),g=br(()=>d.current=!1,"handlePointer");return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),p.useEffect(()=>{if(!n)return;const m=br(()=>f(!1),"handleBlur");return window.addEventListener("blur",m),()=>window.removeEventListener("blur",m)},[n,f]),a.jsx(sM,{...l,children:a.jsx(bRe,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:a.jsx(vut,{scope:t,onClose:p.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:o,children:i})})})},"Menu"),yRe=p.forwardRef(br(function(t,n){const{__scopeMenu:i,...r}=t,s=lM(i);return a.jsx($V,{...s,...r,ref:n})},"MenuAnchor")),vRe="MenuPortal",[wut,xRe]=Uv(vRe,{forceMount:void 0}),kut=br(e=>{const{__scopeMenu:t,forceMount:n,children:i,container:r}=e,s=Ob(vRe,t);return a.jsx(wut,{scope:t,forceMount:n,children:a.jsx(Rh,{present:n||s.open,children:a.jsx(RV,{asChild:!0,container:r,children:i})})})},"MenuPortal"),df="MenuContent",[Out,VV]=Uv(df),Sut=p.forwardRef(br(function(t,n){const i=xRe(df,t.__scopeMenu),{forceMount:r=i.forceMount,...s}=t,o=Ob(df,t.__scopeMenu),l=tT(df,t.__scopeMenu);return a.jsx(yC.Provider,{scope:t.__scopeMenu,children:a.jsx(Rh,{present:r||o.open,children:a.jsx(yC.Slot,{scope:t.__scopeMenu,children:l.modal?a.jsx(Eut,{...s,ref:n}):a.jsx(Cut,{...s,ref:n})})})})},"MenuContent")),Eut=p.forwardRef(br(function(t,n){const i=Ob(df,t.__scopeMenu),r=p.useRef(null),s=Rr(n,r);return p.useEffect(()=>{const o=r.current;if(o)return ZNe(o)},[]),a.jsx(HV,{...t,ref:s,trapFocus:i.open,disableOutsidePointerEvents:i.open,disableOutsideScroll:!0,onFocusOutside:Un(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentModal")),Cut=p.forwardRef(br(function(t,n){const i=Ob(df,t.__scopeMenu);return a.jsx(HV,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentNonModal")),Aut=Yp("MenuContent.ScrollLock"),HV=p.forwardRef(br(function(t,n){const{__scopeMenu:i,loop:r=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,disableOutsideScroll:b,...v}=t,y=Ob(df,i),w=tT(df,i),x=lM(i),k=gRe(i),S=but(i),[O,A]=p.useState(null),E=p.useRef(null),j=Rr(n,E,y.onContentChange),T=p.useRef(0),R=p.useRef(""),C=p.useRef(0),N=p.useRef(null),P=p.useRef("right"),I=p.useRef(0),D=b?PV:p.Fragment,_=b?{as:Aut,allowPinchZoom:!0}:void 0,L=br(M=>{var W,X;const H=R.current+M,q=S().filter(ce=>!ce.disabled),U=document.activeElement,Z=(W=q.find(ce=>ce.ref.current===U))==null?void 0:W.textValue,z=q.map(ce=>ce.textValue),J=TRe(z,H,Z),ne=(X=q.find(ce=>ce.textValue===J))==null?void 0:X.ref.current;br(function ce(V){R.current=V,window.clearTimeout(T.current),V!==""&&(T.current=window.setTimeout(()=>ce(""),1e3))},"updateSearch")(H),ne&&setTimeout(()=>ne.focus())},"handleTypeaheadSearch");p.useEffect(()=>()=>window.clearTimeout(T.current),[]),nM();const F=p.useCallback(M=>{var q,U;return P.current===((q=N.current)==null?void 0:q.side)&&jRe(M,(U=N.current)==null?void 0:U.area)},[]);return a.jsx(Out,{scope:i,searchRef:R,onItemEnter:p.useCallback(M=>{F(M)&&M.preventDefault()},[F]),onItemLeave:p.useCallback(M=>{var H;F(M)||((H=E.current)==null||H.focus(),A(null))},[F]),onTriggerLeave:p.useCallback(M=>{F(M)&&M.preventDefault()},[F]),pointerGraceTimerRef:C,onPointerGraceIntentChange:p.useCallback(M=>{N.current=M},[]),children:a.jsx(D,{..._,children:a.jsx(LNe,{asChild:!0,trapped:s,onMountAutoFocus:Un(o,M=>{var H;M.preventDefault(),(H=E.current)==null||H.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:a.jsx(_V,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,children:a.jsx(QV,{asChild:!0,...k,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:O,onCurrentTabStopIdChange:A,onEntryFocus:Un(u,M=>{w.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(FV,{role:"menu","aria-orientation":"vertical","data-state":WV(y.open),"data-radix-menu-content":"",dir:w.dir,...x,...v,ref:j,style:{outline:"none",...v.style},onKeyDown:Un(v.onKeyDown,M=>{const q=M.target.closest("[data-radix-menu-content]")===M.currentTarget,U=M.ctrlKey||M.altKey||M.metaKey,Z=M.key.length===1;q&&(M.key==="Tab"&&M.preventDefault(),!U&&Z&&L(M.key));const z=E.current;if(M.target!==z||!put.includes(M.key))return;M.preventDefault();const ne=S().filter(W=>!W.disabled).map(W=>W.ref.current);pRe.includes(M.key)&&ne.reverse(),CRe(ne)}),onBlur:Un(t.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(T.current),R.current="")}),onPointerMove:Un(t.onPointerMove,t1(M=>{const H=M.target,q=I.current!==M.clientX;if(M.currentTarget.contains(H)&&q){const U=M.clientX>I.current?"right":"left";P.current=U,I.current=M.clientX}}))})})})})})})},"MenuContentImpl")),Tut=p.forwardRef(br(function(t,n){const{__scopeMenu:i,...r}=t;return a.jsx(Jr.div,{role:"group",...r,ref:n})},"MenuGroup")),EB="MenuItem",See="menu.itemSelect",qV=p.forwardRef(br(function(t,n){const{disabled:i=!1,onSelect:r,...s}=t,o=p.useRef(null),l=tT(EB,t.__scopeMenu),c=VV(EB,t.__scopeMenu),u=Rr(n,o),d=p.useRef(!1),f=br(()=>{const h=o.current;if(!i&&h){const m=new CustomEvent(See,{bubbles:!0,cancelable:!0});h.addEventListener(See,g=>r==null?void 0:r(g),{once:!0}),CV(h,m),m.defaultPrevented?d.current=!1:l.onClose()}},"handleSelect");return a.jsx(wRe,{...s,ref:u,disabled:i,onClick:Un(t.onClick,f),onPointerDown:h=>{var m;(m=t.onPointerDown)==null||m.call(t,h),d.current=!0},onPointerUp:Un(t.onPointerUp,h=>{var m;d.current||(m=h.currentTarget)==null||m.click()}),onKeyDown:Un(t.onKeyDown,h=>{i||h.target!==h.currentTarget||c.searchRef.current!==""&&h.key===" "||SB.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})},"MenuItem")),wRe=p.forwardRef(br(function(t,n){const{__scopeMenu:i,disabled:r=!1,textValue:s,...o}=t,l=VV(EB,i),c=gRe(i),u=p.useRef(null),d=Rr(n,u),[f,h]=p.useState(!1),[m,g]=p.useState("");return p.useEffect(()=>{const b=u.current;b&&g((b.textContent??"").trim())},[o.children]),a.jsx(yC.ItemSlot,{scope:i,disabled:r,textValue:s??m,children:a.jsx(zV,{asChild:!0,...c,focusable:!r,children:a.jsx(Jr.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:d,onPointerMove:Un(t.onPointerMove,t1(b=>{r?l.onItemLeave(b):(l.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Un(t.onPointerLeave,t1(b=>l.onItemLeave(b))),onFocus:Un(t.onFocus,()=>h(!0)),onBlur:Un(t.onBlur,()=>h(!1))})})})},"MenuItemImpl")),_ut=p.forwardRef(br(function(t,n){const{checked:i=!1,onCheckedChange:r,...s}=t;return a.jsx(ORe,{scope:t.__scopeMenu,checked:i,children:a.jsx(qV,{role:"menuitemcheckbox","aria-checked":vC(i)?"mixed":i,...s,ref:n,"data-state":cM(i),onSelect:Un(s.onSelect,()=>r==null?void 0:r(vC(i)?!0:!i),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),jut="MenuRadioGroup",[Nut,Rut]=Uv(jut,{value:void 0,onValueChange:br(()=>{},"onValueChange")}),Iut=p.forwardRef(br(function(t,n){const{value:i,onValueChange:r,...s}=t,o=yf(r);return a.jsx(Nut,{scope:t.__scopeMenu,value:i,onValueChange:o,children:a.jsx(Tut,{...s,ref:n})})},"MenuRadioGroup")),Put="MenuRadioItem",Dut=p.forwardRef(br(function(t,n){const{value:i,...r}=t,s=Rut(Put,t.__scopeMenu),o=i===s.value;return a.jsx(ORe,{scope:t.__scopeMenu,checked:o,children:a.jsx(qV,{role:"menuitemradio","aria-checked":o,...r,ref:n,"data-state":cM(o),onSelect:Un(r.onSelect,()=>{var l;return(l=s.onValueChange)==null?void 0:l.call(s,i)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),kRe="MenuItemIndicator",[ORe,Mut]=Uv(kRe,{checked:!1}),Lut=p.forwardRef(br(function(t,n){const{__scopeMenu:i,forceMount:r,...s}=t,o=Mut(kRe,i);return a.jsx(Rh,{present:r||vC(o.checked)||o.checked===!0,children:a.jsx(Jr.span,{...s,ref:n,"data-state":cM(o.checked)})})},"MenuItemIndicator")),$ut=p.forwardRef(br(function(t,n){const{__scopeMenu:i,...r}=t;return a.jsx(Jr.div,{role:"separator","aria-orientation":"horizontal",...r,ref:n})},"MenuSeparator")),SRe="MenuSub",[Fut,ERe]=Uv(SRe),But=br(e=>{const{__scopeMenu:t,children:n,open:i=!1,onOpenChange:r}=e,s=Ob(SRe,t),o=lM(t),[l,c]=p.useState(null),[u,d]=p.useState(null),f=yf(r);return p.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),a.jsx(sM,{...o,children:a.jsx(bRe,{scope:t,open:i,onOpenChange:f,content:u,onContentChange:d,children:a.jsx(Fut,{scope:t,contentId:Jg(),triggerId:Jg(),trigger:l,onTriggerChange:c,children:n})})})},"MenuSub"),p_="MenuSubTrigger",Uut=p.forwardRef(br(function(t,n){const i=Ob(p_,t.__scopeMenu),r=tT(p_,t.__scopeMenu),s=ERe(p_,t.__scopeMenu),o=VV(p_,t.__scopeMenu),l=p.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=o,d={__scopeMenu:t.__scopeMenu},f=p.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);p.useEffect(()=>f,[f]),p.useEffect(()=>{const m=c.current;return()=>{window.clearTimeout(m),u(null)}},[c,u]);const h=Rr(n,s.onTriggerChange);return a.jsx(yRe,{asChild:!0,...d,children:a.jsx(wRe,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?s.contentId:void 0,"data-state":WV(i.open),...t,ref:h,onClick:m=>{var g;(g=t.onClick)==null||g.call(t,m),!(t.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),i.open||i.onOpenChange(!0))},onPointerMove:Un(t.onPointerMove,t1(m=>{o.onItemEnter(m),!m.defaultPrevented&&!t.disabled&&!i.open&&!l.current&&(o.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{i.onOpenChange(!0),f()},100))})),onPointerLeave:Un(t.onPointerLeave,t1(m=>{var b,v;f();const g=(b=i.content)==null?void 0:b.getBoundingClientRect();if(g){const y=(v=i.content)==null?void 0:v.dataset.side,w=y==="right",x=w?-5:5,k=g[w?"left":"right"],S=g[w?"right":"left"];o.onPointerGraceIntentChange({area:[{x:m.clientX+x,y:m.clientY},{x:k,y:g.top},{x:S,y:g.top},{x:S,y:g.bottom},{x:k,y:g.bottom}],side:y}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(m),m.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Un(t.onKeyDown,m=>{var b;t.disabled||m.target!==m.currentTarget||o.searchRef.current!==""&&m.key===" "||mut[r.dir].includes(m.key)&&(i.onOpenChange(!0),(b=i.content)==null||b.focus(),m.preventDefault())})})})},"MenuSubTrigger")),Qut="MenuSubContent",zut=p.forwardRef(br(function(t,n){const i=xRe(df,t.__scopeMenu),{forceMount:r=i.forceMount,align:s="start",...o}=t,l=Ob(df,t.__scopeMenu),c=tT(df,t.__scopeMenu),u=ERe(Qut,t.__scopeMenu),d=p.useRef(null),f=Rr(n,d);return a.jsx(yC.Provider,{scope:t.__scopeMenu,children:a.jsx(Rh,{present:r||l.open,children:a.jsx(yC.Slot,{scope:t.__scopeMenu,children:a.jsx(HV,{id:u.contentId,"aria-labelledby":u.triggerId,...o,ref:f,align:s,side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{var m;c.isUsingKeyboardRef.current&&((m=d.current)==null||m.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:Un(t.onFocusOutside,h=>{h.target!==u.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:Un(t.onEscapeKeyDown,h=>{c.onClose(),h.preventDefault()}),onKeyDown:Un(t.onKeyDown,h=>{var b;const m=h.currentTarget.contains(h.target),g=gut[c.dir].includes(h.key);m&&g&&(l.onOpenChange(!1),(b=u.trigger)==null||b.focus(),h.preventDefault())})})})})})},"MenuSubContent"));function WV(e){return e?"open":"closed"}br(WV,"getOpenState");function vC(e){return e==="indeterminate"}br(vC,"isIndeterminate");function cM(e){return vC(e)?"indeterminate":e?"checked":"unchecked"}br(cM,"getCheckedState");function CRe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}br(CRe,"focusFirst");function ARe(e,t){return e.map((n,i)=>e[(t+i)%e.length])}br(ARe,"wrapArray");function TRe(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let o=ARe(e,Math.max(s,0));r.length===1&&(o=o.filter(u=>u!==n));const c=o.find(u=>u.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}br(TRe,"getNextMatch");function _Re(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,o=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}br(_Re,"isPointInPolygon");function jRe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return _Re(n,t)}br(jRe,"isPointerInGraceArea");function t1(e){return t=>t.pointerType==="mouse"?e(t):void 0}br(t1,"whenMouse");var Vut=xut,Hut=yRe,qut=kut,Wut=Sut,Kut=qV,Gut=_ut,Xut=Iut,Yut=Dut,Zut=Lut,Jut=$ut,edt=But,tdt=Uut,ndt=zut,idt=Object.defineProperty,Vu=(e,t)=>idt(e,"name",{value:t,configurable:!0}),KV="DropdownMenu",[rdt,Shn]=Qc(KV,[mRe]),Hu=mRe(),[sdt,NRe]=rdt(KV),adt=Vu(e=>{const{__scopeDropdownMenu:t,children:n,dir:i,open:r,defaultOpen:s,onOpenChange:o,modal:l=!0}=e,c=Hu(t),u=p.useRef(null),[d,f]=Id({prop:r,defaultProp:s??!1,onChange:o,caller:KV});return a.jsx(sdt,{scope:t,triggerId:Jg(),triggerRef:u,contentId:Jg(),open:d,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(h=>!h),[f]),modal:l,children:a.jsx(Vut,{...c,open:d,onOpenChange:f,dir:i,modal:l,children:n})})},"DropdownMenu"),odt="DropdownMenuTrigger",ldt=p.forwardRef(Vu(function(t,n){const{__scopeDropdownMenu:i,disabled:r=!1,...s}=t,o=NRe(odt,i),l=Hu(i),c=Rr(n,o.triggerRef);return a.jsx(Hut,{asChild:!0,...l,children:a.jsx(Jr.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:c,onPointerDown:Un(t.onPointerDown,u=>{!r&&u.button===0&&u.ctrlKey===!1&&(o.onOpenToggle(),o.open||u.preventDefault())}),onKeyDown:Un(t.onKeyDown,u=>{r||(["Enter"," "].includes(u.key)&&o.onOpenToggle(),u.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),cdt=Vu(e=>{const{__scopeDropdownMenu:t,...n}=e,i=Hu(t);return a.jsx(qut,{...i,...n})},"DropdownMenuPortal"),udt="DropdownMenuContent",ddt=p.forwardRef(Vu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=NRe(udt,i),o=Hu(i),l=p.useRef(!1);return a.jsx(Wut,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...r,ref:n,onCloseAutoFocus:Un(t.onCloseAutoFocus,c=>{var u;l.current||(u=s.triggerRef.current)==null||u.focus(),l.current=!1,c.preventDefault()}),onInteractOutside:Un(t.onInteractOutside,c=>{const u=c.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;(!s.modal||f)&&(l.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),fdt=p.forwardRef(Vu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Hu(i);return a.jsx(Kut,{...s,...r,ref:n})},"DropdownMenuItem")),hdt=p.forwardRef(Vu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Hu(i);return a.jsx(Gut,{...s,...r,ref:n})},"DropdownMenuCheckboxItem")),pdt=p.forwardRef(Vu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Hu(i);return a.jsx(Xut,{...s,...r,ref:n})},"DropdownMenuRadioGroup")),mdt=p.forwardRef(Vu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Hu(i);return a.jsx(Yut,{...s,...r,ref:n})},"DropdownMenuRadioItem")),gdt=p.forwardRef(Vu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Hu(i);return a.jsx(Zut,{...s,...r,ref:n})},"DropdownMenuItemIndicator")),bdt=p.forwardRef(Vu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Hu(i);return a.jsx(Jut,{...s,...r,ref:n})},"DropdownMenuSeparator")),ydt=Vu(e=>{const{__scopeDropdownMenu:t,children:n,open:i,onOpenChange:r,defaultOpen:s}=e,o=Hu(t),[l,c]=Id({prop:i,defaultProp:s??!1,onChange:r,caller:"DropdownMenuSub"});return a.jsx(edt,{...o,open:l,onOpenChange:c,children:n})},"DropdownMenuSub"),vdt=p.forwardRef(Vu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Hu(i);return a.jsx(tdt,{...s,...r,ref:n})},"DropdownMenuSubTrigger")),xdt=p.forwardRef(Vu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Hu(i);return a.jsx(ndt,{...s,...r,ref:n,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuSubContent")),wdt=adt,kdt=ldt,RRe=cdt,Odt=ddt,IRe=fdt,Sdt=hdt,Edt=pdt,Cdt=mdt,PRe=gdt,Adt=bdt,Tdt=ydt,_dt=vdt,jdt=xdt,Ndt=Object.defineProperty,Sb=(e,t)=>Ndt(e,"name",{value:t,configurable:!0}),GV="Popover",[DRe,Ehn]=Qc(GV,[X1]),XV=X1(),[Rdt,Z1]=DRe(GV),Idt=Sb(e=>{const{__scopePopover:t,children:n,open:i,defaultOpen:r,onOpenChange:s,modal:o=!1}=e,l=XV(t),c=p.useRef(null),[u,d]=p.useState(!1),[f,h]=Id({prop:i,defaultProp:r??!1,onChange:s,caller:GV});return a.jsx(sM,{...l,children:a.jsx(Rdt,{scope:t,contentId:Jg(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:p.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:u,onCustomAnchorAdd:p.useCallback(()=>d(!0),[]),onCustomAnchorRemove:p.useCallback(()=>d(!1),[]),modal:o,children:n})})},"Popover"),Pdt="PopoverTrigger",Ddt=p.forwardRef(Sb(function(t,n){const{__scopePopover:i,...r}=t,s=Z1(Pdt,i),o=XV(i),l=Rr(n,s.triggerRef),c=a.jsx(Jr.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":YV(s.open),...r,ref:l,onClick:Un(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:a.jsx($V,{asChild:!0,...o,children:c})},"PopoverTrigger")),MRe="PopoverPortal",[Mdt,Ldt]=DRe(MRe,{forceMount:void 0}),$dt=Sb(e=>{const{__scopePopover:t,forceMount:n,children:i,container:r}=e,s=Z1(MRe,t);return a.jsx(Mdt,{scope:t,forceMount:n,children:a.jsx(Rh,{present:n||s.open,children:a.jsx(RV,{asChild:!0,container:r,children:i})})})},"PopoverPortal"),xC="PopoverContent",Fdt=p.forwardRef(Sb(function(t,n){const i=Ldt(xC,t.__scopePopover),{forceMount:r=i.forceMount,...s}=t,o=Z1(xC,t.__scopePopover);return a.jsx(Rh,{present:r||o.open,children:o.modal?a.jsx(Udt,{...s,ref:n}):a.jsx(Qdt,{...s,ref:n})})},"PopoverContent")),Bdt=Yp("PopoverContent.RemoveScroll"),Udt=p.forwardRef(Sb(function(t,n){const i=Z1(xC,t.__scopePopover),r=p.useRef(null),s=Rr(n,r),o=p.useRef(!1);return p.useEffect(()=>{const l=r.current;if(l)return ZNe(l)},[]),a.jsx(PV,{as:Bdt,allowPinchZoom:!0,children:a.jsx(LRe,{...t,ref:s,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Un(t.onCloseAutoFocus,l=>{var c;l.preventDefault(),o.current||(c=i.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Un(t.onPointerDownOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;o.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:Un(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),Qdt=p.forwardRef(Sb(function(t,n){const i=Z1(xC,t.__scopePopover),r=p.useRef(!1),s=p.useRef(!1);return a.jsx(LRe,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,c;(l=t.onCloseAutoFocus)==null||l.call(t,o),o.defaultPrevented||(r.current||(c=i.triggerRef.current)==null||c.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var u,d;(u=t.onInteractOutside)==null||u.call(t,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=o.target;((d=i.triggerRef.current)==null?void 0:d.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})},"PopoverContentNonModal")),LRe=p.forwardRef(Sb(function(t,n){const{__scopePopover:i,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,...h}=t,m=Z1(xC,i),g=XV(i);return nM(),a.jsx(LNe,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:a.jsx(_V,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:f,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),deferPointerDownOutside:!0,children:a.jsx(FV,{"data-state":YV(m.open),role:"dialog",id:m.contentId,...g,...h,ref:n,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl"));function YV(e){return e?"open":"closed"}Sb(YV,"getState");var $Re=Idt,FRe=Ddt,BRe=$dt,URe=Fdt,zdt=Object.defineProperty,Tl=(e,t)=>zdt(e,"name",{value:t,configurable:!0}),QRe="Radio",[Vdt,zRe]=Qc(QRe),[Hdt,uM]=Vdt(QRe);function VRe(e){const{__scopeRadio:t,checked:n=!1,children:i,disabled:r,form:s,name:o,onCheck:l,required:c,value:u="on",internal_do_not_use_render:d}=e,[f,h]=p.useState(null),[m,g]=p.useState(null),b=p.useRef(!1),[v,y]=p.useReducer(k=>k+1,0),w=f?!!s||!!f.closest("form"):!0,x={checked:n,disabled:r,required:c,name:o,form:s,value:u,control:f,setControl:h,hasConsumerStoppedPropagationRef:b,userInteractionCount:v,onUserInteraction:y,isFormControl:w,bubbleInput:m,setBubbleInput:g,onCheck:Tl(()=>l==null?void 0:l(),"onCheck")};return a.jsx(Hdt,{scope:t,...x,children:HRe(d)?d(x):i})}Tl(VRe,"RadioProvider");var qdt="RadioTrigger",Wdt=p.forwardRef(Tl(function({__scopeRadio:t,onClick:n,...i},r){const{checked:s,disabled:o,value:l,setControl:c,onCheck:u,hasConsumerStoppedPropagationRef:d,onUserInteraction:f,isFormControl:h,bubbleInput:m}=uM(qdt,t),g=Rr(r,c);return a.jsx(Jr.button,{type:"button",role:"radio","aria-checked":s,"data-state":ZV(s),"data-disabled":o?"":void 0,disabled:o,value:l,...i,ref:g,onClick:Un(n,b=>{s||(f(),u()),m&&h&&(d.current=b.isPropagationStopped(),d.current||b.stopPropagation())})})},"RadioTrigger")),Kdt="RadioIndicator",Gdt=p.forwardRef(Tl(function(t,n){const{__scopeRadio:i,forceMount:r,...s}=t,o=uM(Kdt,i);return a.jsx(Rh,{present:r||o.checked,children:a.jsx(Jr.span,{"data-state":ZV(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:n})})},"RadioIndicator")),Xdt="RadioBubbleInput",Ydt=p.forwardRef(Tl(function({__scopeRadio:t,onClick:n,...i},r){const{control:s,checked:o,required:l,disabled:c,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:m,hasConsumerStoppedPropagationRef:g,userInteractionCount:b}=uM(Xdt,t),v=Rr(r,m),y=eT(s),w=p.useRef(!1),x=p.useRef(o),k=p.useRef(b);p.useEffect(()=>{const O=h;if(!O)return;const A=window.HTMLInputElement.prototype,j=Object.getOwnPropertyDescriptor(A,"checked").set,T=b!==k.current;k.current=b;const R=x.current!==o;x.current=o;const C=!(T&&g.current);if(R&&j){w.current=!T;const N=new Event("click",{bubbles:C});j.call(O,o),O.dispatchEvent(N),w.current=!1}},[h,o,g,b]);const S=p.useRef(o);return a.jsx(Jr.input,{type:"radio","aria-hidden":!0,defaultChecked:S.current,required:l,disabled:c,name:u,value:d,form:f,...i,tabIndex:-1,ref:v,onClick:Un(n,O=>{w.current&&O.stopPropagation()}),style:{...i.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function HRe(e){return typeof e=="function"}Tl(HRe,"isFunction");function ZV(e){return e?"checked":"unchecked"}Tl(ZV,"getState");var Zdt=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],JV="RadioGroup",[Jdt,Chn]=Qc(JV,[Y1,zRe]),qRe=Y1(),dM=zRe(),[eft,tft]=Jdt(JV),nft=p.forwardRef(Tl(function(t,n){const{__scopeRadioGroup:i,name:r,form:s,defaultValue:o,value:l,required:c=!1,disabled:u=!1,orientation:d,dir:f,loop:h=!0,onValueChange:m,...g}=t,b=qRe(i),v=JA(f),[y,w]=Id({prop:l,defaultProp:o??null,onChange:m,caller:JV}),[x,k]=p.useState(null),S=Rr(n,k),O=p.useRef(y);return p.useEffect(()=>{const A=s?x==null?void 0:x.ownerDocument.getElementById(s):x==null?void 0:x.closest("form");if(A instanceof HTMLFormElement){const E=Tl(()=>w(O.current),"reset");return A.addEventListener("reset",E),()=>A.removeEventListener("reset",E)}},[x,s,w]),a.jsx(eft,{scope:i,name:r,form:s,required:c,disabled:u,value:y,onValueChange:w,children:a.jsx(QV,{asChild:!0,...b,orientation:d,dir:v,loop:h,children:a.jsx(Jr.div,{role:"radiogroup","aria-required":c,"aria-orientation":d,"data-disabled":u?"":void 0,dir:v,...g,ref:S})})})},"RadioGroup")),ift="RadioGroupItemProvider",rft="RadioGroupItemTrigger";function WRe(e){const{__scopeRadioGroup:t,value:n,disabled:i,children:r,internal_do_not_use_render:s}=e,o=tft(ift,t),l=dM(t),c=o.disabled||i;return a.jsx(VRe,{...l,checked:o.value===n,disabled:c,required:o.required,name:o.name,form:o.form,value:n,onCheck:()=>o.onValueChange(n),internal_do_not_use_render:s,children:r})}Tl(WRe,"RadioGroupItemProvider");var sft=p.forwardRef(Tl(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=qRe(i),o=dM(i),{checked:l,disabled:c}=uM(rft,o.__scopeRadio),u=p.useRef(null),d=Rr(n,u),f=p.useRef(!1);return p.useEffect(()=>{const h=Tl(g=>{Zdt.includes(g.key)&&(f.current=!0)},"handleKeyDown"),m=Tl(()=>f.current=!1,"handleKeyUp");return document.addEventListener("keydown",h),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",m)}},[]),a.jsx(zV,{asChild:!0,...s,focusable:!c,active:l,children:a.jsx(Wdt,{...o,...r,ref:d,onKeyDown:Un(r.onKeyDown,h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:Un(r.onFocus,()=>{var h;f.current&&((h=u.current)==null||h.click())})})})},"RadioGroupItemTrigger")),aft=p.forwardRef(Tl(function(t,n){const{__scopeRadioGroup:i,value:r,disabled:s,...o}=t;return a.jsx(WRe,{__scopeRadioGroup:i,value:r,disabled:s,internal_do_not_use_render:({isFormControl:l})=>a.jsxs(a.Fragment,{children:[a.jsx(sft,{...o,ref:n,__scopeRadioGroup:i}),l&&a.jsx(oft,{__scopeRadioGroup:i})]})})},"RadioGroupItem")),oft=p.forwardRef(Tl(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=dM(i);return a.jsx(Ydt,{...s,...r,ref:n})},"RadioGroupItemBubbleInput")),lft=p.forwardRef(Tl(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=dM(i);return a.jsx(Gdt,{...s,...r,ref:n})},"RadioGroupIndicator")),cft=Object.defineProperty,eb=(e,t)=>cft(e,"name",{value:t,configurable:!0}),eH="Switch",[uft,Ahn]=Qc(eH),[dft,tH]=uft(eH);function KRe(e){const{__scopeSwitch:t,checked:n,children:i,defaultChecked:r,disabled:s,form:o,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,m]=Id({prop:n,defaultProp:r??!1,onChange:c,caller:eH}),[g,b]=p.useState(null),[v,y]=p.useState(null),w=p.useRef(!1),[x,k]=p.useReducer(A=>A+1,0),S=g?!!o||!!g.closest("form"):!0,O={checked:h,setChecked:m,disabled:s,control:g,setControl:b,name:l,form:o,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:x,onUserInteraction:k,required:u,defaultChecked:r,isFormControl:S,bubbleInput:v,setBubbleInput:y};return a.jsx(dft,{scope:t,...O,children:GRe(f)?f(O):i})}eb(KRe,"SwitchProvider");var fft="SwitchTrigger",hft=p.forwardRef(eb(function({__scopeSwitch:t,onClick:n,...i},r){const{control:s,form:o,value:l,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:g,isFormControl:b,bubbleInput:v}=tH(fft,t),y=Rr(r,f),w=p.useRef(u);return p.useEffect(()=>{const x=o?s==null?void 0:s.ownerDocument.getElementById(o):s==null?void 0:s.form;if(x instanceof HTMLFormElement){const k=eb(()=>h(w.current),"reset");return x.addEventListener("reset",k),()=>x.removeEventListener("reset",k)}},[s,o,h]),a.jsx(Jr.button,{type:"button",role:"switch","aria-checked":u,"aria-required":d,"data-state":nH(u),"data-disabled":c?"":void 0,disabled:c,value:l,...i,ref:y,onClick:Un(n,x=>{g(),h(k=>!k),v&&b&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})})},"SwitchTrigger")),pft=p.forwardRef(eb(function(t,n){const{__scopeSwitch:i,name:r,checked:s,defaultChecked:o,required:l,disabled:c,value:u,onCheckedChange:d,form:f,...h}=t;return a.jsx(KRe,{__scopeSwitch:i,checked:s,defaultChecked:o,disabled:c,required:l,onCheckedChange:d,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>a.jsxs(a.Fragment,{children:[a.jsx(hft,{...h,ref:n,__scopeSwitch:i}),m&&a.jsx(yft,{__scopeSwitch:i})]})})},"Switch")),mft="SwitchThumb",gft=p.forwardRef(eb(function(t,n){const{__scopeSwitch:i,...r}=t,s=tH(mft,i);return a.jsx(Jr.span,{"data-state":nH(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:n})},"SwitchThumb")),bft="SwitchBubbleInput",yft=p.forwardRef(eb(function({__scopeSwitch:t,onClick:n,...i},r){const{control:s,hasConsumerStoppedPropagationRef:o,userInteractionCount:l,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:g,bubbleInput:b,setBubbleInput:v}=tH(bft,t),y=Rr(r,v),w=eT(s),x=p.useRef(!1),k=p.useRef(c),S=p.useRef(l);p.useEffect(()=>{const A=b;if(!A)return;const E=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(E,"checked").set,R=l!==S.current;S.current=l;const C=k.current!==c;k.current=c;const N=!(R&&o.current);if(C&&T){x.current=!R;const P=new Event("click",{bubbles:N});T.call(A,c),A.dispatchEvent(P),x.current=!1}},[b,c,o,l]);const O=p.useRef(c);return a.jsx(Jr.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??O.current,required:d,disabled:f,name:h,value:m,form:g,...i,tabIndex:-1,ref:y,onClick:Un(n,A=>{x.current&&A.stopPropagation()}),style:{...i.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function GRe(e){return typeof e=="function"}eb(GRe,"isFunction");function nH(e){return e?"checked":"unchecked"}eb(nH,"getState");var vft=Object.defineProperty,xft=(e,t)=>vft(e,"name",{value:t,configurable:!0}),wft="Toggle",kft=p.forwardRef(xft(function(t,n){const{pressed:i,defaultPressed:r,onPressedChange:s,...o}=t,[l,c]=Id({prop:i,onChange:s,defaultProp:r??!1,caller:wft});return a.jsx(Jr.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":t.disabled?"":void 0,...o,ref:n,onClick:Un(t.onClick,()=>{t.disabled||c(!l)})})},"Toggle")),Oft=Object.defineProperty,tb=(e,t)=>Oft(e,"name",{value:t,configurable:!0}),J1="ToggleGroup",[XRe,Thn]=Qc(J1,[Y1]),YRe=Y1(),Sft=p.forwardRef(tb(function(t,n){const{type:i,...r}=t;if(i==="single"){const s=r;return a.jsx(Eft,{role:"radiogroup",...s,ref:n})}if(i==="multiple"){const s=r;return a.jsx(Cft,{role:"toolbar",...s,ref:n})}throw new Error(`Missing prop \`type\` expected on \`${J1}\``)},"ToggleGroup")),[ZRe,JRe]=XRe(J1),Eft=p.forwardRef(tb(function(t,n){const{value:i,defaultValue:r,onValueChange:s=tb(()=>{},"onValueChange"),...o}=t,[l,c]=Id({prop:i,defaultProp:r??"",onChange:s,caller:J1});return a.jsx(ZRe,{scope:t.__scopeToggleGroup,type:"single",value:p.useMemo(()=>l?[l]:[],[l]),onItemActivate:c,onItemDeactivate:p.useCallback(()=>c(""),[c]),children:a.jsx(eIe,{...o,ref:n})})},"ToggleGroupImplSingle")),Cft=p.forwardRef(tb(function(t,n){const{value:i,defaultValue:r,onValueChange:s=tb(()=>{},"onValueChange"),...o}=t,[l,c]=Id({prop:i,defaultProp:r??[],onChange:s,caller:J1}),u=p.useCallback(f=>c((h=[])=>[...h,f]),[c]),d=p.useCallback(f=>c((h=[])=>h.filter(m=>m!==f)),[c]);return a.jsx(ZRe,{scope:t.__scopeToggleGroup,type:"multiple",value:l,onItemActivate:u,onItemDeactivate:d,children:a.jsx(eIe,{...o,ref:n})})},"ToggleGroupImplMultiple")),[Aft,Tft]=XRe(J1),eIe=p.forwardRef(tb(function(t,n){const{__scopeToggleGroup:i,disabled:r=!1,rovingFocus:s=!0,orientation:o,dir:l,loop:c=!0,...u}=t,d=YRe(i),f=JA(l),h={dir:f,...u};return a.jsx(Aft,{scope:i,rovingFocus:s,disabled:r,children:s?a.jsx(QV,{asChild:!0,...d,orientation:o,dir:f,loop:c,children:a.jsx(Jr.div,{...h,ref:n})}):a.jsx(Jr.div,{...h,ref:n})})},"ToggleGroupImpl")),CB="ToggleGroupItem",_ft=p.forwardRef(tb(function(t,n){const i=JRe(CB,t.__scopeToggleGroup),r=Tft(CB,t.__scopeToggleGroup),s=YRe(t.__scopeToggleGroup),o=i.value.includes(t.value),l=r.disabled||t.disabled,c={...t,pressed:o,disabled:l},u=p.useRef(null);return r.rovingFocus?a.jsx(zV,{asChild:!0,...s,focusable:!l,active:o,ref:u,children:a.jsx(Eee,{...c,ref:n})}):a.jsx(Eee,{...c,ref:n})},"ToggleGroupItem")),Eee=p.forwardRef(tb(function(t,n){const{__scopeToggleGroup:i,value:r,...s}=t,o=JRe(CB,i),l={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},c=o.type==="single"?l:void 0;return a.jsx(kft,{...c,...s,ref:n,onPressedChange:u=>{u?o.onItemActivate(r):o.onItemDeactivate(r)}})},"ToggleGroupItemImpl")),jft=Object.defineProperty,Mo=(e,t)=>jft(e,"name",{value:t,configurable:!0}),[iH,_hn]=Qc("Tooltip",[X1]),rH=X1(),Nft="TooltipProvider",Rft=700,AB="tooltip.open",[Ift,sH]=iH(Nft),Pft=Mo(e=>{const{__scopeTooltip:t,delayDuration:n=Rft,skipDelayDuration:i=300,disableHoverableContent:r=!1,children:s}=e,o=p.useRef(!0),l=p.useRef(!1),c=p.useRef(0);return p.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),a.jsx(Ift,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:p.useCallback(()=>{i<=0||(window.clearTimeout(c.current),o.current=!1)},[i]),onClose:p.useCallback(()=>{i<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,i))},[i]),isPointerInTransitRef:l,onPointerInTransitChange:p.useCallback(u=>{l.current=u},[]),disableHoverableContent:r,children:s})},"TooltipProvider"),TB="Tooltip",[Dft,nT]=iH(TB),Mft=Mo(e=>{const{__scopeTooltip:t,children:n,open:i,defaultOpen:r,onOpenChange:s,disableHoverableContent:o,delayDuration:l}=e,c=sH(TB,e.__scopeTooltip),u=rH(t),[d,f]=p.useState(null),[h,m]=p.useState(void 0),g=Jg(),b=p.useRef(0),v=o??c.disableHoverableContent,y=l??c.delayDuration,w=p.useRef(!1),[x,k]=Id({prop:i,defaultProp:r??!1,onChange:Mo(T=>{T?(c.onOpen(),document.dispatchEvent(new CustomEvent(AB))):c.onClose(),s==null||s(T)},"onChange"),caller:TB}),S=p.useMemo(()=>x?w.current?"delayed-open":"instant-open":"closed",[x]),O=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,w.current=!1,k(!0)},[k]),A=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,k(!1)},[k]),E=p.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{w.current=!0,k(!0),b.current=0},y)},[y,k]);p.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]);const j=h??g;return a.jsx(sM,{...u,children:a.jsx(Dft,{scope:t,contentId:j,setContentId:m,open:x,stateAttribute:S,trigger:d,onTriggerChange:f,onTriggerEnter:p.useCallback(()=>{c.isOpenDelayedRef.current?E():O()},[c.isOpenDelayedRef,E,O]),onTriggerLeave:p.useCallback(()=>{v?A():(window.clearTimeout(b.current),b.current=0)},[A,v]),onOpen:O,onClose:A,disableHoverableContent:v,children:n})})},"Tooltip"),Cee="TooltipTrigger",Lft=p.forwardRef(Mo(function(t,n){const{__scopeTooltip:i,...r}=t,s=nT(Cee,i),o=sH(Cee,i),l=rH(i),c=p.useRef(null),u=Rr(n,c,s.onTriggerChange),d=p.useRef(!1),f=p.useRef(!1),h=p.useCallback(()=>d.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),a.jsx($V,{asChild:!0,...l,children:a.jsx(Jr.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:u,onPointerMove:Un(t.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:Un(t.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:Un(t.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Un(t.onFocus,()=>{d.current||s.onOpen()}),onBlur:Un(t.onBlur,s.onClose),onClick:Un(t.onClick,s.onClose)})})},"TooltipTrigger")),tIe="TooltipPortal",[$ft,Fft]=iH(tIe,{forceMount:void 0}),Bft=Mo(e=>{const{__scopeTooltip:t,forceMount:n,children:i,container:r}=e,s=nT(tIe,t);return a.jsx($ft,{scope:t,forceMount:n,children:a.jsx(Rh,{present:n||s.open,children:a.jsx(RV,{asChild:!0,container:r,children:i})})})},"TooltipPortal"),wC="TooltipContent",Uft=p.forwardRef(Mo(function(t,n){const i=Fft(wC,t.__scopeTooltip),{forceMount:r=i.forceMount,side:s="top",...o}=t,l=nT(wC,t.__scopeTooltip);return a.jsx(Rh,{present:r||l.open,children:l.disableHoverableContent?a.jsx(nIe,{side:s,...o,ref:n}):a.jsx(Qft,{side:s,...o,ref:n})})},"TooltipContent")),Qft=p.forwardRef(Mo(function(t,n){const i=nT(wC,t.__scopeTooltip),r=sH(wC,t.__scopeTooltip),s=p.useRef(null),o=Rr(n,s),[l,c]=p.useState(null),{trigger:u,onClose:d}=i,f=s.current,{onPointerInTransitChange:h}=r,m=p.useCallback(()=>{c(null),h(!1)},[h]),g=p.useCallback((b,v)=>{const y=b.currentTarget,w={x:b.clientX,y:b.clientY},x=iIe(w,y.getBoundingClientRect()),k=rIe(w,x),S=sIe(v.getBoundingClientRect()),O=oIe([...k,...S]);c(O),h(!0)},[h]);return p.useEffect(()=>()=>m(),[m]),p.useEffect(()=>{if(u&&f){const b=Mo(y=>g(y,f),"handleTriggerLeave"),v=Mo(y=>g(y,u),"handleContentLeave");return u.addEventListener("pointerleave",b),f.addEventListener("pointerleave",v),()=>{u.removeEventListener("pointerleave",b),f.removeEventListener("pointerleave",v)}}},[u,f,g,m]),p.useEffect(()=>{if(l){const b=Mo(v=>{const y=v.target,w={x:v.clientX,y:v.clientY},x=(u==null?void 0:u.contains(y))||(f==null?void 0:f.contains(y)),k=!aIe(w,l);x?m():k&&(m(),d())},"handleTrackPointerGrace");return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[u,f,l,d,m]),a.jsx(nIe,{...t,ref:o})},"TooltipContentHoverable")),zft=pNe("TooltipContent"),nIe=p.forwardRef(Mo(function(t,n){const{__scopeTooltip:i,children:r,"aria-label":s,id:o,onEscapeKeyDown:l,onPointerDownOutside:c,...u}=t,d=nT(wC,i),f=rH(i),{onClose:h}=d;p.useEffect(()=>(document.addEventListener(AB,h),()=>document.removeEventListener(AB,h)),[h]),p.useEffect(()=>{if(d.trigger){const g=Mo(b=>{b.target instanceof Node&&b.target.contains(d.trigger)&&h()},"handleScroll");return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[d.trigger,h]);const{setContentId:m}=d;return Od(()=>(m(o),()=>{m(void 0)}),[o,m]),a.jsx(_V,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:h,children:a.jsxs(FV,{"data-state":d.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:d.contentId,...f,...u,ref:n,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[a.jsx(zft,{children:r}),s?a.jsx(glt,{id:d.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl"));function iIe(e,t){const n=Math.abs(t.top-e.y),i=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,i,r,s)){case s:return"left";case r:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}Mo(iIe,"getExitSideFromRect");function rIe(e,t,n=5){const i=[];switch(t){case"top":i.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":i.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":i.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":i.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return i}Mo(rIe,"getPaddedExitPoints");function sIe(e){const{top:t,right:n,bottom:i,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:i},{x:r,y:i}]}Mo(sIe,"getPointsFromRect");function aIe(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,o=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}Mo(aIe,"isPointInPolygon");function oIe(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),lIe(t)}Mo(oIe,"getHull");function lIe(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let i=e.length-1;i>=0;i--){const r=e[i];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}Mo(lIe,"getHullPresorted");var Vft=Pft,Hft=Mft,cIe=Lft,qft=Bft,Wft=Uft;function nb(e){const t=p.useRef(e);return t.current=e,t}let n1=[],m_=!1;const Aee=e=>{var t,n;if(e.key==="Escape"){const[i]=n1;i&&(e.preventDefault(),(n=(t=i.callback).current)==null||n.call(t))}},uIe=()=>{n1.length>0&&!m_?(document.body.addEventListener("keydown",Aee),m_=!0):n1.length===0&&m_&&(document.body.removeEventListener("keydown",Aee),m_=!1)},Kft=e=>{n1.unshift(e),uIe()},Gft=({id:e})=>{n1=n1.filter(t=>t.id!==e),uIe()},iT=(e,t)=>{const n=p.useId(),i=nb(t);p.useEffect(()=>{if(!e)return;const r={id:n,callback:i};return Kft(r),()=>Gft(r)},[n,e,i])},Xft=p.createContext(null);function dIe(){const e=p.useContext(Xft);return(e==null?void 0:e.linkComponent)??"a"}function rT(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}const Yft=()=>lNe,Tee=(e,t=!1,n="TransitionGroup")=>{const i=[];return p.Children.forEach(e,r=>{if(r&&typeof r=="object"&&"key"in r&&r.key)i.push(r);else if(t)throw new Error(`Child elements of <${n} /> must include a \`key\``)}),i},F0=()=>{},B0=e=>{const t=p.useRef(e);return t.current=e,p.useCallback(n=>t.current(n),[])};function Zft(e,t,n,i){const r=e.reduce((c,u)=>({...c,[u.key]:1}),{}),s=t.reduce((c,u)=>({...c,[u.component.key]:1}),{}),o=e.filter(c=>!s[c.key]).map(n),l=t.map(c=>({...c,component:e.find(({key:u})=>u===c.component.key)||c.component,shouldRender:!!r[c.component.key]}));return i==="append"?l.concat(o):o.concat(l)}function Jft(e,t,n){if((lNe||Yot)&&t&&n>1)throw new Error(`Cannot use forwardRef with multiple children in <${e} />`)}const eht="_TransitionGroupChild_1hv1z_1",tht={TransitionGroupChild:eht},fIe={enter:!1,enterActive:!1,exit:!1,exitActive:!1,interrupted:!1},nht=e=>({...fIe,enter:!e}),iht=(e,t)=>{switch(t.type){case"enter-before":return{enter:!0,enterActive:!1,exit:!1,exitActive:!1,interrupted:e.interrupted||e.exit};case"enter-active":return{enter:!0,enterActive:!0,exit:!1,exitActive:!1,interrupted:!1};case"exit-before":return{enter:!1,enterActive:!1,exit:!0,exitActive:!1,interrupted:e.interrupted||e.enter};case"exit-active":return{enter:!1,enterActive:!1,exit:!0,exitActive:!0,interrupted:!1};case"done":default:return fIe}},rht=({ref:e,as:t,children:n,className:i,transitionId:r,style:s,preventMountTransition:o,shouldRender:l,enterDuration:c,exitDuration:u,removeChild:d,onEnter:f,onEnterActive:h,onEnterComplete:m,onExit:g,onExitActive:b,onExitComplete:v})=>{const[y,w]=p.useReducer(iht,nht(o||!1)),x=p.useRef(!1),k=p.useRef(null),S=p.useRef(c);S.current=c;const O=p.useRef(u);O.current=u;const A=p.useRef(null),E=p.useCallback(j=>{const T=k.current;if(!(!T||j===A.current))switch(A.current=j,j){case"enter":f(T);break;case"enter-active":h(T);break;case"enter-complete":m(T);break;case"exit":g(T);break;case"exit-active":b(T);break;case"exit-complete":v(T);break}},[f,h,m,g,b,v]);return Pi.useLayoutEffect(()=>{if(!l){let R;w({type:"exit-before"}),E("exit");const C=hI(()=>{w({type:"exit-active"}),E("exit-active"),R=window.setTimeout(()=>{E("exit-complete"),d()},O.current)});return()=>{C(),R!==void 0&&clearTimeout(R)}}if(o&&!x.current){x.current=!0;return}let j;w({type:"enter-before"}),E("enter");const T=hI(()=>{w({type:"enter-active"}),E("enter-active"),j=window.setTimeout(()=>{w({type:"done"}),E("enter-complete")},S.current)});return()=>{T(),j!==void 0&&clearTimeout(j)}},[l,o,d,E]),p.useEffect(()=>()=>{x.current=!1},[]),a.jsx(t,{ref:rT([k,e]),className:qi(i,tht.TransitionGroupChild),"data-transition-id":r,style:s,"data-entering":y.enter?"":void 0,"data-entering-active":y.enterActive?"":void 0,"data-exiting":y.exit?"":void 0,"data-exiting-active":y.exitActive?"":void 0,"data-interrupted":y.interrupted?"":void 0,children:n})},sht=e=>{const{enterMountDelay:t,preventMountTransition:n}=e,i=!n&&t!=null?t:null,[r,s]=p.useState(i==null);return OV(()=>s(!0),r?null:i),r?a.jsx(rht,{...e}):null},ek=e=>{const{ref:t,as:n="span",children:i,className:r,transitionId:s,style:o,enterDuration:l=0,exitDuration:c=0,preventInitialTransition:u=!0,enterMountDelay:d,insertMethod:f="append",disableAnimations:h=Yft()}=e,m=B0(e.onEnter??F0),g=B0(e.onEnterActive??F0),b=B0(e.onEnterComplete??F0),v=B0(e.onExit??F0),y=B0(e.onExitActive??F0),w=B0(e.onExitComplete??F0);p.Children.forEach(i,O=>{if(O&&!O.key)throw new Error("Child elements of must include a `key`")});const x=p.useCallback(O=>({component:O,shouldRender:!0,removeChild:()=>{S(A=>A.filter(E=>O.key!==E.component.key))},onEnter:m,onEnterActive:g,onEnterComplete:b,onExit:v,onExitActive:y,onExitComplete:w}),[m,g,b,v,y,w]),[k,S]=p.useState(()=>Tee(i).map(O=>({...x(O),preventMountTransition:u})));return p.useLayoutEffect(()=>{S(O=>{const A=Tee(i);return Zft(A,O,x,f)})},[i,f,x]),Jft("TransitionGroup",t,p.Children.count(i)),h?a.jsx(a.Fragment,{children:p.Children.map(i,O=>a.jsx(n,{ref:t,className:r,style:o,"data-transition-id":s,children:O}))}):a.jsx(a.Fragment,{children:k.map(({component:O,...A})=>a.jsx(sht,{...A,as:n,className:r,transitionId:s,enterDuration:l,exitDuration:c,enterMountDelay:d,style:o,ref:t,children:O},O.key))})},aht="_Button_1864l_1",oht="_ButtonInner_1864l_4",lht="_ButtonLoader_1864l_749",r4={Button:aht,ButtonInner:oht,ButtonLoader:lht},Tt=e=>{const{type:t="button",color:n="primary",variant:i="solid",pill:r=!0,uniform:s=!1,size:o="md",iconSize:l,gutterSize:c,loading:u,selected:d,block:f,opticallyAlign:h,children:m,className:g,onClick:b,disabled:v,disabledTone:y,inert:w=u,...x}=e,k=v||w,S=p.useCallback(O=>{v||b==null||b(O)},[b,v]);return a.jsxs("button",{type:t,className:qi(r4.Button,g),"data-color":n,"data-variant":i,"data-pill":r?"":void 0,"data-uniform":s?"":void 0,"data-size":o,"data-gutter-size":c,"data-icon-size":l,"data-loading":u?"":void 0,"data-selected":d?"":void 0,"data-block":f?"":void 0,"data-optically-align":h,onPointerEnter:SV,disabled:k,"aria-disabled":k,tabIndex:k?-1:void 0,"data-disabled":v?"":void 0,"data-disabled-tone":v?y:void 0,onClick:S,...x,children:[a.jsx(ek,{className:r4.ButtonLoader,enterDuration:250,exitDuration:150,children:u&&a.jsx(YA,{},"loader")}),a.jsx("span",{className:r4.ButtonInner,children:kV(m)})]})},cht=()=>{var e;return typeof ClipboardItem<"u"&&!!((e=navigator.clipboard)!=null&&e.write)};function uht(e){const{"text/plain":t,...n}=e;return new ClipboardItem({...n,...t?{"text/plain":new Blob([t],{type:"text/plain"})}:null})}async function dht(e,t=document.body){if(typeof e=="string")return _ee(e,t);try{return cht()?(await navigator.clipboard.write([uht(e)]),!0):e["text/plain"]?_ee(e["text/plain"],t):!1}catch{return!1}}async function _ee(e,t=document.body){if(navigator.clipboard)try{return await navigator.clipboard.writeText(e),!0}catch{}const n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.top="0",n.style.left="0",n.style.opacity="0",t.appendChild(n),n.focus(),n.select();let i=!1;try{i=document.execCommand("copy")}catch{}return t.removeChild(n),i}const fht="_TransitionItem_1o7b1_1",hht={TransitionItem:fht},pht=e=>{const{as:t="span",className:n,children:i,preventInitialTransition:r,insertMethod:s,transitionClassName:o,transitionPosition:l="absolute"}=e,{enterTotalDuration:c,exitTotalDuration:u,variables:d}=vht(e);return a.jsx(t,{className:qi("block",l==="absolute"&&"relative",n),"data-transition-position":l,style:d,children:a.jsx(ek,{as:t,className:qi(hht.TransitionItem,o),enterDuration:c,exitDuration:u,insertMethod:s,preventInitialTransition:r,children:i})})},mht=400,ght=500,bht=200,yht=300;function vht({initial:e,enter:t,exit:n,forceCompositeLayer:i}){const r=W3(e),s=W3(t),o=W3(n),l=[r,o,s].some(b=>b!=="none"),c=(t==null?void 0:t.duration)??(l?ght:mht),u=(t==null?void 0:t.timingFunction)??(l?"var(--cubic-enter)":"ease"),d=(n==null?void 0:n.duration)??(l?yht:bht),f=(n==null?void 0:n.timingFunction)??(l?"var(--cubic-exit)":"ease"),h=Fv({"tg-will-change":i?"transform, opacity":"auto","tg-enter-opacity":q3((t==null?void 0:t.opacity)??1),"tg-enter-transform":s,"tg-enter-filter":K3(t),"tg-enter-duration":o_(c),"tg-enter-delay":o_((t==null?void 0:t.delay)??0),"tg-enter-timing-function":u,"tg-exit-opacity":q3((n==null?void 0:n.opacity)??0),"tg-exit-transform":o,"tg-exit-filter":K3(n),"tg-exit-duration":o_(d),"tg-exit-delay":o_((n==null?void 0:n.delay)??0),"tg-exit-timing-function":f,"tg-initial-opacity":q3((e==null?void 0:e.opacity)??(n==null?void 0:n.opacity)??0),"tg-initial-transform":r==="none"?o:r,"tg-initial-filter":K3(e??n??{})}),m=((t==null?void 0:t.delay)??0)+c,g=((n==null?void 0:n.delay)??0)+d;return{enterTotalDuration:m,exitTotalDuration:g,variables:h}}const aH=({children:e,copyValue:t,onClick:n,...i})=>{const[r,s]=p.useState(!1),o=p.useRef(null),l=c=>{r||(s(!0),n==null||n(c),dht(typeof t=="function"?t():t),o.current=window.setTimeout(()=>{s(!1)},1300))};return p.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),a.jsxs(Tt,{...i,onClick:l,children:[a.jsx(pht,{className:"w-[var(--button-icon-size)] h-[var(--button-icon-size)]",initial:{scale:.6},enter:{scale:1,delay:150,duration:300},exit:{scale:.6,duration:150},forceCompositeLayer:!0,children:r?a.jsx(mC,{},"copied-icon"):a.jsx(Pje,{},"copy-icon")}),typeof e=="function"?e({copied:r}):e]})},xht="_Menu_1t4b0_1",wht="_MenuList_1t4b0_3",kht="_MenuItemContent_1t4b0_53",Oht="_MenuItem_1t4b0_53",Sht="_ItemActions_1t4b0_98",Eht="_PressableInner_1t4b0_117",Cht="_Separator_1t4b0_135",Aht="_SubMenuItem_1t4b0_139",Tht="_SubTriggerIcon_1t4b0_141",_ht="_RadioItem_1t4b0_151",jht="_RadioIndicatorActive_1t4b0_158",Nht="_RadioIndicator_1t4b0_158",Rht="_CheckboxItem_1t4b0_249",Iht="_CheckboxIndicator_1t4b0_256",Pht="_CheckboxCircle_1t4b0_269",Ns={Menu:xht,MenuList:wht,MenuItemContent:kht,MenuItem:Oht,ItemActions:Sht,PressableInner:Eht,Separator:Cht,SubMenuItem:Aht,SubTriggerIcon:Tht,RadioItem:_ht,RadioIndicatorActive:jht,RadioIndicator:Nht,CheckboxItem:Rht,CheckboxIndicator:Iht,CheckboxCircle:Pht},hIe=p.createContext(null),sT=()=>{const e=p.useContext(hIe);if(!e)throw new Error("Menu components must be wrapped in ");return e},rr=({children:e,forceOpen:t,onOpen:n,onClose:i,modal:r=!1})=>{const[s,o]=p.useState(!1),l=t??s,c=nb(n),u=nb(i),d=p.useCallback(h=>{var m,g;o(h),h?(m=c.current)==null||m.call(c):(g=u.current)==null||g.call(u)},[c,u]);iT(s,()=>{d(!1)});const f=p.useMemo(()=>({open:l,setOpen:d}),[l,d]);return a.jsx(hIe.Provider,{value:f,children:a.jsx(wdt,{open:l,onOpenChange:d,modal:r,children:e})})},Dht=({className:e,children:t,disabled:n,onSelect:i,onClick:r})=>{const{open:s}=sT(),o=l=>{s||l.preventDefault()};return i?a.jsx(IRe,{className:qi(Ns.MenuItem,e),onSelect:i,onClick:r,disabled:n,onPointerMove:o,onPointerLeave:o,children:a.jsx("div",{className:Ns.PressableInner,children:t})}):a.jsx("div",{className:qi(Ns.MenuItemContent,e),children:t})},Mht=({className:e,children:t})=>a.jsx("div",{className:qi(Ns.ItemActions,e),children:t}),Lht=({children:e,onClick:t})=>{const{setOpen:n}=sT();return a.jsx(Tt,{className:"rounded-sm",color:"secondary",size:"xs",uniform:!0,iconSize:"sm",variant:"ghost",onClick:i=>{i.stopPropagation(),n(!1),t(i)},children:e})},$ht=e=>{const{className:t,children:n,href:i,to:r,disabled:s,as:o,...l}=e,{open:c}=sT(),u=i||r,d=u?/^https?:\/\//.test(u):!0,f=dIe(),h=o||(d?"a":f),m=b=>{c||b.preventDefault()},g=d?{target:"_blank",rel:"noopener noreferrer",href:i??r}:{href:i,to:r};return a.jsx(IRe,{asChild:!0,className:qi(Ns.MenuItem,t),disabled:s,onPointerMove:d?void 0:m,onPointerLeave:d?void 0:m,children:a.jsx(h,{...g,...l,children:a.jsx("span",{className:Ns.PressableInner,children:n})})})},Fht=({className:e})=>a.jsx(Adt,{className:qi(Ns.Separator,e),role:"separator"}),Bht=({children:e,side:t,sideOffset:n=5,align:i,alignOffset:r,width:s,minWidth:o,maxHeight:l})=>{const{open:c}=sT();return a.jsx(RRe,{forceMount:!0,children:a.jsx(ek,{className:Ns.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:c&&a.jsx(Odt,{forceMount:!0,className:Ns.MenuList,side:t,sideOffset:n,align:i,alignOffset:r??(i==="center"?0:-5),avoidCollisions:!0,collisionPadding:{bottom:30,top:30,left:12,right:12},onEscapeKeyDown:Lp,style:Fv({"menu-width":s,"menu-min-width":o,"menu-max-height":l}),children:e},"dropdown")})})},Uht=({children:e,disabled:t})=>a.jsx(kdt,{asChild:!0,disabled:t,children:e}),pIe=p.createContext(null),mIe=()=>{const e=p.useContext(pIe);if(!e)throw new Error("Submenu components must be wrapped in ");return e},Qht=({children:e,forceOpen:t,onOpen:n,onClose:i})=>{const[r,s]=p.useState(!1),o=p.useRef(null),l=t??r,c=nb(n),u=nb(i),d=p.useCallback(h=>{var m,g;s(h),h?(m=c.current)==null||m.call(c):(g=u.current)==null||g.call(u)},[c,u]);iT(r,()=>{var h;d(!1),(h=o.current)==null||h.focus()});const f=p.useMemo(()=>({open:l,setOpen:d,triggerRef:o}),[l,d]);return a.jsx(pIe.Provider,{value:f,children:a.jsx(Tdt,{open:l,onOpenChange:d,children:e})})},zht=({className:e,children:t,disabled:n})=>{const{open:i}=sT(),{triggerRef:r}=mIe(),s=o=>{i||o.preventDefault()};return a.jsx(_dt,{ref:r,className:qi(Ns.MenuItem,Ns.SubMenuItem,e),disabled:n,onPointerMove:s,onPointerLeave:s,children:a.jsxs("div",{className:Ns.PressableInner,children:[t,a.jsx(tat,{width:"16",height:"16",className:Ns.SubTriggerIcon})]})})},Vht=({children:e,sideOffset:t=4,alignOffset:n=-6,width:i="auto",minWidth:r="auto",maxHeight:s})=>{const{open:o}=mIe();return a.jsx(RRe,{forceMount:!0,children:a.jsx(ek,{className:Ns.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:o&&a.jsx(jdt,{className:Ns.MenuList,sideOffset:t,alignOffset:n,avoidCollisions:!0,collisionPadding:{bottom:30,top:30,left:12,right:12},onEscapeKeyDown:Lp,style:Fv({"menu-width":i,"menu-min-width":r,"menu-max-height":s}),children:e},"submenu")})})},Hht=({children:e,value:t,onChange:n,indicatorPosition:i="end",...r})=>a.jsx(Edt,{...r,value:t,onValueChange:s=>n(s),"data-indicator-position":i,children:e}),qht=({className:e,children:t,...n})=>a.jsx(Cdt,{className:qi(Ns.MenuItem,Ns.RadioItem,e),...n,children:a.jsxs("div",{className:Ns.PressableInner,children:[a.jsx("div",{className:Ns.RadioIndicator,children:a.jsx(PRe,{className:Ns.RadioIndicatorActive})}),t]})}),Wht=({className:e,children:t,indicatorPosition:n="end",indicatorVariant:i="solid",...r})=>a.jsx(Sdt,{className:qi(Ns.MenuItem,Ns.CheckboxItem,e),...r,"data-indicator-position":n,"data-indicator-variant":i,children:a.jsxs("div",{className:Ns.PressableInner,children:[a.jsx("div",{className:Ns.CheckboxIndicator,children:a.jsx(PRe,{children:i==="ghost"?a.jsx(mC,{className:"size-4"}):a.jsx("div",{className:Ns.CheckboxCircle,children:a.jsx(mC,{className:"size-4"})})})}),t]})});rr.Content=Bht;rr.Item=Dht;rr.ItemActions=Mht;rr.ItemAction=Lht;rr.Link=$ht;rr.Separator=Fht;rr.Trigger=Uht;rr.Sub=Qht;rr.SubTrigger=zht;rr.SubContent=Vht;rr.CheckboxItem=Wht;rr.RadioGroup=Hht;rr.RadioItem=qht;const Kht="_Tooltip_16g2y_1",Ght="_TriggerDecorator_16g2y_73",gIe={Tooltip:Kht,TriggerDecorator:Ght},Ca=e=>{const{ref:t,children:n,content:i,forceOpen:r=i===null?!1:void 0,maxWidth:s=300,openDelay:o=150,interactive:l=!1,compact:c=!1,preventUnintentionalClickToClose:u,align:d,alignOffset:f=0,side:h,sideOffset:m=5,gutterSize:g="md",contentClassName:b,onPointerDown:v,onClick:y,...w}=e,[x,k]=p.useState(!1),[S,O]=p.useState(!1);OV(()=>O(!1),S?400:null);const A=r??x,E=T=>{typeof r!="boolean"&&(k(T),u&&O(T))},j=T=>{u&&S&&(T.preventDefault(),T.stopPropagation())};return a.jsxs(bIe,{open:A,delayDuration:o,onOpenChange:E,disableHoverableContent:!l,children:[a.jsx(cIe,{asChild:!0,children:a.jsx(fNe,{...w,ref:t,onPointerDown:T=>{j(T),v==null||v(T)},onClick:T=>{j(T),y==null||y(T)},children:n})}),a.jsx(yIe,{maxWidth:s,compact:c,align:d,alignOffset:f,side:h,sideOffset:m,gutterSize:g,className:b,children:i})]})},bIe=({children:e,open:t,onOpenChange:n,...i})=>(iT(t,()=>{n(!1)}),a.jsx(Vft,{children:a.jsx(Hft,{open:t,onOpenChange:n,...i,children:e})})),yIe=({children:e,maxWidth:t=300,compact:n=!1,clickable:i=void 0,alignOffset:r=0,sideOffset:s=5,gutterSize:o="md",className:l,style:c,...u})=>a.jsx(qft,{children:a.jsx(Wft,{...u,className:qi(gIe.Tooltip,l),"data-compact":n,"data-clickable":i,"data-gutter-size":o,alignOffset:r,sideOffset:s,collisionPadding:15,hideWhenDetached:!0,style:{...c,maxWidth:t},onEscapeKeyDown:Lp,children:e})}),Xht=({children:e,asChild:t=!0,...n})=>a.jsx(cIe,{asChild:t,...n,children:e}),Yht=e=>{const{children:t,className:n,focusable:i=!0,ref:r,...s}=e,o=typeof t=="string";return a.jsx(fNe,{ref:r,...s,className:qi(gIe.TriggerDecorator,n),tabIndex:i?0:void 0,children:o?a.jsx("span",{children:t}):t})};Ca.Root=bIe;Ca.Content=yIe;Ca.Trigger=Xht;Ca.TriggerDecorator=Yht;const Zht=50,jee=48;function Jht(e){return(e.events??[]).flatMap(t=>{var r,s;const i=(((r=t.content)==null?void 0:r.parts)??[]).map(o=>typeof o.text=="string"?o.text:"").filter(Boolean).join("");return i?[{text:i,role:t.author??((s=t.content)==null?void 0:s.role)??"",ts:t.timestamp}]:[]})}function ept(e){var t,n;for(const i of e.events??[])if(i.author==="user"||((t=i.content)==null?void 0:t.role)==="user"){const r=(((n=i.content)==null?void 0:n.parts)??[]).map(s=>s.text).find(Boolean);if(r)return r}return Q("search.untitledSession")}function tpt(e,t,n){const i=Math.max(0,t-jee),r=Math.min(e.length,t+n+jee);return(i>0?"…":"")+e.slice(i,r).trim()+(r{var c;if((c=l.events)!=null&&c.length)return l;try{return await lC(t,e,l.id)}catch{return l}})),o=[];for(const l of s)for(const{text:c,role:u,ts:d}of Jht(l)){const f=c.toLowerCase().indexOf(i);if(f!==-1){o.push({type:"session",appId:t,sessionId:l.id,title:ept(l),snippet:tpt(c,f,i.length),role:u,ts:d??l.lastUpdateTime});break}}return o.sort((l,c)=>(c.ts??0)-(l.ts??0)),o.slice(0,Zht)}async function ipt(e,t){if(!e||!t.trim())return{results:[]};let n;try{n=await CTe(e,t.trim())}catch(o){const l=String(o);return{results:[],note:l.includes("404")?Q("search.webUnavailable"):Q("search.webFailed",{message:l})}}const{mounted:i,results:r,error:s}=n;return i?s?{results:[],note:s}:{results:r.map((o,l)=>({type:"web",index:l,title:o.title,url:o.url,siteName:o.siteName,summary:o.summary}))}:{results:[],note:Q("search.webNotMounted")}}async function rpt(e,t,n,i){if(!t||!i.trim())return{results:[]};const r=await ETe(t,e,i.trim(),n);if(!r.mounted)return{results:[],note:Q(e==="knowledge"?"search.knowledgeNotMounted":"search.memoryNotMounted")};if(r.error)return{results:[],note:r.error};const s=r.sourceName??Q(e==="knowledge"?"search.knowledge":"search.longTermMemory");return{results:r.results.map((o,l)=>e==="knowledge"?{type:"knowledge",index:l,content:o.content,sourceName:s,sourceType:r.sourceType}:{type:"memory",index:l,content:o.content,sourceName:s,sourceType:r.sourceType,author:o.author,ts:o.timestamp})}}async function spt(e,t,n){return e==="session"?{results:await npt(n.userId,n.appId,t)}:e==="web"?ipt(n.appId,t):rpt(e,n.appId,n.userId,t)}function vIe({mirrored:e=!1}){return a.jsxs("g",{opacity:"0.5",transform:e?"translate(20 0) scale(-1 1)":void 0,children:[a.jsx("path",{className:"sidebar-panel-glyph__divider",d:"M5.938 6.833c.11 0 .249.102.249.292v6.042c0 .19-.14.291-.249.291s-.248-.101-.248-.291V7.125c0-.19.139-.292.248-.292Z",strokeWidth:"1.167"}),a.jsx("path",{className:"sidebar-panel-glyph__frame",d:"M14.5 3.75h-9a3 3 0 0 0-3 3v6.857a3 3 0 0 0 3 3h9a3 3 0 0 0 3-3V6.75a3 3 0 0 0-3-3Z",strokeWidth:"1.667",strokeLinecap:"round",strokeLinejoin:"round"})]})}function apt(e){return a.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:a.jsx(vIe,{})})}function opt(e){return a.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:a.jsx(vIe,{mirrored:!0})})}function lpt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 8.333c.368 0 .667.299.667.667v2h2a.667.667 0 0 1 0 1.333h-2v2a.667.667 0 0 1-1.334 0v-2h-2a.667.667 0 0 1 0-1.333h2V9c0-.368.299-.667.667-.667ZM7.667 1c3.49 0 6.383 2.554 6.913 5.896a.667.667 0 0 1-1.317.208 5.667 5.667 0 1 0-9.708 4.424.67.67 0 0 1 .07.12.667.667 0 0 1-.13.834l-.95.853 4.788-.002a.667.667 0 0 1 0 1.334l-5.657.002c-.917 0-1.35-1.131-.67-1.744l1.163-1.045A6.97 6.97 0 0 1 .667 8c0-3.866 3.134-7 7-7Z",fill:"currentColor"})})}function cpt(e){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"7.333",cy:"7.333",r:"5.333"}),a.jsx("path",{d:"m11.133 11.133 2.867 2.867"})]})}function upt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8 0.667c4.05 0 7.334 3.283 7.334 7.333 0 4.05-3.284 7.334-7.334 7.334S0.667 12.05 0.667 8 3.95 0.667 8 0.667Zm0 1.333a6 6 0 1 0 0 12A6 6 0 0 0 8 2ZM6.167 6c.368 0 .667.299.667.667v2a.667.667 0 0 1-1.334 0v-2c0-.368.299-.667.667-.667Zm3.666 0c.368 0 .667.299.667.667v2a.667.667 0 0 1-1.333 0v-2c0-.368.298-.667.666-.667Z",fill:"currentColor"})})}function xIe(e){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M7.58 2.6a.667.667 0 0 0-.667-.667h-.666a.667.667 0 0 0-.667.667v10.667c0 .368.299.666.667.666h.666a.667.667 0 0 0 .667-.666V2.6Zm1.333 10.667A2 2 0 0 1 6.913 15.267h-.666a2 2 0 0 1-2-2V2.6a2 2 0 0 1 2-2h.666a2 2 0 0 1 2 2v10.667Z",fill:"currentColor"}),a.jsx("path",{d:"M11.88 5.045a.667.667 0 0 0-.801-.514l-.653.136a.667.667 0 0 0-.504.786l1.85 8.092c.081.358.44.589.8.514l.653-.137a.667.667 0 0 0 .504-.786L11.88 5.045Zm3.155 7.82a2 2 0 0 1-1.512 2.358l-.653.136a2 2 0 0 1-2.403-1.541L8.617 5.726a2 2 0 0 1 1.513-2.358l.652-.136a2 2 0 0 1 2.404 1.541l1.849 8.092Z",fill:"currentColor"}),a.jsx("path",{d:"M4.247 2.6a.667.667 0 0 0-.667-.667h-.667a.667.667 0 0 0-.666.667v10.667c0 .368.298.666.666.666h.667a.667.667 0 0 0 .667-.666V2.6ZM5.58 13.267a2 2 0 0 1-2 2h-.667a2 2 0 0 1-2-2V2.6a2 2 0 0 1 2-2h.667a2 2 0 0 1 2 2v10.667Z",fill:"currentColor"})]})}function wIe(e){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M3.25 2.25h6l3.5 3.5v8H3.25v-11Z"}),a.jsx("path",{d:"M9.25 2.25v3.5h3.5M5.5 8.25h5M5.5 10.75h4"})]})}function dpt({className:e="icon"}){return a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[a.jsx("path",{d:"M16.4 10.7a5.7 5.7 0 1 1-1.67-4.03"}),a.jsx("path",{d:"M15.25 15.25 19.6 19.6"})]})}function fpt({open:e}){return a.jsx("svg",{className:`search-source-chevron ${e?"open":""}`,viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:a.jsx("path",{d:"m3.25 4.75 2.75 2.5 2.75-2.5"})})}function hpt({active:e=!1,onClick:t}){const{t:n}=_e("workspaceTools");return a.jsxs("button",{className:`new-chat${e?" is-active":""}`,onClick:t,"aria-label":n("search.nav"),"aria-current":e?"page":void 0,title:n("search.nav"),children:[a.jsx(cpt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:n("search.nav")})]})}function ppt(e,t,n,i){const r=!!e,s=new Set((t==null?void 0:t.searchSources)??[]),o=l=>r?n?i("search.checkingCapabilities"):i("search.notMounted",{label:l}):i("search.selectAgent");return[{id:"session",label:i("search.sources.session"),ready:r,unavailableLabel:i("search.selectAgent")},{id:"web",label:i("search.sources.web"),ready:r&&s.has("web"),description:i("search.webDescription"),unavailableLabel:o(" web_search")},{id:"knowledge",label:i("search.sources.knowledge"),ready:r&&s.has("knowledge"),unavailableLabel:o(i("search.sources.knowledge"))},{id:"memory",label:i("search.sources.memory"),ready:r&&s.has("memory"),unavailableLabel:o(i("search.sources.memory"))}]}function pI(e,t){return{context_search:"Context Search",local:t("search.backendLocal"),mem0:"Mem0",milvus:"Milvus",opensearch:"OpenSearch",openviking:"OpenViking",redis:"Redis",tos_vector:"TOS Vector",viking:"VikingDB"}[e.toLowerCase()]??e}function Nee(e,t){return e?new Date(e*1e3).toLocaleString(t,{timeZone:"Asia/Shanghai",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):""}function mpt({userId:e,appId:t,agentInfo:n,capabilitiesLoading:i,agentLabel:r,onOpenSession:s}){var L,F;const{t:o,i18n:l}=_e("workspaceTools"),c=l.resolvedLanguage||l.language,[u,d]=p.useState("session"),[f,h]=p.useState(""),[m,g]=p.useState([]),[b,v]=p.useState(),[y,w]=p.useState(!1),[x,k]=p.useState(!1),[S,O]=p.useState(!1),A=p.useRef(0),E=p.useRef(null),j=ppt(t,n,i,o),T=j.find(M=>M.id===u),R=u==="knowledge"?(L=n==null?void 0:n.components)==null?void 0:L.find(M=>M.source==="knowledgebase"||M.kind==="knowledgebase"):u==="memory"?(F=n==null?void 0:n.components)==null?void 0:F.find(M=>M.source==="long_term_memory"||M.kind==="memory"):void 0;p.useEffect(()=>{A.current+=1,d("session"),g([]),v(void 0),k(!1),w(!1),O(!1)},[t]),p.useEffect(()=>{if(!S)return;function M(H){var q;(q=E.current)!=null&&q.contains(H.target)||O(!1)}return document.addEventListener("pointerdown",M),()=>document.removeEventListener("pointerdown",M)},[S]);async function C(M,H){var z;const q=M.trim();if(!q||!((z=j.find(J=>J.id===H))!=null&&z.ready))return;const U=++A.current;w(!0),k(!0);let Z;try{Z=await spt(H,q,{userId:e,appId:t})}catch(J){const ne=J instanceof Error?J.message:String(J);Z={results:[],note:o("search.failed",{message:ne})}}U===A.current&&(g(Z.results),v(Z.note),w(!1))}function N(M){A.current+=1,h(M),g([]),v(void 0),k(!1),w(!1)}function P(M){A.current+=1,d(M),O(!1),g([]),v(void 0),k(!1),w(!1)}const I=!!(T!=null&&T.ready),D=t?u==="web"?o("search.placeholder.web"):u==="knowledge"?o("search.placeholder.knowledge",{name:(R==null?void 0:R.name)??o("search.placeholder.knowledgeFallback")}):u==="memory"?o("search.placeholder.memory",{name:(R==null?void 0:R.name)??o("search.placeholder.memoryFallback")}):o("search.placeholder.session"):o("search.placeholder.selectAgent"),_=R!=null&&R.backend?pI(R.backend,o):"";return a.jsxs("div",{className:"search",children:[a.jsxs("div",{className:"search-box",children:[a.jsxs("div",{className:"search-source-picker-wrap",ref:E,children:[a.jsxs("button",{className:"search-source-picker",type:"button","aria-label":o("search.sourceTypeAria",{label:(T==null?void 0:T.label)??o("search.notSelected")}),"aria-haspopup":"listbox","aria-expanded":S,onClick:()=>O(M=>!M),children:[a.jsx("span",{children:(T==null?void 0:T.label)??o("search.sourceType")}),_&&a.jsx("small",{children:_}),a.jsx(fpt,{open:S})]}),S&&a.jsx("div",{className:"search-source-menu",role:"listbox","aria-label":o("search.selectSource"),children:j.map(M=>{var U,Z;const H=M.id==="knowledge"?(U=n==null?void 0:n.components)==null?void 0:U.find(z=>z.source==="knowledgebase"||z.kind==="knowledgebase"):M.id==="memory"?(Z=n==null?void 0:n.components)==null?void 0:Z.find(z=>z.source==="long_term_memory"||z.kind==="memory"):void 0,q=H?[H.name,H.backend?pI(H.backend,o):""].filter(Boolean).join(" · "):M.ready?M.description:M.unavailableLabel;return a.jsxs("button",{type:"button",role:"option","aria-selected":u===M.id,disabled:!M.ready,onClick:()=>P(M.id),children:[a.jsx("span",{children:M.label}),q&&a.jsx("small",{children:q})]},M.id)})})]}),a.jsx("span",{className:"search-box-divider","aria-hidden":!0}),a.jsx("input",{className:"search-input",value:f,onChange:M=>N(M.target.value),onKeyDown:M=>{M.key==="Enter"&&(M.preventDefault(),C(f,u))},placeholder:D,disabled:!I,autoFocus:!0}),a.jsx("button",{className:"search-go",onClick:()=>void C(f,u),disabled:!f.trim()||y,"aria-label":o("search.nav"),children:y?a.jsx(Vi,{className:"icon spin"}):a.jsx(dpt,{className:"icon"})})]}),a.jsx("div",{className:"search-results",children:I?x?y?null:b?a.jsx("div",{className:"search-empty",children:b}):m.length===0&&x?a.jsx("div",{className:"search-empty",children:o("search.noResults",{query:f.trim()})}):m.map((M,H)=>a.jsx(gpt,{result:M,agentLabel:r,onOpen:s,locale:c},H)):a.jsx("div",{className:"search-empty",children:o(u==="web"?"search.instructions.web":u==="knowledge"?"search.instructions.knowledge":u==="memory"?"search.instructions.memory":"search.instructions.session")}):a.jsx("div",{className:"search-empty",children:t?i?o("search.loadingCapabilities"):(T==null?void 0:T.unavailableLabel)??o("search.sourceUnavailable"):o("search.noAgentHint")})})]})}function gpt({result:e,agentLabel:t,onOpen:n,locale:i}){const{t:r}=_e("workspaceTools");switch(e.type){case"session":return a.jsxs("button",{className:"search-result",onClick:()=>n(e.appId,e.sessionId),children:[a.jsx(Hje,{className:"search-result-icon"}),a.jsxs("div",{className:"search-result-body",children:[a.jsxs("div",{className:"search-result-head",children:[a.jsx("span",{className:"search-result-title",children:e.title}),a.jsxs("span",{className:"search-result-meta",children:[t(e.appId),e.ts?` · ${Nee(e.ts,i)}`:""]})]}),a.jsx("div",{className:"search-result-snippet",children:e.snippet})]})]});case"web":return a.jsxs("a",{className:"search-result",href:e.url||void 0,target:"_blank",rel:"noreferrer noopener",children:[a.jsx(eM,{className:"search-result-icon"}),a.jsxs("div",{className:"search-result-body",children:[a.jsxs("div",{className:"search-result-head",children:[a.jsx("span",{className:"search-result-title",children:e.title||e.url}),a.jsxs("span",{className:"search-result-meta",children:[e.siteName,e.url&&a.jsx(uv,{className:"search-result-ext"})]})]}),e.summary&&a.jsx("div",{className:"search-result-snippet",children:e.summary})]})]});case"knowledge":return a.jsxs("div",{className:"search-result search-result-static",children:[a.jsx(Ree,{source:"knowledge"}),a.jsxs("div",{className:"search-result-body",children:[a.jsxs("div",{className:"search-result-head",children:[a.jsx("span",{className:"search-result-title",children:r("search.knowledgeFragment",{index:e.index+1})}),a.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${pI(e.sourceType,r)}`:""]})]}),a.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});case"memory":return a.jsxs("div",{className:"search-result search-result-static",children:[a.jsx(Ree,{source:"memory"}),a.jsxs("div",{className:"search-result-body",children:[a.jsxs("div",{className:"search-result-head",children:[a.jsx("span",{className:"search-result-title",children:r("search.memoryFragment",{index:e.index+1})}),a.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${pI(e.sourceType,r)}`:"",e.ts?` · ${Nee(e.ts,i)}`:""]})]}),a.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});default:return null}}function Ree({source:e,className:t="search-result-icon"}){return e==="knowledge"?a.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[a.jsx("path",{d:"M5 5.5h10.5A3.5 3.5 0 0 1 19 9v9.5H8.5A3.5 3.5 0 0 1 5 15V5.5Z"}),a.jsx("path",{d:"M8.25 9h7.5M8.25 12.25h6"})]}):a.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[a.jsx("path",{d:"M12 4.5a7.5 7.5 0 1 0 7.5 7.5"}),a.jsx("path",{d:"M12 8a4 4 0 1 0 4 4M12 11.3a.7.7 0 1 0 0 1.4.7.7 0 0 0 0-1.4Z"})]})}function bpt({filled:e=!1,...t}){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[a.jsx("rect",{x:"3.5",y:"9.3",width:"4.5",height:"10.2",rx:"1.5"}),a.jsx("path",{d:"M8 10.2 11.3 4.8c.5-.8 1.7-.45 1.7.5v3.8h4.2a2.1 2.1 0 0 1 2.04 2.6l-1.4 5.75A2.1 2.1 0 0 1 15.8 19H8"})]})}function ypt({filled:e=!1,...t}){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"4.5",height:"10.2",rx:"1.5"}),a.jsx("path",{d:"M8 13.8 11.3 19.2c.5.8 1.7.45 1.7-.5v-3.8h4.2a2.1 2.1 0 0 0 2.04-2.6l-1.4-5.75A2.1 2.1 0 0 0 15.8 5H8"})]})}function kIe(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5.25 4.25h9.5a2.5 2.5 0 0 1 2.5 2.5v3.5"}),a.jsx("path",{d:"M13.25 17.75h-8a2.5 2.5 0 0 1-2.5-2.5v-8a3 3 0 0 1 3-3"}),a.jsx("path",{d:"M7 8.25h5.5M7 11.75h3.25"}),a.jsx("path",{d:"m13.35 16.65.42-2.16 4.76-4.76a1.35 1.35 0 0 1 1.91 1.91l-4.76 4.76-2.33.25Z"}),a.jsx("path",{d:"m17.65 10.6 1.9 1.9"})]})}const fM="/assets/media/logo-DCsNZy-k.svg",oH="data:image/svg+xml,%3csvg%20width='28'%20height='23'%20viewBox='0%200%2028%2023'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17.1957%209.44218C17.0253%209.58161%2016.7774%209.47317%2016.7774%209.24079V8.01696V0.611967C16.7774%200.395085%2016.514%200.271152%2016.3591%200.410576L6.04172%209.16334C5.87132%209.30276%205.62345%209.19432%205.62345%208.96194V2.98218C5.62345%202.81178%205.48403%202.67235%205.31362%202.67235H0.309832C0.139424%202.67235%200%202.81178%200%202.98218V21.7115C0%2021.9284%200.263357%2022.0524%200.418273%2021.9129L10.7202%2013.1602C10.8906%2013.0207%2011.1385%2013.1292%2011.1385%2013.3616V22.0059C11.1385%2022.2228%2011.4018%2022.3467%2011.5567%2022.2073L21.8586%2013.4545C22.0291%2013.3151%2022.2769%2013.4235%2022.2769%2013.6559V19.6357C22.2769%2019.8061%2022.4163%2019.9455%2022.5868%2019.9455H27.5905C27.7609%2019.9455%2027.9004%2019.8061%2027.9004%2019.6357V0.890816C27.9004%200.673934%2027.637%200.550001%2027.4821%200.689425L17.1957%209.44218Z'%20fill='%230066FC'/%3e%3c/svg%3e";function vpt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M8.5 4.5H6a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-13a2 2 0 0 0-2-2h-2.5"}),a.jsx("rect",{x:"8.5",y:"2.5",width:"7",height:"4",rx:"1.5"}),a.jsx("path",{d:"m8 13 2.5 2.5L16 10"})]})}const Iee="(max-width: 860px)";function Pee({title:e}){const t=p.useRef(null),n=p.useRef(null),[i,r]=p.useState(0);p.useLayoutEffect(()=>{const l=t.current,c=n.current;if(!l||!c)return;const u=()=>{const f=Math.max(0,Math.ceil(c.scrollWidth-l.clientWidth));r(h=>h===f?h:f)};u();const d=new ResizeObserver(u);return d.observe(l),d.observe(c),()=>d.disconnect()},[e]);const s=Math.min(12,Math.max(4.8,3.6+i/36)),o={"--history-title-translate":`-${i}px`,"--history-title-duration":`${s.toFixed(2)}s`};return a.jsx("span",{ref:t,className:`history-title${i>0?" is-overflowing":""}`,style:o,children:a.jsx("span",{ref:n,className:"history-title-text",children:e})})}function xpt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"7",cy:"7",r:"2.25"}),a.jsx("circle",{cx:"17",cy:"7",r:"2.25"}),a.jsx("circle",{cx:"7",cy:"17",r:"2.25"}),a.jsx("circle",{cx:"17",cy:"17",r:"2.25"})]})}function wpt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"12",cy:"12",r:"8.25"}),a.jsx("path",{d:"M3.75 12h16.5M12 3.75c2.1 2.2 3.2 4.95 3.2 8.25S14.1 18.05 12 20.25M12 3.75C9.9 5.95 8.8 8.7 8.8 12s1.1 6.05 3.2 8.25"})]})}function kpt(e){let t=2166136261;for(const i of e)t^=i.charCodeAt(0),t=Math.imul(t,16777619);const n=t>>>0;return{"--avatar-hue-a":194+n%22,"--avatar-hue-b":214+(n>>>6)%25,"--avatar-hue-c":176+(n>>>12)%25,"--avatar-x":`${22+(n>>>18)%55}%`,"--avatar-y":`${18+(n>>>24)%58}%`}}const Opt={super_admin:"account.roles.super_admin",admin:"account.roles.admin",developer:"account.roles.developer",user:"account.roles.user"};function Spt({activePage:e,access:t,userInfo:n,onAgentKitCli:i,onDeveloperResources:r,onSystemInfo:s,onIssueFeedback:o,onLogout:l}){const{t:c,i18n:u}=_e(["sidebar","common"]),[d,f]=p.useState("");if(!n)return null;const h=Oet(n)||c("sidebar:account.defaultUser"),m=typeof n.email=="string"?n.email.trim():"",g=kpt(h),b=Eet(n),v=b===d?"":b,y=OA(u.resolvedLanguage??u.language)??kA;return a.jsx("div",{className:"sidebar-user",children:a.jsxs("div",{className:"sidebar-user-row",children:[a.jsxs(rr,{modal:!0,children:[a.jsx(rr.Trigger,{children:a.jsxs("button",{type:"button",className:"sidebar-user-btn",title:h,children:[a.jsx("span",{className:`account-avatar${v?" has-image":""}`,style:g,"aria-hidden":"true",children:v?a.jsx("img",{className:"account-avatar-image",src:v,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>f(v)}):null}),a.jsx("span",{className:"sidebar-user-identity",children:a.jsx("span",{className:"sidebar-user-name",children:h})})]})}),a.jsxs(rr.Content,{side:"top",align:"start",sideOffset:4,minWidth:216,children:[a.jsxs("div",{className:"account-menu-head",children:[a.jsx("span",{className:`account-avatar account-avatar--lg${v?" has-image":""}`,style:g,"aria-hidden":"true",children:v?a.jsx("img",{className:"account-avatar-image",src:v,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>f(v)}):null}),a.jsxs("div",{className:"account-id",children:[a.jsxs("div",{className:"account-name-row",children:[a.jsx("div",{className:"account-name",children:h}),a.jsx(Za,{color:"secondary",size:"sm",variant:"soft",pill:!0,children:c(`sidebar:${Opt[t.role]}`)})]}),m&&m!==h&&a.jsx("div",{className:"account-sub",children:m})]})]}),a.jsxs(rr.Item,{className:"account-menu-action",onSelect:s,children:[a.jsx(gm,{className:"icon","aria-hidden":"true"}),c("sidebar:account.systemInfo")]}),a.jsxs(rr.Sub,{children:[a.jsx(rr.SubTrigger,{className:"account-menu-action",children:a.jsxs("span",{className:"account-menu-action__label",children:[a.jsx(wpt,{className:"icon"}),c("sidebar:account.language")]})}),a.jsx(rr.SubContent,{sideOffset:6,minWidth:136,children:a.jsx(rr.RadioGroup,{value:y,onChange:w=>{Nqe(w)},indicatorPosition:"end",children:NU.map(w=>a.jsx(rr.RadioItem,{value:w,children:c(`common:languageNames.${w}`)},w))})})]}),a.jsxs(rr.Item,{className:"account-menu-action",onSelect:o,children:[a.jsx(kIe,{className:"icon"}),c("sidebar:account.issueFeedback")]}),a.jsxs(rr.Item,{className:"account-menu-action",onSelect:l,children:[a.jsx(qat,{className:"icon","aria-hidden":"true"}),c("sidebar:account.logout")]})]})]}),a.jsxs("div",{className:"sidebar-user-shortcuts","aria-label":c("sidebar:account.shortcuts"),children:[a.jsx(Ca,{compact:!0,content:c("sidebar:account.tryCli"),children:a.jsx("button",{type:"button",className:"sidebar-user-shortcut",onClick:i,"aria-label":c("sidebar:account.tryCli"),children:a.jsx(uat,{className:"icon"})})}),a.jsx(Ca,{compact:!0,content:c("sidebar:account.developerResources"),children:a.jsx("button",{type:"button",className:`sidebar-user-shortcut${e==="developer-resources"?" is-active":""}`,onClick:r,"aria-label":c("sidebar:account.developerResources"),"aria-current":e==="developer-resources"?"page":void 0,children:a.jsx(Zst,{className:"icon"})})})]})]})})}function Ept({branding:e,cloudProvider:t,sessions:n,currentSessionId:i,activePage:r,features:s,access:o,streamingSids:l,evaluatingSids:c,sandboxHistory:u,onNewChat:d,onSearch:f,onQuickCreate:h,onLibrary:m,onReviewCenter:g,onAddAgent:b,onMyAgents:v,onWorkspace:y,onApplications:w,onCronJobs:x,onAgentKitCli:k,onDeveloperResources:S,onSystemInfo:O,onUserManagement:A,onIssueFeedback:E,onPickSession:j,onDeleteSession:T,userInfo:R,onLogout:C}){const{t:N}=_e("sidebar"),P=z=>(s==null?void 0:s[z])!==!1,I=o.role==="admin"||o.role==="super_admin",D=o.capabilities.manageUsers&&!!A,[_,L]=p.useState(null),F=p.useRef(typeof window<"u"&&window.matchMedia(Iee).matches),[M,H]=p.useState(F.current),q=n.map(z=>({id:z.id,title:z.title||tM(z.events,N("history.newConversation")),createdAt:(z.lastUpdateTime??0)*1e3})).sort((z,J)=>J.createdAt-z.createdAt),U=()=>{F.current=!1,H(z=>!z),L(null)};p.useEffect(()=>{const z=window.matchMedia(Iee),J=ne=>{ne.matches?H(W=>W||(F.current=!0,!0)):F.current&&(F.current=!1,H(!1))};return z.addEventListener("change",J),()=>z.removeEventListener("change",J)},[]);const Z=t==="byteplus"?oH:fM;return a.jsxs("aside",{className:`sidebar ${M?"is-collapsed":""}`,children:[a.jsxs("div",{className:"sidebar-top",children:[a.jsxs("div",{className:"sidebar-brand-row",children:[a.jsxs("button",{type:"button",className:"brand",onClick:d,"aria-label":N("navigation.home"),title:N("navigation.home"),children:[a.jsx("img",{className:"brand-logo",src:e.logoUrl||Z,width:20,height:20,alt:"","aria-hidden":!0}),a.jsx("span",{className:"brand-title",children:e.title})]}),a.jsx("button",{type:"button",className:"sidebar-collapse-toggle",onClick:U,"aria-label":N(M?"navigation.expand":"navigation.collapse"),title:N(M?"navigation.expand":"navigation.collapse"),children:M?a.jsx(opt,{className:"icon"}):a.jsx(apt,{className:"icon"})})]}),a.jsxs("nav",{className:"sidebar-nav","aria-label":N("navigation.label"),children:[P("newChat")&&a.jsxs("button",{className:`new-chat new-chat--conversation${r==="new-chat"?" is-active":""}`,onClick:d,"aria-label":N("navigation.newChat"),"aria-current":r==="new-chat"?"page":void 0,title:N("navigation.newChat"),children:[a.jsx(lpt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.newChat")})]}),P("search")&&a.jsx(hpt,{active:r==="search",onClick:f}),a.jsxs("button",{className:`new-chat new-chat--agents${r==="agents"?" is-active":""}`,onClick:v,"aria-label":N("navigation.agents"),"aria-current":r==="agents"?"page":void 0,title:N("navigation.agents"),children:[a.jsx(upt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.agents")})]}),a.jsxs("button",{className:`new-chat new-chat--workspaces${r==="workspaces"?" is-active":""}`,onClick:y,"aria-label":N("navigation.workspaces"),"aria-current":r==="workspaces"?"page":void 0,title:N("navigation.workspaces"),children:[a.jsx(Cat,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.workspaces")})]}),a.jsxs("button",{className:`new-chat new-chat--library${r==="library"?" is-active":""}`,onClick:m,"aria-label":N("navigation.library"),"aria-current":r==="library"?"page":void 0,title:N("navigation.library"),children:[a.jsx(xIe,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.library")})]}),a.jsxs("button",{className:`new-chat new-chat--cronjobs${r==="cronjobs"?" is-active":""}`,onClick:x,"aria-label":N("navigation.cronjobs"),"aria-current":r==="cronjobs"?"page":void 0,title:N("navigation.cronjobs"),children:[a.jsx(pV,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.cronjobs")})]}),a.jsxs("button",{className:`new-chat new-chat--applications${r==="applications"?" is-active":""}`,onClick:w,"aria-label":N("navigation.automations"),"aria-current":r==="applications"?"page":void 0,title:N("navigation.automations"),children:[a.jsx(xpt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.automations")})]})]}),I||D?a.jsxs("nav",{className:"sidebar-nav sidebar-nav--administration","aria-label":N("navigation.administration"),children:[a.jsx("div",{className:"sidebar-nav-group-title","aria-hidden":"true",children:N("navigation.administration")}),I?a.jsxs("button",{type:"button",className:`new-chat new-chat--review-center${r==="review-center"?" is-active":""}`,onClick:g,"aria-label":N("navigation.reviewCenter"),"aria-current":r==="review-center"?"page":void 0,title:N("navigation.reviewCenter"),children:[a.jsx(vpt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.reviewCenter")})]}):null,D?a.jsxs("button",{type:"button",className:`new-chat${r==="users"?" is-active":""}`,onClick:A,"aria-label":N("navigation.users"),"aria-current":r==="users"?"page":void 0,title:N("navigation.users"),children:[a.jsx(Qot,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.users")})]}):null]}):null]}),P("history")&&a.jsxs("div",{className:"sidebar-history",children:[a.jsxs("div",{className:"history-head",children:[a.jsx("span",{children:N("history.title")}),P("newChat")&&a.jsx("button",{type:"button",className:"history-new-chat",onClick:(u==null?void 0:u.onNew)??d,disabled:u==null?void 0:u.newDisabled,"aria-label":N("history.create"),title:N("history.create"),children:a.jsx(ec,{className:"icon"})})]}),a.jsx("div",{className:"history-list",children:u?a.jsxs(a.Fragment,{children:[u.loading&&u.threads.length===0?a.jsx("div",{className:"history-empty",role:"status",children:N("history.loading")}):null,u.error?a.jsx("div",{className:"history-error",role:"alert",children:u.error}):null,!u.loading&&!u.error&&u.threads.length===0?a.jsx("div",{className:"history-empty",children:N("history.empty")}):null,u.threads.map(z=>{const J=z.id===u.currentThreadId,ne=z.name||z.preview||`Thread ${z.id.slice(0,8)}`,W=z.id===u.busyThreadId;return a.jsxs("div",{className:`history-item ${J?"active":""}`,children:[a.jsxs("button",{type:"button",className:"history-item-btn",onClick:()=>u.onSelect(z.id),"aria-current":J?"page":void 0,title:ne,disabled:W,children:[a.jsx(Pee,{title:ne}),J?a.jsx("span",{className:"history-current-badge",children:N("history.current")}):null]}),a.jsx("button",{type:"button",className:"history-more","aria-label":N("history.manage",{title:ne}),title:N("history.more"),disabled:W,onClick:()=>L(X=>X===z.id?null:z.id),children:a.jsx(ZJ,{className:"icon"})}),_===z.id?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"menu-scrim",onClick:()=>L(null)}),a.jsx("div",{className:"history-menu",children:a.jsxs("button",{type:"button",className:"menu-item menu-item--danger",onClick:()=>{L(null),u.onDelete(z)},children:[a.jsx(Yg,{className:"icon"})," ",N("history.delete")]})})]}):null]},z.id)}),u.hasMore?a.jsx("button",{type:"button",className:"history-load-more",disabled:u.loading,onClick:u.onLoadMore,children:u.loading?N("history.loadingMore"):N("history.loadMore")}):null]}):a.jsxs(a.Fragment,{children:[q.length===0?a.jsx("div",{className:"history-empty",children:N("history.empty")}):null,q.map(z=>{const J=z.id===i,ne=(l==null?void 0:l.has(z.id))===!0,W=!ne&&(c==null?void 0:c.has(z.id))===!0;return a.jsxs("div",{className:`history-item ${J?"active":""}`,children:[a.jsxs("button",{className:"history-item-btn",onClick:()=>j(z.id),"aria-current":J?"page":void 0,title:z.title,children:[a.jsx(Pee,{title:z.title}),W&&a.jsxs("span",{className:"history-evaluating-status",title:N("history.evaluatingTitle"),children:[a.jsx("span",{className:"history-evaluating","aria-hidden":"true"}),N("history.evaluating")]})]}),a.jsxs("div",{className:"history-action-slot",children:[ne?a.jsx(YA,{className:"history-streaming-indicator",size:12,role:"status","aria-label":N("history.generating")}):null,a.jsx("button",{type:"button",className:"history-more","aria-label":N("history.manage",{title:z.title}),title:N("history.more"),onClick:()=>L(X=>X===z.id?null:z.id),children:a.jsx(ZJ,{className:"icon"})})]}),_===z.id&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"menu-scrim",onClick:()=>L(null)}),a.jsx("div",{className:"history-menu",children:a.jsxs("button",{type:"button",className:"menu-item menu-item--danger",onClick:()=>{L(null),T(z.id)},children:[a.jsx(Yg,{className:"icon"})," ",N("history.delete")]})})]})]},z.id)})]})})]}),a.jsx("div",{className:"sidebar-footer",children:a.jsx(Spt,{activePage:r,access:o,userInfo:R,onAgentKitCli:k,onDeveloperResources:S,onSystemInfo:O,onIssueFeedback:E,onLogout:C})})]})}const Cpt={name:"studio_share_space"},Apt={name:"studio_review_space"},OIe={share:Cpt,review:Apt},Tpt=OIe.share.name,SIe=OIe.review.name,_pt=[Tpt,SIe];function EIe(e){return _pt.includes(e.trim().toLowerCase())}function jpt(e){return e.name===SIe}const Npt="/web/skill-management";class i1 extends Error{constructor(t,n,i="SKILL_MANAGEMENT_ERROR",r="",s,o=""){super(t),this.status=n,this.code=i,this.statusText=r,this.originalError=s,this.rawResponse=o,this.name="SkillManagementApiError"}}async function lc(e,t={},n=eo){return fetch(Na(`${Npt}${e}`),{...t,headers:hl(oc(t.headers)),signal:po(t.signal,n)})}async function aT(e,t){let n=t,i="SKILL_MANAGEMENT_ERROR",r;const s=await e.text().catch(()=>"");try{const o=JSON.parse(s);typeof o.detail=="string"?n=o.detail:o.detail&&(n=o.detail.message||t,i=o.detail.code||i,r=o.detail.originalError)}catch{s.trim()&&(n=Q("common.fallbackWithDetail",{fallback:t,detail:s.trim()}))}return new i1(n,e.status,i,e.statusText,r,s)}async function cc(e,t){if(!e.ok)throw await aT(e,t);return e.json()}async function Rpt(e){const t=new URLSearchParams({region:e.region,page:String(e.page),page_size:String(e.pageSize)});return e.project&&t.set("project",e.project),cc(await lc(`/spaces?${t}`,{signal:e.signal}),Q("skills.listSpacesFailed"))}async function Ipt(e){if(EIe(e.name))throw new i1(Q("skills.reservedSpaceName"),409,"SKILL_SPACE_RESERVED_IDENTITY");return cc(await lc("/spaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Q("skills.createSpaceFailed"))}async function Ppt(e){const t=new URLSearchParams({region:e.region});return cc(await lc(`/shared-space/ensure?${t}`,{method:"POST",signal:e.signal}),Q("skills.sharedSpaceFailed"))}async function Dpt(e){return cc(await lc(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/review`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({region:e.region,version:e.version})},yr),Q("skills.submitReviewFailed"))}async function Mpt(e){const t=new URLSearchParams({region:e.region});return cc(await lc(`/reviews?${t}`,{signal:e.signal}),Q("skills.listReviewsFailed"))}async function Lpt(e){const t=new URLSearchParams({region:e.region});return cc(await lc(`/reviews/${encodeURIComponent(e.id)}/files?${t}`,{signal:e.signal},yr),Q("skills.reviewFilesFailed"))}async function $pt(e){return cc(await lc(`/reviews/${encodeURIComponent(e.id)}/decision`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({region:e.region,decision:e.decision,reason:e.reason||"",comment:e.comment||""})},yr),Q("skills.decideReviewFailed"))}async function Fpt(e){const t=new URLSearchParams({region:e.region});return cc(await lc(`/spaces/${encodeURIComponent(e.spaceId)}/reviews?${t}`,{signal:e.signal}),Q("skills.listReviewsFailed"))}async function Bpt(e){if(EIe(e.name))throw new i1(Q("skills.reservedSpaceName"),409,"SKILL_SPACE_RESERVED_IDENTITY");return cc(await lc(`/spaces/${encodeURIComponent(e.spaceId)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e.name,description:e.description,region:e.region})}),Q("skills.updateSpaceFailed"))}async function Upt(e){const t=new URLSearchParams({region:e.region});await cc(await lc(`/spaces/${encodeURIComponent(e.spaceId)}?${t}`,{method:"DELETE"}),Q("skills.deleteSpaceFailed"))}async function Qpt(e){const t=new URLSearchParams({region:e.region});return e.project&&t.set("project",e.project),cc(await lc(`/spaces/${encodeURIComponent(e.spaceId)}/skills?${t}`,{method:"POST",headers:{"Content-Type":"application/zip"},body:e.file},yr),Q("skills.uploadFailed"))}async function zpt(e){return cc(await lc("/validate",{method:"POST",headers:{"Content-Type":"application/zip"},body:e},yr),Q("skills.validateFailed"))}async function Vpt(e){const t=new URLSearchParams({region:e.region});await cc(await lc(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}?${t}`,{method:"DELETE"}),Q("skills.deleteFailed"))}async function CIe(e){const t=new URLSearchParams({region:e.region});e.version&&t.set("version",e.version),e.skillSpaceName&&t.set("skill_space_name",e.skillSpaceName),e.skillName&&t.set("skill_name",e.skillName);const n=await cc(await lc(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/files?${t}`),Q("skills.listFilesFailed"));return Array.isArray(n.files)?n.files:[]}async function Hpt(e){var l;const t=new URLSearchParams({region:e.region});e.version&&t.set("version",e.version),e.skillSpaceName&&t.set("skill_space_name",e.skillSpaceName),e.skillName&&t.set("skill_name",e.skillName);const n=await lc(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/archive?${t}`,{},yr);n.ok||await cc(n,Q("skills.downloadFailed"));const r=((l=(n.headers.get("content-disposition")||"").match(/filename="([^"]+)"/))==null?void 0:l[1])||`${e.fallbackName}.zip`,s=URL.createObjectURL(await n.blob()),o=document.createElement("a");o.href=s,o.download=r,o.click(),URL.revokeObjectURL(s)}bn.hasResourceBundle("en-US","create")||bn.addResourceBundle("en-US","create",she,!0,!0);bn.hasResourceBundle("zh-CN","create")||bn.addResourceBundle("zh-CN","create",d0e,!0,!0);function Yt(e,t={}){return bn.t(e,{...t,ns:"create"})}function Nc(e){var t;return((t=e==null?void 0:e.displayName)==null?void 0:t.trim())||(e==null?void 0:e.name)||""}async function hM(e,t){const n=await fetch(Na(e),{headers:hl(oc({accept:"application/json"})),signal:po(t,eo)});if(!n.ok)throw await aT(n,Yt("helpers.skills.agentKitRequestFailed"));return n.json()}async function AIe(){return((await hM("/web/skill-spaces")).items||[]).filter(t=>!jpt(t))}async function TIe(e,t){const n=t?`?region=${encodeURIComponent(t)}`:"";return(await hM(`/web/skill-spaces/${encodeURIComponent(e)}/skills${n}`)).items||[]}async function _Ie(e,t){const n=new URLSearchParams({region:t.region,page:String(t.page),page_size:String(t.pageSize)});return t.project&&n.set("project",t.project),hM(`/web/skill-spaces/${encodeURIComponent(e)}/skills?${n.toString()}`,t.signal)}async function qpt(e,t,n,i,r,s,o){const l=[];n&&l.push(`version=${encodeURIComponent(n)}`),i&&l.push(`region=${encodeURIComponent(i)}`),r&&l.push(`project=${encodeURIComponent(r)}`),s&&l.push(`skill_name=${encodeURIComponent(s)}`),o&&l.push(`skill_space_name=${encodeURIComponent(o)}`);const c=l.length>0?`?${l.join("&")}`:"";return hM(`/web/skill-spaces/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}${c}`)}function Wpt(e,t){const n=Ey(t);return{source:"skillspace",id:`ss:${e.id}/${n}/${t.version}`,name:t.skillName,description:t.skillDescription,folder:t.skillName,skillSpaceId:e.id,skillSpaceName:e.name,skillSpaceRegion:e.region,skillId:n,version:t.version}}function Ey(e){return e.skillId||e.skillName}function Kpt(e,t,n="volcengine"){return n==="byteplus"?"":`https://console.volcengine.com/agentkit/${(t||"cn-beijing")==="cn-beijing"?"cn":"cn-shanghai"}/skillspace/detail/${encodeURIComponent(e)}`}const Gpt="data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='visible'%20style='display:%20block;'%20width='7.93649'%20height='8'%20viewBox='0%200%207.93649%208'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20id='Resizer'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.21499%200L0%207.27273L0.721499%208L7.93649%200.727273L7.21499%200ZM6.86867%203.99988L3.98268%206.90897L4.70418%207.63625L7.59017%204.72715L6.86867%203.99988Z'%20fill='%23737A87'/%3e%3c/svg%3e";function jIe({className:e="",counter:t,maxHeight:n,...i}){return a.jsxs("div",{className:`studio-textarea ${e}`.trim(),"data-counter":t!=null||void 0,style:{maxHeight:n},children:[a.jsx("textarea",{...i,className:"studio-textarea__input"}),t!=null&&a.jsx("span",{className:"studio-textarea__counter",children:t}),a.jsx("img",{className:"studio-textarea__resizer",src:Gpt,alt:"","aria-hidden":"true"})]})}async function NIe(e,t,n){const i=new URLSearchParams({region:e.region}),r=await fetch(Na(`/web/skill-management/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/document?${i}`),{...t,headers:hl(oc(t.headers)),signal:po(e.signal,n)});if(!r.ok)throw await aT(r,"SKILL_DOCUMENT_REQUEST_FAILED");return r.json()}function Xpt(e){return NIe(e,{},eo)}function Ypt(e){return NIe(e,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:e.content,baseVersion:e.baseVersion})},yr)}function Zpt({target:e,onClose:t,onSaved:n}){const{t:i}=_e("workspaceTools"),[r,s]=p.useState(null),[o,l]=p.useState(""),[c,u]=p.useState(!0),[d,f]=p.useState(!1),[h,m]=p.useState(""),[g,b]=p.useState(0),[v,y]=p.useState(!1),w=p.useId(),x=p.useRef(null),k=p.useRef(!1),S=p.useRef(!0),O=p.useRef({dirty:!1,onClose:t});O.current={dirty:r!==null&&o!==r.content,onClose:t};const A=p.useRef(null);function E(){k.current||(O.current.dirty?y(!0):O.current.onClose())}p.useEffect(()=>{var N,P;S.current=!0;const T=window.document.activeElement instanceof HTMLElement?window.document.activeElement:null,R=window.document.body.style.overflow;window.document.body.style.overflow="hidden",(P=(N=x.current)==null?void 0:N.querySelector("button"))==null||P.focus();function C(I){var _,L;if(I.isComposing||(I.key==="Escape"&&(I.preventDefault(),E()),I.key!=="Tab"))return;const D=Array.from(((_=x.current)==null?void 0:_.querySelectorAll('button:not([disabled]),textarea:not([disabled]),[tabindex="0"]'))??[]);D.length&&(I.shiftKey&&window.document.activeElement===D[0]?(I.preventDefault(),(L=D[D.length-1])==null||L.focus()):!I.shiftKey&&window.document.activeElement===D[D.length-1]&&(I.preventDefault(),D[0].focus()))}return window.addEventListener("keydown",C),()=>{var I;S.current=!1,(I=A.current)==null||I.abort(),window.removeEventListener("keydown",C),window.document.body.style.overflow=R,T!=null&&T.isConnected&&T.focus()}},[]),p.useEffect(()=>{const T=new AbortController;return u(!0),m(""),Xpt({...e,signal:T.signal}).then(R=>{T.signal.aborted||(s(R),l(R.content))}).catch(()=>{T.signal.aborted||m("documentLoadFailed")}).finally(()=>{T.signal.aborted||u(!1)}),()=>T.abort()},[e,g]);async function j(){if(k.current||!(r!=null&&r.canUpdate)||o===r.content||!o.trim())return;k.current=!0,f(!0),m("");const T=new AbortController;A.current=T;try{await Ypt({...e,content:o,baseVersion:r.baseVersion,signal:T.signal}),S.current&&(n(),t())}catch(R){S.current&&m(R instanceof i1&&R.status===409?"documentConflict":R instanceof i1&&R.status===403?"accessDenied":"documentSaveFailed")}finally{k.current=!1,S.current&&f(!1)}}return vi.createPortal(a.jsx("div",{className:"mpa-skill-editor-backdrop",children:a.jsxs("section",{className:"mpa-skill-editor",role:"dialog","aria-modal":"true","aria-labelledby":w,ref:x,children:[a.jsxs("header",{children:[a.jsxs("h2",{id:w,children:[e.name," · SKILL.md"]}),a.jsx(ki,{variant:"ghost",disabled:d,onClick:E,children:i("agentTopology.close")})]}),a.jsx("p",{className:"mpa-skill-editor-hint",children:i("agentTopology.documentEditHint")}),c?a.jsx("p",{role:"status",children:i("agentTopology.documentLoading")}):r?a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[r.baseVersion," ·"," ",i(r.canUpdate?"agentTopology.documentWritable":"agentTopology.documentReadOnly")]}),a.jsx(jIe,{"aria-label":"SKILL.md",value:o,readOnly:!r.canUpdate,disabled:d,maxLength:262144,spellCheck:!1,onChange:T=>l(T.currentTarget.value)})]}):null,h&&a.jsx("p",{role:"alert",children:i(`agentTopology.${h}`)}),v&&a.jsxs("div",{role:"alert",children:[a.jsx("p",{children:i("agentTopology.discardDocument")}),a.jsx(ki,{variant:"outline",onClick:()=>y(!1),children:i("agentTopology.keepEditing")}),a.jsx(ki,{variant:"secondary",onClick:t,children:i("agentTopology.discardChanges")})]}),a.jsxs("footer",{children:[!r&&!c&&a.jsx(ki,{variant:"outline",onClick:()=>b(T=>T+1),children:i("agentTopology.refresh")}),(r==null?void 0:r.canUpdate)&&a.jsx(ki,{loading:d,disabled:c||o===r.content||!o.trim(),onClick:()=>void j(),children:i("agentTopology.saveDocument")})]})]})}),window.document.body)}function kC(e){return e.trimEnd().replace(/[。.]+$/,"")}function RIe({selected:e,onChange:t,cloudProvider:n="volcengine"}){const{t:i}=_e("create"),[r,s]=p.useState([]),[o,l]=p.useState([]),[c,u]=p.useState(""),[d,f]=p.useState(!0),[h,m]=p.useState(!1),[g,b]=p.useState(null);p.useEffect(()=>{let k=!1;return(async()=>{f(!0),b(null);try{const S=await AIe();k||(s(S),S.length>0&&u(S[0].id))}catch(S){k||b(S instanceof Error?S.message:i("skills.space.loadError"))}finally{k||f(!1)}})(),()=>{k=!0}},[i]),p.useEffect(()=>{if(!c){l([]);return}const k=r.find(O=>O.id===c);let S=!1;return(async()=>{m(!0),b(null);try{const O=await TIe(c,k==null?void 0:k.region);S||l(O)}catch(O){S||b(O instanceof Error?O.message:i("skills.space.loadError"))}finally{S||m(!1)}})(),()=>{S=!0}},[c,r,i]);const v=r.find(k=>k.id===c),y=v?Kpt(v.id,v.region,n):"",w=(k,S)=>e.some(O=>O.source==="skillspace"&&O.skillId===k&&(O.version||"")===S),x=k=>{if(!v)return;const S=Ey(k);if(w(S,k.version))t(e.filter(O=>!(O.source==="skillspace"&&O.skillId===S&&(O.version||"")===k.version)));else{const O=Wpt(v,k);t([...e,{source:"skillspace",folder:O.folder||k.skillName,name:O.name,description:O.description,skillSpaceId:O.skillSpaceId,skillSpaceName:O.skillSpaceName,skillSpaceRegion:O.skillSpaceRegion,skillId:O.skillId,version:O.version}])}};return a.jsx("div",{className:"cw-skillspace",children:d?a.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[a.jsx(Vi,{className:"cw-i cw-spin"})," ",i("skills.space.loadingSpaces")]}):g?a.jsxs("div",{className:"cw-banner",children:[a.jsx(gm,{className:"cw-i"}),a.jsx("span",{children:g})]}):r.length===0?a.jsx("p",{className:"cw-empty-line",children:i("skills.space.noSpaces")}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"cw-skillspace-header",children:[a.jsx("select",{className:"cw-input cw-skillspace-select",value:c,onChange:k=>u(k.target.value),"aria-label":i("skills.space.selectSpace"),children:r.map(k=>a.jsxs("option",{value:k.id,children:[Nc(k)||k.id,k.description?` — ${kC(k.description)}`:""]},k.id))}),v&&a.jsxs(a.Fragment,{children:[v.region&&a.jsx("span",{className:"cw-skillspace-region-label",title:v.region,children:Sh(v.region,n)}),y&&a.jsx("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:"cw-button cw-button-secondary cw-skillspace-console-link",title:i("skills.space.openConsole"),"aria-label":i("skills.space.openConsole"),children:a.jsx(uv,{className:"cw-i cw-i-sm"})})]})]}),h?a.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[a.jsx(Vi,{className:"cw-i cw-spin"})," ",i("skills.space.loadingSkills")]}):o.length===0?a.jsx("p",{className:"cw-empty-line",children:i("skills.space.noSkills")}):a.jsx("div",{className:"cw-skill-results",children:o.map(k=>{const S=Ey(k),O=w(S,k.version);return a.jsxs("button",{type:"button",className:`cw-skill-result ${O?"is-on":""}`,onClick:()=>x(k),"aria-pressed":O,children:[a.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:O?a.jsx(Of,{className:"cw-i cw-i-sm"}):a.jsx(ec,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:"cw-skill-result-meta",children:[a.jsxs("span",{className:"cw-skill-result-name",children:[k.skillName,k.version&&a.jsxs("span",{className:"cw-skill-result-version",children:[" ","v",k.version]})]}),k.skillDescription&&a.jsx("span",{className:"cw-skill-result-desc",children:kC(k.skillDescription)}),a.jsxs("span",{className:"cw-skill-result-repo",children:[a.jsx(Rat,{className:"cw-i cw-i-sm"})," ",Nc(v)||c]})]})]},`${S}/${k.version}`)})})]})})}function oT(e,t){return e.map(n=>({...n,get label(){return Yt(`${t}.${n.id}.label`)},get desc(){return Yt(`${t}.${n.id}.description`)}}))}function md(e,t){const n={...e};for(const[i,r]of Object.entries(t))Object.defineProperty(n,i,{configurable:!0,enumerable:!0,get:()=>Yt(r)});return n}const IIe="https://ark.cn-beijing.volces.com/api/v3/";md({key:"MODEL_AGENT_NAME",required:!1,placeholder:"doubao-seed-1-6-250615"},{comment:"traditional.catalog.env.modelAgentName.comment"});const ON=[md({key:"MODEL_EMBEDDING_NAME",required:!1,placeholder:"doubao-embedding-vision-250615"},{comment:"traditional.catalog.env.embeddingModelName.comment"}),{key:"MODEL_EMBEDDING_DIM",required:!1,placeholder:"2048"},{key:"MODEL_EMBEDDING_API_BASE",required:!1,placeholder:IIe}],mI=[],gI={get label(){return Yt("traditional.catalog.links.console")},url:"https://console.volcengine.com/vikingdb/openviking"},Jpt={get label(){return Yt("traditional.catalog.links.documentation")},url:"https://github.com/volcengine/OpenViking/blob/main/docs/zh/api/05-sessions.md"},PIe="https://api.vikingdb.cn-beijing.volces.com/openviking",emt=`{ "self": {"enabled": true}, "peer": {"enabled": true}, "working_memory": {"enabled": true}, "memory_types": null -}`,emt=[{key:"DATABASE_VIKING_PROJECT",required:!1,placeholder:"default"},{key:"DATABASE_VIKING_REGION",required:!1},{key:"DATABASE_VIKING_COLLECTION_KIND",required:!1},{key:"DATABASE_VIKING_RESOURCE_ID",required:!1}],tmt=[md({key:"DATABASE_VIKINGMEM_PROJECT",required:!1,placeholder:"default",hidden:!0},{comment:"traditional.catalog.env.vikingMemoryProject.comment"}),md({key:"DATABASE_VIKING_REGION",required:!1,hidden:!0},{comment:"traditional.catalog.env.vikingMemoryRegion.comment"}),md({key:"DATABASE_VIKINGMEM_MEMORY_TYPE",required:!1,placeholder:"sys_event_v1,sys_profile_v1",hidden:!0},{comment:"traditional.catalog.env.vikingMemoryType.comment"})],hS=[md({key:"FEISHU_APP_ID",required:!0,placeholder:"cli_xxx"},{comment:"traditional.catalog.env.feishuAppId.comment"}),md({key:"FEISHU_APP_SECRET",required:!0,secret:!0},{placeholder:"traditional.catalog.env.feishuAppSecret.placeholder",comment:"traditional.catalog.env.feishuAppSecret.comment"})],dw={topK:"3",region:"cn-beijing",endpoint:"https://open.volcengineapi.com/"};function pM(e){if(e==="byteplus"){const t="ap-southeast-1";return{topK:dw.topK,region:t,endpoint:`https://agentkit.${t}.byteplusapi.com/`}}return dw}const PIe=[md({key:"REGISTRY_SPACE_ID",required:!0},{placeholder:"traditional.catalog.env.registrySpaceId.placeholder",comment:"traditional.catalog.env.registrySpaceId.comment"}),md({key:"REGISTRY_TOP_K",required:!1,placeholder:dw.topK},{comment:"traditional.catalog.env.registryTopK.comment"}),md({key:"REGISTRY_REGION",required:!1,placeholder:dw.region},{comment:"traditional.catalog.env.registryRegion.comment"}),md({key:"REGISTRY_ENDPOINT",required:!1,placeholder:dw.endpoint},{comment:"traditional.catalog.env.registryEndpoint.comment"})],lT=oT([{id:"web_search",importLine:"from veadk.tools.builtin_tools.web_search import web_search",toolNames:["web_search"],env:mI},{id:"parallel_web_search",importLine:"from veadk.tools.builtin_tools.parallel_web_search import parallel_web_search",toolNames:["parallel_web_search"],env:mI},{id:"link_reader",importLine:"from veadk.tools.builtin_tools.link_reader import link_reader",toolNames:["link_reader"],env:[]},{id:"web_scraper",importLine:"from veadk.tools.builtin_tools.web_scraper import web_scraper",toolNames:["web_scraper"],env:[{key:"TOOL_WEB_SCRAPER_ENDPOINT",required:!0},{key:"TOOL_WEB_SCRAPER_API_KEY",required:!0}]},{id:"image_generate",importLine:"from veadk.tools.builtin_tools.image_generate import image_generate",toolNames:["image_generate"],env:[{key:"MODEL_IMAGE_NAME",required:!1,placeholder:"doubao-seedream-5-0-260128"}]},{id:"image_edit",importLine:"from veadk.tools.builtin_tools.image_edit import image_edit",toolNames:["image_edit"],env:[{key:"MODEL_EDIT_NAME",required:!1,placeholder:"doubao-seededit-3-0-i2i-250628"}]},{id:"video_generate",importLine:"from veadk.tools.builtin_tools.video_generate import video_generate, video_task_query",toolNames:["video_generate","video_task_query"],env:[{key:"MODEL_VIDEO_NAME",required:!1,placeholder:"doubao-seedance-2-0-260128"}]},{id:"text_to_speech",importLine:"from veadk.tools.builtin_tools.tts import text_to_speech",toolNames:["text_to_speech"],env:[{key:"TOOL_VESPEECH_APP_ID",required:!0},{key:"TOOL_VESPEECH_SPEAKER",required:!1,placeholder:"zh_female_vv_uranus_bigtts"}]},{id:"run_code",importLine:"from veadk.tools.builtin_tools.run_code import run_code",toolNames:["run_code"],env:[{key:"AGENTKIT_TOOL_ID",required:!0,placeholder:"t-xxxx",get comment(){return Yt("traditional.catalog.env.agentKitToolId.comment")}},{key:"AGENTKIT_TOOL_REGION",required:!1,placeholder:"cn-beijing",get comment(){return Yt("traditional.catalog.env.agentKitToolRegion.comment")}}]},{id:"vesearch",importLine:"from veadk.tools.builtin_tools.vesearch import vesearch",toolNames:["vesearch"],env:[{key:"TOOL_VESEARCH_ENDPOINT",required:!0,comment:"VeSearch bot_id"}]}],"traditional.catalog"),nmt=new Set(["web_scraper","text_to_speech","vesearch"]),imt=new Set(["web_search","parallel_web_search"]),rmt=lT.filter(e=>!nmt.has(e.id));function DIe(e="volcengine"){const t=e==="byteplus"?imt:new Set;return rmt.filter(n=>!t.has(n.id))}const fw=oT([{id:"local",env:[]},{id:"sqlite",extraArgs:'local_database_path="./short_term_memory.db"',env:[]},{id:"mysql",env:[{key:"DATABASE_MYSQL_HOST",required:!0},{key:"DATABASE_MYSQL_USER",required:!0},{key:"DATABASE_MYSQL_PASSWORD",required:!0},{key:"DATABASE_MYSQL_DATABASE",required:!0}]},{id:"postgresql",env:[{key:"DATABASE_POSTGRESQL_HOST",required:!0},{key:"DATABASE_POSTGRESQL_PORT",required:!1,placeholder:"5432"},{key:"DATABASE_POSTGRESQL_USER",required:!0},{key:"DATABASE_POSTGRESQL_PASSWORD",required:!0},{key:"DATABASE_POSTGRESQL_DATABASE",required:!0}]}],"traditional.backends.shortTerm"),_B=oT([{id:"local",env:ON,pipExtra:"extensions",needsEmbedding:!0},{id:"opensearch",env:[{key:"DATABASE_OPENSEARCH_HOST",required:!0},{key:"DATABASE_OPENSEARCH_PORT",required:!1,placeholder:"9200"},{key:"DATABASE_OPENSEARCH_USERNAME",required:!0},{key:"DATABASE_OPENSEARCH_PASSWORD",required:!0},...ON],pipExtra:"extensions",needsEmbedding:!0},{id:"redis",env:[{key:"DATABASE_REDIS_HOST",required:!0},{key:"DATABASE_REDIS_PORT",required:!1,placeholder:"6379"},{key:"DATABASE_REDIS_PASSWORD",required:!1},...ON],pipExtra:"extensions",needsEmbedding:!0},{id:"viking",env:tmt},{id:"openviking",env:[{key:"DATABASE_OPENVIKING_URL",required:!0,placeholder:IIe,get comment(){return Yt("traditional.catalog.env.openVikingUrl.comment")},link:gI},{key:"DATABASE_OPENVIKING_API_KEY",required:!0,comment:"OpenViking API Key",link:gI},{key:"DATABASE_OPENVIKING_USER_ID",required:!1,placeholder:"default",get comment(){return Yt("traditional.catalog.env.openVikingMemoryUserId.comment")},get help(){return Yt("traditional.catalog.env.openVikingMemoryUserId.help")}},{key:"DATABASE_OPENVIKING_MEMORY_POLICY",required:!1,placeholder:Jpt,get comment(){return Yt("traditional.catalog.env.openVikingMemoryPolicy.comment")},multiline:!0,format:"json",get help(){return Yt("traditional.catalog.env.openVikingMemoryPolicy.help")},link:Zpt}]},{id:"mem0",env:[{key:"DATABASE_MEM0_API_KEY",required:!0},{key:"DATABASE_MEM0_BASE_URL",required:!1}],pipExtra:"database"}],"traditional.backends.longTerm"),Pg="viking",jB=oT([{id:"viking",env:emt},{id:"opensearch",env:[{key:"DATABASE_OPENSEARCH_HOST",required:!0},{key:"DATABASE_OPENSEARCH_PORT",required:!1,placeholder:"9200"},{key:"DATABASE_OPENSEARCH_USERNAME",required:!0},{key:"DATABASE_OPENSEARCH_PASSWORD",required:!0},...ON],pipExtra:"extensions",needsEmbedding:!0},{id:"context_search",env:[...mI,{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ID",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ENDPOINT",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_APIKEY",required:!0}]},{id:"openviking",env:[{key:"DATABASE_OPENVIKING_URL",required:!0,placeholder:IIe,get comment(){return Yt("traditional.catalog.env.openVikingUrl.comment")},link:gI},{key:"DATABASE_OPENVIKING_API_KEY",required:!0,comment:"OpenViking API Key",link:gI},{key:"DATABASE_OPENVIKING_USER_ID",required:!1,placeholder:"default",get comment(){return Yt("traditional.catalog.env.openVikingKnowledgeUserId.comment")},get help(){return Yt("traditional.catalog.env.openVikingKnowledgeUserId.help")}},{key:"DATABASE_OPENVIKING_TARGET_URI",required:!1,placeholder:"viking://user/default/resources//",get comment(){return Yt("traditional.catalog.env.openVikingTargetUri.comment")},get help(){return Yt("traditional.catalog.env.openVikingTargetUri.help")}}]}],"traditional.backends.knowledge"),smt=oT([{id:"apmplus",enableFlag:"ENABLE_APMPLUS",env:[{key:"OBSERVABILITY_OPENTELEMETRY_APMPLUS_SERVICE_NAME",required:!1}]},{id:"cozeloop",enableFlag:"ENABLE_COZELOOP",env:[{key:"OBSERVABILITY_OPENTELEMETRY_COZELOOP_API_KEY",required:!0},{key:"OBSERVABILITY_OPENTELEMETRY_COZELOOP_SERVICE_NAME",required:!1,comment:"CozeLoop space_id"}]},{id:"tls",enableFlag:"ENABLE_TLS",env:[...mI,md({key:"OBSERVABILITY_OPENTELEMETRY_TLS_SERVICE_NAME",required:!1},{comment:"traditional.catalog.env.tlsServiceName.comment"})]}],"traditional.exporters");function Sd(e="volcengine"){return{name:"",description:Yt("defaults.description"),instruction:Yt("defaults.instruction"),dynamicAgentDelegation:!1,agentType:"llm",cloudProvider:e,maxIterations:3,a2aUrl:"",tools:[],skills:[],memory:{shortTerm:!1,longTerm:!1},knowledgebase:!1,tracing:!1,subAgents:[],builtinTools:[],customTools:[],mcpTools:[],a2aRegistry:{enabled:!1,registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},modelName:Xp(e),modelFallbacks:[],modelSource:"ark",modelProvider:"",modelApiBase:"",shortTermBackend:"local",longTermBackend:"local",longTermMemoryIndex:"",autoSaveSession:!1,knowledgebaseBackend:Pg,knowledgebaseIndex:"",tracingExporters:[],selectedSkills:[],cloudEnvironment:{environmentId:"",environmentVersionId:""},deployment:{feishuEnabled:!1,modelApiKeyId:"",modelApiKeyName:""}}}function gO(e){return{id:e,get displayName(){return Yt(`traditional.optimization.options.${e}.label`)},get description(){return Yt(`traditional.optimization.options.${e}.description`)}}}const lH=[gO("context_engine"),gO("compressor"),gO("verifier"),gO("long_run_control"),gO("mcp_resilience")],amt=[{id:"quality",get displayName(){return Yt("traditional.optimization.groups.quality")},componentIds:["context_engine","verifier"]},{id:"cost",get displayName(){return Yt("traditional.optimization.groups.cost")},componentIds:["compressor"]},{id:"stability",get displayName(){return Yt("traditional.optimization.groups.stability")},componentIds:["long_run_control","mcp_resilience"]}],tk=lH.map(e=>e.id);function omt(e){return e==="byteplus"?Yt("traditional.optimization.bytePlusUnavailable"):null}const MIe=["context_engine","compressor","verifier","long_run_control"],lmt=new Set(["1","true","yes","on"]),cH=[{id:"default",get displayName(){return Yt("traditional.optimization.profiles.default.label")},get description(){return Yt("traditional.optimization.profiles.default.description")},defaultComponents:[],autoAddedComponents:[]},{id:"ops",get displayName(){return Yt("traditional.optimization.profiles.ops.label")},get description(){return Yt("traditional.optimization.profiles.ops.description")},defaultComponents:["context_engine","verifier","long_run_control","mcp_resilience"],autoAddedComponents:["sql_readonly"]}];function SN(e){var t;return((t=lH.find(n=>n.id===e))==null?void 0:t.displayName)??e}function cmt(e){var t;return((t=cH.find(n=>n.id===e))==null?void 0:t.displayName)??e}function uH(e){const t=cH.find(n=>n.id===e);return t?[...t.defaultComponents]:[]}function Cy(e,t="default"){const n=new Set(e);return{enabled:n.size>0,profile:t,componentOverrides:Object.fromEntries(tk.map(r=>[r,n.has(r)]))}}function dH(e){if(!e)return;const t=e.profile==="ops"?"ops":"default",n=t==="ops"?uH(t):tk.filter(i=>{var r;return((r=e.componentOverrides)==null?void 0:r[i])===!0});return{...Cy(n,t),...e.catalogVersion?{catalogVersion:e.catalogVersion}:{},...e.planHash?{planHash:e.planHash}:{}}}function s4(e){return lmt.has((e==null?void 0:e.trim().toLowerCase())??"")}function umt(e){if(!e)return null;try{const t=JSON.parse(e);return t&&typeof t=="object"&&!Array.isArray(t)?t:null}catch{return null}}function dmt(e){var o;const t=new Map((e==null?void 0:e.map(({key:l,value:c})=>[l,c]))??[]),n=t.get("HARNESS_SIDECAR_ENABLED");if(n===void 0)return null;const i=((o=t.get("HARNESS_PROFILE"))==null?void 0:o.trim())==="ops"?"ops":"default";if(!s4(n))return Cy([],i);const r=umt(t.get("HARNESS_SIDECAR_COMPONENT_OVERRIDES"));if(r){const l={...Cy(tk.filter(c=>r[c]===!0),i),enabled:!0};return i==="ops"?dH(l)??l:l}if(i==="ops")return Cy(uH(i),i);const s=[...s4(t.get("HARNESS_MODEL_PROXY_ENABLED"))?MIe:[],...s4(t.get("HARNESS_MCP_GATEWAY_ENABLED"))?["mcp_resilience"]:[]];return{...Cy(s,i),enabled:!0}}function fmt(e,t){return{...e,modelName:t.modelName||e.modelName,description:t.description,instruction:t.instruction}}function hmt(e){var t;return((t=e.harnessSidecar)==null?void 0:t.profile)??"default"}function bI(e){var n;const t=(n=e.harnessSidecar)==null?void 0:n.componentOverrides;return t?tk.filter(i=>t[i]):[]}function pmt(e){const t=new Set(bI(e));return MIe.filter(n=>t.has(n))}function mmt(e,t){const n=i=>({...i,mcpTools:(i.mcpTools??[]).map(r=>{var o,l;const s=!!(r.authTokenEnv&&(t.has(r.authTokenEnv)||r.authToken));return{...r,credentialConfigured:s,...s?{credentialSourceUrl:((o=r.url)==null?void 0:o.trim())??"",credentialSourceAuthTokenEnv:((l=r.authTokenEnv)==null?void 0:l.trim())??""}:{}}}),subAgents:i.subAgents.map(n),...i.workflow?{workflow:{...i.workflow,nodes:i.workflow.nodes.map(r=>({...r,agent:n(r.agent)}))}}:{}});return n(e)}function nk(e){const t=(e==null?void 0:e.trim())??"",n=t.indexOf("/");return n<=0||n===t.length-1?{modelName:t,modelProvider:""}:{modelName:t.slice(n+1),modelProvider:t.slice(0,n)}}function fH(e){return nk(e).modelName}function LIe(e,t,n,i=!1){var c,u,d,f;const r=nk((t==null?void 0:t.model)||(n==null?void 0:n.model)),s=(t==null?void 0:t.children)??[],o=t==null?void 0:t.type,l=e.agentType==="a2a"&&((c=e.a2aRegistry)!=null&&c.enabled)&&o==="llm"?"a2a":o??e.agentType;return{...e,name:((u=t==null?void 0:t.name)==null?void 0:u.trim())||((d=n==null?void 0:n.name)==null?void 0:d.trim())||e.name,description:(t==null?void 0:t.description)??e.description,instruction:i?e.instruction:(t==null?void 0:t.instruction)??e.instruction,agentType:l,modelName:r.modelName||e.modelName,modelProvider:r.modelProvider||e.modelProvider,skills:((f=t==null?void 0:t.skills)==null?void 0:f.map(h=>h.name))??e.skills,subAgents:e.subAgents.map((h,m)=>LIe(h,s[m],void 0,i))}}function gmt(e,t){const n=new Map(t.map(({key:o,value:l})=>[o,l]));if(!["REGISTRY_SPACE_ID","REGISTRY_TOP_K","REGISTRY_REGION","REGISTRY_ENDPOINT"].some(o=>n.has(o)))return e;const r=(o,l)=>n.has(o)?n.get(o)??"":l??"",s=o=>{var l;return{...o,...(l=o.a2aRegistry)!=null&&l.enabled?{a2aRegistry:{...o.a2aRegistry,registrySpaceId:r("REGISTRY_SPACE_ID",o.a2aRegistry.registrySpaceId),registryTopK:r("REGISTRY_TOP_K",o.a2aRegistry.registryTopK),registryRegion:r("REGISTRY_REGION",o.a2aRegistry.registryRegion),registryEndpoint:r("REGISTRY_ENDPOINT",o.a2aRegistry.registryEndpoint)}}:{},subAgents:o.subAgents.map(s)}};return s(e)}function NB(e,t){var c,u,d;const n=e.cloudProvider??t,i=Sd(n),r=e.deployment,s=r==null?void 0:r.network,o=e.cloudEnvironment,l=e.a2aRegistry;return{...i,...e,name:e.name??i.name,description:e.description??i.description,instruction:e.instruction??i.instruction,agentType:e.agentType??i.agentType,cloudProvider:n,maxIterations:e.maxIterations??i.maxIterations,a2aUrl:e.a2aUrl??i.a2aUrl,model:e.model??void 0,modelSource:e.modelSource==="ark"||e.modelSource==="custom"?e.modelSource:void 0,modelName:e.modelName??i.modelName,modelProvider:e.modelProvider??i.modelProvider,modelApiBase:e.modelApiBase??i.modelApiBase,memory:{shortTerm:((c=e.memory)==null?void 0:c.shortTerm)??i.memory.shortTerm,longTerm:((u=e.memory)==null?void 0:u.longTerm)??i.memory.longTerm},tools:[...e.tools??[]],skills:[...e.skills??[]],knowledgebase:e.knowledgebase??i.knowledgebase,tracing:e.tracing??i.tracing,harnessSidecar:dH(e.harnessSidecar),subAgents:(e.subAgents??[]).map(f=>NB(f,n)),builtinTools:[...e.builtinTools??[]],customTools:[...e.customTools??[]],mcpTools:[...e.mcpTools??[]],a2aRegistry:{...i.a2aRegistry,...l??{},enabled:(l==null?void 0:l.enabled)??!1,registrySpaceId:(l==null?void 0:l.registrySpaceId)??"",registryTopK:(l==null?void 0:l.registryTopK)??"",registryRegion:(l==null?void 0:l.registryRegion)??"",registryEndpoint:(l==null?void 0:l.registryEndpoint)??""},shortTermBackend:e.shortTermBackend??i.shortTermBackend,longTermBackend:e.longTermBackend??i.longTermBackend,longTermMemoryIndex:e.longTermMemoryIndex??i.longTermMemoryIndex,autoSaveSession:e.autoSaveSession??i.autoSaveSession,knowledgebaseBackend:e.knowledgebaseBackend??i.knowledgebaseBackend,knowledgebaseIndex:e.knowledgebaseIndex??i.knowledgebaseIndex,tracingExporters:[...e.tracingExporters??[]],selectedSkills:[...e.selectedSkills??[]],cloudEnvironment:{...i.cloudEnvironment,...o??{},cliTools:[...(o==null?void 0:o.cliTools)??[]],dockerfile:typeof(o==null?void 0:o.dockerfile)=="string"?o.dockerfile:void 0},deployment:{...i.deployment,...r??{},feishuEnabled:(r==null?void 0:r.feishuEnabled)??!1,runtimeName:(r==null?void 0:r.runtimeName)??void 0,runtimeNameCustomized:(r==null?void 0:r.runtimeNameCustomized)??((d=i.deployment)==null?void 0:d.runtimeNameCustomized),network:s?{...s,vpcId:s.vpcId??"",subnetIds:s.subnetIds??"",enableSharedInternetAccess:s.enableSharedInternetAccess??!1}:void 0,modelApiKeyId:(r==null?void 0:r.modelApiKeyId)??"",modelApiKeyName:(r==null?void 0:r.modelApiKeyName)??"",envValues:(r==null?void 0:r.envValues)??void 0},...e.workflow?{workflow:{...e.workflow,nodes:e.workflow.nodes.map(f=>({...f,agent:NB(f.agent,n)}))}}:{}}}const bmt=["动态子智能体协作规则:","Dynamic sub-agent collaboration rules:"],ymt=["collect_resources","create_agents","handoff_to"];function vmt(e){return e.replace(/\\([\\`*_[\]{}()<>#+\-.!|])/g,"$1")}function xmt(e){const t=bmt.flatMap(i=>{const r=[];let s=0;for(;si-r),n=t.find((i,r)=>{const s=t[r+1]??e.length,o=vmt(e.slice(i,s));return ymt.every(l=>o.includes(l))});return n===void 0?e:e.slice(0,n).trimEnd()}function wmt(e){const t=n=>({...n,instruction:n.dynamicAgentDelegation===!0?xmt(n.instruction):n.instruction,subAgents:n.subAgents.map(t),...n.workflow?{workflow:{...n.workflow,nodes:n.workflow.nodes.map(i=>({...i,agent:t(i.agent)}))}}:{}});return t(e)}function $Ie(e,t){var l,c;const n=Sd(t),i=[...e.tools??[]],r=lT.filter(u=>u.toolNames.some(d=>i.includes(d))),s=new Set(r.flatMap(u=>u.toolNames)),o=nk(e.model);return{...n,modelSource:void 0,name:((l=e.name)==null?void 0:l.trim())??"",description:e.description??"",instruction:e.instruction||n.instruction,agentType:e.type??"llm",modelName:o.modelName,modelProvider:o.modelProvider,tools:i.filter(u=>!s.has(u)),builtinTools:r.map(u=>u.id),skills:((c=e.skills)==null?void 0:c.map(u=>u.name))??[],subAgents:(e.children??[]).map(u=>$Ie(u,t))}}function hH(e,t,n=[]){var l,c,u,d;const i=((l=e.draft)==null?void 0:l.cloudProvider)??t,r=nk(e.model),s=e.draft?NB(e.draft,i):e.graph?$Ie(e.graph,i):{...Sd(i),modelSource:void 0,name:((c=e.name)==null?void 0:c.trim())||e.appName.trim(),description:e.description??"",instruction:e.instruction||Sd(i).instruction,agentType:e.type??"llm",modelName:r.modelName,modelProvider:r.modelProvider,tools:[...e.tools??[]],skills:((u=e.skills)==null?void 0:u.map(f=>f.name))??[]},o=e.draft&&s.dynamicAgentDelegation===!0?wmt(s):s;return mmt(LIe(o,e.graph,{name:((d=e.name)==null?void 0:d.trim())||e.appName.trim(),model:e.model},!!e.draft),new Set(n))}function kmt(e,t){const n=i=>{var s;const r=((s=i.modelName)==null?void 0:s.trim())??"";return{...i,modelSource:i.agentType==="llm"||!i.agentType?t.has(r)?"ark":"custom":i.modelSource,subAgents:i.subAgents.map(n),...i.workflow?{workflow:{...i.workflow,nodes:i.workflow.nodes.map(o=>({...o,agent:n(o.agent)}))}}:{}}};return n(e)}const yI=[{id:"ubuntu-22.04",label:"Ubuntu 22.04",image:"ubuntu:22.04"},{id:"ubuntu-24.04",label:"Ubuntu 24.04",image:"ubuntu:24.04"}],FIe=[{id:"aio-sandbox",label:"AIO Sandbox",description:"内置 Sandbox Shell 能力 · Ubuntu 22.04"},{id:"codex-sandbox",label:"Codex Sandbox",description:"内置 Codex CLI、浏览器与代码执行环境"},{id:"ubuntu",label:"Ubuntu",description:"标准 Linux 基础镜像"}],pH="agentkit-cli-2107625663-cn-beijing.cr.volces.com/agentkit/agent-native-requirements-aio:0.2.1-20260831",BIe={volcengine:"enterprise-public-cn-beijing.cr.volces.com/vefaas-public/codexenv:1.1.0",byteplus:"enterprise-public-ap-southeast-1.cr.volces.com/vefaas-public/codexenv:1.1.0"},UIe=[{id:"python-3.10",label:"Python 3.10"},{id:"python-3.12",label:"Python 3.12"}],Omt={"python-3.10":"3.10.18","python-3.12":"3.12.11"},mH=[{id:"tools",label:"工具",description:"常用 CLI 与内容处理工具",options:[{id:"lark-cli",label:"lark-cli",description:"飞书开放平台命令行工具",installer:"pip",packageName:"lark-cli"},{id:"pandoc",label:"pandoc",description:"文档格式转换工具",installer:"apt",packageName:"pandoc"},{id:"opencli",label:"opencli",description:"将网站与桌面应用转换为命令行工具",installer:"npm",packageName:"@jackwener/opencli@1.8.7"}]},{id:"productivity",label:"效率",description:"加速依赖安装、检索和协作",options:[{id:"uv",label:"uv",description:"快速 Python 包与项目管理器",installer:"pip",packageName:"uv"},{id:"ripgrep",label:"ripgrep",description:"高性能文本检索工具",installer:"apt",packageName:"ripgrep"},{id:"jq",label:"jq",description:"JSON 查询与转换工具",installer:"apt",packageName:"jq"},{id:"github-cli",label:"GitHub CLI",description:"在终端中管理 GitHub 工作流",installer:"apt",packageName:"gh"}]},{id:"browser",label:"浏览器自动化",description:"网页操作、测试与内容采集",options:[{id:"playwright",label:"Playwright",description:"浏览器自动化与端到端测试",installer:"pip",packageName:"playwright"},{id:"chromium",label:"Chromium",description:"无头浏览器运行时",installer:"apt",packageName:"chromium"}]},{id:"system",label:"系统与媒体",description:"基础开发、网络和媒体处理能力",options:[{id:"git",label:"Git",description:"代码版本管理",installer:"apt",packageName:"git"},{id:"curl",label:"curl",description:"网络请求与文件下载",installer:"apt",packageName:"curl"},{id:"ffmpeg",label:"FFmpeg",description:"音视频转码与处理",installer:"apt",packageName:"ffmpeg"},{id:"imagemagick",label:"ImageMagick",description:"图片转换与批处理",installer:"apt",packageName:"imagemagick"}]}],Smt=mH.flatMap(e=>e.options),Emt=["build-essential","curl","libbz2-dev","libffi-dev","libgdbm-dev","liblzma-dev","libncursesw5-dev","libreadline-dev","libsqlite3-dev","libssl-dev","tk-dev","uuid-dev","zlib1g-dev"],Cmt=["xvfb","fonts-noto-color-emoji","fonts-unifont","libfontconfig1","libfreetype6","xfonts-cyrillic","xfonts-scalable","fonts-liberation","fonts-ipafont-gothic","fonts-wqy-zenhei","fonts-tlwg-loma-otf","fonts-freefont-ttf"],Amt={"ubuntu-22.04":["libasound2","libatk-bridge2.0-0","libatk1.0-0","libatspi2.0-0","libcairo2","libcups2","libdbus-1-3","libdrm2","libgbm1","libglib2.0-0","libnspr4","libnss3","libpango-1.0-0","libwayland-client0","libx11-6","libxcb1","libxcomposite1","libxdamage1","libxext6","libxfixes3","libxkbcommon0","libxrandr2"],"ubuntu-24.04":["libasound2t64","libatk-bridge2.0-0t64","libatk1.0-0t64","libatspi2.0-0t64","libcairo2","libcups2t64","libdbus-1-3","libdrm2","libgbm1","libglib2.0-0t64","libnspr4","libnss3","libpango-1.0-0","libx11-6","libxcb1","libxcomposite1","libxdamage1","libxext6","libxfixes3","libxkbcommon0","libxrandr2"]};function bO(e,t){for(const n of t)e.includes(n)||e.push(n)}function Tmt(e,t,n,i,r){const s=["ca-certificates"];r||bO(s,i?[`python${n}`,`python${n}-venv`]:Emt);for(const o of t)o.id==="playwright"||o.id==="chromium"||(o.installer==="apt"&&bO(s,[o.packageName]),o.id==="opencli"&&bO(s,["curl","xz-utils"]));return e.optionIds.some(o=>o==="playwright"||o==="chromium")&&(bO(s,Cmt),bO(s,Amt[e.operatingSystem])),s}const a4={name:"",description:"",baseEnvironment:"aio-sandbox",operatingSystem:"ubuntu-22.04",language:"python-3.12",optionIds:[],selectedSkills:[]};function Fp(e){var t;return((t=UIe.find(n=>n.id===e))==null?void 0:t.label)??e}function RB(e){var t;return((t=yI.find(n=>n.id===e))==null?void 0:t.label)??e}function IB(e){var t;return((t=FIe.find(n=>n.id===e))==null?void 0:t.label)??e}function _mt(e){var n;const t=((n=e.match(/^\s*FROM\s+(.+)$/im))==null?void 0:n[1])??"";return{baseEnvironment:/\/codexenv:/i.test(t)?"codex-sandbox":/aio\.sandbox/i.test(e)?"aio-sandbox":"ubuntu",operatingSystem:/ubuntu:24\.04/i.test(t)?"ubuntu-24.04":"ubuntu-22.04"}}function gH(e,t="volcengine"){const n=Smt.filter(b=>e.optionIds.includes(b.id)),i=e.baseEnvironment==="aio-sandbox",r=e.baseEnvironment==="codex-sandbox",s=i||r,o=s?"python-3.12":e.language,l=o.replace("python-",""),c=Omt[o],u=yI.find(b=>b.id===e.operatingSystem)??yI[0],d=e.operatingSystem==="ubuntu-22.04"&&l==="3.10"||e.operatingSystem==="ubuntu-24.04"&&l==="3.12",f=Tmt(e,n,l,d,s),h=i?[`ARG AIO_BASE_IMAGE=${pH}`,"ARG AIO_BASE_PLATFORM=linux/amd64","",`# Base environment: AIO Sandbox (${u.label})`,"FROM --platform=${AIO_BASE_PLATFORM} ${AIO_BASE_IMAGE}"]:r?[`ARG CODEX_BASE_IMAGE=${BIe[t]}`,"ARG CODEX_BASE_PLATFORM=linux/amd64","","# Base environment: Codex Sandbox","FROM --platform=${CODEX_BASE_PLATFORM} ${CODEX_BASE_IMAGE}"]:[`# Operating system: ${u.label}`,`FROM ${u.image}`];h.push("","ARG DEBIAN_FRONTEND=noninteractive","ARG APT_MIRROR_URL=http://archive.ubuntu.com/ubuntu","ARG PIP_INDEX_URL=https://pypi.org/simple","ARG PYTHON_SOURCE_BASE_URL=https://www.python.org/ftp/python","ARG PLAYWRIGHT_DOWNLOAD_HOST=https://cdn.playwright.dev","ARG PIP_DEFAULT_TIMEOUT=300","ARG PIP_RETRIES=10","","# Install all system dependencies in one transaction from the provider-local mirror.","RUN set -eux; \\",' mirror="${APT_MIRROR_URL%/}"; \\'," for source_file in /etc/apt/sources.list /etc/apt/sources.list.d/*.sources; do \\",' [ -f "$source_file" ] || continue; \\',' sed -i -E "s#https?://(archive|security).ubuntu.com/ubuntu/?#${mirror}#g" "$source_file"; \\'," done; \\",` printf 'Acquire::Retries "5";\\nAcquire::ForceIPv4 "true";\\nAcquire::http::Timeout "60";\\nAcquire::https::Timeout "60";\\n' > /etc/apt/apt.conf.d/80-veadk-network; \\`," apt-get update; \\"," apt-get install -y --no-install-recommends \\",...f.map(b=>" "+b+" \\")," ; rm -rf /var/lib/apt/lists/*","","ENV PYTHONDONTWRITEBYTECODE=1 \\"," PYTHONUNBUFFERED=1 \\"," PIP_NO_CACHE_DIR=1","",`# Python ${l}`),i?h.push("# Keep Studio dependencies isolated from AIO's system interpreter.","RUN /opt/python3.12/bin/python -m venv /opt/veadk-environment/.venv","","ENV VIRTUAL_ENV=/opt/veadk-environment/.venv \\"," BASH_VENV_PATH=/opt/veadk-environment/.venv \\",' PATH="/opt/veadk-environment/.venv/bin:$PATH"'):r?h.push("# Keep Studio dependencies isolated from the Codex runtime.","RUN python3 -m venv /opt/veadk-environment/.venv","","ENV VIRTUAL_ENV=/opt/veadk-environment/.venv \\",' PATH="/opt/veadk-environment/.venv/bin:$PATH"'):d?h.push(`RUN python${l} -m venv /opt/venv`):h.push(`RUN curl --retry 5 --retry-all-errors --connect-timeout 30 -fsSL "\${PYTHON_SOURCE_BASE_URL}/${c}/Python-${c}.tgz" -o /tmp/python.tgz \\`," && mkdir -p /tmp/python-source \\"," && tar -xzf /tmp/python.tgz --strip-components=1 -C /tmp/python-source \\"," && cd /tmp/python-source \\"," && ./configure --prefix=/opt/python --with-ensurepip=install \\",' && make -j"$(nproc)" \\'," && make install \\",` && /opt/python/bin/python${l} -m venv /opt/venv \\`," && rm -rf /tmp/python-source /tmp/python.tgz"),s||h.push("",'ENV PATH="/opt/venv/bin:$PATH"');const m=new Set(e.optionIds);(m.has("playwright")||m.has("chromium"))&&h.push("","ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright \\"," PLAYWRIGHT_DOWNLOAD_CONNECTION_TIMEOUT=300000"),h.push("","WORKDIR /workspace","","# VeADK","RUN python -m pip install --upgrade veadk-python");let g=!1;for(const b of n)h.push("",`# ${b.label}`),b.id==="opencli"?h.push('RUN node_arch="$(dpkg --print-architecture)" \\',' && case "$node_arch" in amd64) node_arch=x64 ;; arm64) node_arch=arm64 ;; *) echo "Unsupported architecture: $node_arch" >&2; exit 1 ;; esac \\',' && curl --retry 5 --connect-timeout 30 -fsSL "https://nodejs.org/dist/v22.18.0/node-v22.18.0-linux-${node_arch}.tar.xz" -o /tmp/node.tar.xz \\'," && tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1 \\",` && npm install --global ${b.packageName} \\`," && npm cache clean --force \\"," && rm -f /tmp/node.tar.xz"):b.id==="playwright"||b.id==="chromium"?g||(h.push("RUN python -m pip install --upgrade playwright"),h.push("RUN python -m playwright install chromium"),g=!0):b.installer!=="apt"&&h.push(`RUN python -m pip install --upgrade ${b.packageName}`);return i?h.push("","# Keep AIO's inherited /opt/gem/run.sh startup chain and shell API.","EXPOSE 8080"):r||h.push("",'CMD ["/bin/bash"]'),h.join(` -`)}function jmt(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m7 7 10 10M17 7 7 17",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function Nmt(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[a.jsx("circle",{cx:"10.8",cy:"10.8",r:"5.8",stroke:"currentColor",strokeWidth:"1.7"}),a.jsx("path",{d:"m15.2 15.2 4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function PB(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[a.jsx("path",{d:"M5 7.25A2.25 2.25 0 0 1 7.25 5h9.5A2.25 2.25 0 0 1 19 7.25v9.5A2.25 2.25 0 0 1 16.75 19h-9.5A2.25 2.25 0 0 1 5 16.75v-9.5Z",stroke:"currentColor",strokeWidth:"1.6"}),a.jsx("path",{d:"M8.5 9.25 11 12l-2.5 2.75M12.75 14.75h2.75",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]})}function QIe(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[a.jsx("path",{d:"M4.75 7.25A2.25 2.25 0 0 1 7 5h3l1.5 2h5.5a2.25 2.25 0 0 1 2.25 2.25v7.5A2.25 2.25 0 0 1 17 19H7a2.25 2.25 0 0 1-2.25-2.25v-9.5Z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),a.jsx("path",{d:"M8 11.25h8M8 14.75h5.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function Rmt(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M12 6.5v11M6.5 12h11",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function Dee(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m7 7 10 10M17 7 7 17",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function Mee(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m3.5 8.25 2.75 2.75 6.25-6.25",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}function Oc(e){return`${e.environment_id}\0${e.environment_version_id}`}function lE(e){return e.latestVersion?{environment_id:e.id,environment_version_id:e.latestVersion.versionId}:null}function EN(e,t){return e.environmentIds.flatMap(n=>{const i=t.get(n),r=i?lE(i):null;return r?[r]:[]})}function Imt({environments:e,workspaces:t,value:n,selectedWorkspaceIds:i,loading:r,error:s,onConfirm:o,onClose:l}){const{t:c}=_e("workspaceTools"),[u,d]=p.useState(""),[f,h]=p.useState(!1),[m,g]=p.useState(""),b=p.useId(),v=p.useMemo(()=>new Map(e.map(C=>[C.id,C])),[e]),[y,w]=p.useState(()=>new Set(i)),[x,k]=p.useState(()=>{const C=new Set(t.filter(N=>i.includes(N.id)).flatMap(N=>N.environmentIds));return new Set(n.filter(N=>!C.has(N.environment_id)).map(Oc))}),S=p.useMemo(()=>new Set(t.filter(C=>y.has(C.id)).flatMap(C=>C.environmentIds)),[y,t]),O=p.useMemo(()=>{const C=new Set(x);for(const N of t)if(y.has(N.id))for(const P of EN(N,v))C.add(Oc(P));return C},[x,y,v,t]),A=p.useMemo(()=>{const C=u.trim().toLocaleLowerCase();return C?e.filter(N=>`${N.name} ${N.description} ${Fp(N.language)}`.toLocaleLowerCase().includes(C)):e},[e,u]),E=p.useMemo(()=>{const C=u.trim().toLocaleLowerCase();return C?t.filter(N=>{const P=N.environmentIds.map(I=>{var D;return((D=v.get(I))==null?void 0:D.name)??""}).join(" ");return`${N.name} ${N.description} ${P}`.toLocaleLowerCase().includes(C)}):t},[v,u,t]);p.useEffect(()=>{const C=document.body.style.overflow,N=P=>{P.key==="Escape"&&!f&&l()};return document.body.style.overflow="hidden",document.addEventListener("keydown",N),()=>{document.body.style.overflow=C,document.removeEventListener("keydown",N)}},[l,f]);const j=C=>{const N=lE(C);if(!N)return;const P=Oc(N);S.has(C.id)||k(I=>{const D=new Set(I);return D.has(P)?D.delete(P):D.add(P),D})},T=C=>{const N=EN(C,v);N.length!==0&&(w(P=>{const I=new Set(P);return I.has(C.id)?I.delete(C.id):I.add(C.id),I}),k(P=>{const I=new Set(P);for(const D of N)I.delete(Oc(D));return I}))},R=async()=>{const C=new Map(n.map(P=>[Oc(P),P])),N=e.flatMap(P=>{const I=lE(P);if(!I||!O.has(Oc(I)))return[];const D=C.get(Oc(I));return[{...I,mount_instance_id:(D==null?void 0:D.mount_instance_id)||crypto.randomUUID()}]});h(!0),g("");try{await o(N,[...y]),l()}catch(P){g(P instanceof Error?P.message:c("sessionEnvironment.mountFailed"))}finally{h(!1)}};return vi.createPortal(a.jsxs("div",{className:"studio-tool-dialog-layer",children:[a.jsx("button",{type:"button",className:"studio-tool-dialog-scrim","aria-label":c("sessionEnvironment.closeDialog"),disabled:f,onClick:l}),a.jsxs("section",{className:"studio-tool-dialog session-environment-dialog",role:"dialog","aria-modal":"true","aria-labelledby":b,children:[a.jsxs("header",{className:"studio-tool-dialog-head",children:[a.jsx("span",{className:"studio-tool-dialog-mark",children:a.jsx(PB,{})}),a.jsxs("div",{children:[a.jsx("h2",{id:b,children:c("sessionEnvironment.addTitle")}),a.jsx("p",{children:c("sessionEnvironment.description")})]}),a.jsx("button",{type:"button",className:"studio-tool-dialog-close","aria-label":c("sessionEnvironment.closeAdd"),disabled:f,onClick:l,children:a.jsx(jmt,{})})]}),a.jsxs("div",{className:"studio-tool-dialog-body",children:[a.jsxs("label",{className:"studio-tool-search",children:[a.jsx(Nmt,{}),a.jsx("input",{value:u,"aria-label":c("sessionEnvironment.searchAria"),placeholder:c("sessionEnvironment.searchPlaceholder"),autoFocus:!0,onChange:C=>d(C.target.value)})]}),a.jsx("div",{className:"studio-tool-picker session-environment-picker",role:"group","aria-label":c("sessionEnvironment.availableAria"),children:r?a.jsx("div",{className:"studio-tool-empty",children:c("sessionEnvironment.loading")}):s?a.jsx("div",{className:"studio-tool-empty",children:s}):A.length===0&&E.length===0?a.jsx("div",{className:"studio-tool-empty",children:c("sessionEnvironment.noMatch")}):a.jsxs(a.Fragment,{children:[E.length>0&&a.jsxs("section",{className:"session-environment-picker__group","aria-labelledby":`${b}-workspaces`,children:[a.jsx("h3",{id:`${b}-workspaces`,children:c("sessionEnvironment.workspaces")}),E.map(C=>{const N=EN(C,v),P=y.has(C.id),I=N.length===0;return a.jsxs("label",{className:`studio-tool-option session-environment-option is-workspace${P?" is-selected":""}${I?" is-disabled":""}`,children:[a.jsx("span",{className:"studio-tool-option-icon",children:a.jsx(QIe,{})}),a.jsxs("span",{className:"studio-tool-option-copy",children:[a.jsx("strong",{children:C.name}),a.jsx("span",{children:C.description||c("sessionEnvironment.reuseAll")}),a.jsx("small",{children:c("sessionEnvironment.availableEnvironmentCount",{count:N.length})})]}),a.jsx("input",{type:"checkbox",checked:P,disabled:I,"aria-label":c("sessionEnvironment.selectWorkspace",{name:C.name}),onChange:()=>T(C)}),a.jsx("span",{className:"session-environment-check","aria-hidden":"true",children:a.jsx(Mee,{})})]},C.id)})]}),A.length>0&&a.jsxs("section",{className:"session-environment-picker__group","aria-labelledby":`${b}-environments`,children:[a.jsx("h3",{id:`${b}-environments`,children:c("sessionEnvironment.environments")}),A.map(C=>{const N=lE(C);if(!N)return null;const P=t.filter(_=>y.has(_.id)&&_.environmentIds.includes(C.id)),I=P.length>0,D=O.has(Oc(N));return a.jsxs("label",{className:`studio-tool-option session-environment-option${D?" is-selected":""}${I?" is-covered":""}`,children:[a.jsx("span",{className:"studio-tool-option-icon",children:a.jsx(PB,{})}),a.jsxs("span",{className:"studio-tool-option-copy",children:[a.jsx("strong",{children:C.name}),a.jsx("span",{children:I?c("sessionEnvironment.includedByWorkspaces",{names:P.map(_=>_.name).join(c("sessionEnvironment.nameSeparator"))}):C.description||Fp(C.language)}),a.jsxs("small",{children:[Fp(C.language)," · ",N.environment_version_id]})]}),a.jsx("input",{type:"checkbox",checked:D,disabled:I,"aria-label":c("sessionEnvironment.selectEnvironment",{name:C.name}),onChange:()=>j(C)}),a.jsx("span",{className:"session-environment-check","aria-hidden":"true",children:a.jsx(Mee,{})})]},Oc(N))})]})]})})]}),a.jsxs("footer",{className:"session-environment-dialog__footer",children:[a.jsx("span",{className:m?"is-error":"",role:m?"alert":void 0,children:m||c("sessionEnvironment.selectionSummary",{workspaces:c("sessionEnvironment.selectedWorkspaceCount",{count:y.size}),environments:c("sessionEnvironment.coveredEnvironmentCount",{count:O.size})})}),a.jsxs("div",{children:[a.jsx("button",{type:"button",disabled:f,onClick:l,children:c("sessionEnvironment.cancel")}),a.jsx("button",{type:"button",className:"is-primary",disabled:r||f||!!s,onClick:()=>void R(),children:c(f?"sessionEnvironment.mounting":"sessionEnvironment.confirm")})]})]})]})]}),document.body)}function Pmt({environments:e,workspaces:t,value:n,selectedWorkspaceIds:i,loading:r,disabled:s=!1,error:o="",onChange:l,onRefresh:c}){const{t:u}=_e("workspaceTools"),[d,f]=p.useState(!1),[h,m]=p.useState(!1),[g,b]=p.useState(""),v=p.useRef(null),y=p.useMemo(()=>new Map(e.flatMap(E=>{const j=lE(E);return j?[[Oc(j),E]]:[]})),[e]),w=p.useMemo(()=>new Map(e.map(E=>[E.id,E])),[e]),x=t.filter(E=>i.includes(E.id)),k=new Set(x.flatMap(E=>E.environmentIds)),S=n.filter(E=>!k.has(E.environment_id)),O=()=>{f(!1),requestAnimationFrame(()=>{var E;return(E=v.current)==null?void 0:E.focus()})},A=async(E,j)=>{if(l){m(!0),b("");try{await l(E,j)}catch(T){b(T instanceof Error?T.message:u("sessionEnvironment.mountFailed"))}finally{m(!1)}}};return a.jsxs("div",{className:"session-environment-select",children:[n.length>0&&a.jsxs("div",{className:"session-environment-list",role:"list","aria-label":u("sessionEnvironment.mountedAria"),children:[x.map(E=>{const j=new Set(EN(E,w).map(T=>T.environment_id));return a.jsxs("div",{className:"session-environment-item is-workspace",role:"listitem",children:[a.jsx("span",{className:"session-environment-item__icon",children:a.jsx(QIe,{})}),a.jsxs("span",{className:"session-environment-item__copy",children:[a.jsx("strong",{children:E.name}),a.jsx("small",{children:u("sessionEnvironment.environmentCount",{count:j.size})})]}),l&&a.jsx("button",{type:"button",className:"topo-remove-capability","aria-label":u("sessionEnvironment.removeWorkspace",{name:E.name}),title:u("sessionEnvironment.remove"),disabled:s||h,onClick:()=>{const T=i.filter(C=>C!==E.id),R=new Set(t.filter(C=>T.includes(C.id)).flatMap(C=>C.environmentIds));A(n.filter(C=>!j.has(C.environment_id)||R.has(C.environment_id)),T)},children:a.jsx(Dee,{})})]},`workspace:${E.id}`)}),S.map(E=>{const j=y.get(Oc(E));return a.jsxs("div",{className:"session-environment-item",role:"listitem",children:[a.jsx("span",{className:"session-environment-item__icon",children:a.jsx(PB,{})}),a.jsxs("span",{className:"session-environment-item__copy",children:[a.jsx("strong",{children:(j==null?void 0:j.name)??E.environment_id}),a.jsx("small",{children:j?Fp(j.language):E.environment_version_id})]}),l&&a.jsx("button",{type:"button",className:"topo-remove-capability","aria-label":u("sessionEnvironment.removeEnvironment",{name:(j==null?void 0:j.name)??E.environment_id}),title:u("sessionEnvironment.remove"),disabled:s||h,onClick:()=>void A(n.filter(T=>Oc(T)!==Oc(E)),[...i]),children:a.jsx(Dee,{})})]},Oc(E))})]}),l&&a.jsxs("button",{ref:v,type:"button",className:"topo-capability-add-slot","aria-label":u("sessionEnvironment.add"),disabled:s||r||h,onClick:()=>{b(""),f(!0),c==null||c()},children:[a.jsx(Rmt,{}),a.jsx("span",{children:n.length>0?u("sessionEnvironment.addMore"):u("sessionEnvironment.addForSession")})]}),g&&a.jsx("p",{className:"is-error",role:"alert",children:g}),(r||o||e.length===0)&&a.jsx("p",{className:o?"is-error":void 0,role:o?"alert":void 0,children:r?u("sessionEnvironment.loadingAvailable"):o||u("sessionEnvironment.empty")}),d&&a.jsx(Imt,{environments:e,workspaces:t,value:n,selectedWorkspaceIds:i,loading:r,error:o,onConfirm:(E,j)=>l==null?void 0:l(E,j),onClose:O})]})}function Dmt(e){return[...new Map(e.filter(t=>t.name.trim()).map(t=>[t.name.trim(),{...t,name:t.name.trim()}])).values()]}function o4({title:e,count:t}){const{t:n}=_e("workspaceTools");return a.jsxs("div",{className:"topo-module-title",children:[a.jsx("span",{className:"topo-module-label",title:e,children:e}),t!==void 0&&a.jsx("span",{className:"topo-section-count","aria-label":n("agentTopology.itemCount",{count:t}),children:t})]})}function Mmt({info:e,loading:t,boundSkills:n,onRefresh:i,onOpenSkill:r,variant:s="rail",selectedSessionSkills:o=[],onSessionSkillsChange:l,environments:c=[],workspaces:u=[],selectedEnvironments:d=[],selectedEnvironmentWorkspaceIds:f=[],environmentsLoading:h=!1,environmentsDisabled:m=!1,environmentsError:g="",onEnvironmentsChange:b,onEnvironmentsRefresh:v}){var R,C,N,P,I;const{t:y}=_e("workspaceTools"),[w,x]=p.useState(null);if(t&&!e)return a.jsx("aside",{className:`topo is-loading${s==="drawer"?" is-drawer":""}`,"aria-label":y("agentTopology.info"),"aria-live":"polite",children:a.jsx(on,{as:"span",className:"topo-loading-label",duration:2.2,children:y("agentTopology.loadingInfo")})});if(!e)return null;const k=fH(e.model),S=e.agentCategory==="mpa",O=((R=e.mpa)==null?void 0:R.agentsMdStatus)??"unsupported",A=S?((C=e.mpa)==null?void 0:C.agentsMd)??"":((N=e.graph)==null?void 0:N.instruction)??((P=e.draft)==null?void 0:P.instruction)??"",E=S?(n==null?void 0:n.skills)??[]:Dmt([...e.skills,...o.map(D=>({name:D.name,description:D.description??""}))]),j=n==null?void 0:n.error,T=j==="forbidden"?"accessDenied":j==="unsupported"?"skillsUnsupported":j==="degraded"?"skillsDegraded":"loadFailed";return a.jsx(a.Fragment,{children:a.jsxs("aside",{className:`topo${s==="drawer"?" is-drawer":""}`,"aria-label":y("agentTopology.infoAndTopology"),children:[a.jsxs("section",{className:"topo-agent-card","aria-label":y("agentTopology.info"),children:[a.jsxs("div",{className:"topo-agent-heading",children:[a.jsx("h2",{title:e.name,children:e.name||y("agentTopology.unnamedAgent")}),k&&a.jsx("span",{title:k,children:k})]}),e.description&&a.jsx("p",{className:"topo-description",title:e.description,children:e.description}),i&&a.jsx("button",{type:"button",className:"topo-refresh",onClick:i,disabled:t||(n==null?void 0:n.loading),children:y("agentTopology.refresh")})]}),a.jsxs("div",{className:"topo-module-stack",children:[a.jsxs("section",{className:"topo-module-card topo-agents-md-card","aria-label":y("agentTopology.agentsMd"),children:[a.jsx(o4,{title:y("agentTopology.agentsMd")}),a.jsx("div",{className:"topo-module-scroll topo-agents-md-scroll",role:"region","aria-label":y("agentTopology.agentsMd"),tabIndex:0,children:S&&O!=="ready"?a.jsx("div",{className:"topo-data-error",role:"status",children:y(`agentTopology.${O==="forbidden"?"accessDenied":O==="unsupported"?"documentUnsupported":"loadFailed"}`)}):A.trim()?a.jsx("pre",{className:"topo-agents-md-content",children:A}):a.jsx("div",{className:"topo-empty",children:y("agentTopology.notConfigured")})})]}),a.jsxs("section",{className:"topo-module-card topo-skills-card","aria-label":y("agentTopology.skills"),children:[a.jsx(o4,{title:y("agentTopology.skills"),count:S?n!=null&&n.complete?E.length:void 0:e.skillsPreviewSupported?E.length:void 0}),a.jsxs("div",{className:"topo-module-scroll topo-skills-scroll",role:"region","aria-label":y("agentTopology.skillList"),tabIndex:0,children:[S&&(n!=null&&n.loading)&&!E.length?a.jsx(on,{as:"span",children:y("agentTopology.loadingSkills")}):!S&&!e.skillsPreviewSupported?a.jsx("div",{className:"topo-empty",children:y("agentTopology.previewUnsupported")}):E.length>0?a.jsx("div",{className:"topo-skill-list",children:E.map((D,_)=>{var L;return a.jsxs("div",{className:"topo-skill",title:D.description||D.name,children:[a.jsx("div",{className:"topo-skill-title",children:S&&r&&((L=n==null?void 0:n.skills[_])!=null&&L.skillId)&&!n.skills[_].lookupByName?a.jsx("button",{type:"button",className:"topo-skill-name topo-skill-open",onClick:()=>r(_),children:D.name}):a.jsx("span",{className:"topo-skill-name",children:D.name})}),D.description&&a.jsx("span",{className:"topo-skill-description",children:D.description})]},`${D.name}:${D.description}:${_}`)})}):j?null:a.jsx("div",{className:"topo-empty",children:y(S?(I=e.mpa)!=null&&I.skillSpaces.length?"agentTopology.noBoundSkills":"agentTopology.noBoundSpace":"agentTopology.notConfigured")}),j&&a.jsx("div",{className:"topo-data-error",role:"status",children:y(`agentTopology.${T}`)}),S&&(n==null?void 0:n.loading)&&E.length>0&&a.jsx("span",{role:"status",children:y("agentTopology.loadingSkills")})]}),!S&&l&&a.jsx("div",{className:"topo-capability-add-dock",children:a.jsxs("button",{type:"button",className:"topo-capability-add-slot","aria-label":y("agentTopology.addSkill"),disabled:m,onClick:()=>x("skill"),children:[a.jsx("span",{"aria-hidden":"true",children:"+"}),a.jsx("span",{children:y("agentTopology.addSkillHere")})]})})]}),(b||d.length>0)&&a.jsxs("section",{className:"topo-module-card topo-environment-card","aria-label":y("agentTopology.sessionEnvironment"),children:[a.jsx(o4,{title:y("agentTopology.environment"),count:d.length}),a.jsx(Pmt,{environments:c,workspaces:u,value:d,selectedWorkspaceIds:f,loading:h,disabled:m,error:g,onChange:b,onRefresh:v})]})]}),w==="skill"&&l&&vi.createPortal(a.jsxs("div",{className:"studio-tool-dialog-layer",children:[a.jsx("button",{type:"button",className:"studio-tool-dialog-scrim","aria-label":y("agentTopology.close"),onClick:()=>x(null)}),a.jsxs("section",{className:"studio-tool-dialog",role:"dialog","aria-modal":"true",children:[a.jsxs("header",{className:"studio-tool-dialog-head is-iconless",children:[a.jsxs("div",{children:[a.jsx("h2",{children:y("agentTopology.addSkill")}),a.jsx("p",{children:y("agentTopology.skillMountNextTurn")})]}),a.jsx("button",{type:"button",className:"studio-tool-dialog-close","aria-label":y("agentTopology.close"),onClick:()=>x(null),children:a.jsx(Bo,{"aria-hidden":"true"})})]}),a.jsx("div",{className:"studio-tool-dialog-body",children:a.jsx(NIe,{selected:[...o],onChange:l})})]})]}),document.body)]})})}function Lmt(e){var i;if(((i=e.info)==null?void 0:i.agentCategory)!=="mpa")return null;const t=e.info.mpa,n=JSON.stringify([t==null?void 0:t.skillSpacesStatus,t==null?void 0:t.skillSpaces]);return a.jsx($mt,{...e,info:e.info},n)}function $mt(e){const[t,n]=p.useState(null),[i,r]=p.useState(0),[s,o]=p.useState({skills:[],loading:!0,complete:!1}),l=e.info.mpa;return p.useEffect(()=>{const c=new AbortController;if((l==null?void 0:l.skillSpacesStatus)!=="ready")return o({skills:[],loading:!1,complete:!1,error:(l==null?void 0:l.skillSpacesStatus)??"unsupported"}),()=>c.abort();o(d=>({...d,loading:!0,error:void 0}));const u=new Map;return(async()=>{let d=!1;for(const f of l.skillSpaces){let h=0;for(let m=1;;m++){if(m>100)throw new Error("Skill pagination limit reached");const g=await TIe(f.id,{region:f.region,page:m,pageSize:100,signal:c.signal});if(c.signal.aborted)return;if(!Array.isArray(g.items)||!Number.isInteger(g.totalCount)||g.totalCount<0)throw new Error("Invalid SkillSpace page");const b=u.size;for(const v of g.items){if(typeof v.skillName!="string"||!v.skillName.trim())throw new Error("Invalid skill name");u.set(`${f.region}:${f.id}:${v.skillId||v.skillName}`,{spaceId:f.id,region:f.region,skillId:v.skillId,version:v.version,lookupByName:v.lookupByName,name:v.skillName,description:v.skillDescription||""})}if(h+=g.items.length,d||(d=g.degraded===!0),o({skills:[...u.values()],loading:!0,complete:!1}),h>=g.totalCount)break;if(!g.items.length||u.size===b)throw new Error("Skill pagination made no progress")}}c.signal.aborted||o({skills:[...u.values()],loading:!1,complete:!d,error:d?"degraded":void 0})})().catch(d=>{if(c.signal.aborted)return;const f=d instanceof i1&&[401,403].includes(d.status);o(h=>({skills:f?[]:u.size?[...u.values()]:h.skills,loading:!1,complete:!1,error:f?"forbidden":"error"}))}),()=>c.abort()},[l,i]),a.jsxs(a.Fragment,{children:[a.jsx(Mmt,{...e,boundSkills:s,onOpenSkill:c=>n(s.skills[c]),onRefresh:()=>{e.onRefresh?e.onRefresh():r(c=>c+1)}}),t&&a.jsx(Ypt,{target:t,onClose:()=>n(null),onSaved:()=>r(c=>c+1)})]})}const cT={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};function Lee(e){return a.jsxs("svg",{...cT,...e,children:[a.jsx("rect",{x:"3.75",y:"5.25",width:"16.5",height:"13.5",rx:"2"}),a.jsx("path",{d:"m10.25 9 4.8 3-4.8 3V9Z"})]})}function Fmt(e){return a.jsxs("svg",{...cT,...e,children:[a.jsx("path",{d:"M12 3.75v10.5M8.4 10.8 12 14.4l3.6-3.6"}),a.jsx("path",{d:"M5 17.25v2h14v-2"})]})}function Bmt(e){return a.jsxs("svg",{...cT,...e,children:[a.jsx("path",{d:"M8.75 8.75 6.9 10.6a3.4 3.4 0 0 0 4.8 4.8l1.85-1.85"}),a.jsx("path",{d:"m15.25 15.25 1.85-1.85a3.4 3.4 0 0 0-4.8-4.8l-1.85 1.85"}),a.jsx("path",{d:"m9.4 14.6 5.2-5.2"})]})}function vI(e){return a.jsxs("svg",{...cT,...e,children:[a.jsx("path",{d:"M5 19h3.2L18.6 8.6a1.7 1.7 0 0 0 0-2.4l-.8-.8a1.7 1.7 0 0 0-2.4 0L5 15.8V19Z"}),a.jsx("path",{d:"m13.9 6.9 3.2 3.2M5 15.8 8.2 19"})]})}function zIe(e){return a.jsx("svg",{...cT,...e,children:a.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}const Umt=180,$ee=500,l4=10,Fee=32;function Qmt(e){return Array.from(new Set(e.split(/[,,]/).map(t=>t.trim()).filter(Boolean)))}function zmt({artifact:e,busy:t,error:n,onClose:i,onSave:r}){const{t:s}=_e("workspaceTools"),[o,l]=p.useState(e.name),[c,u]=p.useState(e.description??""),[d,f]=p.useState((e.tags??[]).join(",")),[h,m]=p.useState(""),g=p.useId(),b=p.useId(),v=p.useRef(null),y=p.useRef(null),w=p.useRef(t),x=p.useRef(i);p.useEffect(()=>{w.current=t,x.current=i},[t,i]),p.useEffect(()=>{var j,T;const O=document.body.style.overflow,A=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(j=y.current)==null||j.focus(),(T=y.current)==null||T.select();const E=R=>{if(R.key==="Escape"&&!w.current){R.preventDefault(),x.current();return}if(R.key!=="Tab")return;const C=v.current;if(!C)return;const N=Array.from(C.querySelectorAll('button:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')).filter(D=>D.getClientRects().length>0);if(N.length===0){R.preventDefault();return}const P=N[0],I=N[N.length-1];R.shiftKey&&document.activeElement===P?(R.preventDefault(),I.focus()):!R.shiftKey&&document.activeElement===I&&(R.preventDefault(),P.focus())};return window.addEventListener("keydown",E),()=>{window.removeEventListener("keydown",E),document.body.style.overflow=O,A!=null&&A.isConnected&&A.focus()}},[]);const k=O=>{var j;O.preventDefault();const A=o.trim(),E=Qmt(d);if(!A){m(s("artifactEdit.nameRequired")),(j=y.current)==null||j.focus();return}if(E.length>l4){m(s("artifactEdit.tooManyTags",{max:l4}));return}if(E.some(T=>T.length>Fee)){m(s("artifactEdit.tagTooLong",{max:Fee}));return}m(""),r({name:A,description:c.trim(),tags:E})},S=h||n;return vi.createPortal(a.jsx("div",{className:"artifact-edit-backdrop",onMouseDown:O=>{O.target===O.currentTarget&&!t&&i()},children:a.jsxs("section",{ref:v,className:"artifact-edit-dialog",role:"dialog","aria-modal":"true","aria-labelledby":g,"aria-describedby":b,"aria-busy":t||void 0,children:[a.jsxs("header",{className:"artifact-edit-dialog__header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:g,children:s("artifactEdit.title")}),a.jsx("p",{id:b,children:s("artifactEdit.subtitle")})]}),a.jsx("button",{type:"button",onClick:i,disabled:t,"aria-label":s("artifactEdit.close"),children:a.jsx(zIe,{})})]}),a.jsxs("form",{onSubmit:k,children:[a.jsxs("div",{className:"artifact-edit-dialog__body",children:[a.jsxs("label",{className:"artifact-edit-field",children:[a.jsx("span",{children:s("artifactEdit.name")}),a.jsx("input",{ref:y,value:o,maxLength:Umt,disabled:t,"aria-invalid":!!S||void 0,onChange:O=>{l(O.target.value),m("")}})]}),a.jsxs("label",{className:"artifact-edit-field",children:[a.jsx("span",{children:s("artifactEdit.description")}),a.jsx("textarea",{value:c,maxLength:$ee,disabled:t,rows:4,placeholder:s("artifactEdit.descriptionPlaceholder"),onChange:O=>u(O.target.value)}),a.jsxs("small",{children:[c.length,"/",$ee]})]}),a.jsxs("label",{className:"artifact-edit-field",children:[a.jsx("span",{children:s("artifactEdit.tags")}),a.jsx("input",{value:d,disabled:t,placeholder:s("artifactEdit.tagsPlaceholder",{max:l4}),onChange:O=>{f(O.target.value),m("")}})]}),S?a.jsx("div",{className:"artifact-edit-error",role:"alert",children:S}):null]}),a.jsxs("footer",{className:"artifact-edit-dialog__actions",children:[a.jsx("button",{type:"button",onClick:i,disabled:t,children:s("artifactEdit.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:t,children:s(t?"artifactEdit.saving":"artifactEdit.save")})]})]})]})}),document.body)}function VIe({label:e,menuLabel:t,items:n,placement:i="bottom-end"}){return a.jsxs(rr,{children:[a.jsx(rr.Trigger,{children:a.jsx(At,{type:"button",color:"secondary",variant:"ghost",size:"md",iconSize:"sm",uniform:!0,"aria-label":e,title:e,disabled:n.length===0,children:a.jsx(iat,{"aria-hidden":"true"})})}),a.jsxs(rr.Content,{side:i==="top-end"?"top":"bottom",align:"end",minWidth:148,children:[a.jsx("span",{className:"sr-only",children:t}),n.map(r=>a.jsx(rr.Item,{disabled:r.disabled,onSelect:r.onSelect,children:a.jsx("span",{title:r.title,children:r.label})},r.label))]})]})}const Vmt="_Alert_1tr02_1",Hmt="_Content_1tr02_145",qmt="_Indicator_1tr02_156",Wmt="_Message_1tr02_159",Kmt="_Title_1tr02_162",Gmt="_Description_1tr02_168",Xmt="_Actions_1tr02_173",qb={Alert:Vmt,Content:Hmt,Indicator:qmt,Message:Wmt,Title:Kmt,Description:Gmt,Actions:Xmt},vh=({color:e="primary",variant:t="outline",title:n,description:i,actions:r,actionsPlacement:s,indicator:o,className:l,actionsClassName:c,ref:u,...d})=>{const f=p.useRef(null),h=p.useRef(null),[m,g]=p.useState("end"),{width:b}=aNe({ref:f});return p.useEffect(()=>{var y;const v=((y=h.current)==null?void 0:y.clientWidth)??0;if(v&&b){const w=v>b/3?"bottom":"end";g(w)}},[b]),a.jsxs("div",{ref:rT([u,f]),className:qi(qb.Alert,l),"data-variant":t,"data-color":e,role:e==="danger"?"alert":void 0,"data-actions-placement":s??m,...d,children:[o===!1?null:a.jsx("div",{className:qb.Indicator,children:o??a.jsx(Ymt,{color:e})}),a.jsxs("div",{className:qb.Content,children:[a.jsxs("div",{className:qb.Message,children:[n&&a.jsx("div",{className:qb.Title,children:n}),i&&a.jsx("div",{className:qb.Description,children:i})]}),r&&a.jsx("div",{className:qi(qb.Actions,c),ref:h,children:r})]})]})},Ymt=({color:e})=>{switch(e){case"warning":case"caution":case"danger":return a.jsx(Lje,{});case"success":return a.jsx(Rje,{});default:return a.jsx(Pje,{})}};function _d({title:e,description:t,error:n,confirmLabel:i,cancelLabel:r,closeLabel:s,variant:o="warning",busy:l=!1,confirmDisabled:c=!1,onCancel:u,onConfirm:d}){const{t:f}=_e("shell"),h=r??f("confirm.cancel"),m=s??f("confirm.close"),g=p.useId(),b=p.useId(),v=p.useRef(null),y=p.useRef(l),w=p.useRef(u);return p.useEffect(()=>{y.current=l,w.current=u},[l,u]),p.useEffect(()=>{var O;const x=document.body.style.overflow,k=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(O=v.current)==null||O.focus();const S=A=>{A.key==="Escape"&&!y.current&&w.current()};return window.addEventListener("keydown",S),()=>{document.body.style.overflow=x,window.removeEventListener("keydown",S),k!=null&&k.isConnected&&k.focus()}},[]),vi.createPortal(a.jsx("div",{className:"studio-confirm-backdrop",onMouseDown:x=>{x.target===x.currentTarget&&!l&&u()},children:a.jsxs("section",{className:`studio-confirm-dialog studio-confirm-dialog--${o}`,role:"alertdialog","aria-modal":"true","aria-labelledby":g,"aria-describedby":b,"aria-busy":l||void 0,children:[a.jsxs("header",{className:"studio-confirm-head",children:[a.jsxs("div",{className:"studio-confirm-title-wrap",children:[a.jsx("span",{className:"studio-confirm-title-icon","aria-hidden":"true",children:a.jsx(Lje,{})}),a.jsx("h2",{id:g,children:e})]}),a.jsx(At,{type:"button",className:"studio-confirm-close",color:"secondary",variant:"ghost",size:"lg",uniform:!0,pill:!1,onClick:u,disabled:l,"aria-label":m,children:a.jsx(mV,{})})]}),a.jsxs("div",{className:"studio-confirm-body",children:[a.jsx("div",{id:b,children:t}),n?a.jsx(vh,{className:"studio-confirm-error",color:"danger",variant:"soft",description:n}):null]}),a.jsxs("footer",{className:"studio-confirm-actions",children:[a.jsx(At,{ref:v,type:"button",color:"secondary",variant:"ghost",size:"lg",pill:!1,onClick:u,disabled:l,children:h}),a.jsx(At,{type:"button",className:"studio-confirm-primary",color:o==="danger"?"danger":"primary",size:"lg",pill:!1,loading:l,onClick:d,disabled:l||c,children:i})]})]})}),document.body)}const Zmt="_Container_1a6nz_1",Jmt="_Input_1a6nz_229",Bee={Container:Zmt,Input:Jmt},js=e=>{const t=p.useRef(null),i=`search-ui-input-${p.useId()}`,{id:r,name:s,type:o="text",variant:l="outline",size:c="md",gutterSize:u,className:d,autoComplete:f,disabled:h=!1,readOnly:m=!1,invalid:g=!1,allowAutofillExtensions:b=o==="password"||!!s||!!f&&f!=="off",onFocus:v,onBlur:y,onAnimationStart:w,onAutofill:x,autoSelect:k,startAdornment:S,endAdornment:O,pill:A,opticallyAlign:E,ref:j,...T}=e,R=I=>{const D=t.current;if(!I.target||!(I.target instanceof Element)||!D||D.contains(I.target)||I.target.closest("button, [type='button'], [role='button'], [role='menuitem']"))return;I.preventDefault(),document.activeElement!==D&&D.focus();const{left:_,top:L}=D.getBoundingClientRect(),{clientX:F,clientY:M}=I,H=M{var I;k&&((I=t.current)==null||I.select())},[k]);const P=I=>{w==null||w(I),I.animationName==="native-autofill-in"&&(x==null||x())};return a.jsxs("div",{className:qi(Bee.Container,d),"data-variant":l,"data-size":c,"data-gutter-size":u,"data-focused":C,"data-disabled":h?"":void 0,"data-readonly":m?"":void 0,"data-invalid":g?"":void 0,"data-pill":A?"":void 0,"data-optically-align":E,"data-has-start-adornment":S?"":void 0,"data-has-end-adornment":O?"":void 0,onMouseDown:R,children:[S,a.jsx("input",{...T,ref:rT([j,t]),id:r||(b?void 0:i),className:Bee.Input,type:o,name:s,autoComplete:f,readOnly:m,disabled:h,onFocus:I=>{N(!0),v==null||v(I)},onBlur:I=>{N(!1),y==null||y(I)},onAnimationStart:P,"data-lpignore":b?void 0:!0,"data-1p-ignore":b?void 0:!0}),O]})},egt="_SelectControl_1tyi7_1",tgt="_Clear_1tyi7_436",ngt="_DropdownIcon_1tyi7_437",igt="_TriggerText_1tyi7_468",rgt="_IndicatorWrapper_1tyi7_476",sgt="_StartIcon_1tyi7_482",agt="_DropdownIconChevron_1tyi7_534",ogt="_LoadingIndicator_1tyi7_537",bp={SelectControl:egt,Clear:tgt,DropdownIcon:ngt,TriggerText:igt,IndicatorWrapper:rgt,StartIcon:sgt,DropdownIconChevron:agt,LoadingIndicator:ogt},lgt=({ref:e,onPointerDown:t,onKeyDown:n,onPointerEnter:i,onInteract:r,invalid:s,disabled:o,children:l,className:c,variant:u="outline",size:d="md",block:f,opticallyAlign:h,pill:m=!0,loading:g,onClearClick:b,selected:v=!1,StartIcon:y,dropdownIconType:w="dropdown",...x})=>{const k=p.useRef(null),O=!!b&&v&&!g&&!o,A=w&&w!=="none"&&!g,E=O||g||A,j=!g&&!o,T=C=>{var N;switch(C.key){case"ArrowDown":case"ArrowUp":case" ":C.stopPropagation(),C.preventDefault(),r?r():(N=k.current)==null||N.dispatchEvent(new PointerEvent("pointerdown",{bubbles:!0,cancelable:!0,pointerType:"mouse"}));break;case"Enter":break;default:n==null||n(C)}},R=C=>{var N;C.button!==2&&(C.stopPropagation(),r?(C.preventDefault(),r()):(t==null||t(C),(N=x.onClick)==null||N.call(x,C)))};return a.jsxs("span",{ref:rT([k,e]),className:qi(bp.SelectControl,c),role:"button",tabIndex:o?-1:0,onPointerEnter:C=>{SV(C),i==null||i(C)},onPointerDown:j?R:void 0,onKeyDown:j?T:void 0,"data-variant":u,"data-block":f?"":void 0,"data-pill":m?"":void 0,"data-size":d,"data-optically-align":h,"aria-busy":g?"true":void 0,"data-selected":v,"data-loading":g?"":void 0,"data-invalid":s?"":void 0,"data-disabled":o?"":void 0,"aria-disabled":o,...x,onClick:void 0,children:[y&&a.jsx(y,{className:bp.StartIcon}),a.jsx("span",{className:bp.TriggerText,children:l}),E&&a.jsxs("div",{className:bp.IndicatorWrapper,children:[O&&a.jsx(At,{"aria-label":"Clear current value",className:bp.Clear,onPointerDown:C=>{C.stopPropagation()},onClick:C=>{C.stopPropagation(),C.preventDefault(),b()},color:"secondary",variant:A?"ghost":"solid",size:"3xs",uniform:!0,pill:m,"data-only-child":A?void 0:"",children:a.jsx(mV,{})}),g&&a.jsx(YA,{className:bp.LoadingIndicator}),A&&a.jsx(cgt,{iconType:w})]})]})},cgt=({iconType:e})=>e==="chevronDown"?a.jsx(Zst,{className:qi(bp.DropdownIcon,bp.DropdownIconChevron)}):a.jsx(rat,{className:bp.DropdownIcon}),ugt="_Menu_n4tw6_3",dgt="_MenuList_n4tw6_5",fgt="_MenuInner_n4tw6_50",hgt="_OptionsList_n4tw6_64",pgt="_Option_n4tw6_64",mgt="_PressableInner_n4tw6_111",ggt="_OptionInner_n4tw6_113",bgt="_OptionCheck_n4tw6_118",ygt="_OptionIndicatorSlot_n4tw6_123",vgt="_OptionGroupHeading_n4tw6_128",xgt="_OptionHardLimitHeading_n4tw6_140",wgt="_OptionsLimit_n4tw6_147",kgt="_Action_n4tw6_152",Ogt="_ActionInner_n4tw6_218",Sgt="_ActionsContainer_n4tw6_224",Egt="_Search_n4tw6_244",Cgt="_SearchEmpty_n4tw6_247",ks={Menu:ugt,MenuList:dgt,MenuInner:fgt,OptionsList:hgt,Option:pgt,PressableInner:mgt,OptionInner:ggt,OptionCheck:bgt,OptionIndicatorSlot:ygt,OptionGroupHeading:vgt,OptionHardLimitHeading:xgt,OptionsLimit:wgt,Action:kgt,ActionInner:Ogt,ActionsContainer:Sgt,Search:Egt,SearchEmpty:Cgt},HIe=p.createContext(null),Eb=()=>{const e=p.use(HIe);if(!e)throw new Error("Select components must be wrapped in ");return e},Tgt=({label:e})=>a.jsx(a.Fragment,{children:e}),_gt=({label:e})=>a.jsx(a.Fragment,{children:e}),jgt=({values:e,selectedAll:t})=>{const n=t?"All selected":e.length===0?"Select...":e.length===1?e[0].label:`${e.length} selected`;return a.jsx(a.Fragment,{children:n})},ma=e=>{const{id:t,required:n,value:i,name:r,multiple:s,variant:o="outline",size:l="md",dropdownIconType:c="dropdown",loading:u=!1,clearable:d=!1,disabled:f=!1,placeholder:h="Select...",loadingPlaceholder:m="Loading...",pill:g=!0,listWidth:b,options:v,actions:y=[],side:w="bottom",avoidCollisions:x=!0,onChange:k,optionClassName:S,OptionView:O=Tgt,TriggerStartIcon:A,triggerClassName:E,opticallyAlign:j,TriggerView:T,searchPlaceholder:R="",searchPredicate:C=Qgt,searchEmptyMessage:N="No results found.",listMaxWidth:P="auto"}=e,I=e.block??o!=="ghost",D=e.align??(I?"center":"start"),_=e.alignOffset??(D==="center"?0:-5),L=e.listMinWidth??(I?"auto":300),F=nb((ce,V)=>{if(s){if(!ce.value){k([]);return}if(V){const Y=i.filter(de=>de!==ce.value),K=DB(v,Y);k(K)}else{const Y=DB(v,i);k(Y.concat(ce))}}else k(ce)}),M=p.useRef(C);M.current=C;const H=p.useMemo(()=>y,[y.length]),q=p.useRef(y);q.current=y;const U=p.useCallback(ce=>{var V;(V=q.current.find(Y=>Y.id===ce))==null||V.onSelect(ce)},[]),Z=p.useMemo(()=>bH(v)?v.reduce((ce,V)=>ce+V.options.length,0):v.length,[v]),J=`select-trigger-${p.useId()}`,ne=Z>15,W=p.useMemo(()=>s?{multiple:!0,value:i,TriggerView:T??jgt}:{multiple:!1,value:i,TriggerView:T??_gt},[s,i,T]),X=p.useMemo(()=>({...W,triggerId:J,id:t,name:r,required:n,options:v,placeholder:h,loadingPlaceholder:m,loading:u,clearable:d,variant:o,pill:g,size:l,dropdownIconType:c,block:I,align:D,alignOffset:_,side:w,avoidCollisions:x,listWidth:b,listMinWidth:L,listMaxWidth:P,searchPlaceholder:R,searchEmptyMessage:N,TriggerStartIcon:A,triggerClassName:E,opticallyAlign:j,optionClassName:S,OptionView:O,actions:H,onActionSelect:U,onSelectRef:F,searchPredicateRef:M,searchable:ne,disabled:f}),[W,J,t,n,r,v,h,m,u,d,o,g,l,c,I,D,_,w,x,b,L,P,R,N,A,E,j,S,O,H,U,F,ne,f]);return a.jsx(qIe.Provider,{value:X,children:a.jsx(Rgt,{})})},Ngt=e=>{const{triggerId:t,id:n,required:i,value:r,multiple:s,options:o,loading:l,disabled:c,clearable:u,name:d,variant:f,pill:h,size:m,dropdownIconType:g,placeholder:b,loadingPlaceholder:v,block:y,opticallyAlign:w,triggerClassName:x,TriggerStartIcon:k,TriggerView:S,onSelectRef:O}=Eb(),{onOpenChange:A,...E}=e,j=s?r[0]:r,T=l?v:b,R=p.useMemo(()=>Vgt(o,j)||{value:"",label:T},[j,o,T]),C=s?r.length>0:!!r,N=l||!C,P=p.useMemo(()=>ZIe(),[]),I=p.useMemo(()=>{if(!s)return{values:[],selectedAll:!1};const L=DB(o,r),F=o.flatMap(M=>"options"in M?M.options:M);return{values:L.length?L:[{value:"",label:T}],selectedAll:F.length<=r.length}},[s,o,r,T]),D=L=>{const F=L.key;if(!s&&JIe(F)){const M=P(F);L.stopPropagation();const H=ePe(o,M,j);H&&O.current(H)}},_=()=>{O.current({value:"",label:""}),A==null||A(!1)};return a.jsxs(cgt,{id:t,className:x,selected:!N,variant:f,pill:h,block:y,size:m,disabled:c,loading:l,StartIcon:k,opticallyAlign:w,dropdownIconType:g,onClearClick:u?_:void 0,onInteract:A,onKeyDown:D,...E,children:[s?a.jsx(S,{...I}):a.jsx(S,{...R}),(d||n)&&a.jsx("input",{id:n,name:d,value:j,tabIndex:-1,onFocus:()=>{var L;(L=document.getElementById(t))==null||L.focus()},onChange:()=>{},required:i,className:"sr-only w-full h-0 left-0 bottom-0 pointer-events-none","aria-hidden":"true"})]})},Rgt=()=>{const{triggerId:e,loading:t,side:n,align:i,alignOffset:r,avoidCollisions:s,listWidth:o,listMinWidth:l,listMaxWidth:c}=Eb(),[u,d]=p.useState(!1),f=p.useRef(null),h=m=>{const g=m===void 0?!u:m;d(g),g||setTimeout(()=>{var v;if(!f.current)return;const b=document.activeElement;b&&!f.current.contains(b)||(v=document.getElementById(e))==null||v.focus()})};return iT(u,()=>{h(!1)}),a.jsxs($Re,{open:u,onOpenChange:m=>{t&&m||h(m)},modal:!1,children:[a.jsx(FRe,{asChild:!0,children:a.jsx(Ngt,{onOpenChange:h})}),a.jsx(BRe,{forceMount:!0,children:a.jsx(ek,{className:ks.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:u&&a.jsx(URe,{ref:f,forceMount:!0,className:ks.MenuList,side:n,sideOffset:5,align:i,alignOffset:r,avoidCollisions:s,collisionPadding:{bottom:30,top:30},onOpenAutoFocus:Lp,onCloseAutoFocus:Lp,onEscapeKeyDown:Lp,style:Fv({"select-list-width":o,"select-list-min-width":l,"select-list-max-width":c}),children:a.jsx(Igt,{onOpenChange:h})},"dropdown")})})]})},WIe=p.createContext(null),ik=()=>{const e=p.use(WIe);if(!e)throw new Error("CustomSelectMenu components must be wrapped in ");return e},Igt=({onOpenChange:e})=>{const{multiple:t,value:n,options:i,searchable:r,searchPredicateRef:s}=Eb(),o=p.useRef(()=>e(!1)),l=p.useRef(null),c=p.useRef(null),u=p.useRef(null),[d,f]=p.useState(""),[h,m]=p.useState(()=>{var j;return((t?n[0]:n)||((j=g_(i))==null?void 0:j.value))??""}),g=p.useMemo(()=>ZIe(),[]),v=`select-list-${p.useId()}`,y=p.useRef(t?"":n),w=p.useMemo(()=>d.trim().toLocaleLowerCase(),[d]),x=p.useMemo(()=>zgt(i,w,s.current),[i,w,s]),k=p.useMemo(()=>g_(x),[x]),S=p.useRef(!1),O=E=>{const j=E.key,T=t?n[0]:n,R=h||(k==null?void 0:k.value)||T,C=document.activeElement===u.current,N=l.current;if(!N)return;const P=()=>{const _=new PointerEvent("pointerup",{bubbles:!0,cancelable:!0,pointerType:"mouse"}),L=mp(h,N);L==null||L.dispatchEvent(_)},I=(_,L)=>{m(_),L.scrollIntoView({block:"nearest"})},D=()=>{const _=t?n[0]:n;if(_){const F=mp(_,N);if(F){I(_,F);return}}const L=g_(i);if(L){const F=mp(L.value,N);F&&I(L.value,F)}};switch(j){case"ArrowDown":{if(E.preventDefault(),!h||!mp(h,N)){D();return}const _=Hgt(h,N),L=_==null?void 0:_.getAttribute("data-option-id");_&&L&&I(L,_);return}case"ArrowUp":{if(E.preventDefault(),!h||!mp(h,N)){D();return}const _=qgt(R,N),L=_==null?void 0:_.getAttribute("data-option-id");_&&L&&I(L,_);return}case"Enter":E.preventDefault(),P();return;case" ":if(w&&C)return;E.preventDefault(),P();return}if(JIe(j)){if(C)return;const _=g(j);E.stopPropagation();const L=ePe(i,_,h);if(L){const F=mp(L.value,N);F&&(m(L.value),F.scrollIntoView({block:"nearest"}))}}},A=p.useMemo(()=>({valueRef:y,listId:v,highlightedValue:h,setHighlightedValue:m,requestCloseRef:o,searchTerm:d,setSearchTerm:f,searchInputRef:u,listRef:c}),[v,h,m,d,f]);return p.useEffect(()=>{hI(()=>{if(!l.current)return;const j=mp(h,l.current);j==null||j.scrollIntoView({block:"center"})});const E=u.current||l.current;return E==null||E.focus({preventScroll:!0}),()=>{S.current=!1}},[]),p.useLayoutEffect(()=>{if(!S.current){S.current=!0;return}if(!c.current)return;c.current.scrollTop=0;const E=g_(x);E&&m(E.value)},[x]),a.jsx(WIe,{value:A,children:a.jsxs("div",{id:v,className:ks.MenuInner,onKeyDown:O,ref:l,tabIndex:0,children:[r&&a.jsx(Pgt,{value:d,onChange:f}),a.jsx(Dgt,{filteredOptions:x}),a.jsx(Bgt,{})]})})},Pgt=({value:e,onChange:t})=>{const{searchPlaceholder:n}=Eb(),{listId:i,searchInputRef:r}=ik(),s=o=>{t(o.target.value)};return a.jsx("div",{className:ks.Search,children:a.jsx(js,{startAdornment:a.jsx(mat,{width:16,height:16,className:"fill-secondary"}),ref:r,value:e,placeholder:n,onChange:s,autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-controls":i,"aria-expanded":!0})})},uT=e=>"options"in e,bH=e=>e[0]&&uT(e[0]),hw=300,Dgt=({filteredOptions:e})=>{const{searchEmptyMessage:t}=Eb(),{listRef:n}=ik();if(!e.length)return typeof t=="string"?a.jsx("p",{className:ks.SearchEmpty,"data-text-only":!0,children:t}):a.jsx("div",{className:ks.SearchEmpty,children:t});const i=bH(e),r=!i&&e.length>hw,s=i?e.map(o=>a.jsx(Lgt,{...o},o.label)):e.slice(0,hw).map(o=>a.jsx(GIe,{...o},o.value));return a.jsxs("div",{className:ks.OptionsList,ref:n,children:[s,r&&a.jsx(KIe,{numHidden:e.length-hw})]})},Mgt={limit:100,label:"Show all"},Lgt=({label:e,options:t,optionsLimit:n=Mgt})=>{const i=p.useId(),{searchTerm:r,setHighlightedValue:s}=ik(),[o,l]=p.useState(!1),c=n.limit{l(!0),s(t[n.limit].value)};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:ks.OptionGroupHeading,children:[a.jsx("div",{className:ks.OptionIndicatorSlot}),e]}),d.map(h=>a.jsx(GIe,{...h},h.value)),c&&a.jsx($gt,{value:`group-limit-${i}`,label:n.label,onPointerUp:f}),u&&a.jsx(KIe,{numHidden:t.length-hw})]})},KIe=({numHidden:e})=>a.jsxs("div",{className:ks.OptionHardLimitHeading,children:[a.jsx("div",{className:ks.OptionIndicatorSlot}),`…and ${e.toLocaleString()} more options. Use search to refine results further.`]}),$gt=({value:e,label:t,onPointerUp:n})=>{const{highlightedValue:i,setHighlightedValue:r}=ik(),s=e===i,o=()=>{s||r(e)},l=()=>{r(c=>c!==e?c:"")};return a.jsx("div",{className:qi(ks.Option,ks.OptionsLimit),"data-option-id":e,"data-highlight":s?"":void 0,role:"option","aria-selected":s,onPointerUp:n,onPointerMove:o,onPointerLeave:l,children:a.jsxs("div",{className:qi(ks.PressableInner,ks.OptionInner),children:[a.jsx("div",{className:ks.OptionIndicatorSlot}),t]})})},Fgt="data-option-id",GIe=e=>{const{optionClassName:t,OptionView:n,value:i,multiple:r,onSelectRef:s}=Eb(),{valueRef:o,requestCloseRef:l,highlightedValue:c,setHighlightedValue:u}=ik(),{value:d,disabled:f,tooltip:h}=e,m=o.current,g=r?i.includes(d):d===m,b=d===c,v=()=>{var x;r?s.current(e,g):(s.current(e),(x=l.current)==null||x.call(l))},y=()=>{b||u(d)},w=()=>{u(x=>x!==d?x:"")};return a.jsx("div",{className:qi(ks.Option,t),"data-highlight":b?"":void 0,role:"option","aria-selected":b,"data-selected":g?"":void 0,[Fgt]:d,onPointerUp:f?void 0:v,onPointerMove:f?void 0:y,onPointerLeave:f?void 0:w,"aria-disabled":f,"data-disabled":f?"":void 0,children:a.jsxs("div",{className:ks.PressableInner,children:[a.jsxs("div",{className:ks.OptionInner,children:[a.jsx("div",{className:ks.OptionIndicatorSlot,children:g&&a.jsx(mC,{className:ks.OptionCheck})}),a.jsx(n,{...e}),h&&a.jsx(Ca,{content:h.content,maxWidth:h.maxWidth,side:"right",children:a.jsx(Dje,{})})]}),e.description&&a.jsxs("div",{className:ks.OptionInner,children:[a.jsx("div",{className:ks.OptionIndicatorSlot}),e.description]})]})})},Bgt=()=>{const{actions:e}=Eb();return e.length===0?null:a.jsx("div",{className:ks.ActionsContainer,children:e.map(t=>a.jsx(Ugt,{...t},t.id))})},Ugt=({id:e,label:t,Icon:n,className:i})=>{const{onActionSelect:r}=Eb(),{requestCloseRef:s}=ik(),o=c=>{switch(c.key){case"Tab":break;case"Enter":case" ":c.stopPropagation(),l();break;default:c.stopPropagation()}},l=()=>{var c;r(e),(c=s.current)==null||c.call(s)};return a.jsx("div",{className:ks.Action,onPointerUp:l,onKeyDown:o,tabIndex:0,children:a.jsxs("div",{className:qi(ks.ActionInner,i),children:[n&&a.jsx(n,{role:"presentation"}),t]})})},Qgt=(e,t)=>e.label.toLowerCase().includes(t),zgt=(e,t,n)=>{const i=t.trim().toLocaleLowerCase();if(!i)return e;const r=s=>n(s,i);return bH(e)?e.reduce((s,o)=>{const l=o.options.filter(r);return l.length&&s.push({...o,options:l}),s},[]):e.reduce((s,o)=>(r(o)&&s.push(o),s),[])},g_=e=>{if(!e.length)return;let t;for(const n of e)if(uT(n)){const i=n.options.find(r=>!r.disabled);if(i){t=i;break}}else if(!n.disabled){t=n;break}return t},Vgt=(e,t)=>{let n;for(const i of e)if(uT(i)){const r=i.options.find(s=>s.value===t);if(r){n=r;break}}else if(i.value===t){n=i;break}return n},DB=(e,t)=>{let n=[];const i=new Set(t);for(const r of e)if(uT(r)){const s=r.options.filter(o=>i.has(o.value));n=n.concat(s)}else i.has(r.value)&&n.push(r);return n},XIe=40,mp=(e,t)=>t.querySelector(`[data-option-id="${e}"]`),YIe=e=>e.matches("[data-option-id]:not([data-disabled])"),Hgt=(e,t)=>{const n=mp(e,t);let i=n==null?void 0:n.nextElementSibling,r=0;for(;i&&r{const n=mp(e,t);let i=n==null?void 0:n.previousElementSibling,r=0;for(;i&&r{let e="",t;return n=>(n=n.toLowerCase(),e+=n,t&&clearTimeout(t),t=setTimeout(()=>{e=""},500),n.repeat(e.length)===e?n:e)},JIe=e=>/^[a-zA-Z0-9]$/.test(e),ePe=(e,t,n)=>{if(!e.length)return;let i,r,s=!n;const o=({disabled:l,label:c,value:u})=>u===n?(s=!0,!1):!l&&c.toLowerCase().startsWith(t);for(const l of e)if(uT(l)){for(const c of l.options)if(o(c))if(s){r=c;break}else i=i||c}else if(o(l))if(s){r=l;break}else i=i||l;return r||i};function to(...e){return e.filter(Boolean).join(" ")}const Uee=[["14 90% 62%","28 96% 80%","3 44% 24%"],["198 72% 56%","217 88% 79%","189 42% 24%"],["263 66% 63%","291 72% 81%","242 39% 25%"],["146 49% 52%","169 66% 78%","158 38% 23%"],["334 72% 63%","15 87% 80%","350 41% 25%"]];function Wgt(e){let t=2166136261;for(const o of e)t^=o.charCodeAt(0),t=Math.imul(t,16777619);const n=t>>>0,[i,r,s]=Uee[n%Uee.length];return{"--resource-identity-accent":i,"--resource-identity-glow":r,"--resource-identity-shadow":s,"--resource-identity-x":`${20+(n>>>7)%61}%`,"--resource-identity-y":`${18+(n>>>15)%57}%`}}function r1({seed:e,className:t}){return a.jsx("span",{className:to("resource-card__identity-mark",t),style:Wgt(e),"aria-hidden":"true"})}function Kgt(e){return a.jsx("svg",{viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",...e,children:a.jsxs("g",{transform:"translate(0.875 0.875)",children:[a.jsx("path",{d:"M5.869 10.719a4.849 4.849 0 1 0 0-9.698 4.849 4.849 0 0 0 0 9.698Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),a.jsx("path",{d:"m11.229 11.229-1.021-1.021",stroke:"currentColor",strokeWidth:"0.984375",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function Ch({className:e,...t}){return a.jsx("section",{className:to("resource-page",e),...t})}function Qv({title:e,description:t,className:n}){return a.jsxs("header",{className:to("resource-page__header",n),children:[a.jsx("h1",{children:e}),t?a.jsx("p",{children:t}):null]})}function Ggt({className:e,...t}){return a.jsx("div",{className:to("resource-detail",e),...t})}function Xgt({className:e,...t}){return a.jsx("header",{className:to("resource-detail__header",e),...t})}function Ygt({title:e,description:t,identitySeed:n,meta:i,backLabel:r,onBack:s}){const{t:o}=_e("ui"),l=r??o("resourceCollection.back");return a.jsxs("div",{className:"resource-detail__heading",children:[s?a.jsx("button",{type:"button",className:"resource-detail__back",onClick:s,"aria-label":l,title:l,children:a.jsx(_at,{"aria-hidden":"true"})}):null,a.jsxs("div",{className:"resource-detail__heading-copy",children:[a.jsxs("div",{className:"resource-detail__title-row",children:[a.jsx("span",{className:"resource-detail__identity",children:a.jsx(r1,{seed:n})}),a.jsx("h1",{children:e}),i?a.jsx("div",{className:"resource-detail__meta",children:i}):null]}),t?a.jsx("p",{children:t}):null]})]})}function Zgt({className:e,...t}){return a.jsx("div",{className:to("resource-detail__actions",e),...t})}function Jgt({className:e,...t}){return a.jsx("div",{className:to("resource-detail__body",e),...t})}function dT({title:e,description:t,identitySeed:n,meta:i,backLabel:r,onBack:s,actions:o,className:l,actionsClassName:c,bodyClassName:u,sections:d,activeSectionKey:f,navigationLabel:h,onSectionChange:m,children:g}){var x;const{t:b}=_e("ui"),v=!!(d!=null&&d.length),y=(x=d==null?void 0:d.find(k=>k.key===f))==null?void 0:x.content,w=h??b("resourceCollection.detailNavigation");return a.jsxs(Ggt,{className:l,children:[a.jsxs(Xgt,{children:[a.jsx(Ygt,{title:e,description:t,identitySeed:n,meta:i,backLabel:r,onBack:s}),o?a.jsx(Zgt,{className:c,children:o}):null]}),a.jsx(Jgt,{className:to(v&&"is-split",u),children:v?a.jsxs(a.Fragment,{children:[a.jsx("nav",{className:"resource-detail__navigation","aria-label":w,children:d==null?void 0:d.map(k=>a.jsx(Tt,{type:"button",color:"secondary",variant:k.key===f?"soft":"ghost",size:"lg",pill:!1,block:!0,"aria-current":k.key===f?"page":void 0,disabled:k.disabled,onClick:()=>m==null?void 0:m(k.key),children:a.jsx("span",{className:"resource-detail__navigation-label",children:k.label})},k.key))}),a.jsx("div",{className:"resource-detail__content",children:y})]}):g})]})}function yH({className:e,...t}){return a.jsx("dl",{className:to("resource-detail__summary",e),...t})}function tPe({title:e,description:t,actions:n,className:i}){return a.jsxs("header",{className:to("resource-detail__section-header",i),children:[a.jsxs("div",{children:[a.jsx("h2",{children:e}),t?a.jsx("p",{children:t}):null]}),n]})}function vH({rows:e,rowKey:t,rowLabel:n,columns:i,searchValue:r,onSearchChange:s,searchPlaceholder:o,searchLabel:l,toolbarActions:c,primaryAction:u,rowActions:d,scrollRef:f,onScroll:h,busy:m,footer:g,emptyLabel:b}){const{t:v}=_e("ui"),y=!!d,w=b??v("resourceCollection.noData");return a.jsxs("div",{className:"resource-data-table",children:[a.jsxs("div",{className:"resource-data-table__toolbar",children:[a.jsx("div",{className:"resource-data-table__search",children:a.jsx(js,{type:"search",value:r,onChange:x=>s(x.target.value),placeholder:o,"aria-label":l})}),c,u?a.jsx(Tt,{type:"button",color:"primary",disabled:u.disabled,title:u.title,onClick:u.onClick,children:u.label}):null]}),a.jsxs("div",{ref:f,className:"resource-data-table__frame","aria-busy":m||void 0,onScroll:h,children:[a.jsxs("table",{className:"resource-data-table__table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[i.map(x=>a.jsx("th",{scope:"col",className:x.className,children:x.header},x.key)),y?a.jsx("th",{scope:"col",className:"resource-data-table__actions-heading",children:a.jsx("span",{className:"sr-only",children:v("resourceCollection.actions")})}):null]})}),a.jsx("tbody",{children:e.length===0?a.jsx("tr",{children:a.jsx("td",{className:"resource-data-table__empty",colSpan:i.length+(y?1:0),children:w})}):e.map(x=>{const k=t(x),S=(n==null?void 0:n(x))??k;return a.jsxs("tr",{children:[i.map(O=>a.jsx("td",{className:O.className,children:O.render(x)},O.key)),d?a.jsx("td",{className:"resource-data-table__actions",children:a.jsx(HIe,{label:v("resourceCollection.moreActions",{label:S}),menuLabel:v("resourceCollection.actionsFor",{label:S}),items:d(x)})}):null]},k)})})]}),g]})]})}function ib({className:e,...t}){return a.jsx("div",{className:to("resource-toolbar",e),...t})}function rb({items:e,value:t,onChange:n,ariaLabel:i,idPrefix:r,className:s}){const o=c=>{c.disabled||n(c.id)},l=(c,u)=>{var g;if(!["ArrowLeft","ArrowRight","Home","End"].includes(c.key))return;c.preventDefault();const d=e.filter(b=>!b.disabled),f=d.findIndex(b=>b.id===u.id),h=c.key==="Home"?0:c.key==="End"?d.length-1:(f+(c.key==="ArrowRight"?1:-1)+d.length)%d.length,m=d[h];m&&(n(m.id),(g=document.getElementById(`${r}-${m.id}-tab`))==null||g.focus())};return a.jsx("nav",{className:to("resource-tabs",s),"aria-label":i,role:"tablist",children:e.map(c=>a.jsx("button",{type:"button",id:`${r}-${c.id}-tab`,className:t===c.id?"is-active":void 0,role:"tab","aria-selected":t===c.id,"aria-controls":c.panelId,tabIndex:t===c.id?0:-1,disabled:c.disabled,onClick:()=>o(c),onKeyDown:u=>l(u,c),children:c.label},c.id))})}function em({className:e,...t}){return a.jsxs("label",{className:to("resource-search",e),children:[a.jsx(Kgt,{}),a.jsx("input",{type:"search",...t})]})}const ebt=150,tbt=200;function Qee(e){e.dispatchEvent(new PointerEvent("pointerdown",{bubbles:!0,cancelable:!0,pointerType:"mouse",button:0}))}function sb({id:e,ariaLabel:t,value:n,options:i,onChange:r,className:s,disabled:o=!1}){const l=p.useRef(null),c=p.useRef(null),u=p.useRef(null),d=p.useRef(!1),f=p.useCallback(()=>{c.current!==null&&(window.clearTimeout(c.current),c.current=null)},[]),h=p.useCallback(()=>{u.current!==null&&(window.clearTimeout(u.current),u.current=null)},[]),m=p.useCallback(()=>{var y;return((y=l.current)==null?void 0:y.querySelector(".resource-filter-select__trigger"))??null},[]),g=p.useCallback(()=>{h();const y=m();d.current&&(y==null?void 0:y.getAttribute("data-state"))==="open"&&Qee(y),d.current=!1},[h,m]),b=p.useCallback(()=>{d.current&&(h(),u.current=window.setTimeout(g,tbt))},[h,g]),v=p.useCallback(y=>{var k;if(o||!window.matchMedia("(hover: hover) and (pointer: fine)").matches)return;h();const w=m();if(!w||w.getAttribute("data-state")==="open")return;const x=document.activeElement;x instanceof HTMLElement&&x!==w&&!((k=l.current)!=null&&k.contains(x))&&x.matches("input, textarea, [contenteditable='true']")||(f(),c.current=window.setTimeout(()=>{const S=m();!S||S.getAttribute("data-state")==="open"||(d.current=!0,Qee(S))},ebt))},[h,f,o,m]);return p.useEffect(()=>{const y=w=>{var A;if(!d.current)return;const x=m();if(!x||x.getAttribute("data-state")!=="open"){d.current=!1,h();return}const k=w.target;if(!(k instanceof Node))return;const S=x.getAttribute("aria-controls"),O=S?document.getElementById(S):null;if((A=l.current)!=null&&A.contains(k)||O!=null&&O.contains(k)){h();return}b()};return document.addEventListener("pointermove",y,{passive:!0}),()=>{document.removeEventListener("pointermove",y),f(),h()}},[h,f,m,b]),a.jsxs("div",{ref:l,className:to("resource-filter-select",s),onMouseEnter:v,onMouseLeave:()=>{f(),b()},children:[a.jsx("label",{className:"sr-only",htmlFor:e,children:t}),a.jsx(ma,{id:e,value:n,options:i,size:"md",variant:"ghost",pill:!1,block:!1,align:"end",listMinWidth:160,disabled:o,triggerClassName:"resource-filter-select__trigger",onChange:y=>r(y.value)})]})}const tm=p.forwardRef(function({className:t,...n},i){return a.jsx("section",{ref:i,className:to("resource-results",t),...n})});function fl(){const{t:e}=_e("ui");return a.jsxs("div",{className:"resource-loading-state",role:"status","aria-live":"polite","aria-busy":"true",children:[a.jsx(YA,{size:16}),a.jsx(on,{as:"span",duration:2.4,children:e("resourceCollection.loading")})]})}function zv({className:e,...t}){return a.jsx("div",{className:to("resource-grid",e),...t})}function xH({className:e,footer:t,actions:n,activateLabel:i,onActivate:r,children:s,...o}){return a.jsxs("article",{className:to("resource-card",r&&"is-interactive",e),...o,children:[r&&i?a.jsx("button",{type:"button",className:"resource-card__target","aria-label":i,title:i,onClick:r}):null,a.jsx("div",{className:"resource-card__content",children:s}),t||n?a.jsxs("footer",{className:"resource-card__footer",children:[t,n?a.jsx("div",{className:"resource-card__actions",children:n}):null]}):null]})}function CN({className:e,iconOnly:t=!1,tone:n="secondary",...i}){return a.jsx("button",{type:"button",className:to("resource-card__action",`is-${n}`,t&&"is-icon-only",e),...i})}function MB({label:e,icon:t="arrow",tone:n="primary",className:i,children:r,title:s,...o}){const l=t==="play"?a.jsx(hat,{}):t==="plus"?a.jsx(Lje,{}):a.jsx(Xst,{});return a.jsx(CN,{className:i,iconOnly:!0,tone:n,"aria-label":e,title:s??e,...o,children:r??l})}function wH({leading:e,title:t,titleText:n,subtitle:i,status:r}){return a.jsxs("div",{className:"resource-card__header",children:[a.jsxs("div",{className:"resource-card__identity",children:[e,a.jsxs("div",{className:"resource-card__title-copy",children:[a.jsx("h3",{title:n,children:t}),i]})]}),r]})}function kH({children:e,title:t}){return a.jsx("p",{className:"resource-card__description",title:t,children:e})}function nPe({items:e,className:t}){return a.jsx("dl",{className:to("resource-card__metadata",t),children:e.map((n,i)=>a.jsxs("div",{className:n.className,children:[a.jsx("dt",{className:n.hideLabel?"sr-only":void 0,children:n.label}),a.jsx("dd",{title:n.title,children:n.value})]},`${String(n.label)}:${i}`))})}function ab({className:e,icon:t,children:n,...i}){return a.jsxs("button",{type:"button",className:to("resource-create-card",e),...i,children:[a.jsx("span",{className:"resource-create-card__icon","aria-hidden":"true",children:t}),a.jsx("span",{children:n})]})}const nbt=new Set(["avif","bmp","gif","heic","jpeg","jpg","png","svg","tif","tiff","webp"]),ibt=new Set(["avi","m4v","mkv","mov","mp4","mpeg","mpg","webm"]),rbt=new Set(["csv","htm","html","json","md","pdf","svg","txt","xml","yaml","yml"]);function iPe(e){const t=e.lastIndexOf(".");return t<0?"":e.slice(t+1).toLocaleLowerCase()}function xI(e,t){if(!Number.isFinite(e))return t;const n=e;return n>1e10?n:n*1e3}function sbt(e){var t,n;return((t=e.actions)==null?void 0:t.artifactDelta)??((n=e.actions)==null?void 0:n.artifact_delta)}function abt(e){return`${e.replace(/\.pptx$/i,"")}.preview.webp`}function obt(e){var t;return(((t=e.content)==null?void 0:t.parts)??[]).map(n=>n.functionResponse??n.function_response).filter(n=>!!n)}function lbt(e){if(!e)return{};const t=e.result;return t&&typeof t=="object"&&!Array.isArray(t)?t:e}function zee(e,t,n){var i;if(/\.[A-Za-z0-9]{2,8}$/.test(e))return e;try{const r=new URL(t).pathname.split("/").filter(Boolean),o=((i=(r[r.length-1]??"").match(/\.[A-Za-z0-9]{2,8}$/))==null?void 0:i[0])??"";if(o)return`${e}${o}`}catch{}return`${e}.${n==="image"?"png":"mp4"}`}function cbt(e,t){const n=lbt(t),i=e==="image_generate"||e.endsWith("_image_generate"),r=["video_generate","video_task_query"].some(u=>e===u||e.endsWith(`_${u}`));if(!i&&!r)return[];const s=i?"image":"video",o=[],l=n.success_list;if(Array.isArray(l)){for(const u of l)if(!(!u||typeof u!="object"||Array.isArray(u)))for(const[d,f]of Object.entries(u))typeof f=="string"&&f.startsWith("https://")&&o.push({name:zee(d,f,s),url:f,type:s})}const c=n.video_url;if(r&&typeof c=="string"&&c.startsWith("https://")){const u=typeof n.task_id=="string"?n.task_id:void 0;o.push({name:zee(u||"generated-video",c,s),url:c,type:s,taskId:u})}return o}function Vee(e,t){return new Date(xI(e,t)||Date.now()).toISOString()}function ubt(e,t){var r;const n=[],i=new Set;for(const s of e)for(const o of s.sessions){const l=xI(o.lastUpdateTime,Date.now()),c=tM(o.events,t);for(const u of o.events??[])for(const d of obt(u)){const f=(d==null?void 0:d.name)??"";for(const h of cbt(f,d==null?void 0:d.response)){const m=`${o.id}:${u.id??""}:${f}:${h.url}`;i.has(m)||(i.add(m),n.push({sourceUrl:h.url,name:h.name,mimeType:h.type==="image"?"image/png":"video/mp4",appName:s.appName,agentId:s.agentId,agentName:((r=s.agentName)==null?void 0:r.trim())||s.appName,sessionId:o.id,sessionTitle:c,sessionUpdatedAt:Vee(o.lastUpdateTime,l),createdAt:Vee(u.timestamp,l),origin:{runtimeId:s.runtimeId,region:s.region,eventId:u.id,invocationId:u.invocationId??u.invocation_id,toolName:f,taskId:h.taskId}}))}}}return n}function rPe(e){const t=iPe(e);return nbt.has(t)?"image":ibt.has(t)?"video":"document"}function dbt(e){const t=rPe(e);return t==="image"?"image":t==="video"?"video":rbt.has(iPe(e))?"frame":"unavailable"}function fbt(e,t,n="en-US"){var r;const i=[];for(const s of e)for(const o of s.sessions){const l=xI(o.lastUpdateTime,0),c=new Map;for(const u of o.events??[]){const d=sbt(u);if(!d)continue;const f=xI(u.timestamp,l);for(const[h,m]of Object.entries(d)){if(!h||!Number.isFinite(m))continue;const g=c.get(h);(!g||m>=g.version)&&c.set(h,{filename:h,version:m,createdAt:f})}}for(const u of c.values()){if(/\.preview\.webp$/i.test(u.filename))continue;const d=c.get(abt(u.filename)),f=d??u,h=d?"image":dbt(u.filename);i.push({id:`${s.appName}:${o.id}:${u.filename}:${u.version}`,appName:s.appName,agentId:s.agentId,sessionId:o.id,sessionTitle:tM(o.events,t),agentName:((r=s.agentName)==null?void 0:r.trim())||s.appName,sessionUpdatedAt:l,name:u.filename,version:u.version,type:rPe(u.filename),createdAt:u.createdAt||l,origin:{runtimeId:s.runtimeId,region:s.region},preview:{filename:f.filename,version:f.version,mode:h}})}}return i.sort((s,o)=>o.createdAt-s.createdAt||s.name.localeCompare(o.name,n))}function sPe(e,t,n){if(!e)return n;const i=new Date(e);if(Number.isNaN(i.getTime()))return n;const r=new Date;return i.getFullYear()===r.getFullYear()&&i.getMonth()===r.getMonth()&&i.getDate()===r.getDate()?new Intl.DateTimeFormat(t,{hour:"2-digit",minute:"2-digit",hour12:!1}).format(i):new Intl.DateTimeFormat(t,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).format(i)}function aPe(e){return!e||e<=0?"":e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(e<10*1024*1024?1:0)} MB`:`${(e/(1024*1024*1024)).toFixed(1)} GB`}const c4=40;function hbt(e){return[{value:"all",label:e("artifactLibrary.types.all")},{value:"document",label:e("artifactLibrary.types.document")},{value:"image",label:e("artifactLibrary.types.image")},{value:"video",label:e("artifactLibrary.types.video")}]}function pbt(e,t){return e(`artifactLibrary.types.${t}`)}function b_(e){return e instanceof Error?e.message:String(e)}function oPe({artifact:e,large:t=!1}){return a.jsx("div",{className:`library-artifact-preview library-artifact-preview--${e.type}${t?" is-large":""}`,children:e.thumbnailUrl?a.jsxs(a.Fragment,{children:[a.jsx("img",{className:"library-artifact-preview-media",src:e.thumbnailUrl,alt:"",loading:"lazy"}),e.type==="video"?a.jsx("span",{className:"artifact-video-play is-overlay","aria-hidden":"true",children:a.jsx(Lee,{})}):null]}):e.type==="document"?a.jsxs("div",{className:"artifact-document-sheet","aria-hidden":"true",children:[a.jsx("span",{className:"is-title"}),a.jsx("span",{}),a.jsx("span",{}),a.jsx("span",{className:"is-short"})]}):e.type==="image"?a.jsxs("div",{className:"artifact-image-scene","aria-hidden":"true",children:[a.jsx("span",{className:"artifact-image-sun"}),a.jsx("span",{className:"artifact-image-plane artifact-image-plane--back"}),a.jsx("span",{className:"artifact-image-plane artifact-image-plane--front"})]}):a.jsxs("div",{className:"artifact-video-frame","aria-hidden":"true",children:[a.jsx("span",{className:"artifact-video-orbit"}),a.jsx("span",{className:"artifact-video-node artifact-video-node--one"}),a.jsx("span",{className:"artifact-video-node artifact-video-node--two"}),a.jsx("span",{className:"artifact-video-play",children:a.jsx(Lee,{})})]})})}function mbt({artifact:e,pendingAction:t,disabled:n,onPreview:i,onDownload:r,onEdit:s,onDelete:o,onOpenSource:l,t:c,locale:u}){const d=t===`download:${e.id}`;return a.jsxs("tr",{className:"library-artifact-row",children:[a.jsx("td",{className:"library-artifact-file",children:a.jsxs("button",{type:"button",className:"library-artifact-preview-trigger","aria-label":c("artifactLibrary.previewArtifact",{name:e.name}),disabled:n||!!t,onClick:()=>i(e),children:[a.jsx("div",{className:"library-artifact-thumbnail",children:a.jsx(oPe,{artifact:e})}),a.jsxs("div",{className:"library-artifact-row-title",children:[a.jsx("span",{className:"library-artifact-row-name",title:e.name,children:e.name}),a.jsx("span",{className:"library-artifact-row-size",children:aPe(e.sizeBytes)||"—"})]})]})}),a.jsx("td",{className:"library-artifact-source-cell",children:l?a.jsxs("button",{type:"button",className:"library-artifact-source-link",title:`${e.agentName} / ${e.sessionTitle}`,onClick:()=>l(e),children:[a.jsx("span",{children:e.agentName}),a.jsx("span",{"aria-hidden":"true",children:"/"}),a.jsx("span",{children:e.sessionTitle})]}):a.jsxs("span",{title:`${e.agentName} / ${e.sessionTitle}`,children:[e.agentName," / ",e.sessionTitle]})}),a.jsx("td",{className:"library-artifact-time",children:sPe(e.updatedAt??e.createdAt,u,c("artifactLibrary.unknownTime"))}),a.jsx("td",{className:"library-artifact-actions-cell",children:a.jsx("div",{className:"library-artifact-actions",children:a.jsx(HIe,{label:c("artifactLibrary.moreActions",{name:e.name}),menuLabel:c("artifactLibrary.actionMenu",{name:e.name}),placement:"bottom-end",items:[{label:c(d?"artifactLibrary.downloading":"artifactLibrary.download"),onSelect:()=>r(e),disabled:n||!!t},...s?[{label:c("artifactLibrary.edit"),onSelect:()=>s(e),disabled:n||!!t||e.canManage===!1}]:[],...o?[{label:c("artifactLibrary.delete"),onSelect:()=>o(e),disabled:n||!!t||e.canManage===!1,danger:!0}]:[]]})})})]})}function gbt({sources:e=[],items:t,userId:n="",active:i=!0,activationRevision:r=0,loading:s=!1,error:o="",onRetry:l,onEdit:c,onDelete:u,onDownload:d,onOpenSource:f,region:h,toolbarLeading:m,toolbarFilters:g}){var Ge,ye;const{t:b,i18n:v}=_e("workspaceTools"),y=v.resolvedLanguage||v.language,[w,x]=p.useState("all"),[k,S]=p.useState(""),[O,A]=p.useState(null),[E,j]=p.useState(""),[T,R]=p.useState(""),[C,N]=p.useState(""),[P,I]=p.useState(""),[D,_]=p.useState({}),[L,F]=p.useState(()=>new Set),[M,H]=p.useState(null),[q,U]=p.useState(!1),[Z,z]=p.useState(""),[J,ne]=p.useState(null),[W,X]=p.useState(!1),[ce,V]=p.useState(c4),Y=p.useRef(null),K=p.useRef(null),de=p.useRef(0),ee=p.useRef(null),Oe=p.useRef(null),he=p.useRef(!1),ge=p.useCallback(()=>{de.current+=1,A(null),j(""),R("")},[]),Se=p.useMemo(()=>t?[...t]:fbt(e,b("library.untitledSession"),y),[t,y,e,b]),xe=p.useMemo(()=>Se.filter(oe=>!L.has(oe.id)).map(oe=>D[oe.id]??oe),[Se,D,L]);p.useEffect(()=>()=>{de.current+=1},[]),p.useEffect(()=>()=>{E&&URL.revokeObjectURL(E)},[E]),p.useEffect(()=>{var Re;if(!O)return;const oe=document.activeElement,ie=document.body.style.overflow;document.body.style.overflow="hidden",(Re=Y.current)==null||Re.focus();const Ae=St=>{if(St.key==="Escape"){St.preventDefault(),ge();return}if(St.key!=="Tab")return;const Nt=K.current;if(!Nt)return;const Dt=Array.from(Nt.querySelectorAll('button:not([disabled]), video[controls], iframe, [tabindex]:not([tabindex="-1"])')).filter(He=>He.getClientRects().length>0);if(Dt.length===0){St.preventDefault();return}const Et=Dt[0],$t=Dt[Dt.length-1];St.shiftKey&&document.activeElement===Et?(St.preventDefault(),$t.focus()):!St.shiftKey&&document.activeElement===$t&&(St.preventDefault(),Et.focus())};return document.addEventListener("keydown",Ae),()=>{document.removeEventListener("keydown",Ae),document.body.style.overflow=ie,oe!=null&&oe.isConnected&&oe.focus()}},[ge,O]);const Pe=async oe=>{const ie=de.current+1;if(de.current=ie,N(""),j(""),A(oe),oe.preview.mode!=="unavailable"){if(oe.contentUrl){j(oe.contentUrl);return}R(`preview:${oe.id}`);try{const Ae=await Cz(oe.appName,n,oe.sessionId,oe.preview.filename,oe.preview.version);if(de.current!==ie){URL.revokeObjectURL(Ae);return}j(Ae)}catch(Ae){de.current===ie&&N(b("artifactLibrary.previewFailed",{name:oe.name,message:b_(Ae)}))}finally{de.current===ie&&R("")}}},Ue=async oe=>{N(""),R(`download:${oe.id}`);try{d?await d(oe):await Ez(oe.appName,n,oe.sessionId,oe.name,oe.version),I(b("artifactLibrary.downloadStarted",{name:oe.name}))}catch(ie){N(b("artifactLibrary.downloadFailed",{name:oe.name,message:b_(ie)}))}finally{R("")}},Ke=async oe=>{if(!(!M||!c)){U(!0),z("");try{const Ae=await c(M,oe)??{...M,...oe,updatedAt:Date.now()};_(Re=>({...Re,[M.id]:Ae})),I(b("artifactLibrary.updated",{name:Ae.name})),H(null)}catch(ie){z(b_(ie))}finally{U(!1)}}},Me=async()=>{if(!(!J||!u)){X(!0),N("");try{await u(J),F(oe=>new Set([...oe,J.id])),I(b("artifactLibrary.deleted",{name:J.name})),(O==null?void 0:O.id)===J.id&&ge(),ne(null)}catch(oe){N(b("artifactLibrary.deleteFailed",{name:J.name,message:b_(oe)})),ne(null)}finally{X(!1)}}},re=p.useMemo(()=>{const oe=k.trim().toLocaleLowerCase();return xe.filter(ie=>{var Ae;return(Ae=ie.origin)!=null&&Ae.region&&ie.origin.region!==h||w!=="all"&&ie.type!==w?!1:oe?[ie.name,ie.sessionTitle,ie.agentName].some(Re=>Re.toLocaleLowerCase().includes(oe)):!0})},[w,xe,k,h]),ue=p.useMemo(()=>re.slice(0,ce),[re,ce]),be=ce{he.current||(he.current=!0,V(oe=>oe+c4))},[]);p.useEffect(()=>{V(c4)},[r,w,k,re.length]),p.useEffect(()=>{he.current=!1},[ce]),p.useEffect(()=>{const oe=Oe.current,ie=ee.current;if(!i||!oe||!ie||!be)return;const Ae=new IntersectionObserver(([Re])=>{Re.isIntersecting&&Ce()},{root:ie,rootMargin:"240px 0px",threshold:.01});return Ae.observe(oe),()=>Ae.disconnect()},[i,be,Ce,ce]);const Ee=()=>{const oe=ee.current;!i||!oe||!be||oe.scrollHeight-oe.scrollTop-oe.clientHeight<=240&&Ce()},Ve=!!k.trim()||w!=="all"||xe.some(oe=>{var ie;return((ie=oe.origin)==null?void 0:ie.region)&&oe.origin.region!==h});return a.jsxs("div",{className:"artifact-library-page resource-collection",children:[a.jsxs(ib,{className:"artifact-library-toolbar library-resource-toolbar",children:[m,a.jsxs("div",{className:"resource-toolbar__actions",children:[a.jsx(sb,{id:"artifact-type-filter",ariaLabel:b("artifactLibrary.typeFilter"),value:w,options:hbt(b),onChange:x}),g,a.jsx(em,{"aria-label":b("artifactLibrary.searchAria"),value:k,onChange:oe=>S(oe.target.value),placeholder:b("artifactLibrary.searchPlaceholder")})]})]}),o&&xe.length>0?a.jsxs("div",{className:"artifact-library-banner",role:"alert",children:[a.jsx("span",{children:o}),l?a.jsx("button",{type:"button",onClick:l,children:b("artifactLibrary.retry")}):null]}):null,C?a.jsxs("div",{className:"artifact-library-banner",role:"alert",children:[a.jsx("span",{children:C}),a.jsx("button",{type:"button",onClick:()=>N(""),children:b("artifactLibrary.close")})]}):null,a.jsx(tm,{ref:ee,className:"artifact-library-results","aria-label":b("artifactLibrary.listAria"),onScroll:Ee,children:a.jsxs("div",{className:"artifact-library-panel",children:[s&&xe.length===0?a.jsx(fl,{}):o&&xe.length===0?a.jsxs("div",{className:"artifact-library-empty is-error",role:"alert",children:[a.jsx("p",{children:b("artifactLibrary.loadFailed")}),a.jsx("span",{children:o}),l?a.jsx("button",{type:"button",onClick:l,children:b("artifactLibrary.reload")}):null]}):re.length===0?a.jsxs("div",{className:"artifact-library-empty",children:[a.jsx("p",{children:b(Ve?"artifactLibrary.noMatch":"artifactLibrary.noArtifacts")}),a.jsx("span",{children:b(Ve?"artifactLibrary.searchHint":"artifactLibrary.emptyHint")})]}):a.jsx("div",{className:"artifact-library-list",children:a.jsxs("table",{className:"artifact-library-table",children:[a.jsxs("colgroup",{children:[a.jsx("col",{className:"artifact-library-table__file-column"}),a.jsx("col",{className:"artifact-library-table__source-column"}),a.jsx("col",{className:"artifact-library-table__time-column"}),a.jsx("col",{className:"artifact-library-table__actions-column"})]}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:b("artifactLibrary.columns.name")}),a.jsx("th",{scope:"col",children:b("artifactLibrary.columns.source")}),a.jsx("th",{scope:"col",children:b("artifactLibrary.columns.updatedAt")}),a.jsx("th",{scope:"col",className:"artifact-library-table__actions-heading",children:b("artifactLibrary.columns.actions")})]})}),a.jsx("tbody",{children:ue.map(oe=>a.jsx(mbt,{artifact:oe,pendingAction:T,disabled:!n&&!t,onPreview:ie=>void Pe(ie),onDownload:ie=>void Ue(ie),onEdit:c?ie=>{z(""),H(ie)}:void 0,onDelete:u?ne:void 0,onOpenSource:f,t:b,locale:y},oe.id))})]})}),be?a.jsx("div",{ref:Oe,className:"artifact-library-load-more",role:"status","aria-live":"polite",children:a.jsx(on,{as:"span",duration:2.4,children:b("artifactLibrary.loadingMore")})}):null]})}),a.jsx("p",{className:"artifact-library-status","aria-live":"polite",children:P}),O?a.jsxs("div",{className:"artifact-library-preview-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"artifact-library-preview-title",children:[a.jsx("button",{type:"button",className:"artifact-library-preview-backdrop","aria-label":b("artifactLibrary.preview.close"),onClick:ge}),a.jsxs("div",{ref:K,className:"artifact-library-preview-panel",children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("h2",{id:"artifact-library-preview-title",children:O.name}),a.jsx("p",{children:b("artifactLibrary.preview.meta",{type:pbt(b,O.type),version:O.version})})]}),a.jsx("button",{ref:Y,type:"button","aria-label":b("artifactLibrary.preview.close"),onClick:ge,children:a.jsx(VIe,{})})]}),a.jsxs("div",{className:"artifact-library-preview-content",children:[a.jsx("div",{className:"artifact-library-preview-canvas",children:T===`preview:${O.id}`?a.jsx(on,{as:"span",duration:2.4,children:b("artifactLibrary.preview.loading")}):E&&O.preview.mode==="image"?a.jsx("img",{src:E,alt:b("artifactLibrary.preview.alt",{name:O.name})}):E&&O.preview.mode==="video"?a.jsx("video",{src:E,controls:!0,"aria-label":b("artifactLibrary.preview.alt",{name:O.name})}):E&&O.preview.mode==="frame"?a.jsx("iframe",{src:E,title:b("artifactLibrary.preview.alt",{name:O.name})}):a.jsxs("div",{className:"artifact-library-preview-unavailable",children:[a.jsx(oPe,{artifact:O,large:!0}),a.jsx("p",{children:b(C?"artifactLibrary.preview.loadFailed":"artifactLibrary.preview.unsupported")})]})}),a.jsxs("aside",{className:"artifact-library-preview-details","aria-label":b("artifactLibrary.preview.sourceAria"),children:[O.description?a.jsx("p",{className:"artifact-library-preview-description",children:O.description}):null,a.jsxs("dl",{children:[a.jsxs("div",{children:[a.jsx("dt",{children:b("artifactLibrary.preview.agent")}),a.jsx("dd",{title:O.agentName,children:O.agentName})]}),a.jsxs("div",{children:[a.jsx("dt",{children:b("artifactLibrary.preview.session")}),a.jsx("dd",{title:O.sessionTitle,children:O.sessionTitle})]}),(Ge=O.origin)!=null&&Ge.toolName?a.jsxs("div",{children:[a.jsx("dt",{children:b("artifactLibrary.preview.tool")}),a.jsx("dd",{children:O.origin.toolName})]}):null,a.jsxs("div",{children:[a.jsx("dt",{children:b("artifactLibrary.preview.createdAt")}),a.jsx("dd",{children:sPe(O.createdAt,y,b("artifactLibrary.unknownTime"))})]}),O.sizeBytes?a.jsxs("div",{children:[a.jsx("dt",{children:b("artifactLibrary.preview.fileSize")}),a.jsx("dd",{children:aPe(O.sizeBytes)})]}):null]}),(ye=O.tags)!=null&&ye.length?a.jsx("div",{className:"artifact-library-preview-tags","aria-label":b("artifactLibrary.preview.tags"),children:O.tags.map(oe=>a.jsx("span",{children:oe},oe))}):null]})]}),a.jsxs("footer",{children:[a.jsxs("div",{className:"artifact-library-preview-footer-start",children:[f?a.jsxs("button",{type:"button",className:"is-secondary",onClick:()=>{const oe=O;ge(),f(oe)},children:[a.jsx(Umt,{}),b("artifactLibrary.preview.viewSession")]}):null,c?a.jsxs("button",{type:"button",className:"is-secondary",disabled:O.canManage===!1,onClick:()=>{const oe=O;ge(),z(""),H(oe)},children:[a.jsx(vI,{}),b("artifactLibrary.edit")]}):null]}),a.jsxs("button",{type:"button",disabled:T.startsWith("download:")||!n&&!t,onClick:()=>void Ue(O),children:[a.jsx(Bmt,{}),b("artifactLibrary.download")]})]})]})]}):null,M?a.jsx(Vmt,{artifact:M,busy:q,error:Z,onClose:()=>{q||H(null)},onSave:oe=>void Ke(oe)}):null,J?a.jsx(_d,{title:b("artifactLibrary.deleteDialog.title"),description:b("artifactLibrary.deleteDialog.description",{name:J.name}),confirmLabel:b(W?"artifactLibrary.deleteDialog.deleting":"artifactLibrary.deleteDialog.confirm"),closeLabel:b("artifactLibrary.deleteDialog.close"),variant:"danger",busy:W,onCancel:()=>{W||ne(null)},onConfirm:()=>void Me()}):null]})}bn.hasResourceBundle("en-US","workspaceTools")||bn.addResourceBundle("en-US","workspaceTools",Ube,!0,!0);bn.hasResourceBundle("zh-CN","workspaceTools")||bn.addResourceBundle("zh-CN","workspaceTools",Wke,!0,!0);function Cb(e,t={}){return bn.t(e,{...t,ns:"workspaceTools"})}function bbt(e,t){if(e&&typeof e=="object"&&"detail"in e){const n=e.detail;if(typeof n=="string"&&n.trim())return n}return t}async function fT(e,t){if(e.ok)return e;let n;try{n=await e.json()}catch{n=void 0}throw new Error(bbt(n,Cb("artifactLibrary.api.withStatus",{message:t,status:e.status})))}function u4(e){if(typeof e=="number")return e;if(typeof e!="string")return 0;const t=Date.parse(e);return Number.isFinite(t)?t:0}function lPe(e){const t=e;return{...t,createdAt:u4(t.createdAt),updatedAt:u4(t.updatedAt),sessionUpdatedAt:u4(t.sessionUpdatedAt)}}async function cPe(e){const t=await e.json();return Array.isArray(t.items)?t.items.map(lPe):[]}async function ybt(){const e=await fT(await yn("/web/artifacts"),Cb("artifactLibrary.api.listFailed"));return cPe(e)}async function vbt(e){if(e.length===0)return ybt();const t=await fT(await yn("/web/artifacts/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({candidates:e})},24e4),Cb("artifactLibrary.api.syncFailed"));return cPe(t)}async function xbt(e,t){const n=await fT(await yn(`/web/artifacts/${encodeURIComponent(e.id)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),Cb("artifactLibrary.api.updateFailed"));return lPe(await n.json())}async function wbt(e){await fT(await yn(`/web/artifacts/${encodeURIComponent(e.id)}`,{method:"DELETE"}),Cb("artifactLibrary.api.deleteFailed"))}async function kbt(e){const n=await(await fT(await yn(`/web/artifacts/${encodeURIComponent(e.id)}/content?download=true`,{},24e4),Cb("artifactLibrary.api.downloadFailed"))).blob(),i=URL.createObjectURL(n),r=document.createElement("a");r.href=i,r.download=e.name,document.body.appendChild(r),r.click(),r.remove(),window.setTimeout(()=>URL.revokeObjectURL(i),0)}const uPe="KNOWLEDGE_PROVIDER_ASSOCIATION_INVALID";class mM extends Error{constructor(n,i,r={}){super(n);Zt(this,"status");Zt(this,"errorCode");Zt(this,"requestId");Zt(this,"diagnostics");Zt(this,"detail");Zt(this,"payload");Zt(this,"rawBody");this.name="KnowledgeRequestError",this.status=i;const s=typeof r=="string"?{errorCode:r}:r;this.errorCode=s.errorCode||"",this.requestId=s.requestId||"",this.diagnostics=s.diagnostics,this.detail=s.detail,this.payload=s.payload,this.rawBody=s.rawBody||""}}class dPe extends Error{constructor(n){super(n.map(({region:i,error:r})=>`${i}: ${r.message||Q("knowledge.loadFailed")}`).join(` +`));Zt(this,"failures");this.name="KnowledgeRegionAggregateError",this.failures=n}}const Obt=new Set(["ak","apikey","sk","accesskey","accesskeyid","authorization","authkey","clientsecret","cookie","credential","credentials","password","passwd","privatekey","secret","secretaccesskey","secretkey","securitytoken","sessiontoken","setcookie","token"]),Sbt=6,Hee=50,fPe=4e3;function Ebt(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}function Cbt(e){const t=Ebt(e);return Obt.has(t)||t.endsWith("password")||t.endsWith("secret")||t.endsWith("token")||t.endsWith("credential")}function Abt(e){return/<\s*(?:!doctype|html|head|body|script|style)\b/i.test(e)}function pS(e){if(Abt(e))return Q("knowledge.htmlHidden");const t=Q("knowledge.redacted");return e.replace(/\bBearer\s+[^\s,;]+/gi,`Bearer ${t}`).replace(/\b(?:set-)?cookie\s*:\s*[^\r\n]*/gi,`cookie: ${t}`).replace(/\bAKLT[A-Za-z0-9_-]{6,}\b/g,t).replace(/((?:access[_-]?key(?:[_-]?id)?|secret(?:[_-]?(?:access)?[_-]?key)?|session[_-]?token|security[_-]?token|client[_-]?secret|api[_-]?key|authorization|cookie|[a-z0-9_-]*(?:password|secret|token)|credential|ak|sk)\s*[:=]\s*)(?:"[^"]*"|'[^']*'|[^\s,;&]+)/gi,`$1${t}`).replace(/([?&](?:access[_-]?key|api[_-]?key|client[_-]?secret|security[_-]?token|session[_-]?token|secret|token|password|authorization|cookie|credential)=)[^&#\s]+/gi,`$1${t}`)}function LB(e,t=0,n=new WeakSet){if(e===null||typeof e=="number"||typeof e=="boolean")return e;if(typeof e=="string")return pS(e).slice(0,fPe);if(typeof e!="object")return;if(t>=Sbt)return Q("knowledge.depthTruncated");if(n.has(e))return Q("knowledge.circularReference");if(n.add(e),Array.isArray(e))return e.slice(0,Hee).map(r=>LB(r,t+1,n));const i={};return Object.entries(e).slice(0,Hee).forEach(([r,s])=>{i[r]=Cbt(r)?Q("knowledge.redacted"):LB(s,t+1,n)}),i}function qee(e){if(e===void 0)return"";const t=LB(e);if(typeof t=="string")return t;if(t===void 0)return"";try{return JSON.stringify(t).slice(0,fPe)}catch{return Q("knowledge.diagnosticsUnavailable")}}function Sl(e,t){if(e instanceof dPe)return e.failures.map(({region:o,error:l})=>`${o} ${Sl(l,t)}`).join(` `);if(!(e instanceof mM))return(e instanceof Error?pS(e.message):"")||t;const n=pS(e.message)||t,i=[Number.isFinite(e.status)?Q("knowledge.statusCode",{status:e.status}):"",e.errorCode?Q("knowledge.errorCode",{code:pS(e.errorCode)}):"",e.requestId?Q("knowledge.requestId",{requestId:pS(e.requestId)}):""].filter(Boolean).join(" · "),r=qee(e.diagnostics),s=qee(e.detail);return[n,i,r?Q("knowledge.diagnostics",{diagnostics:r}):"",s&&s!==n?Q("knowledge.detail",{detail:s}):""].filter(Boolean).join(` -`)}function AN(...e){for(const t of e)if(typeof t=="string"&&t.trim())return t.trim();return""}function Abt(e){return Array.isArray(e)?e.map(t=>{const n=jd(t),i=AN(n.msg,n.message);if(!i)return"";const r=Array.isArray(n.loc)?n.loc.filter(s=>typeof s=="string"||typeof s=="number").map(String).join("."):"";return r?`${r}: ${i}`:i}).filter(Boolean).join("; "):""}function Tbt(e,t=!0){const n=jd(e),i=Object.prototype.hasOwnProperty.call(n,"detail")?n.detail:typeof e=="string"?e:void 0,r=jd(i);return{message:typeof i=="string"?t?i.trim():"":AN(r.message,n.message,Abt(i)),errorCode:AN(r.errorCode,n.errorCode),requestId:AN(r.requestId,r.request_id,r.RequestId,n.requestId,n.request_id),diagnostics:r.diagnostics??n.diagnostics,detail:i,payload:e}}function jd(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function cr(e){return typeof e=="string"?e:""}function OC(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}function OH(e){const t=jd(e);return{id:cr(t.id),name:cr(t.name),description:cr(t.description),providerType:cr(t.providerType),providerKnowledgeId:cr(t.providerKnowledgeId),projectName:cr(t.projectName),region:cr(t.region),status:cr(t.status),createdAt:cr(t.createdAt),updatedAt:cr(t.updatedAt),ownerId:cr(t.ownerId),ownerLabel:cr(t.ownerLabel),canManage:t.canManage===!0}}function hT(e){const t=jd(e);return{id:cr(t.id),name:cr(t.name),type:cr(t.type),sizeBytes:OC(t.sizeBytes,0),status:cr(t.status),url:cr(t.url),tosPath:cr(t.tosPath),metadata:jd(t.metadata),createdAt:cr(t.createdAt),updatedAt:cr(t.updatedAt),sourceMarkdown:cr(t.sourceMarkdown)}}function _bt(e){const t=jd(e),n=t.attachment,i=jd(n);return{id:cr(t.id),title:cr(t.title),content:cr(t.content),attachmentUrl:cr(t.attachmentUrl)||cr(i.url)||cr(i.previewUrl),attachmentType:cr(t.attachmentType)||cr(i.type)||cr(i.mimeType),attachment:n,tableFields:t.tableFields}}async function Ef(e,t={},n=eo){var f;const i=hl(oc(t.headers));i.set("accept","application/json"),t.body&&!(t.body instanceof FormData)&&i.set("content-type","application/json");const r=await fetch(e,{...t,headers:i,signal:po(t.signal,n)});if(r.ok)return r.status===204?void 0:r.json();const s=await r.text();let o=s,l=!1;if(s)try{o=JSON.parse(s),l=!0}catch{}const c=((f=r.headers.get("content-type"))==null?void 0:f.toLowerCase())||"",u=Tbt(o,l||c.startsWith("text/plain")),d=r.status===401?Q("knowledge.signInRequired"):r.status===403?Q("knowledge.forbidden"):r.status===404?Q("knowledge.notFound"):r.status===409?Q("knowledge.conflict"):Q("knowledge.requestFailed",{status:r.status});throw new mM(u.message||d,r.status,{errorCode:u.errorCode,requestId:u.requestId,diagnostics:u.diagnostics,detail:u.detail,payload:u.payload,rawBody:s})}function Vv(e){const t=new URLSearchParams;e.trim()&&t.set("region",e.trim());const n=t.toString();return n?`?${n}`:""}async function jbt(e){var r;const t=new URLSearchParams({region:e.region,pageSize:String(e.pageSize??30)});(r=e.projectName)!=null&&r.trim()&&t.set("projectName",e.projectName.trim()),e.nextToken&&t.set("nextToken",e.nextToken);const n=await Ef(`/web/knowledge-bases?${t.toString()}`,{signal:e.signal}),i=jd(n);return{items:Array.isArray(i.items)?i.items.map(OH):[],nextToken:cr(i.nextToken)}}function Nbt(e){return`${e.region}\0${e.id}`}async function Rbt(e){var l;const t=[...new Set(e.regions.map(c=>c.trim()).filter(Boolean))],n=e.nextTokens?t.filter(c=>{var u;return!!((u=e.nextTokens)!=null&&u[c])}):t;if(n.length===0)return{items:[],nextTokens:{},failures:[]};const i=await Promise.allSettled(n.map(async c=>{var u;return{region:c,page:await jbt({region:c,projectName:e.projectName,nextToken:(u=e.nextTokens)==null?void 0:u[c],pageSize:e.pageSize,signal:e.signal})}}));if((l=e.signal)!=null&&l.aborted)throw new DOMException("Aborted","AbortError");const r=[],s={},o=new Map;if(i.forEach((c,u)=>{var f;const d=n[u];if(c.status==="rejected"){const h=(f=e.nextTokens)==null?void 0:f[d];h&&(s[d]=h),r.push({region:d,error:c.reason instanceof Error?c.reason:new Error(Q("knowledge.loadFailed"))});return}c.value.page.nextToken&&(s[d]=c.value.page.nextToken),c.value.page.items.forEach(h=>{const m=h.region?h:{...h,region:d};o.set(Nbt(m),m)})}),r.length===n.length)throw new uPe(r);return{items:[...o.values()],nextTokens:s,failures:r}}function Ibt(e){return Ef("/web/knowledge-bases",{method:"POST",body:JSON.stringify(e)},yr).then(OH)}function Pbt(e,t,n){return Ef(`/web/knowledge-bases/${encodeURIComponent(e)}${Vv(t)}`,{method:"PATCH",body:JSON.stringify(n)}).then(OH)}function Dbt(e,t){return Ef(`/web/knowledge-bases/${encodeURIComponent(e)}${Vv(t)}`,{method:"DELETE"},yr)}async function Mbt(e,t){var s;const n=new URLSearchParams({region:t.region,offset:String(t.offset??0),limit:String(t.limit??30)});(s=t.documentType)!=null&&s.trim()&&n.set("documentType",t.documentType.trim());const i=await Ef(`/web/knowledge-bases/${encodeURIComponent(e)}/documents?${n.toString()}`,{signal:t.signal}),r=jd(i);return{items:Array.isArray(r.items)?r.items.map(hT):[],offset:OC(r.offset,0),limit:OC(r.limit,t.limit??30),hasMore:r.hasMore===!0}}async function Lbt(e,t,n){const i=new URLSearchParams({region:n.region,offset:String(n.offset??0),limit:String(n.limit??20)}),r=await Ef(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}/preview?${i.toString()}`,{signal:n.signal}),s=jd(r);return{document:hT(s.document),chunks:Array.isArray(s.chunks)?s.chunks.map(_bt):[],sourceMarkdown:cr(s.sourceMarkdown),offset:OC(s.offset,0),limit:OC(s.limit,n.limit??20),hasMore:s.hasMore===!0}}function $bt(e,t,n){return Ef(`/web/knowledge-bases/${encodeURIComponent(e)}/documents${Vv(t)}`,{method:"POST",body:JSON.stringify(n)},yr).then(hT)}async function Fbt(e,t,n){const i=await Ef(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/web-preview${Vv(t)}`,{method:"POST",body:JSON.stringify({sourceType:"url",url:n.url})},yr),r=jd(i);return{name:cr(r.name),url:cr(r.url),sourceMarkdown:cr(r.sourceMarkdown)}}function Bbt(e,t,n){var r,s;const i=new FormData;return i.set("file",n.file),(r=n.name)!=null&&r.trim()&&i.set("name",n.name.trim()),(s=n.documentType)!=null&&s.trim()&&i.set("documentType",n.documentType.trim()),n.metadata&&i.set("metadata",JSON.stringify(n.metadata)),Ef(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/upload${Vv(t)}`,{method:"POST",body:i},yr).then(hT)}function Ubt(e,t,n,i){return Ef(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}${Vv(n)}`,{method:"PATCH",body:JSON.stringify(i)}).then(hT)}function Qbt(e,t,n){return Ef(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}${Vv(n)}`,{method:"DELETE"},yr)}function Hv({className:e="",title:t,status:n,description:i,metadata:r,detailAction:s,action:o,auxiliaryAction:l}){return a.jsxs(xH,{className:`library-resource-card ${e}`.trim(),activateLabel:`${s.label} ${t}`,onActivate:s.disabled?void 0:s.onClick,footer:a.jsx(tPe,{items:r.map(c=>({label:c.label,value:c.value,title:c.title,hideLabel:!0}))}),actions:a.jsxs(a.Fragment,{children:[l?a.jsx(MB,{className:"library-resource-card__auxiliary-action",label:`${l.label} ${t}`,tone:"secondary",disabled:l.disabled,title:l.title??l.label,onClick:l.onClick,children:l.icon}):null,o?a.jsx(MB,{label:`${o.label} ${t}`,icon:o.icon,disabled:o.disabled,title:o.title,onClick:o.onClick}):null]}),children:[a.jsx(wH,{leading:a.jsx(r1,{seed:t}),title:t,titleText:t,status:n}),a.jsx(kH,{title:i,children:i})]})}function jhn(){}function Wee(e){const t=[],n=String(e||"");let i=n.indexOf(","),r=0,s=!1;for(;!s;){i===-1&&(i=n.length,s=!0);const o=n.slice(r,i).trim();(o||!s)&&t.push(o),r=i+1,i=n.indexOf(",",r)}return t}function fPe(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const zbt=/[$_\p{ID_Start}]/u,Vbt=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,Hbt=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,qbt=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Wbt=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,hPe={};function Nhn(e){return e?zbt.test(String.fromCodePoint(e)):!1}function Rhn(e,t){const i=(t||hPe).jsx?Hbt:Vbt;return e?i.test(String.fromCodePoint(e)):!1}function Kee(e,t){return(hPe.jsx?Wbt:qbt).test(e)}const Kbt=/[ \t\n\f\r]/g;function Gbt(e){return typeof e=="object"?e.type==="text"?Gee(e.value):!1:Gee(e)}function Gee(e){return e.replace(Kbt,"")===""}let pT=class{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}};pT.prototype.normal={};pT.prototype.property={};pT.prototype.space=void 0;function pPe(e,t){const n={},i={};for(const r of e)Object.assign(n,r.property),Object.assign(i,r.normal);return new pT(n,i,t)}function SC(e){return e.toLowerCase()}class zc{constructor(t,n){this.attribute=n,this.property=t}}zc.prototype.attribute="";zc.prototype.booleanish=!1;zc.prototype.boolean=!1;zc.prototype.commaOrSpaceSeparated=!1;zc.prototype.commaSeparated=!1;zc.prototype.defined=!1;zc.prototype.mustUseProperty=!1;zc.prototype.number=!1;zc.prototype.overloadedBoolean=!1;zc.prototype.property="";zc.prototype.spaceSeparated=!1;zc.prototype.space=void 0;let Xbt=0;const Ii=qv(),qa=qv(),$B=qv(),qt=qv(),vs=qv(),pw=qv(),fu=qv();function qv(){return 2**++Xbt}const FB=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ii,booleanish:qa,commaOrSpaceSeparated:fu,commaSeparated:pw,number:qt,overloadedBoolean:$B,spaceSeparated:vs},Symbol.toStringTag,{value:"Module"})),d4=Object.keys(FB);class SH extends zc{constructor(t,n,i,r){let s=-1;if(super(t,n),Xee(this,"space",r),typeof i=="number")for(;++s4&&n.slice(0,4)==="data"&&tyt.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(Yee,iyt);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!Yee.test(s)){let o=s.replace(eyt,nyt);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}r=SH}return new r(i,t)}function nyt(e){return"-"+e.toLowerCase()}function iyt(e){return e.charAt(1).toUpperCase()}const mT=pPe([mPe,Ybt,yPe,vPe,xPe],"html"),Ab=pPe([mPe,Zbt,yPe,vPe,xPe],"svg");function Zee(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function wPe(e){return e.join(" ").trim()}var EH={},Jee=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,ryt=/\n/g,syt=/^\s*/,ayt=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,oyt=/^:\s*/,lyt=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,cyt=/^[;\s]*/,uyt=/^\s+|\s+$/g,dyt=` -`,ete="/",tte="*",gy="",fyt="comment",hyt="declaration";function pyt(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,i=1;function r(g){var b=g.match(ryt);b&&(n+=b.length);var v=g.lastIndexOf(dyt);i=~v?g.length-v:i+g.length}function s(){var g={line:n,column:i};return function(b){return b.position=new o(g),u(),b}}function o(g){this.start=g,this.end={line:n,column:i},this.source=t.source}o.prototype.content=e;function l(g){var b=new Error(t.source+":"+n+":"+i+": "+g);if(b.reason=g,b.filename=t.source,b.line=n,b.column=i,b.source=e,!t.silent)throw b}function c(g){var b=g.exec(e);if(b){var v=b[0];return r(v),e=e.slice(v.length),b}}function u(){c(syt)}function d(g){var b;for(g=g||[];b=f();)b!==!1&&g.push(b);return g}function f(){var g=s();if(!(ete!=e.charAt(0)||tte!=e.charAt(1))){for(var b=2;gy!=e.charAt(b)&&(tte!=e.charAt(b)||ete!=e.charAt(b+1));)++b;if(b+=2,gy===e.charAt(b-1))return l("End of comment missing");var v=e.slice(2,b-2);return i+=2,r(v),e=e.slice(b),i+=2,g({type:fyt,comment:v})}}function h(){var g=s(),b=c(ayt);if(b){if(f(),!c(oyt))return l("property missing ':'");var v=c(lyt),y=g({type:hyt,property:nte(b[0].replace(Jee,gy)),value:v?nte(v[0].replace(Jee,gy)):gy});return c(cyt),y}}function m(){var g=[];d(g);for(var b;b=h();)b!==!1&&(g.push(b),d(g));return g}return u(),m()}function nte(e){return e?e.replace(uyt,gy):gy}var myt=pyt,gyt=lg&&lg.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(EH,"__esModule",{value:!0});EH.default=yyt;const byt=gyt(myt);function yyt(e,t){let n=null;if(!e||typeof e!="string")return n;const i=(0,byt.default)(e),r=typeof t=="function";return i.forEach(s=>{if(s.type!=="declaration")return;const{property:o,value:l}=s;r?t(o,l,s):l&&(n=n||{},n[o]=l)}),n}var bM={};Object.defineProperty(bM,"__esModule",{value:!0});bM.camelCase=void 0;var vyt=/^--[a-zA-Z0-9_-]+$/,xyt=/-([a-z])/g,wyt=/^[^-]+$/,kyt=/^-(webkit|moz|ms|o|khtml)-/,Oyt=/^-(ms)-/,Syt=function(e){return!e||wyt.test(e)||vyt.test(e)},Eyt=function(e,t){return t.toUpperCase()},ite=function(e,t){return"".concat(t,"-")},Cyt=function(e,t){return t===void 0&&(t={}),Syt(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Oyt,ite):e=e.replace(kyt,ite),e.replace(xyt,Eyt))};bM.camelCase=Cyt;var Ayt=lg&&lg.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Tyt=Ayt(EH),_yt=bM;function BB(e,t){var n={};return!e||typeof e!="string"||(0,Tyt.default)(e,function(i,r){i&&r&&(n[(0,_yt.camelCase)(i,t)]=r)}),n}BB.default=BB;var jyt=BB;const Nyt=N1(jyt),yM=kPe("end"),Ih=kPe("start");function kPe(e){return t;function t(n){const i=n&&n.position&&n.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function Ryt(e){const t=Ih(e),n=yM(e);if(t&&n)return{start:t,end:n}}function cE(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?rte(e.position):"start"in e||"end"in e?rte(e):"line"in e||"column"in e?UB(e):""}function UB(e){return ste(e&&e.line)+":"+ste(e&&e.column)}function rte(e){return UB(e&&e.start)+"-"+UB(e&&e.end)}function ste(e){return e&&typeof e=="number"?e:1}class jl extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let r="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?r=t:!s.cause&&t&&(o=!0,r=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof i=="string"){const c=i.indexOf(":");c===-1?s.ruleId=i:(s.source=i.slice(0,c),s.ruleId=i.slice(c+1))}if(!s.place&&s.ancestors&&s.ancestors){const c=s.ancestors[s.ancestors.length-1];c&&(s.place=c.position)}const l=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=l?l.line:void 0,this.name=cE(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}jl.prototype.file="";jl.prototype.name="";jl.prototype.reason="";jl.prototype.message="";jl.prototype.stack="";jl.prototype.column=void 0;jl.prototype.line=void 0;jl.prototype.ancestors=void 0;jl.prototype.cause=void 0;jl.prototype.fatal=void 0;jl.prototype.place=void 0;jl.prototype.ruleId=void 0;jl.prototype.source=void 0;const CH={}.hasOwnProperty,Iyt=new Map,Pyt=/[A-Z]/g,Dyt=new Set(["table","tbody","thead","tfoot","tr"]),Myt=new Set(["td","th"]),OPe="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Lyt(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let i;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=Hyt(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");i=Vyt(n,t.jsx,t.jsxs)}const r={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,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"?Ab:mT,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=SPe(r,e,void 0);return s&&typeof s!="string"?s:r.create(e,r.Fragment,{children:s||void 0},void 0)}function SPe(e,t,n){if(t.type==="element")return $yt(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Fyt(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Uyt(e,t,n);if(t.type==="mdxjsEsm")return Byt(e,t);if(t.type==="root")return Qyt(e,t,n);if(t.type==="text")return zyt(e,t)}function $yt(e,t,n){const i=e.schema;let r=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(r=Ab,e.schema=r),e.ancestors.push(t);const s=CPe(e,t.tagName,!1),o=qyt(e,t);let l=TH(e,t);return Dyt.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!Gbt(c):!0})),EPe(e,o,s,t),AH(o,l),e.ancestors.pop(),e.schema=i,e.create(t,s,o,n)}function Fyt(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}EC(e,t.position)}function Byt(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);EC(e,t.position)}function Uyt(e,t,n){const i=e.schema;let r=i;t.name==="svg"&&i.space==="html"&&(r=Ab,e.schema=r),e.ancestors.push(t);const s=t.name===null?e.Fragment:CPe(e,t.name,!0),o=Wyt(e,t),l=TH(e,t);return EPe(e,o,s,t),AH(o,l),e.ancestors.pop(),e.schema=i,e.create(t,s,o,n)}function Qyt(e,t,n){const i={};return AH(i,TH(e,t)),e.create(t,e.Fragment,i,n)}function zyt(e,t){return t.value}function EPe(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function AH(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Vyt(e,t,n){return i;function i(r,s,o,l){const u=Array.isArray(o.children)?n:t;return l?u(s,o,l):u(s,o)}}function Hyt(e,t){return n;function n(i,r,s,o){const l=Array.isArray(s.children),c=Ih(i);return t(r,s,o,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function qyt(e,t){const n={};let i,r;for(r in t.properties)if(r!=="children"&&CH.call(t.properties,r)){const s=Kyt(e,r,t.properties[r]);if(s){const[o,l]=s;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&Myt.has(t.tagName)?i=l:n[o]=l}}if(i){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function Wyt(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const s=i.data.estree.body[0];s.type;const o=s.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else EC(e,t.position);else{const r=i.name;let s;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const l=i.value.data.estree.body[0];l.type,s=e.evaluater.evaluateExpression(l.expression)}else EC(e,t.position);else s=i.value===null?!0:i.value;n[r]=s}return n}function TH(e,t){const n=[];let i=-1;const r=e.passKeys?new Map:Iyt;for(;++ir?0:r+t:t=t>r?r:t,n=n>0?n:0,i.length<1e4)o=Array.from(i),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s0?(Du(e,e.length,0,t),e):t}const lte={}.hasOwnProperty;function TPe(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 ff(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Xl=Tb(/[A-Za-z]/),Al=Tb(/[\dA-Za-z]/),ivt=Tb(/[#-'*+\--9=?A-Z^-~]/);function wI(e){return e!==null&&(e<32||e===127)}const QB=Tb(/\d/),rvt=Tb(/[\dA-Fa-f]/),svt=Tb(/[!-/:-@[-`{-~]/);function Wn(e){return e!==null&&e<-2}function ds(e){return e!==null&&(e<0||e===32)}function Zi(e){return e===-2||e===-1||e===32}const vM=Tb(new RegExp("\\p{P}|\\p{S}","u")),fv=Tb(/\s/);function Tb(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function sk(e){const t=[];let n=-1,i=0,r=0;for(;++n55295&&s<57344){const l=e.charCodeAt(n+1);s<56320&&l>56319&&l<57344?(o=String.fromCharCode(s,l),r=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(i,n),encodeURIComponent(o)),i=n+r+1,o=""),r&&(n+=r,r=0)}return t.join("")+e.slice(i)}function gr(e,t,n,i){const r=i?i-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(c){return Zi(c)?(e.enter(n),l(c)):t(c)}function l(c){return Zi(c)&&s++o))return;const A=t.events.length;let E=A,j,T;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){if(j){T=t.events[E][1].end;break}j=!0}for(y(i),O=A;Ox;){const S=n[k];t.containerState=S[1],S[0].exit.call(t,e)}n.length=x}function w(){r.write([null]),s=void 0,r=void 0,t.containerState._closeFlow=void 0}}function uvt(e,t,n){return gr(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function s1(e){if(e===null||ds(e)||fv(e))return 1;if(vM(e))return 2}function xM(e,t,n){const i=[];let r=-1;for(;++r1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[i][1].end},h={...e[n][1].start};ute(f,-c),ute(h,c),o={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[i][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},s={type:c>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},r={type:c>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[i][1].end={...o.start},e[n][1].start={...l.end},u=[],e[i][1].end.offset-e[i][1].start.offset&&(u=sd(u,[["enter",e[i][1],t],["exit",e[i][1],t]])),u=sd(u,[["enter",r,t],["enter",o,t],["exit",o,t],["enter",s,t]]),u=sd(u,xM(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),u=sd(u,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",r,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=sd(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Du(e,i-1,n-i+3,u),n=i+u.length-d-2;break}}for(n=-1;++n0&&Zi(O)?gr(e,w,"linePrefix",s+1)(O):w(O)}function w(O){return O===null||Wn(O)?e.check(dte,b,k)(O):(e.enter("codeFlowValue"),x(O))}function x(O){return O===null||Wn(O)?(e.exit("codeFlowValue"),w(O)):(e.consume(O),x)}function k(O){return e.exit("codeFenced"),t(O)}function S(O,A,E){let j=0;return T;function T(I){return O.enter("lineEnding"),O.consume(I),O.exit("lineEnding"),R}function R(I){return O.enter("codeFencedFence"),Zi(I)?gr(O,C,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):C(I)}function C(I){return I===l?(O.enter("codeFencedFenceSequence"),N(I)):E(I)}function N(I){return I===l?(j++,O.consume(I),N):j>=o?(O.exit("codeFencedFenceSequence"),Zi(I)?gr(O,P,"whitespace")(I):P(I)):E(I)}function P(I){return I===null||Wn(I)?(O.exit("codeFencedFence"),A(I)):E(I)}}}function kvt(e,t,n){const i=this;return r;function r(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}const h4={name:"codeIndented",tokenize:Svt},Ovt={partial:!0,tokenize:Evt};function Svt(e,t,n){const i=this;return r;function r(u){return e.enter("codeIndented"),gr(e,s,"linePrefix",5)(u)}function s(u){const d=i.events[i.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(u):n(u)}function o(u){return u===null?c(u):Wn(u)?e.attempt(Ovt,o,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Wn(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function Evt(e,t,n){const i=this;return r;function r(o){return i.parser.lazy[i.now().line]?n(o):Wn(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r):gr(e,s,"linePrefix",5)(o)}function s(o){const l=i.events[i.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):Wn(o)?r(o):n(o)}}const Cvt={name:"codeText",previous:Tvt,resolve:Avt,tokenize:_vt};function Avt(e){let t=e.length-4,n=3,i,r;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i=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-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const r=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return i&&yO(this.left,i),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),yO(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),yO(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(o):e.interrupt(i.parser.constructs.flow,n,t)(o)}}function PPe(e,t,n,i,r,s,o,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return f;function f(y){return y===60?(e.enter(i),e.enter(r),e.enter(s),e.consume(y),e.exit(s),h):y===null||y===32||y===41||wI(y)?n(y):(e.enter(i),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),b(y))}function h(y){return y===62?(e.enter(s),e.consume(y),e.exit(s),e.exit(r),e.exit(i),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===62?(e.exit("chunkString"),e.exit(l),h(y)):y===null||y===60||Wn(y)?n(y):(e.consume(y),y===92?g:m)}function g(y){return y===60||y===62||y===92?(e.consume(y),m):m(y)}function b(y){return!d&&(y===null||y===41||ds(y))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(i),t(y)):d999||m===null||m===91||m===93&&!c||m===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(m):m===93?(e.exit(s),e.enter(r),e.consume(m),e.exit(r),e.exit(i),t):Wn(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(m))}function f(m){return m===null||m===91||m===93||Wn(m)||l++>999?(e.exit("chunkString"),d(m)):(e.consume(m),c||(c=!Zi(m)),m===92?h:f)}function h(m){return m===91||m===92||m===93?(e.consume(m),l++,f):f(m)}}function MPe(e,t,n,i,r,s){let o;return l;function l(h){return h===34||h===39||h===40?(e.enter(i),e.enter(r),e.consume(h),e.exit(r),o=h===40?41:h,c):n(h)}function c(h){return h===o?(e.enter(r),e.consume(h),e.exit(r),e.exit(i),t):(e.enter(s),u(h))}function u(h){return h===o?(e.exit(s),c(o)):h===null?n(h):Wn(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),gr(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===o||h===null||Wn(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:d)}function f(h){return h===o||h===92?(e.consume(h),d):d(h)}}function uE(e,t){let n;return i;function i(r){return Wn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n=!0,i):Zi(r)?gr(e,i,n?"linePrefix":"lineSuffix")(r):t(r)}}const Lvt={name:"definition",tokenize:Fvt},$vt={partial:!0,tokenize:Bvt};function Fvt(e,t,n){const i=this;let r;return s;function s(m){return e.enter("definition"),o(m)}function o(m){return DPe.call(i,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function l(m){return r=ff(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),c):n(m)}function c(m){return ds(m)?uE(e,u)(m):u(m)}function u(m){return PPe(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function d(m){return e.attempt($vt,f,f)(m)}function f(m){return Zi(m)?gr(e,h,"whitespace")(m):h(m)}function h(m){return m===null||Wn(m)?(e.exit("definition"),i.parser.defined.push(r),t(m)):n(m)}}function Bvt(e,t,n){return i;function i(l){return ds(l)?uE(e,r)(l):n(l)}function r(l){return MPe(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return Zi(l)?gr(e,o,"whitespace")(l):o(l)}function o(l){return l===null||Wn(l)?t(l):n(l)}}const Uvt={name:"hardBreakEscape",tokenize:Qvt};function Qvt(e,t,n){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),r}function r(s){return Wn(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const zvt={name:"headingAtx",resolve:Vvt,tokenize:Hvt};function Vvt(e,t){let n=e.length-2,i=3,r,s;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(r={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},s={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},Du(e,i,n-i+1,[["enter",r,t],["enter",s,t],["exit",s,t],["exit",r,t]])),e}function Hvt(e,t,n){let i=0;return r;function r(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&i++<6?(e.consume(d),o):d===null||ds(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||Wn(d)?(e.exit("atxHeading"),t(d)):Zi(d)?gr(e,l,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),l(d))}function u(d){return d===null||d===35||ds(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const qvt=["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"],hte=["pre","script","style","textarea"],Wvt={concrete:!0,name:"htmlFlow",resolveTo:Xvt,tokenize:Yvt},Kvt={partial:!0,tokenize:Jvt},Gvt={partial:!0,tokenize:Zvt};function Xvt(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 Yvt(e,t,n){const i=this;let r,s,o,l,c;return u;function u(U){return d(U)}function d(U){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(U),f}function f(U){return U===33?(e.consume(U),h):U===47?(e.consume(U),s=!0,b):U===63?(e.consume(U),r=3,i.interrupt?t:M):Xl(U)?(e.consume(U),o=String.fromCharCode(U),v):n(U)}function h(U){return U===45?(e.consume(U),r=2,m):U===91?(e.consume(U),r=5,l=0,g):Xl(U)?(e.consume(U),r=4,i.interrupt?t:M):n(U)}function m(U){return U===45?(e.consume(U),i.interrupt?t:M):n(U)}function g(U){const Z="CDATA[";return U===Z.charCodeAt(l++)?(e.consume(U),l===Z.length?i.interrupt?t:C:g):n(U)}function b(U){return Xl(U)?(e.consume(U),o=String.fromCharCode(U),v):n(U)}function v(U){if(U===null||U===47||U===62||ds(U)){const Z=U===47,z=o.toLowerCase();return!Z&&!s&&hte.includes(z)?(r=1,i.interrupt?t(U):C(U)):qvt.includes(o.toLowerCase())?(r=6,Z?(e.consume(U),y):i.interrupt?t(U):C(U)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(U):s?w(U):x(U))}return U===45||Al(U)?(e.consume(U),o+=String.fromCharCode(U),v):n(U)}function y(U){return U===62?(e.consume(U),i.interrupt?t:C):n(U)}function w(U){return Zi(U)?(e.consume(U),w):T(U)}function x(U){return U===47?(e.consume(U),T):U===58||U===95||Xl(U)?(e.consume(U),k):Zi(U)?(e.consume(U),x):T(U)}function k(U){return U===45||U===46||U===58||U===95||Al(U)?(e.consume(U),k):S(U)}function S(U){return U===61?(e.consume(U),O):Zi(U)?(e.consume(U),S):x(U)}function O(U){return U===null||U===60||U===61||U===62||U===96?n(U):U===34||U===39?(e.consume(U),c=U,A):Zi(U)?(e.consume(U),O):E(U)}function A(U){return U===c?(e.consume(U),c=null,j):U===null||Wn(U)?n(U):(e.consume(U),A)}function E(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||ds(U)?S(U):(e.consume(U),E)}function j(U){return U===47||U===62||Zi(U)?x(U):n(U)}function T(U){return U===62?(e.consume(U),R):n(U)}function R(U){return U===null||Wn(U)?C(U):Zi(U)?(e.consume(U),R):n(U)}function C(U){return U===45&&r===2?(e.consume(U),D):U===60&&r===1?(e.consume(U),_):U===62&&r===4?(e.consume(U),H):U===63&&r===3?(e.consume(U),M):U===93&&r===5?(e.consume(U),F):Wn(U)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(Kvt,q,N)(U)):U===null||Wn(U)?(e.exit("htmlFlowData"),N(U)):(e.consume(U),C)}function N(U){return e.check(Gvt,P,q)(U)}function P(U){return e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),I}function I(U){return U===null||Wn(U)?N(U):(e.enter("htmlFlowData"),C(U))}function D(U){return U===45?(e.consume(U),M):C(U)}function _(U){return U===47?(e.consume(U),o="",L):C(U)}function L(U){if(U===62){const Z=o.toLowerCase();return hte.includes(Z)?(e.consume(U),H):C(U)}return Xl(U)&&o.length<8?(e.consume(U),o+=String.fromCharCode(U),L):C(U)}function F(U){return U===93?(e.consume(U),M):C(U)}function M(U){return U===62?(e.consume(U),H):U===45&&r===2?(e.consume(U),M):C(U)}function H(U){return U===null||Wn(U)?(e.exit("htmlFlowData"),q(U)):(e.consume(U),H)}function q(U){return e.exit("htmlFlow"),t(U)}}function Zvt(e,t,n){const i=this;return r;function r(o){return Wn(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}function Jvt(e,t,n){return i;function i(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(gT,t,n)}}const e0t={name:"htmlText",tokenize:t0t};function t0t(e,t,n){const i=this;let r,s,o;return l;function l(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),c}function c(M){return M===33?(e.consume(M),u):M===47?(e.consume(M),S):M===63?(e.consume(M),x):Xl(M)?(e.consume(M),E):n(M)}function u(M){return M===45?(e.consume(M),d):M===91?(e.consume(M),s=0,g):Xl(M)?(e.consume(M),w):n(M)}function d(M){return M===45?(e.consume(M),m):n(M)}function f(M){return M===null?n(M):M===45?(e.consume(M),h):Wn(M)?(o=f,_(M)):(e.consume(M),f)}function h(M){return M===45?(e.consume(M),m):f(M)}function m(M){return M===62?D(M):M===45?h(M):f(M)}function g(M){const H="CDATA[";return M===H.charCodeAt(s++)?(e.consume(M),s===H.length?b:g):n(M)}function b(M){return M===null?n(M):M===93?(e.consume(M),v):Wn(M)?(o=b,_(M)):(e.consume(M),b)}function v(M){return M===93?(e.consume(M),y):b(M)}function y(M){return M===62?D(M):M===93?(e.consume(M),y):b(M)}function w(M){return M===null||M===62?D(M):Wn(M)?(o=w,_(M)):(e.consume(M),w)}function x(M){return M===null?n(M):M===63?(e.consume(M),k):Wn(M)?(o=x,_(M)):(e.consume(M),x)}function k(M){return M===62?D(M):x(M)}function S(M){return Xl(M)?(e.consume(M),O):n(M)}function O(M){return M===45||Al(M)?(e.consume(M),O):A(M)}function A(M){return Wn(M)?(o=A,_(M)):Zi(M)?(e.consume(M),A):D(M)}function E(M){return M===45||Al(M)?(e.consume(M),E):M===47||M===62||ds(M)?j(M):n(M)}function j(M){return M===47?(e.consume(M),D):M===58||M===95||Xl(M)?(e.consume(M),T):Wn(M)?(o=j,_(M)):Zi(M)?(e.consume(M),j):D(M)}function T(M){return M===45||M===46||M===58||M===95||Al(M)?(e.consume(M),T):R(M)}function R(M){return M===61?(e.consume(M),C):Wn(M)?(o=R,_(M)):Zi(M)?(e.consume(M),R):j(M)}function C(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),r=M,N):Wn(M)?(o=C,_(M)):Zi(M)?(e.consume(M),C):(e.consume(M),P)}function N(M){return M===r?(e.consume(M),r=void 0,I):M===null?n(M):Wn(M)?(o=N,_(M)):(e.consume(M),N)}function P(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||ds(M)?j(M):(e.consume(M),P)}function I(M){return M===47||M===62||ds(M)?j(M):n(M)}function D(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function _(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),L}function L(M){return Zi(M)?gr(e,F,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):F(M)}function F(M){return e.enter("htmlTextData"),o(M)}}const NH={name:"labelEnd",resolveAll:s0t,resolveTo:a0t,tokenize:o0t},n0t={tokenize:l0t},i0t={tokenize:c0t},r0t={tokenize:u0t};function s0t(e){let t=-1;const n=[];for(;++t=3&&(u===null||Wn(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===r?(e.consume(u),i++,c):(e.exit("thematicBreakSequence"),Zi(u)?gr(e,l,"whitespace")(u):l(u))}}const yc={continuation:{tokenize:x0t},exit:k0t,name:"list",tokenize:v0t},b0t={partial:!0,tokenize:O0t},y0t={partial:!0,tokenize:w0t};function v0t(e,t,n){const i=this,r=i.events[i.events.length-1];let s=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,o=0;return l;function l(m){const g=i.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!i.containerState.marker||m===i.containerState.marker:QB(m)){if(i.containerState.type||(i.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(TN,n,u)(m):u(m);if(!i.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(m)}return n(m)}function c(m){return QB(m)&&++o<10?(e.consume(m),c):(!i.interrupt||o<2)&&(i.containerState.marker?m===i.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):n(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||m,e.check(gT,i.interrupt?n:d,e.attempt(b0t,h,f))}function d(m){return i.containerState.initialBlankLine=!0,s++,h(m)}function f(m){return Zi(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),h):n(m)}function h(m){return i.containerState.size=s+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function x0t(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(gT,r,s);function r(l){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,gr(e,t,"listItemIndent",i.containerState.size+1)(l)}function s(l){return i.containerState.furtherBlankLines||!Zi(l)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,o(l)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(y0t,t,o)(l))}function o(l){return i.containerState._closeFlow=!0,i.interrupt=void 0,gr(e,e.attempt(yc,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function w0t(e,t,n){const i=this;return gr(e,r,"listItemIndent",i.containerState.size+1);function r(s){const o=i.events[i.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===i.containerState.size?t(s):n(s)}}function k0t(e){e.exit(this.containerState.type)}function O0t(e,t,n){const i=this;return gr(e,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(s){const o=i.events[i.events.length-1];return!Zi(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const pte={name:"setextUnderline",resolveTo:S0t,tokenize:E0t};function S0t(e,t){let n=e.length,i,r,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(r=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",s?(e.splice(r,0,["enter",o,t]),e.splice(s+1,0,["exit",e[i][1],t]),e[i][1].end={...e[s][1].end}):e[i][1]=o,e.push(["exit",o,t]),e}function E0t(e,t,n){const i=this;let r;return s;function s(u){let d=i.events.length,f;for(;d--;)if(i.events[d][1].type!=="lineEnding"&&i.events[d][1].type!=="linePrefix"&&i.events[d][1].type!=="content"){f=i.events[d][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||f)?(e.enter("setextHeadingLine"),r=u,o(u)):n(u)}function o(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===r?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),Zi(u)?gr(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Wn(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const C0t={tokenize:A0t};function A0t(e){const t=this,n=e.attempt(gT,i,e.attempt(this.parser.constructs.flowInitial,r,gr(e,e.attempt(this.parser.constructs.flow,r,e.attempt(Rvt,r)),"linePrefix")));return n;function i(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const T0t={resolveAll:$Pe()},_0t=LPe("string"),j0t=LPe("text");function LPe(e){return{resolveAll:$Pe(e==="text"?N0t:void 0),tokenize:t};function t(n){const i=this,r=this.parser.constructs[e],s=n.attempt(r,o,l);return o;function o(d){return u(d)?s(d):l(d)}function l(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),c}function c(d){return u(d)?(n.exit("data"),s(d)):(n.consume(d),c)}function u(d){if(d===null)return!0;const f=r[d];let h=-1;if(f)for(;++h-1){const l=o[0];typeof l=="string"?o[0]=l.slice(i):o.shift()}s>0&&o.push(e[r].slice(0,s))}return o}function V0t(e,t){let n=-1;const i=[];let r;for(;++n{const n=jd(t),i=AN(n.msg,n.message);if(!i)return"";const r=Array.isArray(n.loc)?n.loc.filter(s=>typeof s=="string"||typeof s=="number").map(String).join("."):"";return r?`${r}: ${i}`:i}).filter(Boolean).join("; "):""}function _bt(e,t=!0){const n=jd(e),i=Object.prototype.hasOwnProperty.call(n,"detail")?n.detail:typeof e=="string"?e:void 0,r=jd(i);return{message:typeof i=="string"?t?i.trim():"":AN(r.message,n.message,Tbt(i)),errorCode:AN(r.errorCode,n.errorCode),requestId:AN(r.requestId,r.request_id,r.RequestId,n.requestId,n.request_id),diagnostics:r.diagnostics??n.diagnostics,detail:i,payload:e}}function jd(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function cr(e){return typeof e=="string"?e:""}function OC(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}function OH(e){const t=jd(e);return{id:cr(t.id),name:cr(t.name),description:cr(t.description),providerType:cr(t.providerType),providerKnowledgeId:cr(t.providerKnowledgeId),projectName:cr(t.projectName),region:cr(t.region),status:cr(t.status),createdAt:cr(t.createdAt),updatedAt:cr(t.updatedAt),ownerId:cr(t.ownerId),ownerLabel:cr(t.ownerLabel),canManage:t.canManage===!0}}function hT(e){const t=jd(e);return{id:cr(t.id),name:cr(t.name),type:cr(t.type),sizeBytes:OC(t.sizeBytes,0),status:cr(t.status),url:cr(t.url),tosPath:cr(t.tosPath),metadata:jd(t.metadata),createdAt:cr(t.createdAt),updatedAt:cr(t.updatedAt),sourceMarkdown:cr(t.sourceMarkdown)}}function jbt(e){const t=jd(e),n=t.attachment,i=jd(n);return{id:cr(t.id),title:cr(t.title),content:cr(t.content),attachmentUrl:cr(t.attachmentUrl)||cr(i.url)||cr(i.previewUrl),attachmentType:cr(t.attachmentType)||cr(i.type)||cr(i.mimeType),attachment:n,tableFields:t.tableFields}}async function Ef(e,t={},n=eo){var f;const i=hl(oc(t.headers));i.set("accept","application/json"),t.body&&!(t.body instanceof FormData)&&i.set("content-type","application/json");const r=await fetch(e,{...t,headers:i,signal:po(t.signal,n)});if(r.ok)return r.status===204?void 0:r.json();const s=await r.text();let o=s,l=!1;if(s)try{o=JSON.parse(s),l=!0}catch{}const c=((f=r.headers.get("content-type"))==null?void 0:f.toLowerCase())||"",u=_bt(o,l||c.startsWith("text/plain")),d=r.status===401?Q("knowledge.signInRequired"):r.status===403?Q("knowledge.forbidden"):r.status===404?Q("knowledge.notFound"):r.status===409?Q("knowledge.conflict"):Q("knowledge.requestFailed",{status:r.status});throw new mM(u.message||d,r.status,{errorCode:u.errorCode,requestId:u.requestId,diagnostics:u.diagnostics,detail:u.detail,payload:u.payload,rawBody:s})}function Vv(e){const t=new URLSearchParams;e.trim()&&t.set("region",e.trim());const n=t.toString();return n?`?${n}`:""}async function Nbt(e){var r;const t=new URLSearchParams({region:e.region,pageSize:String(e.pageSize??30)});(r=e.projectName)!=null&&r.trim()&&t.set("projectName",e.projectName.trim()),e.nextToken&&t.set("nextToken",e.nextToken);const n=await Ef(`/web/knowledge-bases?${t.toString()}`,{signal:e.signal}),i=jd(n);return{items:Array.isArray(i.items)?i.items.map(OH):[],nextToken:cr(i.nextToken)}}function Rbt(e){return`${e.region}\0${e.id}`}async function Ibt(e){var l;const t=[...new Set(e.regions.map(c=>c.trim()).filter(Boolean))],n=e.nextTokens?t.filter(c=>{var u;return!!((u=e.nextTokens)!=null&&u[c])}):t;if(n.length===0)return{items:[],nextTokens:{},failures:[]};const i=await Promise.allSettled(n.map(async c=>{var u;return{region:c,page:await Nbt({region:c,projectName:e.projectName,nextToken:(u=e.nextTokens)==null?void 0:u[c],pageSize:e.pageSize,signal:e.signal})}}));if((l=e.signal)!=null&&l.aborted)throw new DOMException("Aborted","AbortError");const r=[],s={},o=new Map;if(i.forEach((c,u)=>{var f;const d=n[u];if(c.status==="rejected"){const h=(f=e.nextTokens)==null?void 0:f[d];h&&(s[d]=h),r.push({region:d,error:c.reason instanceof Error?c.reason:new Error(Q("knowledge.loadFailed"))});return}c.value.page.nextToken&&(s[d]=c.value.page.nextToken),c.value.page.items.forEach(h=>{const m=h.region?h:{...h,region:d};o.set(Rbt(m),m)})}),r.length===n.length)throw new dPe(r);return{items:[...o.values()],nextTokens:s,failures:r}}function Pbt(e){return Ef("/web/knowledge-bases",{method:"POST",body:JSON.stringify(e)},yr).then(OH)}function Dbt(e,t,n){return Ef(`/web/knowledge-bases/${encodeURIComponent(e)}${Vv(t)}`,{method:"PATCH",body:JSON.stringify(n)}).then(OH)}function Mbt(e,t){return Ef(`/web/knowledge-bases/${encodeURIComponent(e)}${Vv(t)}`,{method:"DELETE"},yr)}async function Lbt(e,t){var s;const n=new URLSearchParams({region:t.region,offset:String(t.offset??0),limit:String(t.limit??30)});(s=t.documentType)!=null&&s.trim()&&n.set("documentType",t.documentType.trim());const i=await Ef(`/web/knowledge-bases/${encodeURIComponent(e)}/documents?${n.toString()}`,{signal:t.signal}),r=jd(i);return{items:Array.isArray(r.items)?r.items.map(hT):[],offset:OC(r.offset,0),limit:OC(r.limit,t.limit??30),hasMore:r.hasMore===!0}}async function $bt(e,t,n){const i=new URLSearchParams({region:n.region,offset:String(n.offset??0),limit:String(n.limit??20)}),r=await Ef(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}/preview?${i.toString()}`,{signal:n.signal}),s=jd(r);return{document:hT(s.document),chunks:Array.isArray(s.chunks)?s.chunks.map(jbt):[],sourceMarkdown:cr(s.sourceMarkdown),offset:OC(s.offset,0),limit:OC(s.limit,n.limit??20),hasMore:s.hasMore===!0}}function Fbt(e,t,n){return Ef(`/web/knowledge-bases/${encodeURIComponent(e)}/documents${Vv(t)}`,{method:"POST",body:JSON.stringify(n)},yr).then(hT)}async function Bbt(e,t,n){const i=await Ef(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/web-preview${Vv(t)}`,{method:"POST",body:JSON.stringify({sourceType:"url",url:n.url})},yr),r=jd(i);return{name:cr(r.name),url:cr(r.url),sourceMarkdown:cr(r.sourceMarkdown)}}function Ubt(e,t,n){var r,s;const i=new FormData;return i.set("file",n.file),(r=n.name)!=null&&r.trim()&&i.set("name",n.name.trim()),(s=n.documentType)!=null&&s.trim()&&i.set("documentType",n.documentType.trim()),n.metadata&&i.set("metadata",JSON.stringify(n.metadata)),Ef(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/upload${Vv(t)}`,{method:"POST",body:i},yr).then(hT)}function Qbt(e,t,n,i){return Ef(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}${Vv(n)}`,{method:"PATCH",body:JSON.stringify(i)}).then(hT)}function zbt(e,t,n){return Ef(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}${Vv(n)}`,{method:"DELETE"},yr)}function Hv({className:e="",title:t,status:n,description:i,metadata:r,detailAction:s,action:o,auxiliaryAction:l}){return a.jsxs(xH,{className:`library-resource-card ${e}`.trim(),activateLabel:`${s.label} ${t}`,onActivate:s.disabled?void 0:s.onClick,footer:a.jsx(nPe,{items:r.map(c=>({label:c.label,value:c.value,title:c.title,hideLabel:!0}))}),actions:a.jsxs(a.Fragment,{children:[l?a.jsx(MB,{className:"library-resource-card__auxiliary-action",label:`${l.label} ${t}`,tone:"secondary",disabled:l.disabled,title:l.title??l.label,onClick:l.onClick,children:l.icon}):null,o?a.jsx(MB,{label:`${o.label} ${t}`,icon:o.icon,disabled:o.disabled,title:o.title,onClick:o.onClick}):null]}),children:[a.jsx(wH,{leading:a.jsx(r1,{seed:t}),title:t,titleText:t,status:n}),a.jsx(kH,{title:i,children:i})]})}function jhn(){}function Wee(e){const t=[],n=String(e||"");let i=n.indexOf(","),r=0,s=!1;for(;!s;){i===-1&&(i=n.length,s=!0);const o=n.slice(r,i).trim();(o||!s)&&t.push(o),r=i+1,i=n.indexOf(",",r)}return t}function hPe(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Vbt=/[$_\p{ID_Start}]/u,Hbt=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,qbt=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,Wbt=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Kbt=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pPe={};function Nhn(e){return e?Vbt.test(String.fromCodePoint(e)):!1}function Rhn(e,t){const i=(t||pPe).jsx?qbt:Hbt;return e?i.test(String.fromCodePoint(e)):!1}function Kee(e,t){return(pPe.jsx?Kbt:Wbt).test(e)}const Gbt=/[ \t\n\f\r]/g;function Xbt(e){return typeof e=="object"?e.type==="text"?Gee(e.value):!1:Gee(e)}function Gee(e){return e.replace(Gbt,"")===""}let pT=class{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}};pT.prototype.normal={};pT.prototype.property={};pT.prototype.space=void 0;function mPe(e,t){const n={},i={};for(const r of e)Object.assign(n,r.property),Object.assign(i,r.normal);return new pT(n,i,t)}function SC(e){return e.toLowerCase()}class zc{constructor(t,n){this.attribute=n,this.property=t}}zc.prototype.attribute="";zc.prototype.booleanish=!1;zc.prototype.boolean=!1;zc.prototype.commaOrSpaceSeparated=!1;zc.prototype.commaSeparated=!1;zc.prototype.defined=!1;zc.prototype.mustUseProperty=!1;zc.prototype.number=!1;zc.prototype.overloadedBoolean=!1;zc.prototype.property="";zc.prototype.spaceSeparated=!1;zc.prototype.space=void 0;let Ybt=0;const Ii=qv(),qa=qv(),$B=qv(),Wt=qv(),vs=qv(),pw=qv(),fu=qv();function qv(){return 2**++Ybt}const FB=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ii,booleanish:qa,commaOrSpaceSeparated:fu,commaSeparated:pw,number:Wt,overloadedBoolean:$B,spaceSeparated:vs},Symbol.toStringTag,{value:"Module"})),d4=Object.keys(FB);class SH extends zc{constructor(t,n,i,r){let s=-1;if(super(t,n),Xee(this,"space",r),typeof i=="number")for(;++s4&&n.slice(0,4)==="data"&&nyt.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(Yee,ryt);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!Yee.test(s)){let o=s.replace(tyt,iyt);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}r=SH}return new r(i,t)}function iyt(e){return"-"+e.toLowerCase()}function ryt(e){return e.charAt(1).toUpperCase()}const mT=mPe([gPe,Zbt,vPe,xPe,wPe],"html"),Ab=mPe([gPe,Jbt,vPe,xPe,wPe],"svg");function Zee(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function kPe(e){return e.join(" ").trim()}var EH={},Jee=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,syt=/\n/g,ayt=/^\s*/,oyt=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,lyt=/^:\s*/,cyt=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,uyt=/^[;\s]*/,dyt=/^\s+|\s+$/g,fyt=` +`,ete="/",tte="*",gy="",hyt="comment",pyt="declaration";function myt(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,i=1;function r(g){var b=g.match(syt);b&&(n+=b.length);var v=g.lastIndexOf(fyt);i=~v?g.length-v:i+g.length}function s(){var g={line:n,column:i};return function(b){return b.position=new o(g),u(),b}}function o(g){this.start=g,this.end={line:n,column:i},this.source=t.source}o.prototype.content=e;function l(g){var b=new Error(t.source+":"+n+":"+i+": "+g);if(b.reason=g,b.filename=t.source,b.line=n,b.column=i,b.source=e,!t.silent)throw b}function c(g){var b=g.exec(e);if(b){var v=b[0];return r(v),e=e.slice(v.length),b}}function u(){c(ayt)}function d(g){var b;for(g=g||[];b=f();)b!==!1&&g.push(b);return g}function f(){var g=s();if(!(ete!=e.charAt(0)||tte!=e.charAt(1))){for(var b=2;gy!=e.charAt(b)&&(tte!=e.charAt(b)||ete!=e.charAt(b+1));)++b;if(b+=2,gy===e.charAt(b-1))return l("End of comment missing");var v=e.slice(2,b-2);return i+=2,r(v),e=e.slice(b),i+=2,g({type:hyt,comment:v})}}function h(){var g=s(),b=c(oyt);if(b){if(f(),!c(lyt))return l("property missing ':'");var v=c(cyt),y=g({type:pyt,property:nte(b[0].replace(Jee,gy)),value:v?nte(v[0].replace(Jee,gy)):gy});return c(uyt),y}}function m(){var g=[];d(g);for(var b;b=h();)b!==!1&&(g.push(b),d(g));return g}return u(),m()}function nte(e){return e?e.replace(dyt,gy):gy}var gyt=myt,byt=lg&&lg.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(EH,"__esModule",{value:!0});EH.default=vyt;const yyt=byt(gyt);function vyt(e,t){let n=null;if(!e||typeof e!="string")return n;const i=(0,yyt.default)(e),r=typeof t=="function";return i.forEach(s=>{if(s.type!=="declaration")return;const{property:o,value:l}=s;r?t(o,l,s):l&&(n=n||{},n[o]=l)}),n}var bM={};Object.defineProperty(bM,"__esModule",{value:!0});bM.camelCase=void 0;var xyt=/^--[a-zA-Z0-9_-]+$/,wyt=/-([a-z])/g,kyt=/^[^-]+$/,Oyt=/^-(webkit|moz|ms|o|khtml)-/,Syt=/^-(ms)-/,Eyt=function(e){return!e||kyt.test(e)||xyt.test(e)},Cyt=function(e,t){return t.toUpperCase()},ite=function(e,t){return"".concat(t,"-")},Ayt=function(e,t){return t===void 0&&(t={}),Eyt(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Syt,ite):e=e.replace(Oyt,ite),e.replace(wyt,Cyt))};bM.camelCase=Ayt;var Tyt=lg&&lg.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},_yt=Tyt(EH),jyt=bM;function BB(e,t){var n={};return!e||typeof e!="string"||(0,_yt.default)(e,function(i,r){i&&r&&(n[(0,jyt.camelCase)(i,t)]=r)}),n}BB.default=BB;var Nyt=BB;const Ryt=N1(Nyt),yM=OPe("end"),Ih=OPe("start");function OPe(e){return t;function t(n){const i=n&&n.position&&n.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function Iyt(e){const t=Ih(e),n=yM(e);if(t&&n)return{start:t,end:n}}function cE(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?rte(e.position):"start"in e||"end"in e?rte(e):"line"in e||"column"in e?UB(e):""}function UB(e){return ste(e&&e.line)+":"+ste(e&&e.column)}function rte(e){return UB(e&&e.start)+"-"+UB(e&&e.end)}function ste(e){return e&&typeof e=="number"?e:1}class jl extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let r="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?r=t:!s.cause&&t&&(o=!0,r=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof i=="string"){const c=i.indexOf(":");c===-1?s.ruleId=i:(s.source=i.slice(0,c),s.ruleId=i.slice(c+1))}if(!s.place&&s.ancestors&&s.ancestors){const c=s.ancestors[s.ancestors.length-1];c&&(s.place=c.position)}const l=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=l?l.line:void 0,this.name=cE(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}jl.prototype.file="";jl.prototype.name="";jl.prototype.reason="";jl.prototype.message="";jl.prototype.stack="";jl.prototype.column=void 0;jl.prototype.line=void 0;jl.prototype.ancestors=void 0;jl.prototype.cause=void 0;jl.prototype.fatal=void 0;jl.prototype.place=void 0;jl.prototype.ruleId=void 0;jl.prototype.source=void 0;const CH={}.hasOwnProperty,Pyt=new Map,Dyt=/[A-Z]/g,Myt=new Set(["table","tbody","thead","tfoot","tr"]),Lyt=new Set(["td","th"]),SPe="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $yt(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let i;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=qyt(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");i=Hyt(n,t.jsx,t.jsxs)}const r={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,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"?Ab:mT,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=EPe(r,e,void 0);return s&&typeof s!="string"?s:r.create(e,r.Fragment,{children:s||void 0},void 0)}function EPe(e,t,n){if(t.type==="element")return Fyt(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Byt(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Qyt(e,t,n);if(t.type==="mdxjsEsm")return Uyt(e,t);if(t.type==="root")return zyt(e,t,n);if(t.type==="text")return Vyt(e,t)}function Fyt(e,t,n){const i=e.schema;let r=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(r=Ab,e.schema=r),e.ancestors.push(t);const s=APe(e,t.tagName,!1),o=Wyt(e,t);let l=TH(e,t);return Myt.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!Xbt(c):!0})),CPe(e,o,s,t),AH(o,l),e.ancestors.pop(),e.schema=i,e.create(t,s,o,n)}function Byt(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}EC(e,t.position)}function Uyt(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);EC(e,t.position)}function Qyt(e,t,n){const i=e.schema;let r=i;t.name==="svg"&&i.space==="html"&&(r=Ab,e.schema=r),e.ancestors.push(t);const s=t.name===null?e.Fragment:APe(e,t.name,!0),o=Kyt(e,t),l=TH(e,t);return CPe(e,o,s,t),AH(o,l),e.ancestors.pop(),e.schema=i,e.create(t,s,o,n)}function zyt(e,t,n){const i={};return AH(i,TH(e,t)),e.create(t,e.Fragment,i,n)}function Vyt(e,t){return t.value}function CPe(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function AH(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Hyt(e,t,n){return i;function i(r,s,o,l){const u=Array.isArray(o.children)?n:t;return l?u(s,o,l):u(s,o)}}function qyt(e,t){return n;function n(i,r,s,o){const l=Array.isArray(s.children),c=Ih(i);return t(r,s,o,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function Wyt(e,t){const n={};let i,r;for(r in t.properties)if(r!=="children"&&CH.call(t.properties,r)){const s=Gyt(e,r,t.properties[r]);if(s){const[o,l]=s;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&Lyt.has(t.tagName)?i=l:n[o]=l}}if(i){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function Kyt(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const s=i.data.estree.body[0];s.type;const o=s.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else EC(e,t.position);else{const r=i.name;let s;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const l=i.value.data.estree.body[0];l.type,s=e.evaluater.evaluateExpression(l.expression)}else EC(e,t.position);else s=i.value===null?!0:i.value;n[r]=s}return n}function TH(e,t){const n=[];let i=-1;const r=e.passKeys?new Map:Pyt;for(;++ir?0:r+t:t=t>r?r:t,n=n>0?n:0,i.length<1e4)o=Array.from(i),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s0?(Du(e,e.length,0,t),e):t}const lte={}.hasOwnProperty;function _Pe(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 ff(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Xl=Tb(/[A-Za-z]/),Al=Tb(/[\dA-Za-z]/),rvt=Tb(/[#-'*+\--9=?A-Z^-~]/);function wI(e){return e!==null&&(e<32||e===127)}const QB=Tb(/\d/),svt=Tb(/[\dA-Fa-f]/),avt=Tb(/[!-/:-@[-`{-~]/);function Wn(e){return e!==null&&e<-2}function ds(e){return e!==null&&(e<0||e===32)}function Zi(e){return e===-2||e===-1||e===32}const vM=Tb(new RegExp("\\p{P}|\\p{S}","u")),fv=Tb(/\s/);function Tb(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function sk(e){const t=[];let n=-1,i=0,r=0;for(;++n55295&&s<57344){const l=e.charCodeAt(n+1);s<56320&&l>56319&&l<57344?(o=String.fromCharCode(s,l),r=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(i,n),encodeURIComponent(o)),i=n+r+1,o=""),r&&(n+=r,r=0)}return t.join("")+e.slice(i)}function gr(e,t,n,i){const r=i?i-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(c){return Zi(c)?(e.enter(n),l(c)):t(c)}function l(c){return Zi(c)&&s++o))return;const A=t.events.length;let E=A,j,T;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){if(j){T=t.events[E][1].end;break}j=!0}for(y(i),O=A;Ox;){const S=n[k];t.containerState=S[1],S[0].exit.call(t,e)}n.length=x}function w(){r.write([null]),s=void 0,r=void 0,t.containerState._closeFlow=void 0}}function dvt(e,t,n){return gr(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function s1(e){if(e===null||ds(e)||fv(e))return 1;if(vM(e))return 2}function xM(e,t,n){const i=[];let r=-1;for(;++r1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[i][1].end},h={...e[n][1].start};ute(f,-c),ute(h,c),o={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[i][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},s={type:c>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},r={type:c>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[i][1].end={...o.start},e[n][1].start={...l.end},u=[],e[i][1].end.offset-e[i][1].start.offset&&(u=sd(u,[["enter",e[i][1],t],["exit",e[i][1],t]])),u=sd(u,[["enter",r,t],["enter",o,t],["exit",o,t],["enter",s,t]]),u=sd(u,xM(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),u=sd(u,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",r,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=sd(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Du(e,i-1,n-i+3,u),n=i+u.length-d-2;break}}for(n=-1;++n0&&Zi(O)?gr(e,w,"linePrefix",s+1)(O):w(O)}function w(O){return O===null||Wn(O)?e.check(dte,b,k)(O):(e.enter("codeFlowValue"),x(O))}function x(O){return O===null||Wn(O)?(e.exit("codeFlowValue"),w(O)):(e.consume(O),x)}function k(O){return e.exit("codeFenced"),t(O)}function S(O,A,E){let j=0;return T;function T(I){return O.enter("lineEnding"),O.consume(I),O.exit("lineEnding"),R}function R(I){return O.enter("codeFencedFence"),Zi(I)?gr(O,C,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):C(I)}function C(I){return I===l?(O.enter("codeFencedFenceSequence"),N(I)):E(I)}function N(I){return I===l?(j++,O.consume(I),N):j>=o?(O.exit("codeFencedFenceSequence"),Zi(I)?gr(O,P,"whitespace")(I):P(I)):E(I)}function P(I){return I===null||Wn(I)?(O.exit("codeFencedFence"),A(I)):E(I)}}}function Ovt(e,t,n){const i=this;return r;function r(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}const h4={name:"codeIndented",tokenize:Evt},Svt={partial:!0,tokenize:Cvt};function Evt(e,t,n){const i=this;return r;function r(u){return e.enter("codeIndented"),gr(e,s,"linePrefix",5)(u)}function s(u){const d=i.events[i.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(u):n(u)}function o(u){return u===null?c(u):Wn(u)?e.attempt(Svt,o,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Wn(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function Cvt(e,t,n){const i=this;return r;function r(o){return i.parser.lazy[i.now().line]?n(o):Wn(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r):gr(e,s,"linePrefix",5)(o)}function s(o){const l=i.events[i.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):Wn(o)?r(o):n(o)}}const Avt={name:"codeText",previous:_vt,resolve:Tvt,tokenize:jvt};function Tvt(e){let t=e.length-4,n=3,i,r;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i=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-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const r=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return i&&yO(this.left,i),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),yO(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),yO(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(o):e.interrupt(i.parser.constructs.flow,n,t)(o)}}function DPe(e,t,n,i,r,s,o,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return f;function f(y){return y===60?(e.enter(i),e.enter(r),e.enter(s),e.consume(y),e.exit(s),h):y===null||y===32||y===41||wI(y)?n(y):(e.enter(i),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),b(y))}function h(y){return y===62?(e.enter(s),e.consume(y),e.exit(s),e.exit(r),e.exit(i),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===62?(e.exit("chunkString"),e.exit(l),h(y)):y===null||y===60||Wn(y)?n(y):(e.consume(y),y===92?g:m)}function g(y){return y===60||y===62||y===92?(e.consume(y),m):m(y)}function b(y){return!d&&(y===null||y===41||ds(y))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(i),t(y)):d999||m===null||m===91||m===93&&!c||m===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(m):m===93?(e.exit(s),e.enter(r),e.consume(m),e.exit(r),e.exit(i),t):Wn(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(m))}function f(m){return m===null||m===91||m===93||Wn(m)||l++>999?(e.exit("chunkString"),d(m)):(e.consume(m),c||(c=!Zi(m)),m===92?h:f)}function h(m){return m===91||m===92||m===93?(e.consume(m),l++,f):f(m)}}function LPe(e,t,n,i,r,s){let o;return l;function l(h){return h===34||h===39||h===40?(e.enter(i),e.enter(r),e.consume(h),e.exit(r),o=h===40?41:h,c):n(h)}function c(h){return h===o?(e.enter(r),e.consume(h),e.exit(r),e.exit(i),t):(e.enter(s),u(h))}function u(h){return h===o?(e.exit(s),c(o)):h===null?n(h):Wn(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),gr(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===o||h===null||Wn(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:d)}function f(h){return h===o||h===92?(e.consume(h),d):d(h)}}function uE(e,t){let n;return i;function i(r){return Wn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n=!0,i):Zi(r)?gr(e,i,n?"linePrefix":"lineSuffix")(r):t(r)}}const $vt={name:"definition",tokenize:Bvt},Fvt={partial:!0,tokenize:Uvt};function Bvt(e,t,n){const i=this;let r;return s;function s(m){return e.enter("definition"),o(m)}function o(m){return MPe.call(i,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function l(m){return r=ff(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),c):n(m)}function c(m){return ds(m)?uE(e,u)(m):u(m)}function u(m){return DPe(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function d(m){return e.attempt(Fvt,f,f)(m)}function f(m){return Zi(m)?gr(e,h,"whitespace")(m):h(m)}function h(m){return m===null||Wn(m)?(e.exit("definition"),i.parser.defined.push(r),t(m)):n(m)}}function Uvt(e,t,n){return i;function i(l){return ds(l)?uE(e,r)(l):n(l)}function r(l){return LPe(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return Zi(l)?gr(e,o,"whitespace")(l):o(l)}function o(l){return l===null||Wn(l)?t(l):n(l)}}const Qvt={name:"hardBreakEscape",tokenize:zvt};function zvt(e,t,n){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),r}function r(s){return Wn(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const Vvt={name:"headingAtx",resolve:Hvt,tokenize:qvt};function Hvt(e,t){let n=e.length-2,i=3,r,s;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(r={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},s={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},Du(e,i,n-i+1,[["enter",r,t],["enter",s,t],["exit",s,t],["exit",r,t]])),e}function qvt(e,t,n){let i=0;return r;function r(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&i++<6?(e.consume(d),o):d===null||ds(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||Wn(d)?(e.exit("atxHeading"),t(d)):Zi(d)?gr(e,l,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),l(d))}function u(d){return d===null||d===35||ds(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const Wvt=["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"],hte=["pre","script","style","textarea"],Kvt={concrete:!0,name:"htmlFlow",resolveTo:Yvt,tokenize:Zvt},Gvt={partial:!0,tokenize:e0t},Xvt={partial:!0,tokenize:Jvt};function Yvt(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 Zvt(e,t,n){const i=this;let r,s,o,l,c;return u;function u(U){return d(U)}function d(U){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(U),f}function f(U){return U===33?(e.consume(U),h):U===47?(e.consume(U),s=!0,b):U===63?(e.consume(U),r=3,i.interrupt?t:M):Xl(U)?(e.consume(U),o=String.fromCharCode(U),v):n(U)}function h(U){return U===45?(e.consume(U),r=2,m):U===91?(e.consume(U),r=5,l=0,g):Xl(U)?(e.consume(U),r=4,i.interrupt?t:M):n(U)}function m(U){return U===45?(e.consume(U),i.interrupt?t:M):n(U)}function g(U){const Z="CDATA[";return U===Z.charCodeAt(l++)?(e.consume(U),l===Z.length?i.interrupt?t:C:g):n(U)}function b(U){return Xl(U)?(e.consume(U),o=String.fromCharCode(U),v):n(U)}function v(U){if(U===null||U===47||U===62||ds(U)){const Z=U===47,z=o.toLowerCase();return!Z&&!s&&hte.includes(z)?(r=1,i.interrupt?t(U):C(U)):Wvt.includes(o.toLowerCase())?(r=6,Z?(e.consume(U),y):i.interrupt?t(U):C(U)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(U):s?w(U):x(U))}return U===45||Al(U)?(e.consume(U),o+=String.fromCharCode(U),v):n(U)}function y(U){return U===62?(e.consume(U),i.interrupt?t:C):n(U)}function w(U){return Zi(U)?(e.consume(U),w):T(U)}function x(U){return U===47?(e.consume(U),T):U===58||U===95||Xl(U)?(e.consume(U),k):Zi(U)?(e.consume(U),x):T(U)}function k(U){return U===45||U===46||U===58||U===95||Al(U)?(e.consume(U),k):S(U)}function S(U){return U===61?(e.consume(U),O):Zi(U)?(e.consume(U),S):x(U)}function O(U){return U===null||U===60||U===61||U===62||U===96?n(U):U===34||U===39?(e.consume(U),c=U,A):Zi(U)?(e.consume(U),O):E(U)}function A(U){return U===c?(e.consume(U),c=null,j):U===null||Wn(U)?n(U):(e.consume(U),A)}function E(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||ds(U)?S(U):(e.consume(U),E)}function j(U){return U===47||U===62||Zi(U)?x(U):n(U)}function T(U){return U===62?(e.consume(U),R):n(U)}function R(U){return U===null||Wn(U)?C(U):Zi(U)?(e.consume(U),R):n(U)}function C(U){return U===45&&r===2?(e.consume(U),D):U===60&&r===1?(e.consume(U),_):U===62&&r===4?(e.consume(U),H):U===63&&r===3?(e.consume(U),M):U===93&&r===5?(e.consume(U),F):Wn(U)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(Gvt,q,N)(U)):U===null||Wn(U)?(e.exit("htmlFlowData"),N(U)):(e.consume(U),C)}function N(U){return e.check(Xvt,P,q)(U)}function P(U){return e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),I}function I(U){return U===null||Wn(U)?N(U):(e.enter("htmlFlowData"),C(U))}function D(U){return U===45?(e.consume(U),M):C(U)}function _(U){return U===47?(e.consume(U),o="",L):C(U)}function L(U){if(U===62){const Z=o.toLowerCase();return hte.includes(Z)?(e.consume(U),H):C(U)}return Xl(U)&&o.length<8?(e.consume(U),o+=String.fromCharCode(U),L):C(U)}function F(U){return U===93?(e.consume(U),M):C(U)}function M(U){return U===62?(e.consume(U),H):U===45&&r===2?(e.consume(U),M):C(U)}function H(U){return U===null||Wn(U)?(e.exit("htmlFlowData"),q(U)):(e.consume(U),H)}function q(U){return e.exit("htmlFlow"),t(U)}}function Jvt(e,t,n){const i=this;return r;function r(o){return Wn(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}function e0t(e,t,n){return i;function i(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(gT,t,n)}}const t0t={name:"htmlText",tokenize:n0t};function n0t(e,t,n){const i=this;let r,s,o;return l;function l(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),c}function c(M){return M===33?(e.consume(M),u):M===47?(e.consume(M),S):M===63?(e.consume(M),x):Xl(M)?(e.consume(M),E):n(M)}function u(M){return M===45?(e.consume(M),d):M===91?(e.consume(M),s=0,g):Xl(M)?(e.consume(M),w):n(M)}function d(M){return M===45?(e.consume(M),m):n(M)}function f(M){return M===null?n(M):M===45?(e.consume(M),h):Wn(M)?(o=f,_(M)):(e.consume(M),f)}function h(M){return M===45?(e.consume(M),m):f(M)}function m(M){return M===62?D(M):M===45?h(M):f(M)}function g(M){const H="CDATA[";return M===H.charCodeAt(s++)?(e.consume(M),s===H.length?b:g):n(M)}function b(M){return M===null?n(M):M===93?(e.consume(M),v):Wn(M)?(o=b,_(M)):(e.consume(M),b)}function v(M){return M===93?(e.consume(M),y):b(M)}function y(M){return M===62?D(M):M===93?(e.consume(M),y):b(M)}function w(M){return M===null||M===62?D(M):Wn(M)?(o=w,_(M)):(e.consume(M),w)}function x(M){return M===null?n(M):M===63?(e.consume(M),k):Wn(M)?(o=x,_(M)):(e.consume(M),x)}function k(M){return M===62?D(M):x(M)}function S(M){return Xl(M)?(e.consume(M),O):n(M)}function O(M){return M===45||Al(M)?(e.consume(M),O):A(M)}function A(M){return Wn(M)?(o=A,_(M)):Zi(M)?(e.consume(M),A):D(M)}function E(M){return M===45||Al(M)?(e.consume(M),E):M===47||M===62||ds(M)?j(M):n(M)}function j(M){return M===47?(e.consume(M),D):M===58||M===95||Xl(M)?(e.consume(M),T):Wn(M)?(o=j,_(M)):Zi(M)?(e.consume(M),j):D(M)}function T(M){return M===45||M===46||M===58||M===95||Al(M)?(e.consume(M),T):R(M)}function R(M){return M===61?(e.consume(M),C):Wn(M)?(o=R,_(M)):Zi(M)?(e.consume(M),R):j(M)}function C(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),r=M,N):Wn(M)?(o=C,_(M)):Zi(M)?(e.consume(M),C):(e.consume(M),P)}function N(M){return M===r?(e.consume(M),r=void 0,I):M===null?n(M):Wn(M)?(o=N,_(M)):(e.consume(M),N)}function P(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||ds(M)?j(M):(e.consume(M),P)}function I(M){return M===47||M===62||ds(M)?j(M):n(M)}function D(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function _(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),L}function L(M){return Zi(M)?gr(e,F,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):F(M)}function F(M){return e.enter("htmlTextData"),o(M)}}const NH={name:"labelEnd",resolveAll:a0t,resolveTo:o0t,tokenize:l0t},i0t={tokenize:c0t},r0t={tokenize:u0t},s0t={tokenize:d0t};function a0t(e){let t=-1;const n=[];for(;++t=3&&(u===null||Wn(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===r?(e.consume(u),i++,c):(e.exit("thematicBreakSequence"),Zi(u)?gr(e,l,"whitespace")(u):l(u))}}const yc={continuation:{tokenize:w0t},exit:O0t,name:"list",tokenize:x0t},y0t={partial:!0,tokenize:S0t},v0t={partial:!0,tokenize:k0t};function x0t(e,t,n){const i=this,r=i.events[i.events.length-1];let s=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,o=0;return l;function l(m){const g=i.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!i.containerState.marker||m===i.containerState.marker:QB(m)){if(i.containerState.type||(i.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(TN,n,u)(m):u(m);if(!i.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(m)}return n(m)}function c(m){return QB(m)&&++o<10?(e.consume(m),c):(!i.interrupt||o<2)&&(i.containerState.marker?m===i.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):n(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||m,e.check(gT,i.interrupt?n:d,e.attempt(y0t,h,f))}function d(m){return i.containerState.initialBlankLine=!0,s++,h(m)}function f(m){return Zi(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),h):n(m)}function h(m){return i.containerState.size=s+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function w0t(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(gT,r,s);function r(l){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,gr(e,t,"listItemIndent",i.containerState.size+1)(l)}function s(l){return i.containerState.furtherBlankLines||!Zi(l)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,o(l)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(v0t,t,o)(l))}function o(l){return i.containerState._closeFlow=!0,i.interrupt=void 0,gr(e,e.attempt(yc,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function k0t(e,t,n){const i=this;return gr(e,r,"listItemIndent",i.containerState.size+1);function r(s){const o=i.events[i.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===i.containerState.size?t(s):n(s)}}function O0t(e){e.exit(this.containerState.type)}function S0t(e,t,n){const i=this;return gr(e,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(s){const o=i.events[i.events.length-1];return!Zi(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const pte={name:"setextUnderline",resolveTo:E0t,tokenize:C0t};function E0t(e,t){let n=e.length,i,r,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(r=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",s?(e.splice(r,0,["enter",o,t]),e.splice(s+1,0,["exit",e[i][1],t]),e[i][1].end={...e[s][1].end}):e[i][1]=o,e.push(["exit",o,t]),e}function C0t(e,t,n){const i=this;let r;return s;function s(u){let d=i.events.length,f;for(;d--;)if(i.events[d][1].type!=="lineEnding"&&i.events[d][1].type!=="linePrefix"&&i.events[d][1].type!=="content"){f=i.events[d][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||f)?(e.enter("setextHeadingLine"),r=u,o(u)):n(u)}function o(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===r?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),Zi(u)?gr(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Wn(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const A0t={tokenize:T0t};function T0t(e){const t=this,n=e.attempt(gT,i,e.attempt(this.parser.constructs.flowInitial,r,gr(e,e.attempt(this.parser.constructs.flow,r,e.attempt(Ivt,r)),"linePrefix")));return n;function i(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const _0t={resolveAll:FPe()},j0t=$Pe("string"),N0t=$Pe("text");function $Pe(e){return{resolveAll:FPe(e==="text"?R0t:void 0),tokenize:t};function t(n){const i=this,r=this.parser.constructs[e],s=n.attempt(r,o,l);return o;function o(d){return u(d)?s(d):l(d)}function l(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),c}function c(d){return u(d)?(n.exit("data"),s(d)):(n.consume(d),c)}function u(d){if(d===null)return!0;const f=r[d];let h=-1;if(f)for(;++h-1){const l=o[0];typeof l=="string"?o[0]=l.slice(i):o.shift()}s>0&&o.push(e[r].slice(0,s))}return o}function H0t(e,t){let n=-1;const i=[];let r;for(;++n0){const Be=Ae.tokenStack[Ae.tokenStack.length-1];(Be[1]||gte).call(Ae,void 0,Be[0])}for(ye.position={start:Dm(ce.length>0?ce[0][1].start:{line:1,column:1,offset:0}),end:Dm(ce.length>0?ce[ce.length-2][1].end:{line:1,column:1,offset:0})},Ce=-1;++Ce0&&(i.className=["language-"+r[0]]);let s={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function rxt(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sxt(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function axt(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),r=sk(i.toLowerCase()),s=e.footnoteOrder.indexOf(i);let o,l=e.footnoteCounts.get(i);l===void 0?(l=0,e.footnoteOrder.push(i),o=e.footnoteOrder.length):o=s+1,l+=1,e.footnoteCounts.set(i,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function oxt(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 lxt(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function UPe(e,t){const n=t.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];const r=e.all(t),s=r[0];s&&s.type==="text"?s.value="["+s.value:r.unshift({type:"text",value:"["});const o=r[r.length-1];return o&&o.type==="text"?o.value+=i:r.push({type:"text",value:i}),r}function cxt(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return UPe(e,t);const r={src:sk(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,s),e.applyData(t,s)}function uxt(e,t){const n={src:sk(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 i={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,i),e.applyData(t,i)}function dxt(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,i),e.applyData(t,i)}function fxt(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return UPe(e,t);const r={href:sk(i.url||"")};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function hxt(e,t){const n={href:sk(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function pxt(e,t,n){const i=e.all(t),r=n?mxt(n):QPe(t),s={},o=[];if(typeof t.checked=="boolean"){const d=i[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},i.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let l=-1;for(;++l0){const Ge=Ce.tokenStack[Ce.tokenStack.length-1];(Ge[1]||gte).call(Ce,void 0,Ge[0])}for(be.position={start:Dm(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:Dm(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},Ve=-1;++Ve0&&(i.className=["language-"+r[0]]);let s={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function sxt(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function axt(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function oxt(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),r=sk(i.toLowerCase()),s=e.footnoteOrder.indexOf(i);let o,l=e.footnoteCounts.get(i);l===void 0?(l=0,e.footnoteOrder.push(i),o=e.footnoteOrder.length):o=s+1,l+=1,e.footnoteCounts.set(i,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function lxt(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 cxt(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function QPe(e,t){const n=t.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];const r=e.all(t),s=r[0];s&&s.type==="text"?s.value="["+s.value:r.unshift({type:"text",value:"["});const o=r[r.length-1];return o&&o.type==="text"?o.value+=i:r.push({type:"text",value:i}),r}function uxt(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return QPe(e,t);const r={src:sk(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,s),e.applyData(t,s)}function dxt(e,t){const n={src:sk(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 i={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,i),e.applyData(t,i)}function fxt(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,i),e.applyData(t,i)}function hxt(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return QPe(e,t);const r={href:sk(i.url||"")};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function pxt(e,t){const n={href:sk(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function mxt(e,t,n){const i=e.all(t),r=n?gxt(n):zPe(t),s={},o=[];if(typeof t.checked=="boolean"){const d=i[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},i.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let l=-1;for(;++l1}function gxt(e,t){const n={},i=e.all(t);let r=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++r0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=Ih(t.children[1]),c=yM(t.children[t.children.length-1]);l&&c&&(o.position={start:l,end:c}),r.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function wxt(e,t,n){const i=n?n.children:void 0,s=(i?i.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.length:t.children.length;let c=-1;const u=[];for(;++c0,!0),i[0]),r=i.index+i[0].length,i=n.exec(t);return s.push(vte(t.slice(r),r>0,!1)),s.join("")}function vte(e,t,n){let i=0,r=e.length;if(t){let s=e.codePointAt(i);for(;s===bte||s===yte;)i++,s=e.codePointAt(i)}if(n){let s=e.codePointAt(r-1);for(;s===bte||s===yte;)r--,s=e.codePointAt(r-1)}return r>i?e.slice(i,r):""}function Sxt(e,t){const n={type:"text",value:Oxt(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Ext(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Cxt={blockquote:txt,break:nxt,code:ixt,delete:rxt,emphasis:sxt,footnoteReference:axt,heading:oxt,html:lxt,imageReference:cxt,image:uxt,inlineCode:dxt,linkReference:fxt,link:hxt,listItem:pxt,list:gxt,paragraph:bxt,root:yxt,strong:vxt,table:xxt,tableCell:kxt,tableRow:wxt,text:Sxt,thematicBreak:Ext,toml:y_,yaml:y_,definition:y_,footnoteDefinition:y_};function y_(){}const zPe=-1,wM=0,dE=1,kI=2,RH=3,IH=4,PH=5,DH=6,VPe=7,HPe=8,Axt=typeof self=="object"?self:globalThis,xte=(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 Axt[e](t)},Txt=(e,t)=>{const n=(r,s)=>(e.set(s,r),r),i=r=>{if(e.has(r))return e.get(r);const[s,o]=t[r];switch(s){case wM:case zPe:return n(o,r);case dE:{const l=n([],r);for(const c of o)l.push(i(c));return l}case kI:{const l=n({},r);for(const[c,u]of o)l[i(c)]=i(u);return l}case RH:return n(new Date(o),r);case IH:{const{source:l,flags:c}=o;return n(new RegExp(l,c),r)}case PH:{const l=n(new Map,r);for(const[c,u]of o)l.set(i(c),i(u));return l}case DH:{const l=n(new Set,r);for(const c of o)l.add(i(c));return l}case VPe:{const{name:l,message:c}=o;return n(xte(l,c),r)}case HPe:return n(BigInt(o),r);case"BigInt":return n(Object(BigInt(o)),r);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(xte(s,o),r)};return i},wte=e=>Txt(new Map,e)(0),U0="",{toString:_xt}={},{keys:jxt}=Object,vO=e=>{const t=typeof e;if(t!=="object"||!e)return[wM,t];const n=_xt.call(e).slice(8,-1);switch(n){case"Array":return[dE,U0];case"Object":return[kI,U0];case"Date":return[RH,U0];case"RegExp":return[IH,U0];case"Map":return[PH,U0];case"Set":return[DH,U0];case"DataView":return[dE,n]}return n.includes("Array")?[dE,n]:n.includes("Error")?[VPe,n]:[kI,n]},v_=([e,t])=>e===wM&&(t==="function"||t==="symbol"),Nxt=(e,t,n,i)=>{const r=(o,l)=>{const c=i.push(o)-1;return n.set(l,c),c},s=o=>{if(n.has(o))return n.get(o);let[l,c]=vO(o);switch(l){case wM:{let d=o;switch(c){case"bigint":l=HPe,d=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return r([zPe],o)}return r([l,d],o)}case dE:{if(c){let h=o;return c==="DataView"?h=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(o)),r([c,[...h]],o)}const d=[],f=r([l,d],o);for(const h of o)d.push(s(h));return f}case kI:{if(c)switch(c){case"BigInt":return r([c,o.toString()],o);case"Boolean":case"Number":case"String":return r([c,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const d=[],f=r([l,d],o);for(const h of jxt(o))(e||!v_(vO(o[h])))&&d.push([s(h),s(o[h])]);return f}case RH:return r([l,o.toISOString()],o);case IH:{const{source:d,flags:f}=o;return r([l,{source:d,flags:f}],o)}case PH:{const d=[],f=r([l,d],o);for(const[h,m]of o)(e||!(v_(vO(h))||v_(vO(m))))&&d.push([s(h),s(m)]);return f}case DH:{const d=[],f=r([l,d],o);for(const h of o)(e||!v_(vO(h)))&&d.push(s(h));return f}}const{message:u}=o;return r([l,{name:c,message:u}],o)};return s},kte=(e,{json:t,lossy:n}={})=>{const i=[];return Nxt(!(t||n),!!t,new Map,i)(e),i},a1=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?wte(kte(e,t)):structuredClone(e):(e,t)=>wte(kte(e,t));function Rxt(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 Ixt(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Pxt(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Rxt,i=e.options.footnoteBackLabel||Ixt,r=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c0&&g.push({type:"text",value:" "});let w=typeof n=="string"?n:n(c,m);typeof w=="string"&&(w={type:"text",value:w}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(c,m),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const v=d[d.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const w=v.children[v.children.length-1];w&&w.type==="text"?w.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...g)}else d.push(...g);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,y),l.push(y)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...a1(o),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:` +`});const u={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,u),e.applyData(t,u)}function gxt(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let i=-1;for(;!t&&++i1}function bxt(e,t){const n={},i=e.all(t);let r=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++r0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=Ih(t.children[1]),c=yM(t.children[t.children.length-1]);l&&c&&(o.position={start:l,end:c}),r.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function kxt(e,t,n){const i=n?n.children:void 0,s=(i?i.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.length:t.children.length;let c=-1;const u=[];for(;++c0,!0),i[0]),r=i.index+i[0].length,i=n.exec(t);return s.push(vte(t.slice(r),r>0,!1)),s.join("")}function vte(e,t,n){let i=0,r=e.length;if(t){let s=e.codePointAt(i);for(;s===bte||s===yte;)i++,s=e.codePointAt(i)}if(n){let s=e.codePointAt(r-1);for(;s===bte||s===yte;)r--,s=e.codePointAt(r-1)}return r>i?e.slice(i,r):""}function Ext(e,t){const n={type:"text",value:Sxt(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Cxt(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Axt={blockquote:nxt,break:ixt,code:rxt,delete:sxt,emphasis:axt,footnoteReference:oxt,heading:lxt,html:cxt,imageReference:uxt,image:dxt,inlineCode:fxt,linkReference:hxt,link:pxt,listItem:mxt,list:bxt,paragraph:yxt,root:vxt,strong:xxt,table:wxt,tableCell:Oxt,tableRow:kxt,text:Ext,thematicBreak:Cxt,toml:y_,yaml:y_,definition:y_,footnoteDefinition:y_};function y_(){}const VPe=-1,wM=0,dE=1,kI=2,RH=3,IH=4,PH=5,DH=6,HPe=7,qPe=8,Txt=typeof self=="object"?self:globalThis,xte=(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 Txt[e](t)},_xt=(e,t)=>{const n=(r,s)=>(e.set(s,r),r),i=r=>{if(e.has(r))return e.get(r);const[s,o]=t[r];switch(s){case wM:case VPe:return n(o,r);case dE:{const l=n([],r);for(const c of o)l.push(i(c));return l}case kI:{const l=n({},r);for(const[c,u]of o)l[i(c)]=i(u);return l}case RH:return n(new Date(o),r);case IH:{const{source:l,flags:c}=o;return n(new RegExp(l,c),r)}case PH:{const l=n(new Map,r);for(const[c,u]of o)l.set(i(c),i(u));return l}case DH:{const l=n(new Set,r);for(const c of o)l.add(i(c));return l}case HPe:{const{name:l,message:c}=o;return n(xte(l,c),r)}case qPe:return n(BigInt(o),r);case"BigInt":return n(Object(BigInt(o)),r);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(xte(s,o),r)};return i},wte=e=>_xt(new Map,e)(0),U0="",{toString:jxt}={},{keys:Nxt}=Object,vO=e=>{const t=typeof e;if(t!=="object"||!e)return[wM,t];const n=jxt.call(e).slice(8,-1);switch(n){case"Array":return[dE,U0];case"Object":return[kI,U0];case"Date":return[RH,U0];case"RegExp":return[IH,U0];case"Map":return[PH,U0];case"Set":return[DH,U0];case"DataView":return[dE,n]}return n.includes("Array")?[dE,n]:n.includes("Error")?[HPe,n]:[kI,n]},v_=([e,t])=>e===wM&&(t==="function"||t==="symbol"),Rxt=(e,t,n,i)=>{const r=(o,l)=>{const c=i.push(o)-1;return n.set(l,c),c},s=o=>{if(n.has(o))return n.get(o);let[l,c]=vO(o);switch(l){case wM:{let d=o;switch(c){case"bigint":l=qPe,d=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return r([VPe],o)}return r([l,d],o)}case dE:{if(c){let h=o;return c==="DataView"?h=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(o)),r([c,[...h]],o)}const d=[],f=r([l,d],o);for(const h of o)d.push(s(h));return f}case kI:{if(c)switch(c){case"BigInt":return r([c,o.toString()],o);case"Boolean":case"Number":case"String":return r([c,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const d=[],f=r([l,d],o);for(const h of Nxt(o))(e||!v_(vO(o[h])))&&d.push([s(h),s(o[h])]);return f}case RH:return r([l,o.toISOString()],o);case IH:{const{source:d,flags:f}=o;return r([l,{source:d,flags:f}],o)}case PH:{const d=[],f=r([l,d],o);for(const[h,m]of o)(e||!(v_(vO(h))||v_(vO(m))))&&d.push([s(h),s(m)]);return f}case DH:{const d=[],f=r([l,d],o);for(const h of o)(e||!v_(vO(h)))&&d.push(s(h));return f}}const{message:u}=o;return r([l,{name:c,message:u}],o)};return s},kte=(e,{json:t,lossy:n}={})=>{const i=[];return Rxt(!(t||n),!!t,new Map,i)(e),i},a1=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?wte(kte(e,t)):structuredClone(e):(e,t)=>wte(kte(e,t));function Ixt(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 Pxt(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Dxt(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Ixt,i=e.options.footnoteBackLabel||Pxt,r=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c0&&g.push({type:"text",value:" "});let w=typeof n=="string"?n:n(c,m);typeof w=="string"&&(w={type:"text",value:w}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(c,m),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const v=d[d.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const w=v.children[v.children.length-1];w&&w.type==="text"?w.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...g)}else d.push(...g);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,y),l.push(y)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...a1(o),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:` -`}]}}const bT=function(e){if(e==null)return $xt;if(typeof e=="function")return kM(e);if(typeof e=="object")return Array.isArray(e)?Dxt(e):Mxt(e);if(typeof e=="string")return Lxt(e);throw new Error("Expected function, string, or object as test")};function Dxt(e){const t=[];let n=-1;for(;++n":""))+")"})}return h;function h(){let m=qPe,g,b,v;if((!t||s(c,u,d[d.length-1]||void 0))&&(m=Qxt(n(c,d)),m[0]===VB))return m;if("children"in c&&c.children){const y=c;if(y.children&&m[0]!==Uxt)for(b=(i?y.children.length:-1)+o,v=d.concat(y);b>-1&&b":""))+")"})}return h;function h(){let m=WPe,g,b,v;if((!t||s(c,u,d[d.length-1]||void 0))&&(m=zxt(n(c,d)),m[0]===VB))return m;if("children"in c&&c.children){const y=c;if(y.children&&m[0]!==Qxt)for(b=(i?y.children.length:-1)+o,v=d.concat(y);b>-1&&b0&&n.push({type:"text",value:` -`}),n}function Ote(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Ste(e,t){const n=Vxt(e,t),i=n.one(e,void 0),r=Pxt(n),s=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&s.children.push({type:"text",value:` -`},r),s}function Gxt(e,t){return e&&"run"in e?async function(n,i){const r=Ste(n,{file:i,...t});await e.run(r,i)}:function(n,i){return Ste(n,{file:i,...e||t})}}function Ete(e){if(e)throw e}var _N=Object.prototype.hasOwnProperty,KPe=Object.prototype.toString,Cte=Object.defineProperty,Ate=Object.getOwnPropertyDescriptor,Tte=function(t){return typeof Array.isArray=="function"?Array.isArray(t):KPe.call(t)==="[object Array]"},_te=function(t){if(!t||KPe.call(t)!=="[object Object]")return!1;var n=_N.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&_N.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!i)return!1;var r;for(r in t);return typeof r>"u"||_N.call(t,r)},jte=function(t,n){Cte&&n.name==="__proto__"?Cte(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Nte=function(t,n){if(n==="__proto__")if(_N.call(t,n)){if(Ate)return Ate(t,n).value}else return;return t[n]},Xxt=function e(){var t,n,i,r,s,o,l=arguments[0],c=1,u=arguments.length,d=!1;for(typeof l=="boolean"&&(d=l,l=arguments[1]||{},c=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});co.length;let c;l&&o.push(r);try{c=e.apply(this,o)}catch(u){const d=u;if(l&&n)throw d;return r(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(s,r):c instanceof Error?r(c):s(c))}function r(o,...l){n||(n=!0,t(o,...l))}function s(o){r(null,o)}}const Kf={basename:Jxt,dirname:ewt,extname:twt,join:nwt,sep:"/"};function Jxt(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');vT(e);let n=0,i=-1,r=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;r--;)if(e.codePointAt(r)===47){if(s){n=r+1;break}}else i<0&&(s=!0,i=r+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let o=-1,l=t.length-1;for(;r--;)if(e.codePointAt(r)===47){if(s){n=r+1;break}}else o<0&&(s=!0,o=r+1),l>-1&&(e.codePointAt(r)===t.codePointAt(l--)?l<0&&(i=r):(l=-1,i=o));return n===i?i=o:i<0&&(i=e.length),e.slice(n,i)}function ewt(e){if(vT(e),e.length===0)return".";let t=-1,n=e.length,i;for(;--n;)if(e.codePointAt(n)===47){if(i){t=n;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function twt(e){vT(e);let t=e.length,n=-1,i=0,r=-1,s=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){i=t+1;break}continue}n<0&&(o=!0,n=t+1),l===46?r<0?r=t:s!==1&&(s=1):r>-1&&(s=-1)}return r<0||n<0||s===0||s===1&&r===n-1&&r===i+1?"":e.slice(r,n)}function nwt(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function rwt(e,t){let n="",i=0,r=-1,s=0,o=-1,l,c;for(;++o<=e.length;){if(o2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",i=0):(n=n.slice(0,c),i=n.length-1-n.lastIndexOf("/")),r=o,s=0;continue}}else if(n.length>0){n="",i=0,r=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(r+1,o):n=e.slice(r+1,o),i=o-r-1;r=o,s=0}else l===46&&s>-1?s++:s=-1}return n}function vT(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const swt={cwd:awt};function awt(){return"/"}function WB(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function owt(e){if(typeof e=="string")e=new URL(e);else if(!WB(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 lwt(e)}function lwt(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let n=-1;for(;++n0){let[m,...g]=d;const b=i[h][1];qB(b)&&qB(m)&&(m=m4(!0,b,m)),i[h]=[u,m,...g]}}}}const fwt=new MH().freeze();function v4(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function x4(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function w4(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 Ite(e){if(!qB(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Pte(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function x_(e){return hwt(e)?e:new GPe(e)}function hwt(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function pwt(e){return typeof e=="string"||mwt(e)}function mwt(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const gwt="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Dte=[],Mte={allowDangerousHtml:!0},bwt=/^(https?|ircs?|mailto|xmpp)$/i,ywt=[{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:"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 XPe(e){const t=vwt(e),n=xwt(e);return wwt(t.runSync(t.parse(n),n),e)}function vwt(e){const t=e.rehypePlugins||Dte,n=e.remarkPlugins||Dte,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Mte}:Mte;return fwt().use(ext).use(n).use(Gxt,i).use(t)}function xwt(e){const t=e.children||"",n=new GPe;return typeof t=="string"&&(n.value=t),n}function wwt(e,t){const n=t.allowedElements,i=t.allowElement,r=t.components,s=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||kwt;for(const d of ywt)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+gwt+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),yT(e,u),Lyt(e,{Fragment:a.Fragment,components:r,ignoreInvalidStyle:!0,jsx:a.jsx,jsxs:a.jsxs,passKeys:!0,passNode:!0});function u(d,f,h){if(d.type==="raw"&&h&&typeof f=="number")return o?h.children.splice(f,1):h.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let m;for(m in f4)if(Object.hasOwn(f4,m)&&Object.hasOwn(d.properties,m)){const g=d.properties[m],b=f4[m];(b===null||b.includes(d.tagName))&&(d.properties[m]=c(String(g||""),m,d))}}if(d.type==="element"){let m=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!m&&i&&typeof f=="number"&&(m=!i(d,f,h)),m&&h&&typeof f=="number")return l&&d.children?h.children.splice(f,1,...d.children):h.children.splice(f,1),f}}}function kwt(e){const t=e.indexOf(":"),n=e.indexOf("?"),i=e.indexOf("#"),r=e.indexOf("/");return t===-1||r!==-1&&t>r||n!==-1&&t>n||i!==-1&&t>i||bwt.test(e.slice(0,t))?e:""}function Lte(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,r=n.indexOf(t);for(;r!==-1;)i++,r=n.indexOf(t,r+t.length);return i}function Owt(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Swt(e,t,n){const r=bT((n||{}).ignore||[]),s=Ewt(t);let o=-1;for(;++o0?{type:"text",value:O}:void 0),O===!1?h.lastIndex=k+1:(g!==k&&w.push({type:"text",value:u.value.slice(g,k)}),Array.isArray(O)?w.push(...O):O&&w.push(O),g=k+x[0].length,y=!0),!h.global)break;x=h.exec(u.value)}return y?(g?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")");const r=Lte(e,"(");let s=Lte(e,")");for(;i!==-1&&r>s;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),s++;return[e,n]}function YPe(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||fv(n)||vM(n))&&(!t||n!==47)}ZPe.peek=Kwt;function Bwt(){this.buffer()}function Uwt(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Qwt(){this.buffer()}function zwt(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Vwt(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ff(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Hwt(e){this.exit(e)}function qwt(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ff(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Wwt(e){this.exit(e)}function Kwt(){return"["}function ZPe(e,t,n,i){const r=n.createTracker(i);let s=r.move("[^");const o=n.enter("footnoteReference"),l=n.enter("reference");return s+=r.move(n.safe(n.associationId(e),{after:"]",before:s})),l(),o(),s+=r.move("]"),s}function Gwt(){return{enter:{gfmFootnoteCallString:Bwt,gfmFootnoteCall:Uwt,gfmFootnoteDefinitionLabelString:Qwt,gfmFootnoteDefinition:zwt},exit:{gfmFootnoteCallString:Vwt,gfmFootnoteCall:Hwt,gfmFootnoteDefinitionLabelString:qwt,gfmFootnoteDefinition:Wwt}}}function Xwt(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:ZPe},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,r,s,o){const l=s.createTracker(o);let c=l.move("[^");const u=s.enter("footnoteDefinition"),d=s.enter("label");return c+=l.move(s.safe(s.associationId(i),{before:c,after:"]"})),d(),c+=l.move("]:"),i.children&&i.children.length>0&&(l.shift(4),c+=l.move((t?` -`:" ")+s.indentLines(s.containerFlow(i,l.current()),t?JPe:Ywt))),u(),c}}function Ywt(e,t,n){return t===0?e:JPe(e,t,n)}function JPe(e,t,n){return(n?"":" ")+e}const Zwt=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];eDe.peek=i1t;function Jwt(){return{canContainEols:["delete"],enter:{strikethrough:t1t},exit:{strikethrough:n1t}}}function e1t(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Zwt}],handlers:{delete:eDe}}}function t1t(e){this.enter({type:"delete",children:[]},e)}function n1t(e){this.exit(e)}function eDe(e,t,n,i){const r=n.createTracker(i),s=n.enter("strikethrough");let o=r.move("~~");return o+=n.containerPhrasing(e,{...r.current(),before:o,after:"~"}),o+=r.move("~~"),s(),o}function i1t(){return"~"}function r1t(e){return e.length}function s1t(e,t){const n=t||{},i=(n.align||[]).concat(),r=n.stringLength||r1t,s=[],o=[],l=[],c=[];let u=0,d=-1;for(;++du&&(u=e[d].length);++yc[y])&&(c[y]=x)}b.push(w)}o[d]=b,l[d]=v}let f=-1;if(typeof i=="object"&&"length"in i)for(;++fc[f]&&(c[f]=w),m[f]=w),h[f]=x}o.splice(1,0,h),l.splice(1,0,m),d=-1;const g=[];for(;++d "),s.shift(2);const o=n.indentLines(n.containerFlow(e,s.current()),l1t);return r(),o}function l1t(e,t,n){return">"+(n?"":" ")+e}function c1t(e,t){return Bte(e,t.inConstruct,!0)&&!Bte(e,t.notInConstruct,!1)}function Bte(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let i=-1;for(;++io&&(o=s):s=1,r=i+t.length,i=n.indexOf(t,r);return o}function d1t(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 f1t(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 h1t(e,t,n,i){const r=f1t(n),s=e.value||"",o=r==="`"?"GraveAccent":"Tilde";if(d1t(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(s,p1t);return f(),h}const l=n.createTracker(i),c=r.repeat(Math.max(u1t(s,r)+1,3)),u=n.enter("codeFenced");let d=l.move(c);if(e.lang){const f=n.enter(`codeFencedLang${o}`);d+=l.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...l.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${o}`);d+=l.move(" "),d+=l.move(n.safe(e.meta,{before:d,after:` +`}),n}function Ote(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Ste(e,t){const n=Hxt(e,t),i=n.one(e,void 0),r=Dxt(n),s=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&s.children.push({type:"text",value:` +`},r),s}function Xxt(e,t){return e&&"run"in e?async function(n,i){const r=Ste(n,{file:i,...t});await e.run(r,i)}:function(n,i){return Ste(n,{file:i,...e||t})}}function Ete(e){if(e)throw e}var _N=Object.prototype.hasOwnProperty,GPe=Object.prototype.toString,Cte=Object.defineProperty,Ate=Object.getOwnPropertyDescriptor,Tte=function(t){return typeof Array.isArray=="function"?Array.isArray(t):GPe.call(t)==="[object Array]"},_te=function(t){if(!t||GPe.call(t)!=="[object Object]")return!1;var n=_N.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&_N.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!i)return!1;var r;for(r in t);return typeof r>"u"||_N.call(t,r)},jte=function(t,n){Cte&&n.name==="__proto__"?Cte(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Nte=function(t,n){if(n==="__proto__")if(_N.call(t,n)){if(Ate)return Ate(t,n).value}else return;return t[n]},Yxt=function e(){var t,n,i,r,s,o,l=arguments[0],c=1,u=arguments.length,d=!1;for(typeof l=="boolean"&&(d=l,l=arguments[1]||{},c=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});co.length;let c;l&&o.push(r);try{c=e.apply(this,o)}catch(u){const d=u;if(l&&n)throw d;return r(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(s,r):c instanceof Error?r(c):s(c))}function r(o,...l){n||(n=!0,t(o,...l))}function s(o){r(null,o)}}const Kf={basename:ewt,dirname:twt,extname:nwt,join:iwt,sep:"/"};function ewt(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');vT(e);let n=0,i=-1,r=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;r--;)if(e.codePointAt(r)===47){if(s){n=r+1;break}}else i<0&&(s=!0,i=r+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let o=-1,l=t.length-1;for(;r--;)if(e.codePointAt(r)===47){if(s){n=r+1;break}}else o<0&&(s=!0,o=r+1),l>-1&&(e.codePointAt(r)===t.codePointAt(l--)?l<0&&(i=r):(l=-1,i=o));return n===i?i=o:i<0&&(i=e.length),e.slice(n,i)}function twt(e){if(vT(e),e.length===0)return".";let t=-1,n=e.length,i;for(;--n;)if(e.codePointAt(n)===47){if(i){t=n;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function nwt(e){vT(e);let t=e.length,n=-1,i=0,r=-1,s=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){i=t+1;break}continue}n<0&&(o=!0,n=t+1),l===46?r<0?r=t:s!==1&&(s=1):r>-1&&(s=-1)}return r<0||n<0||s===0||s===1&&r===n-1&&r===i+1?"":e.slice(r,n)}function iwt(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function swt(e,t){let n="",i=0,r=-1,s=0,o=-1,l,c;for(;++o<=e.length;){if(o2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",i=0):(n=n.slice(0,c),i=n.length-1-n.lastIndexOf("/")),r=o,s=0;continue}}else if(n.length>0){n="",i=0,r=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(r+1,o):n=e.slice(r+1,o),i=o-r-1;r=o,s=0}else l===46&&s>-1?s++:s=-1}return n}function vT(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const awt={cwd:owt};function owt(){return"/"}function WB(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function lwt(e){if(typeof e=="string")e=new URL(e);else if(!WB(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 cwt(e)}function cwt(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let n=-1;for(;++n0){let[m,...g]=d;const b=i[h][1];qB(b)&&qB(m)&&(m=m4(!0,b,m)),i[h]=[u,m,...g]}}}}const hwt=new MH().freeze();function v4(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function x4(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function w4(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 Ite(e){if(!qB(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Pte(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function x_(e){return pwt(e)?e:new XPe(e)}function pwt(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function mwt(e){return typeof e=="string"||gwt(e)}function gwt(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const bwt="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Dte=[],Mte={allowDangerousHtml:!0},ywt=/^(https?|ircs?|mailto|xmpp)$/i,vwt=[{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:"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 YPe(e){const t=xwt(e),n=wwt(e);return kwt(t.runSync(t.parse(n),n),e)}function xwt(e){const t=e.rehypePlugins||Dte,n=e.remarkPlugins||Dte,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Mte}:Mte;return hwt().use(txt).use(n).use(Xxt,i).use(t)}function wwt(e){const t=e.children||"",n=new XPe;return typeof t=="string"&&(n.value=t),n}function kwt(e,t){const n=t.allowedElements,i=t.allowElement,r=t.components,s=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||Owt;for(const d of vwt)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+bwt+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),yT(e,u),$yt(e,{Fragment:a.Fragment,components:r,ignoreInvalidStyle:!0,jsx:a.jsx,jsxs:a.jsxs,passKeys:!0,passNode:!0});function u(d,f,h){if(d.type==="raw"&&h&&typeof f=="number")return o?h.children.splice(f,1):h.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let m;for(m in f4)if(Object.hasOwn(f4,m)&&Object.hasOwn(d.properties,m)){const g=d.properties[m],b=f4[m];(b===null||b.includes(d.tagName))&&(d.properties[m]=c(String(g||""),m,d))}}if(d.type==="element"){let m=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!m&&i&&typeof f=="number"&&(m=!i(d,f,h)),m&&h&&typeof f=="number")return l&&d.children?h.children.splice(f,1,...d.children):h.children.splice(f,1),f}}}function Owt(e){const t=e.indexOf(":"),n=e.indexOf("?"),i=e.indexOf("#"),r=e.indexOf("/");return t===-1||r!==-1&&t>r||n!==-1&&t>n||i!==-1&&t>i||ywt.test(e.slice(0,t))?e:""}function Lte(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,r=n.indexOf(t);for(;r!==-1;)i++,r=n.indexOf(t,r+t.length);return i}function Swt(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Ewt(e,t,n){const r=bT((n||{}).ignore||[]),s=Cwt(t);let o=-1;for(;++o0?{type:"text",value:O}:void 0),O===!1?h.lastIndex=k+1:(g!==k&&w.push({type:"text",value:u.value.slice(g,k)}),Array.isArray(O)?w.push(...O):O&&w.push(O),g=k+x[0].length,y=!0),!h.global)break;x=h.exec(u.value)}return y?(g?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")");const r=Lte(e,"(");let s=Lte(e,")");for(;i!==-1&&r>s;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),s++;return[e,n]}function ZPe(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||fv(n)||vM(n))&&(!t||n!==47)}JPe.peek=Gwt;function Uwt(){this.buffer()}function Qwt(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function zwt(){this.buffer()}function Vwt(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Hwt(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ff(this.sliceSerialize(e)).toLowerCase(),n.label=t}function qwt(e){this.exit(e)}function Wwt(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ff(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Kwt(e){this.exit(e)}function Gwt(){return"["}function JPe(e,t,n,i){const r=n.createTracker(i);let s=r.move("[^");const o=n.enter("footnoteReference"),l=n.enter("reference");return s+=r.move(n.safe(n.associationId(e),{after:"]",before:s})),l(),o(),s+=r.move("]"),s}function Xwt(){return{enter:{gfmFootnoteCallString:Uwt,gfmFootnoteCall:Qwt,gfmFootnoteDefinitionLabelString:zwt,gfmFootnoteDefinition:Vwt},exit:{gfmFootnoteCallString:Hwt,gfmFootnoteCall:qwt,gfmFootnoteDefinitionLabelString:Wwt,gfmFootnoteDefinition:Kwt}}}function Ywt(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:JPe},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,r,s,o){const l=s.createTracker(o);let c=l.move("[^");const u=s.enter("footnoteDefinition"),d=s.enter("label");return c+=l.move(s.safe(s.associationId(i),{before:c,after:"]"})),d(),c+=l.move("]:"),i.children&&i.children.length>0&&(l.shift(4),c+=l.move((t?` +`:" ")+s.indentLines(s.containerFlow(i,l.current()),t?eDe:Zwt))),u(),c}}function Zwt(e,t,n){return t===0?e:eDe(e,t,n)}function eDe(e,t,n){return(n?"":" ")+e}const Jwt=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];tDe.peek=r1t;function e1t(){return{canContainEols:["delete"],enter:{strikethrough:n1t},exit:{strikethrough:i1t}}}function t1t(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Jwt}],handlers:{delete:tDe}}}function n1t(e){this.enter({type:"delete",children:[]},e)}function i1t(e){this.exit(e)}function tDe(e,t,n,i){const r=n.createTracker(i),s=n.enter("strikethrough");let o=r.move("~~");return o+=n.containerPhrasing(e,{...r.current(),before:o,after:"~"}),o+=r.move("~~"),s(),o}function r1t(){return"~"}function s1t(e){return e.length}function a1t(e,t){const n=t||{},i=(n.align||[]).concat(),r=n.stringLength||s1t,s=[],o=[],l=[],c=[];let u=0,d=-1;for(;++du&&(u=e[d].length);++yc[y])&&(c[y]=x)}b.push(w)}o[d]=b,l[d]=v}let f=-1;if(typeof i=="object"&&"length"in i)for(;++fc[f]&&(c[f]=w),m[f]=w),h[f]=x}o.splice(1,0,h),l.splice(1,0,m),d=-1;const g=[];for(;++d "),s.shift(2);const o=n.indentLines(n.containerFlow(e,s.current()),c1t);return r(),o}function c1t(e,t,n){return">"+(n?"":" ")+e}function u1t(e,t){return Bte(e,t.inConstruct,!0)&&!Bte(e,t.notInConstruct,!1)}function Bte(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let i=-1;for(;++io&&(o=s):s=1,r=i+t.length,i=n.indexOf(t,r);return o}function f1t(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 h1t(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 p1t(e,t,n,i){const r=h1t(n),s=e.value||"",o=r==="`"?"GraveAccent":"Tilde";if(f1t(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(s,m1t);return f(),h}const l=n.createTracker(i),c=r.repeat(Math.max(d1t(s,r)+1,3)),u=n.enter("codeFenced");let d=l.move(c);if(e.lang){const f=n.enter(`codeFencedLang${o}`);d+=l.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...l.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${o}`);d+=l.move(" "),d+=l.move(n.safe(e.meta,{before:d,after:` `,encode:["`"],...l.current()})),f()}return d+=l.move(` `),s&&(d+=l.move(s+` -`)),d+=l.move(c),u(),d}function p1t(e,t,n){return(n?"":" ")+e}function LH(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 m1t(e,t,n,i){const r=LH(n),s=r==='"'?"Quote":"Apostrophe",o=n.enter("definition");let l=n.enter("label");const c=n.createTracker(i);let u=c.move("[");return u+=c.move(n.safe(n.associationId(e),{before:u,after:"]",...c.current()})),u+=c.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":` -`,...c.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=c.move(" "+r),u+=c.move(n.safe(e.title,{before:u,after:r,...c.current()})),u+=c.move(r),l()),o(),u}function g1t(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 CC(e){return"&#x"+e.toString(16).toUpperCase()+";"}function OI(e,t,n){const i=s1(e),r=s1(t);return i===void 0?r===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}nDe.peek=b1t;function nDe(e,t,n,i){const r=g1t(n),s=n.enter("emphasis"),o=n.createTracker(i),l=o.move(r);let c=o.move(n.containerPhrasing(e,{after:r,before:l,...o.current()}));const u=c.charCodeAt(0),d=OI(i.before.charCodeAt(i.before.length-1),u,r);d.inside&&(c=CC(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=OI(i.after.charCodeAt(0),f,r);h.inside&&(c=c.slice(0,-1)+CC(f));const m=o.move(r);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+m}function b1t(e,t,n){return n.options.emphasis||"*"}function y1t(e,t){let n=!1;return yT(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,VB}),!!((!e.depth||e.depth<3)&&_H(e)&&(t.options.setext||n))}function v1t(e,t,n,i){const r=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(i);if(y1t(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...s.current(),before:` +`)),d+=l.move(c),u(),d}function m1t(e,t,n){return(n?"":" ")+e}function LH(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 g1t(e,t,n,i){const r=LH(n),s=r==='"'?"Quote":"Apostrophe",o=n.enter("definition");let l=n.enter("label");const c=n.createTracker(i);let u=c.move("[");return u+=c.move(n.safe(n.associationId(e),{before:u,after:"]",...c.current()})),u+=c.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":` +`,...c.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=c.move(" "+r),u+=c.move(n.safe(e.title,{before:u,after:r,...c.current()})),u+=c.move(r),l()),o(),u}function b1t(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 CC(e){return"&#x"+e.toString(16).toUpperCase()+";"}function OI(e,t,n){const i=s1(e),r=s1(t);return i===void 0?r===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}iDe.peek=y1t;function iDe(e,t,n,i){const r=b1t(n),s=n.enter("emphasis"),o=n.createTracker(i),l=o.move(r);let c=o.move(n.containerPhrasing(e,{after:r,before:l,...o.current()}));const u=c.charCodeAt(0),d=OI(i.before.charCodeAt(i.before.length-1),u,r);d.inside&&(c=CC(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=OI(i.after.charCodeAt(0),f,r);h.inside&&(c=c.slice(0,-1)+CC(f));const m=o.move(r);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+m}function y1t(e,t,n){return n.options.emphasis||"*"}function v1t(e,t){let n=!1;return yT(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,VB}),!!((!e.depth||e.depth<3)&&_H(e)&&(t.options.setext||n))}function x1t(e,t,n,i){const r=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(i);if(v1t(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...s.current(),before:` `,after:` `});return f(),d(),h+` `+(r===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(` `))+1))}const o="#".repeat(r),l=n.enter("headingAtx"),c=n.enter("phrasing");s.move(o+" ");let u=n.containerPhrasing(e,{before:"# ",after:` -`,...s.current()});return/^[\t ]/.test(u)&&(u=CC(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,n.options.closeAtx&&(u+=" "+o),c(),l(),u}iDe.peek=x1t;function iDe(e){return e.value||""}function x1t(){return"<"}rDe.peek=w1t;function rDe(e,t,n,i){const r=LH(n),s=r==='"'?"Quote":"Apostrophe",o=n.enter("image");let l=n.enter("label");const c=n.createTracker(i);let u=c.move("![");return u+=c.move(n.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=c.move(" "+r),u+=c.move(n.safe(e.title,{before:u,after:r,...c.current()})),u+=c.move(r),l()),u+=c.move(")"),o(),u}function w1t(){return"!"}sDe.peek=k1t;function sDe(e,t,n,i){const r=e.referenceType,s=n.enter("imageReference");let o=n.enter("label");const l=n.createTracker(i);let c=l.move("![");const u=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=d,s(),r==="full"||!u||u!==f?c+=l.move(f+"]"):r==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function k1t(){return"!"}aDe.peek=O1t;function aDe(e,t,n){let i=e.value||"",r="`",s=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(i);)r+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++s\u007F]/.test(e.url))}lDe.peek=S1t;function lDe(e,t,n,i){const r=LH(n),s=r==='"'?"Quote":"Apostrophe",o=n.createTracker(i);let l,c;if(oDe(e,n)){const d=n.stack;n.stack=[],l=n.enter("autolink");let f=o.move("<");return f+=o.move(n.containerPhrasing(e,{before:f,after:">",...o.current()})),f+=o.move(">"),l(),n.stack=d,f}l=n.enter("link"),c=n.enter("label");let u=o.move("[");return u+=o.move(n.containerPhrasing(e,{before:u,after:"](",...o.current()})),u+=o.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(n.safe(e.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(c=n.enter("destinationRaw"),u+=o.move(n.safe(e.url,{before:u,after:e.title?" ":")",...o.current()}))),c(),e.title&&(c=n.enter(`title${s}`),u+=o.move(" "+r),u+=o.move(n.safe(e.title,{before:u,after:r,...o.current()})),u+=o.move(r),c()),u+=o.move(")"),l(),u}function S1t(e,t,n){return oDe(e,n)?"<":"["}cDe.peek=E1t;function cDe(e,t,n,i){const r=e.referenceType,s=n.enter("linkReference");let o=n.enter("label");const l=n.createTracker(i);let c=l.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=d,s(),r==="full"||!u||u!==f?c+=l.move(f+"]"):r==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function E1t(){return"["}function $H(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 C1t(e){const t=$H(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 A1t(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 uDe(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 T1t(e,t,n,i){const r=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?A1t(n):$H(n);const l=e.ordered?o==="."?")":".":C1t(n);let c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),uDe(n)===o&&d){let f=-1;for(;++f-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let o=s.length+1;(r==="tab"||r==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=n.createTracker(i);l.move(s+" ".repeat(o-s.length)),l.shift(o);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,l.current()),d);return c(),u;function d(f,h,m){return h?(m?"":" ".repeat(o))+f:(m?s:s+" ".repeat(o-s.length))+f}}function N1t(e,t,n,i){const r=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,i);return s(),r(),o}const R1t=bT(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function I1t(e,t,n,i){return(e.children.some(function(o){return R1t(o)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function P1t(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}dDe.peek=D1t;function dDe(e,t,n,i){const r=P1t(n),s=n.enter("strong"),o=n.createTracker(i),l=o.move(r+r);let c=o.move(n.containerPhrasing(e,{after:r,before:l,...o.current()}));const u=c.charCodeAt(0),d=OI(i.before.charCodeAt(i.before.length-1),u,r);d.inside&&(c=CC(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=OI(i.after.charCodeAt(0),f,r);h.inside&&(c=c.slice(0,-1)+CC(f));const m=o.move(r+r);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+m}function D1t(e,t,n){return n.options.strong||"*"}function M1t(e,t,n,i){return n.safe(e.value,i)}function L1t(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 $1t(e,t,n){const i=(uDe(n)+(n.options.ruleSpaces?" ":"")).repeat(L1t(n));return n.options.ruleSpaces?i.slice(0,-1):i}const fDe={blockquote:o1t,break:Ute,code:h1t,definition:m1t,emphasis:nDe,hardBreak:Ute,heading:v1t,html:iDe,image:rDe,imageReference:sDe,inlineCode:aDe,link:lDe,linkReference:cDe,list:T1t,listItem:j1t,paragraph:N1t,root:I1t,strong:dDe,text:M1t,thematicBreak:$1t};function F1t(){return{enter:{table:B1t,tableData:Qte,tableHeader:Qte,tableRow:Q1t},exit:{codeText:z1t,table:U1t,tableData:E4,tableHeader:E4,tableRow:E4}}}function B1t(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 U1t(e){this.exit(e),this.data.inTable=void 0}function Q1t(e){this.enter({type:"tableRow",children:[]},e)}function E4(e){this.exit(e)}function Qte(e){this.enter({type:"tableCell",children:[]},e)}function z1t(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,V1t));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function V1t(e,t){return t==="|"?t:e}function H1t(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,r=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,...s.current()});return/^[\t ]/.test(u)&&(u=CC(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,n.options.closeAtx&&(u+=" "+o),c(),l(),u}rDe.peek=w1t;function rDe(e){return e.value||""}function w1t(){return"<"}sDe.peek=k1t;function sDe(e,t,n,i){const r=LH(n),s=r==='"'?"Quote":"Apostrophe",o=n.enter("image");let l=n.enter("label");const c=n.createTracker(i);let u=c.move("![");return u+=c.move(n.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=c.move(" "+r),u+=c.move(n.safe(e.title,{before:u,after:r,...c.current()})),u+=c.move(r),l()),u+=c.move(")"),o(),u}function k1t(){return"!"}aDe.peek=O1t;function aDe(e,t,n,i){const r=e.referenceType,s=n.enter("imageReference");let o=n.enter("label");const l=n.createTracker(i);let c=l.move("![");const u=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=d,s(),r==="full"||!u||u!==f?c+=l.move(f+"]"):r==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function O1t(){return"!"}oDe.peek=S1t;function oDe(e,t,n){let i=e.value||"",r="`",s=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(i);)r+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++s\u007F]/.test(e.url))}cDe.peek=E1t;function cDe(e,t,n,i){const r=LH(n),s=r==='"'?"Quote":"Apostrophe",o=n.createTracker(i);let l,c;if(lDe(e,n)){const d=n.stack;n.stack=[],l=n.enter("autolink");let f=o.move("<");return f+=o.move(n.containerPhrasing(e,{before:f,after:">",...o.current()})),f+=o.move(">"),l(),n.stack=d,f}l=n.enter("link"),c=n.enter("label");let u=o.move("[");return u+=o.move(n.containerPhrasing(e,{before:u,after:"](",...o.current()})),u+=o.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(n.safe(e.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(c=n.enter("destinationRaw"),u+=o.move(n.safe(e.url,{before:u,after:e.title?" ":")",...o.current()}))),c(),e.title&&(c=n.enter(`title${s}`),u+=o.move(" "+r),u+=o.move(n.safe(e.title,{before:u,after:r,...o.current()})),u+=o.move(r),c()),u+=o.move(")"),l(),u}function E1t(e,t,n){return lDe(e,n)?"<":"["}uDe.peek=C1t;function uDe(e,t,n,i){const r=e.referenceType,s=n.enter("linkReference");let o=n.enter("label");const l=n.createTracker(i);let c=l.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=d,s(),r==="full"||!u||u!==f?c+=l.move(f+"]"):r==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function C1t(){return"["}function $H(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 A1t(e){const t=$H(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 T1t(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 dDe(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 _1t(e,t,n,i){const r=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?T1t(n):$H(n);const l=e.ordered?o==="."?")":".":A1t(n);let c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),dDe(n)===o&&d){let f=-1;for(;++f-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let o=s.length+1;(r==="tab"||r==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=n.createTracker(i);l.move(s+" ".repeat(o-s.length)),l.shift(o);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,l.current()),d);return c(),u;function d(f,h,m){return h?(m?"":" ".repeat(o))+f:(m?s:s+" ".repeat(o-s.length))+f}}function R1t(e,t,n,i){const r=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,i);return s(),r(),o}const I1t=bT(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function P1t(e,t,n,i){return(e.children.some(function(o){return I1t(o)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function D1t(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}fDe.peek=M1t;function fDe(e,t,n,i){const r=D1t(n),s=n.enter("strong"),o=n.createTracker(i),l=o.move(r+r);let c=o.move(n.containerPhrasing(e,{after:r,before:l,...o.current()}));const u=c.charCodeAt(0),d=OI(i.before.charCodeAt(i.before.length-1),u,r);d.inside&&(c=CC(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=OI(i.after.charCodeAt(0),f,r);h.inside&&(c=c.slice(0,-1)+CC(f));const m=o.move(r+r);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+m}function M1t(e,t,n){return n.options.strong||"*"}function L1t(e,t,n,i){return n.safe(e.value,i)}function $1t(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 F1t(e,t,n){const i=(dDe(n)+(n.options.ruleSpaces?" ":"")).repeat($1t(n));return n.options.ruleSpaces?i.slice(0,-1):i}const hDe={blockquote:l1t,break:Ute,code:p1t,definition:g1t,emphasis:iDe,hardBreak:Ute,heading:x1t,html:rDe,image:sDe,imageReference:aDe,inlineCode:oDe,link:cDe,linkReference:uDe,list:_1t,listItem:N1t,paragraph:R1t,root:P1t,strong:fDe,text:L1t,thematicBreak:F1t};function B1t(){return{enter:{table:U1t,tableData:Qte,tableHeader:Qte,tableRow:z1t},exit:{codeText:V1t,table:Q1t,tableData:E4,tableHeader:E4,tableRow:E4}}}function U1t(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 Q1t(e){this.exit(e),this.data.inTable=void 0}function z1t(e){this.enter({type:"tableRow",children:[]},e)}function E4(e){this.exit(e)}function Qte(e){this.enter({type:"tableCell",children:[]},e)}function V1t(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,H1t));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function H1t(e,t){return t==="|"?t:e}function q1t(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,r=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:o,tableCell:c,tableRow:l}};function o(m,g,b,v){return u(d(m,b,v),m.align)}function l(m,g,b,v){const y=f(m,b,v),w=u([y]);return w.slice(0,w.indexOf(` -`))}function c(m,g,b,v){const y=b.enter("tableCell"),w=b.enter("phrasing"),x=b.containerPhrasing(m,{...v,before:s,after:s});return w(),y(),x}function u(m,g){return s1t(m,{align:g,alignDelimiters:i,padding:n,stringLength:r})}function d(m,g,b){const v=m.children;let y=-1;const w=[],x=g.enter("table");for(;++y0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const ckt={tokenize:bkt,partial:!0};function ukt(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:pkt,continuation:{tokenize:mkt},exit:gkt}},text:{91:{name:"gfmFootnoteCall",tokenize:hkt},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:dkt,resolveTo:fkt}}}}function dkt(e,t,n){const i=this;let r=i.events.length;const s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o;for(;r--;){const c=i.events[r][1];if(c.type==="labelImage"){o=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!o||!o._balanced)return n(c);const u=ff(i.sliceSerialize({start:o.end,end:i.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function fkt(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 i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",r,t],["exit",r,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...l),e}function hkt(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s=0,o;return l;function l(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),c}function c(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(s>999||f===93&&!o||f===null||f===91||ds(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return r.includes(ff(i.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return ds(f)||(o=!0),s++,e.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(e.consume(f),s++,u):u(f)}}function pkt(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s,o=0,l;return c;function c(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(g)}function d(g){if(o>999||g===93&&!l||g===null||g===91||ds(g))return n(g);if(g===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return s=ff(i.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return ds(g)||(l=!0),o++,e.consume(g),g===92?f:d}function f(g){return g===91||g===92||g===93?(e.consume(g),o++,d):d(g)}function h(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),r.includes(s)||r.push(s),gr(e,m,"gfmFootnoteDefinitionWhitespace")):n(g)}function m(g){return t(g)}}function mkt(e,t,n){return e.check(gT,t,e.attempt(ckt,t,n))}function gkt(e){e.exit("gfmFootnoteDefinition")}function bkt(e,t,n){const i=this;return gr(e,r,"gfmFootnoteDefinitionIndent",5);function r(s){const o=i.events[i.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function ykt(e){let n=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:s,resolveAll:r};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function r(o,l){let c=-1;for(;++c1?c(g):(o.consume(g),f++,m);if(f<2&&!n)return c(g);const v=o.exit("strikethroughSequenceTemporary"),y=s1(g);return v._open=!y||y===2&&!!b,v._close=!b||b===2&&!!y,l(g)}}}class vkt{constructor(){this.map=[]}add(t,n,i){xkt(this,t,n,i)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];i.push(t.slice()),t.length=0;let r=i.pop();for(;r;){for(const s of r)t.push(s);r=i.pop()}this.map.length=0}}function xkt(e,t,n,i){let r=0;if(!(n===0&&i.length===0)){for(;r-1;){const P=i.events[R][1].type;if(P==="lineEnding"||P==="linePrefix")R--;else break}const C=R>-1?i.events[R][1].type:null,N=C==="tableHead"||C==="tableRow"?O:c;return N===O&&i.parser.lazy[i.now().line]?n(T):N(T)}function c(T){return e.enter("tableHead"),e.enter("tableRow"),u(T)}function u(T){return T===124||(o=!0,s+=1),d(T)}function d(T){return T===null?n(T):Wn(T)?s>1?(s=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),m):n(T):Zi(T)?gr(e,d,"whitespace")(T):(s+=1,o&&(o=!1,r+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),o=!0,d):(e.enter("data"),f(T)))}function f(T){return T===null||T===124||ds(T)?(e.exit("data"),d(T)):(e.consume(T),T===92?h:f)}function h(T){return T===92||T===124?(e.consume(T),f):f(T)}function m(T){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(T):(e.enter("tableDelimiterRow"),o=!1,Zi(T)?gr(e,g,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):g(T))}function g(T){return T===45||T===58?v(T):T===124?(o=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),b):S(T)}function b(T){return Zi(T)?gr(e,v,"whitespace")(T):v(T)}function v(T){return T===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),y):T===45?(s+=1,y(T)):T===null||Wn(T)?k(T):S(T)}function y(T){return T===45?(e.enter("tableDelimiterFiller"),w(T)):S(T)}function w(T){return T===45?(e.consume(T),w):T===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(T))}function x(T){return Zi(T)?gr(e,k,"whitespace")(T):k(T)}function k(T){return T===124?g(T):T===null||Wn(T)?!o||r!==s?S(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):S(T)}function S(T){return n(T)}function O(T){return e.enter("tableRow"),A(T)}function A(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),A):T===null||Wn(T)?(e.exit("tableRow"),t(T)):Zi(T)?gr(e,A,"whitespace")(T):(e.enter("data"),E(T))}function E(T){return T===null||T===124||ds(T)?(e.exit("data"),A(T)):(e.consume(T),T===92?j:E)}function j(T){return T===92||T===124?(e.consume(T),E):E(T)}}function Skt(e,t){let n=-1,i=!0,r=0,s=[0,0,0,0],o=[0,0,0,0],l=!1,c=0,u,d,f;const h=new vkt;for(;++nn[2]+1){const g=n[2]+1,b=n[3]-n[2]-1;e.add(g,b,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return r!==void 0&&(s.end=Object.assign({},lx(t.events,r)),e.add(r,0,[["exit",s,t]]),s=void 0),s}function Vte(e,t,n,i,r){const s=[],o=lx(t.events,n);r&&(r.end=Object.assign({},o),s.push(["exit",r,t])),i.end=Object.assign({},o),s.push(["exit",i,t]),e.add(n+1,0,s)}function lx(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const Ekt={name:"tasklistCheck",tokenize:Akt};function Ckt(){return{text:{91:Ekt}}}function Akt(e,t,n){const i=this;return r;function r(c){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),s)}function s(c){return ds(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),o):n(c)}function o(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(c)}function l(c){return Wn(c)?t(c):Zi(c)?e.check({tokenize:Tkt},t,n)(c):n(c)}}function Tkt(e,t,n){return gr(e,i,"whitespace");function i(r){return r===null?n(r):t(r)}}function _kt(e){return TPe([ekt(),ukt(),ykt(e),kkt(),Ckt()])}const jkt={};function wDe(e){const t=this,n=e||jkt,i=t.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),s=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),o=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(_kt(n)),s.push(X1t()),o.push(Y1t(n))}const Hte=function(e,t,n){const i=bT(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++tu&&(u=d):d&&(u!==void 0&&u>-1&&c.push(` -`.repeat(u)||" "),u=-1,c.push(d))}return c.join("")}function ODe(e,t,n){return e.type==="element"?$kt(e,t,n):e.type==="text"?n.whitespace==="normal"?SDe(e,n):Fkt(e):[]}function $kt(e,t,n){const i=EDe(e,n),r=e.children||[];let s=-1,o=[];if(Mkt(e))return o;let l,c;for(GB(e)||Gte(e)&&Hte(t,e,Gte)?c=` -`:Dkt(e)?(l=2,c=2):kDe(e)&&(l=1,c=1);++s]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},m=t.optional(r)+e.IDENT_RE+"\\s*\\(",g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],b=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],k={type:b,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},S={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},O=[S,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],A={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:k,contains:O.concat([{begin:/\(/,end:/\)/,keywords:k,contains:O.concat(["self"]),relevance:0}]),relevance:0},E={className:"function",begin:"("+o+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:k,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:k,relevance:0},{begin:m,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:k,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:k,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:k,illegal:"",keywords:k,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:k},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Hkt(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=Vkt(e),i=n.keywords;return i.type=[...i.type,...t.type],i.literal=[...i.literal,...t.literal],i.built_in=[...i.built_in,...t.built_in],i._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function OM(e){const t=e.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const r={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},s=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,r]};r.contains.push(l);const c={match:/\\"/},u={className:"string",begin:/'/,end:/'/},d={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},h=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],m=e.SHEBANG({binary:`(${h.join("|")})`,relevance:10}),g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},b=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],v=["true","false"],y={match:/(\/[a-z._-]+)+/},w=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],x=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],k=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],S=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:b,literal:v,built_in:[...w,...x,"set","shopt",...k,...S]},contains:[m,e.SHEBANG(),g,f,s,o,y,l,c,u,d,n]}}function qkt(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",o="("+i+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},m=t.optional(r)+e.IDENT_RE+"\\s*\\(",v={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],w={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:y.concat([{begin:/\(/,end:/\)/,keywords:v,contains:y.concat(["self"]),relevance:0}]),relevance:0},x={begin:"("+o+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:v,relevance:0},{begin:m,returnBegin:!0,contains:[e.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C",aliases:["h"],keywords:v,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:v}}}function Wkt(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",o="(?!struct)("+i+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},m=t.optional(r)+e.IDENT_RE+"\\s*\\(",g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],b=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],k={type:b,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},S={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},O=[S,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],A={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:k,contains:O.concat([{begin:/\(/,end:/\)/,keywords:k,contains:O.concat(["self"]),relevance:0}]),relevance:0},E={className:"function",begin:"("+o+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:k,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:k,relevance:0},{begin:m,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:k,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:k,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:k,illegal:"",keywords:k,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:k},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Kkt(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],i=["default","false","null","true"],r=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],s=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],o={keyword:r.concat(s),built_in:t,literal:i},l=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),c={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},f=e.inherit(d,{illegal:/\n/}),h={className:"subst",begin:/\{/,end:/\}/,keywords:o},m=e.inherit(h,{illegal:/\n/}),g={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,m]},b={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},v=e.inherit(b,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]});h.contains=[b,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],m.contains=[v,g,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[u,b,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},w={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},x=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",k={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:o,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},y,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,w,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,w,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+x+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:o,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,w],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,relevance:0,contains:[y,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},k]}}const Gkt=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Xkt=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Ykt=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Zkt=[...Xkt,...Ykt],Jkt=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),eOt=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),tOt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),nOt=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function ADe(e){const t=e.regex,n=Gkt(e),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",s=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",l=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,i,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+eOt.join("|")+")"},{begin:":(:)?("+tOt.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+nOt.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:Jkt.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Zkt.join("|")+")\\b"}]}}function TDe(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function _De(e){const s={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:s,illegal:"jDe(e,t,n-1))}function NDe(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+jDe("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),c={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},u={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},d={className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:c,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+i+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:c,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,Xte,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},Xte,u]}}const Yte="[A-Za-z$_][0-9A-Za-z$_]*",rOt=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],sOt=["true","false","null","undefined","NaN","Infinity"],RDe=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],IDe=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],PDe=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],aOt=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],oOt=[].concat(PDe,RDe,IDe);function QH(e){const t=e.regex,n=(L,{after:F})=>{const M="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,F)=>{const M=L[0].length+L.index,H=L.input[M];if(H==="<"||H===","){F.ignoreMatch();return}H===">"&&(n(L,{after:M})||F.ignoreMatch());let q;const U=L.input.substring(M);if(q=U.match(/^\s*=/)){F.ignoreMatch();return}if((q=U.match(/^\s+extends\s+/))&&q.index===0){F.ignoreMatch();return}}},l={$pattern:Yte,keyword:rOt,literal:sOt,built_in:oOt,"variable.language":aOt},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},m={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},w={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const k=[].concat(w,h.contains),S=k.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(k)}]),O={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},A={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},E={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...RDe,...IDe]}},j={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[O],illegal:/%/},R={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function C(L){return t.concat("(?!",L.join("|"),")")}const N={match:t.concat(/\b/,C([...PDe,"super","import"].map(L=>`${L}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},P={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},I={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},O]},D="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",_={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[O]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:E},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),j,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,w,{match:/\$\d+/},f,E,{scope:"attr",match:i+t.lookahead(":"),relevance:0},_,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[w,e.REGEXP_MODE,{className:"function",begin:D,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[O,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},P,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[O]},N,R,A,I,{match:/\$[(.]/}]}}function zH(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],r={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[t,n,e.QUOTE_STRING_MODE,r,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var ux="[0-9](_*[0-9])*",S_=`\\.(${ux})`,E_="[0-9a-fA-F](_*[0-9a-fA-F])*",lOt={className:"number",variants:[{begin:`(\\b(${ux})((${S_})|\\.)?|(${S_}))[eE][+-]?(${ux})[fFdD]?\\b`},{begin:`\\b(${ux})((${S_})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${S_})[fFdD]?\\b`},{begin:`\\b(${ux})[fFdD]\\b`},{begin:`\\b0[xX]((${E_})\\.?|(${E_})?\\.(${E_}))[pP][+-]?(${ux})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${E_})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function cOt(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},i={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},r={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,r]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,s,r]}]};r.contains.push(o);const l={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},c={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:"string"}),"self"]}]},u=lOt,d=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),f={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},h=f;return h.variants[1].contains=[f],f.variants[1].contains=[h],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,d,n,i,l,c,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[f,e.C_LINE_COMMENT_MODE,d],relevance:0},e.C_LINE_COMMENT_MODE,d,l,c,o,e.C_NUMBER_MODE]},d]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},l,c]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` -`},u]}}const uOt=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),dOt=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],fOt=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],hOt=[...dOt,...fOt],pOt=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),DDe=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),MDe=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),mOt=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),gOt=DDe.concat(MDe).sort().reverse();function bOt(e){const t=uOt(e),n=gOt,i="and or not only",r="[\\w-]+",s="("+r+"|@\\{"+r+"\\})",o=[],l=[],c=function(x){return{className:"string",begin:"~?"+x+".*?"+x}},u=function(x,k,S){return{className:x,begin:k,relevance:S}},d={$pattern:/[a-z-]+/,keyword:i,attribute:pOt.join(" ")},f={begin:"\\(",end:"\\)",contains:l,keywords:d,relevance:0};l.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,c("'"),c('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,f,u("variable","@@?"+r,10),u("variable","@\\{"+r+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:r+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const h=l.concat({begin:/\{/,end:/\}/,contains:o}),m={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},g={begin:s+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+mOt.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},b={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:d,returnEnd:!0,contains:l,relevance:0}},v={className:"variable",variants:[{begin:"@"+r+"\\s*:",relevance:15},{begin:"@"+r}],starts:{end:"[;}]",returnEnd:!0,contains:h}},y={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:s,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m,u("keyword","all\\b"),u("variable","@\\{"+r+"\\}"),{begin:"\\b("+hOt.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,u("selector-tag",s,0),u("selector-id","#"+s),u("selector-class","\\."+s,0),u("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+DDe.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+MDe.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},w={begin:r+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,b,v,w,g,y,m,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:o}}function yOt(e){const t="\\[=*\\[",n="\\]=*\\]",i={begin:t,end:n,contains:["self"]},r=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[i],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:r.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:r}].concat(r)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[i],relevance:5}])}}function VH(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},r={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=e.inherit(u,{contains:[]}),h=e.inherit(d,{contains:[]});u.contains.push(h),d.contains.push(f);let m=[n,c];return[u,d,f,h].forEach(y=>{y.contains=y.contains.concat(m)}),m=m.concat(u,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:m},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:m}]}]},n,s,u,d,{className:"quote",begin:"^>\\s+",contains:m,end:"$"},r,i,c,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function vOt(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,l={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},c={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:l,illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+c.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:c,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function xOt(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],i=/[dualxmsipngr]{0,12}/,r={$pattern:/[\w.]+/,keyword:n.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:r},o={begin:/->\{/,end:/\}/},l={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},c={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[l]},u={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},d=[e.BACKSLASH_ESCAPE,s,c],f=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],h=(b,v,y="\\1")=>{const w=y==="\\1"?y:t.concat(y,v);return t.concat(t.concat("(?:",b,")"),v,/(?:\\.|[^\\\/])*?/,w,/(?:\\.|[^\\\/])*?/,y,i)},m=(b,v,y)=>t.concat(t.concat("(?:",b,")"),v,/(?:\\.|[^\\\/])*?/,y,i),g=[c,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:"string",contains:d,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},u,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:h("s|tr|y",t.either(...f,{capture:!0}))},{begin:h("s|tr|y","\\(","\\)")},{begin:h("s|tr|y","\\[","\\]")},{begin:h("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:m("(?:m|qr)?",/\//,/\//)},{begin:m("m|qr",t.either(...f,{capture:!0}),/\1/)},{begin:m("m|qr",/\(/,/\)/)},{begin:m("m|qr",/\[/,/\]/)},{begin:m("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l,u]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return s.contains=g,o.contains=g,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:g}}function wOt(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,i=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),r=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),s=t.concat(/[A-Z]+/,n),o={scope:"variable",match:"\\$+"+i},l={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=e.inherit(e.APOS_STRING_MODE,{illegal:null}),d=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(c)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(P,I)=>{I.data._beginMatch=P[1]||P[2]},"on:end":(P,I)=>{I.data._beginMatch!==P[1]&&I.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),m=`[ -]`,g={scope:"string",variants:[d,u,f,h]},b={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},v=["false","null","true"],y=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],w=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],k={keyword:y,literal:(P=>{const I=[];return P.forEach(D=>{I.push(D),D.toLowerCase()===D?I.push(D.toUpperCase()):I.push(D.toLowerCase())}),I})(v),built_in:w},S=P=>P.map(I=>I.replace(/\|\d+$/,"")),O={variants:[{match:[/new/,t.concat(m,"+"),t.concat("(?!",S(w).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},A=t.concat(i,"\\b(?!\\()"),E={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),A],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,t.concat(/::/,t.lookahead(/(?!class\b)/)),A],scope:{1:"title.class",3:"variable.constant"}},{match:[r,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[r,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},j={scope:"attr",match:t.concat(i,t.lookahead(":"),t.lookahead(/(?!::)/))},T={relevance:0,begin:/\(/,end:/\)/,keywords:k,contains:[j,o,E,e.C_BLOCK_COMMENT_MODE,g,b,O]},R={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",S(y).join("\\b|"),"|",S(w).join("\\b|"),"\\b)"),i,t.concat(m,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[T]};T.contains.push(R);const C=[j,E,e.C_BLOCK_COMMENT_MODE,g,b,O],N={begin:t.concat(/#\[\s*\\?/,t.either(r,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:v,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:v,keyword:["new","array"]},contains:["self",...C]},...C,{scope:"meta",variants:[{match:r},{match:s}]}]};return{case_insensitive:!1,keywords:k,contains:[N,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},o,R,E,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},O,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:k,contains:["self",N,o,E,e.C_BLOCK_COMMENT_MODE,g,b]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},g,b]}}function kOt(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function LDe(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function qH(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},d={begin:/\{\{/,relevance:0},f={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h="[0-9](_?[0-9])*",m=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,g=`\\b|${i.join("|")}`,b={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${m}))[eE][+-]?(${h})[jJ]?(?=${g})`},{begin:`(${m})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${h})[jJ](?=${g})`}]},v={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,b,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,b,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,b,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,v,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[b,y,f]}]}}function OOt(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function SOt(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,i=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),r=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[r,i]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,i]},{scope:{1:"punctuation",2:"number"},match:[s,i]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,i]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:r},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function EOt(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",i=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),r=t.concat(i,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[l]}),e.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],d={className:"subst",begin:/#\{/,end:/\}/,keywords:o},f={className:"string",contains:[e.BACKSLASH_ESCAPE,d],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,d]})]}]},h="[1-9](_?[0-9])*|0",m="[0-9](_?[0-9])*",g={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${m}))?([eE][+-]?(${m})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},b={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},O=[f,{variants:[{match:[/class\s+/,r,/\s+<\s+/,r]},{match:[/\b(class|module)\s+/,r]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,r],scope:{2:"title.class"},keywords:o},{relevance:0,match:[r,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:i,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[b]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:n}],relevance:0},g,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(c,u),relevance:0}].concat(c,u);d.contains=O,b.contains=O;const T=[{begin:/^\s*=>/,starts:{end:"$",contains:O}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:O}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(T).concat(u).concat(O)}}function $De(e){const t=e.regex,n=/(r#)?/,i=t.concat(n,e.UNDERSCORE_IDENT_RE),r=t.concat(n,e.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,r,t.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",l=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],c=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],d=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:d,keyword:l,literal:c,built_in:u},illegal:""},s]}}const COt=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),AOt=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],TOt=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],_Ot=[...AOt,...TOt],jOt=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),NOt=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),ROt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),IOt=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function FDe(e){const t=COt(e),n=ROt,i=NOt,r="@[a-z-]+",s="and or not only",l={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+_Ot.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+i.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+IOt.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,l,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:r,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:jOt.join(" ")},contains:[{begin:r,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},l,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function POt(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function BDe(e){const t=e.regex,n=e.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],c=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],f=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],h=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],m=d,g=[...u,...c].filter(S=>!d.includes(S)),b={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},v={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:t.concat(/\b/,t.either(...m),/\s*\(/),relevance:0,keywords:{built_in:m}};function w(S){return t.concat(/\b/,t.either(...S.map(O=>O.replace(/\s+/,"\\s+"))),/\b/)}const x={scope:"keyword",match:w(h),relevance:0};function k(S,{exceptions:O,when:A}={}){const E=A;return O=O||[],S.map(j=>j.match(/\|\d+$/)||O.includes(j)?j:E(j)?`${j}|0`:j)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:k(g,{when:S=>S.length<3}),literal:s,type:l,built_in:f},contains:[{scope:"type",match:w(o)},x,y,b,i,r,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function UDe(e){return e?typeof e=="string"?e:e.source:null}function xO(e){return Gr("(?=",e,")")}function Gr(...e){return e.map(n=>UDe(n)).join("")}function DOt(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function ql(...e){return"("+(DOt(e).capture?"":"?:")+e.map(i=>UDe(i)).join("|")+")"}const WH=e=>Gr(/\b/,e,/\w$/.test(e)?/\b/:/\B/),MOt=["Protocol","Type"].map(WH),Zte=["init","self"].map(WH),LOt=["Any","Self"],C4=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Jte=["false","nil","true"],$Ot=["assignment","associativity","higherThan","left","lowerThan","none","right"],FOt=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],ene=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],QDe=ql(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),zDe=ql(QDe,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),A4=Gr(QDe,zDe,"*"),VDe=ql(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),SI=ql(VDe,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),qf=Gr(VDe,SI,"*"),C_=Gr(/[A-Z]/,SI,"*"),BOt=["attached","autoclosure",Gr(/convention\(/,ql("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Gr(/objc\(/,qf,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],UOt=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function QOt(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[e.C_LINE_COMMENT_MODE,n],r={match:[/\./,ql(...MOt,...Zte)],className:{2:"keyword"}},s={match:Gr(/\./,ql(...C4)),relevance:0},o=C4.filter(Oe=>typeof Oe=="string").concat(["_|0"]),l=C4.filter(Oe=>typeof Oe!="string").concat(LOt).map(WH),c={variants:[{className:"keyword",match:ql(...l,...Zte)}]},u={$pattern:ql(/\b\w+/,/#\w+/),keyword:o.concat(FOt),literal:Jte},d=[r,s,c],f={match:Gr(/\./,ql(...ene)),relevance:0},h={className:"built_in",match:Gr(/\b/,ql(...ene),/(?=\()/)},m=[f,h],g={match:/->/,relevance:0},b={className:"operator",relevance:0,variants:[{match:A4},{match:`\\.(\\.|${zDe})+`}]},v=[g,b],y="([0-9]_*)+",w="([0-9a-fA-F]_*)+",x={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${w})(\\.(${w}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},k=(Oe="")=>({className:"subst",variants:[{match:Gr(/\\/,Oe,/[0\\tnr"']/)},{match:Gr(/\\/,Oe,/u\{[0-9a-fA-F]{1,8}\}/)}]}),S=(Oe="")=>({className:"subst",match:Gr(/\\/,Oe,/[\t ]*(?:[\r\n]|\r\n)/)}),O=(Oe="")=>({className:"subst",label:"interpol",begin:Gr(/\\/,Oe,/\(/),end:/\)/}),A=(Oe="")=>({begin:Gr(Oe,/"""/),end:Gr(/"""/,Oe),contains:[k(Oe),S(Oe),O(Oe)]}),E=(Oe="")=>({begin:Gr(Oe,/"/),end:Gr(/"/,Oe),contains:[k(Oe),O(Oe)]}),j={className:"string",variants:[A(),A("#"),A("##"),A("###"),E(),E("#"),E("##"),E("###")]},T=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],R={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:T},C=Oe=>{const fe=Gr(Oe,/\//),pe=Gr(/\//,Oe);return{begin:fe,end:pe,contains:[...T,{scope:"comment",begin:`#(?!.*${pe})`,end:/$/}]}},N={scope:"regexp",variants:[C("###"),C("##"),C("#"),R]},P={match:Gr(/`/,qf,/`/)},I={className:"variable",match:/\$\d+/},D={className:"variable",match:`\\$${SI}+`},_=[P,I,D],L={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:UOt,contains:[...v,x,j]}]}},F={scope:"keyword",match:Gr(/@/,ql(...BOt),xO(ql(/\(/,/\s+/)))},M={scope:"meta",match:Gr(/@/,qf)},H=[L,F,M],q={match:xO(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Gr(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,SI,"+")},{className:"type",match:C_,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Gr(/\s+&\s+/,xO(C_)),relevance:0}]},U={begin://,keywords:u,contains:[...i,...d,...H,g,q]};q.contains.push(U);const Z={match:Gr(qf,/\s*:/),keywords:"_|0",relevance:0},z={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",Z,...i,N,...d,...m,...v,x,j,..._,...H,q]},J={begin://,keywords:"repeat each",contains:[...i,q]},ne={begin:ql(xO(Gr(qf,/\s*:/)),xO(Gr(qf,/\s+/,qf,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:qf}]},W={begin:/\(/,end:/\)/,keywords:u,contains:[ne,...i,...d,...v,x,j,...H,q,z],endsParent:!0,illegal:/["']/},X={match:[/(func|macro)/,/\s+/,ql(P.match,qf,A4)],className:{1:"keyword",3:"title.function"},contains:[J,W,t],illegal:[/\[/,/%/]},le={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[J,W,t],illegal:/\[|%/},V={match:[/operator/,/\s+/,A4],className:{1:"keyword",3:"title"}},Y={begin:[/precedencegroup/,/\s+/,C_],className:{1:"keyword",3:"title"},contains:[q],keywords:[...$Ot,...Jte],end:/}/},K={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},ue={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},te={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,qf,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[J,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:C_},...d],relevance:0}]};for(const Oe of j.variants){const fe=Oe.contains.find(Se=>Se.label==="interpol");fe.keywords=u;const pe=[...d,...m,...v,x,j,..._];fe.contains=[...pe,{begin:/\(/,end:/\)/,contains:["self",...pe]}]}return{name:"Swift",keywords:u,contains:[...i,X,le,K,ue,te,V,Y,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},N,...d,...m,...v,x,j,..._,...H,q,z]}}const EI="[A-Za-z$_][0-9A-Za-z$_]*",HDe=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],qDe=["true","false","null","undefined","NaN","Infinity"],WDe=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],KDe=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],GDe=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],XDe=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],YDe=[].concat(GDe,WDe,KDe);function zOt(e){const t=e.regex,n=(L,{after:F})=>{const M="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,F)=>{const M=L[0].length+L.index,H=L.input[M];if(H==="<"||H===","){F.ignoreMatch();return}H===">"&&(n(L,{after:M})||F.ignoreMatch());let q;const U=L.input.substring(M);if(q=U.match(/^\s*=/)){F.ignoreMatch();return}if((q=U.match(/^\s+extends\s+/))&&q.index===0){F.ignoreMatch();return}}},l={$pattern:EI,keyword:HDe,literal:qDe,built_in:YDe,"variable.language":XDe},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},m={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},w={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const k=[].concat(w,h.contains),S=k.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(k)}]),O={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},A={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},E={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...WDe,...KDe]}},j={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[O],illegal:/%/},R={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function C(L){return t.concat("(?!",L.join("|"),")")}const N={match:t.concat(/\b/,C([...GDe,"super","import"].map(L=>`${L}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},P={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},I={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},O]},D="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",_={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[O]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:E},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),j,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,w,{match:/\$\d+/},f,E,{scope:"attr",match:i+t.lookahead(":"),relevance:0},_,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[w,e.REGEXP_MODE,{className:"function",begin:D,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[O,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},P,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[O]},N,R,A,I,{match:/\$[(.]/}]}}function KH(e){const t=e.regex,n=zOt(e),i=EI,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[n.exports.CLASS_REFERENCE]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:EI,keyword:HDe.concat(c),literal:qDe,built_in:YDe.concat(r),"variable.language":XDe},d={className:"meta",begin:"@"+i},f=(b,v,y)=>{const w=b.contains.findIndex(x=>x.label===v);if(w===-1)throw new Error("can not find mode to replace");b.contains.splice(w,1,y)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(b=>b.scope==="attr"),m=Object.assign({},h,{match:t.concat(i,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,h,m]),n.contains=n.contains.concat([d,s,o,m]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",l);const g=n.contains.find(b=>b.label==="func.def");return g.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function VOt(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},i={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},r=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,l=/\d{1,2}(:\d{1,2}){1,2}/,c={className:"literal",variants:[{begin:t.concat(/# */,t.either(s,r),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(s,r),/ +/,t.either(o,l),/ *#/)}]},u={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},d={className:"label",begin:/^\w+:/},f=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),h=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,i,c,u,d,f,h,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[h]}]}}function HOt(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),i=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],r={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},s={className:"variable",begin:/\$[\w_]+/},o={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},l={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},c={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},u={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:i},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,o,r,e.QUOTE_STRING_MODE,c,u,l]}}function ZDe(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(s,{begin:/\(/,end:/\)/}),l=e.inherit(e.APOS_STRING_MODE,{className:"string"}),c=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[s,c,l,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[s,o,c,l]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function GH(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},l=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),h={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},m={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},g={begin:/\{/,end:/\}/,contains:[m],illegal:"\\n",relevance:0},b={begin:"\\[",end:"\\]",contains:[m],illegal:"\\n",relevance:0},v=[i,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},h,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},g,b,s,o],y=[...v];return y.pop(),y.push(l),m.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}const qOt={arduino:Hkt,bash:OM,c:qkt,cpp:Wkt,csharp:Kkt,css:ADe,diff:TDe,go:_De,graphql:iOt,ini:UH,java:NDe,javascript:QH,json:zH,kotlin:cOt,less:bOt,lua:yOt,makefile:VH,markdown:HH,objectivec:vOt,perl:xOt,php:wOt,"php-template":kOt,plaintext:LDe,python:qH,"python-repl":OOt,r:SOt,ruby:EOt,rust:$De,scss:FDe,shell:POt,sql:BDe,swift:QOt,typescript:KH,vbnet:VOt,wasm:HOt,xml:ZDe,yaml:GH};function JDe(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],i=typeof n;(i==="object"||i==="function")&&!Object.isFrozen(n)&&JDe(n)}),e}let tne=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function eMe(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function gg(e,...t){const n=Object.create(null);for(const i in e)n[i]=e[i];return t.forEach(function(i){for(const r in i)n[r]=i[r]}),n}const WOt="",nne=e=>!!e.scope,KOt=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((i,r)=>`${i}${"_".repeat(r+1)}`)].join(" ")}return`${t}${e}`};class GOt{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=eMe(t)}openNode(t){if(!nne(t))return;const n=KOt(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){nne(t)&&(this.buffer+=WOt)}value(){return this.buffer}span(t){this.buffer+=``}}const ine=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class XH{constructor(){this.rootNode=ine(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const n=ine({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(i=>this._walk(t,i)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{XH._collapse(n)}))}}class XOt extends XH{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const i=t.root;n&&(i.scope=`language:${n}`),this.add(i)}toHTML(){return new GOt(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function AC(e){return e?typeof e=="string"?e:e.source:null}function tMe(e){return Kv("(?=",e,")")}function YOt(e){return Kv("(?:",e,")*")}function ZOt(e){return Kv("(?:",e,")?")}function Kv(...e){return e.map(n=>AC(n)).join("")}function JOt(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function YH(...e){return"("+(JOt(e).capture?"":"?:")+e.map(i=>AC(i)).join("|")+")"}function nMe(e){return new RegExp(e.toString()+"|").exec("").length-1}function eSt(e,t){const n=e&&e.exec(t);return n&&n.index===0}const tSt=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function ZH(e,{joinWith:t}){let n=0;return e.map(i=>{n+=1;const r=n;let s=AC(i),o="";for(;s.length>0;){const l=tSt.exec(s);if(!l){o+=s;break}o+=s.substring(0,l.index),s=s.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?o+="\\"+String(Number(l[1])+r):(o+=l[0],l[0]==="("&&n++)}return o}).map(i=>`(${i})`).join(t)}const nSt=/\b\B/,iMe="[a-zA-Z]\\w*",JH="[a-zA-Z_]\\w*",rMe="\\b\\d+(\\.\\d+)?",sMe="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",aMe="\\b(0b[01]+)",iSt="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",rSt=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Kv(t,/.*\b/,e.binary,/\b.*/)),gg({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},e)},TC={begin:"\\\\[\\s\\S]",relevance:0},sSt={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[TC]},aSt={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[TC]},oSt={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},SM=function(e,t,n={}){const i=gg({scope:"comment",begin:e,end:t,contains:[]},n);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const r=YH("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return i.contains.push({begin:Kv(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},lSt=SM("//","$"),cSt=SM("/\\*","\\*/"),uSt=SM("#","$"),dSt={scope:"number",begin:rMe,relevance:0},fSt={scope:"number",begin:sMe,relevance:0},hSt={scope:"number",begin:aMe,relevance:0},pSt={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[TC,{begin:/\[/,end:/\]/,relevance:0,contains:[TC]}]},mSt={scope:"title",begin:iMe,relevance:0},gSt={scope:"title",begin:JH,relevance:0},bSt={begin:"\\.\\s*"+JH,relevance:0},ySt=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})};var A_=Object.freeze({__proto__:null,APOS_STRING_MODE:sSt,BACKSLASH_ESCAPE:TC,BINARY_NUMBER_MODE:hSt,BINARY_NUMBER_RE:aMe,COMMENT:SM,C_BLOCK_COMMENT_MODE:cSt,C_LINE_COMMENT_MODE:lSt,C_NUMBER_MODE:fSt,C_NUMBER_RE:sMe,END_SAME_AS_BEGIN:ySt,HASH_COMMENT_MODE:uSt,IDENT_RE:iMe,MATCH_NOTHING_RE:nSt,METHOD_GUARD:bSt,NUMBER_MODE:dSt,NUMBER_RE:rMe,PHRASAL_WORDS_MODE:oSt,QUOTE_STRING_MODE:aSt,REGEXP_MODE:pSt,RE_STARTERS_RE:iSt,SHEBANG:rSt,TITLE_MODE:mSt,UNDERSCORE_IDENT_RE:JH,UNDERSCORE_TITLE_MODE:gSt});function vSt(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function xSt(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function wSt(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=vSt,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function kSt(e,t){Array.isArray(e.illegal)&&(e.illegal=YH(...e.illegal))}function OSt(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function SSt(e,t){e.relevance===void 0&&(e.relevance=1)}const ESt=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(i=>{delete e[i]}),e.keywords=n.keywords,e.begin=Kv(n.beforeMatch,tMe(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},CSt=["of","and","for","in","not","or","if","then","parent","list","value"],ASt="keyword";function oMe(e,t,n=ASt){const i=Object.create(null);return typeof e=="string"?r(n,e.split(" ")):Array.isArray(e)?r(n,e):Object.keys(e).forEach(function(s){Object.assign(i,oMe(e[s],t,s))}),i;function r(s,o){t&&(o=o.map(l=>l.toLowerCase())),o.forEach(function(l){const c=l.split("|");i[c[0]]=[s,TSt(c[0],c[1])]})}}function TSt(e,t){return t?Number(t):_St(e)?0:1}function _St(e){return CSt.includes(e.toLowerCase())}const rne={},qy=e=>{console.error(e)},sne=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Q0=(e,t)=>{rne[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),rne[`${e}/${t}`]=!0)},CI=new Error;function lMe(e,t,{key:n}){let i=0;const r=e[n],s={},o={};for(let l=1;l<=t.length;l++)o[l+i]=r[l],s[l+i]=!0,i+=nMe(t[l-1]);e[n]=o,e[n]._emit=s,e[n]._multi=!0}function jSt(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw qy("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),CI;if(typeof e.beginScope!="object"||e.beginScope===null)throw qy("beginScope must be object"),CI;lMe(e,e.begin,{key:"beginScope"}),e.begin=ZH(e.begin,{joinWith:""})}}function NSt(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw qy("skip, excludeEnd, returnEnd not compatible with endScope: {}"),CI;if(typeof e.endScope!="object"||e.endScope===null)throw qy("endScope must be object"),CI;lMe(e,e.end,{key:"endScope"}),e.end=ZH(e.end,{joinWith:""})}}function RSt(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function ISt(e){RSt(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),jSt(e),NSt(e)}function PSt(e){function t(o,l){return new RegExp(AC(o),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,l]),this.matchAt+=nMe(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(ZH(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(l);if(!c)return null;const u=c.findIndex((f,h)=>h>0&&f!==void 0),d=this.matchIndexes[u];return c.splice(0,u),Object.assign(c,d)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];const c=new n;return this.rules.slice(l).forEach(([u,d])=>c.addRule(u,d)),c.compile(),this.multiRegexes[l]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,c){this.rules.push([l,c]),c.type==="begin"&&this.count++}exec(l){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let u=c.exec(l);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,u=d.exec(l)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function r(o){const l=new i;return o.contains.forEach(c=>l.addRule(c.begin,{rule:c,type:"begin"})),o.terminatorEnd&&l.addRule(o.terminatorEnd,{type:"end"}),o.illegal&&l.addRule(o.illegal,{type:"illegal"}),l}function s(o,l){const c=o;if(o.isCompiled)return c;[xSt,OSt,ISt,ESt].forEach(d=>d(o,l)),e.compilerExtensions.forEach(d=>d(o,l)),o.__beforeBegin=null,[wSt,kSt,SSt].forEach(d=>d(o,l)),o.isCompiled=!0;let u=null;return typeof o.keywords=="object"&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),u=o.keywords.$pattern,delete o.keywords.$pattern),u=u||/\w+/,o.keywords&&(o.keywords=oMe(o.keywords,e.case_insensitive)),c.keywordPatternRe=t(u,!0),l&&(o.begin||(o.begin=/\B|\b/),c.beginRe=t(c.begin),!o.end&&!o.endsWithParent&&(o.end=/\B|\b/),o.end&&(c.endRe=t(c.end)),c.terminatorEnd=AC(c.end)||"",o.endsWithParent&&l.terminatorEnd&&(c.terminatorEnd+=(o.end?"|":"")+l.terminatorEnd)),o.illegal&&(c.illegalRe=t(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(d){return DSt(d==="self"?o:d)})),o.contains.forEach(function(d){s(d,c)}),o.starts&&s(o.starts,l),c.matcher=r(c),c}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=gg(e.classNameAliases||{}),s(e)}function cMe(e){return e?e.endsWithParent||cMe(e.starts):!1}function DSt(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return gg(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:cMe(e)?gg(e,{starts:e.starts?gg(e.starts):null}):Object.isFrozen(e)?gg(e):e}var MSt="11.11.1";class LSt extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const T4=eMe,ane=gg,one=Symbol("nomatch"),$St=7,uMe=function(e){const t=Object.create(null),n=Object.create(null),i=[];let r=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",o={disableAutodetect:!0,name:"Plain text",contains:[]};let l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:XOt};function c(D){return l.noHighlightRe.test(D)}function u(D){let _=D.className+" ";_+=D.parentNode?D.parentNode.className:"";const L=l.languageDetectRe.exec(_);if(L){const F=E(L[1]);return F||(sne(s.replace("{}",L[1])),sne("Falling back to no-highlight mode for this block.",D)),F?L[1]:"no-highlight"}return _.split(/\s+/).find(F=>c(F)||E(F))}function d(D,_,L){let F="",M="";typeof _=="object"?(F=D,L=_.ignoreIllegals,M=_.language):(Q0("10.7.0","highlight(lang, code, ...args) has been deprecated."),Q0("10.7.0",`Please use highlight(code, options) instead. -https://github.com/highlightjs/highlight.js/issues/2277`),M=D,F=_),L===void 0&&(L=!0);const H={code:F,language:M};P("before:highlight",H);const q=H.result?H.result:f(H.language,H.code,L);return q.code=H.code,P("after:highlight",q),q}function f(D,_,L,F){const M=Object.create(null);function H(ce,ye){return ce.keywords[ye]}function q(){if(!pe.keywords){ve.addText(Le);return}let ce=0;pe.keywordPatternRe.lastIndex=0;let ye=pe.keywordPatternRe.exec(Le),Ae="";for(;ye;){Ae+=Le.substring(ce,ye.index);const Ee=te.case_insensitive?ye[0].toLowerCase():ye[0],Ce=H(pe,Ee);if(Ce){const[Be,he]=Ce;if(ve.addText(Ae),Ae="",M[Ee]=(M[Ee]||0)+1,M[Ee]<=$St&&(He+=he),Be.startsWith("_"))Ae+=ye[0];else{const ie=te.classNameAliases[Be]||Be;z(ye[0],ie)}}else Ae+=ye[0];ce=pe.keywordPatternRe.lastIndex,ye=pe.keywordPatternRe.exec(Le)}Ae+=Le.substring(ce),ve.addText(Ae)}function U(){if(Le==="")return;let ce=null;if(typeof pe.subLanguage=="string"){if(!t[pe.subLanguage]){ve.addText(Le);return}ce=f(pe.subLanguage,Le,!0,Se[pe.subLanguage]),Se[pe.subLanguage]=ce._top}else ce=m(Le,pe.subLanguage.length?pe.subLanguage:null);pe.relevance>0&&(He+=ce.relevance),ve.__addSublanguage(ce._emitter,ce.language)}function Z(){pe.subLanguage!=null?U():q(),Le=""}function z(ce,ye){ce!==""&&(ve.startScope(ye),ve.addText(ce),ve.endScope())}function J(ce,ye){let Ae=1;const Ee=ye.length-1;for(;Ae<=Ee;){if(!ce._emit[Ae]){Ae++;continue}const Ce=te.classNameAliases[ce[Ae]]||ce[Ae],Be=ye[Ae];Ce?z(Be,Ce):(Le=Be,q(),Le=""),Ae++}}function ne(ce,ye){return ce.scope&&typeof ce.scope=="string"&&ve.openNode(te.classNameAliases[ce.scope]||ce.scope),ce.beginScope&&(ce.beginScope._wrap?(z(Le,te.classNameAliases[ce.beginScope._wrap]||ce.beginScope._wrap),Le=""):ce.beginScope._multi&&(J(ce.beginScope,ye),Le="")),pe=Object.create(ce,{parent:{value:pe}}),pe}function W(ce,ye,Ae){let Ee=eSt(ce.endRe,Ae);if(Ee){if(ce["on:end"]){const Ce=new tne(ce);ce["on:end"](ye,Ce),Ce.isMatchIgnored&&(Ee=!1)}if(Ee){for(;ce.endsParent&&ce.parent;)ce=ce.parent;return ce}}if(ce.endsWithParent)return W(ce.parent,ye,Ae)}function X(ce){return pe.matcher.regexIndex===0?(Le+=ce[0],1):(se=!0,0)}function le(ce){const ye=ce[0],Ae=ce.rule,Ee=new tne(Ae),Ce=[Ae.__beforeBegin,Ae["on:begin"]];for(const Be of Ce)if(Be&&(Be(ce,Ee),Ee.isMatchIgnored))return X(ye);return Ae.skip?Le+=ye:(Ae.excludeBegin&&(Le+=ye),Z(),!Ae.returnBegin&&!Ae.excludeBegin&&(Le=ye)),ne(Ae,ce),Ae.returnBegin?0:ye.length}function V(ce){const ye=ce[0],Ae=_.substring(ce.index),Ee=W(pe,ce,Ae);if(!Ee)return one;const Ce=pe;pe.endScope&&pe.endScope._wrap?(Z(),z(ye,pe.endScope._wrap)):pe.endScope&&pe.endScope._multi?(Z(),J(pe.endScope,ce)):Ce.skip?Le+=ye:(Ce.returnEnd||Ce.excludeEnd||(Le+=ye),Z(),Ce.excludeEnd&&(Le=ye));do pe.scope&&ve.closeNode(),!pe.skip&&!pe.subLanguage&&(He+=pe.relevance),pe=pe.parent;while(pe!==Ee.parent);return Ee.starts&&ne(Ee.starts,ce),Ce.returnEnd?0:ye.length}function Y(){const ce=[];for(let ye=pe;ye!==te;ye=ye.parent)ye.scope&&ce.unshift(ye.scope);ce.forEach(ye=>ve.openNode(ye))}let K={};function ue(ce,ye){const Ae=ye&&ye[0];if(Le+=ce,Ae==null)return Z(),0;if(K.type==="begin"&&ye.type==="end"&&K.index===ye.index&&Ae===""){if(Le+=_.slice(ye.index,ye.index+1),!r){const Ee=new Error(`0 width match regex (${D})`);throw Ee.languageName=D,Ee.badRule=K.rule,Ee}return 1}if(K=ye,ye.type==="begin")return le(ye);if(ye.type==="illegal"&&!L){const Ee=new Error('Illegal lexeme "'+Ae+'" for mode "'+(pe.scope||"")+'"');throw Ee.mode=pe,Ee}else if(ye.type==="end"){const Ee=V(ye);if(Ee!==one)return Ee}if(ye.type==="illegal"&&Ae==="")return Le+=` -`,1;if(De>1e5&&De>ye.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Le+=Ae,Ae.length}const te=E(D);if(!te)throw qy(s.replace("{}",D)),new Error('Unknown language: "'+D+'"');const Oe=PSt(te);let fe="",pe=F||Oe;const Se={},ve=new l.__emitter(l);Y();let Le="",He=0,Ge=0,De=0,se=!1;try{if(te.__emitTokens)te.__emitTokens(_,ve);else{for(pe.matcher.considerAll();;){De++,se?se=!1:pe.matcher.considerAll(),pe.matcher.lastIndex=Ge;const ce=pe.matcher.exec(_);if(!ce)break;const ye=_.substring(Ge,ce.index),Ae=ue(ye,ce);Ge=ce.index+Ae}ue(_.substring(Ge))}return ve.finalize(),fe=ve.toHTML(),{language:D,value:fe,relevance:He,illegal:!1,_emitter:ve,_top:pe}}catch(ce){if(ce.message&&ce.message.includes("Illegal"))return{language:D,value:T4(_),illegal:!0,relevance:0,_illegalBy:{message:ce.message,index:Ge,context:_.slice(Ge-100,Ge+100),mode:ce.mode,resultSoFar:fe},_emitter:ve};if(r)return{language:D,value:T4(_),illegal:!1,relevance:0,errorRaised:ce,_emitter:ve,_top:pe};throw ce}}function h(D){const _={value:T4(D),illegal:!1,relevance:0,_top:o,_emitter:new l.__emitter(l)};return _._emitter.addText(D),_}function m(D,_){_=_||l.languages||Object.keys(t);const L=h(D),F=_.filter(E).filter(T).map(Z=>f(Z,D,!1));F.unshift(L);const M=F.sort((Z,z)=>{if(Z.relevance!==z.relevance)return z.relevance-Z.relevance;if(Z.language&&z.language){if(E(Z.language).supersetOf===z.language)return 1;if(E(z.language).supersetOf===Z.language)return-1}return 0}),[H,q]=M,U=H;return U.secondBest=q,U}function g(D,_,L){const F=_&&n[_]||L;D.classList.add("hljs"),D.classList.add(`language-${F}`)}function b(D){let _=null;const L=u(D);if(c(L))return;if(P("before:highlightElement",{el:D,language:L}),D.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",D);return}if(D.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(D)),l.throwUnescapedHTML))throw new LSt("One of your code blocks includes unescaped HTML.",D.innerHTML);_=D;const F=_.textContent,M=L?d(F,{language:L,ignoreIllegals:!0}):m(F);D.innerHTML=M.value,D.dataset.highlighted="yes",g(D,L,M.language),D.result={language:M.language,re:M.relevance,relevance:M.relevance},M.secondBest&&(D.secondBest={language:M.secondBest.language,relevance:M.secondBest.relevance}),P("after:highlightElement",{el:D,result:M,text:F})}function v(D){l=ane(l,D)}const y=()=>{k(),Q0("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function w(){k(),Q0("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let x=!1;function k(){function D(){k()}if(document.readyState==="loading"){x||window.addEventListener("DOMContentLoaded",D,!1),x=!0;return}document.querySelectorAll(l.cssSelector).forEach(b)}function S(D,_){let L=null;try{L=_(e)}catch(F){if(qy("Language definition for '{}' could not be registered.".replace("{}",D)),r)qy(F);else throw F;L=o}L.name||(L.name=D),t[D]=L,L.rawDefinition=_.bind(null,e),L.aliases&&j(L.aliases,{languageName:D})}function O(D){delete t[D];for(const _ of Object.keys(n))n[_]===D&&delete n[_]}function A(){return Object.keys(t)}function E(D){return D=(D||"").toLowerCase(),t[D]||t[n[D]]}function j(D,{languageName:_}){typeof D=="string"&&(D=[D]),D.forEach(L=>{n[L.toLowerCase()]=_})}function T(D){const _=E(D);return _&&!_.disableAutodetect}function R(D){D["before:highlightBlock"]&&!D["before:highlightElement"]&&(D["before:highlightElement"]=_=>{D["before:highlightBlock"](Object.assign({block:_.el},_))}),D["after:highlightBlock"]&&!D["after:highlightElement"]&&(D["after:highlightElement"]=_=>{D["after:highlightBlock"](Object.assign({block:_.el},_))})}function C(D){R(D),i.push(D)}function N(D){const _=i.indexOf(D);_!==-1&&i.splice(_,1)}function P(D,_){const L=D;i.forEach(function(F){F[L]&&F[L](_)})}function I(D){return Q0("10.7.0","highlightBlock will be removed entirely in v12.0"),Q0("10.7.0","Please use highlightElement now."),b(D)}Object.assign(e,{highlight:d,highlightAuto:m,highlightAll:k,highlightElement:b,highlightBlock:I,configure:v,initHighlighting:y,initHighlightingOnLoad:w,registerLanguage:S,unregisterLanguage:O,listLanguages:A,getLanguage:E,registerAliases:j,autoDetection:T,inherit:ane,addPlugin:C,removePlugin:N}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString=MSt,e.regex={concat:Kv,lookahead:tMe,either:YH,optional:ZOt,anyNumberOfTimes:YOt};for(const D in A_)typeof A_[D]=="object"&&JDe(A_[D]);return Object.assign(e,A_),e},o1=uMe({});o1.newInstance=()=>uMe({});var FSt=o1;o1.HighlightJS=o1;o1.default=o1;const cl=N1(FSt),lne={},BSt="hljs-";function USt(e){const t=cl.newInstance();return e&&s(e),{highlight:n,highlightAuto:i,listLanguages:r,register:s,registerAlias:o,registered:l};function n(c,u,d){const f=d||lne,h=typeof f.prefix=="string"?f.prefix:BSt;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:QSt,classPrefix:h});const m=t.highlight(u,{ignoreIllegals:!0,language:c});if(m.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:m.errorRaised});const g=m._emitter.root,b=g.data;return b.language=m.language,b.relevance=m.relevance,g}function i(c,u){const f=(u||lne).subset||r();let h=-1,m=0,g;for(;++hm&&(m=v.data.relevance,g=v)}return g||{type:"root",children:[],data:{language:void 0,relevance:m}}}function r(){return t.listLanguages()}function s(c,u){if(typeof c=="string")t.registerLanguage(c,u);else{let d;for(d in c)Object.hasOwn(c,d)&&t.registerLanguage(d,c[d])}}function o(c,u){if(typeof c=="string")t.registerAliases(typeof u=="string"?u:[...u],{languageName:c});else{let d;for(d in c)if(Object.hasOwn(c,d)){const f=c[d];t.registerAliases(typeof f=="string"?f:[...f],{languageName:d})}}}function l(c){return!!t.getLanguage(c)}}class QSt{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],i=n.children[n.children.length-1];i&&i.type==="text"?i.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const i=this.stack[this.stack.length-1],r=t.root.children;n?i.children.push({type:"element",tagName:"span",properties:{className:[n]},children:r}):i.children.push(...r)}openNode(t){const n=this,i=t.split(".").map(function(o,l){return l?o+"_".repeat(l):n.options.classPrefix+o}),r=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:i},children:[]};r.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const zSt={};function cne(e){const t=e||zSt,n=t.aliases,i=t.detect||!1,r=t.languages||qOt,s=t.plainText,o=t.prefix,l=t.subset;let c="hljs";const u=USt(r);if(n&&u.registerAlias(n),o){const d=o.indexOf("-");c=d===-1?o:o.slice(0,d)}return function(d,f){yT(d,"element",function(h,m,g){if(h.tagName!=="code"||!g||g.type!=="element"||g.tagName!=="pre")return;const b=VSt(h);if(b===!1||!b&&!i||b&&s&&s.includes(b))return;Array.isArray(h.properties.className)||(h.properties.className=[]),h.properties.className.includes(c)||h.properties.className.unshift(c);const v=Lkt(h,{whitespace:"pre"});let y;try{y=b?u.highlight(b,v,{prefix:o}):u.highlightAuto(v,{prefix:o,subset:l})}catch(w){const x=w;if(b&&/Unknown language/.test(x.message)){f.message("Cannot highlight as `"+b+"`, it’s not registered",{ancestors:[g,h],cause:x,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw x}!b&&y.data&&y.data.language&&h.properties.className.push("language-"+y.data.language),y.children.length>0&&(h.children=y.children)})}}function VSt(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let i;for(;++n-1&&s<=t.length){let o=0;for(;;){let l=n[o];if(l===void 0){const c=fne(t,n[o-1]);l=c===-1?t.length+1:c+1,n[o]=l}if(l>s)return{line:o+1,column:s-(o>0?n[o-1]:0)+1,offset:s};o++}}}function r(s){if(s&&typeof s.line=="number"&&typeof s.column=="number"&&!Number.isNaN(s.line)&&!Number.isNaN(s.column)){for(;n.length1?n[s.line-2]:0)+s.column-1;if(o=55296&&e<=57343}function gEt(e){return e>=56320&&e<=57343}function bEt(e,t){return(e-55296)*1024+9216+t}function gMe(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function bMe(e){return e>=64976&&e<=65007||mEt.has(e)}var ht;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(ht||(ht={}));const yEt=65536;class vEt{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=yEt,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:i,col:r,offset:s}=this,o=r+n,l=s+n;return{code:t,startLine:i,endLine:i,startCol:o,endCol:o,startOffset:l,endOffset:l}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(gEt(n))return this.pos++,this._addGap(),bEt(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,ke.EOF;return this._err(ht.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let i=0;i=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,ke.EOF;const i=this.html.charCodeAt(n);return i===ke.CARRIAGE_RETURN?ke.LINE_FEED:i}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,ke.EOF;let t=this.html.charCodeAt(this.pos);return t===ke.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,ke.LINE_FEED):t===ke.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,mMe(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===ke.LINE_FEED||t===ke.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){gMe(t)?this._err(ht.controlCharacterInInputStream):bMe(t)&&this._err(ht.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const xEt=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),wEt=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function kEt(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=wEt.get(e))!==null&&t!==void 0?t:e}var Po;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Po||(Po={}));const OEt=32;var bg;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(bg||(bg={}));function YB(e){return e>=Po.ZERO&&e<=Po.NINE}function SEt(e){return e>=Po.UPPER_A&&e<=Po.UPPER_F||e>=Po.LOWER_A&&e<=Po.LOWER_F}function EEt(e){return e>=Po.UPPER_A&&e<=Po.UPPER_Z||e>=Po.LOWER_A&&e<=Po.LOWER_Z||YB(e)}function CEt(e){return e===Po.EQUALS||EEt(e)}var Ao;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Ao||(Ao={}));var xp;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(xp||(xp={}));class AEt{constructor(t,n,i){this.decodeTree=t,this.emitCodePoint=n,this.errors=i,this.state=Ao.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=xp.Strict}startEntity(t){this.decodeMode=t,this.state=Ao.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Ao.EntityStart:return t.charCodeAt(n)===Po.NUM?(this.state=Ao.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Ao.NamedEntity,this.stateNamedEntity(t,n));case Ao.NumericStart:return this.stateNumericStart(t,n);case Ao.NumericDecimal:return this.stateNumericDecimal(t,n);case Ao.NumericHex:return this.stateNumericHex(t,n);case Ao.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|OEt)===Po.LOWER_X?(this.state=Ao.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Ao.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,i,r){if(n!==i){const s=i-n;this.result=this.result*Math.pow(r,s)+Number.parseInt(t.substr(n,s),r),this.consumed+=s}}stateNumericHex(t,n){const i=n;for(;n>14;for(;n>14,s!==0){if(o===Po.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==xp.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:i}=this,r=(i[n]&bg.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,r,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,i){const{decodeTree:r}=this;return this.emitCodePoint(n===1?r[t]&~bg.VALUE_LENGTH:r[t+1],i),n===3&&this.emitCodePoint(r[t+2],i),i}end(){var t;switch(this.state){case Ao.NamedEntity:return this.result!==0&&(this.decodeMode!==xp.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Ao.NumericDecimal:return this.emitNumericEntity(0,2);case Ao.NumericHex:return this.emitNumericEntity(0,3);case Ao.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Ao.EntityStart:return 0}}}function TEt(e,t,n,i){const r=(t&bg.BRANCH_LENGTH)>>7,s=t&bg.JUMP_TABLE;if(r===0)return s!==0&&i===s?n:-1;if(s){const c=i-s;return c<0||c>=r?-1:e[n+c]-1}let o=n,l=o+r-1;for(;o<=l;){const c=o+l>>>1,u=e[c];if(ui)l=c-1;else return e[c+r]}return-1}var jt;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(jt||(jt={}));var Wy;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Wy||(Wy={}));var ad;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(ad||(ad={}));var et;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(et||(et={}));var B;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(B||(B={}));const _Et=new Map([[et.A,B.A],[et.ADDRESS,B.ADDRESS],[et.ANNOTATION_XML,B.ANNOTATION_XML],[et.APPLET,B.APPLET],[et.AREA,B.AREA],[et.ARTICLE,B.ARTICLE],[et.ASIDE,B.ASIDE],[et.B,B.B],[et.BASE,B.BASE],[et.BASEFONT,B.BASEFONT],[et.BGSOUND,B.BGSOUND],[et.BIG,B.BIG],[et.BLOCKQUOTE,B.BLOCKQUOTE],[et.BODY,B.BODY],[et.BR,B.BR],[et.BUTTON,B.BUTTON],[et.CAPTION,B.CAPTION],[et.CENTER,B.CENTER],[et.CODE,B.CODE],[et.COL,B.COL],[et.COLGROUP,B.COLGROUP],[et.DD,B.DD],[et.DESC,B.DESC],[et.DETAILS,B.DETAILS],[et.DIALOG,B.DIALOG],[et.DIR,B.DIR],[et.DIV,B.DIV],[et.DL,B.DL],[et.DT,B.DT],[et.EM,B.EM],[et.EMBED,B.EMBED],[et.FIELDSET,B.FIELDSET],[et.FIGCAPTION,B.FIGCAPTION],[et.FIGURE,B.FIGURE],[et.FONT,B.FONT],[et.FOOTER,B.FOOTER],[et.FOREIGN_OBJECT,B.FOREIGN_OBJECT],[et.FORM,B.FORM],[et.FRAME,B.FRAME],[et.FRAMESET,B.FRAMESET],[et.H1,B.H1],[et.H2,B.H2],[et.H3,B.H3],[et.H4,B.H4],[et.H5,B.H5],[et.H6,B.H6],[et.HEAD,B.HEAD],[et.HEADER,B.HEADER],[et.HGROUP,B.HGROUP],[et.HR,B.HR],[et.HTML,B.HTML],[et.I,B.I],[et.IMG,B.IMG],[et.IMAGE,B.IMAGE],[et.INPUT,B.INPUT],[et.IFRAME,B.IFRAME],[et.KEYGEN,B.KEYGEN],[et.LABEL,B.LABEL],[et.LI,B.LI],[et.LINK,B.LINK],[et.LISTING,B.LISTING],[et.MAIN,B.MAIN],[et.MALIGNMARK,B.MALIGNMARK],[et.MARQUEE,B.MARQUEE],[et.MATH,B.MATH],[et.MENU,B.MENU],[et.META,B.META],[et.MGLYPH,B.MGLYPH],[et.MI,B.MI],[et.MO,B.MO],[et.MN,B.MN],[et.MS,B.MS],[et.MTEXT,B.MTEXT],[et.NAV,B.NAV],[et.NOBR,B.NOBR],[et.NOFRAMES,B.NOFRAMES],[et.NOEMBED,B.NOEMBED],[et.NOSCRIPT,B.NOSCRIPT],[et.OBJECT,B.OBJECT],[et.OL,B.OL],[et.OPTGROUP,B.OPTGROUP],[et.OPTION,B.OPTION],[et.P,B.P],[et.PARAM,B.PARAM],[et.PLAINTEXT,B.PLAINTEXT],[et.PRE,B.PRE],[et.RB,B.RB],[et.RP,B.RP],[et.RT,B.RT],[et.RTC,B.RTC],[et.RUBY,B.RUBY],[et.S,B.S],[et.SCRIPT,B.SCRIPT],[et.SEARCH,B.SEARCH],[et.SECTION,B.SECTION],[et.SELECT,B.SELECT],[et.SOURCE,B.SOURCE],[et.SMALL,B.SMALL],[et.SPAN,B.SPAN],[et.STRIKE,B.STRIKE],[et.STRONG,B.STRONG],[et.STYLE,B.STYLE],[et.SUB,B.SUB],[et.SUMMARY,B.SUMMARY],[et.SUP,B.SUP],[et.TABLE,B.TABLE],[et.TBODY,B.TBODY],[et.TEMPLATE,B.TEMPLATE],[et.TEXTAREA,B.TEXTAREA],[et.TFOOT,B.TFOOT],[et.TD,B.TD],[et.TH,B.TH],[et.THEAD,B.THEAD],[et.TITLE,B.TITLE],[et.TR,B.TR],[et.TRACK,B.TRACK],[et.TT,B.TT],[et.U,B.U],[et.UL,B.UL],[et.SVG,B.SVG],[et.VAR,B.VAR],[et.WBR,B.WBR],[et.XMP,B.XMP]]);function ok(e){var t;return(t=_Et.get(e))!==null&&t!==void 0?t:B.UNKNOWN}const Mt=B,jEt={[jt.HTML]:new Set([Mt.ADDRESS,Mt.APPLET,Mt.AREA,Mt.ARTICLE,Mt.ASIDE,Mt.BASE,Mt.BASEFONT,Mt.BGSOUND,Mt.BLOCKQUOTE,Mt.BODY,Mt.BR,Mt.BUTTON,Mt.CAPTION,Mt.CENTER,Mt.COL,Mt.COLGROUP,Mt.DD,Mt.DETAILS,Mt.DIR,Mt.DIV,Mt.DL,Mt.DT,Mt.EMBED,Mt.FIELDSET,Mt.FIGCAPTION,Mt.FIGURE,Mt.FOOTER,Mt.FORM,Mt.FRAME,Mt.FRAMESET,Mt.H1,Mt.H2,Mt.H3,Mt.H4,Mt.H5,Mt.H6,Mt.HEAD,Mt.HEADER,Mt.HGROUP,Mt.HR,Mt.HTML,Mt.IFRAME,Mt.IMG,Mt.INPUT,Mt.LI,Mt.LINK,Mt.LISTING,Mt.MAIN,Mt.MARQUEE,Mt.MENU,Mt.META,Mt.NAV,Mt.NOEMBED,Mt.NOFRAMES,Mt.NOSCRIPT,Mt.OBJECT,Mt.OL,Mt.P,Mt.PARAM,Mt.PLAINTEXT,Mt.PRE,Mt.SCRIPT,Mt.SECTION,Mt.SELECT,Mt.SOURCE,Mt.STYLE,Mt.SUMMARY,Mt.TABLE,Mt.TBODY,Mt.TD,Mt.TEMPLATE,Mt.TEXTAREA,Mt.TFOOT,Mt.TH,Mt.THEAD,Mt.TITLE,Mt.TR,Mt.TRACK,Mt.UL,Mt.WBR,Mt.XMP]),[jt.MATHML]:new Set([Mt.MI,Mt.MO,Mt.MN,Mt.MS,Mt.MTEXT,Mt.ANNOTATION_XML]),[jt.SVG]:new Set([Mt.TITLE,Mt.FOREIGN_OBJECT,Mt.DESC]),[jt.XLINK]:new Set,[jt.XML]:new Set,[jt.XMLNS]:new Set},ZB=new Set([Mt.H1,Mt.H2,Mt.H3,Mt.H4,Mt.H5,Mt.H6]);et.STYLE,et.SCRIPT,et.XMP,et.IFRAME,et.NOEMBED,et.NOFRAMES,et.PLAINTEXT;var Te;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(Te||(Te={}));const Ta={DATA:Te.DATA,RCDATA:Te.RCDATA,RAWTEXT:Te.RAWTEXT,SCRIPT_DATA:Te.SCRIPT_DATA,PLAINTEXT:Te.PLAINTEXT,CDATA_SECTION:Te.CDATA_SECTION};function NEt(e){return e>=ke.DIGIT_0&&e<=ke.DIGIT_9}function mS(e){return e>=ke.LATIN_CAPITAL_A&&e<=ke.LATIN_CAPITAL_Z}function REt(e){return e>=ke.LATIN_SMALL_A&&e<=ke.LATIN_SMALL_Z}function Qm(e){return REt(e)||mS(e)}function pne(e){return Qm(e)||NEt(e)}function T_(e){return e+32}function vMe(e){return e===ke.SPACE||e===ke.LINE_FEED||e===ke.TABULATION||e===ke.FORM_FEED}function mne(e){return vMe(e)||e===ke.SOLIDUS||e===ke.GREATER_THAN_SIGN}function IEt(e){return e===ke.NULL?ht.nullCharacterReference:e>1114111?ht.characterReferenceOutsideUnicodeRange:mMe(e)?ht.surrogateCharacterReference:bMe(e)?ht.noncharacterCharacterReference:gMe(e)||e===ke.CARRIAGE_RETURN?ht.controlCharacterReference:null}class PEt{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=Te.DATA,this.returnState=Te.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new vEt(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new AEt(xEt,(i,r)=>{this.preprocessor.pos=this.entityStartPos+r-1,this._flushCodePointConsumedAsCharacterReference(i)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(ht.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:i=>{this._err(ht.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+i)},validateNumericCharacterReference:i=>{const r=IEt(i);r&&this._err(r,1)}}:void 0)}_err(t,n=0){var i,r;(r=(i=this.handler).onParseError)===null||r===void 0||r.call(i,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,n,i){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||i==null||i()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n0&&this._err(ht.endTagWithAttributes),t.selfClosing&&this._err(ht.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case zi.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case zi.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case zi.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:zi.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=vMe(t)?zi.WHITESPACE_CHARACTER:t===ke.NULL?zi.NULL_CHARACTER:zi.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(zi.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=Te.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?xp.Attribute:xp.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===Te.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Te.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Te.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case Te.DATA:{this._stateData(t);break}case Te.RCDATA:{this._stateRcdata(t);break}case Te.RAWTEXT:{this._stateRawtext(t);break}case Te.SCRIPT_DATA:{this._stateScriptData(t);break}case Te.PLAINTEXT:{this._statePlaintext(t);break}case Te.TAG_OPEN:{this._stateTagOpen(t);break}case Te.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case Te.TAG_NAME:{this._stateTagName(t);break}case Te.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case Te.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case Te.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case Te.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case Te.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case Te.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case Te.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case Te.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case Te.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case Te.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case Te.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case Te.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case Te.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case Te.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case Te.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case Te.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case Te.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case Te.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case Te.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case Te.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case Te.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case Te.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case Te.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case Te.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case Te.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case Te.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case Te.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case Te.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case Te.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case Te.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case Te.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case Te.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case Te.BOGUS_COMMENT:{this._stateBogusComment(t);break}case Te.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case Te.COMMENT_START:{this._stateCommentStart(t);break}case Te.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case Te.COMMENT:{this._stateComment(t);break}case Te.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case Te.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case Te.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case Te.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case Te.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case Te.COMMENT_END:{this._stateCommentEnd(t);break}case Te.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case Te.DOCTYPE:{this._stateDoctype(t);break}case Te.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case Te.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case Te.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case Te.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case Te.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case Te.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case Te.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case Te.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case Te.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case Te.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case Te.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case Te.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case Te.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case Te.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case Te.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case Te.CDATA_SECTION:{this._stateCdataSection(t);break}case Te.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case Te.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case Te.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case Te.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case ke.LESS_THAN_SIGN:{this.state=Te.TAG_OPEN;break}case ke.AMPERSAND:{this._startCharacterReference();break}case ke.NULL:{this._err(ht.unexpectedNullCharacter),this._emitCodePoint(t);break}case ke.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case ke.AMPERSAND:{this._startCharacterReference();break}case ke.LESS_THAN_SIGN:{this.state=Te.RCDATA_LESS_THAN_SIGN;break}case ke.NULL:{this._err(ht.unexpectedNullCharacter),this._emitChars(Fs);break}case ke.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case ke.LESS_THAN_SIGN:{this.state=Te.RAWTEXT_LESS_THAN_SIGN;break}case ke.NULL:{this._err(ht.unexpectedNullCharacter),this._emitChars(Fs);break}case ke.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case ke.LESS_THAN_SIGN:{this.state=Te.SCRIPT_DATA_LESS_THAN_SIGN;break}case ke.NULL:{this._err(ht.unexpectedNullCharacter),this._emitChars(Fs);break}case ke.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case ke.NULL:{this._err(ht.unexpectedNullCharacter),this._emitChars(Fs);break}case ke.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Qm(t))this._createStartTagToken(),this.state=Te.TAG_NAME,this._stateTagName(t);else switch(t){case ke.EXCLAMATION_MARK:{this.state=Te.MARKUP_DECLARATION_OPEN;break}case ke.SOLIDUS:{this.state=Te.END_TAG_OPEN;break}case ke.QUESTION_MARK:{this._err(ht.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Te.BOGUS_COMMENT,this._stateBogusComment(t);break}case ke.EOF:{this._err(ht.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(ht.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=Te.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Qm(t))this._createEndTagToken(),this.state=Te.TAG_NAME,this._stateTagName(t);else switch(t){case ke.GREATER_THAN_SIGN:{this._err(ht.missingEndTagName),this.state=Te.DATA;break}case ke.EOF:{this._err(ht.eofBeforeTagName),this._emitChars("");break}case ke.NULL:{this._err(ht.unexpectedNullCharacter),this.state=Te.SCRIPT_DATA_ESCAPED,this._emitChars(Fs);break}case ke.EOF:{this._err(ht.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Te.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===ke.SOLIDUS?this.state=Te.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Qm(t)?(this._emitChars("<"),this.state=Te.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=Te.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Qm(t)?(this.state=Te.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case ke.NULL:{this._err(ht.unexpectedNullCharacter),this.state=Te.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Fs);break}case ke.EOF:{this._err(ht.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Te.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===ke.SOLIDUS?(this.state=Te.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=Te.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(bc.SCRIPT,!1)&&mne(this.preprocessor.peek(bc.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const i=this._indexOf(t);this.items[i]=n,i===this.stackTop&&(this.current=n)}insertAfter(t,n,i){const r=this._indexOf(t)+1;this.items.splice(r,0,n),this.tagIDs.splice(r,0,i),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==jt.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop=0;i--)if(t.has(this.tagIDs[i])&&this.treeAdapter.getNamespaceURI(this.items[i])===n)return i;return-1}clearBackTo(t,n){const i=this._indexOfTagNames(t,n);this.shortenToLength(i+1)}clearBackToTableContext(){this.clearBackTo(FEt,jt.HTML)}clearBackToTableBodyContext(){this.clearBackTo($Et,jt.HTML)}clearBackToTableRowContext(){this.clearBackTo(LEt,jt.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===B.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===B.HTML}hasInDynamicScope(t,n){for(let i=this.stackTop;i>=0;i--){const r=this.tagIDs[i];switch(this.treeAdapter.getNamespaceURI(this.items[i])){case jt.HTML:{if(r===t)return!0;if(n.has(r))return!1;break}case jt.SVG:{if(yne.has(r))return!1;break}case jt.MATHML:{if(bne.has(r))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,AI)}hasInListItemScope(t){return this.hasInDynamicScope(t,DEt)}hasInButtonScope(t){return this.hasInDynamicScope(t,MEt)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case jt.HTML:{if(ZB.has(n))return!0;if(AI.has(n))return!1;break}case jt.SVG:{if(yne.has(n))return!1;break}case jt.MATHML:{if(bne.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===jt.HTML)switch(this.tagIDs[n]){case t:return!0;case B.TABLE:case B.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===jt.HTML)switch(this.tagIDs[t]){case B.TBODY:case B.THEAD:case B.TFOOT:return!0;case B.TABLE:case B.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===jt.HTML)switch(this.tagIDs[n]){case t:return!0;case B.OPTION:case B.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&xMe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&gne.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&gne.has(this.currentTagId);)this.pop()}}const _4=3;var Gf;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Gf||(Gf={}));const vne={type:Gf.Marker};class QEt{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const i=[],r=n.length,s=this.treeAdapter.getTagName(t),o=this.treeAdapter.getNamespaceURI(t);for(let l=0;l[o.name,o.value]));let s=0;for(let o=0;or.get(c.name)===c.value)&&(s+=1,s>=_4&&this.entries.splice(l.idx,1))}}insertMarker(){this.entries.unshift(vne)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Gf.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const i=this.entries.indexOf(this.bookmark);this.entries.splice(i,0,{type:Gf.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(vne);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(i=>i.type===Gf.Marker||this.treeAdapter.getTagName(i.element)===t);return n&&n.type===Gf.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Gf.Element&&n.element===t)}}const zm={createDocument(){return{nodeName:"#document",mode:ad.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const i=e.childNodes.indexOf(n);e.childNodes.splice(i,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,i){const r=e.childNodes.find(s=>s.nodeName==="#documentType");if(r)r.name=t,r.publicId=n,r.systemId=i;else{const s={nodeName:"#documentType",name:t,publicId:n,systemId:i,parentNode:null};zm.appendChild(e,s)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(zm.isTextNode(n)){n.value+=t;return}}zm.appendChild(e,zm.createTextNode(t))},insertTextBefore(e,t,n){const i=e.childNodes[e.childNodes.indexOf(n)-1];i&&zm.isTextNode(i)?i.value+=t:zm.insertBefore(e,zm.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(i=>i.name));for(let i=0;ie.startsWith(n))}function KEt(e){return e.name===wMe&&e.publicId===null&&(e.systemId===null||e.systemId===zEt)}function GEt(e){if(e.name!==wMe)return ad.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===VEt)return ad.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),qEt.has(n))return ad.QUIRKS;let i=t===null?HEt:kMe;if(xne(n,i))return ad.QUIRKS;if(i=t===null?OMe:WEt,xne(n,i))return ad.LIMITED_QUIRKS}return ad.NO_QUIRKS}const wne={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},XEt="definitionurl",YEt="definitionURL",ZEt=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),JEt=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:jt.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:jt.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:jt.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:jt.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:jt.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:jt.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:jt.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:jt.XML}],["xml:space",{prefix:"xml",name:"space",namespace:jt.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:jt.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:jt.XMLNS}]]),eCt=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),tCt=new Set([B.B,B.BIG,B.BLOCKQUOTE,B.BODY,B.BR,B.CENTER,B.CODE,B.DD,B.DIV,B.DL,B.DT,B.EM,B.EMBED,B.H1,B.H2,B.H3,B.H4,B.H5,B.H6,B.HEAD,B.HR,B.I,B.IMG,B.LI,B.LISTING,B.MENU,B.META,B.NOBR,B.OL,B.P,B.PRE,B.RUBY,B.S,B.SMALL,B.SPAN,B.STRONG,B.STRIKE,B.SUB,B.SUP,B.TABLE,B.TT,B.U,B.UL,B.VAR]);function nCt(e){const t=e.tagID;return t===B.FONT&&e.attrs.some(({name:i})=>i===Wy.COLOR||i===Wy.SIZE||i===Wy.FACE)||tCt.has(t)}function SMe(e){for(let t=0;t0&&this._setContextModes(t,n)}onItemPop(t,n){var i,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(r=(i=this.treeAdapter).onItemPop)===null||r===void 0||r.call(i,t,this.openElements.current),n){let s,o;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,o=this.fragmentContextID):{current:s,currentTagId:o}=this.openElements,this._setContextModes(s,o)}}_setContextModes(t,n){const i=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===jt.HTML;this.currentNotInHTML=!i,this.tokenizer.inForeignNode=!i&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,jt.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=Pe.TEXT}switchToPlaintextParsing(){this.insertionMode=Pe.TEXT,this.originalInsertionMode=Pe.IN_BODY,this.tokenizer.state=Ta.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===et.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==jt.HTML))switch(this.fragmentContextID){case B.TITLE:case B.TEXTAREA:{this.tokenizer.state=Ta.RCDATA;break}case B.STYLE:case B.XMP:case B.IFRAME:case B.NOEMBED:case B.NOFRAMES:case B.NOSCRIPT:{this.tokenizer.state=Ta.RAWTEXT;break}case B.SCRIPT:{this.tokenizer.state=Ta.SCRIPT_DATA;break}case B.PLAINTEXT:{this.tokenizer.state=Ta.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",i=t.publicId||"",r=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,i,r),t.location){const o=this.treeAdapter.getChildNodes(this.document).find(l=>this.treeAdapter.isDocumentTypeNode(l));o&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const i=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,i)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const i=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(i??this.document,t)}}_appendElement(t,n){const i=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(i,t.location)}_insertElement(t,n){const i=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(i,t.location),this.openElements.push(i,t.tagID)}_insertFakeElement(t,n){const i=this.treeAdapter.createElement(t,jt.HTML,[]);this._attachElementToTree(i,null),this.openElements.push(i,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,jt.HTML,t.attrs),i=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,i),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(et.HTML,jt.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,B.HTML)}_appendCommentNode(t,n){const i=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,i),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,t.location)}_insertCharacters(t){let n,i;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:i}=this._findFosterParentingLocation(),i?this.treeAdapter.insertTextBefore(n,t.chars,i):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const r=this.treeAdapter.getChildNodes(n),s=i?r.lastIndexOf(i):r.length,o=r[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(o)){const{endLine:c,endCol:u,endOffset:d}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:c,endCol:u,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}_adoptNodes(t,n){for(let i=this.treeAdapter.getFirstChild(t);i;i=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(i),this.treeAdapter.appendChild(n,i)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const i=n.location,r=this.treeAdapter.getTagName(t),s=n.type===zi.END_TAG&&r===n.tagName?{endTag:{...i},endLine:i.endLine,endCol:i.endCol,endOffset:i.endOffset}:{endLine:i.startLine,endCol:i.startCol,endOffset:i.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,s)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,i;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,i=this.fragmentContextID):{current:n,currentTagId:i}=this.openElements,t.tagID===B.SVG&&this.treeAdapter.getTagName(n)===et.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===jt.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===B.MGLYPH||t.tagID===B.MALIGNMARK)&&i!==void 0&&!this._isIntegrationPoint(i,n,jt.HTML)}_processToken(t){switch(t.type){case zi.CHARACTER:{this.onCharacter(t);break}case zi.NULL_CHARACTER:{this.onNullCharacter(t);break}case zi.COMMENT:{this.onComment(t);break}case zi.DOCTYPE:{this.onDoctype(t);break}case zi.START_TAG:{this._processStartTag(t);break}case zi.END_TAG:{this.onEndTag(t);break}case zi.EOF:{this.onEof(t);break}case zi.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,i){const r=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return aCt(t,r,s,i)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(r=>r.type===Gf.Marker||this.openElements.contains(r.element)),i=n===-1?t-1:n-1;for(let r=i;r>=0;r--){const s=this.activeFormattingElements.entries[r];this._insertElement(s.token,this.treeAdapter.getNamespaceURI(s.element)),s.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=Pe.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(B.P),this.openElements.popUntilTagNamePopped(B.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case B.TR:{this.insertionMode=Pe.IN_ROW;return}case B.TBODY:case B.THEAD:case B.TFOOT:{this.insertionMode=Pe.IN_TABLE_BODY;return}case B.CAPTION:{this.insertionMode=Pe.IN_CAPTION;return}case B.COLGROUP:{this.insertionMode=Pe.IN_COLUMN_GROUP;return}case B.TABLE:{this.insertionMode=Pe.IN_TABLE;return}case B.BODY:{this.insertionMode=Pe.IN_BODY;return}case B.FRAMESET:{this.insertionMode=Pe.IN_FRAMESET;return}case B.SELECT:{this._resetInsertionModeForSelect(t);return}case B.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case B.HTML:{this.insertionMode=this.headElement?Pe.AFTER_HEAD:Pe.BEFORE_HEAD;return}case B.TD:case B.TH:{if(t>0){this.insertionMode=Pe.IN_CELL;return}break}case B.HEAD:{if(t>0){this.insertionMode=Pe.IN_HEAD;return}break}}this.insertionMode=Pe.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const i=this.openElements.tagIDs[n];if(i===B.TEMPLATE)break;if(i===B.TABLE){this.insertionMode=Pe.IN_SELECT_IN_TABLE;return}}this.insertionMode=Pe.IN_SELECT}_isElementCausesFosterParenting(t){return CMe.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case B.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===jt.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case B.TABLE:{const i=this.treeAdapter.getParentNode(n);return i?{parent:i,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const i=this.treeAdapter.getNamespaceURI(t);return jEt[i].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){BAt(this,t);return}switch(this.insertionMode){case Pe.INITIAL:{wO(this,t);break}case Pe.BEFORE_HTML:{fE(this,t);break}case Pe.BEFORE_HEAD:{hE(this,t);break}case Pe.IN_HEAD:{pE(this,t);break}case Pe.IN_HEAD_NO_SCRIPT:{mE(this,t);break}case Pe.AFTER_HEAD:{gE(this,t);break}case Pe.IN_BODY:case Pe.IN_CAPTION:case Pe.IN_CELL:case Pe.IN_TEMPLATE:{TMe(this,t);break}case Pe.TEXT:case Pe.IN_SELECT:case Pe.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case Pe.IN_TABLE:case Pe.IN_TABLE_BODY:case Pe.IN_ROW:{j4(this,t);break}case Pe.IN_TABLE_TEXT:{PMe(this,t);break}case Pe.IN_COLUMN_GROUP:{TI(this,t);break}case Pe.AFTER_BODY:{_I(this,t);break}case Pe.AFTER_AFTER_BODY:{NN(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){FAt(this,t);return}switch(this.insertionMode){case Pe.INITIAL:{wO(this,t);break}case Pe.BEFORE_HTML:{fE(this,t);break}case Pe.BEFORE_HEAD:{hE(this,t);break}case Pe.IN_HEAD:{pE(this,t);break}case Pe.IN_HEAD_NO_SCRIPT:{mE(this,t);break}case Pe.AFTER_HEAD:{gE(this,t);break}case Pe.TEXT:{this._insertCharacters(t);break}case Pe.IN_TABLE:case Pe.IN_TABLE_BODY:case Pe.IN_ROW:{j4(this,t);break}case Pe.IN_COLUMN_GROUP:{TI(this,t);break}case Pe.AFTER_BODY:{_I(this,t);break}case Pe.AFTER_AFTER_BODY:{NN(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){JB(this,t);return}switch(this.insertionMode){case Pe.INITIAL:case Pe.BEFORE_HTML:case Pe.BEFORE_HEAD:case Pe.IN_HEAD:case Pe.IN_HEAD_NO_SCRIPT:case Pe.AFTER_HEAD:case Pe.IN_BODY:case Pe.IN_TABLE:case Pe.IN_CAPTION:case Pe.IN_COLUMN_GROUP:case Pe.IN_TABLE_BODY:case Pe.IN_ROW:case Pe.IN_CELL:case Pe.IN_SELECT:case Pe.IN_SELECT_IN_TABLE:case Pe.IN_TEMPLATE:case Pe.IN_FRAMESET:case Pe.AFTER_FRAMESET:{JB(this,t);break}case Pe.IN_TABLE_TEXT:{kO(this,t);break}case Pe.AFTER_BODY:{bCt(this,t);break}case Pe.AFTER_AFTER_BODY:case Pe.AFTER_AFTER_FRAMESET:{yCt(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case Pe.INITIAL:{vCt(this,t);break}case Pe.BEFORE_HEAD:case Pe.IN_HEAD:case Pe.IN_HEAD_NO_SCRIPT:case Pe.AFTER_HEAD:{this._err(t,ht.misplacedDoctype);break}case Pe.IN_TABLE_TEXT:{kO(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,ht.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?UAt(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case Pe.INITIAL:{wO(this,t);break}case Pe.BEFORE_HTML:{xCt(this,t);break}case Pe.BEFORE_HEAD:{kCt(this,t);break}case Pe.IN_HEAD:{Cf(this,t);break}case Pe.IN_HEAD_NO_SCRIPT:{ECt(this,t);break}case Pe.AFTER_HEAD:{ACt(this,t);break}case Pe.IN_BODY:{Nl(this,t);break}case Pe.IN_TABLE:{l1(this,t);break}case Pe.IN_TABLE_TEXT:{kO(this,t);break}case Pe.IN_CAPTION:{OAt(this,t);break}case Pe.IN_COLUMN_GROUP:{sq(this,t);break}case Pe.IN_TABLE_BODY:{AM(this,t);break}case Pe.IN_ROW:{TM(this,t);break}case Pe.IN_CELL:{CAt(this,t);break}case Pe.IN_SELECT:{LMe(this,t);break}case Pe.IN_SELECT_IN_TABLE:{TAt(this,t);break}case Pe.IN_TEMPLATE:{jAt(this,t);break}case Pe.AFTER_BODY:{RAt(this,t);break}case Pe.IN_FRAMESET:{IAt(this,t);break}case Pe.AFTER_FRAMESET:{DAt(this,t);break}case Pe.AFTER_AFTER_BODY:{LAt(this,t);break}case Pe.AFTER_AFTER_FRAMESET:{$At(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?QAt(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case Pe.INITIAL:{wO(this,t);break}case Pe.BEFORE_HTML:{wCt(this,t);break}case Pe.BEFORE_HEAD:{OCt(this,t);break}case Pe.IN_HEAD:{SCt(this,t);break}case Pe.IN_HEAD_NO_SCRIPT:{CCt(this,t);break}case Pe.AFTER_HEAD:{TCt(this,t);break}case Pe.IN_BODY:{CM(this,t);break}case Pe.TEXT:{hAt(this,t);break}case Pe.IN_TABLE:{_C(this,t);break}case Pe.IN_TABLE_TEXT:{kO(this,t);break}case Pe.IN_CAPTION:{SAt(this,t);break}case Pe.IN_COLUMN_GROUP:{EAt(this,t);break}case Pe.IN_TABLE_BODY:{e9(this,t);break}case Pe.IN_ROW:{MMe(this,t);break}case Pe.IN_CELL:{AAt(this,t);break}case Pe.IN_SELECT:{$Me(this,t);break}case Pe.IN_SELECT_IN_TABLE:{_At(this,t);break}case Pe.IN_TEMPLATE:{NAt(this,t);break}case Pe.AFTER_BODY:{BMe(this,t);break}case Pe.IN_FRAMESET:{PAt(this,t);break}case Pe.AFTER_FRAMESET:{MAt(this,t);break}case Pe.AFTER_AFTER_BODY:{NN(this,t);break}}}onEof(t){switch(this.insertionMode){case Pe.INITIAL:{wO(this,t);break}case Pe.BEFORE_HTML:{fE(this,t);break}case Pe.BEFORE_HEAD:{hE(this,t);break}case Pe.IN_HEAD:{pE(this,t);break}case Pe.IN_HEAD_NO_SCRIPT:{mE(this,t);break}case Pe.AFTER_HEAD:{gE(this,t);break}case Pe.IN_BODY:case Pe.IN_TABLE:case Pe.IN_CAPTION:case Pe.IN_COLUMN_GROUP:case Pe.IN_TABLE_BODY:case Pe.IN_ROW:case Pe.IN_CELL:case Pe.IN_SELECT:case Pe.IN_SELECT_IN_TABLE:{RMe(this,t);break}case Pe.TEXT:{pAt(this,t);break}case Pe.IN_TABLE_TEXT:{kO(this,t);break}case Pe.IN_TEMPLATE:{FMe(this,t);break}case Pe.AFTER_BODY:case Pe.IN_FRAMESET:case Pe.AFTER_FRAMESET:case Pe.AFTER_AFTER_BODY:case Pe.AFTER_AFTER_FRAMESET:{rq(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===ke.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case Pe.IN_HEAD:case Pe.IN_HEAD_NO_SCRIPT:case Pe.AFTER_HEAD:case Pe.TEXT:case Pe.IN_COLUMN_GROUP:case Pe.IN_SELECT:case Pe.IN_SELECT_IN_TABLE:case Pe.IN_FRAMESET:case Pe.AFTER_FRAMESET:{this._insertCharacters(t);break}case Pe.IN_BODY:case Pe.IN_CAPTION:case Pe.IN_CELL:case Pe.IN_TEMPLATE:case Pe.AFTER_BODY:case Pe.AFTER_AFTER_BODY:case Pe.AFTER_AFTER_FRAMESET:{AMe(this,t);break}case Pe.IN_TABLE:case Pe.IN_TABLE_BODY:case Pe.IN_ROW:{j4(this,t);break}case Pe.IN_TABLE_TEXT:{IMe(this,t);break}}}};function dCt(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):NMe(e,t),n}function fCt(e,t){let n=null,i=e.openElements.stackTop;for(;i>=0;i--){const r=e.openElements.items[i];if(r===t.element)break;e._isSpecialElement(r,e.openElements.tagIDs[i])&&(n=r)}return n||(e.openElements.shortenToLength(Math.max(i,0)),e.activeFormattingElements.removeEntry(t)),n}function hCt(e,t,n){let i=t,r=e.openElements.getCommonAncestor(t);for(let s=0,o=r;o!==n;s++,o=r){r=e.openElements.getCommonAncestor(o);const l=e.activeFormattingElements.getElementEntry(o),c=l&&s>=cCt;!l||c?(c&&e.activeFormattingElements.removeEntry(l),e.openElements.remove(o)):(o=pCt(e,l),i===t&&(e.activeFormattingElements.bookmark=l),e.treeAdapter.detachNode(i),e.treeAdapter.appendChild(o,i),i=o)}return i}function pCt(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),i=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,i),t.element=i,i}function mCt(e,t,n){const i=e.treeAdapter.getTagName(t),r=ok(i);if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{const s=e.treeAdapter.getNamespaceURI(t);r===B.TEMPLATE&&s===jt.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function gCt(e,t,n){const i=e.treeAdapter.getNamespaceURI(n.element),{token:r}=n,s=e.treeAdapter.createElement(r.tagName,i,r.attrs);e._adoptNodes(t,s),e.treeAdapter.appendChild(t,s),e.activeFormattingElements.insertElementAfterBookmark(s,r),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,s,r.tagID)}function iq(e,t){for(let n=0;n=n;i--)e._setEndLocation(e.openElements.items[i],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const i=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(i);if(r&&!r.endTag&&(e._setEndLocation(i,t),e.openElements.stackTop>=1)){const s=e.openElements.items[1],o=e.treeAdapter.getNodeSourceCodeLocation(s);o&&!o.endTag&&e._setEndLocation(s,t)}}}}function vCt(e,t){e._setDocumentType(t);const n=t.forceQuirks?ad.QUIRKS:GEt(t);KEt(t)||e._err(t,ht.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=Pe.BEFORE_HTML}function wO(e,t){e._err(t,ht.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,ad.QUIRKS),e.insertionMode=Pe.BEFORE_HTML,e._processToken(t)}function xCt(e,t){t.tagID===B.HTML?(e._insertElement(t,jt.HTML),e.insertionMode=Pe.BEFORE_HEAD):fE(e,t)}function wCt(e,t){const n=t.tagID;(n===B.HTML||n===B.HEAD||n===B.BODY||n===B.BR)&&fE(e,t)}function fE(e,t){e._insertFakeRootElement(),e.insertionMode=Pe.BEFORE_HEAD,e._processToken(t)}function kCt(e,t){switch(t.tagID){case B.HTML:{Nl(e,t);break}case B.HEAD:{e._insertElement(t,jt.HTML),e.headElement=e.openElements.current,e.insertionMode=Pe.IN_HEAD;break}default:hE(e,t)}}function OCt(e,t){const n=t.tagID;n===B.HEAD||n===B.BODY||n===B.HTML||n===B.BR?hE(e,t):e._err(t,ht.endTagWithoutMatchingOpenElement)}function hE(e,t){e._insertFakeElement(et.HEAD,B.HEAD),e.headElement=e.openElements.current,e.insertionMode=Pe.IN_HEAD,e._processToken(t)}function Cf(e,t){switch(t.tagID){case B.HTML:{Nl(e,t);break}case B.BASE:case B.BASEFONT:case B.BGSOUND:case B.LINK:case B.META:{e._appendElement(t,jt.HTML),t.ackSelfClosing=!0;break}case B.TITLE:{e._switchToTextParsing(t,Ta.RCDATA);break}case B.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Ta.RAWTEXT):(e._insertElement(t,jt.HTML),e.insertionMode=Pe.IN_HEAD_NO_SCRIPT);break}case B.NOFRAMES:case B.STYLE:{e._switchToTextParsing(t,Ta.RAWTEXT);break}case B.SCRIPT:{e._switchToTextParsing(t,Ta.SCRIPT_DATA);break}case B.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=Pe.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(Pe.IN_TEMPLATE);break}case B.HEAD:{e._err(t,ht.misplacedStartTagForHeadElement);break}default:pE(e,t)}}function SCt(e,t){switch(t.tagID){case B.HEAD:{e.openElements.pop(),e.insertionMode=Pe.AFTER_HEAD;break}case B.BODY:case B.BR:case B.HTML:{pE(e,t);break}case B.TEMPLATE:{Gv(e,t);break}default:e._err(t,ht.endTagWithoutMatchingOpenElement)}}function Gv(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==B.TEMPLATE&&e._err(t,ht.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(B.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,ht.endTagWithoutMatchingOpenElement)}function pE(e,t){e.openElements.pop(),e.insertionMode=Pe.AFTER_HEAD,e._processToken(t)}function ECt(e,t){switch(t.tagID){case B.HTML:{Nl(e,t);break}case B.BASEFONT:case B.BGSOUND:case B.HEAD:case B.LINK:case B.META:case B.NOFRAMES:case B.STYLE:{Cf(e,t);break}case B.NOSCRIPT:{e._err(t,ht.nestedNoscriptInHead);break}default:mE(e,t)}}function CCt(e,t){switch(t.tagID){case B.NOSCRIPT:{e.openElements.pop(),e.insertionMode=Pe.IN_HEAD;break}case B.BR:{mE(e,t);break}default:e._err(t,ht.endTagWithoutMatchingOpenElement)}}function mE(e,t){const n=t.type===zi.EOF?ht.openElementsLeftAfterEof:ht.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=Pe.IN_HEAD,e._processToken(t)}function ACt(e,t){switch(t.tagID){case B.HTML:{Nl(e,t);break}case B.BODY:{e._insertElement(t,jt.HTML),e.framesetOk=!1,e.insertionMode=Pe.IN_BODY;break}case B.FRAMESET:{e._insertElement(t,jt.HTML),e.insertionMode=Pe.IN_FRAMESET;break}case B.BASE:case B.BASEFONT:case B.BGSOUND:case B.LINK:case B.META:case B.NOFRAMES:case B.SCRIPT:case B.STYLE:case B.TEMPLATE:case B.TITLE:{e._err(t,ht.abandonedHeadElementChild),e.openElements.push(e.headElement,B.HEAD),Cf(e,t),e.openElements.remove(e.headElement);break}case B.HEAD:{e._err(t,ht.misplacedStartTagForHeadElement);break}default:gE(e,t)}}function TCt(e,t){switch(t.tagID){case B.BODY:case B.HTML:case B.BR:{gE(e,t);break}case B.TEMPLATE:{Gv(e,t);break}default:e._err(t,ht.endTagWithoutMatchingOpenElement)}}function gE(e,t){e._insertFakeElement(et.BODY,B.BODY),e.insertionMode=Pe.IN_BODY,EM(e,t)}function EM(e,t){switch(t.type){case zi.CHARACTER:{TMe(e,t);break}case zi.WHITESPACE_CHARACTER:{AMe(e,t);break}case zi.COMMENT:{JB(e,t);break}case zi.START_TAG:{Nl(e,t);break}case zi.END_TAG:{CM(e,t);break}case zi.EOF:{RMe(e,t);break}}}function AMe(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function TMe(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function _Ct(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function jCt(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function NCt(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,jt.HTML),e.insertionMode=Pe.IN_FRAMESET)}function RCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,jt.HTML)}function ICt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&ZB.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,jt.HTML)}function PCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,jt.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function DCt(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,jt.HTML),n||(e.formElement=e.openElements.current))}function MCt(e,t){e.framesetOk=!1;const n=t.tagID;for(let i=e.openElements.stackTop;i>=0;i--){const r=e.openElements.tagIDs[i];if(n===B.LI&&r===B.LI||(n===B.DD||n===B.DT)&&(r===B.DD||r===B.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==B.ADDRESS&&r!==B.DIV&&r!==B.P&&e._isSpecialElement(e.openElements.items[i],r))break}e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,jt.HTML)}function LCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,jt.HTML),e.tokenizer.state=Ta.PLAINTEXT}function $Ct(e,t){e.openElements.hasInScope(B.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(B.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,jt.HTML),e.framesetOk=!1}function FCt(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(et.A);n&&(iq(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,jt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function BCt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,jt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function UCt(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(B.NOBR)&&(iq(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,jt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function QCt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,jt.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function zCt(e,t){e.treeAdapter.getDocumentMode(e.document)!==ad.QUIRKS&&e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,jt.HTML),e.framesetOk=!1,e.insertionMode=Pe.IN_TABLE}function _Me(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,jt.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function jMe(e){const t=yMe(e,Wy.TYPE);return t!=null&&t.toLowerCase()===oCt}function VCt(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,jt.HTML),jMe(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function HCt(e,t){e._appendElement(t,jt.HTML),t.ackSelfClosing=!0}function qCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._appendElement(t,jt.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function WCt(e,t){t.tagName=et.IMG,t.tagID=B.IMG,_Me(e,t)}function KCt(e,t){e._insertElement(t,jt.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Ta.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=Pe.TEXT}function GCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Ta.RAWTEXT)}function XCt(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Ta.RAWTEXT)}function Sne(e,t){e._switchToTextParsing(t,Ta.RAWTEXT)}function YCt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,jt.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===Pe.IN_TABLE||e.insertionMode===Pe.IN_CAPTION||e.insertionMode===Pe.IN_TABLE_BODY||e.insertionMode===Pe.IN_ROW||e.insertionMode===Pe.IN_CELL?Pe.IN_SELECT_IN_TABLE:Pe.IN_SELECT}function ZCt(e,t){e.openElements.currentTagId===B.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,jt.HTML)}function JCt(e,t){e.openElements.hasInScope(B.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,jt.HTML)}function eAt(e,t){e.openElements.hasInScope(B.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(B.RTC),e._insertElement(t,jt.HTML)}function tAt(e,t){e._reconstructActiveFormattingElements(),SMe(t),nq(t),t.selfClosing?e._appendElement(t,jt.MATHML):e._insertElement(t,jt.MATHML),t.ackSelfClosing=!0}function nAt(e,t){e._reconstructActiveFormattingElements(),EMe(t),nq(t),t.selfClosing?e._appendElement(t,jt.SVG):e._insertElement(t,jt.SVG),t.ackSelfClosing=!0}function Ene(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,jt.HTML)}function Nl(e,t){switch(t.tagID){case B.I:case B.S:case B.B:case B.U:case B.EM:case B.TT:case B.BIG:case B.CODE:case B.FONT:case B.SMALL:case B.STRIKE:case B.STRONG:{BCt(e,t);break}case B.A:{FCt(e,t);break}case B.H1:case B.H2:case B.H3:case B.H4:case B.H5:case B.H6:{ICt(e,t);break}case B.P:case B.DL:case B.OL:case B.UL:case B.DIV:case B.DIR:case B.NAV:case B.MAIN:case B.MENU:case B.ASIDE:case B.CENTER:case B.FIGURE:case B.FOOTER:case B.HEADER:case B.HGROUP:case B.DIALOG:case B.DETAILS:case B.ADDRESS:case B.ARTICLE:case B.SEARCH:case B.SECTION:case B.SUMMARY:case B.FIELDSET:case B.BLOCKQUOTE:case B.FIGCAPTION:{RCt(e,t);break}case B.LI:case B.DD:case B.DT:{MCt(e,t);break}case B.BR:case B.IMG:case B.WBR:case B.AREA:case B.EMBED:case B.KEYGEN:{_Me(e,t);break}case B.HR:{qCt(e,t);break}case B.RB:case B.RTC:{JCt(e,t);break}case B.RT:case B.RP:{eAt(e,t);break}case B.PRE:case B.LISTING:{PCt(e,t);break}case B.XMP:{GCt(e,t);break}case B.SVG:{nAt(e,t);break}case B.HTML:{_Ct(e,t);break}case B.BASE:case B.LINK:case B.META:case B.STYLE:case B.TITLE:case B.SCRIPT:case B.BGSOUND:case B.BASEFONT:case B.TEMPLATE:{Cf(e,t);break}case B.BODY:{jCt(e,t);break}case B.FORM:{DCt(e,t);break}case B.NOBR:{UCt(e,t);break}case B.MATH:{tAt(e,t);break}case B.TABLE:{zCt(e,t);break}case B.INPUT:{VCt(e,t);break}case B.PARAM:case B.TRACK:case B.SOURCE:{HCt(e,t);break}case B.IMAGE:{WCt(e,t);break}case B.BUTTON:{$Ct(e,t);break}case B.APPLET:case B.OBJECT:case B.MARQUEE:{QCt(e,t);break}case B.IFRAME:{XCt(e,t);break}case B.SELECT:{YCt(e,t);break}case B.OPTION:case B.OPTGROUP:{ZCt(e,t);break}case B.NOEMBED:case B.NOFRAMES:{Sne(e,t);break}case B.FRAMESET:{NCt(e,t);break}case B.TEXTAREA:{KCt(e,t);break}case B.NOSCRIPT:{e.options.scriptingEnabled?Sne(e,t):Ene(e,t);break}case B.PLAINTEXT:{LCt(e,t);break}case B.COL:case B.TH:case B.TD:case B.TR:case B.HEAD:case B.FRAME:case B.TBODY:case B.TFOOT:case B.THEAD:case B.CAPTION:case B.COLGROUP:break;default:Ene(e,t)}}function iAt(e,t){if(e.openElements.hasInScope(B.BODY)&&(e.insertionMode=Pe.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function rAt(e,t){e.openElements.hasInScope(B.BODY)&&(e.insertionMode=Pe.AFTER_BODY,BMe(e,t))}function sAt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function aAt(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(B.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(B.FORM):n&&e.openElements.remove(n))}function oAt(e){e.openElements.hasInButtonScope(B.P)||e._insertFakeElement(et.P,B.P),e._closePElement()}function lAt(e){e.openElements.hasInListItemScope(B.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(B.LI),e.openElements.popUntilTagNamePopped(B.LI))}function cAt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function uAt(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function dAt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function fAt(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(et.BR,B.BR),e.openElements.pop(),e.framesetOk=!1}function NMe(e,t){const n=t.tagName,i=t.tagID;for(let r=e.openElements.stackTop;r>0;r--){const s=e.openElements.items[r],o=e.openElements.tagIDs[r];if(i===o&&(i!==B.UNKNOWN||e.treeAdapter.getTagName(s)===n)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.stackTop>=r&&e.openElements.shortenToLength(r);break}if(e._isSpecialElement(s,o))break}}function CM(e,t){switch(t.tagID){case B.A:case B.B:case B.I:case B.S:case B.U:case B.EM:case B.TT:case B.BIG:case B.CODE:case B.FONT:case B.NOBR:case B.SMALL:case B.STRIKE:case B.STRONG:{iq(e,t);break}case B.P:{oAt(e);break}case B.DL:case B.UL:case B.OL:case B.DIR:case B.DIV:case B.NAV:case B.PRE:case B.MAIN:case B.MENU:case B.ASIDE:case B.BUTTON:case B.CENTER:case B.FIGURE:case B.FOOTER:case B.HEADER:case B.HGROUP:case B.DIALOG:case B.ADDRESS:case B.ARTICLE:case B.DETAILS:case B.SEARCH:case B.SECTION:case B.SUMMARY:case B.LISTING:case B.FIELDSET:case B.BLOCKQUOTE:case B.FIGCAPTION:{sAt(e,t);break}case B.LI:{lAt(e);break}case B.DD:case B.DT:{cAt(e,t);break}case B.H1:case B.H2:case B.H3:case B.H4:case B.H5:case B.H6:{uAt(e);break}case B.BR:{fAt(e);break}case B.BODY:{iAt(e,t);break}case B.HTML:{rAt(e,t);break}case B.FORM:{aAt(e);break}case B.APPLET:case B.OBJECT:case B.MARQUEE:{dAt(e,t);break}case B.TEMPLATE:{Gv(e,t);break}default:NMe(e,t)}}function RMe(e,t){e.tmplInsertionModeStack.length>0?FMe(e,t):rq(e,t)}function hAt(e,t){var n;t.tagID===B.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function pAt(e,t){e._err(t,ht.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function j4(e,t){if(e.openElements.currentTagId!==void 0&&CMe.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=Pe.IN_TABLE_TEXT,t.type){case zi.CHARACTER:{PMe(e,t);break}case zi.WHITESPACE_CHARACTER:{IMe(e,t);break}}else xT(e,t)}function mAt(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,jt.HTML),e.insertionMode=Pe.IN_CAPTION}function gAt(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,jt.HTML),e.insertionMode=Pe.IN_COLUMN_GROUP}function bAt(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(et.COLGROUP,B.COLGROUP),e.insertionMode=Pe.IN_COLUMN_GROUP,sq(e,t)}function yAt(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,jt.HTML),e.insertionMode=Pe.IN_TABLE_BODY}function vAt(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(et.TBODY,B.TBODY),e.insertionMode=Pe.IN_TABLE_BODY,AM(e,t)}function xAt(e,t){e.openElements.hasInTableScope(B.TABLE)&&(e.openElements.popUntilTagNamePopped(B.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function wAt(e,t){jMe(t)?e._appendElement(t,jt.HTML):xT(e,t),t.ackSelfClosing=!0}function kAt(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,jt.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function l1(e,t){switch(t.tagID){case B.TD:case B.TH:case B.TR:{vAt(e,t);break}case B.STYLE:case B.SCRIPT:case B.TEMPLATE:{Cf(e,t);break}case B.COL:{bAt(e,t);break}case B.FORM:{kAt(e,t);break}case B.TABLE:{xAt(e,t);break}case B.TBODY:case B.TFOOT:case B.THEAD:{yAt(e,t);break}case B.INPUT:{wAt(e,t);break}case B.CAPTION:{mAt(e,t);break}case B.COLGROUP:{gAt(e,t);break}default:xT(e,t)}}function _C(e,t){switch(t.tagID){case B.TABLE:{e.openElements.hasInTableScope(B.TABLE)&&(e.openElements.popUntilTagNamePopped(B.TABLE),e._resetInsertionMode());break}case B.TEMPLATE:{Gv(e,t);break}case B.BODY:case B.CAPTION:case B.COL:case B.COLGROUP:case B.HTML:case B.TBODY:case B.TD:case B.TFOOT:case B.TH:case B.THEAD:case B.TR:break;default:xT(e,t)}}function xT(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,EM(e,t),e.fosterParentingEnabled=n}function IMe(e,t){e.pendingCharacterTokens.push(t)}function PMe(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function kO(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===B.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===B.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===B.OPTGROUP&&e.openElements.pop();break}case B.OPTION:{e.openElements.currentTagId===B.OPTION&&e.openElements.pop();break}case B.SELECT:{e.openElements.hasInSelectScope(B.SELECT)&&(e.openElements.popUntilTagNamePopped(B.SELECT),e._resetInsertionMode());break}case B.TEMPLATE:{Gv(e,t);break}}}function TAt(e,t){const n=t.tagID;n===B.CAPTION||n===B.TABLE||n===B.TBODY||n===B.TFOOT||n===B.THEAD||n===B.TR||n===B.TD||n===B.TH?(e.openElements.popUntilTagNamePopped(B.SELECT),e._resetInsertionMode(),e._processStartTag(t)):LMe(e,t)}function _At(e,t){const n=t.tagID;n===B.CAPTION||n===B.TABLE||n===B.TBODY||n===B.TFOOT||n===B.THEAD||n===B.TR||n===B.TD||n===B.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(B.SELECT),e._resetInsertionMode(),e.onEndTag(t)):$Me(e,t)}function jAt(e,t){switch(t.tagID){case B.BASE:case B.BASEFONT:case B.BGSOUND:case B.LINK:case B.META:case B.NOFRAMES:case B.SCRIPT:case B.STYLE:case B.TEMPLATE:case B.TITLE:{Cf(e,t);break}case B.CAPTION:case B.COLGROUP:case B.TBODY:case B.TFOOT:case B.THEAD:{e.tmplInsertionModeStack[0]=Pe.IN_TABLE,e.insertionMode=Pe.IN_TABLE,l1(e,t);break}case B.COL:{e.tmplInsertionModeStack[0]=Pe.IN_COLUMN_GROUP,e.insertionMode=Pe.IN_COLUMN_GROUP,sq(e,t);break}case B.TR:{e.tmplInsertionModeStack[0]=Pe.IN_TABLE_BODY,e.insertionMode=Pe.IN_TABLE_BODY,AM(e,t);break}case B.TD:case B.TH:{e.tmplInsertionModeStack[0]=Pe.IN_ROW,e.insertionMode=Pe.IN_ROW,TM(e,t);break}default:e.tmplInsertionModeStack[0]=Pe.IN_BODY,e.insertionMode=Pe.IN_BODY,Nl(e,t)}}function NAt(e,t){t.tagID===B.TEMPLATE&&Gv(e,t)}function FMe(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(B.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):rq(e,t)}function RAt(e,t){t.tagID===B.HTML?Nl(e,t):_I(e,t)}function BMe(e,t){var n;if(t.tagID===B.HTML){if(e.fragmentContext||(e.insertionMode=Pe.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===B.HTML){e._setEndLocation(e.openElements.items[0],t);const i=e.openElements.items[1];i&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(i))===null||n===void 0)&&n.endTag)&&e._setEndLocation(i,t)}}else _I(e,t)}function _I(e,t){e.insertionMode=Pe.IN_BODY,EM(e,t)}function IAt(e,t){switch(t.tagID){case B.HTML:{Nl(e,t);break}case B.FRAMESET:{e._insertElement(t,jt.HTML);break}case B.FRAME:{e._appendElement(t,jt.HTML),t.ackSelfClosing=!0;break}case B.NOFRAMES:{Cf(e,t);break}}}function PAt(e,t){t.tagID===B.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==B.FRAMESET&&(e.insertionMode=Pe.AFTER_FRAMESET))}function DAt(e,t){switch(t.tagID){case B.HTML:{Nl(e,t);break}case B.NOFRAMES:{Cf(e,t);break}}}function MAt(e,t){t.tagID===B.HTML&&(e.insertionMode=Pe.AFTER_AFTER_FRAMESET)}function LAt(e,t){t.tagID===B.HTML?Nl(e,t):NN(e,t)}function NN(e,t){e.insertionMode=Pe.IN_BODY,EM(e,t)}function $At(e,t){switch(t.tagID){case B.HTML:{Nl(e,t);break}case B.NOFRAMES:{Cf(e,t);break}}}function FAt(e,t){t.chars=Fs,e._insertCharacters(t)}function BAt(e,t){e._insertCharacters(t),e.framesetOk=!1}function UMe(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==jt.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function UAt(e,t){if(nCt(t))UMe(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),i=e.treeAdapter.getNamespaceURI(n);i===jt.MATHML?SMe(t):i===jt.SVG&&(iCt(t),EMe(t)),nq(t),t.selfClosing?e._appendElement(t,i):e._insertElement(t,i),t.ackSelfClosing=!0}}function QAt(e,t){if(t.tagID===B.P||t.tagID===B.BR){UMe(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const i=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(i)===jt.HTML){e._endTagOutsideForeignContent(t);break}const r=e.treeAdapter.getTagName(i);if(r.toLowerCase()===t.tagName){t.tagName=r,e.openElements.shortenToLength(n);break}}}et.AREA,et.BASE,et.BASEFONT,et.BGSOUND,et.BR,et.COL,et.EMBED,et.FRAME,et.HR,et.IMG,et.INPUT,et.KEYGEN,et.LINK,et.META,et.PARAM,et.SOURCE,et.TRACK,et.WBR;const zAt=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,VAt=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),Cne={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function QMe(e,t){const n=eTt(e),i=tDe("type",{handlers:{root:HAt,element:qAt,text:WAt,comment:VMe,doctype:KAt,raw:XAt},unknown:YAt}),r={parser:n?new One(Cne):One.getFragmentParser(void 0,Cne),handle(l){i(l,r)},stitches:!1,options:t||{}};i(e,r),lk(r,Ih());const s=n?r.parser.document:r.parser.getFragment(),o=tEt(s,{file:r.options.file});return r.stitches&&yT(o,"comment",function(l,c,u){const d=l;if(d.value.stitch&&u&&c!==void 0){const f=u.children;return f[c]=d.value.stitch,c}}),o.type==="root"&&o.children.length===1&&o.children[0].type===e.type?o.children[0]:o}function zMe(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);const n={type:zi.CHARACTER,chars:e.value,location:wT(e)};lk(t,Ih(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function KAt(e,t){const n={type:zi.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:wT(e)};lk(t,Ih(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function GAt(e,t){t.stitches=!0;const n=tTt(e);if("children"in e&&"children"in n){const i=QMe({type:"root",children:e.children},t.options);n.children=i.children}VMe({type:"comment",value:{stitch:n}},t)}function VMe(e,t){const n=e.value,i={type:zi.COMMENT,data:n,location:wT(e)};lk(t,Ih(e)),t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken)}function XAt(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,HMe(t,Ih(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(zAt,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function YAt(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))GAt(n,t);else{let i="";throw VAt.has(n.type)&&(i=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+i)}}function lk(e,t){HMe(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Ta.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function HMe(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function ZAt(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Ta.PLAINTEXT)return;lk(t,Ih(e));const i=t.parser.openElements.current;let r="namespaceURI"in i?i.namespaceURI:Ay.html;r===Ay.html&&n==="svg"&&(r=Ay.svg);const s=aEt({...e,children:[]},{space:r===Ay.svg?"svg":"html"}),o={type:zi.START_TAG,tagName:n,tagID:ok(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:wT(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function JAt(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&pEt.includes(n)||t.parser.tokenizer.state===Ta.PLAINTEXT)return;lk(t,yM(e));const i={type:zi.END_TAG,tagName:n,tagID:ok(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:wT(e)};t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Ta.RCDATA||t.parser.tokenizer.state===Ta.RAWTEXT||t.parser.tokenizer.state===Ta.SCRIPT_DATA)&&(t.parser.tokenizer.state=Ta.DATA)}function eTt(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function wT(e){const t=Ih(e)||{line:void 0,column:void 0,offset:void 0},n=yM(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function tTt(e){return"children"in e?a1({...e,children:[]}):a1(e)}function nTt(e){return function(t,n){return QMe(t,{...e,file:n})}}const iTt="modulepreload",rTt=function(e){return"/"+e},Ane={},Ys=function(t,n,i){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));r=Promise.allSettled(n.map(c=>{if(c=rTt(c),c in Ane)return;Ane[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":iTt,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((h,m)=>{f.addEventListener("load",h),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return r.then(o=>{for(const l of o||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})};var sTt=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,aTt=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,oTt=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,N4={Space_Separator:sTt,ID_Start:aTt,ID_Continue:oTt},ka={isSpaceSeparator(e){return typeof e=="string"&&N4.Space_Separator.test(e)},isIdStartChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"||N4.ID_Start.test(e))},isIdContinueChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||e==="$"||e==="_"||e==="‌"||e==="‍"||N4.ID_Continue.test(e))},isDigit(e){return typeof e=="string"&&/[0-9]/.test(e)},isHexDigit(e){return typeof e=="string"&&/[0-9A-Fa-f]/.test(e)}};let t9,Yl,wp,jI,ob,hf,To,aq,bE;var lTt=function(t,n){t9=String(t),Yl="start",wp=[],jI=0,ob=1,hf=0,To=void 0,aq=void 0,bE=void 0;do To=cTt(),fTt[Yl]();while(To.type!=="eof");return typeof n=="function"?n9({"":bE},"",n):bE};function n9(e,t,n){const i=e[t];if(i!=null&&typeof i=="object")if(Array.isArray(i))for(let r=0;r0;){const n=Bp();if(!ka.isHexDigit(n))throw Ts(Et());e+=Et()}return String.fromCodePoint(parseInt(e,16))}const fTt={start(){if(To.type==="eof")throw Gb();R4()},beforePropertyName(){switch(To.type){case"identifier":case"string":aq=To.value,Yl="afterPropertyName";return;case"punctuator":__();return;case"eof":throw Gb()}},afterPropertyName(){if(To.type==="eof")throw Gb();Yl="beforePropertyValue"},beforePropertyValue(){if(To.type==="eof")throw Gb();R4()},beforeArrayValue(){if(To.type==="eof")throw Gb();if(To.type==="punctuator"&&To.value==="]"){__();return}R4()},afterPropertyValue(){if(To.type==="eof")throw Gb();switch(To.value){case",":Yl="beforePropertyName";return;case"}":__()}},afterArrayValue(){if(To.type==="eof")throw Gb();switch(To.value){case",":Yl="beforeArrayValue";return;case"]":__()}},end(){}};function R4(){let e;switch(To.type){case"punctuator":switch(To.value){case"{":e={};break;case"[":e=[];break}break;case"null":case"boolean":case"numeric":case"string":e=To.value;break}if(bE===void 0)bE=e;else{const t=wp[wp.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,aq,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(e!==null&&typeof e=="object")wp.push(e),Array.isArray(e)?Yl="beforeArrayValue":Yl="beforePropertyName";else{const t=wp[wp.length-1];t==null?Yl="end":Array.isArray(t)?Yl="afterArrayValue":Yl="afterPropertyValue"}}function __(){wp.pop();const e=wp[wp.length-1];e==null?Yl="end":Array.isArray(e)?Yl="afterArrayValue":Yl="afterPropertyValue"}function Ts(e){return NI(e===void 0?`JSON5: invalid end of input at ${ob}:${hf}`:`JSON5: invalid character '${WMe(e)}' at ${ob}:${hf}`)}function Gb(){return NI(`JSON5: invalid end of input at ${ob}:${hf}`)}function Tne(){return hf-=5,NI(`JSON5: invalid identifier character at ${ob}:${hf}`)}function hTt(e){console.warn(`JSON5: '${WMe(e)}' in strings is not valid ECMAScript; consider escaping`)}function WMe(e){const t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){const n=e.charCodeAt(0).toString(16);return"\\x"+("00"+n).substring(n.length)}return e}function NI(e){const t=new SyntaxError(e);return t.lineNumber=ob,t.columnNumber=hf,t}var pTt=function(t,n,i){const r=[];let s="",o,l,c="",u;if(n!=null&&typeof n=="object"&&!Array.isArray(n)&&(i=n.space,u=n.quote,n=n.replacer),typeof n=="function")l=n;else if(Array.isArray(n)){o=[];for(const b of n){let v;typeof b=="string"?v=b:(typeof b=="number"||b instanceof String||b instanceof Number)&&(v=String(b)),v!==void 0&&o.indexOf(v)<0&&o.push(v)}}return i instanceof Number?i=Number(i):i instanceof String&&(i=String(i)),typeof i=="number"?i>0&&(i=Math.min(10,Math.floor(i)),c=" ".substr(0,i)):typeof i=="string"&&(c=i.substr(0,10)),d("",{"":t});function d(b,v){let y=v[b];switch(y!=null&&(typeof y.toJSON5=="function"?y=y.toJSON5(b):typeof y.toJSON=="function"&&(y=y.toJSON(b))),l&&(y=l.call(v,b,y)),y instanceof Number?y=Number(y):y instanceof String?y=String(y):y instanceof Boolean&&(y=y.valueOf()),y){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof y=="string")return f(y);if(typeof y=="number")return String(y);if(typeof y=="object")return Array.isArray(y)?g(y):h(y)}function f(b){const v={"'":.1,'"':.2},y={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let w="";for(let k=0;kv[k]=0)throw TypeError("Converting circular structure to JSON5");r.push(b);let v=s;s=s+c;let y=o||Object.keys(b),w=[];for(const k of y){const S=d(k,b);if(S!==void 0){let O=m(k)+":";c!==""&&(O+=" "),O+=S,w.push(O)}}let x;if(w.length===0)x="{}";else{let k;if(c==="")k=w.join(","),x="{"+k+"}";else{let S=`, +`))}function c(m,g,b,v){const y=b.enter("tableCell"),w=b.enter("phrasing"),x=b.containerPhrasing(m,{...v,before:s,after:s});return w(),y(),x}function u(m,g){return a1t(m,{align:g,alignDelimiters:i,padding:n,stringLength:r})}function d(m,g,b){const v=m.children;let y=-1;const w=[],x=g.enter("table");for(;++y0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const ukt={tokenize:ykt,partial:!0};function dkt(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:mkt,continuation:{tokenize:gkt},exit:bkt}},text:{91:{name:"gfmFootnoteCall",tokenize:pkt},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:fkt,resolveTo:hkt}}}}function fkt(e,t,n){const i=this;let r=i.events.length;const s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o;for(;r--;){const c=i.events[r][1];if(c.type==="labelImage"){o=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!o||!o._balanced)return n(c);const u=ff(i.sliceSerialize({start:o.end,end:i.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function hkt(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 i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",r,t],["exit",r,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...l),e}function pkt(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s=0,o;return l;function l(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),c}function c(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(s>999||f===93&&!o||f===null||f===91||ds(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return r.includes(ff(i.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return ds(f)||(o=!0),s++,e.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(e.consume(f),s++,u):u(f)}}function mkt(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s,o=0,l;return c;function c(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(g)}function d(g){if(o>999||g===93&&!l||g===null||g===91||ds(g))return n(g);if(g===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return s=ff(i.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return ds(g)||(l=!0),o++,e.consume(g),g===92?f:d}function f(g){return g===91||g===92||g===93?(e.consume(g),o++,d):d(g)}function h(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),r.includes(s)||r.push(s),gr(e,m,"gfmFootnoteDefinitionWhitespace")):n(g)}function m(g){return t(g)}}function gkt(e,t,n){return e.check(gT,t,e.attempt(ukt,t,n))}function bkt(e){e.exit("gfmFootnoteDefinition")}function ykt(e,t,n){const i=this;return gr(e,r,"gfmFootnoteDefinitionIndent",5);function r(s){const o=i.events[i.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function vkt(e){let n=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:s,resolveAll:r};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function r(o,l){let c=-1;for(;++c1?c(g):(o.consume(g),f++,m);if(f<2&&!n)return c(g);const v=o.exit("strikethroughSequenceTemporary"),y=s1(g);return v._open=!y||y===2&&!!b,v._close=!b||b===2&&!!y,l(g)}}}class xkt{constructor(){this.map=[]}add(t,n,i){wkt(this,t,n,i)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];i.push(t.slice()),t.length=0;let r=i.pop();for(;r;){for(const s of r)t.push(s);r=i.pop()}this.map.length=0}}function wkt(e,t,n,i){let r=0;if(!(n===0&&i.length===0)){for(;r-1;){const P=i.events[R][1].type;if(P==="lineEnding"||P==="linePrefix")R--;else break}const C=R>-1?i.events[R][1].type:null,N=C==="tableHead"||C==="tableRow"?O:c;return N===O&&i.parser.lazy[i.now().line]?n(T):N(T)}function c(T){return e.enter("tableHead"),e.enter("tableRow"),u(T)}function u(T){return T===124||(o=!0,s+=1),d(T)}function d(T){return T===null?n(T):Wn(T)?s>1?(s=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),m):n(T):Zi(T)?gr(e,d,"whitespace")(T):(s+=1,o&&(o=!1,r+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),o=!0,d):(e.enter("data"),f(T)))}function f(T){return T===null||T===124||ds(T)?(e.exit("data"),d(T)):(e.consume(T),T===92?h:f)}function h(T){return T===92||T===124?(e.consume(T),f):f(T)}function m(T){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(T):(e.enter("tableDelimiterRow"),o=!1,Zi(T)?gr(e,g,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):g(T))}function g(T){return T===45||T===58?v(T):T===124?(o=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),b):S(T)}function b(T){return Zi(T)?gr(e,v,"whitespace")(T):v(T)}function v(T){return T===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),y):T===45?(s+=1,y(T)):T===null||Wn(T)?k(T):S(T)}function y(T){return T===45?(e.enter("tableDelimiterFiller"),w(T)):S(T)}function w(T){return T===45?(e.consume(T),w):T===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(T))}function x(T){return Zi(T)?gr(e,k,"whitespace")(T):k(T)}function k(T){return T===124?g(T):T===null||Wn(T)?!o||r!==s?S(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):S(T)}function S(T){return n(T)}function O(T){return e.enter("tableRow"),A(T)}function A(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),A):T===null||Wn(T)?(e.exit("tableRow"),t(T)):Zi(T)?gr(e,A,"whitespace")(T):(e.enter("data"),E(T))}function E(T){return T===null||T===124||ds(T)?(e.exit("data"),A(T)):(e.consume(T),T===92?j:E)}function j(T){return T===92||T===124?(e.consume(T),E):E(T)}}function Ekt(e,t){let n=-1,i=!0,r=0,s=[0,0,0,0],o=[0,0,0,0],l=!1,c=0,u,d,f;const h=new xkt;for(;++nn[2]+1){const g=n[2]+1,b=n[3]-n[2]-1;e.add(g,b,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return r!==void 0&&(s.end=Object.assign({},lx(t.events,r)),e.add(r,0,[["exit",s,t]]),s=void 0),s}function Vte(e,t,n,i,r){const s=[],o=lx(t.events,n);r&&(r.end=Object.assign({},o),s.push(["exit",r,t])),i.end=Object.assign({},o),s.push(["exit",i,t]),e.add(n+1,0,s)}function lx(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const Ckt={name:"tasklistCheck",tokenize:Tkt};function Akt(){return{text:{91:Ckt}}}function Tkt(e,t,n){const i=this;return r;function r(c){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),s)}function s(c){return ds(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),o):n(c)}function o(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(c)}function l(c){return Wn(c)?t(c):Zi(c)?e.check({tokenize:_kt},t,n)(c):n(c)}}function _kt(e,t,n){return gr(e,i,"whitespace");function i(r){return r===null?n(r):t(r)}}function jkt(e){return _Pe([tkt(),dkt(),vkt(e),Okt(),Akt()])}const Nkt={};function kDe(e){const t=this,n=e||Nkt,i=t.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),s=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),o=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(jkt(n)),s.push(Y1t()),o.push(Z1t(n))}const Hte=function(e,t,n){const i=bT(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++tu&&(u=d):d&&(u!==void 0&&u>-1&&c.push(` +`.repeat(u)||" "),u=-1,c.push(d))}return c.join("")}function SDe(e,t,n){return e.type==="element"?Fkt(e,t,n):e.type==="text"?n.whitespace==="normal"?EDe(e,n):Bkt(e):[]}function Fkt(e,t,n){const i=CDe(e,n),r=e.children||[];let s=-1,o=[];if(Lkt(e))return o;let l,c;for(GB(e)||Gte(e)&&Hte(t,e,Gte)?c=` +`:Mkt(e)?(l=2,c=2):ODe(e)&&(l=1,c=1);++s]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},m=t.optional(r)+e.IDENT_RE+"\\s*\\(",g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],b=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],k={type:b,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},S={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},O=[S,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],A={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:k,contains:O.concat([{begin:/\(/,end:/\)/,keywords:k,contains:O.concat(["self"]),relevance:0}]),relevance:0},E={className:"function",begin:"("+o+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:k,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:k,relevance:0},{begin:m,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:k,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:k,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:k,illegal:"",keywords:k,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:k},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function qkt(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=Hkt(e),i=n.keywords;return i.type=[...i.type,...t.type],i.literal=[...i.literal,...t.literal],i.built_in=[...i.built_in,...t.built_in],i._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function OM(e){const t=e.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const r={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},s=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,r]};r.contains.push(l);const c={match:/\\"/},u={className:"string",begin:/'/,end:/'/},d={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},h=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],m=e.SHEBANG({binary:`(${h.join("|")})`,relevance:10}),g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},b=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],v=["true","false"],y={match:/(\/[a-z._-]+)+/},w=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],x=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],k=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],S=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:b,literal:v,built_in:[...w,...x,"set","shopt",...k,...S]},contains:[m,e.SHEBANG(),g,f,s,o,y,l,c,u,d,n]}}function Wkt(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",o="("+i+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},m=t.optional(r)+e.IDENT_RE+"\\s*\\(",v={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],w={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:y.concat([{begin:/\(/,end:/\)/,keywords:v,contains:y.concat(["self"]),relevance:0}]),relevance:0},x={begin:"("+o+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:v,relevance:0},{begin:m,returnBegin:!0,contains:[e.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C",aliases:["h"],keywords:v,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:v}}}function Kkt(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",o="(?!struct)("+i+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},m=t.optional(r)+e.IDENT_RE+"\\s*\\(",g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],b=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],k={type:b,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},S={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},O=[S,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],A={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:k,contains:O.concat([{begin:/\(/,end:/\)/,keywords:k,contains:O.concat(["self"]),relevance:0}]),relevance:0},E={className:"function",begin:"("+o+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:k,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:k,relevance:0},{begin:m,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:k,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:k,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:k,illegal:"",keywords:k,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:k},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Gkt(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],i=["default","false","null","true"],r=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],s=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],o={keyword:r.concat(s),built_in:t,literal:i},l=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),c={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},f=e.inherit(d,{illegal:/\n/}),h={className:"subst",begin:/\{/,end:/\}/,keywords:o},m=e.inherit(h,{illegal:/\n/}),g={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,m]},b={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},v=e.inherit(b,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]});h.contains=[b,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],m.contains=[v,g,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[u,b,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},w={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},x=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",k={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:o,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},y,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,w,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,w,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+x+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:o,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,w],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,relevance:0,contains:[y,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},k]}}const Xkt=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Ykt=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Zkt=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Jkt=[...Ykt,...Zkt],eOt=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),tOt=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),nOt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),iOt=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function TDe(e){const t=e.regex,n=Xkt(e),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",s=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",l=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,i,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+tOt.join("|")+")"},{begin:":(:)?("+nOt.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+iOt.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:eOt.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Jkt.join("|")+")\\b"}]}}function _De(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function jDe(e){const s={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:s,illegal:"NDe(e,t,n-1))}function RDe(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+NDe("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),c={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},u={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},d={className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:c,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+i+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:c,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,Xte,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},Xte,u]}}const Yte="[A-Za-z$_][0-9A-Za-z$_]*",sOt=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],aOt=["true","false","null","undefined","NaN","Infinity"],IDe=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],PDe=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],DDe=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],oOt=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],lOt=[].concat(DDe,IDe,PDe);function QH(e){const t=e.regex,n=(L,{after:F})=>{const M="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,F)=>{const M=L[0].length+L.index,H=L.input[M];if(H==="<"||H===","){F.ignoreMatch();return}H===">"&&(n(L,{after:M})||F.ignoreMatch());let q;const U=L.input.substring(M);if(q=U.match(/^\s*=/)){F.ignoreMatch();return}if((q=U.match(/^\s+extends\s+/))&&q.index===0){F.ignoreMatch();return}}},l={$pattern:Yte,keyword:sOt,literal:aOt,built_in:lOt,"variable.language":oOt},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},m={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},w={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const k=[].concat(w,h.contains),S=k.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(k)}]),O={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},A={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},E={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...IDe,...PDe]}},j={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[O],illegal:/%/},R={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function C(L){return t.concat("(?!",L.join("|"),")")}const N={match:t.concat(/\b/,C([...DDe,"super","import"].map(L=>`${L}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},P={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},I={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},O]},D="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",_={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[O]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:E},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),j,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,w,{match:/\$\d+/},f,E,{scope:"attr",match:i+t.lookahead(":"),relevance:0},_,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[w,e.REGEXP_MODE,{className:"function",begin:D,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[O,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},P,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[O]},N,R,A,I,{match:/\$[(.]/}]}}function zH(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],r={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[t,n,e.QUOTE_STRING_MODE,r,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var ux="[0-9](_*[0-9])*",S_=`\\.(${ux})`,E_="[0-9a-fA-F](_*[0-9a-fA-F])*",cOt={className:"number",variants:[{begin:`(\\b(${ux})((${S_})|\\.)?|(${S_}))[eE][+-]?(${ux})[fFdD]?\\b`},{begin:`\\b(${ux})((${S_})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${S_})[fFdD]?\\b`},{begin:`\\b(${ux})[fFdD]\\b`},{begin:`\\b0[xX]((${E_})\\.?|(${E_})?\\.(${E_}))[pP][+-]?(${ux})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${E_})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function uOt(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},i={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},r={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,r]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,s,r]}]};r.contains.push(o);const l={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},c={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:"string"}),"self"]}]},u=cOt,d=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),f={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},h=f;return h.variants[1].contains=[f],f.variants[1].contains=[h],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,d,n,i,l,c,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[f,e.C_LINE_COMMENT_MODE,d],relevance:0},e.C_LINE_COMMENT_MODE,d,l,c,o,e.C_NUMBER_MODE]},d]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},l,c]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` +`},u]}}const dOt=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),fOt=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],hOt=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],pOt=[...fOt,...hOt],mOt=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),MDe=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),LDe=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),gOt=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),bOt=MDe.concat(LDe).sort().reverse();function yOt(e){const t=dOt(e),n=bOt,i="and or not only",r="[\\w-]+",s="("+r+"|@\\{"+r+"\\})",o=[],l=[],c=function(x){return{className:"string",begin:"~?"+x+".*?"+x}},u=function(x,k,S){return{className:x,begin:k,relevance:S}},d={$pattern:/[a-z-]+/,keyword:i,attribute:mOt.join(" ")},f={begin:"\\(",end:"\\)",contains:l,keywords:d,relevance:0};l.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,c("'"),c('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,f,u("variable","@@?"+r,10),u("variable","@\\{"+r+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:r+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const h=l.concat({begin:/\{/,end:/\}/,contains:o}),m={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},g={begin:s+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+gOt.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},b={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:d,returnEnd:!0,contains:l,relevance:0}},v={className:"variable",variants:[{begin:"@"+r+"\\s*:",relevance:15},{begin:"@"+r}],starts:{end:"[;}]",returnEnd:!0,contains:h}},y={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:s,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m,u("keyword","all\\b"),u("variable","@\\{"+r+"\\}"),{begin:"\\b("+pOt.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,u("selector-tag",s,0),u("selector-id","#"+s),u("selector-class","\\."+s,0),u("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+MDe.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+LDe.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},w={begin:r+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,b,v,w,g,y,m,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:o}}function vOt(e){const t="\\[=*\\[",n="\\]=*\\]",i={begin:t,end:n,contains:["self"]},r=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[i],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:r.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:r}].concat(r)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[i],relevance:5}])}}function VH(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},r={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=e.inherit(u,{contains:[]}),h=e.inherit(d,{contains:[]});u.contains.push(h),d.contains.push(f);let m=[n,c];return[u,d,f,h].forEach(y=>{y.contains=y.contains.concat(m)}),m=m.concat(u,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:m},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:m}]}]},n,s,u,d,{className:"quote",begin:"^>\\s+",contains:m,end:"$"},r,i,c,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function xOt(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,l={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},c={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:l,illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+c.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:c,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function wOt(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],i=/[dualxmsipngr]{0,12}/,r={$pattern:/[\w.]+/,keyword:n.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:r},o={begin:/->\{/,end:/\}/},l={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},c={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[l]},u={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},d=[e.BACKSLASH_ESCAPE,s,c],f=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],h=(b,v,y="\\1")=>{const w=y==="\\1"?y:t.concat(y,v);return t.concat(t.concat("(?:",b,")"),v,/(?:\\.|[^\\\/])*?/,w,/(?:\\.|[^\\\/])*?/,y,i)},m=(b,v,y)=>t.concat(t.concat("(?:",b,")"),v,/(?:\\.|[^\\\/])*?/,y,i),g=[c,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:"string",contains:d,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},u,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:h("s|tr|y",t.either(...f,{capture:!0}))},{begin:h("s|tr|y","\\(","\\)")},{begin:h("s|tr|y","\\[","\\]")},{begin:h("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:m("(?:m|qr)?",/\//,/\//)},{begin:m("m|qr",t.either(...f,{capture:!0}),/\1/)},{begin:m("m|qr",/\(/,/\)/)},{begin:m("m|qr",/\[/,/\]/)},{begin:m("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l,u]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return s.contains=g,o.contains=g,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:g}}function kOt(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,i=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),r=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),s=t.concat(/[A-Z]+/,n),o={scope:"variable",match:"\\$+"+i},l={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=e.inherit(e.APOS_STRING_MODE,{illegal:null}),d=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(c)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(P,I)=>{I.data._beginMatch=P[1]||P[2]},"on:end":(P,I)=>{I.data._beginMatch!==P[1]&&I.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),m=`[ +]`,g={scope:"string",variants:[d,u,f,h]},b={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},v=["false","null","true"],y=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],w=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],k={keyword:y,literal:(P=>{const I=[];return P.forEach(D=>{I.push(D),D.toLowerCase()===D?I.push(D.toUpperCase()):I.push(D.toLowerCase())}),I})(v),built_in:w},S=P=>P.map(I=>I.replace(/\|\d+$/,"")),O={variants:[{match:[/new/,t.concat(m,"+"),t.concat("(?!",S(w).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},A=t.concat(i,"\\b(?!\\()"),E={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),A],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,t.concat(/::/,t.lookahead(/(?!class\b)/)),A],scope:{1:"title.class",3:"variable.constant"}},{match:[r,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[r,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},j={scope:"attr",match:t.concat(i,t.lookahead(":"),t.lookahead(/(?!::)/))},T={relevance:0,begin:/\(/,end:/\)/,keywords:k,contains:[j,o,E,e.C_BLOCK_COMMENT_MODE,g,b,O]},R={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",S(y).join("\\b|"),"|",S(w).join("\\b|"),"\\b)"),i,t.concat(m,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[T]};T.contains.push(R);const C=[j,E,e.C_BLOCK_COMMENT_MODE,g,b,O],N={begin:t.concat(/#\[\s*\\?/,t.either(r,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:v,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:v,keyword:["new","array"]},contains:["self",...C]},...C,{scope:"meta",variants:[{match:r},{match:s}]}]};return{case_insensitive:!1,keywords:k,contains:[N,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},o,R,E,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},O,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:k,contains:["self",N,o,E,e.C_BLOCK_COMMENT_MODE,g,b]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},g,b]}}function OOt(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function $De(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function qH(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},d={begin:/\{\{/,relevance:0},f={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h="[0-9](_?[0-9])*",m=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,g=`\\b|${i.join("|")}`,b={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${m}))[eE][+-]?(${h})[jJ]?(?=${g})`},{begin:`(${m})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${h})[jJ](?=${g})`}]},v={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,b,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,b,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,b,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,v,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[b,y,f]}]}}function SOt(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function EOt(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,i=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),r=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[r,i]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,i]},{scope:{1:"punctuation",2:"number"},match:[s,i]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,i]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:r},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function COt(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",i=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),r=t.concat(i,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[l]}),e.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],d={className:"subst",begin:/#\{/,end:/\}/,keywords:o},f={className:"string",contains:[e.BACKSLASH_ESCAPE,d],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,d]})]}]},h="[1-9](_?[0-9])*|0",m="[0-9](_?[0-9])*",g={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${m}))?([eE][+-]?(${m})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},b={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},O=[f,{variants:[{match:[/class\s+/,r,/\s+<\s+/,r]},{match:[/\b(class|module)\s+/,r]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,r],scope:{2:"title.class"},keywords:o},{relevance:0,match:[r,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:i,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[b]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:n}],relevance:0},g,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(c,u),relevance:0}].concat(c,u);d.contains=O,b.contains=O;const T=[{begin:/^\s*=>/,starts:{end:"$",contains:O}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:O}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(T).concat(u).concat(O)}}function FDe(e){const t=e.regex,n=/(r#)?/,i=t.concat(n,e.UNDERSCORE_IDENT_RE),r=t.concat(n,e.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,r,t.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",l=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],c=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],d=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:d,keyword:l,literal:c,built_in:u},illegal:""},s]}}const AOt=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),TOt=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],_Ot=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],jOt=[...TOt,..._Ot],NOt=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),ROt=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),IOt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),POt=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function BDe(e){const t=AOt(e),n=IOt,i=ROt,r="@[a-z-]+",s="and or not only",l={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+jOt.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+i.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+POt.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,l,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:r,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:NOt.join(" ")},contains:[{begin:r,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},l,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function DOt(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function UDe(e){const t=e.regex,n=e.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],c=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],f=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],h=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],m=d,g=[...u,...c].filter(S=>!d.includes(S)),b={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},v={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:t.concat(/\b/,t.either(...m),/\s*\(/),relevance:0,keywords:{built_in:m}};function w(S){return t.concat(/\b/,t.either(...S.map(O=>O.replace(/\s+/,"\\s+"))),/\b/)}const x={scope:"keyword",match:w(h),relevance:0};function k(S,{exceptions:O,when:A}={}){const E=A;return O=O||[],S.map(j=>j.match(/\|\d+$/)||O.includes(j)?j:E(j)?`${j}|0`:j)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:k(g,{when:S=>S.length<3}),literal:s,type:l,built_in:f},contains:[{scope:"type",match:w(o)},x,y,b,i,r,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function QDe(e){return e?typeof e=="string"?e:e.source:null}function xO(e){return Gr("(?=",e,")")}function Gr(...e){return e.map(n=>QDe(n)).join("")}function MOt(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function ql(...e){return"("+(MOt(e).capture?"":"?:")+e.map(i=>QDe(i)).join("|")+")"}const WH=e=>Gr(/\b/,e,/\w$/.test(e)?/\b/:/\B/),LOt=["Protocol","Type"].map(WH),Zte=["init","self"].map(WH),$Ot=["Any","Self"],C4=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Jte=["false","nil","true"],FOt=["assignment","associativity","higherThan","left","lowerThan","none","right"],BOt=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],ene=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],zDe=ql(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),VDe=ql(zDe,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),A4=Gr(zDe,VDe,"*"),HDe=ql(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),SI=ql(HDe,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),qf=Gr(HDe,SI,"*"),C_=Gr(/[A-Z]/,SI,"*"),UOt=["attached","autoclosure",Gr(/convention\(/,ql("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Gr(/objc\(/,qf,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],QOt=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function zOt(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[e.C_LINE_COMMENT_MODE,n],r={match:[/\./,ql(...LOt,...Zte)],className:{2:"keyword"}},s={match:Gr(/\./,ql(...C4)),relevance:0},o=C4.filter(Oe=>typeof Oe=="string").concat(["_|0"]),l=C4.filter(Oe=>typeof Oe!="string").concat($Ot).map(WH),c={variants:[{className:"keyword",match:ql(...l,...Zte)}]},u={$pattern:ql(/\b\w+/,/#\w+/),keyword:o.concat(BOt),literal:Jte},d=[r,s,c],f={match:Gr(/\./,ql(...ene)),relevance:0},h={className:"built_in",match:Gr(/\b/,ql(...ene),/(?=\()/)},m=[f,h],g={match:/->/,relevance:0},b={className:"operator",relevance:0,variants:[{match:A4},{match:`\\.(\\.|${VDe})+`}]},v=[g,b],y="([0-9]_*)+",w="([0-9a-fA-F]_*)+",x={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${w})(\\.(${w}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},k=(Oe="")=>({className:"subst",variants:[{match:Gr(/\\/,Oe,/[0\\tnr"']/)},{match:Gr(/\\/,Oe,/u\{[0-9a-fA-F]{1,8}\}/)}]}),S=(Oe="")=>({className:"subst",match:Gr(/\\/,Oe,/[\t ]*(?:[\r\n]|\r\n)/)}),O=(Oe="")=>({className:"subst",label:"interpol",begin:Gr(/\\/,Oe,/\(/),end:/\)/}),A=(Oe="")=>({begin:Gr(Oe,/"""/),end:Gr(/"""/,Oe),contains:[k(Oe),S(Oe),O(Oe)]}),E=(Oe="")=>({begin:Gr(Oe,/"/),end:Gr(/"/,Oe),contains:[k(Oe),O(Oe)]}),j={className:"string",variants:[A(),A("#"),A("##"),A("###"),E(),E("#"),E("##"),E("###")]},T=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],R={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:T},C=Oe=>{const he=Gr(Oe,/\//),ge=Gr(/\//,Oe);return{begin:he,end:ge,contains:[...T,{scope:"comment",begin:`#(?!.*${ge})`,end:/$/}]}},N={scope:"regexp",variants:[C("###"),C("##"),C("#"),R]},P={match:Gr(/`/,qf,/`/)},I={className:"variable",match:/\$\d+/},D={className:"variable",match:`\\$${SI}+`},_=[P,I,D],L={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:QOt,contains:[...v,x,j]}]}},F={scope:"keyword",match:Gr(/@/,ql(...UOt),xO(ql(/\(/,/\s+/)))},M={scope:"meta",match:Gr(/@/,qf)},H=[L,F,M],q={match:xO(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Gr(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,SI,"+")},{className:"type",match:C_,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Gr(/\s+&\s+/,xO(C_)),relevance:0}]},U={begin://,keywords:u,contains:[...i,...d,...H,g,q]};q.contains.push(U);const Z={match:Gr(qf,/\s*:/),keywords:"_|0",relevance:0},z={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",Z,...i,N,...d,...m,...v,x,j,..._,...H,q]},J={begin://,keywords:"repeat each",contains:[...i,q]},ne={begin:ql(xO(Gr(qf,/\s*:/)),xO(Gr(qf,/\s+/,qf,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:qf}]},W={begin:/\(/,end:/\)/,keywords:u,contains:[ne,...i,...d,...v,x,j,...H,q,z],endsParent:!0,illegal:/["']/},X={match:[/(func|macro)/,/\s+/,ql(P.match,qf,A4)],className:{1:"keyword",3:"title.function"},contains:[J,W,t],illegal:[/\[/,/%/]},ce={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[J,W,t],illegal:/\[|%/},V={match:[/operator/,/\s+/,A4],className:{1:"keyword",3:"title"}},Y={begin:[/precedencegroup/,/\s+/,C_],className:{1:"keyword",3:"title"},contains:[q],keywords:[...FOt,...Jte],end:/}/},K={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},de={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},ee={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,qf,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[J,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:C_},...d],relevance:0}]};for(const Oe of j.variants){const he=Oe.contains.find(Se=>Se.label==="interpol");he.keywords=u;const ge=[...d,...m,...v,x,j,..._];he.contains=[...ge,{begin:/\(/,end:/\)/,contains:["self",...ge]}]}return{name:"Swift",keywords:u,contains:[...i,X,ce,K,de,ee,V,Y,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},N,...d,...m,...v,x,j,..._,...H,q,z]}}const EI="[A-Za-z$_][0-9A-Za-z$_]*",qDe=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],WDe=["true","false","null","undefined","NaN","Infinity"],KDe=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],GDe=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],XDe=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],YDe=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ZDe=[].concat(XDe,KDe,GDe);function VOt(e){const t=e.regex,n=(L,{after:F})=>{const M="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,F)=>{const M=L[0].length+L.index,H=L.input[M];if(H==="<"||H===","){F.ignoreMatch();return}H===">"&&(n(L,{after:M})||F.ignoreMatch());let q;const U=L.input.substring(M);if(q=U.match(/^\s*=/)){F.ignoreMatch();return}if((q=U.match(/^\s+extends\s+/))&&q.index===0){F.ignoreMatch();return}}},l={$pattern:EI,keyword:qDe,literal:WDe,built_in:ZDe,"variable.language":YDe},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},m={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},w={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const k=[].concat(w,h.contains),S=k.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(k)}]),O={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},A={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},E={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...KDe,...GDe]}},j={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[O],illegal:/%/},R={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function C(L){return t.concat("(?!",L.join("|"),")")}const N={match:t.concat(/\b/,C([...XDe,"super","import"].map(L=>`${L}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},P={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},I={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},O]},D="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",_={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[O]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:E},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),j,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,w,{match:/\$\d+/},f,E,{scope:"attr",match:i+t.lookahead(":"),relevance:0},_,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[w,e.REGEXP_MODE,{className:"function",begin:D,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[O,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},P,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[O]},N,R,A,I,{match:/\$[(.]/}]}}function KH(e){const t=e.regex,n=VOt(e),i=EI,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[n.exports.CLASS_REFERENCE]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:EI,keyword:qDe.concat(c),literal:WDe,built_in:ZDe.concat(r),"variable.language":YDe},d={className:"meta",begin:"@"+i},f=(b,v,y)=>{const w=b.contains.findIndex(x=>x.label===v);if(w===-1)throw new Error("can not find mode to replace");b.contains.splice(w,1,y)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(b=>b.scope==="attr"),m=Object.assign({},h,{match:t.concat(i,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,h,m]),n.contains=n.contains.concat([d,s,o,m]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",l);const g=n.contains.find(b=>b.label==="func.def");return g.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function HOt(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},i={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},r=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,l=/\d{1,2}(:\d{1,2}){1,2}/,c={className:"literal",variants:[{begin:t.concat(/# */,t.either(s,r),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(s,r),/ +/,t.either(o,l),/ *#/)}]},u={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},d={className:"label",begin:/^\w+:/},f=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),h=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,i,c,u,d,f,h,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[h]}]}}function qOt(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),i=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],r={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},s={className:"variable",begin:/\$[\w_]+/},o={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},l={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},c={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},u={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:i},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,o,r,e.QUOTE_STRING_MODE,c,u,l]}}function JDe(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(s,{begin:/\(/,end:/\)/}),l=e.inherit(e.APOS_STRING_MODE,{className:"string"}),c=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[s,c,l,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[s,o,c,l]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function GH(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},l=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),h={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},m={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},g={begin:/\{/,end:/\}/,contains:[m],illegal:"\\n",relevance:0},b={begin:"\\[",end:"\\]",contains:[m],illegal:"\\n",relevance:0},v=[i,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},h,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},g,b,s,o],y=[...v];return y.pop(),y.push(l),m.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}const WOt={arduino:qkt,bash:OM,c:Wkt,cpp:Kkt,csharp:Gkt,css:TDe,diff:_De,go:jDe,graphql:rOt,ini:UH,java:RDe,javascript:QH,json:zH,kotlin:uOt,less:yOt,lua:vOt,makefile:VH,markdown:HH,objectivec:xOt,perl:wOt,php:kOt,"php-template":OOt,plaintext:$De,python:qH,"python-repl":SOt,r:EOt,ruby:COt,rust:FDe,scss:BDe,shell:DOt,sql:UDe,swift:zOt,typescript:KH,vbnet:HOt,wasm:qOt,xml:JDe,yaml:GH};function eMe(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],i=typeof n;(i==="object"||i==="function")&&!Object.isFrozen(n)&&eMe(n)}),e}let tne=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function tMe(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function gg(e,...t){const n=Object.create(null);for(const i in e)n[i]=e[i];return t.forEach(function(i){for(const r in i)n[r]=i[r]}),n}const KOt="",nne=e=>!!e.scope,GOt=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((i,r)=>`${i}${"_".repeat(r+1)}`)].join(" ")}return`${t}${e}`};class XOt{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=tMe(t)}openNode(t){if(!nne(t))return;const n=GOt(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){nne(t)&&(this.buffer+=KOt)}value(){return this.buffer}span(t){this.buffer+=``}}const ine=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class XH{constructor(){this.rootNode=ine(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const n=ine({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(i=>this._walk(t,i)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{XH._collapse(n)}))}}class YOt extends XH{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const i=t.root;n&&(i.scope=`language:${n}`),this.add(i)}toHTML(){return new XOt(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function AC(e){return e?typeof e=="string"?e:e.source:null}function nMe(e){return Kv("(?=",e,")")}function ZOt(e){return Kv("(?:",e,")*")}function JOt(e){return Kv("(?:",e,")?")}function Kv(...e){return e.map(n=>AC(n)).join("")}function eSt(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function YH(...e){return"("+(eSt(e).capture?"":"?:")+e.map(i=>AC(i)).join("|")+")"}function iMe(e){return new RegExp(e.toString()+"|").exec("").length-1}function tSt(e,t){const n=e&&e.exec(t);return n&&n.index===0}const nSt=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function ZH(e,{joinWith:t}){let n=0;return e.map(i=>{n+=1;const r=n;let s=AC(i),o="";for(;s.length>0;){const l=nSt.exec(s);if(!l){o+=s;break}o+=s.substring(0,l.index),s=s.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?o+="\\"+String(Number(l[1])+r):(o+=l[0],l[0]==="("&&n++)}return o}).map(i=>`(${i})`).join(t)}const iSt=/\b\B/,rMe="[a-zA-Z]\\w*",JH="[a-zA-Z_]\\w*",sMe="\\b\\d+(\\.\\d+)?",aMe="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",oMe="\\b(0b[01]+)",rSt="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",sSt=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Kv(t,/.*\b/,e.binary,/\b.*/)),gg({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},e)},TC={begin:"\\\\[\\s\\S]",relevance:0},aSt={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[TC]},oSt={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[TC]},lSt={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},SM=function(e,t,n={}){const i=gg({scope:"comment",begin:e,end:t,contains:[]},n);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const r=YH("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return i.contains.push({begin:Kv(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},cSt=SM("//","$"),uSt=SM("/\\*","\\*/"),dSt=SM("#","$"),fSt={scope:"number",begin:sMe,relevance:0},hSt={scope:"number",begin:aMe,relevance:0},pSt={scope:"number",begin:oMe,relevance:0},mSt={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[TC,{begin:/\[/,end:/\]/,relevance:0,contains:[TC]}]},gSt={scope:"title",begin:rMe,relevance:0},bSt={scope:"title",begin:JH,relevance:0},ySt={begin:"\\.\\s*"+JH,relevance:0},vSt=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})};var A_=Object.freeze({__proto__:null,APOS_STRING_MODE:aSt,BACKSLASH_ESCAPE:TC,BINARY_NUMBER_MODE:pSt,BINARY_NUMBER_RE:oMe,COMMENT:SM,C_BLOCK_COMMENT_MODE:uSt,C_LINE_COMMENT_MODE:cSt,C_NUMBER_MODE:hSt,C_NUMBER_RE:aMe,END_SAME_AS_BEGIN:vSt,HASH_COMMENT_MODE:dSt,IDENT_RE:rMe,MATCH_NOTHING_RE:iSt,METHOD_GUARD:ySt,NUMBER_MODE:fSt,NUMBER_RE:sMe,PHRASAL_WORDS_MODE:lSt,QUOTE_STRING_MODE:oSt,REGEXP_MODE:mSt,RE_STARTERS_RE:rSt,SHEBANG:sSt,TITLE_MODE:gSt,UNDERSCORE_IDENT_RE:JH,UNDERSCORE_TITLE_MODE:bSt});function xSt(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function wSt(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function kSt(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=xSt,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function OSt(e,t){Array.isArray(e.illegal)&&(e.illegal=YH(...e.illegal))}function SSt(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function ESt(e,t){e.relevance===void 0&&(e.relevance=1)}const CSt=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(i=>{delete e[i]}),e.keywords=n.keywords,e.begin=Kv(n.beforeMatch,nMe(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},ASt=["of","and","for","in","not","or","if","then","parent","list","value"],TSt="keyword";function lMe(e,t,n=TSt){const i=Object.create(null);return typeof e=="string"?r(n,e.split(" ")):Array.isArray(e)?r(n,e):Object.keys(e).forEach(function(s){Object.assign(i,lMe(e[s],t,s))}),i;function r(s,o){t&&(o=o.map(l=>l.toLowerCase())),o.forEach(function(l){const c=l.split("|");i[c[0]]=[s,_St(c[0],c[1])]})}}function _St(e,t){return t?Number(t):jSt(e)?0:1}function jSt(e){return ASt.includes(e.toLowerCase())}const rne={},qy=e=>{console.error(e)},sne=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Q0=(e,t)=>{rne[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),rne[`${e}/${t}`]=!0)},CI=new Error;function cMe(e,t,{key:n}){let i=0;const r=e[n],s={},o={};for(let l=1;l<=t.length;l++)o[l+i]=r[l],s[l+i]=!0,i+=iMe(t[l-1]);e[n]=o,e[n]._emit=s,e[n]._multi=!0}function NSt(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw qy("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),CI;if(typeof e.beginScope!="object"||e.beginScope===null)throw qy("beginScope must be object"),CI;cMe(e,e.begin,{key:"beginScope"}),e.begin=ZH(e.begin,{joinWith:""})}}function RSt(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw qy("skip, excludeEnd, returnEnd not compatible with endScope: {}"),CI;if(typeof e.endScope!="object"||e.endScope===null)throw qy("endScope must be object"),CI;cMe(e,e.end,{key:"endScope"}),e.end=ZH(e.end,{joinWith:""})}}function ISt(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function PSt(e){ISt(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),NSt(e),RSt(e)}function DSt(e){function t(o,l){return new RegExp(AC(o),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,l]),this.matchAt+=iMe(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(ZH(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(l);if(!c)return null;const u=c.findIndex((f,h)=>h>0&&f!==void 0),d=this.matchIndexes[u];return c.splice(0,u),Object.assign(c,d)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];const c=new n;return this.rules.slice(l).forEach(([u,d])=>c.addRule(u,d)),c.compile(),this.multiRegexes[l]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,c){this.rules.push([l,c]),c.type==="begin"&&this.count++}exec(l){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let u=c.exec(l);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,u=d.exec(l)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function r(o){const l=new i;return o.contains.forEach(c=>l.addRule(c.begin,{rule:c,type:"begin"})),o.terminatorEnd&&l.addRule(o.terminatorEnd,{type:"end"}),o.illegal&&l.addRule(o.illegal,{type:"illegal"}),l}function s(o,l){const c=o;if(o.isCompiled)return c;[wSt,SSt,PSt,CSt].forEach(d=>d(o,l)),e.compilerExtensions.forEach(d=>d(o,l)),o.__beforeBegin=null,[kSt,OSt,ESt].forEach(d=>d(o,l)),o.isCompiled=!0;let u=null;return typeof o.keywords=="object"&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),u=o.keywords.$pattern,delete o.keywords.$pattern),u=u||/\w+/,o.keywords&&(o.keywords=lMe(o.keywords,e.case_insensitive)),c.keywordPatternRe=t(u,!0),l&&(o.begin||(o.begin=/\B|\b/),c.beginRe=t(c.begin),!o.end&&!o.endsWithParent&&(o.end=/\B|\b/),o.end&&(c.endRe=t(c.end)),c.terminatorEnd=AC(c.end)||"",o.endsWithParent&&l.terminatorEnd&&(c.terminatorEnd+=(o.end?"|":"")+l.terminatorEnd)),o.illegal&&(c.illegalRe=t(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(d){return MSt(d==="self"?o:d)})),o.contains.forEach(function(d){s(d,c)}),o.starts&&s(o.starts,l),c.matcher=r(c),c}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=gg(e.classNameAliases||{}),s(e)}function uMe(e){return e?e.endsWithParent||uMe(e.starts):!1}function MSt(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return gg(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:uMe(e)?gg(e,{starts:e.starts?gg(e.starts):null}):Object.isFrozen(e)?gg(e):e}var LSt="11.11.1";class $St extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const T4=tMe,ane=gg,one=Symbol("nomatch"),FSt=7,dMe=function(e){const t=Object.create(null),n=Object.create(null),i=[];let r=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",o={disableAutodetect:!0,name:"Plain text",contains:[]};let l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:YOt};function c(D){return l.noHighlightRe.test(D)}function u(D){let _=D.className+" ";_+=D.parentNode?D.parentNode.className:"";const L=l.languageDetectRe.exec(_);if(L){const F=E(L[1]);return F||(sne(s.replace("{}",L[1])),sne("Falling back to no-highlight mode for this block.",D)),F?L[1]:"no-highlight"}return _.split(/\s+/).find(F=>c(F)||E(F))}function d(D,_,L){let F="",M="";typeof _=="object"?(F=D,L=_.ignoreIllegals,M=_.language):(Q0("10.7.0","highlight(lang, code, ...args) has been deprecated."),Q0("10.7.0",`Please use highlight(code, options) instead. +https://github.com/highlightjs/highlight.js/issues/2277`),M=D,F=_),L===void 0&&(L=!0);const H={code:F,language:M};P("before:highlight",H);const q=H.result?H.result:f(H.language,H.code,L);return q.code=H.code,P("after:highlight",q),q}function f(D,_,L,F){const M=Object.create(null);function H(ue,be){return ue.keywords[be]}function q(){if(!ge.keywords){xe.addText(Pe);return}let ue=0;ge.keywordPatternRe.lastIndex=0;let be=ge.keywordPatternRe.exec(Pe),Ce="";for(;be;){Ce+=Pe.substring(ue,be.index);const Ee=ee.case_insensitive?be[0].toLowerCase():be[0],Ve=H(ge,Ee);if(Ve){const[Ge,ye]=Ve;if(xe.addText(Ce),Ce="",M[Ee]=(M[Ee]||0)+1,M[Ee]<=FSt&&(Ue+=ye),Ge.startsWith("_"))Ce+=be[0];else{const oe=ee.classNameAliases[Ge]||Ge;z(be[0],oe)}}else Ce+=be[0];ue=ge.keywordPatternRe.lastIndex,be=ge.keywordPatternRe.exec(Pe)}Ce+=Pe.substring(ue),xe.addText(Ce)}function U(){if(Pe==="")return;let ue=null;if(typeof ge.subLanguage=="string"){if(!t[ge.subLanguage]){xe.addText(Pe);return}ue=f(ge.subLanguage,Pe,!0,Se[ge.subLanguage]),Se[ge.subLanguage]=ue._top}else ue=m(Pe,ge.subLanguage.length?ge.subLanguage:null);ge.relevance>0&&(Ue+=ue.relevance),xe.__addSublanguage(ue._emitter,ue.language)}function Z(){ge.subLanguage!=null?U():q(),Pe=""}function z(ue,be){ue!==""&&(xe.startScope(be),xe.addText(ue),xe.endScope())}function J(ue,be){let Ce=1;const Ee=be.length-1;for(;Ce<=Ee;){if(!ue._emit[Ce]){Ce++;continue}const Ve=ee.classNameAliases[ue[Ce]]||ue[Ce],Ge=be[Ce];Ve?z(Ge,Ve):(Pe=Ge,q(),Pe=""),Ce++}}function ne(ue,be){return ue.scope&&typeof ue.scope=="string"&&xe.openNode(ee.classNameAliases[ue.scope]||ue.scope),ue.beginScope&&(ue.beginScope._wrap?(z(Pe,ee.classNameAliases[ue.beginScope._wrap]||ue.beginScope._wrap),Pe=""):ue.beginScope._multi&&(J(ue.beginScope,be),Pe="")),ge=Object.create(ue,{parent:{value:ge}}),ge}function W(ue,be,Ce){let Ee=tSt(ue.endRe,Ce);if(Ee){if(ue["on:end"]){const Ve=new tne(ue);ue["on:end"](be,Ve),Ve.isMatchIgnored&&(Ee=!1)}if(Ee){for(;ue.endsParent&&ue.parent;)ue=ue.parent;return ue}}if(ue.endsWithParent)return W(ue.parent,be,Ce)}function X(ue){return ge.matcher.regexIndex===0?(Pe+=ue[0],1):(re=!0,0)}function ce(ue){const be=ue[0],Ce=ue.rule,Ee=new tne(Ce),Ve=[Ce.__beforeBegin,Ce["on:begin"]];for(const Ge of Ve)if(Ge&&(Ge(ue,Ee),Ee.isMatchIgnored))return X(be);return Ce.skip?Pe+=be:(Ce.excludeBegin&&(Pe+=be),Z(),!Ce.returnBegin&&!Ce.excludeBegin&&(Pe=be)),ne(Ce,ue),Ce.returnBegin?0:be.length}function V(ue){const be=ue[0],Ce=_.substring(ue.index),Ee=W(ge,ue,Ce);if(!Ee)return one;const Ve=ge;ge.endScope&&ge.endScope._wrap?(Z(),z(be,ge.endScope._wrap)):ge.endScope&&ge.endScope._multi?(Z(),J(ge.endScope,ue)):Ve.skip?Pe+=be:(Ve.returnEnd||Ve.excludeEnd||(Pe+=be),Z(),Ve.excludeEnd&&(Pe=be));do ge.scope&&xe.closeNode(),!ge.skip&&!ge.subLanguage&&(Ue+=ge.relevance),ge=ge.parent;while(ge!==Ee.parent);return Ee.starts&&ne(Ee.starts,ue),Ve.returnEnd?0:be.length}function Y(){const ue=[];for(let be=ge;be!==ee;be=be.parent)be.scope&&ue.unshift(be.scope);ue.forEach(be=>xe.openNode(be))}let K={};function de(ue,be){const Ce=be&&be[0];if(Pe+=ue,Ce==null)return Z(),0;if(K.type==="begin"&&be.type==="end"&&K.index===be.index&&Ce===""){if(Pe+=_.slice(be.index,be.index+1),!r){const Ee=new Error(`0 width match regex (${D})`);throw Ee.languageName=D,Ee.badRule=K.rule,Ee}return 1}if(K=be,be.type==="begin")return ce(be);if(be.type==="illegal"&&!L){const Ee=new Error('Illegal lexeme "'+Ce+'" for mode "'+(ge.scope||"")+'"');throw Ee.mode=ge,Ee}else if(be.type==="end"){const Ee=V(be);if(Ee!==one)return Ee}if(be.type==="illegal"&&Ce==="")return Pe+=` +`,1;if(Me>1e5&&Me>be.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Pe+=Ce,Ce.length}const ee=E(D);if(!ee)throw qy(s.replace("{}",D)),new Error('Unknown language: "'+D+'"');const Oe=DSt(ee);let he="",ge=F||Oe;const Se={},xe=new l.__emitter(l);Y();let Pe="",Ue=0,Ke=0,Me=0,re=!1;try{if(ee.__emitTokens)ee.__emitTokens(_,xe);else{for(ge.matcher.considerAll();;){Me++,re?re=!1:ge.matcher.considerAll(),ge.matcher.lastIndex=Ke;const ue=ge.matcher.exec(_);if(!ue)break;const be=_.substring(Ke,ue.index),Ce=de(be,ue);Ke=ue.index+Ce}de(_.substring(Ke))}return xe.finalize(),he=xe.toHTML(),{language:D,value:he,relevance:Ue,illegal:!1,_emitter:xe,_top:ge}}catch(ue){if(ue.message&&ue.message.includes("Illegal"))return{language:D,value:T4(_),illegal:!0,relevance:0,_illegalBy:{message:ue.message,index:Ke,context:_.slice(Ke-100,Ke+100),mode:ue.mode,resultSoFar:he},_emitter:xe};if(r)return{language:D,value:T4(_),illegal:!1,relevance:0,errorRaised:ue,_emitter:xe,_top:ge};throw ue}}function h(D){const _={value:T4(D),illegal:!1,relevance:0,_top:o,_emitter:new l.__emitter(l)};return _._emitter.addText(D),_}function m(D,_){_=_||l.languages||Object.keys(t);const L=h(D),F=_.filter(E).filter(T).map(Z=>f(Z,D,!1));F.unshift(L);const M=F.sort((Z,z)=>{if(Z.relevance!==z.relevance)return z.relevance-Z.relevance;if(Z.language&&z.language){if(E(Z.language).supersetOf===z.language)return 1;if(E(z.language).supersetOf===Z.language)return-1}return 0}),[H,q]=M,U=H;return U.secondBest=q,U}function g(D,_,L){const F=_&&n[_]||L;D.classList.add("hljs"),D.classList.add(`language-${F}`)}function b(D){let _=null;const L=u(D);if(c(L))return;if(P("before:highlightElement",{el:D,language:L}),D.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",D);return}if(D.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(D)),l.throwUnescapedHTML))throw new $St("One of your code blocks includes unescaped HTML.",D.innerHTML);_=D;const F=_.textContent,M=L?d(F,{language:L,ignoreIllegals:!0}):m(F);D.innerHTML=M.value,D.dataset.highlighted="yes",g(D,L,M.language),D.result={language:M.language,re:M.relevance,relevance:M.relevance},M.secondBest&&(D.secondBest={language:M.secondBest.language,relevance:M.secondBest.relevance}),P("after:highlightElement",{el:D,result:M,text:F})}function v(D){l=ane(l,D)}const y=()=>{k(),Q0("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function w(){k(),Q0("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let x=!1;function k(){function D(){k()}if(document.readyState==="loading"){x||window.addEventListener("DOMContentLoaded",D,!1),x=!0;return}document.querySelectorAll(l.cssSelector).forEach(b)}function S(D,_){let L=null;try{L=_(e)}catch(F){if(qy("Language definition for '{}' could not be registered.".replace("{}",D)),r)qy(F);else throw F;L=o}L.name||(L.name=D),t[D]=L,L.rawDefinition=_.bind(null,e),L.aliases&&j(L.aliases,{languageName:D})}function O(D){delete t[D];for(const _ of Object.keys(n))n[_]===D&&delete n[_]}function A(){return Object.keys(t)}function E(D){return D=(D||"").toLowerCase(),t[D]||t[n[D]]}function j(D,{languageName:_}){typeof D=="string"&&(D=[D]),D.forEach(L=>{n[L.toLowerCase()]=_})}function T(D){const _=E(D);return _&&!_.disableAutodetect}function R(D){D["before:highlightBlock"]&&!D["before:highlightElement"]&&(D["before:highlightElement"]=_=>{D["before:highlightBlock"](Object.assign({block:_.el},_))}),D["after:highlightBlock"]&&!D["after:highlightElement"]&&(D["after:highlightElement"]=_=>{D["after:highlightBlock"](Object.assign({block:_.el},_))})}function C(D){R(D),i.push(D)}function N(D){const _=i.indexOf(D);_!==-1&&i.splice(_,1)}function P(D,_){const L=D;i.forEach(function(F){F[L]&&F[L](_)})}function I(D){return Q0("10.7.0","highlightBlock will be removed entirely in v12.0"),Q0("10.7.0","Please use highlightElement now."),b(D)}Object.assign(e,{highlight:d,highlightAuto:m,highlightAll:k,highlightElement:b,highlightBlock:I,configure:v,initHighlighting:y,initHighlightingOnLoad:w,registerLanguage:S,unregisterLanguage:O,listLanguages:A,getLanguage:E,registerAliases:j,autoDetection:T,inherit:ane,addPlugin:C,removePlugin:N}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString=LSt,e.regex={concat:Kv,lookahead:nMe,either:YH,optional:JOt,anyNumberOfTimes:ZOt};for(const D in A_)typeof A_[D]=="object"&&eMe(A_[D]);return Object.assign(e,A_),e},o1=dMe({});o1.newInstance=()=>dMe({});var BSt=o1;o1.HighlightJS=o1;o1.default=o1;const cl=N1(BSt),lne={},USt="hljs-";function QSt(e){const t=cl.newInstance();return e&&s(e),{highlight:n,highlightAuto:i,listLanguages:r,register:s,registerAlias:o,registered:l};function n(c,u,d){const f=d||lne,h=typeof f.prefix=="string"?f.prefix:USt;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:zSt,classPrefix:h});const m=t.highlight(u,{ignoreIllegals:!0,language:c});if(m.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:m.errorRaised});const g=m._emitter.root,b=g.data;return b.language=m.language,b.relevance=m.relevance,g}function i(c,u){const f=(u||lne).subset||r();let h=-1,m=0,g;for(;++hm&&(m=v.data.relevance,g=v)}return g||{type:"root",children:[],data:{language:void 0,relevance:m}}}function r(){return t.listLanguages()}function s(c,u){if(typeof c=="string")t.registerLanguage(c,u);else{let d;for(d in c)Object.hasOwn(c,d)&&t.registerLanguage(d,c[d])}}function o(c,u){if(typeof c=="string")t.registerAliases(typeof u=="string"?u:[...u],{languageName:c});else{let d;for(d in c)if(Object.hasOwn(c,d)){const f=c[d];t.registerAliases(typeof f=="string"?f:[...f],{languageName:d})}}}function l(c){return!!t.getLanguage(c)}}class zSt{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],i=n.children[n.children.length-1];i&&i.type==="text"?i.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const i=this.stack[this.stack.length-1],r=t.root.children;n?i.children.push({type:"element",tagName:"span",properties:{className:[n]},children:r}):i.children.push(...r)}openNode(t){const n=this,i=t.split(".").map(function(o,l){return l?o+"_".repeat(l):n.options.classPrefix+o}),r=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:i},children:[]};r.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const VSt={};function cne(e){const t=e||VSt,n=t.aliases,i=t.detect||!1,r=t.languages||WOt,s=t.plainText,o=t.prefix,l=t.subset;let c="hljs";const u=QSt(r);if(n&&u.registerAlias(n),o){const d=o.indexOf("-");c=d===-1?o:o.slice(0,d)}return function(d,f){yT(d,"element",function(h,m,g){if(h.tagName!=="code"||!g||g.type!=="element"||g.tagName!=="pre")return;const b=HSt(h);if(b===!1||!b&&!i||b&&s&&s.includes(b))return;Array.isArray(h.properties.className)||(h.properties.className=[]),h.properties.className.includes(c)||h.properties.className.unshift(c);const v=$kt(h,{whitespace:"pre"});let y;try{y=b?u.highlight(b,v,{prefix:o}):u.highlightAuto(v,{prefix:o,subset:l})}catch(w){const x=w;if(b&&/Unknown language/.test(x.message)){f.message("Cannot highlight as `"+b+"`, it’s not registered",{ancestors:[g,h],cause:x,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw x}!b&&y.data&&y.data.language&&h.properties.className.push("language-"+y.data.language),y.children.length>0&&(h.children=y.children)})}}function HSt(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let i;for(;++n-1&&s<=t.length){let o=0;for(;;){let l=n[o];if(l===void 0){const c=fne(t,n[o-1]);l=c===-1?t.length+1:c+1,n[o]=l}if(l>s)return{line:o+1,column:s-(o>0?n[o-1]:0)+1,offset:s};o++}}}function r(s){if(s&&typeof s.line=="number"&&typeof s.column=="number"&&!Number.isNaN(s.line)&&!Number.isNaN(s.column)){for(;n.length1?n[s.line-2]:0)+s.column-1;if(o=55296&&e<=57343}function bEt(e){return e>=56320&&e<=57343}function yEt(e,t){return(e-55296)*1024+9216+t}function bMe(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function yMe(e){return e>=64976&&e<=65007||gEt.has(e)}var ht;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(ht||(ht={}));const vEt=65536;class xEt{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=vEt,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:i,col:r,offset:s}=this,o=r+n,l=s+n;return{code:t,startLine:i,endLine:i,startCol:o,endCol:o,startOffset:l,endOffset:l}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(bEt(n))return this.pos++,this._addGap(),yEt(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,ke.EOF;return this._err(ht.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let i=0;i=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,ke.EOF;const i=this.html.charCodeAt(n);return i===ke.CARRIAGE_RETURN?ke.LINE_FEED:i}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,ke.EOF;let t=this.html.charCodeAt(this.pos);return t===ke.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,ke.LINE_FEED):t===ke.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,gMe(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===ke.LINE_FEED||t===ke.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){bMe(t)?this._err(ht.controlCharacterInInputStream):yMe(t)&&this._err(ht.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const wEt=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),kEt=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function OEt(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=kEt.get(e))!==null&&t!==void 0?t:e}var Po;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Po||(Po={}));const SEt=32;var bg;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(bg||(bg={}));function YB(e){return e>=Po.ZERO&&e<=Po.NINE}function EEt(e){return e>=Po.UPPER_A&&e<=Po.UPPER_F||e>=Po.LOWER_A&&e<=Po.LOWER_F}function CEt(e){return e>=Po.UPPER_A&&e<=Po.UPPER_Z||e>=Po.LOWER_A&&e<=Po.LOWER_Z||YB(e)}function AEt(e){return e===Po.EQUALS||CEt(e)}var Ao;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Ao||(Ao={}));var xp;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(xp||(xp={}));class TEt{constructor(t,n,i){this.decodeTree=t,this.emitCodePoint=n,this.errors=i,this.state=Ao.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=xp.Strict}startEntity(t){this.decodeMode=t,this.state=Ao.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Ao.EntityStart:return t.charCodeAt(n)===Po.NUM?(this.state=Ao.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Ao.NamedEntity,this.stateNamedEntity(t,n));case Ao.NumericStart:return this.stateNumericStart(t,n);case Ao.NumericDecimal:return this.stateNumericDecimal(t,n);case Ao.NumericHex:return this.stateNumericHex(t,n);case Ao.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|SEt)===Po.LOWER_X?(this.state=Ao.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Ao.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,i,r){if(n!==i){const s=i-n;this.result=this.result*Math.pow(r,s)+Number.parseInt(t.substr(n,s),r),this.consumed+=s}}stateNumericHex(t,n){const i=n;for(;n>14;for(;n>14,s!==0){if(o===Po.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==xp.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:i}=this,r=(i[n]&bg.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,r,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,i){const{decodeTree:r}=this;return this.emitCodePoint(n===1?r[t]&~bg.VALUE_LENGTH:r[t+1],i),n===3&&this.emitCodePoint(r[t+2],i),i}end(){var t;switch(this.state){case Ao.NamedEntity:return this.result!==0&&(this.decodeMode!==xp.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Ao.NumericDecimal:return this.emitNumericEntity(0,2);case Ao.NumericHex:return this.emitNumericEntity(0,3);case Ao.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Ao.EntityStart:return 0}}}function _Et(e,t,n,i){const r=(t&bg.BRANCH_LENGTH)>>7,s=t&bg.JUMP_TABLE;if(r===0)return s!==0&&i===s?n:-1;if(s){const c=i-s;return c<0||c>=r?-1:e[n+c]-1}let o=n,l=o+r-1;for(;o<=l;){const c=o+l>>>1,u=e[c];if(ui)l=c-1;else return e[c+r]}return-1}var jt;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(jt||(jt={}));var Wy;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Wy||(Wy={}));var ad;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(ad||(ad={}));var et;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(et||(et={}));var B;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(B||(B={}));const jEt=new Map([[et.A,B.A],[et.ADDRESS,B.ADDRESS],[et.ANNOTATION_XML,B.ANNOTATION_XML],[et.APPLET,B.APPLET],[et.AREA,B.AREA],[et.ARTICLE,B.ARTICLE],[et.ASIDE,B.ASIDE],[et.B,B.B],[et.BASE,B.BASE],[et.BASEFONT,B.BASEFONT],[et.BGSOUND,B.BGSOUND],[et.BIG,B.BIG],[et.BLOCKQUOTE,B.BLOCKQUOTE],[et.BODY,B.BODY],[et.BR,B.BR],[et.BUTTON,B.BUTTON],[et.CAPTION,B.CAPTION],[et.CENTER,B.CENTER],[et.CODE,B.CODE],[et.COL,B.COL],[et.COLGROUP,B.COLGROUP],[et.DD,B.DD],[et.DESC,B.DESC],[et.DETAILS,B.DETAILS],[et.DIALOG,B.DIALOG],[et.DIR,B.DIR],[et.DIV,B.DIV],[et.DL,B.DL],[et.DT,B.DT],[et.EM,B.EM],[et.EMBED,B.EMBED],[et.FIELDSET,B.FIELDSET],[et.FIGCAPTION,B.FIGCAPTION],[et.FIGURE,B.FIGURE],[et.FONT,B.FONT],[et.FOOTER,B.FOOTER],[et.FOREIGN_OBJECT,B.FOREIGN_OBJECT],[et.FORM,B.FORM],[et.FRAME,B.FRAME],[et.FRAMESET,B.FRAMESET],[et.H1,B.H1],[et.H2,B.H2],[et.H3,B.H3],[et.H4,B.H4],[et.H5,B.H5],[et.H6,B.H6],[et.HEAD,B.HEAD],[et.HEADER,B.HEADER],[et.HGROUP,B.HGROUP],[et.HR,B.HR],[et.HTML,B.HTML],[et.I,B.I],[et.IMG,B.IMG],[et.IMAGE,B.IMAGE],[et.INPUT,B.INPUT],[et.IFRAME,B.IFRAME],[et.KEYGEN,B.KEYGEN],[et.LABEL,B.LABEL],[et.LI,B.LI],[et.LINK,B.LINK],[et.LISTING,B.LISTING],[et.MAIN,B.MAIN],[et.MALIGNMARK,B.MALIGNMARK],[et.MARQUEE,B.MARQUEE],[et.MATH,B.MATH],[et.MENU,B.MENU],[et.META,B.META],[et.MGLYPH,B.MGLYPH],[et.MI,B.MI],[et.MO,B.MO],[et.MN,B.MN],[et.MS,B.MS],[et.MTEXT,B.MTEXT],[et.NAV,B.NAV],[et.NOBR,B.NOBR],[et.NOFRAMES,B.NOFRAMES],[et.NOEMBED,B.NOEMBED],[et.NOSCRIPT,B.NOSCRIPT],[et.OBJECT,B.OBJECT],[et.OL,B.OL],[et.OPTGROUP,B.OPTGROUP],[et.OPTION,B.OPTION],[et.P,B.P],[et.PARAM,B.PARAM],[et.PLAINTEXT,B.PLAINTEXT],[et.PRE,B.PRE],[et.RB,B.RB],[et.RP,B.RP],[et.RT,B.RT],[et.RTC,B.RTC],[et.RUBY,B.RUBY],[et.S,B.S],[et.SCRIPT,B.SCRIPT],[et.SEARCH,B.SEARCH],[et.SECTION,B.SECTION],[et.SELECT,B.SELECT],[et.SOURCE,B.SOURCE],[et.SMALL,B.SMALL],[et.SPAN,B.SPAN],[et.STRIKE,B.STRIKE],[et.STRONG,B.STRONG],[et.STYLE,B.STYLE],[et.SUB,B.SUB],[et.SUMMARY,B.SUMMARY],[et.SUP,B.SUP],[et.TABLE,B.TABLE],[et.TBODY,B.TBODY],[et.TEMPLATE,B.TEMPLATE],[et.TEXTAREA,B.TEXTAREA],[et.TFOOT,B.TFOOT],[et.TD,B.TD],[et.TH,B.TH],[et.THEAD,B.THEAD],[et.TITLE,B.TITLE],[et.TR,B.TR],[et.TRACK,B.TRACK],[et.TT,B.TT],[et.U,B.U],[et.UL,B.UL],[et.SVG,B.SVG],[et.VAR,B.VAR],[et.WBR,B.WBR],[et.XMP,B.XMP]]);function ok(e){var t;return(t=jEt.get(e))!==null&&t!==void 0?t:B.UNKNOWN}const Lt=B,NEt={[jt.HTML]:new Set([Lt.ADDRESS,Lt.APPLET,Lt.AREA,Lt.ARTICLE,Lt.ASIDE,Lt.BASE,Lt.BASEFONT,Lt.BGSOUND,Lt.BLOCKQUOTE,Lt.BODY,Lt.BR,Lt.BUTTON,Lt.CAPTION,Lt.CENTER,Lt.COL,Lt.COLGROUP,Lt.DD,Lt.DETAILS,Lt.DIR,Lt.DIV,Lt.DL,Lt.DT,Lt.EMBED,Lt.FIELDSET,Lt.FIGCAPTION,Lt.FIGURE,Lt.FOOTER,Lt.FORM,Lt.FRAME,Lt.FRAMESET,Lt.H1,Lt.H2,Lt.H3,Lt.H4,Lt.H5,Lt.H6,Lt.HEAD,Lt.HEADER,Lt.HGROUP,Lt.HR,Lt.HTML,Lt.IFRAME,Lt.IMG,Lt.INPUT,Lt.LI,Lt.LINK,Lt.LISTING,Lt.MAIN,Lt.MARQUEE,Lt.MENU,Lt.META,Lt.NAV,Lt.NOEMBED,Lt.NOFRAMES,Lt.NOSCRIPT,Lt.OBJECT,Lt.OL,Lt.P,Lt.PARAM,Lt.PLAINTEXT,Lt.PRE,Lt.SCRIPT,Lt.SECTION,Lt.SELECT,Lt.SOURCE,Lt.STYLE,Lt.SUMMARY,Lt.TABLE,Lt.TBODY,Lt.TD,Lt.TEMPLATE,Lt.TEXTAREA,Lt.TFOOT,Lt.TH,Lt.THEAD,Lt.TITLE,Lt.TR,Lt.TRACK,Lt.UL,Lt.WBR,Lt.XMP]),[jt.MATHML]:new Set([Lt.MI,Lt.MO,Lt.MN,Lt.MS,Lt.MTEXT,Lt.ANNOTATION_XML]),[jt.SVG]:new Set([Lt.TITLE,Lt.FOREIGN_OBJECT,Lt.DESC]),[jt.XLINK]:new Set,[jt.XML]:new Set,[jt.XMLNS]:new Set},ZB=new Set([Lt.H1,Lt.H2,Lt.H3,Lt.H4,Lt.H5,Lt.H6]);et.STYLE,et.SCRIPT,et.XMP,et.IFRAME,et.NOEMBED,et.NOFRAMES,et.PLAINTEXT;var Te;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(Te||(Te={}));const Ta={DATA:Te.DATA,RCDATA:Te.RCDATA,RAWTEXT:Te.RAWTEXT,SCRIPT_DATA:Te.SCRIPT_DATA,PLAINTEXT:Te.PLAINTEXT,CDATA_SECTION:Te.CDATA_SECTION};function REt(e){return e>=ke.DIGIT_0&&e<=ke.DIGIT_9}function mS(e){return e>=ke.LATIN_CAPITAL_A&&e<=ke.LATIN_CAPITAL_Z}function IEt(e){return e>=ke.LATIN_SMALL_A&&e<=ke.LATIN_SMALL_Z}function Qm(e){return IEt(e)||mS(e)}function pne(e){return Qm(e)||REt(e)}function T_(e){return e+32}function xMe(e){return e===ke.SPACE||e===ke.LINE_FEED||e===ke.TABULATION||e===ke.FORM_FEED}function mne(e){return xMe(e)||e===ke.SOLIDUS||e===ke.GREATER_THAN_SIGN}function PEt(e){return e===ke.NULL?ht.nullCharacterReference:e>1114111?ht.characterReferenceOutsideUnicodeRange:gMe(e)?ht.surrogateCharacterReference:yMe(e)?ht.noncharacterCharacterReference:bMe(e)||e===ke.CARRIAGE_RETURN?ht.controlCharacterReference:null}class DEt{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=Te.DATA,this.returnState=Te.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new xEt(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new TEt(wEt,(i,r)=>{this.preprocessor.pos=this.entityStartPos+r-1,this._flushCodePointConsumedAsCharacterReference(i)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(ht.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:i=>{this._err(ht.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+i)},validateNumericCharacterReference:i=>{const r=PEt(i);r&&this._err(r,1)}}:void 0)}_err(t,n=0){var i,r;(r=(i=this.handler).onParseError)===null||r===void 0||r.call(i,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,n,i){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||i==null||i()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n0&&this._err(ht.endTagWithAttributes),t.selfClosing&&this._err(ht.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case zi.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case zi.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case zi.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:zi.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=xMe(t)?zi.WHITESPACE_CHARACTER:t===ke.NULL?zi.NULL_CHARACTER:zi.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(zi.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=Te.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?xp.Attribute:xp.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===Te.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Te.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Te.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case Te.DATA:{this._stateData(t);break}case Te.RCDATA:{this._stateRcdata(t);break}case Te.RAWTEXT:{this._stateRawtext(t);break}case Te.SCRIPT_DATA:{this._stateScriptData(t);break}case Te.PLAINTEXT:{this._statePlaintext(t);break}case Te.TAG_OPEN:{this._stateTagOpen(t);break}case Te.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case Te.TAG_NAME:{this._stateTagName(t);break}case Te.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case Te.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case Te.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case Te.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case Te.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case Te.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case Te.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case Te.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case Te.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case Te.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case Te.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case Te.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case Te.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case Te.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case Te.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case Te.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case Te.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case Te.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case Te.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case Te.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case Te.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case Te.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case Te.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case Te.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case Te.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case Te.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case Te.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case Te.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case Te.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case Te.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case Te.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case Te.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case Te.BOGUS_COMMENT:{this._stateBogusComment(t);break}case Te.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case Te.COMMENT_START:{this._stateCommentStart(t);break}case Te.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case Te.COMMENT:{this._stateComment(t);break}case Te.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case Te.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case Te.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case Te.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case Te.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case Te.COMMENT_END:{this._stateCommentEnd(t);break}case Te.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case Te.DOCTYPE:{this._stateDoctype(t);break}case Te.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case Te.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case Te.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case Te.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case Te.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case Te.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case Te.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case Te.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case Te.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case Te.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case Te.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case Te.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case Te.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case Te.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case Te.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case Te.CDATA_SECTION:{this._stateCdataSection(t);break}case Te.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case Te.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case Te.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case Te.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case ke.LESS_THAN_SIGN:{this.state=Te.TAG_OPEN;break}case ke.AMPERSAND:{this._startCharacterReference();break}case ke.NULL:{this._err(ht.unexpectedNullCharacter),this._emitCodePoint(t);break}case ke.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case ke.AMPERSAND:{this._startCharacterReference();break}case ke.LESS_THAN_SIGN:{this.state=Te.RCDATA_LESS_THAN_SIGN;break}case ke.NULL:{this._err(ht.unexpectedNullCharacter),this._emitChars(Fs);break}case ke.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case ke.LESS_THAN_SIGN:{this.state=Te.RAWTEXT_LESS_THAN_SIGN;break}case ke.NULL:{this._err(ht.unexpectedNullCharacter),this._emitChars(Fs);break}case ke.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case ke.LESS_THAN_SIGN:{this.state=Te.SCRIPT_DATA_LESS_THAN_SIGN;break}case ke.NULL:{this._err(ht.unexpectedNullCharacter),this._emitChars(Fs);break}case ke.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case ke.NULL:{this._err(ht.unexpectedNullCharacter),this._emitChars(Fs);break}case ke.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Qm(t))this._createStartTagToken(),this.state=Te.TAG_NAME,this._stateTagName(t);else switch(t){case ke.EXCLAMATION_MARK:{this.state=Te.MARKUP_DECLARATION_OPEN;break}case ke.SOLIDUS:{this.state=Te.END_TAG_OPEN;break}case ke.QUESTION_MARK:{this._err(ht.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Te.BOGUS_COMMENT,this._stateBogusComment(t);break}case ke.EOF:{this._err(ht.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(ht.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=Te.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Qm(t))this._createEndTagToken(),this.state=Te.TAG_NAME,this._stateTagName(t);else switch(t){case ke.GREATER_THAN_SIGN:{this._err(ht.missingEndTagName),this.state=Te.DATA;break}case ke.EOF:{this._err(ht.eofBeforeTagName),this._emitChars("");break}case ke.NULL:{this._err(ht.unexpectedNullCharacter),this.state=Te.SCRIPT_DATA_ESCAPED,this._emitChars(Fs);break}case ke.EOF:{this._err(ht.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Te.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===ke.SOLIDUS?this.state=Te.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Qm(t)?(this._emitChars("<"),this.state=Te.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=Te.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Qm(t)?(this.state=Te.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case ke.NULL:{this._err(ht.unexpectedNullCharacter),this.state=Te.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Fs);break}case ke.EOF:{this._err(ht.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Te.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===ke.SOLIDUS?(this.state=Te.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=Te.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(bc.SCRIPT,!1)&&mne(this.preprocessor.peek(bc.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const i=this._indexOf(t);this.items[i]=n,i===this.stackTop&&(this.current=n)}insertAfter(t,n,i){const r=this._indexOf(t)+1;this.items.splice(r,0,n),this.tagIDs.splice(r,0,i),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==jt.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop=0;i--)if(t.has(this.tagIDs[i])&&this.treeAdapter.getNamespaceURI(this.items[i])===n)return i;return-1}clearBackTo(t,n){const i=this._indexOfTagNames(t,n);this.shortenToLength(i+1)}clearBackToTableContext(){this.clearBackTo(BEt,jt.HTML)}clearBackToTableBodyContext(){this.clearBackTo(FEt,jt.HTML)}clearBackToTableRowContext(){this.clearBackTo($Et,jt.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===B.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===B.HTML}hasInDynamicScope(t,n){for(let i=this.stackTop;i>=0;i--){const r=this.tagIDs[i];switch(this.treeAdapter.getNamespaceURI(this.items[i])){case jt.HTML:{if(r===t)return!0;if(n.has(r))return!1;break}case jt.SVG:{if(yne.has(r))return!1;break}case jt.MATHML:{if(bne.has(r))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,AI)}hasInListItemScope(t){return this.hasInDynamicScope(t,MEt)}hasInButtonScope(t){return this.hasInDynamicScope(t,LEt)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case jt.HTML:{if(ZB.has(n))return!0;if(AI.has(n))return!1;break}case jt.SVG:{if(yne.has(n))return!1;break}case jt.MATHML:{if(bne.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===jt.HTML)switch(this.tagIDs[n]){case t:return!0;case B.TABLE:case B.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===jt.HTML)switch(this.tagIDs[t]){case B.TBODY:case B.THEAD:case B.TFOOT:return!0;case B.TABLE:case B.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===jt.HTML)switch(this.tagIDs[n]){case t:return!0;case B.OPTION:case B.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&wMe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&gne.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&gne.has(this.currentTagId);)this.pop()}}const _4=3;var Gf;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Gf||(Gf={}));const vne={type:Gf.Marker};class zEt{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const i=[],r=n.length,s=this.treeAdapter.getTagName(t),o=this.treeAdapter.getNamespaceURI(t);for(let l=0;l[o.name,o.value]));let s=0;for(let o=0;or.get(c.name)===c.value)&&(s+=1,s>=_4&&this.entries.splice(l.idx,1))}}insertMarker(){this.entries.unshift(vne)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Gf.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const i=this.entries.indexOf(this.bookmark);this.entries.splice(i,0,{type:Gf.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(vne);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(i=>i.type===Gf.Marker||this.treeAdapter.getTagName(i.element)===t);return n&&n.type===Gf.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Gf.Element&&n.element===t)}}const zm={createDocument(){return{nodeName:"#document",mode:ad.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const i=e.childNodes.indexOf(n);e.childNodes.splice(i,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,i){const r=e.childNodes.find(s=>s.nodeName==="#documentType");if(r)r.name=t,r.publicId=n,r.systemId=i;else{const s={nodeName:"#documentType",name:t,publicId:n,systemId:i,parentNode:null};zm.appendChild(e,s)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(zm.isTextNode(n)){n.value+=t;return}}zm.appendChild(e,zm.createTextNode(t))},insertTextBefore(e,t,n){const i=e.childNodes[e.childNodes.indexOf(n)-1];i&&zm.isTextNode(i)?i.value+=t:zm.insertBefore(e,zm.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(i=>i.name));for(let i=0;ie.startsWith(n))}function GEt(e){return e.name===kMe&&e.publicId===null&&(e.systemId===null||e.systemId===VEt)}function XEt(e){if(e.name!==kMe)return ad.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===HEt)return ad.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),WEt.has(n))return ad.QUIRKS;let i=t===null?qEt:OMe;if(xne(n,i))return ad.QUIRKS;if(i=t===null?SMe:KEt,xne(n,i))return ad.LIMITED_QUIRKS}return ad.NO_QUIRKS}const wne={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},YEt="definitionurl",ZEt="definitionURL",JEt=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),eCt=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:jt.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:jt.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:jt.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:jt.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:jt.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:jt.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:jt.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:jt.XML}],["xml:space",{prefix:"xml",name:"space",namespace:jt.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:jt.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:jt.XMLNS}]]),tCt=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),nCt=new Set([B.B,B.BIG,B.BLOCKQUOTE,B.BODY,B.BR,B.CENTER,B.CODE,B.DD,B.DIV,B.DL,B.DT,B.EM,B.EMBED,B.H1,B.H2,B.H3,B.H4,B.H5,B.H6,B.HEAD,B.HR,B.I,B.IMG,B.LI,B.LISTING,B.MENU,B.META,B.NOBR,B.OL,B.P,B.PRE,B.RUBY,B.S,B.SMALL,B.SPAN,B.STRONG,B.STRIKE,B.SUB,B.SUP,B.TABLE,B.TT,B.U,B.UL,B.VAR]);function iCt(e){const t=e.tagID;return t===B.FONT&&e.attrs.some(({name:i})=>i===Wy.COLOR||i===Wy.SIZE||i===Wy.FACE)||nCt.has(t)}function EMe(e){for(let t=0;t0&&this._setContextModes(t,n)}onItemPop(t,n){var i,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(r=(i=this.treeAdapter).onItemPop)===null||r===void 0||r.call(i,t,this.openElements.current),n){let s,o;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,o=this.fragmentContextID):{current:s,currentTagId:o}=this.openElements,this._setContextModes(s,o)}}_setContextModes(t,n){const i=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===jt.HTML;this.currentNotInHTML=!i,this.tokenizer.inForeignNode=!i&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,jt.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=De.TEXT}switchToPlaintextParsing(){this.insertionMode=De.TEXT,this.originalInsertionMode=De.IN_BODY,this.tokenizer.state=Ta.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===et.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==jt.HTML))switch(this.fragmentContextID){case B.TITLE:case B.TEXTAREA:{this.tokenizer.state=Ta.RCDATA;break}case B.STYLE:case B.XMP:case B.IFRAME:case B.NOEMBED:case B.NOFRAMES:case B.NOSCRIPT:{this.tokenizer.state=Ta.RAWTEXT;break}case B.SCRIPT:{this.tokenizer.state=Ta.SCRIPT_DATA;break}case B.PLAINTEXT:{this.tokenizer.state=Ta.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",i=t.publicId||"",r=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,i,r),t.location){const o=this.treeAdapter.getChildNodes(this.document).find(l=>this.treeAdapter.isDocumentTypeNode(l));o&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const i=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,i)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const i=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(i??this.document,t)}}_appendElement(t,n){const i=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(i,t.location)}_insertElement(t,n){const i=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(i,t.location),this.openElements.push(i,t.tagID)}_insertFakeElement(t,n){const i=this.treeAdapter.createElement(t,jt.HTML,[]);this._attachElementToTree(i,null),this.openElements.push(i,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,jt.HTML,t.attrs),i=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,i),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(et.HTML,jt.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,B.HTML)}_appendCommentNode(t,n){const i=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,i),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,t.location)}_insertCharacters(t){let n,i;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:i}=this._findFosterParentingLocation(),i?this.treeAdapter.insertTextBefore(n,t.chars,i):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const r=this.treeAdapter.getChildNodes(n),s=i?r.lastIndexOf(i):r.length,o=r[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(o)){const{endLine:c,endCol:u,endOffset:d}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:c,endCol:u,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}_adoptNodes(t,n){for(let i=this.treeAdapter.getFirstChild(t);i;i=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(i),this.treeAdapter.appendChild(n,i)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const i=n.location,r=this.treeAdapter.getTagName(t),s=n.type===zi.END_TAG&&r===n.tagName?{endTag:{...i},endLine:i.endLine,endCol:i.endCol,endOffset:i.endOffset}:{endLine:i.startLine,endCol:i.startCol,endOffset:i.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,s)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,i;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,i=this.fragmentContextID):{current:n,currentTagId:i}=this.openElements,t.tagID===B.SVG&&this.treeAdapter.getTagName(n)===et.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===jt.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===B.MGLYPH||t.tagID===B.MALIGNMARK)&&i!==void 0&&!this._isIntegrationPoint(i,n,jt.HTML)}_processToken(t){switch(t.type){case zi.CHARACTER:{this.onCharacter(t);break}case zi.NULL_CHARACTER:{this.onNullCharacter(t);break}case zi.COMMENT:{this.onComment(t);break}case zi.DOCTYPE:{this.onDoctype(t);break}case zi.START_TAG:{this._processStartTag(t);break}case zi.END_TAG:{this.onEndTag(t);break}case zi.EOF:{this.onEof(t);break}case zi.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,i){const r=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return oCt(t,r,s,i)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(r=>r.type===Gf.Marker||this.openElements.contains(r.element)),i=n===-1?t-1:n-1;for(let r=i;r>=0;r--){const s=this.activeFormattingElements.entries[r];this._insertElement(s.token,this.treeAdapter.getNamespaceURI(s.element)),s.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=De.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(B.P),this.openElements.popUntilTagNamePopped(B.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case B.TR:{this.insertionMode=De.IN_ROW;return}case B.TBODY:case B.THEAD:case B.TFOOT:{this.insertionMode=De.IN_TABLE_BODY;return}case B.CAPTION:{this.insertionMode=De.IN_CAPTION;return}case B.COLGROUP:{this.insertionMode=De.IN_COLUMN_GROUP;return}case B.TABLE:{this.insertionMode=De.IN_TABLE;return}case B.BODY:{this.insertionMode=De.IN_BODY;return}case B.FRAMESET:{this.insertionMode=De.IN_FRAMESET;return}case B.SELECT:{this._resetInsertionModeForSelect(t);return}case B.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case B.HTML:{this.insertionMode=this.headElement?De.AFTER_HEAD:De.BEFORE_HEAD;return}case B.TD:case B.TH:{if(t>0){this.insertionMode=De.IN_CELL;return}break}case B.HEAD:{if(t>0){this.insertionMode=De.IN_HEAD;return}break}}this.insertionMode=De.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const i=this.openElements.tagIDs[n];if(i===B.TEMPLATE)break;if(i===B.TABLE){this.insertionMode=De.IN_SELECT_IN_TABLE;return}}this.insertionMode=De.IN_SELECT}_isElementCausesFosterParenting(t){return AMe.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case B.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===jt.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case B.TABLE:{const i=this.treeAdapter.getParentNode(n);return i?{parent:i,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const i=this.treeAdapter.getNamespaceURI(t);return NEt[i].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){UAt(this,t);return}switch(this.insertionMode){case De.INITIAL:{wO(this,t);break}case De.BEFORE_HTML:{fE(this,t);break}case De.BEFORE_HEAD:{hE(this,t);break}case De.IN_HEAD:{pE(this,t);break}case De.IN_HEAD_NO_SCRIPT:{mE(this,t);break}case De.AFTER_HEAD:{gE(this,t);break}case De.IN_BODY:case De.IN_CAPTION:case De.IN_CELL:case De.IN_TEMPLATE:{_Me(this,t);break}case De.TEXT:case De.IN_SELECT:case De.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case De.IN_TABLE:case De.IN_TABLE_BODY:case De.IN_ROW:{j4(this,t);break}case De.IN_TABLE_TEXT:{DMe(this,t);break}case De.IN_COLUMN_GROUP:{TI(this,t);break}case De.AFTER_BODY:{_I(this,t);break}case De.AFTER_AFTER_BODY:{NN(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){BAt(this,t);return}switch(this.insertionMode){case De.INITIAL:{wO(this,t);break}case De.BEFORE_HTML:{fE(this,t);break}case De.BEFORE_HEAD:{hE(this,t);break}case De.IN_HEAD:{pE(this,t);break}case De.IN_HEAD_NO_SCRIPT:{mE(this,t);break}case De.AFTER_HEAD:{gE(this,t);break}case De.TEXT:{this._insertCharacters(t);break}case De.IN_TABLE:case De.IN_TABLE_BODY:case De.IN_ROW:{j4(this,t);break}case De.IN_COLUMN_GROUP:{TI(this,t);break}case De.AFTER_BODY:{_I(this,t);break}case De.AFTER_AFTER_BODY:{NN(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){JB(this,t);return}switch(this.insertionMode){case De.INITIAL:case De.BEFORE_HTML:case De.BEFORE_HEAD:case De.IN_HEAD:case De.IN_HEAD_NO_SCRIPT:case De.AFTER_HEAD:case De.IN_BODY:case De.IN_TABLE:case De.IN_CAPTION:case De.IN_COLUMN_GROUP:case De.IN_TABLE_BODY:case De.IN_ROW:case De.IN_CELL:case De.IN_SELECT:case De.IN_SELECT_IN_TABLE:case De.IN_TEMPLATE:case De.IN_FRAMESET:case De.AFTER_FRAMESET:{JB(this,t);break}case De.IN_TABLE_TEXT:{kO(this,t);break}case De.AFTER_BODY:{yCt(this,t);break}case De.AFTER_AFTER_BODY:case De.AFTER_AFTER_FRAMESET:{vCt(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case De.INITIAL:{xCt(this,t);break}case De.BEFORE_HEAD:case De.IN_HEAD:case De.IN_HEAD_NO_SCRIPT:case De.AFTER_HEAD:{this._err(t,ht.misplacedDoctype);break}case De.IN_TABLE_TEXT:{kO(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,ht.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?QAt(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case De.INITIAL:{wO(this,t);break}case De.BEFORE_HTML:{wCt(this,t);break}case De.BEFORE_HEAD:{OCt(this,t);break}case De.IN_HEAD:{Cf(this,t);break}case De.IN_HEAD_NO_SCRIPT:{CCt(this,t);break}case De.AFTER_HEAD:{TCt(this,t);break}case De.IN_BODY:{Nl(this,t);break}case De.IN_TABLE:{l1(this,t);break}case De.IN_TABLE_TEXT:{kO(this,t);break}case De.IN_CAPTION:{SAt(this,t);break}case De.IN_COLUMN_GROUP:{sq(this,t);break}case De.IN_TABLE_BODY:{AM(this,t);break}case De.IN_ROW:{TM(this,t);break}case De.IN_CELL:{AAt(this,t);break}case De.IN_SELECT:{$Me(this,t);break}case De.IN_SELECT_IN_TABLE:{_At(this,t);break}case De.IN_TEMPLATE:{NAt(this,t);break}case De.AFTER_BODY:{IAt(this,t);break}case De.IN_FRAMESET:{PAt(this,t);break}case De.AFTER_FRAMESET:{MAt(this,t);break}case De.AFTER_AFTER_BODY:{$At(this,t);break}case De.AFTER_AFTER_FRAMESET:{FAt(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?zAt(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case De.INITIAL:{wO(this,t);break}case De.BEFORE_HTML:{kCt(this,t);break}case De.BEFORE_HEAD:{SCt(this,t);break}case De.IN_HEAD:{ECt(this,t);break}case De.IN_HEAD_NO_SCRIPT:{ACt(this,t);break}case De.AFTER_HEAD:{_Ct(this,t);break}case De.IN_BODY:{CM(this,t);break}case De.TEXT:{pAt(this,t);break}case De.IN_TABLE:{_C(this,t);break}case De.IN_TABLE_TEXT:{kO(this,t);break}case De.IN_CAPTION:{EAt(this,t);break}case De.IN_COLUMN_GROUP:{CAt(this,t);break}case De.IN_TABLE_BODY:{e9(this,t);break}case De.IN_ROW:{LMe(this,t);break}case De.IN_CELL:{TAt(this,t);break}case De.IN_SELECT:{FMe(this,t);break}case De.IN_SELECT_IN_TABLE:{jAt(this,t);break}case De.IN_TEMPLATE:{RAt(this,t);break}case De.AFTER_BODY:{UMe(this,t);break}case De.IN_FRAMESET:{DAt(this,t);break}case De.AFTER_FRAMESET:{LAt(this,t);break}case De.AFTER_AFTER_BODY:{NN(this,t);break}}}onEof(t){switch(this.insertionMode){case De.INITIAL:{wO(this,t);break}case De.BEFORE_HTML:{fE(this,t);break}case De.BEFORE_HEAD:{hE(this,t);break}case De.IN_HEAD:{pE(this,t);break}case De.IN_HEAD_NO_SCRIPT:{mE(this,t);break}case De.AFTER_HEAD:{gE(this,t);break}case De.IN_BODY:case De.IN_TABLE:case De.IN_CAPTION:case De.IN_COLUMN_GROUP:case De.IN_TABLE_BODY:case De.IN_ROW:case De.IN_CELL:case De.IN_SELECT:case De.IN_SELECT_IN_TABLE:{IMe(this,t);break}case De.TEXT:{mAt(this,t);break}case De.IN_TABLE_TEXT:{kO(this,t);break}case De.IN_TEMPLATE:{BMe(this,t);break}case De.AFTER_BODY:case De.IN_FRAMESET:case De.AFTER_FRAMESET:case De.AFTER_AFTER_BODY:case De.AFTER_AFTER_FRAMESET:{rq(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===ke.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case De.IN_HEAD:case De.IN_HEAD_NO_SCRIPT:case De.AFTER_HEAD:case De.TEXT:case De.IN_COLUMN_GROUP:case De.IN_SELECT:case De.IN_SELECT_IN_TABLE:case De.IN_FRAMESET:case De.AFTER_FRAMESET:{this._insertCharacters(t);break}case De.IN_BODY:case De.IN_CAPTION:case De.IN_CELL:case De.IN_TEMPLATE:case De.AFTER_BODY:case De.AFTER_AFTER_BODY:case De.AFTER_AFTER_FRAMESET:{TMe(this,t);break}case De.IN_TABLE:case De.IN_TABLE_BODY:case De.IN_ROW:{j4(this,t);break}case De.IN_TABLE_TEXT:{PMe(this,t);break}}}};function fCt(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):RMe(e,t),n}function hCt(e,t){let n=null,i=e.openElements.stackTop;for(;i>=0;i--){const r=e.openElements.items[i];if(r===t.element)break;e._isSpecialElement(r,e.openElements.tagIDs[i])&&(n=r)}return n||(e.openElements.shortenToLength(Math.max(i,0)),e.activeFormattingElements.removeEntry(t)),n}function pCt(e,t,n){let i=t,r=e.openElements.getCommonAncestor(t);for(let s=0,o=r;o!==n;s++,o=r){r=e.openElements.getCommonAncestor(o);const l=e.activeFormattingElements.getElementEntry(o),c=l&&s>=uCt;!l||c?(c&&e.activeFormattingElements.removeEntry(l),e.openElements.remove(o)):(o=mCt(e,l),i===t&&(e.activeFormattingElements.bookmark=l),e.treeAdapter.detachNode(i),e.treeAdapter.appendChild(o,i),i=o)}return i}function mCt(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),i=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,i),t.element=i,i}function gCt(e,t,n){const i=e.treeAdapter.getTagName(t),r=ok(i);if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{const s=e.treeAdapter.getNamespaceURI(t);r===B.TEMPLATE&&s===jt.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function bCt(e,t,n){const i=e.treeAdapter.getNamespaceURI(n.element),{token:r}=n,s=e.treeAdapter.createElement(r.tagName,i,r.attrs);e._adoptNodes(t,s),e.treeAdapter.appendChild(t,s),e.activeFormattingElements.insertElementAfterBookmark(s,r),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,s,r.tagID)}function iq(e,t){for(let n=0;n=n;i--)e._setEndLocation(e.openElements.items[i],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const i=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(i);if(r&&!r.endTag&&(e._setEndLocation(i,t),e.openElements.stackTop>=1)){const s=e.openElements.items[1],o=e.treeAdapter.getNodeSourceCodeLocation(s);o&&!o.endTag&&e._setEndLocation(s,t)}}}}function xCt(e,t){e._setDocumentType(t);const n=t.forceQuirks?ad.QUIRKS:XEt(t);GEt(t)||e._err(t,ht.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=De.BEFORE_HTML}function wO(e,t){e._err(t,ht.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,ad.QUIRKS),e.insertionMode=De.BEFORE_HTML,e._processToken(t)}function wCt(e,t){t.tagID===B.HTML?(e._insertElement(t,jt.HTML),e.insertionMode=De.BEFORE_HEAD):fE(e,t)}function kCt(e,t){const n=t.tagID;(n===B.HTML||n===B.HEAD||n===B.BODY||n===B.BR)&&fE(e,t)}function fE(e,t){e._insertFakeRootElement(),e.insertionMode=De.BEFORE_HEAD,e._processToken(t)}function OCt(e,t){switch(t.tagID){case B.HTML:{Nl(e,t);break}case B.HEAD:{e._insertElement(t,jt.HTML),e.headElement=e.openElements.current,e.insertionMode=De.IN_HEAD;break}default:hE(e,t)}}function SCt(e,t){const n=t.tagID;n===B.HEAD||n===B.BODY||n===B.HTML||n===B.BR?hE(e,t):e._err(t,ht.endTagWithoutMatchingOpenElement)}function hE(e,t){e._insertFakeElement(et.HEAD,B.HEAD),e.headElement=e.openElements.current,e.insertionMode=De.IN_HEAD,e._processToken(t)}function Cf(e,t){switch(t.tagID){case B.HTML:{Nl(e,t);break}case B.BASE:case B.BASEFONT:case B.BGSOUND:case B.LINK:case B.META:{e._appendElement(t,jt.HTML),t.ackSelfClosing=!0;break}case B.TITLE:{e._switchToTextParsing(t,Ta.RCDATA);break}case B.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Ta.RAWTEXT):(e._insertElement(t,jt.HTML),e.insertionMode=De.IN_HEAD_NO_SCRIPT);break}case B.NOFRAMES:case B.STYLE:{e._switchToTextParsing(t,Ta.RAWTEXT);break}case B.SCRIPT:{e._switchToTextParsing(t,Ta.SCRIPT_DATA);break}case B.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=De.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(De.IN_TEMPLATE);break}case B.HEAD:{e._err(t,ht.misplacedStartTagForHeadElement);break}default:pE(e,t)}}function ECt(e,t){switch(t.tagID){case B.HEAD:{e.openElements.pop(),e.insertionMode=De.AFTER_HEAD;break}case B.BODY:case B.BR:case B.HTML:{pE(e,t);break}case B.TEMPLATE:{Gv(e,t);break}default:e._err(t,ht.endTagWithoutMatchingOpenElement)}}function Gv(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==B.TEMPLATE&&e._err(t,ht.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(B.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,ht.endTagWithoutMatchingOpenElement)}function pE(e,t){e.openElements.pop(),e.insertionMode=De.AFTER_HEAD,e._processToken(t)}function CCt(e,t){switch(t.tagID){case B.HTML:{Nl(e,t);break}case B.BASEFONT:case B.BGSOUND:case B.HEAD:case B.LINK:case B.META:case B.NOFRAMES:case B.STYLE:{Cf(e,t);break}case B.NOSCRIPT:{e._err(t,ht.nestedNoscriptInHead);break}default:mE(e,t)}}function ACt(e,t){switch(t.tagID){case B.NOSCRIPT:{e.openElements.pop(),e.insertionMode=De.IN_HEAD;break}case B.BR:{mE(e,t);break}default:e._err(t,ht.endTagWithoutMatchingOpenElement)}}function mE(e,t){const n=t.type===zi.EOF?ht.openElementsLeftAfterEof:ht.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=De.IN_HEAD,e._processToken(t)}function TCt(e,t){switch(t.tagID){case B.HTML:{Nl(e,t);break}case B.BODY:{e._insertElement(t,jt.HTML),e.framesetOk=!1,e.insertionMode=De.IN_BODY;break}case B.FRAMESET:{e._insertElement(t,jt.HTML),e.insertionMode=De.IN_FRAMESET;break}case B.BASE:case B.BASEFONT:case B.BGSOUND:case B.LINK:case B.META:case B.NOFRAMES:case B.SCRIPT:case B.STYLE:case B.TEMPLATE:case B.TITLE:{e._err(t,ht.abandonedHeadElementChild),e.openElements.push(e.headElement,B.HEAD),Cf(e,t),e.openElements.remove(e.headElement);break}case B.HEAD:{e._err(t,ht.misplacedStartTagForHeadElement);break}default:gE(e,t)}}function _Ct(e,t){switch(t.tagID){case B.BODY:case B.HTML:case B.BR:{gE(e,t);break}case B.TEMPLATE:{Gv(e,t);break}default:e._err(t,ht.endTagWithoutMatchingOpenElement)}}function gE(e,t){e._insertFakeElement(et.BODY,B.BODY),e.insertionMode=De.IN_BODY,EM(e,t)}function EM(e,t){switch(t.type){case zi.CHARACTER:{_Me(e,t);break}case zi.WHITESPACE_CHARACTER:{TMe(e,t);break}case zi.COMMENT:{JB(e,t);break}case zi.START_TAG:{Nl(e,t);break}case zi.END_TAG:{CM(e,t);break}case zi.EOF:{IMe(e,t);break}}}function TMe(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function _Me(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function jCt(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function NCt(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function RCt(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,jt.HTML),e.insertionMode=De.IN_FRAMESET)}function ICt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,jt.HTML)}function PCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&ZB.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,jt.HTML)}function DCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,jt.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function MCt(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,jt.HTML),n||(e.formElement=e.openElements.current))}function LCt(e,t){e.framesetOk=!1;const n=t.tagID;for(let i=e.openElements.stackTop;i>=0;i--){const r=e.openElements.tagIDs[i];if(n===B.LI&&r===B.LI||(n===B.DD||n===B.DT)&&(r===B.DD||r===B.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==B.ADDRESS&&r!==B.DIV&&r!==B.P&&e._isSpecialElement(e.openElements.items[i],r))break}e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,jt.HTML)}function $Ct(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,jt.HTML),e.tokenizer.state=Ta.PLAINTEXT}function FCt(e,t){e.openElements.hasInScope(B.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(B.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,jt.HTML),e.framesetOk=!1}function BCt(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(et.A);n&&(iq(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,jt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function UCt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,jt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function QCt(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(B.NOBR)&&(iq(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,jt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function zCt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,jt.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function VCt(e,t){e.treeAdapter.getDocumentMode(e.document)!==ad.QUIRKS&&e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,jt.HTML),e.framesetOk=!1,e.insertionMode=De.IN_TABLE}function jMe(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,jt.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function NMe(e){const t=vMe(e,Wy.TYPE);return t!=null&&t.toLowerCase()===lCt}function HCt(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,jt.HTML),NMe(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function qCt(e,t){e._appendElement(t,jt.HTML),t.ackSelfClosing=!0}function WCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._appendElement(t,jt.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function KCt(e,t){t.tagName=et.IMG,t.tagID=B.IMG,jMe(e,t)}function GCt(e,t){e._insertElement(t,jt.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Ta.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=De.TEXT}function XCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Ta.RAWTEXT)}function YCt(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Ta.RAWTEXT)}function Sne(e,t){e._switchToTextParsing(t,Ta.RAWTEXT)}function ZCt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,jt.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===De.IN_TABLE||e.insertionMode===De.IN_CAPTION||e.insertionMode===De.IN_TABLE_BODY||e.insertionMode===De.IN_ROW||e.insertionMode===De.IN_CELL?De.IN_SELECT_IN_TABLE:De.IN_SELECT}function JCt(e,t){e.openElements.currentTagId===B.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,jt.HTML)}function eAt(e,t){e.openElements.hasInScope(B.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,jt.HTML)}function tAt(e,t){e.openElements.hasInScope(B.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(B.RTC),e._insertElement(t,jt.HTML)}function nAt(e,t){e._reconstructActiveFormattingElements(),EMe(t),nq(t),t.selfClosing?e._appendElement(t,jt.MATHML):e._insertElement(t,jt.MATHML),t.ackSelfClosing=!0}function iAt(e,t){e._reconstructActiveFormattingElements(),CMe(t),nq(t),t.selfClosing?e._appendElement(t,jt.SVG):e._insertElement(t,jt.SVG),t.ackSelfClosing=!0}function Ene(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,jt.HTML)}function Nl(e,t){switch(t.tagID){case B.I:case B.S:case B.B:case B.U:case B.EM:case B.TT:case B.BIG:case B.CODE:case B.FONT:case B.SMALL:case B.STRIKE:case B.STRONG:{UCt(e,t);break}case B.A:{BCt(e,t);break}case B.H1:case B.H2:case B.H3:case B.H4:case B.H5:case B.H6:{PCt(e,t);break}case B.P:case B.DL:case B.OL:case B.UL:case B.DIV:case B.DIR:case B.NAV:case B.MAIN:case B.MENU:case B.ASIDE:case B.CENTER:case B.FIGURE:case B.FOOTER:case B.HEADER:case B.HGROUP:case B.DIALOG:case B.DETAILS:case B.ADDRESS:case B.ARTICLE:case B.SEARCH:case B.SECTION:case B.SUMMARY:case B.FIELDSET:case B.BLOCKQUOTE:case B.FIGCAPTION:{ICt(e,t);break}case B.LI:case B.DD:case B.DT:{LCt(e,t);break}case B.BR:case B.IMG:case B.WBR:case B.AREA:case B.EMBED:case B.KEYGEN:{jMe(e,t);break}case B.HR:{WCt(e,t);break}case B.RB:case B.RTC:{eAt(e,t);break}case B.RT:case B.RP:{tAt(e,t);break}case B.PRE:case B.LISTING:{DCt(e,t);break}case B.XMP:{XCt(e,t);break}case B.SVG:{iAt(e,t);break}case B.HTML:{jCt(e,t);break}case B.BASE:case B.LINK:case B.META:case B.STYLE:case B.TITLE:case B.SCRIPT:case B.BGSOUND:case B.BASEFONT:case B.TEMPLATE:{Cf(e,t);break}case B.BODY:{NCt(e,t);break}case B.FORM:{MCt(e,t);break}case B.NOBR:{QCt(e,t);break}case B.MATH:{nAt(e,t);break}case B.TABLE:{VCt(e,t);break}case B.INPUT:{HCt(e,t);break}case B.PARAM:case B.TRACK:case B.SOURCE:{qCt(e,t);break}case B.IMAGE:{KCt(e,t);break}case B.BUTTON:{FCt(e,t);break}case B.APPLET:case B.OBJECT:case B.MARQUEE:{zCt(e,t);break}case B.IFRAME:{YCt(e,t);break}case B.SELECT:{ZCt(e,t);break}case B.OPTION:case B.OPTGROUP:{JCt(e,t);break}case B.NOEMBED:case B.NOFRAMES:{Sne(e,t);break}case B.FRAMESET:{RCt(e,t);break}case B.TEXTAREA:{GCt(e,t);break}case B.NOSCRIPT:{e.options.scriptingEnabled?Sne(e,t):Ene(e,t);break}case B.PLAINTEXT:{$Ct(e,t);break}case B.COL:case B.TH:case B.TD:case B.TR:case B.HEAD:case B.FRAME:case B.TBODY:case B.TFOOT:case B.THEAD:case B.CAPTION:case B.COLGROUP:break;default:Ene(e,t)}}function rAt(e,t){if(e.openElements.hasInScope(B.BODY)&&(e.insertionMode=De.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function sAt(e,t){e.openElements.hasInScope(B.BODY)&&(e.insertionMode=De.AFTER_BODY,UMe(e,t))}function aAt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function oAt(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(B.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(B.FORM):n&&e.openElements.remove(n))}function lAt(e){e.openElements.hasInButtonScope(B.P)||e._insertFakeElement(et.P,B.P),e._closePElement()}function cAt(e){e.openElements.hasInListItemScope(B.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(B.LI),e.openElements.popUntilTagNamePopped(B.LI))}function uAt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function dAt(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function fAt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function hAt(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(et.BR,B.BR),e.openElements.pop(),e.framesetOk=!1}function RMe(e,t){const n=t.tagName,i=t.tagID;for(let r=e.openElements.stackTop;r>0;r--){const s=e.openElements.items[r],o=e.openElements.tagIDs[r];if(i===o&&(i!==B.UNKNOWN||e.treeAdapter.getTagName(s)===n)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.stackTop>=r&&e.openElements.shortenToLength(r);break}if(e._isSpecialElement(s,o))break}}function CM(e,t){switch(t.tagID){case B.A:case B.B:case B.I:case B.S:case B.U:case B.EM:case B.TT:case B.BIG:case B.CODE:case B.FONT:case B.NOBR:case B.SMALL:case B.STRIKE:case B.STRONG:{iq(e,t);break}case B.P:{lAt(e);break}case B.DL:case B.UL:case B.OL:case B.DIR:case B.DIV:case B.NAV:case B.PRE:case B.MAIN:case B.MENU:case B.ASIDE:case B.BUTTON:case B.CENTER:case B.FIGURE:case B.FOOTER:case B.HEADER:case B.HGROUP:case B.DIALOG:case B.ADDRESS:case B.ARTICLE:case B.DETAILS:case B.SEARCH:case B.SECTION:case B.SUMMARY:case B.LISTING:case B.FIELDSET:case B.BLOCKQUOTE:case B.FIGCAPTION:{aAt(e,t);break}case B.LI:{cAt(e);break}case B.DD:case B.DT:{uAt(e,t);break}case B.H1:case B.H2:case B.H3:case B.H4:case B.H5:case B.H6:{dAt(e);break}case B.BR:{hAt(e);break}case B.BODY:{rAt(e,t);break}case B.HTML:{sAt(e,t);break}case B.FORM:{oAt(e);break}case B.APPLET:case B.OBJECT:case B.MARQUEE:{fAt(e,t);break}case B.TEMPLATE:{Gv(e,t);break}default:RMe(e,t)}}function IMe(e,t){e.tmplInsertionModeStack.length>0?BMe(e,t):rq(e,t)}function pAt(e,t){var n;t.tagID===B.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function mAt(e,t){e._err(t,ht.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function j4(e,t){if(e.openElements.currentTagId!==void 0&&AMe.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=De.IN_TABLE_TEXT,t.type){case zi.CHARACTER:{DMe(e,t);break}case zi.WHITESPACE_CHARACTER:{PMe(e,t);break}}else xT(e,t)}function gAt(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,jt.HTML),e.insertionMode=De.IN_CAPTION}function bAt(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,jt.HTML),e.insertionMode=De.IN_COLUMN_GROUP}function yAt(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(et.COLGROUP,B.COLGROUP),e.insertionMode=De.IN_COLUMN_GROUP,sq(e,t)}function vAt(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,jt.HTML),e.insertionMode=De.IN_TABLE_BODY}function xAt(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(et.TBODY,B.TBODY),e.insertionMode=De.IN_TABLE_BODY,AM(e,t)}function wAt(e,t){e.openElements.hasInTableScope(B.TABLE)&&(e.openElements.popUntilTagNamePopped(B.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function kAt(e,t){NMe(t)?e._appendElement(t,jt.HTML):xT(e,t),t.ackSelfClosing=!0}function OAt(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,jt.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function l1(e,t){switch(t.tagID){case B.TD:case B.TH:case B.TR:{xAt(e,t);break}case B.STYLE:case B.SCRIPT:case B.TEMPLATE:{Cf(e,t);break}case B.COL:{yAt(e,t);break}case B.FORM:{OAt(e,t);break}case B.TABLE:{wAt(e,t);break}case B.TBODY:case B.TFOOT:case B.THEAD:{vAt(e,t);break}case B.INPUT:{kAt(e,t);break}case B.CAPTION:{gAt(e,t);break}case B.COLGROUP:{bAt(e,t);break}default:xT(e,t)}}function _C(e,t){switch(t.tagID){case B.TABLE:{e.openElements.hasInTableScope(B.TABLE)&&(e.openElements.popUntilTagNamePopped(B.TABLE),e._resetInsertionMode());break}case B.TEMPLATE:{Gv(e,t);break}case B.BODY:case B.CAPTION:case B.COL:case B.COLGROUP:case B.HTML:case B.TBODY:case B.TD:case B.TFOOT:case B.TH:case B.THEAD:case B.TR:break;default:xT(e,t)}}function xT(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,EM(e,t),e.fosterParentingEnabled=n}function PMe(e,t){e.pendingCharacterTokens.push(t)}function DMe(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function kO(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===B.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===B.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===B.OPTGROUP&&e.openElements.pop();break}case B.OPTION:{e.openElements.currentTagId===B.OPTION&&e.openElements.pop();break}case B.SELECT:{e.openElements.hasInSelectScope(B.SELECT)&&(e.openElements.popUntilTagNamePopped(B.SELECT),e._resetInsertionMode());break}case B.TEMPLATE:{Gv(e,t);break}}}function _At(e,t){const n=t.tagID;n===B.CAPTION||n===B.TABLE||n===B.TBODY||n===B.TFOOT||n===B.THEAD||n===B.TR||n===B.TD||n===B.TH?(e.openElements.popUntilTagNamePopped(B.SELECT),e._resetInsertionMode(),e._processStartTag(t)):$Me(e,t)}function jAt(e,t){const n=t.tagID;n===B.CAPTION||n===B.TABLE||n===B.TBODY||n===B.TFOOT||n===B.THEAD||n===B.TR||n===B.TD||n===B.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(B.SELECT),e._resetInsertionMode(),e.onEndTag(t)):FMe(e,t)}function NAt(e,t){switch(t.tagID){case B.BASE:case B.BASEFONT:case B.BGSOUND:case B.LINK:case B.META:case B.NOFRAMES:case B.SCRIPT:case B.STYLE:case B.TEMPLATE:case B.TITLE:{Cf(e,t);break}case B.CAPTION:case B.COLGROUP:case B.TBODY:case B.TFOOT:case B.THEAD:{e.tmplInsertionModeStack[0]=De.IN_TABLE,e.insertionMode=De.IN_TABLE,l1(e,t);break}case B.COL:{e.tmplInsertionModeStack[0]=De.IN_COLUMN_GROUP,e.insertionMode=De.IN_COLUMN_GROUP,sq(e,t);break}case B.TR:{e.tmplInsertionModeStack[0]=De.IN_TABLE_BODY,e.insertionMode=De.IN_TABLE_BODY,AM(e,t);break}case B.TD:case B.TH:{e.tmplInsertionModeStack[0]=De.IN_ROW,e.insertionMode=De.IN_ROW,TM(e,t);break}default:e.tmplInsertionModeStack[0]=De.IN_BODY,e.insertionMode=De.IN_BODY,Nl(e,t)}}function RAt(e,t){t.tagID===B.TEMPLATE&&Gv(e,t)}function BMe(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(B.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):rq(e,t)}function IAt(e,t){t.tagID===B.HTML?Nl(e,t):_I(e,t)}function UMe(e,t){var n;if(t.tagID===B.HTML){if(e.fragmentContext||(e.insertionMode=De.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===B.HTML){e._setEndLocation(e.openElements.items[0],t);const i=e.openElements.items[1];i&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(i))===null||n===void 0)&&n.endTag)&&e._setEndLocation(i,t)}}else _I(e,t)}function _I(e,t){e.insertionMode=De.IN_BODY,EM(e,t)}function PAt(e,t){switch(t.tagID){case B.HTML:{Nl(e,t);break}case B.FRAMESET:{e._insertElement(t,jt.HTML);break}case B.FRAME:{e._appendElement(t,jt.HTML),t.ackSelfClosing=!0;break}case B.NOFRAMES:{Cf(e,t);break}}}function DAt(e,t){t.tagID===B.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==B.FRAMESET&&(e.insertionMode=De.AFTER_FRAMESET))}function MAt(e,t){switch(t.tagID){case B.HTML:{Nl(e,t);break}case B.NOFRAMES:{Cf(e,t);break}}}function LAt(e,t){t.tagID===B.HTML&&(e.insertionMode=De.AFTER_AFTER_FRAMESET)}function $At(e,t){t.tagID===B.HTML?Nl(e,t):NN(e,t)}function NN(e,t){e.insertionMode=De.IN_BODY,EM(e,t)}function FAt(e,t){switch(t.tagID){case B.HTML:{Nl(e,t);break}case B.NOFRAMES:{Cf(e,t);break}}}function BAt(e,t){t.chars=Fs,e._insertCharacters(t)}function UAt(e,t){e._insertCharacters(t),e.framesetOk=!1}function QMe(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==jt.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function QAt(e,t){if(iCt(t))QMe(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),i=e.treeAdapter.getNamespaceURI(n);i===jt.MATHML?EMe(t):i===jt.SVG&&(rCt(t),CMe(t)),nq(t),t.selfClosing?e._appendElement(t,i):e._insertElement(t,i),t.ackSelfClosing=!0}}function zAt(e,t){if(t.tagID===B.P||t.tagID===B.BR){QMe(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const i=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(i)===jt.HTML){e._endTagOutsideForeignContent(t);break}const r=e.treeAdapter.getTagName(i);if(r.toLowerCase()===t.tagName){t.tagName=r,e.openElements.shortenToLength(n);break}}}et.AREA,et.BASE,et.BASEFONT,et.BGSOUND,et.BR,et.COL,et.EMBED,et.FRAME,et.HR,et.IMG,et.INPUT,et.KEYGEN,et.LINK,et.META,et.PARAM,et.SOURCE,et.TRACK,et.WBR;const VAt=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,HAt=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),Cne={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function zMe(e,t){const n=tTt(e),i=nDe("type",{handlers:{root:qAt,element:WAt,text:KAt,comment:HMe,doctype:GAt,raw:YAt},unknown:ZAt}),r={parser:n?new One(Cne):One.getFragmentParser(void 0,Cne),handle(l){i(l,r)},stitches:!1,options:t||{}};i(e,r),lk(r,Ih());const s=n?r.parser.document:r.parser.getFragment(),o=nEt(s,{file:r.options.file});return r.stitches&&yT(o,"comment",function(l,c,u){const d=l;if(d.value.stitch&&u&&c!==void 0){const f=u.children;return f[c]=d.value.stitch,c}}),o.type==="root"&&o.children.length===1&&o.children[0].type===e.type?o.children[0]:o}function VMe(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);const n={type:zi.CHARACTER,chars:e.value,location:wT(e)};lk(t,Ih(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function GAt(e,t){const n={type:zi.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:wT(e)};lk(t,Ih(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function XAt(e,t){t.stitches=!0;const n=nTt(e);if("children"in e&&"children"in n){const i=zMe({type:"root",children:e.children},t.options);n.children=i.children}HMe({type:"comment",value:{stitch:n}},t)}function HMe(e,t){const n=e.value,i={type:zi.COMMENT,data:n,location:wT(e)};lk(t,Ih(e)),t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken)}function YAt(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,qMe(t,Ih(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(VAt,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function ZAt(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))XAt(n,t);else{let i="";throw HAt.has(n.type)&&(i=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+i)}}function lk(e,t){qMe(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Ta.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function qMe(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function JAt(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Ta.PLAINTEXT)return;lk(t,Ih(e));const i=t.parser.openElements.current;let r="namespaceURI"in i?i.namespaceURI:Ay.html;r===Ay.html&&n==="svg"&&(r=Ay.svg);const s=oEt({...e,children:[]},{space:r===Ay.svg?"svg":"html"}),o={type:zi.START_TAG,tagName:n,tagID:ok(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:wT(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function eTt(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&mEt.includes(n)||t.parser.tokenizer.state===Ta.PLAINTEXT)return;lk(t,yM(e));const i={type:zi.END_TAG,tagName:n,tagID:ok(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:wT(e)};t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Ta.RCDATA||t.parser.tokenizer.state===Ta.RAWTEXT||t.parser.tokenizer.state===Ta.SCRIPT_DATA)&&(t.parser.tokenizer.state=Ta.DATA)}function tTt(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function wT(e){const t=Ih(e)||{line:void 0,column:void 0,offset:void 0},n=yM(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function nTt(e){return"children"in e?a1({...e,children:[]}):a1(e)}function iTt(e){return function(t,n){return zMe(t,{...e,file:n})}}const rTt="modulepreload",sTt=function(e){return"/"+e},Ane={},Ys=function(t,n,i){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));r=Promise.allSettled(n.map(c=>{if(c=sTt(c),c in Ane)return;Ane[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":rTt,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((h,m)=>{f.addEventListener("load",h),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return r.then(o=>{for(const l of o||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})};var aTt=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,oTt=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,lTt=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,N4={Space_Separator:aTt,ID_Start:oTt,ID_Continue:lTt},ka={isSpaceSeparator(e){return typeof e=="string"&&N4.Space_Separator.test(e)},isIdStartChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"||N4.ID_Start.test(e))},isIdContinueChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||e==="$"||e==="_"||e==="‌"||e==="‍"||N4.ID_Continue.test(e))},isDigit(e){return typeof e=="string"&&/[0-9]/.test(e)},isHexDigit(e){return typeof e=="string"&&/[0-9A-Fa-f]/.test(e)}};let t9,Yl,wp,jI,ob,hf,To,aq,bE;var cTt=function(t,n){t9=String(t),Yl="start",wp=[],jI=0,ob=1,hf=0,To=void 0,aq=void 0,bE=void 0;do To=uTt(),hTt[Yl]();while(To.type!=="eof");return typeof n=="function"?n9({"":bE},"",n):bE};function n9(e,t,n){const i=e[t];if(i!=null&&typeof i=="object")if(Array.isArray(i))for(let r=0;r0;){const n=Bp();if(!ka.isHexDigit(n))throw Ts(Ct());e+=Ct()}return String.fromCodePoint(parseInt(e,16))}const hTt={start(){if(To.type==="eof")throw Gb();R4()},beforePropertyName(){switch(To.type){case"identifier":case"string":aq=To.value,Yl="afterPropertyName";return;case"punctuator":__();return;case"eof":throw Gb()}},afterPropertyName(){if(To.type==="eof")throw Gb();Yl="beforePropertyValue"},beforePropertyValue(){if(To.type==="eof")throw Gb();R4()},beforeArrayValue(){if(To.type==="eof")throw Gb();if(To.type==="punctuator"&&To.value==="]"){__();return}R4()},afterPropertyValue(){if(To.type==="eof")throw Gb();switch(To.value){case",":Yl="beforePropertyName";return;case"}":__()}},afterArrayValue(){if(To.type==="eof")throw Gb();switch(To.value){case",":Yl="beforeArrayValue";return;case"]":__()}},end(){}};function R4(){let e;switch(To.type){case"punctuator":switch(To.value){case"{":e={};break;case"[":e=[];break}break;case"null":case"boolean":case"numeric":case"string":e=To.value;break}if(bE===void 0)bE=e;else{const t=wp[wp.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,aq,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(e!==null&&typeof e=="object")wp.push(e),Array.isArray(e)?Yl="beforeArrayValue":Yl="beforePropertyName";else{const t=wp[wp.length-1];t==null?Yl="end":Array.isArray(t)?Yl="afterArrayValue":Yl="afterPropertyValue"}}function __(){wp.pop();const e=wp[wp.length-1];e==null?Yl="end":Array.isArray(e)?Yl="afterArrayValue":Yl="afterPropertyValue"}function Ts(e){return NI(e===void 0?`JSON5: invalid end of input at ${ob}:${hf}`:`JSON5: invalid character '${KMe(e)}' at ${ob}:${hf}`)}function Gb(){return NI(`JSON5: invalid end of input at ${ob}:${hf}`)}function Tne(){return hf-=5,NI(`JSON5: invalid identifier character at ${ob}:${hf}`)}function pTt(e){console.warn(`JSON5: '${KMe(e)}' in strings is not valid ECMAScript; consider escaping`)}function KMe(e){const t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){const n=e.charCodeAt(0).toString(16);return"\\x"+("00"+n).substring(n.length)}return e}function NI(e){const t=new SyntaxError(e);return t.lineNumber=ob,t.columnNumber=hf,t}var mTt=function(t,n,i){const r=[];let s="",o,l,c="",u;if(n!=null&&typeof n=="object"&&!Array.isArray(n)&&(i=n.space,u=n.quote,n=n.replacer),typeof n=="function")l=n;else if(Array.isArray(n)){o=[];for(const b of n){let v;typeof b=="string"?v=b:(typeof b=="number"||b instanceof String||b instanceof Number)&&(v=String(b)),v!==void 0&&o.indexOf(v)<0&&o.push(v)}}return i instanceof Number?i=Number(i):i instanceof String&&(i=String(i)),typeof i=="number"?i>0&&(i=Math.min(10,Math.floor(i)),c=" ".substr(0,i)):typeof i=="string"&&(c=i.substr(0,10)),d("",{"":t});function d(b,v){let y=v[b];switch(y!=null&&(typeof y.toJSON5=="function"?y=y.toJSON5(b):typeof y.toJSON=="function"&&(y=y.toJSON(b))),l&&(y=l.call(v,b,y)),y instanceof Number?y=Number(y):y instanceof String?y=String(y):y instanceof Boolean&&(y=y.valueOf()),y){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof y=="string")return f(y);if(typeof y=="number")return String(y);if(typeof y=="object")return Array.isArray(y)?g(y):h(y)}function f(b){const v={"'":.1,'"':.2},y={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let w="";for(let k=0;kv[k]=0)throw TypeError("Converting circular structure to JSON5");r.push(b);let v=s;s=s+c;let y=o||Object.keys(b),w=[];for(const k of y){const S=d(k,b);if(S!==void 0){let O=m(k)+":";c!==""&&(O+=" "),O+=S,w.push(O)}}let x;if(w.length===0)x="{}";else{let k;if(c==="")k=w.join(","),x="{"+k+"}";else{let S=`, `+s;k=w.join(S),x=`{ `+s+k+`, `+v+"}"}}return r.pop(),s=v,x}function m(b){if(b.length===0)return f(b);const v=String.fromCodePoint(b.codePointAt(0));if(!ka.isIdStartChar(v))return f(b);for(let y=v.length;y=0)throw TypeError("Converting circular structure to JSON5");r.push(b);let v=s;s=s+c;let y=[];for(let x=0;x30)throw new Error("ECharts option nesting is too deep");if(typeof e=="number"&&!Number.isFinite(e))throw new Error("ECharts option contains a non-finite number");if(typeof e=="string"&&yTt.test(e.trim()))throw new Error("ECharts option contains an external resource");if(Array.isArray(e)){for(const n of e)RI(n,t+1);return}if(bS(e))for(const[n,i]of Object.entries(e)){if(bTt.has(n))throw new Error("ECharts option contains an unsafe key");RI(i,t+1)}}function vTt(e){var i;const t=e.trim(),n=t.match(/^(?:(?:const|let|var)\s+)?option\s*=\s*([\s\S]*?)\s*;?$/);return((i=n==null?void 0:n[1])==null?void 0:i.trim())||t}function xTt(e,t){let n=1,i="",r=!1,s=!1,o=!1;for(let l=t+1;li+2)throw new Error("Invalid ECharts gradient argument count");const r=n.slice(0,i).map(wTt),s=n[i],o=n[i+1]??!1;if(!Array.isArray(s)||typeof o!="boolean")throw new Error("Invalid ECharts gradient data");return e==="linear"?{type:e,x:r[0],y:r[1],x2:r[2],y2:r[3],colorStops:s,global:o}:{type:e,x:r[0],y:r[1],r:r[2],colorStops:s,global:o}}function OTt(e,t){const n=/^(?:new\s+)?echarts\.graphic\.(LinearGradient|RadialGradient)\s*\(/;let i="",r=!1,s=!1,o=!1;for(let l=t;lgTt)throw new Error("ECharts option is too large");const n=STt(vTt(e));let i;try{i=KMe.parse(n)}catch(o){throw/\bfunction\s*\(|=>/.test(n)?new Error("ECharts function callbacks are not supported"):o}if(!bS(i))throw new Error("ECharts option must be a data object");RI(i);const r={...i};r.aria={...bS(r.aria)?r.aria:{},enabled:!0};const s=r.tooltip;return bS(s)?r.tooltip={...s,renderMode:"richText"}:Array.isArray(s)&&(r.tooltip=s.map(o=>bS(o)?{...o,renderMode:"richText"}:o)),t&&(r.animation=!1),r}let I4;function ETt(){return I4??(I4=Ys(()=>import("../visualizations/echarts/index-CGT341lL.js"),[]).catch(e=>{throw I4=void 0,e})),I4}function CTt({source:e}){const{t}=_e("conversation"),n=p.useRef(null),[i,r]=p.useState(!1),[s,o]=p.useState("");return p.useEffect(()=>{let l=!1,c,u,d;r(!1);try{d=GMe(e,window.matchMedia("(prefers-reduced-motion: reduce)").matches),o("")}catch{o("invalid");return}return ETt().then(f=>{const h=n.current;l||!h||(c=f.init(h,void 0,{renderer:"svg"}),c.setOption(d,{notMerge:!0}),typeof ResizeObserver<"u"&&(u=new ResizeObserver(()=>c==null?void 0:c.resize()),u.observe(h)),r(!0))}).catch(()=>{c==null||c.dispose(),c=void 0,l||o("render")}),()=>{l=!0,u==null||u.disconnect(),c==null||c.dispose()}},[e]),a.jsxs("div",{className:`echarts-diagram${s?" echarts-diagram--error":""}`,role:"img","aria-label":t("visualization.echartsAria"),"aria-busy":!i&&!s,children:[a.jsx("div",{ref:n,className:"echarts-diagram__canvas",hidden:!!s}),!i&&!s?a.jsx("div",{className:"echarts-diagram__state","aria-live":"polite",children:a.jsx(on,{duration:2.2,spread:15,children:t("visualization.rendering")})}):null,s?a.jsx("p",{className:"echarts-diagram__error",role:"alert",children:t(s==="invalid"?"visualization.invalidEcharts":"visualization.renderFailed")}):null]})}const ATt=p.memo(CTt);let _ne,jne=Promise.resolve(),TTt=0;function _Tt(){return _ne??(_ne=Ys(async()=>{const{default:e}=await import("../visualizations/mermaid/mermaid.core-Xn0bMahe.js").then(t=>t.ay);return{default:e}},__vite__mapDeps([0,1])).then(({default:e})=>(e.initialize({startOnLoad:!1,securityLevel:"strict",suppressErrorRendering:!0,theme:"neutral"}),e))),_ne}function jTt(e){const t=jne.then(async()=>{const n=await _Tt(),i=`mermaid-diagram-${TTt+=1}`;return n.render(i,e)});return jne=t.then(()=>{},()=>{}),t}function NTt({source:e}){const{t}=_e("conversation"),n=p.useRef(null),[i,r]=p.useState(null),[s,o]=p.useState(!1);return p.useEffect(()=>{let l=!1;return r(null),o(!1),jTt(e).then(c=>{l||r(c)}).catch(()=>{l||o(!0)}),()=>{l=!0}},[e]),p.useEffect(()=>{!(i!=null&&i.bindFunctions)||!n.current||i.bindFunctions(n.current)},[i]),s?a.jsx("div",{className:"mermaid-diagram mermaid-diagram--error",children:a.jsx("p",{className:"mermaid-diagram__error",role:"alert",children:t("visualization.mermaidFailed")})}):i?a.jsx("div",{ref:n,className:"mermaid-diagram",role:"img","aria-label":t("visualization.mermaidAria"),dangerouslySetInnerHTML:{__html:i.svg}}):a.jsx("div",{className:"mermaid-diagram mermaid-diagram--loading","aria-live":"polite",children:a.jsx(on,{duration:2.2,spread:15,children:t("visualization.rendering")})})}const RTt=p.memo(NTt),ITt="_SegmentedControl_1sl7d_1",PTt="_SegmentedControlOption_1sl7d_140",DTt="_SegmentedControlThumb_1sl7d_219",r9={SegmentedControl:ITt,SegmentedControlOption:PTt,SegmentedControlThumb:DTt},dd=({value:e,onChange:t,children:n,block:i,pill:r=!0,size:s="md",gutterSize:o,className:l,onClick:c,...u})=>{const d=p.useRef(null),f=p.useRef(null),h=p.useCallback(g=>{const b=d.current,v=f.current;if(!b||!v)return;const y=b==null?void 0:b.querySelector('[data-state="on"]');if(!y)return;const w=b.clientWidth;let x=Math.floor(y.clientWidth);const k=y.offsetLeft;if(w-(x+k)<2&&(x=x-1),v.style.width=`${Math.floor(x)}px`,v.style.transform=`translateX(${k}px)`,b.scrollWidth>w){const S=w*.15,O=b.scrollLeft,A=y.offsetLeft,E=A+x;(AO+w-S)&&g&&y.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"})}},[]);aNe({ref:d,onResize:()=>{const g=f.current;if(!g)return;const b=g.style.transition;g.style.transition="",h(!1),g.style.transition=b}}),p.useLayoutEffect(()=>{const g=d.current,b=f.current;!g||!b||(h(!!b.style.transition),b.style.transition||hI(()=>{b.style.transition="width 300ms var(--cubic-enter), transform 300ms var(--cubic-enter)"}))},[h,e,s,o,r]);const m=g=>{g&&t&&t(g)};return a.jsxs(Oft,{ref:d,className:qi(r9.SegmentedControl,l),type:"single",value:e,loop:!1,onValueChange:m,onClick:c,"data-block":i?"":void 0,"data-pill":r?"":void 0,"data-size":s,"data-gutter-size":o,...u,children:[a.jsx("div",{className:r9.SegmentedControlThumb,ref:f}),n]})},MTt=({children:e,...t})=>a.jsx(Tft,{className:r9.SegmentedControlOption,...t,onPointerEnter:SV,children:a.jsx("span",{className:"relative",children:e})});dd.Option=MTt;function LTt({children:e,label:t,language:n,source:i,streaming:r=!1}){const{t:s}=_e("conversation"),[o,l]=p.useState("preview"),c=r?"code":o;return a.jsxs("section",{className:"visualization-card","aria-label":s("visualization.cardAria",{label:t}),children:[a.jsx("div",{className:"visualization-card__toolbar",children:a.jsxs(dd,{className:"visualization-card__tabs",value:c,size:"sm",gutterSize:"sm",pill:!1,"aria-label":s("visualization.viewAria",{label:t}),onChange:u=>{r||l(u)},children:[a.jsx(dd.Option,{value:"preview",disabled:r,children:s("visualization.preview")}),a.jsx(dd.Option,{value:"code",children:s("visualization.code")})]})}),a.jsx("div",{className:"visualization-card__body",children:c==="code"?a.jsx("pre",{className:"visualization-card__code",children:a.jsx("code",{className:`language-${n}`,children:i})}):e})]})}const $Tt=p.memo(LTt);function XMe(e){const t=e==null?void 0:e.trim().toLowerCase();if(t==="mermaid")return"mermaid";if(t==="echart"||t==="echarts")return"echarts"}const YMe=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function s9(e){return typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(s9).join(""):p.isValidElement(e)?s9(e.props.children):""}function FTt(e){var i;const t=p.Children.toArray(e)[0];if(!p.isValidElement(t))return;const n=(i=t.props.className)==null?void 0:i.split(/\s+/).find(r=>r.startsWith("language-"));return XMe(n==null?void 0:n.slice(9))}function ZMe(e){if(!e)return!1;try{const t=e.toLowerCase();return YMe.some(n=>t.includes(n))}catch{return!1}}function BTt(e){var i;const t=(i=e==null?void 0:e.properties)==null?void 0:i.href;if(!t)return!1;if(ZMe(t))return!0;const n=e==null?void 0:e.children;if(n&&Array.isArray(n)){const r=n.map(s=>(s==null?void 0:s.value)||"").join("").toLowerCase();return YMe.some(s=>r.includes(s))}return!1}function UTt({text:e,className:t,allowRawHtml:n=!0,streaming:i=!1}){const{t:r}=_e("conversation"),s=p.useContext(Nje),[o,l]=p.useState(null),c=(f,h)=>{if(f.src)return f.src;if(h){const m=b=>{var v;if(!b)return null;if(b.type==="source"&&((v=b.properties)!=null&&v.src))return b.properties.src;if(b.children)for(const y of b.children){const w=m(y);if(w)return w}return null},g=m({children:h});if(g)return g}return""},u=f=>{try{const m=new URL(f).pathname.split("/");return m[m.length-1]||"video.mp4"}catch{return"video.mp4"}},d=f=>f?Array.isArray(f)?f.map(h=>(h==null?void 0:h.value)||"").join("")||"video":(f==null?void 0:f.value)||"video":"video";return a.jsxs("div",{className:t?`md ${t}`:"md",children:[a.jsx(XPe,{disallowedElements:s?["file-card","personal-drive-enable-card"]:void 0,remarkPlugins:[wDe],rehypePlugins:n?[nTt,cne]:[cne],components:{pre:({node:f,children:h,...m})=>{const g=FTt(h);if(g==="mermaid"||g==="echarts"){const b=s9(h).replace(/\n$/,"");return a.jsx($Tt,{label:g==="mermaid"?"Mermaid":"ECharts",language:g,source:b,streaming:i,children:g==="mermaid"?a.jsx(RTt,{source:b}):a.jsx(ATt,{source:b})})}return a.jsx("pre",{...m,children:h})},a:({node:f,...h})=>{const m=h.href,g=s&&qst(m);if(g)return a.jsx(Wst,{...s,path:g,children:h.children});if(m&&(ZMe(m)||BTt(f))){const b=m,v=d(f==null?void 0:f.children);return a.jsxs("div",{className:"video-container",children:[a.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":r("markdown.playVideo",{name:v}),onClick:()=>l({src:b,title:v}),children:[a.jsx("video",{src:b,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),a.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:a.jsx(aE,{})})]}),a.jsx("div",{className:"video-caption",children:a.jsx("a",{href:b,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:v})})]})}return a.jsx("a",{...h,target:"_blank",rel:"noopener noreferrer"})},img:({node:f,src:h,alt:m,...g})=>{const b=a.jsx("img",{...g,src:h,alt:m??"",loading:"lazy"});return h?a.jsx(BAe,{src:h,children:a.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":r("markdown.enlargeImage",{name:m||r("markdown.image")}),children:[b,a.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:a.jsx(aE,{})})]})}):b},video:({node:f,src:h,children:m,...g})=>{const b=c({src:h},m);return b?a.jsx("div",{className:"video-container",children:a.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":r("markdown.enlargeVideo"),onClick:()=>l({src:b}),children:[a.jsx("video",{src:b,...g,playsInline:!0,className:"video-thumbnail",children:m}),a.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:a.jsx(aE,{})})]})}):a.jsx("video",{src:h,controls:!0,playsInline:!0,className:"video-inline",...g,children:m})}},children:e}),o&&a.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":r("markdown.videoPreview"),onClick:()=>l(null),children:a.jsxs("div",{className:"video-viewer",onClick:f=>f.stopPropagation(),children:[a.jsxs("div",{className:"video-viewer-header",children:[a.jsx("div",{className:"video-viewer-title",children:o.title||u(o.src)}),a.jsxs("nav",{className:"video-viewer-nav",children:[a.jsx("a",{href:o.src,download:o.title||u(o.src),"aria-label":r("markdown.downloadVideo"),title:r("markdown.downloadVideo"),className:"video-viewer-download",children:a.jsx(JD,{})}),a.jsx("button",{type:"button",className:"video-viewer-close","aria-label":r("markdown.close"),onClick:()=>l(null),children:a.jsx(Bo,{})})]})]}),a.jsx("div",{className:"video-viewer-body",children:a.jsx("video",{src:o.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const Nd=p.memo(UTt);function P4(e){return(e==null?void 0:e.trim())||Cb("resourceMetadata.unknownSource")}function JMe(e){return(e==null?void 0:e.trim())||Cb("resourceMetadata.unknownCreator")}function QTt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5 5.5A2.5 2.5 0 0 1 7.5 3H19v16H7.5A2.5 2.5 0 0 0 5 21.5v-16Z"}),a.jsx("path",{d:"M5 18.5A2.5 2.5 0 0 1 7.5 16H19"}),a.jsx("path",{d:"M9 7h6M9 10h4"})]})}function zTt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3h8l4 4v14H6V3Z"}),a.jsx("path",{d:"M14 3v5h5M9 12h6M9 16h6"})]})}function VTt(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m7 7 10 10M17 7 7 17"})})}function HTt(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 5v14M5 12h14"})})}function kT({title:e,children:t,onClose:n,busy:i=!1,className:r=""}){const{t:s}=_e("ui"),o=p.useId(),l=p.useRef(null),c=p.useRef(null),u=p.useRef(i),d=p.useRef(n);return p.useEffect(()=>{u.current=i,d.current=n},[i,n]),p.useEffect(()=>{var g;const f=document.activeElement instanceof HTMLElement?document.activeElement:null,h=document.body.style.overflow;document.body.style.overflow="hidden",(g=l.current)==null||g.focus();const m=b=>{if(b.key==="Escape"&&!u.current){d.current();return}if(b.key!=="Tab")return;const v=c.current;if(!v)return;const y=Array.from(v.querySelectorAll('button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), a[href], audio[controls], video[controls], iframe, [tabindex]:not([tabindex="-1"])')).filter(k=>k.getClientRects().length>0);if(y.length===0){b.preventDefault();return}const w=y[0],x=y[y.length-1];b.shiftKey&&(document.activeElement===w||!v.contains(document.activeElement))?(b.preventDefault(),x.focus()):!b.shiftKey&&(document.activeElement===x||!v.contains(document.activeElement))&&(b.preventDefault(),w.focus())};return window.addEventListener("keydown",m),()=>{window.removeEventListener("keydown",m),document.body.style.overflow=h,f!=null&&f.isConnected&&f.focus()}},[]),vi.createPortal(a.jsx("div",{className:"knowledge-dialog-backdrop",onMouseDown:f=>{f.target===f.currentTarget&&!i&&n()},children:a.jsxs("section",{ref:c,className:`knowledge-dialog${r?` ${r}`:""}`,role:"dialog","aria-modal":"true","aria-labelledby":o,"aria-busy":i||void 0,children:[a.jsxs("header",{className:"knowledge-dialog__header",children:[a.jsx("h2",{id:o,children:e}),a.jsx("button",{ref:l,type:"button",onClick:n,disabled:i,"aria-label":s("common.close"),children:a.jsx(VTt,{})})]}),t]})}),document.body)}function jC({message:e}){return e?a.jsx("div",{className:"knowledge-form-error",role:"alert",children:e}):null}function a9(e){return e instanceof DOMException&&e.name==="AbortError"}function qTt(e,t){if(!e)return"";const n=Date.parse(e);return Number.isFinite(n)?new Intl.DateTimeFormat(t,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(n):e}const eLe=[".jpg",".jpeg",".png"].join(","),WTt=new Set(eLe.split(",")),tLe=[".pdf",".pptx",".docx",".xlsx",".txt"].join(","),KTt=new Set(tLe.split(",")),GTt=200*1024*1024;function o9(e){const t=e.lastIndexOf(".");return t<0?"":e.slice(t).toLocaleLowerCase()}function XTt(e,t,n){return e.size>GTt?n("knowledge.errors.fileTooLarge"):t==="image"?WTt.has(o9(e.name))?"":n("knowledge.errors.invalidImageType"):KTt.has(o9(e.name))?"":n("knowledge.errors.invalidDocumentType")}function oq(e){return e<=0?"-":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function l9(e){var r;const t=e.type.trim().replace(/^\./,"");if(t)return t.toUpperCase();const n=e.name.trim(),i=n.includes(".")?(r=n.split(".").pop())==null?void 0:r.trim():"";return i?i.toUpperCase():"-"}function YTt({region:e,onClose:t,onCreated:n}){const{t:i}=_e("ui"),[r,s]=p.useState(""),[o,l]=p.useState(""),[c,u]=p.useState(!1),[d,f]=p.useState(!1),[h,m]=p.useState(""),g=r.trim(),b=!!(g&&!/^[A-Za-z][A-Za-z0-9_]{0,47}$/.test(g)),v=async y=>{if(y.preventDefault(),u(!0),!g||b)return;f(!0),m("");const w={name:g,description:o.trim()||void 0,region:e};try{n(await Ibt(w))}catch(x){m(Sl(x,i("knowledge.errors.createBase")))}finally{f(!1)}};return a.jsx(kT,{title:i("knowledge.createBase"),onClose:t,busy:d,children:a.jsxs("form",{onSubmit:y=>void v(y),children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:i("common.name")}),a.jsx("input",{autoFocus:!0,value:r,maxLength:48,"aria-invalid":c&&b||void 0,"aria-describedby":"knowledge-name-help",onBlur:()=>u(!0),onChange:y=>s(y.target.value)})]}),a.jsx("p",{id:"knowledge-name-help",className:`knowledge-dialog__note${c&&b?" is-error":""}`,role:c&&b?"alert":void 0,children:i(c&&b?"knowledge.invalidName":"knowledge.nameHelp")}),a.jsxs("label",{children:[a.jsx("span",{children:i("knowledge.optionalDescription")}),a.jsx("textarea",{value:o,maxLength:80,onChange:y=>l(y.target.value)})]}),a.jsx(jC,{message:h})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:t,disabled:d,children:i("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:d||!g||b,children:i(d?"common.creating":"common.create")})]})]})})}function ZTt({item:e,onClose:t,onUpdated:n}){const{t:i}=_e("ui"),[r,s]=p.useState(e.description),[o,l]=p.useState(!1),[c,u]=p.useState(""),d=async f=>{f.preventDefault(),l(!0),u("");try{n(await Pbt(e.id,e.region,{description:r.trim()}))}catch(h){u(Sl(h,i("knowledge.errors.updateBase")))}finally{l(!1)}};return a.jsx(kT,{title:i("knowledge.editBase"),onClose:t,busy:o,children:a.jsxs("form",{onSubmit:f=>void d(f),children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:i("common.name")}),a.jsx("input",{value:e.name,disabled:!0})]}),a.jsxs("label",{children:[a.jsx("span",{children:i("common.description")}),a.jsx("textarea",{autoFocus:!0,value:r,maxLength:80,onChange:f=>s(f.target.value)})]}),a.jsx("p",{className:"knowledge-dialog__note",children:i("knowledge.descriptionOnly")}),a.jsx(jC,{message:c})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:t,disabled:o,children:i("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:o,children:i(o?"common.saving":"common.save")})]})]})})}function nLe(e,t){if(!e.trim())return{};const n=JSON.parse(e);if(!n||Array.isArray(n)||typeof n!="object")throw new Error(t);return n}function JTt({base:e,onClose:t,onCreated:n,onAssociationInvalid:i}){const{t:r}=_e("ui"),[s,o]=p.useState("document"),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(""),[m,g]=p.useState(null),[b,v]=p.useState(!1),[y,w]=p.useState("{}"),[x,k]=p.useState(""),[S,O]=p.useState(""),[A,E]=p.useState(null),j=p.useRef(null),T=p.useRef(null),R=p.useRef(null),C=p.useRef(0),N=!!x;p.useEffect(()=>{var L;A&&!N&&((L=R.current)==null||L.focus())},[N,A]);const P=L=>{N||L===s||(o(L),g(null),h(""),c(""),d(""),O(""),E(null),v(!1),C.current=0,j.current&&(j.current.value=""))},I=L=>{if(!L||s==="web")return;const F=XTt(L,s,r);if(F){g(null),c(""),d(""),O(F);return}g(L),O(""),c(L.name.replace(/\.[^.]+$/,"")),d(o9(L.name).slice(1))},D=async L=>{if(L.preventDefault(),s==="web"?!f.trim():!m)return;let F;try{F=nLe(y,r("knowledge.errors.metadataObject"))}catch(M){O(Sl(M,r("knowledge.errors.metadataFormat")));return}k(s==="web"?A?"save":"preview":"upload"),O("");try{if(s==="web")if(A){const M={sourceType:"url",metadata:A.metadata,url:A.preview.url,sourceTitle:A.preview.name,sourceMarkdown:A.preview.sourceMarkdown};await $bt(e.id,e.region,M),n()}else{const M=await Fbt(e.id,e.region,{url:f.trim()});if(!M.sourceMarkdown.trim())throw new Error(r("knowledge.errors.noWebPreview"));E({preview:M,metadata:F})}else m&&(await Bbt(e.id,e.region,{file:m,name:l.trim()||void 0,documentType:u.trim()||void 0,metadata:F}),n())}catch(M){M instanceof mM&&M.errorCode===cPe?i(M):O(Sl(M,r(s==="web"?A?"knowledge.errors.addWeb":"knowledge.errors.previewWeb":"knowledge.errors.uploadFile")))}finally{k("")}},_=()=>{N||(E(null),O(""),requestAnimationFrame(()=>{var L;return(L=T.current)==null?void 0:L.focus()}))};return a.jsx(kT,{title:r(A?"knowledge.previewWeb":"knowledge.addData"),onClose:t,busy:N,className:A?"knowledge-dialog--preview knowledge-dialog--web-confirm":"",children:a.jsx("form",{onSubmit:L=>void D(L),children:A?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"knowledge-preview knowledge-web-preview",children:[a.jsxs("div",{className:"knowledge-preview__meta",children:[a.jsx("strong",{title:A.preview.name,children:A.preview.name}),a.jsx("a",{href:A.preview.url,target:"_blank",rel:"noopener noreferrer",children:r("knowledge.openOriginalWeb")})]}),a.jsx("div",{className:"knowledge-preview__body","aria-live":"polite",children:a.jsx("div",{className:"knowledge-preview__markdown-shell",children:a.jsx(Nd,{text:A.preview.sourceMarkdown,allowRawHtml:!1,className:"knowledge-preview__markdown"})})}),S?a.jsx("div",{className:"knowledge-web-preview__error",children:a.jsx(jC,{message:S})}):null]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",className:"is-back",onClick:_,disabled:N,children:r("knowledge.backToEdit")}),a.jsx("button",{type:"button",onClick:t,disabled:N,children:r("common.cancel")}),a.jsx("button",{ref:R,type:"submit",className:"is-primary",disabled:N,children:r(x==="save"?"common.adding":"knowledge.confirmAdd")})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsx("div",{className:"knowledge-source-tabs",role:"tablist","aria-label":r("knowledge.source"),children:[["image",r("knowledge.image")],["document",r("knowledge.documentFile")],["web",r("knowledge.webPage")]].map(([L,F])=>a.jsx("button",{type:"button",role:"tab",id:`knowledge-source-${L}-tab`,"aria-controls":`knowledge-source-${L}-panel`,"aria-selected":s===L,tabIndex:s===L?0:-1,className:s===L?"is-active":"",disabled:N,onClick:()=>P(L),onKeyDown:M=>{const H=["image","document","web"];if(!["ArrowLeft","ArrowRight","Home","End"].includes(M.key))return;M.preventDefault();const q=H.indexOf(L),U=M.key==="Home"?H[0]:M.key==="End"?H[H.length-1]:H[(q+(M.key==="ArrowRight"?1:-1)+H.length)%H.length];P(U),requestAnimationFrame(()=>{var Z;return(Z=document.getElementById(`knowledge-source-${U}-tab`))==null?void 0:Z.focus()})},children:F},L))}),a.jsx("div",{id:`knowledge-source-${s}-panel`,className:"knowledge-source-panel",role:"tabpanel","aria-labelledby":`knowledge-source-${s}-tab`,children:s==="web"?a.jsxs(a.Fragment,{children:[a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.webUrl")}),a.jsx("input",{ref:T,autoFocus:!0,type:"url",value:f,disabled:N,onChange:L=>{h(L.target.value),O("")},placeholder:"https://example.com/article"})]}),a.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:x==="preview"?a.jsx(on,{children:r("knowledge.generatingWebPreview")}):null})]}):a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:j,className:"knowledge-upload-input",type:"file","aria-label":r("knowledge.selectFile"),accept:s==="image"?eLe:tLe,disabled:N,onChange:L=>{var F;I(((F=L.currentTarget.files)==null?void 0:F[0])??null),L.currentTarget.value=""}}),a.jsxs("button",{type:"button",className:`knowledge-upload-dropzone${b?" is-dragging":""}${m?" is-ready":""}`,disabled:N,onClick:()=>{var L;return(L=j.current)==null?void 0:L.click()},onDragEnter:L=>{L.preventDefault(),!N&&(C.current+=1,v(!0))},onDragOver:L=>{L.preventDefault(),N||(L.dataTransfer.dropEffect="copy")},onDragLeave:L=>{L.preventDefault(),C.current=Math.max(0,C.current-1),C.current===0&&v(!1)},onDrop:L=>{var F;L.preventDefault(),C.current=0,v(!1),N||I(((F=L.dataTransfer.files)==null?void 0:F[0])??null)},children:[a.jsx("strong",{children:m?m.name:r("knowledge.selectOrDropFile")}),a.jsx("span",{children:m?r("knowledge.selectedFile",{size:oq(m.size)}):r(s==="image"?"knowledge.imageFileHelp":"knowledge.documentFileHelp")})]}),a.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:N?a.jsx(on,{children:r("knowledge.uploadingFile")}):null})]})}),s!=="web"?a.jsxs("div",{className:"knowledge-dialog__fields",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.optionalName")}),a.jsx("input",{value:l,disabled:N,maxLength:256,onChange:L=>c(L.target.value)})]}),a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.optionalType")}),a.jsx("input",{value:u,disabled:N,maxLength:64,onChange:L=>d(L.target.value),placeholder:"pdf, docx, png"})]})]}):null,a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.metadataJson")}),a.jsx("textarea",{className:"is-code",value:y,disabled:N,onChange:L=>w(L.target.value),spellCheck:!1})]}),a.jsx(jC,{message:S})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:t,disabled:N,children:r("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:N||(s==="web"?!f.trim():!m),children:r(N?s==="web"?"common.generating":"common.uploading":s==="web"?"knowledge.generatePreview":"knowledge.uploadFile")})]})]})})})}function e2t({base:e,item:t,onClose:n,onUpdated:i}){const{t:r}=_e("ui"),[s,o]=p.useState(()=>JSON.stringify(t.metadata??{},null,2)),[l,c]=p.useState(!1),[u,d]=p.useState(""),f=async h=>{h.preventDefault();let m;try{m=nLe(s,r("knowledge.errors.metadataObject"))}catch(g){d(Sl(g,r("knowledge.errors.metadataFormat")));return}c(!0),d("");try{i(await Ubt(e.id,t.id,e.region,{metadata:m}))}catch(g){d(Sl(g,r("knowledge.errors.updateDocument")))}finally{c(!1)}};return a.jsx(kT,{title:r("knowledge.editMetadata"),onClose:n,busy:l,children:a.jsxs("form",{onSubmit:h=>void f(h),children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.knowledge")}),a.jsx("input",{value:t.name||t.id,disabled:!0})]}),a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.metadataJson")}),a.jsx("textarea",{autoFocus:!0,className:"is-code knowledge-metadata-editor",value:s,onChange:h=>o(h.target.value),spellCheck:!1})]}),a.jsx(jC,{message:u})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:n,disabled:l,children:r("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:l,children:r(l?"common.saving":"common.save")})]})]})})}const iLe=new Set(["avif","bmp","gif","jpeg","jpg","png","svg","webp"]),rLe=new Set(["aac","flac","m4a","mp3","ogg","wav","webm"]),sLe=new Set(["m4v","mov","mp4","mpeg","mpg","ogg","webm"]),t2t=new Set(["pdf"]),n2t=new Set(["doc","docx","ppt","pptx","xls","xlsx"]),i2t=new Set(["creating","indexing","pending","processing","queued","submitted"]),r2t=new Set(["error","failed","unavailable"]);function Nne(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function j_(e){if(e==null||e==="")return"-";if(["string","number","boolean"].includes(typeof e))return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function s2t(e,t){if(Array.isArray(e)){if(e.length===0)return null;const r=e.map(Nne);if(r.some(s=>Object.keys(s).length>0)){const s=[...new Set(r.flatMap(o=>Object.keys(o)))];return{columns:s,rows:r.map(o=>s.map(l=>j_(o[l])))}}return{columns:[t("knowledge.value")],rows:e.map(s=>[j_(s)])}}const n=Nne(e),i=Object.entries(n);if(i.length===0)return null;if(i.every(([,r])=>Array.isArray(r))){const r=i.map(([o])=>o),s=Math.max(...i.map(([,o])=>o.length));return{columns:r,rows:Array.from({length:s},(o,l)=>i.map(([,c])=>j_(c[l])))}}return{columns:[t("knowledge.field"),t("knowledge.value")],rows:i.map(([r,s])=>[r,j_(s)])}}function aLe(e){const t=e.trim();if(!t||t.startsWith("//"))return"";if(t.startsWith("/"))return t;try{const n=new URL(t);return["http:","https:"].includes(n.protocol)?n.href:""}catch{return""}}function a2t(e){const t=aLe(e);return t.startsWith("http://")||t.startsWith("https://")?t:""}function o2t(e){var r;const t=e.attachmentType.trim().toLocaleLowerCase();if(t==="image"||t==="doc-image"||t.startsWith("image/"))return"image";if(t==="audio"||t.startsWith("audio/"))return"audio";if(t==="video"||t.startsWith("video/"))return"video";if(t==="pdf"||t==="application/pdf")return"pdf";const n=e.attachmentUrl.split(/[?#]/,1)[0],i=n.includes(".")?((r=n.split(".").pop())==null?void 0:r.toLocaleLowerCase())??"":"";return iLe.has(i)?"image":rLe.has(i)?"audio":sLe.has(i)?"video":t2t.has(i)?"pdf":t||i?"file":"none"}function l2t(e,t){const n=e.status.trim().toLocaleLowerCase();if(i2t.has(n))return{title:t("knowledge.preview.processingTitle"),detail:t("knowledge.preview.processingDetail")};if(r2t.has(n))return{title:t("knowledge.preview.failedTitle"),detail:t("knowledge.preview.failedDetail")};const i=l9(e).toLocaleLowerCase();return i==="pdf"||n2t.has(i)?{title:t("knowledge.preview.noParsedTitle"),detail:t("knowledge.preview.noParsedDetail")}:iLe.has(i)||rLe.has(i)||sLe.has(i)?{title:t("knowledge.preview.noMediaTitle"),detail:t("knowledge.preview.noMediaDetail")}:{title:t("knowledge.preview.noDataTitle"),detail:t("knowledge.preview.noDataDetail")}}function c2t({chunk:e}){const{t}=_e("ui"),[n,i]=p.useState(!1),r=aLe(e.attachmentUrl),s=o2t(e);return!r||s==="none"?null:n?a.jsx("div",{className:"knowledge-preview__attachment-error",children:t("knowledge.preview.attachmentError")}):s==="image"?a.jsx("img",{className:"knowledge-preview__image",src:r,alt:e.title||t("knowledge.preview.imageAlt"),loading:"lazy",onError:()=>i(!0)}):s==="audio"?a.jsx("audio",{className:"knowledge-preview__audio",src:r,controls:!0,preload:"metadata",onError:()=>i(!0),children:t("knowledge.preview.audioUnsupported")}):s==="video"?a.jsx("video",{className:"knowledge-preview__video",src:r,controls:!0,playsInline:!0,preload:"metadata",onError:()=>i(!0),children:t("knowledge.preview.videoUnsupported")}):s==="pdf"?a.jsxs("div",{className:"knowledge-preview__pdf",children:[a.jsx("iframe",{src:r,title:e.title?t("knowledge.preview.namedPdf",{name:e.title}):t("knowledge.preview.pdf"),sandbox:"",referrerPolicy:"no-referrer",onError:()=>i(!0)}),a.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:t("knowledge.preview.openPdf")})]}):a.jsxs("div",{className:"knowledge-preview__file-fallback",children:[a.jsx("p",{children:t("knowledge.preview.fileUnsupported")}),a.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:t("knowledge.preview.openOriginalFile")})]})}function u2t({base:e,item:t,onClose:n}){const{t:i}=_e("ui"),[r,s]=p.useState([]),[o,l]=p.useState(t),[c,u]=p.useState(""),[d,f]=p.useState(!0),[h,m]=p.useState(!1),[g,b]=p.useState(!1),[v,y]=p.useState(""),w=p.useRef(0),x=p.useRef(null),k=p.useCallback(async(E=0)=>{var R;(R=x.current)==null||R.abort();const j=new AbortController;x.current=j;const T=w.current+1;w.current=T,E>0?m(!0):f(!0),y(""),E===0&&(s([]),b(!1));try{const C=await Lbt(e.id,t.id,{region:e.region,offset:E,signal:j.signal});if(w.current!==T)return;l(C.document.id?C.document:t),u(C.sourceMarkdown||C.document.sourceMarkdown),s(N=>E>0?[...N,...C.chunks]:C.chunks),b(C.hasMore)}catch(C){!a9(C)&&w.current===T&&y(Sl(C,i("knowledge.errors.loadPreview")))}finally{w.current===T&&(f(!1),m(!1))}},[e.id,e.region,t,i]);p.useEffect(()=>(k(),()=>{var E;(E=x.current)==null||E.abort(),w.current+=1}),[k]);const S=a2t(o.url||t.url),O=l2t(o,i),A=o.metadata._veadk_content_format==="markdown";return a.jsx(kT,{title:o.name||t.name||t.id,onClose:n,className:"knowledge-dialog--preview",children:a.jsxs("div",{className:"knowledge-preview",children:[o.sizeBytes>0||S?a.jsxs("div",{className:"knowledge-preview__meta",children:[o.sizeBytes>0?a.jsx("span",{children:oq(o.sizeBytes)}):null,S?a.jsx("a",{href:S,target:"_blank",rel:"noopener noreferrer",children:i("knowledge.openOriginalWeb")}):null]}):null,a.jsx("div",{className:"knowledge-preview__body","aria-live":"polite",children:c?a.jsx("div",{className:"knowledge-preview__markdown-shell",children:a.jsx(Nd,{text:c,allowRawHtml:!1,className:"knowledge-preview__markdown"})}):d?a.jsx("div",{className:"knowledge-preview__state",role:"status",children:a.jsx(on,{as:"span",duration:2.4,children:i("knowledge.preview.loading")})}):v&&r.length===0?a.jsxs("div",{className:"knowledge-preview__state is-error",role:"alert",children:[a.jsx("p",{children:v}),a.jsx("button",{type:"button",onClick:()=>void k(),children:i("common.retry")})]}):r.length===0?a.jsxs("div",{className:"knowledge-preview__state",children:[a.jsx("p",{children:O.title}),a.jsx("span",{children:S?i("knowledge.preview.openOriginalHint"):O.detail}),a.jsx("button",{type:"button",onClick:()=>void k(),children:i("common.reload")})]}):a.jsxs("div",{className:"knowledge-preview__chunks",children:[r.map((E,j)=>{const T=s2t(E.tableFields,i),R=E.id||`${j}:${E.title}`;return a.jsxs("article",{className:"knowledge-preview__chunk",children:[a.jsx("header",{children:a.jsx("h3",{children:E.title||i("knowledge.preview.chunk",{index:j+1})})}),E.content?A?a.jsx(Nd,{text:E.content,allowRawHtml:!1,className:"knowledge-preview__markdown"}):a.jsx("p",{className:"knowledge-preview__content",children:E.content}):null,T?a.jsx("div",{className:"knowledge-preview__table-wrap",children:a.jsxs("table",{children:[a.jsx("thead",{children:a.jsx("tr",{children:T.columns.map((C,N)=>a.jsx("th",{scope:"col",children:C},`${C}:${N}`))})}),a.jsx("tbody",{children:T.rows.map((C,N)=>a.jsx("tr",{children:C.map((P,I)=>a.jsx("td",{children:P},I))},N))})]})}):null,a.jsx(c2t,{chunk:E})]},R)}),v?a.jsx("div",{className:"knowledge-preview__more-error",role:"alert",children:v}):null,g?a.jsx("button",{type:"button",className:"knowledge-preview__load-more",disabled:h,onClick:()=>void k(r.length),children:h?a.jsx(on,{as:"span",duration:2.4,children:i("knowledge.preview.loadingMore")}):i("knowledge.preview.loadMore")}):null]})})]})})}function d2t({cloudProvider:e,region:t,active:n=!0,activationRevision:i=0,onDetailChange:r,toolbarLeading:s,toolbarFilters:o}){const{t:l,i18n:c}=_e("ui"),[u,d]=p.useState([]),[f,h]=p.useState({}),[m,g]=p.useState([]),[b,v]=p.useState(""),[y,w]=p.useState("overview"),[x,k]=p.useState(""),[S,O]=p.useState(""),[A,E]=p.useState(!0),[j,T]=p.useState(!1),[R,C]=p.useState(""),[N,P]=p.useState([]),[I,D]=p.useState(!1),[_,L]=p.useState(""),[F,M]=p.useState(""),[H,q]=p.useState(""),[U,Z]=p.useState(!1),[z,J]=p.useState(!1),[ne,W]=p.useState(!1),[X,le]=p.useState(null),[V,Y]=p.useState(null),[K,ue]=p.useState(null),[te,Oe]=p.useState(null),[fe,pe]=p.useState(null),[Se,ve]=p.useState(!1),Le=p.useRef(0),He=p.useRef(0),Ge=p.useRef([]),De=p.useRef(!1),se=p.useRef(!1),ce=p.useRef(null),ye=p.useRef(null),Ae=p.useRef({}),Ee=p.useRef(!1),Ce=p.useRef(null),Be=p.useRef(null),he=p.useRef(null),ie=p.useRef(null),we=p.useMemo(()=>[t],[t]),Re=p.useCallback(We=>`${We.region}\0${We.id}`,[]),Ue=u.find(We=>Re(We)===b)??null,_t=!!(Ue&&H===Re(Ue));p.useEffect(()=>{r==null||r(!!Ue)},[r,Ue]),p.useEffect(()=>{w("overview"),O("")},[b]);const Pt=p.useMemo(()=>{const We=x.trim().toLocaleLowerCase();return We?u.filter(vt=>[vt.name,vt.description,vt.ownerLabel,vt.providerKnowledgeId].some(Ke=>Ke.toLocaleLowerCase().includes(We))):u},[u,x]),Gt=p.useMemo(()=>{const We=S.trim().toLocaleLowerCase();return We?N.filter(vt=>[vt.name,vt.id,l9(vt)].some(Ke=>Ke.toLocaleLowerCase().includes(We))):N},[S,N]);p.useEffect(()=>{Y(null)},[Ue==null?void 0:Ue.id,Ue==null?void 0:Ue.region]);const St=p.useCallback(async(We=!1)=>{var ot;if(We&&(Ee.current||Object.keys(Ae.current).length===0))return;(ot=ce.current)==null||ot.abort();const vt=new AbortController;ce.current=vt;const Ke=Le.current+1;Le.current=Ke,Ee.current=!0,We?T(!0):E(!0),C(""),We||g([]);try{const it=await Rbt({regions:we,nextTokens:We?Ae.current:void 0,signal:vt.signal});if(Le.current!==Ke)return;d(Ct=>We?[...Ct,...it.items.filter(Ot=>!Ct.some(Bt=>Re(Bt)===Re(Ot)))]:it.items),Ae.current=it.nextTokens,h(it.nextTokens);const tt=it.failures.map(({region:Ct,error:Ot})=>`${Sh(Ct,e)}: ${Sl(Ot,l("common.loadFailed"))}`);g(Ct=>We?[...new Set([...Ct,...tt])]:tt),We||v(Ct=>it.items.some(Ot=>Re(Ot)===Ct)?Ct:"")}catch(it){if(a9(it))return;Le.current===Ke&&(We?g(tt=>[...new Set([...tt,Sl(it,l("knowledge.errors.loadMoreBases"))])]):C(Sl(it,l("knowledge.errors.loadBases"))))}finally{Le.current===Ke&&(Ee.current=!1,E(!1),T(!1))}},[Re,e,we,l]),Lt=p.useCallback(async(We,vt=!1)=>{var it;if(vt&&De.current)return;(it=ye.current)==null||it.abort();const Ke=new AbortController;ye.current=Ke;const ot=He.current+1;He.current=ot,vt||(Ge.current=[],se.current=!1,P([]),Z(!1),M("")),De.current=!0,D(!0),vt?M(""):L("");try{const tt=await Mbt(We.id,{region:We.region,offset:vt?Ge.current.length:0,signal:Ke.signal});if(He.current!==ot)return;q(Dt=>Dt===Re(We)?"":Dt);const Ct=Ge.current,Ot=vt?[...Ct,...tt.items.filter(Dt=>!Dt.id||!Ct.some(Ze=>Ze.id===Dt.id))]:tt.items,Bt=tt.hasMore&&(!vt||Ot.length>Ct.length);Ge.current=Ot,se.current=Bt,P(Ot),Z(Bt)}catch(tt){if(a9(tt))return;He.current===ot&&(tt instanceof mM&&tt.errorCode===cPe&&(q(Re(We)),le(Ot=>Ot&&Re(Ot)===Re(We)?null:Ot)),vt?M(Sl(tt,l("knowledge.errors.loadMoreData"))):L(Sl(tt,l("knowledge.errors.loadData"))))}finally{He.current===ot&&(De.current=!1,D(!1))}},[Re,l]);p.useEffect(()=>{var We;(We=ce.current)==null||We.abort(),Le.current+=1,Ee.current=!1,Ae.current={},d([]),h({}),g([]),v(""),q(""),C(""),E(!0)},[e]),p.useEffect(()=>{if(n)return St(),()=>{var We;(We=ce.current)==null||We.abort(),Le.current+=1,Ee.current=!1}},[n,i,St]),p.useEffect(()=>{var We,vt;if(!n){(We=ye.current)==null||We.abort(),He.current+=1,De.current=!1;return}if(!Ue){(vt=ye.current)==null||vt.abort(),He.current+=1,Ge.current=[],De.current=!1,se.current=!1,P([]),Z(!1),M("");return}return Lt(Ue),()=>{var Ke;(Ke=ye.current)==null||Ke.abort(),He.current+=1,De.current=!1}},[n,i,Ue==null?void 0:Ue.id,Ue==null?void 0:Ue.region]);const qe=n&&!Ue&&!x.trim()&&!A&&!j&&!R&&Object.keys(f).length>0;p.useEffect(()=>{const We=Be.current,vt=Ce.current;if(!We||!vt||!qe)return;const Ke=new IntersectionObserver(([ot])=>{ot.isIntersecting&&St(!0)},{root:vt,rootMargin:"240px 0px",threshold:.01});return Ke.observe(We),()=>Ke.disconnect()},[qe,St]);const yt=()=>{const We=Ce.current;!We||!qe||We.scrollHeight-We.scrollTop-We.clientHeight<=240&&St(!0)},je=!!(Ue&&N.length>0&&U&&!I&&!F);p.useEffect(()=>{const We=ie.current,vt=he.current;if(!Ue||!We||!vt||!je)return;const Ke=new IntersectionObserver(([ot])=>{ot.isIntersecting&&Lt(Ue,!0)},{root:he.current,rootMargin:"240px 0px",threshold:.01});return Ke.observe(We),()=>Ke.disconnect()},[je,Lt,Ue==null?void 0:Ue.id,Ue==null?void 0:Ue.region]);const kt=()=>{const We=he.current;if(!Ue||!We||!se.current||De.current||F)return;const{scrollHeight:vt,scrollTop:Ke,clientHeight:ot}=We;vt-Ke-ot<=240&&Lt(Ue,!0)},Tt=We=>{d(vt=>vt.map(Ke=>Re(Ke)===Re(We)?We:Ke))},fn=async()=>{if(te){ve(!0);try{await Dbt(te.id,te.region),d(We=>We.filter(vt=>Re(vt)!==Re(te))),q(We=>We===Re(te)?"":We),b===Re(te)&&v(""),Oe(null)}catch(We){C(Sl(We,l("knowledge.errors.deleteBase"))),Oe(null)}finally{ve(!1)}}},tn=async()=>{if(!(!Ue||!fe)){ve(!0);try{await Qbt(Ue.id,fe.id,Ue.region);const We=Ge.current.filter(vt=>vt.id!==fe.id);Ge.current=We,P(We),pe(null)}catch(We){L(Sl(We,l("knowledge.errors.deleteDocument"))),pe(null)}finally{ve(!1)}}};return a.jsxs("section",{className:`knowledge-library${Ue?" is-detail":" resource-collection"}`,"aria-label":l("knowledge.library"),children:[Ue?a.jsx(dT,{className:"knowledge-library__detail",title:Ue.name,description:Ue.description||l("common.noDescription"),identitySeed:Ue.name,backLabel:l("knowledge.backToList"),onBack:()=>v(""),sections:[{key:"overview",label:l("skillCenter.overview"),content:a.jsx("section",{className:"knowledge-overview",children:a.jsxs(yH,{className:"knowledge-overview__summary",children:[a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.provider")}),a.jsx("dd",{children:Ue.providerType||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.knowledgeId")}),a.jsx("dd",{className:"knowledge-keyboard-reveal",tabIndex:0,title:Ue.providerKnowledgeId,children:Ue.providerKnowledgeId||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.project")}),a.jsx("dd",{children:Ue.projectName||"default"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.creator")}),a.jsx("dd",{children:P4(Ue.ownerLabel)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("skillCenter.updatedAt")}),a.jsx("dd",{children:qTt(Ue.updatedAt,c.resolvedLanguage??c.language)||"-"})]})]})})},{key:"data",label:l("knowledge.data"),content:a.jsx("section",{className:"knowledge-documents",children:a.jsx("div",{className:`knowledge-documents__body${N.length>0?" is-table":""}`,"aria-live":"polite",children:I&&N.length===0?a.jsx(fl,{}):_&&N.length===0?a.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[a.jsx("p",{children:_}),_t&&Ue.canManage?a.jsx("button",{type:"button",onClick:()=>Oe(Ue),children:l("knowledge.deleteInvalidAssociation")}):a.jsx("button",{type:"button",onClick:()=>void Lt(Ue),children:l("common.retry")})]}):N.length===0?a.jsxs("div",{className:"knowledge-library__state",children:[a.jsx(zTt,{}),a.jsx("p",{children:l("knowledge.noData")}),Ue.canManage&&a.jsx("button",{type:"button",onClick:()=>le(Ue),children:l("knowledge.addFirstData")})]}):a.jsx(vH,{rows:Gt,rowKey:We=>We.id,rowLabel:We=>We.name||We.id,columns:[{key:"name",header:l("common.name"),className:"is-primary-column",render:We=>a.jsx("span",{title:We.name||We.id,children:We.name||We.id})},{key:"format",header:l("knowledge.format"),className:"is-compact-column",render:We=>l9(We)},{key:"size",header:l("knowledge.size"),className:"is-compact-column",render:We=>oq(We.sizeBytes)}],searchValue:S,onSearchChange:O,searchPlaceholder:l("knowledge.searchData"),searchLabel:l("knowledge.searchLibraryData"),primaryAction:Ue.canManage?{label:l(_t?"knowledge.associationInvalid":"knowledge.addData"),disabled:_t,title:_t?l("knowledge.providerMissing"):void 0,onClick:()=>le(Ue)}:void 0,rowActions:We=>[{label:l("common.preview"),onSelect:()=>Y(We)},...Ue.canManage?[{label:l("common.edit"),onSelect:()=>ue(We)},{label:l("common.delete"),onSelect:()=>pe(We),danger:!0}]:[]],scrollRef:he,onScroll:kt,busy:I,emptyLabel:l("knowledge.noMatchingData"),footer:I?a.jsxs("div",{className:"knowledge-document-pagination",role:"status","aria-live":"polite",children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:l("knowledge.loadingMoreData")})]}):F?a.jsxs("div",{className:"knowledge-document-pagination is-error",role:"alert",children:[a.jsx("span",{children:F}),a.jsx("button",{type:"button",onClick:()=>void Lt(Ue,!0),children:l("knowledge.retryLoading")})]}):U?a.jsx("div",{ref:ie,className:"knowledge-document-pagination",role:"status","aria-live":"polite",children:l("skillCenter.scrollForMore")}):null})})})}],activeSectionKey:y,navigationLabel:l("knowledge.details"),onSectionChange:w,actions:Ue.canManage?a.jsxs(a.Fragment,{children:[a.jsx(At,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>Oe(Ue),children:l("common.delete")}),a.jsx(At,{type:"button",color:"primary",size:"lg",pill:!1,onClick:()=>W(!0),children:l("common.edit")})]}):void 0}):a.jsxs(a.Fragment,{children:[a.jsxs(ib,{className:"knowledge-library__toolbar library-resource-toolbar",children:[s,a.jsxs("div",{className:"resource-toolbar__actions",children:[o,a.jsx(em,{value:x,onChange:We=>k(We.target.value),placeholder:l("knowledge.searchBases"),"aria-label":l("knowledge.searchBases")})]})]}),a.jsxs(tm,{ref:Ce,"aria-live":"polite",onScroll:yt,children:[m.length>0&&!A&&a.jsxs("div",{className:"knowledge-region-warning",role:"status",children:[a.jsx("span",{children:l("knowledge.someBasesFailed")}),a.jsx("button",{type:"button",onClick:()=>void St(),children:l("common.retry")})]}),A&&u.length===0?a.jsx(fl,{}):R?a.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[a.jsx("p",{children:R}),a.jsx("button",{type:"button",onClick:()=>void St(),children:l("common.retry")})]}):Pt.length===0&&x.trim()?a.jsxs("div",{className:"knowledge-library__state",children:[a.jsx(QTt,{}),a.jsx("p",{children:l("knowledge.noMatchingBases")})]}):a.jsxs(zv,{children:[x.trim()?null:a.jsx(ab,{"aria-label":l("knowledge.createBase"),icon:a.jsx(HTt,{}),onClick:()=>J(!0),children:l("knowledge.createBase")}),Pt.map(We=>a.jsx(Hv,{className:"knowledge-card",title:We.name,description:We.description||l("common.noDescription"),metadata:[{label:l("knowledge.creator"),value:P4(We.ownerLabel),title:P4(We.ownerLabel)},{label:l("knowledge.project"),value:We.projectName||"default",title:We.projectName||"default"}],action:{label:H===Re(We)?l("knowledge.associationInvalid"):l("knowledge.addData"),icon:"plus",disabled:!We.canManage||H===Re(We),title:We.canManage?H===Re(We)?l("knowledge.providerMissing"):void 0:l("knowledge.noManagePermission"),onClick:()=>le(We)},detailAction:{label:l("common.viewDetails"),onClick:()=>v(Re(We))}},Re(We)))]}),qe||j?a.jsx("div",{ref:Be,className:"my-agent-load-more",role:"status","aria-live":"polite",children:j?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:l("knowledge.loadingMoreBases")})]}):qe?a.jsx("span",{children:l("skillCenter.scrollForMore")}):null}):null]})]}),z&&a.jsx(YTt,{region:t,onClose:()=>J(!1),onCreated:We=>{d(vt=>[We,...vt]),v(Re(We)),J(!1)}}),Ue&&ne&&a.jsx(ZTt,{item:Ue,onClose:()=>W(!1),onUpdated:We=>{Tt(We),W(!1)}}),Ue&&V&&a.jsx(u2t,{base:Ue,item:V,onClose:()=>Y(null)}),X&&a.jsx(JTt,{base:X,onClose:()=>le(null),onAssociationInvalid:We=>{q(Re(X)),Ue&&Re(Ue)===Re(X)&&L(Sl(We,l("knowledge.associationInvalid"))),le(null)},onCreated:()=>{Ue&&Re(Ue)===Re(X)&&Lt(Ue),le(null)}}),Ue&&K&&a.jsx(e2t,{base:Ue,item:K,onClose:()=>ue(null),onUpdated:We=>{const vt=Ge.current.map(Ke=>Ke.id===We.id?We:Ke);Ge.current=vt,P(vt),ue(null)}}),te&&a.jsx(_d,{title:l("knowledge.deleteBaseTitle"),description:l("knowledge.deleteBaseDescription",{name:te.name}),confirmLabel:l(Se?"common.deleting":"common.delete"),variant:"danger",busy:Se,onCancel:()=>Oe(null),onConfirm:()=>void fn()}),fe&&a.jsx(_d,{title:l("knowledge.deleteDocumentTitle"),description:l("knowledge.deleteDocumentDescription",{name:fe.name||fe.id}),confirmLabel:l(Se?"common.deleting":"common.delete"),variant:"danger",busy:Se,onCancel:()=>pe(null),onConfirm:()=>void tn()})]})}const f2t="_EmptyMessage_1r5gu_1",h2t="_IconBadge_1r5gu_16",p2t="_Title_1r5gu_54",m2t="_Description_1r5gu_69",g2t="_ActionRow_1r5gu_77",OT={EmptyMessage:f2t,IconBadge:h2t,Title:p2t,Description:m2t,ActionRow:g2t},qn=({children:e,className:t,fill:n="static"})=>a.jsx("div",{className:qi(OT.EmptyMessage,t),"data-fill":n,children:e}),b2t=({size:e="md",color:t="secondary",children:n,className:i})=>a.jsx("div",{className:qi(OT.IconBadge,i),"data-size":e,"data-color":t,children:n}),y2t=({children:e,className:t,color:n="secondary"})=>a.jsx("div",{className:qi(OT.Title,t),"data-color":n,children:e}),v2t=({children:e,className:t})=>a.jsx("div",{className:qi(OT.Description,t),children:e}),x2t=({children:e,className:t})=>a.jsx("div",{className:qi(OT.ActionRow,t),children:e});qn.Icon=b2t;qn.Title=y2t;qn.Description=v2t;qn.ActionRow=x2t;bn.hasResourceBundle("en-US","skills")||bn.addResourceBundle("en-US","skills",Wme,!0,!0);bn.hasResourceBundle("zh-CN","skills")||bn.addResourceBundle("zh-CN","skills",Jwe,!0,!0);function en(e,t={}){return bn.t(e,{...t,ns:"skills"})}const w2t="/web/skill-workbench";class c9 extends Error{constructor(t,n,i="SKILL_WORKBENCH_ERROR",r=!1,s="",o,l=""){super(t),this.status=n,this.code=i,this.retryable=r,this.statusText=s,this.originalError=o,this.rawResponse=l,this.name="SkillWorkbenchApiError"}}function Ed(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(en("api.invalidFormat",{label:t}));return e}function Rne(e,t){if(e!=null){if(typeof e!="string"||!e.trim()||e.trim().length>256)throw new Error(en("api.invalidFormat",{label:t}));return e.trim()}}function k2t(e){if(e!=null){if(e==="pending"||e==="ready"||e==="failed"||e==="unknown")return e;throw new Error(en("api.invalidFormat",{label:en("api.recoveryStatus")}))}}async function Ah(e,t={},n=eo){return fetch(Na(`${w2t}${e}`),{...t,headers:oc(t.headers),signal:po(t.signal,n)})}async function lq(e,t){var i;const n=await e.text().catch(()=>"");try{const r=Ed(JSON.parse(n),en("api.errorResponse")),s=r.detail&&typeof r.detail=="object"?Ed(r.detail,en("api.errorDetails")):r;return new c9(typeof s.message=="string"?s.message:t,e.status,typeof s.code=="string"?s.code:"SKILL_WORKBENCH_ERROR",s.retryable===!0,e.statusText,s.originalError&&typeof s.originalError=="object"?s.originalError:void 0,n)}catch{const r=((i=e.headers.get("content-type"))==null?void 0:i.split(";",1)[0])||en("api.missingContentType");return new c9(en("api.gatewayError",{fallback:t,status:e.status,contentType:r}),e.status,"SKILL_WORKBENCH_ERROR",!1,e.statusText,void 0,n)}}async function lb(e,t){if(!e.ok)throw await lq(e,t);const n=e.headers.get("content-type")??"";if(!n.includes("application/json")){const i=n.split(";",1)[0]||en("api.missingContentType");throw new Error(en("api.nonJson",{fallback:t,status:e.status,contentType:i}))}return e.json()}function O2t(e){return Array.isArray(e)?e.map(t=>{const n=Ed(t,en("api.activity")),i=n.kind,r=n.status;if(typeof n.id!="string"||!["status","thinking","message","tool"].includes(String(i))||!["running","done"].includes(String(r)))throw new Error(en("api.invalidActivity"));if(i==="tool"){if(typeof n.name!="string")throw new Error(en("api.invalidToolActivity"));return{id:n.id,kind:i,status:r,name:n.name,...n.input!==void 0?{args:n.input}:{},...n.output!==void 0?{response:n.output}:{}}}if(typeof n.text!="string")throw new Error(en("api.invalidTextActivity"));return{id:n.id,kind:i,status:r,text:n.text}}):[]}function S2t(e){if(e==null)return;const t=Ed(e,en("api.publication"));if(typeof t.revision!="number"||typeof t.skillId!="string"||typeof t.version!="string"||!Array.isArray(t.skillSpaceIds)||!t.skillSpaceIds.every(n=>typeof n=="string")||t.disposition!=="create-new"&&t.disposition!=="update-source"||!ED(t.region)||typeof t.projectName!="string")throw new Error(en("api.invalidFormat",{label:en("api.publication")}));return{revision:t.revision,skillId:t.skillId,version:t.version,skillSpaceIds:t.skillSpaceIds,disposition:t.disposition,region:t.region,projectName:t.projectName}}function NC(e){const t=Ed(e,en("api.task"));if(typeof t.jobId!="string"||t.operation!=="create"&&t.operation!=="optimize"||typeof t.intent!="string"||typeof t.revision!="number"||typeof t.state!="string")throw new Error(en("api.invalidFormat",{label:en("api.task")}));const n=Array.isArray(t.files)?t.files.flatMap(l=>{const c=Ed(l,en("api.file"));return typeof c.path=="string"&&typeof c.size=="number"?[{path:c.path,size:c.size}]:[]}):[];if(!["running","ready","failed","cancelled","expired","published"].includes(t.state))throw new Error(en("api.unknownTaskState"));const r=Rne(t.toolId,"Tool ID"),s=Rne(t.sessionId,"Session ID"),o=k2t(t.recoveryStatus);return{jobId:t.jobId,operation:t.operation,intent:t.intent,...typeof t.model=="string"?{model:t.model}:{},...typeof t.style=="string"?{style:t.style}:{},...typeof t.requestedName=="string"?{requestedName:t.requestedName}:{},revision:t.revision,...r?{toolId:r}:{},...s?{sessionId:s}:{},...typeof t.sessionTtlSeconds=="number"?{sessionTtlSeconds:t.sessionTtlSeconds}:{},...typeof t.expiresAt=="string"?{expiresAt:t.expiresAt}:{},...typeof t.recoveryAvailable=="boolean"?{recoveryAvailable:t.recoveryAvailable}:{},...o?{recoveryStatus:o}:{},...typeof t.recoveredFromSnapshot=="boolean"?{recoveredFromSnapshot:t.recoveredFromSnapshot}:{},state:t.state,stage:typeof t.stage=="string"?t.stage:"generating",activities:O2t(t.activities),files:n,...t.source&&typeof t.source=="object"?{source:t.source}:{},...typeof t.name=="string"?{name:t.name}:{},...typeof t.description=="string"?{description:t.description}:{},...typeof t.skillMd=="string"?{skillMd:t.skillMd}:{},...typeof t.error=="string"?{error:t.error}:{},...t.validation&&typeof t.validation=="object"?{validation:t.validation}:{},...t.publication?{publication:S2t(t.publication)}:{}}}async function _M(e){const t=Ed(await lb(await Ah("/capabilities",{signal:e}),en("api.loadCapability")),en("api.capability"));return{enabled:t.enabled===!0,reason:typeof t.reason=="string"?t.reason:"",operations:Array.isArray(t.operations)?t.operations.filter(n=>n==="create"||n==="optimize"):[],models:Array.isArray(t.models)?t.models.flatMap(n=>{if(!n||typeof n!="object")return[];const i=n;return typeof i.id=="string"&&typeof i.label=="string"?[{id:i.id,label:i.label}]:[]}):[],styles:t.styles&&typeof t.styles=="object"&&!Array.isArray(t.styles)?Object.fromEntries(Object.entries(t.styles).filter(n=>typeof n[1]=="string")):{},...typeof t.maxUploadBytes=="number"?{maxUploadBytes:t.maxUploadBytes}:{}}}async function E2t(e){if(e.file){const n=new URLSearchParams({operation:"optimize",intent:e.intent});e.jobId&&n.set("job_id",e.jobId),e.model&&n.set("model",e.model),e.style&&n.set("style",e.style),e.name&&n.set("name",e.name);const i=await Ah(`/tasks/from-upload?${n}`,{method:"POST",body:e.file,headers:{"Content-Type":"application/zip"},signal:e.signal},yr);return NC(await lb(i,en("api.startOptimization")))}const t=await Ah("/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operation:e.operation,intent:e.intent,...e.model?{model:e.model}:{},...e.style?{style:e.style}:{},...e.name?{name:e.name}:{},...e.jobId?{jobId:e.jobId}:{},...e.source?{source:{kind:"skill-center",skillId:e.source.skillId,skillName:e.source.name,version:e.source.version,region:e.source.region,projectName:e.source.projectName,skillSpaceId:e.source.skillSpaceId,skillSpaceName:e.source.skillSpaceName}}:{}}),signal:e.signal},yr);return NC(await lb(t,en("api.startTask")))}async function C2t(e,t){return NC(await lb(await Ah(`/tasks/${encodeURIComponent(e)}`,{signal:t}),en("api.loadTask")))}async function D4(e,t,n){const i=new URLSearchParams;i.set("expected_revision",String(t));const r=Ed(await lb(await Ah(`/tasks/${encodeURIComponent(e)}/artifact?${i.toString()}`,{signal:n}),en("api.loadArtifact")),en("api.artifact"));if(r.jobId!==e||r.revision!==t||!Number.isSafeInteger(r.revision)||r.revision<1||typeof r.sha256!="string"||!/^[0-9a-f]{64}$/.test(r.sha256)||typeof r.name!="string"||typeof r.description!="string"||!Array.isArray(r.files))throw new Error(en("api.invalidFormat",{label:en("api.artifact")}));const s=r.files.map(o=>{const l=Ed(o,en("api.artifactFile"));if(typeof l.path!="string"||typeof l.size!="number"||typeof l.content!="string")throw new Error(en("api.invalidFormat",{label:en("api.artifactFile")}));return{path:l.path,size:l.size,content:l.content}});return{jobId:r.jobId,revision:r.revision,sha256:r.sha256,name:r.name,description:r.description,files:s}}async function M4(e){const t=await Ah(`/tasks/${encodeURIComponent(e.jobId)}/refinements`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({intent:e.intent,expectedRevision:e.expectedRevision})},yr);return NC(await lb(t,en("api.refine")))}async function A2t(e){const t=await Ah(`/tasks/${encodeURIComponent(e.jobId)}/stop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedRevision:e.expectedRevision})});return NC(await lb(t,en("api.stop")))}async function T2t(e){const t=await Ah(`/tasks/${encodeURIComponent(e.jobId)}/publish-stream`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/x-ndjson"},body:JSON.stringify({disposition:e.disposition,expectedRevision:e.expectedRevision,expectedArtifactSha256:e.expectedArtifactSha256,skillSpaceIds:e.skillSpaceIds??[],projectName:e.projectName,region:e.region}),signal:e.signal},0);if(!t.ok)throw await lq(t,en("api.publish"));if(!(t.headers.get("content-type")??"").includes("application/x-ndjson"))throw new Error(en("api.nonNdjson"));if(!t.body)throw new Error(en("api.missingStream"));const i=new Set(["preparing","uploading","registering","activating","publishing"]);let r=null,s="";const o=new TextDecoder,l=t.body.getReader(),c=u=>{var h;if(!u.trim())return;const d=Ed(JSON.parse(u),en("api.publishProgress"));if(d.type==="progress"){if(typeof d.phase!="string"||!i.has(d.phase)||typeof d.message!="string")throw new Error(en("api.invalidPublishProgress"));(h=e.onProgress)==null||h.call(e,{phase:d.phase,message:d.message});return}if(d.type==="error"){const m=Ed(d.error,en("api.publishError"));throw new c9(typeof m.message=="string"?m.message:en("api.publish"),500,typeof m.code=="string"?m.code:"SKILL_PUBLISH_FAILED",m.retryable===!0,"",m.originalError&&typeof m.originalError=="object"?m.originalError:void 0,JSON.stringify(d.error))}if(d.type!=="complete")throw new Error(en("api.unknownPublishEvent"));const f=Ed(d.result,en("api.publishResult"));if(typeof f.skillId!="string"||typeof f.version!="string"||!Array.isArray(f.skillSpaceIds)||!f.skillSpaceIds.every(m=>typeof m=="string")||f.disposition!=="create-new"&&f.disposition!=="update-source"||!ED(f.region)||typeof f.projectName!="string")throw new Error(en("api.invalidFormat",{label:en("api.publishResult")}));r={skillId:f.skillId,version:f.version,skillSpaceIds:f.skillSpaceIds,disposition:f.disposition,region:f.region,projectName:f.projectName}};for(;;){const{value:u,done:d}=await l.read();s+=o.decode(u,{stream:!d});const f=s.split(` -`);if(s=f.pop()??"",f.forEach(c),d)break}if(c(s),!r)throw new Error(en("api.streamEnded"));return r}async function _2t(e){await lb(await Ah(`/tasks/${encodeURIComponent(e)}`,{method:"DELETE"}),en("api.deleteTask"))}async function j2t(e,t,n){var c;const i=new URLSearchParams;i.set("expected_revision",String(t)),i.set("expected_sha256",n);const r=await Ah(`/tasks/${encodeURIComponent(e)}/download?${i.toString()}`,{},yr);if(!r.ok)throw await lq(r,en("api.download"));const o=((c=(r.headers.get("content-disposition")??"").match(/filename="([^"]+)"/))==null?void 0:c[1])??"skill.zip",l=URL.createObjectURL(await r.blob());try{const u=document.createElement("a");u.href=l,u.download=o,u.click()}finally{URL.revokeObjectURL(l)}}const oLe=p.createContext(void 0);function Xv(e){const t=p.useContext(oLe);if(t===void 0&&!e)throw new Error(Uc(47));return t}const N2t={...vje,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class R2t extends $D{constructor(n,i,r){const s=new uV;super(I2t(n,s,i,r),P2t(s),N2t);Zt(this,"setOpen",(n,i)=>{var f,h;const r=i.reason===vu,s=i.reason===e1&&i.event.detail===0,o=!n&&(i.reason===R_e||i.reason==null),l=lst(i),c=this.select("activeTriggerId");if(!n&&i.reason===N_e&&i.trigger==null&&c!=null&&(i.trigger=this.context.triggerElements.getById(c)??this.select("activeTriggerElement")??void 0),(h=(f=this.context).onOpenChange)==null||h.call(f,n,i),i.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,i);const u=()=>{const m={open:n,openChangeReason:i.reason};uje(m,n,i.trigger,l()),this.update(m)};r?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(Mit,()=>{this.set("stickIfOpen",!1)}),vi.flushSync(u)):u();let d;s?d="click":o?d="dismiss":i.reason===fC&&(d="focus"),this.set("instantType",d)})}}function I2t(e,t,n,i=!1){const r={...gje(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return r.open&&(e==null?void 0:e.mounted)===void 0&&(r.mounted=!0),r.floatingRootContext=bje(t,n,i),r}function P2t(e){return{popupRef:p.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:p.createRef(),beforeContentFocusGuardRef:p.createRef(),stickIfOpenTimeout:new Qu,triggerElements:e}}function Ine({props:e}){const{children:t,open:n,defaultOpen:i=!1,onOpenChange:r,onOpenChangeComplete:s,modal:o=!1,handle:l,triggerId:c,defaultTriggerId:u=null}=e,d=M2t(l,{modal:o,open:i,openProp:n,activeTriggerId:u,triggerIdProp:c});d.useControlledProp("openProp",n),d.useControlledProp("triggerIdProp",c);const f=d.useState("open"),h=d.useState("mounted"),m=d.useState("payload");d.useContextCallback("onOpenChange",r),d.useContextCallback("onOpenChangeComplete",s),mje(d,f),fje(d);const{forceUnmount:g}=hje(f,d,()=>{d.update({stickIfOpen:!0,openChangeReason:null})});d.useSyncedValues({modal:o}),p.useEffect(()=>{f||d.context.stickIfOpenTimeout.clear()},[d,f]),p.useImperativeHandle(e.actionsRef,()=>({unmount:g,close:()=>d.setOpen(!1,pa(I_e))}),[g,d]);const b=f||h;return a.jsxs(oLe.Provider,{value:d,children:[l&&a.jsx(cje,{handle:l,store:d}),b&&a.jsx(L2t,{store:d,modal:o}),typeof t=="function"?t({payload:m}):t]})}function D2t(e){return Xv(!0)?a.jsx(Ine,{props:e}):a.jsx(mrt,{children:a.jsx(Ine,{props:e})})}function M2t(e,t){const n=lje((i,r)=>new R2t(t,i,r));return p.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function L2t({store:e,modal:t}){const n=e.useState("floatingRootContext"),i=H_e(n,{outsidePressEvent:{mouse:t==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),r=i.reference,s=i.floating;return pje(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:s}),null}const $2t=300;function nm(e){return KA(e,"base-ui")}function F2t(e,t){const n=p.useRef(null);function i(s){vi.flushSync(()=>{e.setOpen(!1,pa(fC,s.nativeEvent,s.currentTarget))});const o=fit(n.current);o==null||o.focus()}function r(s){var l;const o=e.select("positionerElement");if(o&&aw(s,o))(l=e.context.beforeContentFocusGuardRef.current)==null||l.focus();else{vi.flushSync(()=>{e.setOpen(!1,pa(fC,s.nativeEvent,s.currentTarget))});let c=dit(e.context.triggerFocusTargetRef.current||t.current);for(;c!==null&&ii(o,c);){const u=c;if(c=eV(c),c===u)break}c==null||c.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:i,handleFocusTargetFocus:r}}function B2t(e){const t=p.useRef(""),n=p.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:p.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r?e(r,r.pointerType):e(r,t.current),t.current=""},[e]),onPointerDown:n}}function lLe(e,t){const n=oi((s,o)=>{(typeof e=="function"?e():e)||t(o||(zD?"touch":""))}),{onClick:i,onPointerDown:r}=B2t(n);return p.useMemo(()=>({onClick:i,onPointerDown:r}),[i,r])}const U2t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,disabled:o=!1,nativeButton:l=!0,handle:c,payload:u,openOnHover:d=!1,delay:f=$2t,closeDelay:h=0,id:m,...g}=t,b=Xv(!0),y=xje(c)??b;if(!y)throw new Error(Uc(74));const w=nm(m),x=y.useState("isTriggerActive",w),k=y.useState("floatingRootContext"),S=y.useState("isOpenedByTrigger",w),O=y.useState("triggerPopupId",w),A=p.useRef(null),{registerTrigger:E,isMountedByThisTrigger:j}=dje(w,A,y,{payload:u,disabled:o,openOnHover:d,closeDelay:h}),T=y.useState("openChangeReason"),R=y.useState("stickIfOpen"),C=y.useState("openMethod"),N=y.useState("focusManagerModal"),P=mst(k,{enabled:!o&&d&&(C!=="touch"||T!==e1),mouseOnly:!0,move:!1,handleClose:yst(),restMs:f,delay:{close:h},triggerElementRef:A,isActiveTrigger:x,isClosing:()=>y.select("transitionStatus")==="ending"}),I=V_e(k,{stickIfOpen:R}),D=lLe(()=>y.select("open"),ne=>{y.set("openMethod",ne)}),_=y.useState("triggerProps",j),{getButtonProps:L,buttonRef:F}=WD({disabled:o,native:l}),M={open(ne){return ne&&T===e1?Rst.open(ne):Sje.open(ne)}},{preFocusGuardRef:H,handlePreFocusGuardFocus:q,handleFocusTargetFocus:U}=F2t(y,A),z=Da("button",t,{state:{disabled:o,open:S},ref:[F,n,E,A],props:[I.reference,P,_,D,{[aV]:"",id:w,"aria-haspopup":"dialog","aria-expanded":S,"aria-controls":O},g,L],stateAttributesMapping:M}),J=a.jsx(p.Fragment,{children:z},w);return j&&!N?a.jsxs(p.Fragment,{children:[a.jsx(lv,{ref:H,onFocus:q}),J,a.jsx(lv,{ref:y.context.triggerFocusTargetRef,onFocus:U})]}):J}),cLe=p.createContext(void 0);function Q2t(){const e=p.useContext(cLe);if(e===void 0)throw new Error(Uc(45));return e}const z2t=p.forwardRef(function(t,n){const{keepMounted:i=!1,...r}=t;return Xv().useState("mounted")||i?a.jsx(cLe.Provider,{value:i,children:a.jsx(L_e,{ref:n,...r})}):null}),uLe=p.createContext(void 0);function V2t(){const e=p.useContext(uLe);if(!e)throw new Error(Uc(46));return e}const dLe=p.forwardRef(function(t,n){const{cutout:i,...r}=t;let s;if(i){const o=i.getBoundingClientRect();s=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${o.left}px ${o.top}px,${o.left}px ${o.bottom}px,${o.right}px ${o.bottom}px,${o.right}px ${o.top}px,${o.left}px ${o.top}px)`}return a.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...r,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});let Pne={},Dne={},Mne="";function jM(e,t){return HA(e)?e:t}function Lne(e,t,n){return/hidden|clip/.test(e.getComputedStyle(jM(t,n)).overflowY)}function H2t(e){if(typeof document>"u")return!1;const t=Cr(e);return ea(t).innerWidth-t.documentElement.clientWidth>0}function q2t(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Cr(e),i=n.documentElement,r=n.body,s=jM(i,r),o=s.style.overflowY,l=i.style.scrollbarGutter;i.style.scrollbarGutter="stable",s.style.overflowY="scroll";const c=s.offsetWidth;s.style.overflowY="hidden";const u=s.offsetWidth;return s.style.overflowY=o,i.style.scrollbarGutter=l,c===u}function W2t(e){const t=Cr(e),n=t.documentElement,i=t.body,r=jM(n,i),s={overflowY:r.style.overflowY,overflowX:r.style.overflowX};return Object.assign(r.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(r.style,s)}}function K2t(e){var m;const t=Cr(e),n=t.documentElement,i=t.body,r=ea(n);let s=0,o=0,l=!1;const c=Cc.create();if(q1&&(((m=r.visualViewport)==null?void 0:m.scale)??1)!==1)return()=>{};function u(){const g=r.getComputedStyle(n),b=r.getComputedStyle(i),w=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,o=n.scrollLeft,Pne={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Mne=n.style.scrollBehavior,Dne={position:i.style.position,height:i.style.height,width:i.style.width,boxSizing:i.style.boxSizing,overflowY:i.style.overflowY,overflowX:i.style.overflowX,scrollBehavior:i.style.scrollBehavior};const x=n.scrollHeight>n.clientHeight,k=n.scrollWidth>n.clientWidth,S=g.overflowY==="scroll"||b.overflowY==="scroll",O=g.overflowX==="scroll"||b.overflowX==="scroll",A=Math.max(0,r.innerWidth-i.clientWidth),E=Math.max(0,r.innerHeight-i.clientHeight),j=parseFloat(b.marginTop)+parseFloat(b.marginBottom),T=parseFloat(b.marginLeft)+parseFloat(b.marginRight),R=jM(n,i);if(l=q2t(e),l){n.style.scrollbarGutter=w,R.style.overflowY="hidden",R.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:w,overflowY:"hidden",overflowX:"hidden"}),(x||S)&&(n.style.overflowY="scroll"),(k||O)&&(n.style.overflowX="scroll"),Object.assign(i.style,{position:"relative",height:j||E?`calc(100dvh - ${j+E}px)`:"100dvh",width:T||A?`calc(100vw - ${T+A}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),i.scrollTop=s,i.scrollLeft=o,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function d(){Object.assign(n.style,Pne),Object.assign(i.style,Dne),l||(n.scrollTop=s,n.scrollLeft=o,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Mne)}function f(){d(),c.request(u)}u();const h=Di(r,"resize",f);return()=>{c.cancel(),d(),typeof r.removeEventListener=="function"&&h()}}class G2t{constructor(){Zt(this,"lockCount",0);Zt(this,"restore",null);Zt(this,"timeoutLock",Qu.create());Zt(this,"timeoutUnlock",Qu.create());Zt(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});Zt(this,"unlock",()=>{var t;this.lockCount===0&&this.restore&&((t=this.restore)==null||t.call(this),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const n=Cr(t),i=n.documentElement,r=n.body,s=ea(i);if(Lne(s,i,r)){const l=new s.MutationObserver(()=>{Lne(s,i,r)||(l.disconnect(),this.restore=null,this.lock(t))}),c={attributes:!0};l.observe(i,c),l.observe(r,c),this.restore=()=>l.disconnect();return}const o=zD||!H2t(t);this.restore=o?W2t(t):K2t(t)}}const X2t=new G2t;function fLe(e=!0,t=null){ti(()=>{if(e)return X2t.acquire(t)},[e,t])}const Y2t=20;function Z2t(e,t,n,i){const[r,s]=p.useState(!1);ti(()=>{if(!e||!t||n==null){s(!1);return}const o=Cr(n).documentElement.clientWidth,l=n.offsetWidth;s(o>0&&l>0&&l>=o-Y2t)},[e,t,n]),fLe(e&&(!t||r),i)}const J2t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,anchor:o,positionMethod:l,side:c,align:u,sideOffset:d,alignOffset:f,collisionBoundary:h="clipping-ancestors",collisionPadding:m,arrowPadding:g,sticky:b,disableAnchorTracking:v=!1,collisionAvoidance:y=Qit,...w}=t,x=Xv(),k=Q2t(),S=hrt(),O=x.useState("floatingRootContext"),A=x.useState("mounted"),E=x.useState("open"),j=x.useState("openChangeReason"),T=x.useState("activeTriggerElement"),R=x.useState("modal"),C=x.useState("openMethod"),N=x.useState("positionerElement"),P=x.useState("instantType"),I=x.useState("transitionStatus"),D=x.useState("adaptiveOrigin"),_=p.useRef(null),L=sV(N),F=Est({anchor:o,floatingRootContext:O,positionMethod:l,mounted:A,side:c,sideOffset:d,align:u,alignOffset:f,arrowPadding:g,collisionBoundary:h,collisionPadding:m,sticky:b,disableAnchorTracking:v,keepMounted:k,nodeId:S,collisionAvoidance:y,adaptiveOrigin:D}),M=O.useState("domReferenceElement");ti(()=>{const z=M,J=_.current;if(z&&(_.current=z),J&&z&&z!==J){x.set("instantType",void 0);const ne=new AbortController;return L(()=>{x.set("instantType","trigger-change")},ne.signal),()=>{ne.abort()}}},[M,L,x]);const H=R===!0&&j!==vu;Z2t(E&&H,C==="touch",N,T);const q=x.useStateSetter("positionerElement"),U={open:E,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:P},Z=Ist(t,U,{styles:F.positionerStyles,transitionStatus:I,props:w,refs:[n,q],hidden:!A,inert:!E});return a.jsxs(uLe.Provider,{value:F,children:[A&&H&&a.jsx(dLe,{inert:rV(!E),cutout:T}),a.jsx(prt,{id:S,children:Z})]})}),e_t="ArrowUp",t_t="ArrowDown",n_t="ArrowLeft",i_t="ArrowRight",r_t="Home",s_t="End",hLe=new Set([e_t,t_t,n_t,i_t,r_t,s_t]),a_t=p.createContext(void 0);function o_t(e){return p.useContext(a_t)}const l_t=p.createContext(void 0);function c_t(){const[e,t]=p.useState(0),n=oi(()=>(t(r=>r+1),()=>{t(r=>Math.max(0,r-1))}));return{context:p.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}const u_t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,initialFocus:o,finalFocus:l,...c}=t,u=Xv(),d=V2t(),f=o_t()!=null,{context:h,hasClosePart:m}=c_t(),g=u.useState("open"),b=u.useState("openMethod"),v=u.useState("instantType"),y=u.useState("transitionStatus"),w=u.useState("popupProps"),x=u.useState("titleElementId"),k=u.useState("descriptionElementId"),S=u.useState("modal"),O=u.useState("mounted"),A=u.useState("openChangeReason"),E=u.useState("activeTriggerElement"),j=u.useState("floatingRootContext"),T=j.useState("floatingId"),R=u.useState("disabled"),C=u.useState("openOnHover"),N=u.useState("closeDelay");WA({open:g,ref:u.context.popupRef,onComplete(){var F,M;g&&((M=(F=u.context).onOpenChangeComplete)==null||M.call(F,!0))}}),hst(j,{enabled:C&&!R,closeDelay:N});const P=o===void 0?oje(u.context.popupRef):o,I=S!==!1&&m;u.useSyncedValue("focusManagerModal",I);const D=u.useStateSetter("popupElement"),_={open:g,side:d.side,align:d.align,instant:v,transitionStatus:y},L=Da("div",t,{state:_,ref:[n,u.context.popupRef,D],props:[w,{id:T,role:"dialog",...aje,"aria-labelledby":x,"aria-describedby":k,onKeyDown(F){f&&hLe.has(F.key)&&F.stopPropagation()}},Cje(y),c],stateAttributesMapping:Eje});return a.jsx(z_e,{context:j,openInteractionType:b,modal:I,disabled:!O||A===vu,initialFocus:P,returnFocus:l,restoreFocus:"popup",previousFocusableElement:Zs(E)?E:void 0,nextFocusableElement:u.context.triggerFocusTargetRef,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:a.jsx(l_t.Provider,{value:h,children:L})})}),d_t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...o}=t,l=Xv(),c=nm(o.id);return l.useSyncedValueWithCleanup("titleElementId",c),Da("h2",t,{ref:n,props:[{id:c},o]})}),f_t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...o}=t,l=Xv(),c=nm(o.id);return l.useSyncedValueWithCleanup("descriptionElementId",c),Da("p",t,{ref:n,props:[{id:c},o]})});function $ne(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),a.jsx("path",{d:"M4.15 10.25h12.2M10.25 4c1.65 1.72 2.5 3.8 2.5 6.25s-.85 4.53-2.5 6.25M10.25 4c-1.65 1.72-2.5 3.8-2.5 6.25s.85 4.53 2.5 6.25M14.8 14.8 20 20"})]})}function h_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),a.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),a.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),a.jsx("path",{d:"m19.4 2.75.48 1.37 1.37.48-1.37.48-.48 1.37-.48-1.37-1.37-.48 1.37-.48.48-1.37Z",fill:"currentColor",stroke:"none"})]})}function cq(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{className:"video-generate-icon__body",d:"M3.25 9h17.5v7.35a2.4 2.4 0 0 1-2.4 2.4H5.65a2.4 2.4 0 0 1-2.4-2.4V9Z"}),a.jsxs("g",{className:"video-generate-icon__clapper",children:[a.jsx("path",{d:"M3.25 9V7.65a2.4 2.4 0 0 1 2.4-2.4h12.7a2.4 2.4 0 0 1 2.4 2.4V9H3.25Z"}),a.jsx("path",{d:"M6.75 5.25 9.3 9M12 5.25 14.55 9M17.25 5.25 19.8 9"})]}),a.jsx("path",{d:"m10.25 11.45 4 2.55-4 2.55v-5.1Z"})]})}function p_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.25 5.25h15.5v10.5H4.25zM8.25 19.75h7.5M12 15.75v4"}),a.jsx("path",{d:"m7.25 12.75 2.35-2.4 2.15 1.65 3.4-3.6 1.6 1.55"}),a.jsx("circle",{cx:"7.25",cy:"8.4",r:".7",fill:"currentColor",stroke:"none"})]})}function m_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5 7.4c0-1.55 3.13-2.8 7-2.8s7 1.25 7 2.8-3.13 2.8-7 2.8-7-1.25-7-2.8Z"}),a.jsx("path",{d:"M5 7.4v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8V7.4M5 11.95v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8v-4.55"}),a.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function g_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),a.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),a.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),a.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function b_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.25 6.25h6.25c1 0 1.5.55 1.5 1.45v11.05c0-.9-.5-1.45-1.5-1.45H4.25V6.25Z"}),a.jsx("path",{d:"M19.75 9.1v8.2H13.5c-1 0-1.5.55-1.5 1.45V7.7c0-.9.5-1.45 1.5-1.45h2.15"}),a.jsx("path",{d:"m19 3.2.58 1.62 1.62.58-1.62.58L19 7.6l-.58-1.62-1.62-.58 1.62-.58L19 3.2Z",fill:"currentColor",stroke:"none"})]})}function y_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"m4.2 8.4 1.15 10.2h13.3L19.8 8.4"}),a.jsx("path",{d:"M4.2 8.4h15.6L17.9 5H6.1L4.2 8.4Z"}),a.jsx("path",{d:"M7.2 12.2c1.1-1 2.25 1.25 3.4.25 1.05-.9 2.15 1.3 3.3.25"}),a.jsx("path",{d:"m8.2 15.1 1.45 1.35 1.45-1.35M13.55 16.45h2.35"})]})}function v_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"6",cy:"6.25",r:"2.25"}),a.jsx("circle",{cx:"18",cy:"6.25",r:"2.25"}),a.jsx("circle",{cx:"12",cy:"17.75",r:"2.25"}),a.jsx("path",{d:"m7.7 7.75 2.7 7.55M16.3 7.75l-2.7 7.55M8.25 6.25h7.5"})]})}function Fne(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"9",cy:"8",r:"3"}),a.jsx("path",{d:"M3.75 18.75c.45-3.05 2.2-4.65 5.25-4.65s4.8 1.6 5.25 4.65"}),a.jsx("path",{d:"M17.75 4.25v5.5M15 7h5.5M16 13.25h4.25M18.125 11.125v4.25"})]})}function x_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"4",y:"4.25",width:"16",height:"5",rx:"1.5"}),a.jsx("rect",{x:"4",y:"14.75",width:"16",height:"5",rx:"1.5"}),a.jsx("path",{d:"M7.25 6.75h.01M7.25 17.25h.01M10 6.75h6.5M10 17.25h6.5"})]})}function w_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3.75h8l4 4v12.5H6V3.75Z"}),a.jsx("path",{d:"M14 3.75v4h4M8.75 11h6.5M8.75 14.25h6.5M8.75 17.5h4"})]})}function Bne(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.75",y:"4.5",width:"16.5",height:"15",rx:"2.5"}),a.jsx("path",{d:"m7.5 9 2.75 2.5L7.5 14M12.5 14h4"}),a.jsx("path",{d:"M3.75 7.5h16.5",opacity:".62"})]})}function ck(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function k_t({value:e}){const{t,i18n:n}=_e("adk"),[i,r]=p.useState(!1),s=f=>f==null?t("developmentRuns.notReported"):f.toLocaleString(n.resolvedLanguage||n.language),o=W2e,l=e.usage,c=(l==null?void 0:l.inputTokens)!=null&&l.cachedInputTokens!=null&&l.cachedInputTokens<=l.inputTokens?l.inputTokens-l.cachedInputTokens:void 0,u=l!=null&&l.inputTokens&&l.cachedInputTokens!=null&&c!=null?`${(l.cachedInputTokens/l.inputTokens*100).toFixed(1)}%`:void 0,d=[["inputTokens",l==null?void 0:l.inputTokens],["cachedInputTokens",l==null?void 0:l.cachedInputTokens],["uncachedInputTokens",c],["cacheWriteInputTokens",l==null?void 0:l.cacheWriteInputTokens],["outputTokens",l==null?void 0:l.outputTokens],["reasoningOutputTokens",l==null?void 0:l.reasoningOutputTokens]];return a.jsxs("div",{className:"development-turn-summary","data-turn-id":e.turnId,children:[a.jsx("span",{children:t(`developmentRuns.turnStatus.${e.status}`)}),a.jsx("span",{children:t("developmentRuns.toolCalls",{count:e.toolCalls})}),a.jsx("span",{children:t("developmentRuns.turnDuration",{duration:o(e.durationMs)})}),a.jsx("span",{title:t("developmentRuns.toolDurationHelp"),children:t(e.toolDurationComplete?"developmentRuns.toolDuration":"developmentRuns.toolDurationPartial",{duration:o(e.toolDurationMs)})}),a.jsxs(D2t,{open:i,onOpenChange:r,children:[a.jsxs(U2t,{className:"development-token-trigger",openOnHover:!0,delay:150,closeDelay:150,onFocus:f=>{f.currentTarget.matches(":focus-visible")&&r(!0)},children:[a.jsx("span",{children:"Tokens"}),a.jsx("span",{className:"development-token-value",children:s(l==null?void 0:l.totalTokens)}),e.usageIncomplete&&a.jsxs("span",{children:["· ",t("developmentRuns.partial")]}),a.jsx(ck,{className:"development-token-chevron"})]}),a.jsx(z2t,{children:a.jsx(J2t,{side:"top",align:"end",sideOffset:8,className:"development-token-positioner",children:a.jsxs(u_t,{className:"development-token-popup",initialFocus:!1,finalFocus:!1,children:[a.jsx(d_t,{className:"development-token-title",children:t("developmentRuns.tokenDetails")}),a.jsxs("dl",{children:[a.jsxs("div",{children:[a.jsx("dt",{children:t("developmentRuns.model")}),a.jsx("dd",{children:e.model||t("developmentRuns.notReported")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:t("developmentRuns.totalTokens")}),a.jsx("dd",{children:s(l==null?void 0:l.totalTokens)})]}),d.map(([f,h])=>a.jsxs("div",{children:[a.jsx("dt",{children:t(`developmentRuns.${f}`)}),a.jsx("dd",{children:s(h)})]},f)),a.jsxs("div",{children:[a.jsx("dt",{children:t("developmentRuns.cacheHitRate")}),a.jsx("dd",{children:u||t("developmentRuns.notReported")})]})]}),a.jsxs(f_t,{className:"development-token-note",children:[t("developmentRuns.tokenHelp"),e.usageIncomplete?` ${t("developmentRuns.partialHelp")}`:""]})]})})})]})]})}function uq(e){return a.jsx("svg",{viewBox:"0 0 111 117",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M0 5.6016C7.82288e-05 0.621244 6.02226 -1.87314 9.54395 1.64847L40.1289 32.2334L68.5732 3.7891C69.5834 2.77903 70.9533 2.21099 72.3818 2.21097H82.7031C82.7917 2.20658 82.8806 2.20414 82.9697 2.20414H104.775C109.574 2.20427 111.977 8.00691 108.584 11.4004L64.916 55.0664C64.3075 55.8528 63.9436 56.7647 63.8242 57.6993C63.7142 56.4884 63.1964 55.3069 62.2695 54.3799L45.4082 37.5186H45.4072L40.124 32.2354L17.832 54.5284C16.7671 55.5933 16.2416 56.993 16.2549 58.3887C16.2417 59.7843 16.7672 61.1842 17.832 62.2491L39.9287 84.3467L9.54395 114.733C6.0223 118.255 0.000223474 115.761 0 110.78V5.6016ZM63.8018 58.8702C63.8962 59.9086 64.2936 60.9229 64.9961 61.7735L108.591 105.368C111.984 108.762 109.58 114.564 104.781 114.564H94.4336C94.3543 114.568 94.274 114.569 94.1934 114.569H72.3877C70.9592 114.569 69.5892 114.002 68.5791 112.992L39.9336 84.3467L58.4531 65.8282L58.4453 65.8203L62.2695 61.9981C63.1476 61.12 63.6567 60.0136 63.8018 58.8702Z",fill:"currentColor"})})}function NM({kind:e,...t}){return e==="thinking"?a.jsx(uq,{...t}):a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:e==="tool"?a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"3"}),a.jsx("path",{d:"m7 9 3 3-3 3m6 0h4"})]}):e==="plan"?a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"m4 7 1.5 1.5L8 6m-4 7 1.5 1.5L8 12M11 7h9m-9 6h9m-9 6h9"}),a.jsx("circle",{cx:"6",cy:"19",r:"1"})]}):a.jsx(a.Fragment,{children:a.jsx("path",{d:"M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9zM14 3v6h6M8 13h8m-4-3v6M8 18h8"})})})}function O_t({blocks:e,active:t,status:n,render:i}){const{t:r}=_e("adk"),[s,o]=p.useState(!1),l=[...e].reverse().find(h=>"done"in h&&!h.done),c=e.filter(h=>h.kind==="tool"),u=c.filter(h=>h.durationMs!=null),d=u.reduce((h,m)=>h+(m.durationMs||0),0);let f=r("developmentRuns.processSummary",{count:e.length});return t&&(f=n||((l==null?void 0:l.kind)==="thinking"?r("developmentRuns.thinking"):(l==null?void 0:l.kind)==="tool"?K2e(l):(l==null?void 0:l.kind)==="plan"?r("developmentRuns.plan"):(l==null?void 0:l.kind)==="diff"?r("developmentRuns.diff"):r("developmentRuns.processing"))),a.jsxs("section",{className:"development-process",children:[a.jsxs("button",{type:"button",className:"development-process__toggle","aria-expanded":s,onClick:()=>o(!s),children:[a.jsx(ck,{className:`tool-chevron${s?" is-open":""}`}),a.jsx("span",{className:"tool-icon",children:a.jsx(NM,{kind:(l==null?void 0:l.kind)==="thinking"||(l==null?void 0:l.kind)==="plan"||(l==null?void 0:l.kind)==="diff"?l.kind:"tool"})}),t?a.jsx(on,{className:"development-process__title","aria-live":"polite",children:f}):a.jsx("span",{className:"development-process__title",children:f}),!t&&c.length>0&&a.jsxs("span",{className:"development-process__duration",children:[r("developmentRuns.toolCalls",{count:c.length}),u.length>0?` · ${r(u.length===c.length?"developmentRuns.toolDuration":"developmentRuns.toolDurationPartial",{duration:W2e(d)})}`:""]})]}),a.jsx("div",{className:"development-process__items",hidden:!s,children:i(e)})]})}function S_t({blocks:e,active:t,status:n="",render:i}){const{t:r}=_e("adk"),s=snt(e),o=s[s.length-1],l=[...e].reverse().find(u=>u.kind==="progress"),c=n||((l==null?void 0:l.kind)==="progress"?l.text:"");return a.jsxs(a.Fragment,{children:[s.map(u=>u.process?a.jsx(O_t,{blocks:u.blocks,active:t&&u===o,status:c,render:i},u.id):a.jsx("div",{"data-assistant-phase":u.blocks[0].phase,children:i(u.blocks)},u.id)),t&&!(o!=null&&o.process)&&a.jsxs("div",{className:"development-process__status",role:"status",children:[a.jsx("span",{className:"tool-icon",children:a.jsx(NM,{kind:"thinking"})}),a.jsx(on,{children:c||r("developmentRuns.processing")})]})]})}const E_t={formatDate(e){const t=e.value??e.date??e.timestamp;if(t==null)return"";const n=new Date(t);return isNaN(n.getTime())?String(t):n.toLocaleString()}};function C_t(e,t){if(!t||t==="/")return e;const n=t.replace(/^\//,"").split("/").map(r=>r.replace(/~1/g,"/").replace(/~0/g,"~"));let i=e;for(const r of n){if(i==null||typeof i!="object")return;i=i[r]}return i}function A_t(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function T_t(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function dq(e,t){if(A_t(e))return C_t(t,e.path);if(T_t(e)){const n=E_t[e.call],i={};for(const[r,s]of Object.entries(e.args??{}))i[r]=dq(s,t);return n?n(i):`[unknown fn: ${e.call}]`}return e}function __t(e,t){const n=dq(e,t);return n==null?"":typeof n=="string"?n:String(n)}const pLe=new Map;function Yv(e,t){pLe.set(e,t)}function j_t(e){return pLe.get(e)}function N_t(e,t,n){const i=t.replace(/^\//,"").split("/").map(s=>s.replace(/~1/g,"/").replace(/~0/g,"~"));let r=e;for(let s=0;sdq(i,e.dataModel),resolveString:i=>__t(i,e.dataModel),dispatchAction:t,render:i=>{if(!i)return null;const r=e.components[i];if(!r)return null;const s=j_t(r.component)??R_t;return a.jsx(s,{node:r,ctx:n},i)}};return a.jsx("div",{className:"a2ui-surface","data-a2ui-surface":e.surfaceId,children:n.render(e.rootId)})}function gLe(e){const t=p.useRef(null),n=p.useRef(!0),i=28,r=p.useCallback(()=>{const s=t.current;s&&(n.current=s.scrollHeight-s.scrollTop-s.clientHeight{const s=t.current;s&&n.current&&(s.scrollTop=s.scrollHeight)},[e]),{ref:t,onScroll:r}}function RM({value:e,skillPrefix:t="/",onRemoveSkill:n,onRemoveAgent:i}){const{t:r}=_e("conversation");return e.skills.length===0&&!e.targetAgent?null:a.jsxs("div",{className:"invocation-chips","aria-label":r("invocation.ariaLabel"),children:[e.skills.map(s=>a.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:s.description,children:[a.jsx(gC,{"aria-hidden":!0}),a.jsxs("span",{children:[t,s.name]}),n?a.jsx("button",{type:"button",onClick:()=>n(s.name),"aria-label":r("invocation.removeSkill",{name:s.name}),children:a.jsx(Bo,{})}):null]},s.name)),e.targetAgent?a.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[a.jsx(Bje,{"aria-hidden":!0}),a.jsx("span",{children:e.targetAgent.name}),i?a.jsx("button",{type:"button",onClick:i,"aria-label":r("invocation.removeAgent",{name:e.targetAgent.name}),children:a.jsx(Bo,{})}):null]}):null]})}function fq(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function bLe(e){var n,i,r,s;const t=fq(e.mimeType);return t==="pdf"?"PDF":t==="markdown"?"MD":t==="video"?((i=(n=e.mimeType)==null?void 0:n.split("/")[1])==null?void 0:i.toUpperCase())??"VIDEO":t==="image"?((s=(r=e.mimeType)==null?void 0:r.split("/")[1])==null?void 0:s.toUpperCase())??"IMAGE":"TXT"}function yLe(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function vLe(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?bTe(t,e.uri):""}function P_t({kind:e}){return e==="image"?a.jsx(yV,{}):e==="video"?a.jsx(Qje,{}):e==="pdf"?a.jsx(Lat,{}):a.jsx(gV,{})}function IM({appName:e,items:t,compact:n=!1,onRemove:i}){const{t:r}=_e("conversation"),[s,o]=p.useState(null);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(l=>{const c=fq(l.mimeType),u=vLe(l,e),d=l.status==="uploading"||l.status==="error"||!u,f=a.jsxs("button",{type:"button",className:"media-card-main",disabled:d,onClick:c==="image"?void 0:()=>o(l),"aria-label":r("media.preview",{name:l.name??r("media.attachment")}),children:[c==="image"&&u?a.jsx("img",{className:"media-card-image",src:u,alt:l.name??r("media.image"),loading:"lazy"}):c==="video"&&u?a.jsxs("div",{className:"media-card-video-container",children:[a.jsx("video",{className:"media-card-video",src:u,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),a.jsx("span",{className:"media-card-video-play",children:a.jsx(Hje,{})})]}):a.jsx("span",{className:"media-card-icon",children:a.jsx(P_t,{kind:c})}),a.jsxs("span",{className:"media-card-copy",children:[a.jsx("span",{className:"media-card-name",children:l.name??r("media.attachment")}),a.jsxs("span",{className:"media-card-meta",children:[a.jsx("span",{className:"media-card-type",children:bLe(l)}),l.status==="uploading"?a.jsxs(a.Fragment,{children:[a.jsx(Vi,{className:"media-card-spinner"})," ",r("media.uploading")]}):l.status==="error"?l.error??r("media.uploadFailed"):yLe(l.sizeBytes)]})]}),!n&&l.status!=="uploading"&&l.status!=="error"?a.jsx(aE,{className:"media-card-open"}):null]});return a.jsxs(_r.div,{className:`media-card media-card--${c}${l.status==="error"?" media-card--error":""}`,layout:!0,initial:{opacity:0,scale:.985,y:4},animate:{opacity:1,scale:1,y:0},children:[c==="image"&&!d?a.jsx(BAe,{src:u,children:f}):f,i?a.jsx("button",{type:"button",className:"media-card-remove","aria-label":r("media.remove",{name:l.name??r("media.attachment")}),onClick:()=>i(l.id),children:a.jsx(Bo,{})}):null]},l.id)})}),a.jsx(uf,{children:s?a.jsx(D_t,{appName:e,item:s,onClose:()=>o(null)}):null})]})}function D_t({appName:e,item:t,onClose:n}){const{t:i}=_e("conversation"),r=p.useMemo(()=>vLe(t,e),[e,t]),s=fq(t.mimeType),[o,l]=p.useState(""),[c,u]=p.useState(s==="text"||s==="markdown"),[d,f]=p.useState("");return p.useEffect(()=>{const h=m=>{m.key==="Escape"&&n()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[n]),p.useEffect(()=>{if(s!=="text"&&s!=="markdown")return;const h=new AbortController;return u(!0),f(""),fetch(r,{signal:h.signal}).then(m=>{if(!m.ok)throw new Error(`HTTP ${m.status}`);return m.text()}).then(l).catch(m=>{h.signal.aborted||f(m instanceof Error?m.message:String(m))}).finally(()=>{h.signal.aborted||u(!1)}),()=>h.abort()},[s,r]),a.jsx(_r.div,{className:"media-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":i("media.previewDialog",{name:t.name??i("media.attachment")}),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onMouseDown:h=>{h.target===h.currentTarget&&n()},children:a.jsxs(_r.div,{className:"media-viewer",initial:{opacity:0,y:18,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.99},transition:{type:"spring",stiffness:420,damping:30},children:[a.jsxs("header",{className:"media-viewer-header",children:[a.jsxs("div",{children:[a.jsx("strong",{children:t.name??i("media.attachment")}),a.jsxs("span",{children:[bLe(t),t.sizeBytes?` · ${yLe(t.sizeBytes)}`:""]})]}),a.jsxs("nav",{children:[a.jsx("a",{href:r,download:t.name,"aria-label":i("media.download"),children:a.jsx(JD,{})}),a.jsx("button",{type:"button",onClick:n,"aria-label":i("media.close"),children:a.jsx(Bo,{})})]})]}),a.jsxs("div",{className:`media-viewer-body media-viewer-body--${s}`,children:[s==="image"?a.jsx("img",{src:r,alt:t.name??i("media.image")}):null,s==="video"?a.jsx("div",{className:"media-viewer-video-wrapper",children:a.jsx("video",{src:r,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,s==="pdf"?a.jsx("iframe",{src:r,title:t.name??"PDF"}):null,c?a.jsxs("div",{className:"media-viewer-loading",children:[a.jsx(Vi,{})," ",i("media.reading")]}):null,!c&&d?a.jsx("div",{className:"media-viewer-loading",children:i("media.loadFailed",{error:d})}):null,!c&&s==="markdown"?a.jsx("div",{className:"media-document",children:a.jsx(Nd,{text:o})}):null,!c&&s==="text"?a.jsx("pre",{className:"media-document media-document--plain",children:o}):null]})]})})}function M_t({definition:e,label:t,done:n,open:i,onToggle:r}){const{t:s}=_e("conversation"),o=e.icon,l=n?e.doneLabel:e.runningLabel,c=t??s(`blocks.tools.${e.name}.${n?"done":"running"}`,{defaultValue:l});return a.jsxs("button",{type:"button",className:`builtin-tool-head${n?" is-done":" is-running"}`,"data-tool-tone":e.tone,onClick:r,"aria-expanded":i,children:[a.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:a.jsx(o,{})}),n?a.jsx("span",{className:"builtin-tool-label",children:c}):a.jsx(on,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:c}),a.jsx(ck,{className:`builtin-tool-chevron${i?" is-open":""}`})]})}function Mu(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Hn(e){return typeof e=="string"?e:""}function Une(e){return typeof e=="number"&&Number.isFinite(e)?e:0}function fd(e){return Array.isArray(e)?e:[]}function u9(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return{}}const n=Mu(t)??{};return Mu(n.result)??n}function PM(e){if(typeof e=="string")try{return PM(JSON.parse(e))}catch{return e}const t=Mu(e);if(!t)return"";const n=Mu(t.result);return Hn(t.error)||Hn(t.message)||Hn(n==null?void 0:n.error)||Hn(n==null?void 0:n.message)}function L_t(e){if(e.kind==="tool")return"tool";if(e.kind==="knowledge_base")return"knowledge_base";const t=Mu(e.metadata),n=Hn(t==null?void 0:t.source_type).toLowerCase(),i=Hn(e.source).toLowerCase();return n==="skillhub"||i.startsWith("skill_hub:")?"skill_hub":"skill_space"}const xLe={tool:"Tools",knowledge:"AgentKit Knowledge Base",skillCenter:"AgentKit Skill Center",unknownSource:"Unknown source",unnamedResource:"Unnamed resource",unnamedAgent:"Unnamed agent"};function $_t(e,t){return e==="veadk_builtin_tools"?t.tool:e==="agentkit_knowledge"?t.knowledge:e.startsWith("skill_hub:")?`Skill Hub ${e.slice(10)}`:e.startsWith("skill_space:")?`${t.skillCenter} ${e.slice(12)}`:e||t.unknownSource}function F_t(e){return e==="veadk_builtin_tools"?"tool":e==="agentkit_knowledge"?"knowledge_base":e.startsWith("skill_hub:")?"skill_hub":"skill_space"}function B_t(e,t=xLe){const n=u9(e),i=Mu(n.capabilities)??{},r=fd(n.resources).flatMap(o=>{const l=Mu(o);if(!l)return[];const c=l.kind==="tool"?"tool":l.kind==="knowledge_base"?"knowledge_base":"skill";return[{ref:Hn(l.ref),kind:c,category:L_t(l),name:Hn(l.name)||Hn(l.ref)||t.unnamedResource,description:Hn(l.description),source:Hn(l.source),version:Hn(l.version)}]}),s=fd(n.sources).flatMap(o=>{const l=Mu(o);if(!l)return[];const c=Hn(l.source),u=Hn(l.status),d=u==="error"?"error":u==="skipped"?"skipped":"ok";return[{source:c,category:F_t(c),label:$_t(c,t),status:d,count:Une(l.count),message:Hn(l.message),searchKeywords:fd(l.search_keywords).map(Hn).filter(Boolean)}]});return{collectionId:Hn(n.collection_id),capabilities:{googleAdkVersion:Hn(i.google_adk_version),agentTypes:fd(i.agent_types).map(Hn).filter(Boolean),maxOrchestrationDepth:Une(i.max_orchestration_depth)},resources:r,sources:s,counts:{all:r.length,skill_hub:r.filter(o=>o.category==="skill_hub").length,skill_space:r.filter(o=>o.category==="skill_space").length,knowledge_base:r.filter(o=>o.category==="knowledge_base").length,tool:r.filter(o=>o.category==="tool").length}}}function U_t(e,t){return{resources:e.resources.filter(n=>n.category===t),sources:e.sources.filter(n=>n.category===t)}}function wLe(e,t,n=xLe){const i=u9(e),r=u9(t),s=new Map(fd(r.results).flatMap(d=>{const f=Mu(d),h=Hn(f==null?void 0:f.name);return f&&h?[[h,f]]:[]})),o=fd(i.agents).flatMap(d=>{const f=Mu(d),h=Hn(f==null?void 0:f.name);return f&&h?[f]:[]}),l=new Set(o.map(d=>Hn(d.name))),c=[...s.entries()].filter(([d])=>!l.has(d)).map(([d])=>({name:d})),u=[...o,...c].map(d=>{const f=Hn(d.name),h=fd(d.nodes).flatMap(A=>{const E=Mu(A);return E?[E]:[]}),m=Hn(d.root_node),g=h.find(A=>Hn(A.id)===m),b=h.filter(A=>Hn(A.id)!==m).map(A=>({id:Hn(A.id)||n.unnamedAgent,type:Hn(A.type)||"llm",description:Hn(A.description)})),v=s.get(f),y=Hn(v==null?void 0:v.status),w=y==="failed"?"failed":y==="completed"?"completed":"running",x=Qne(v==null?void 0:v.resources),k=x.length>0?x:Qne(h.flatMap(A=>fd(A.resources))),S=zne(v==null?void 0:v.python_tools),O=S.length>0?S:zne(h.flatMap(A=>fd(A.python_tools)));return{name:f,description:Hn(v==null?void 0:v.description)||Hn(g==null?void 0:g.description)||Hn(d.task),task:Hn(d.task),rootType:Hn(v==null?void 0:v.root_type)||Hn(g==null?void 0:g.type)||"llm",nodeCount:h.length,subAgentCount:b.length,resourceCount:k.length,pythonToolCount:O.length,skills:k.filter(A=>A.kind==="skill"),knowledgeBases:k.filter(A=>A.kind==="knowledge_base"),builtinTools:k.filter(A=>A.kind==="tool"),pythonTools:O,subAgents:b,status:w,output:Hn(v==null?void 0:v.output),error:Hn(v==null?void 0:v.error)}});return{collectionId:Hn(r.collection_id)||Hn(i.collection_id),agents:u,completedCount:u.filter(d=>d.status==="completed").length,failedCount:u.filter(d=>d.status==="failed").length,runningCount:u.filter(d=>d.status==="running").length}}function Q_t(e,t){return!!PM(t)||wLe(e,t).failedCount>0}function Qne(e){const t=new Set;return fd(e).flatMap(n=>{const i=Mu(n),r=Hn(i?i.ref:n);if(!r||t.has(r))return[];t.add(r);const s=Hn(i==null?void 0:i.kind),o=s==="tool"||r.startsWith("veadk_tool:")?"tool":s==="knowledge_base"||r.startsWith("agentkit_kb:")?"knowledge_base":"skill",l=r.split(":");return[{ref:r,kind:o,name:Hn(i==null?void 0:i.name)||l[l.length-1]||r,description:Hn(i==null?void 0:i.description),version:Hn(i==null?void 0:i.version),source:Hn(i==null?void 0:i.source)}]})}function zne(e){const t=new Set;return fd(e).flatMap(n=>{const i=Mu(n),r=Hn(i==null?void 0:i.name),s=Hn(i==null?void 0:i.code),o=`${r}\0${s}`;return!i||!r||t.has(o)?[]:(t.add(o),[{name:r,description:Hn(i.description),code:s,entrypoint:Hn(i.entrypoint)||r,dependencies:fd(i.dependencies).map(Hn).filter(Boolean)}])})}function z_t({branch:e}){return a.jsxs("div",{className:`branch-compare__body${e.status==="running"?" is-streaming":""}`,"aria-live":"polite",children:[e.content?a.jsx(Nd,{text:e.content,streaming:e.status==="running"}):null,e.status==="running"?a.jsx("span",{className:"branch-compare__caret","aria-hidden":"true"}):null,e.error?a.jsx("p",{className:"branch-compare__error",children:e.error}):null]})}function V_t({args:e,response:t,status:n,onBranchSelect:i}){const{t:r}=_e("conversation"),s=p.useMemo(()=>Kje(e,t,n),[e,t,n]),[o,l]=p.useState(0);return a.jsxs("section",{className:"branch-compare","aria-label":r("blocks.branchCompare.ariaLabel"),children:[a.jsx("div",{className:"branch-compare__tabs",role:"tablist","aria-label":r("blocks.branchCompare.selectDirection"),children:s.branches.map((c,u)=>a.jsx("button",{className:`branch-compare__tab${o===u?" is-active":""}`,type:"button",role:"tab","aria-selected":o===u,"aria-controls":`branch-compare-panel-${u}`,onClick:()=>l(u),children:a.jsx(Za,{color:"info",size:"sm",variant:"soft",children:c.label})},`${c.label}:${u}`))}),a.jsx("div",{className:"branch-compare__branches",children:s.branches.map((c,u)=>a.jsxs("article",{className:`branch-compare__branch${o===u?" is-active":""}`,id:`branch-compare-panel-${u}`,role:"tabpanel",children:[a.jsx("header",{className:"branch-compare__head",children:a.jsx(Za,{color:"info",size:"sm",variant:"soft",children:c.label})}),a.jsx(z_t,{branch:c}),a.jsx("footer",{className:"branch-compare__footer",children:a.jsx(At,{type:"button",color:"info",variant:"ghost",size:"sm",pill:!1,disabled:c.status!=="completed",onClick:()=>i==null?void 0:i(c),children:r("blocks.branchCompare.continue")})})]},`${c.label}:${u}`))})]})}function kLe({controlled:e,default:t,name:n,state:i="value"}){const{current:r}=p.useRef(e!==void 0),[s,o]=p.useState(t),l=r?e:s,c=p.useCallback(u=>{r||o(u)},[]);return[l,c]}const OLe=p.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function H_t(){return p.useContext(OLe)}function q_t(e){const{children:t,elementsRef:n,labelsRef:i,onMapChange:r}=e,s=oi(r),[,o]=p.useState(!1),l=Td(K_t).current,c=Td(W_t).current,u=p.useRef(0),d=p.useRef(!0),f=p.useRef([]),h=p.useRef(null),m=oi(()=>{d.current||(d.current=!0,o(S=>!S))}),g=oi((S,O)=>{c.set(S,O),m()}),b=oi(S=>{c.delete(S),m()}),v=oi(S=>{const O=new Map;return n.current.length=0,i&&(i.current.length=0),S.forEach(A=>{var E,j;O.set(A.element,{...A.registration.metadata??{},index:A.index}),n.current[A.index]=A.element,i&&(i.current[A.index]=A.registration.label!==void 0?A.registration.label:((j=(E=A.registration.textRef)==null?void 0:E.current)==null?void 0:j.textContent)??A.element.textContent)}),u.current=n.current.length,O});function y(S){var E;if((E=h.current)==null||E.disconnect(),h.current=null,typeof MutationObserver!="function"||S.length<2)return;const O=new MutationObserver(j=>{if(!Y_t(j))return;let T=null;for(const R of S)if(R.isConnected){if(T&&SLe(T,R)>0){O.disconnect(),m();return}T=R}});h.current=O;const A=new Set;for(let j=1;jO.observe(j,{childList:!0}))}const w=oi(()=>{const[S,O]=G_t(c),A=v(S);y(O),f.current=S,d.current=!1,l.forEach(E=>E(A)),s(A)});ti(()=>(d.current||v(f.current),()=>{n.current=[],i&&(i.current=[])}),[n,i,v]),ti(()=>{d.current&&w()}),ti(()=>()=>{var S;(S=h.current)==null||S.disconnect(),d.current=!0},[]);const x=oi(S=>(l.add(S),()=>{l.delete(S)})),k=p.useMemo(()=>({register:g,unregister:b,subscribeMapChange:x,nextIndexRef:u}),[g,b,x,u]);return a.jsx(OLe.Provider,{value:k,children:t})}function W_t(){return new Map}function K_t(){return new Set}function G_t(e){const t=new Set,n=[],i=[];e.forEach((s,o)=>{if(!o.isConnected)return;const l=s.index,c={index:l??-1,element:o,registration:s};l===null?i.push(c):l>=0&&(t.add(l),n.push(c))});let r=0;return i.sort((s,o)=>SLe(s.element,o.element)),i.forEach(s=>{for(;t.has(r);)r+=1;s.index=r,n.push(s),r+=1}),t.size>0&&n.sort((s,o)=>s.index-o.index),[n,i.map(s=>s.element)]}function X_t(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function Y_t(e){for(const t of e)for(let n=0;nnull},ALe=p.forwardRef(function(t,n){const{render:i,className:r,disabled:s=!1,hiddenUntilFound:o,keepMounted:l,loopFocus:c,onValueChange:u,multiple:d=!1,orientation:f="vertical",value:h,defaultValue:m,style:g,...b}=t,v=p.useMemo(()=>{if(h===void 0)return m??[]},[h,m]),y=p.useRef([]),[w,x]=kLe({controlled:h,default:v,name:"Accordion",state:"value"}),k=oi((E,j,T)=>{if(d)if(j){const R=w.slice();if(R.push(E),u==null||u(R,T),T.isCanceled)return;x(R)}else{const R=w.filter(C=>C!==E);if(u==null||u(R,T),T.isCanceled)return;x(R)}else{const R=w[0]===E?[]:[E];if(u==null||u(R,T),T.isCanceled)return;x(R)}}),S=p.useMemo(()=>({value:w,disabled:s,orientation:f}),[w,s,f]),O=p.useMemo(()=>({disabled:s,handleValueChange:k,hiddenUntilFound:o??!1,keepMounted:l??!1,state:S,value:w}),[s,k,o,l,S,w]),A=Da("div",t,{state:S,ref:n,props:b,stateAttributesMapping:Z_t});return a.jsx(ELe.Provider,{value:O,children:a.jsx(q_t,{elementsRef:y,children:A})})});function J_t(e){const{open:t,defaultOpen:n,onOpenChange:i,disabled:r}=e,[s,o]=kLe({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:l,setMounted:c,transitionStatus:u}=sje(s,!0,!0),d=nm(),[f,h]=p.useState(),m=f===null?void 0:f??d,g=oi(b=>{const v=!s,y=pa(e1,b.nativeEvent);i(v,y),!y.isCanceled&&o(v)});return p.useMemo(()=>({defaultPanelId:d,disabled:r,handleTrigger:g,mounted:l,open:s,panelId:m,setMounted:c,setOpen:o,setPanelIdState:h,transitionStatus:u}),[d,r,g,l,s,m,c,o,h,u])}const TLe=p.createContext(void 0);function _Le(){const e=p.useContext(TLe);if(e===void 0)throw new Error(Uc(15));return e}function ejt(e={}){const{guess:t,label:n,metadata:i,textRef:r,index:s}=e,{register:o,unregister:l,subscribeMapChange:c,nextIndexRef:u}=H_t(),d=p.useRef(-1),[f,h]=p.useState(s==null&&t?()=>{if(d.current===-1){const v=u.current;u.current+=1,d.current=v}return d.current}:-1),m=s??f,g=p.useRef(null),b=p.useCallback(v=>{const y=g.current;y&&l(y),g.current=v,v&&o(v,{metadata:i??null,index:s??null,label:n,textRef:r})},[s,o,l,i,n,r]);return ti(()=>{if(s==null)return c(v=>{var w;const y=g.current?(w=v.get(g.current))==null?void 0:w.index:null;y!=null&&h(y)})},[s,c]),{ref:b,index:m}}const jLe=p.createContext(void 0);function hq(){const e=p.useContext(jLe);if(e===void 0)throw new Error(Uc(9));return e}let pq=function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=aI.startingStyle]="startingStyle",e[e.endingStyle=aI.endingStyle]="endingStyle",e}({}),tjt=function(e){return e.panelOpen="data-panel-open",e}({});const njt={[pq.open]:""},ijt={[pq.closed]:""},rjt={open(e){return e?{[tjt.panelOpen]:""}:null}},sjt={open(e){return e?njt:ijt}};let ajt=function(e){return e.index="data-index",e.disabled="data-disabled",e.open="data-open",e}({});const mq={...sjt,index:e=>({[ajt.index]:String(e)}),...qD,value:()=>null},NLe=p.forwardRef(function(t,n){const{className:i,disabled:r=!1,onOpenChange:s,render:o,value:l,style:c,...u}=t,{ref:d,index:f}=ejt(),h=Jw(n,d),{disabled:m,handleValueChange:g,state:b,value:v}=CLe(),y=nm(),w=l??y,x=r||m,k=v.indexOf(w)!==-1,S=oi((D,_)=>{s==null||s(D,_),!_.isCanceled&&g(w,D,_)}),O=J_t({open:k,onOpenChange:S,disabled:x}),A=p.useMemo(()=>({open:O.open,disabled:O.disabled,transitionStatus:O.transitionStatus}),[O.open,O.disabled,O.transitionStatus]),E=p.useMemo(()=>({...O,onOpenChange:S,state:A}),[O,A,S]),j=p.useMemo(()=>({...b,hidden:!k&&!O.mounted,index:f,disabled:x,open:k}),[O.mounted,x,f,k,b]),T=nm(),[R,C]=p.useState(),N=R===null?void 0:R??T,P=p.useMemo(()=>({defaultTriggerId:T,open:k,state:j,setTriggerId:C,triggerId:N}),[T,k,j,C,N]),I=Da("div",t,{state:j,ref:h,props:u,stateAttributesMapping:mq});return a.jsx(TLe.Provider,{value:E,children:a.jsx(jLe.Provider,{value:P,children:I})})}),RLe=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...o}=t,{state:l}=hq();return Da("h3",t,{state:l,ref:n,props:o,stateAttributesMapping:mq})}),ILe=p.forwardRef(function(t,n){const{disabled:i,className:r,id:s,render:o,nativeButton:l=!0,style:c,...u}=t,{panelId:d,open:f,handleTrigger:h,disabled:m}=_Le(),g=i||m,{getButtonProps:b,buttonRef:v}=WD({disabled:g,focusableWhenDisabled:!0,native:l}),{defaultTriggerId:y,state:w,setTriggerId:x}=hq(),k=s||void 0,S=k??y;return ti(()=>(x(E=>k??(E===null?void 0:E)),()=>{x(E=>E===k?null:E)}),[k,x]),Da("button",t,{state:w,ref:[n,v],props:[{"aria-controls":f?d:void 0,"aria-expanded":f,id:S,onClick:h},u,b],stateAttributesMapping:rjt})}),OO={height:void 0,width:void 0};function ojt(e){const{externalRef:t,hiddenUntilFound:n,id:i,keepMounted:r,mounted:s,onOpenChange:o,open:l,setMounted:c,setOpen:u,transitionStatus:d}=e,f=p.useRef(null),h=p.useRef(null),[m,g]=p.useState(OO),b=p.useRef(OO),v=p.useRef(!1),y=p.useRef(l),w=p.useRef(!1),[x,k]=p.useState(!1),S=p.useRef(null),O=Jw(t,f),A=Gl(l),E=sV(f),j=!l&&!s,T=x?"idle":d,R=l&&(y.current||w.current),C=!l&&s&&h.current==="css-animation"&&m.height===void 0&&m.width===void 0?b.current:m,N=n&&j&&h.current!=="css-animation",P=oi((F,M=!0)=>{M&&(b.current=F),g(F)}),I=oi(()=>{var F;(F=S.current)==null||F.call(S),S.current=null}),D=oi(F=>{I(),S.current=()=>{S.current=null,F()}}),_=oi(()=>{l&&s&&h.current==="css-animation"&&(w.current=!0)});ti(()=>{!x||d==="starting"||k(!1)},[x,d]),p.useEffect(()=>()=>{_(),I()},[_,I]),ti(()=>{const F=f.current;if(!F)return;!l&&S.current&&I();const M=ljt(F,R);if(h.current=M,l&&d==="idle"&&y.current&&M==="css-animation"){b.current=z0(F);return}if(l&&d==="starting"){const U=v.current;if(v.current=!1,M==="none"){P(z0(F)),k(!0);return}if(M==="css-transition"){const J=cjt(F);if(P(z0(F)),!U)return J;const ne=N_(F,"transition-duration","0s");return D(ne),k(!0),J}P(z0(F));const Z=N_(F,"animation-name","none");if(!U){Z();return}const z=N_(F,"animation-duration","0s");Z(),D(z),k(!0);return}if(!l&&s&&(d==="idle"||d==="starting")){if(y.current=!1,w.current=!1,M==="none"){P(OO,!1),c(!1);return}P(z0(F));return}if(d!=="ending")return;if(M==="none"){c(!1);return}const H=z0(F);if(!(H.height>0||H.width>0)){c(!1);return}P(H),M==="css-animation"&&N_(F,"animation-name","none")()},[s,l,I,P,c,D,R,d]),WA({enabled:l&&s&&T==="idle",open:!0,ref:f,onComplete(){l&&P(OO,!1)}}),p.useEffect(()=>{if(l||!s||T!=="ending"||!f.current)return;const M=new AbortController;let H=-1;function q(){A.current||(c(!1),P(OO,!1))}return H=Cc.request(()=>{E(q,M.signal)}),()=>{Cc.cancel(H),M.abort()}},[A,s,l,T,E,P,c]),ti(()=>{const F=f.current;!F||!n||!j||F.setAttribute("hidden","until-found")},[j,n]),p.useEffect(function(){const M=f.current;if(!M)return;function H(q){const U=pa(__e,q);o(!0,U),!U.isCanceled&&(v.current=!0,u(!0))}return Di(M,"beforematch",H)},[o,u]);const L=r||n||s||l;return{height:C.height,props:{...N?{[pq.startingStyle]:""}:void 0,hidden:j,id:i},ref:O,shouldPreventOpenAnimation:R,shouldRender:L,transitionStatus:T,width:C.width}}function z0(e){return{height:e.scrollHeight,width:e.scrollWidth}}function ljt(e,t){const n=ea(e).getComputedStyle(e),i=(n.animationName.split(",").map(s=>s.trim()).some(s=>s!==""&&s!=="none")||t)&&Vne(n.animationDuration),r=Vne(n.transitionDuration);return i&&r||r?"css-transition":i?"css-animation":"none"}function Vne(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function N_(e,t,n){const i=e.style.getPropertyValue(t),r=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(i===""){e.style.removeProperty(t);return}e.style.setProperty(t,i,r)}}function cjt(e){const t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(r=>{e.style.setProperty(r,"initial","important")});function n(){Object.entries(t).forEach(([r,s])=>{if(s===""){e.style.removeProperty(r);return}e.style.setProperty(r,s)})}const i=Cc.request(n);return()=>{Cc.cancel(i),n()}}let Hne=function(e){return e.accordionPanelHeight="--accordion-panel-height",e.accordionPanelWidth="--accordion-panel-width",e}({});const PLe=p.forwardRef(function(t,n){const{className:i,hiddenUntilFound:r,keepMounted:s,id:o,render:l,style:c,...u}=t,{hiddenUntilFound:d,keepMounted:f}=CLe(),{defaultPanelId:h,mounted:m,onOpenChange:g,open:b,setMounted:v,setOpen:y,setPanelIdState:w,transitionStatus:x}=_Le(),k=r??d,S=s??f,O=o||void 0,A=o??h;ti(()=>(w(M=>O??(M===null?void 0:M)),()=>{w(M=>M===O?null:M)}),[O,w]);const{height:E,props:j,ref:T,shouldPreventOpenAnimation:R,shouldRender:C,transitionStatus:N,width:P}=ojt({externalRef:n,hiddenUntilFound:k,id:A,keepMounted:S,mounted:m,onOpenChange:g,open:b,setMounted:v,setOpen:y,transitionStatus:x}),{state:I,triggerId:D}=hq(),_={...I,transitionStatus:N},L=v_e(c,_),F=Da("div",{...t,style:void 0},{state:_,ref:T,props:[j,{"aria-labelledby":D,role:"region",style:{[Hne.accordionPanelHeight]:E===void 0?"auto":`${E}px`,[Hne.accordionPanelWidth]:P===void 0?"auto":`${P}px`}},u,L?{style:L}:void 0,R?{style:{animationName:"none"}}:void 0],stateAttributesMapping:mq});return C?F:null}),ujt=(e,t)=>{const n=e.currentTarget,i={x:e.clientX,y:e.clientY},r=djt(i,n.getBoundingClientRect()),s=fjt(i,r),o=hjt(t.getBoundingClientRect());return mjt([...s,...o])};function djt(e,t){const n=Math.abs(t.top-e.y),i=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,i,r,s)){case s:return"left";case r:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function fjt(e,t,n=5){const i=[];switch(t){case"top":i.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":i.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":i.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":i.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return i}function hjt(e){const{top:t,right:n,bottom:i,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:i},{x:r,y:i}]}function pjt(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,o=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}function mjt(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),gjt(t)}function gjt(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let i=e.length-1;i>=0;i--){const r=e[i];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const bjt="_Transition_1wdpp_1",yjt="_Popover_1wdpp_3",DLe={Transition:bjt,Popover:yjt},MLe=p.createContext(null),DM=()=>{const e=p.use(MLe);if(!e)throw new Error("Popover components must be wrapped in ");return e},Dg=({open:e,onOpenChange:t,showOnHover:n=!1,hoverOpenDelay:i=150,children:r})=>{const[s,o]=p.useState(!1),[l,c]=p.useState(!1),u=p.useRef(null),d=p.useRef(null),f=p.useRef(void 0),h=p.useRef(!1),m=p.useRef(!1),g=e??s,[b,v]=p.useState(!1);OV(()=>v(!1),b?500:null);const y=nb(t),w=nb(A=>{var E,j;clearTimeout(f.current),g!==A&&(A||(c(!1),n&&h.current&&((E=u.current)==null||E.focus()),h.current=!1),(j=y.current)==null||j.call(y,A),o(A),n&&v(A))}),x=p.useCallback(A=>{w.current(A)},[w]),k=p.useCallback(()=>{f.current=setTimeout(()=>x(!0),i)},[x,i]),S=p.useCallback(()=>{clearTimeout(f.current)},[]);p.useEffect(()=>()=>{clearTimeout(f.current)},[]);const O=p.useMemo(()=>({open:g,setOpen:x,shake:l,setShake:c,showOnHover:n,temporarilyPreventClickToClose:b,onTriggerEnter:k,onTriggerLeave:S,isPointerInTransitRef:m,triggerRef:u,contentRef:d,hoverOpenFocusedWithTab:h}),[g,x,l,c,n,b,h,m,k,S]);return a.jsx(MLe,{value:O,children:a.jsx(LRe,{open:g,onOpenChange:x,modal:!1,children:r})})},vjt=({children:e,onPointerDown:t,onClick:n})=>{const{setOpen:i,showOnHover:r,temporarilyPreventClickToClose:s,onTriggerEnter:o,onTriggerLeave:l,isPointerInTransitRef:c,triggerRef:u,contentRef:d}=DM(),f=p.useRef(!1),h=b=>{!(b.currentTarget.nodeName.toLocaleLowerCase()==="a")&&s&&(b.preventDefault(),b.stopPropagation())},m=b=>{b.pointerType!=="touch"&&!f.current&&!c.current&&(o(),f.current=!0)},g=()=>{f.current&&(l(),f.current=!1)};return a.jsx($Re,{asChild:!0,ref:u,onPointerDown:b=>{h(b),t==null||t(b)},onClick:b=>{h(b),n==null||n(b)},onPointerMove:r?m:void 0,onPointerLeave:r?g:void 0,onFocus:r?()=>i(!0):void 0,onBlur:r?()=>{setTimeout(()=>{var b;(b=d.current)!=null&&b.contains(document.activeElement)||i(!1)},50)}:void 0,children:e})},LLe=({children:e,avoidCollisions:t,width:n,minWidth:i,maxWidth:r,side:s,sideOffset:o=8,align:l,alignOffset:c,translucent:u,className:d,autoFocus:f=!0})=>{const{showOnHover:h,shake:m,contentRef:g}=DM(),b=v=>{const y=g.current;if(y&&v.target===y&&v.key==="Tab"&&v.shiftKey){v.preventDefault(),v.stopPropagation();const w=cNe(y),x=w[w.length-1];x==null||x.focus()}};return p.useEffect(()=>{const v=g.current;!v||!f||v!=null&&v.contains(document.activeElement)||h||v.focus({preventScroll:!0})},[g,h,f]),a.jsx(BRe,{forceMount:!0,ref:g,className:qi(DLe.Popover,d),style:Fv({"popover-width":n,"popover-min-width":i,"popover-max-width":r}),onCloseAutoFocus:h?Lp:void 0,"data-animate":m?"shake":void 0,"data-translucent":u?"true":void 0,side:s,sideOffset:o,align:l,alignOffset:c??(l==="center"?0:-5),avoidCollisions:t??!0,hideWhenDetached:!0,collisionPadding:20,onOpenAutoFocus:Lp,onEscapeKeyDown:Lp,onKeyDown:b,children:e})},xjt=e=>{const{setOpen:t,triggerRef:n,contentRef:i,isPointerInTransitRef:r,hoverOpenFocusedWithTab:s}=DM(),[o,l]=p.useState(null),c=p.useCallback(()=>{l(null),r.current=!1},[r]),u=p.useCallback((d,f)=>{const h=ujt(d,f);l(h),r.current=!0},[r]);return p.useEffect(()=>()=>c(),[c]),p.useEffect(()=>{const d=n.current,f=i.current;if(!d||!f)return;const h=g=>u(g,f),m=g=>u(g,d);return d.addEventListener("pointerleave",h),f.addEventListener("pointerleave",m),()=>{d.removeEventListener("pointerleave",h),f.removeEventListener("pointerleave",m)}},[i,n,u,c]),p.useEffect(()=>{if(!o)return;const d=f=>{const h=n.current,m=i.current,g=f.target,b={x:f.clientX,y:f.clientY},v=(h==null?void 0:h.contains(g))||(m==null?void 0:m.contains(g)),y=!pjt(b,o),w=g.hasAttribute("aria-haspopup");v?c():(y||w)&&(c(),t(!1))};return document.addEventListener("pointermove",d),()=>document.removeEventListener("pointermove",d)},[o,t,c,n,i]),p.useEffect(()=>{const d=f=>{if(i.current&&f.key==="Tab"&&!f.shiftKey){const[h]=cNe(i.current);h&&(f.preventDefault(),h.focus(),s.current=!0,document.removeEventListener("keydown",d))}};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[i,s]),a.jsx(LLe,{...e})},wjt=e=>{const{open:t,showOnHover:n,setOpen:i}=DM();return iT(t,()=>{i(!1)}),a.jsx(FRe,{forceMount:!0,children:a.jsx(ek,{enterDuration:600,exitDuration:300,className:DLe.Transition,disableAnimations:!0,children:t&&(n?a.jsx(xjt,{...e},"popover-hover"):a.jsx(LLe,{...e},"popover"))})})};Dg.Trigger=vjt;Dg.Content=wjt;const kjt=["skill_hub","skill_space","knowledge_base","tool"];function $Le(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m4 6 4 4 4-4"})})}function FLe({label:e}){return a.jsx("div",{className:"create-agent-card__loading",role:"status","aria-label":e,children:[0,1,2].map(t=>a.jsxs("div",{className:"create-agent-card__skeleton-row","aria-hidden":"true",children:[a.jsx("span",{}),a.jsx("span",{})]},t))})}function Ojt(e,t){return e.kind==="tool"?t("blocks.createAgents.builtinTool"):e.kind==="knowledge_base"?t("blocks.createAgents.knowledgeBase"):e.source.startsWith("skill_hub:")?"Skill Hub":e.source.startsWith("skill_space:")?t("blocks.createAgents.skillCenter"):"Skill"}function L4({label:e,resources:t}){const{t:n}=_e("conversation");return t.length===0?null:a.jsxs("section",{className:"create-agent-card__popover-section",children:[a.jsx("h4",{children:e}),a.jsx("div",{className:"create-agent-card__popover-list",children:t.map(i=>a.jsxs("div",{className:"create-agent-card__popover-item",children:[a.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[a.jsx("strong",{children:i.name}),a.jsx(Za,{color:"secondary",size:"sm",variant:"soft",children:Ojt(i,n)})]}),i.description?a.jsx("p",{children:i.description}):null]},i.ref))})]})}function Sjt({tools:e}){const{t}=_e("conversation");return e.length===0?null:a.jsxs("section",{className:"create-agent-card__popover-section",children:[a.jsx("h4",{children:t("blocks.createAgents.selfAuthoredTools")}),a.jsx(ALe,{children:e.map((n,i)=>a.jsxs(NLe,{className:"create-agent-card__python-tool",value:`${n.name}:${i}`,children:[a.jsx(RLe,{className:"create-agent-card__python-tool-header",children:a.jsxs(ILe,{className:"create-agent-card__python-tool-trigger",children:[a.jsxs("span",{children:[a.jsx("strong",{children:n.name}),n.description?a.jsx("small",{children:n.description}):null]}),a.jsxs("span",{className:"create-agent-card__python-tool-meta",children:[a.jsx(Za,{color:"secondary",size:"sm",variant:"soft",children:t("blocks.createAgents.selfAuthoredTools")}),a.jsx($Le,{className:"create-agent-card__python-tool-chevron"})]})]})}),a.jsxs(PLe,{className:"create-agent-card__python-tool-panel",children:[n.dependencies.length>0?a.jsx("div",{className:"create-agent-card__python-tool-dependencies",children:t("blocks.createAgents.dependencies",{items:n.dependencies.join(", ")})}):null,a.jsx("pre",{tabIndex:0,"aria-label":t("blocks.createAgents.fullCode",{name:n.name}),children:a.jsx("code",{children:n.code})})]})]},`${n.name}:${i}`))})]})}function Ejt({agents:e}){const{t}=_e("conversation");return e.length===0?null:a.jsxs("section",{className:"create-agent-card__popover-section",children:[a.jsx("h4",{children:t("blocks.createAgents.subAgents")}),a.jsx("div",{className:"create-agent-card__popover-list",children:e.map(n=>a.jsxs("div",{className:"create-agent-card__popover-item",children:[a.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[a.jsx("strong",{children:n.id}),a.jsx(Za,{color:"secondary",size:"sm",variant:"soft",children:t(`blocks.createAgents.agentTypes.${n.type}`,{defaultValue:n.type})})]}),n.description?a.jsx("p",{children:n.description}):null]},n.id))})]})}function R_({label:e,count:t,icon:n,children:i}){const{t:r}=_e("conversation"),s=a.jsxs("button",{className:"create-agent-card__resource-metric",type:"button",disabled:t===0,"aria-label":r("blocks.createAgents.itemCount",{label:e,count:t}),children:[n,a.jsx("span",{children:t})]});return t===0?s:a.jsxs(Dg,{showOnHover:!0,hoverOpenDelay:120,children:[a.jsx(Dg.Trigger,{children:s}),a.jsx(Dg.Content,{side:"top",align:"start",minWidth:"auto",maxWidth:360,className:"create-agent-card__resource-popover",children:i})]})}function Cjt({response:e,status:t}){const{t:n}=_e("conversation"),i=p.useMemo(()=>({tool:n("blocks.createAgents.sourceLabels.tool"),knowledge:n("blocks.createAgents.sourceLabels.knowledge"),skillCenter:n("blocks.createAgents.sourceLabels.skillCenter"),unknownSource:n("blocks.createAgents.sourceLabels.unknown"),unnamedResource:n("blocks.createAgents.unnamedResource"),unnamedAgent:n("blocks.createAgents.unnamedAgent")}),[n]),r=p.useMemo(()=>B_t(e,i),[i,e]),s=p.useMemo(()=>kjt.map(c=>{const u=U_t(r,c);return{value:c,label:n(`blocks.createAgents.categories.${c}`),...u,searchKeywords:[...new Set(u.sources.flatMap(d=>d.searchKeywords))]}}),[r,n]),o=t==="failed",l=o?PM(e):"";return a.jsx("section",{className:"create-agent-tool-card","aria-label":n("blocks.createAgents.collectionAria"),children:t==="running"?a.jsx(FLe,{label:n("blocks.createAgents.retrieving")}):o?a.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[a.jsx("span",{className:"create-agent-card__message-title",children:n("blocks.createAgents.retrievalFailed")}),a.jsx("span",{children:l||n("blocks.createAgents.checkConfig")})]}):a.jsx(ALe,{className:"create-agent-card__accordion",children:s.map(c=>a.jsxs(NLe,{className:"create-agent-card__accordion-item",value:c.value,children:[a.jsx(RLe,{className:"create-agent-card__accordion-header",children:a.jsxs(ILe,{className:"create-agent-card__accordion-trigger",children:[a.jsx("span",{children:c.label}),a.jsxs("span",{className:"create-agent-card__accordion-meta",children:[a.jsx(Za,{color:"secondary",size:"sm",variant:"soft",children:c.sources.length===0?c.value==="skill_hub"?n("blocks.createAgents.notSearched"):n("blocks.createAgents.notConfigured"):c.resources.length}),a.jsx($Le,{className:"create-agent-card__accordion-chevron"})]})]})}),a.jsx(PLe,{className:"create-agent-card__accordion-content",children:a.jsxs("div",{className:"create-agent-card__accordion-scroll",role:"region","aria-label":n("blocks.createAgents.resourceList",{label:c.label}),tabIndex:0,children:[c.value==="skill_hub"&&c.searchKeywords.length>0?a.jsxs("div",{className:"create-agent-card__search-keywords",children:[a.jsx("span",{children:n("blocks.createAgents.searchKeywords")}),a.jsx("span",{children:c.searchKeywords.join("、")})]}):null,c.resources.length>0?a.jsx("div",{className:"create-agent-card__resource-list",children:c.resources.map(u=>a.jsx("div",{className:"create-agent-card__resource",children:a.jsxs("div",{className:"create-agent-card__resource-main",children:[a.jsxs("div",{className:"create-agent-card__resource-title",children:[a.jsx("span",{className:"create-agent-card__resource-name",children:u.name}),u.version?a.jsx(Za,{className:"create-agent-card__resource-version",color:"secondary",size:"sm",variant:"soft",children:u.version}):null]}),u.description?a.jsx("p",{children:u.description}):null]})},u.ref))}):a.jsxs("div",{className:"create-agent-card__empty-category",children:[a.jsx("p",{children:c.sources.length===0?c.value==="skill_hub"?n("blocks.createAgents.skillHubSkipped"):n("blocks.createAgents.sourceSkipped",{label:c.label}):n("blocks.createAgents.noResources")}),c.sources.filter(u=>u.message).map(u=>a.jsx("p",{className:"create-agent-card__raw-source-error",children:u.message},u.source))]})]})})]},c.value))},r.collectionId||"collected-resources")})}function Ajt({args:e,response:t,status:n}){const{t:i}=_e("conversation"),r=p.useMemo(()=>({tool:i("blocks.createAgents.sourceLabels.tool"),knowledge:i("blocks.createAgents.sourceLabels.knowledge"),skillCenter:i("blocks.createAgents.sourceLabels.skillCenter"),unknownSource:i("blocks.createAgents.sourceLabels.unknown"),unnamedResource:i("blocks.createAgents.unnamedResource"),unnamedAgent:i("blocks.createAgents.unnamedAgent")}),[i]),s=p.useMemo(()=>wLe(e,t,r),[e,r,t]),o=n==="failed"?PM(t):"";return a.jsxs("section",{className:"create-agent-tool-card is-agent-results","aria-label":i("blocks.createAgents.resultAria"),children:[o?a.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[a.jsx("span",{className:"create-agent-card__message-title",children:i("blocks.createAgents.creationFailed")}),a.jsx("span",{children:o})]}):null,s.agents.length>0?a.jsx("div",{className:"create-agent-card__agent-grid",children:s.agents.map(l=>{const c=n==="failed"?"failed":l.status,u=l.error||c==="failed"&&o,d=l.builtinTools.length+l.pythonTools.length;return a.jsxs(xH,{className:`create-agent-card__agent-card${u?" is-error":""}`,children:[a.jsx(wH,{leading:a.jsx(r1,{seed:l.name}),title:l.name,titleText:l.name,status:a.jsx(Za,{color:"secondary",size:"sm",variant:"soft",children:i(`blocks.createAgents.agentTypes.${l.rootType}`,{defaultValue:l.rootType})})}),l.description?a.jsx(kH,{children:l.description}):null,u?a.jsx("div",{className:"create-agent-card__agent-result is-error",role:"alert",children:u}):null,a.jsxs("div",{className:"create-agent-card__agent-resources","aria-label":i("blocks.createAgents.agentResources",{name:l.name}),children:[a.jsx(R_,{label:i("blocks.createAgents.skill"),count:l.skills.length,icon:a.jsx(mN,{"aria-hidden":"true"}),children:a.jsx(L4,{label:i("blocks.createAgents.skill"),resources:l.skills})}),a.jsx(R_,{label:i("blocks.createAgents.knowledgeBase"),count:l.knowledgeBases.length,icon:a.jsx(vIe,{"aria-hidden":"true"}),children:a.jsx(L4,{label:i("blocks.createAgents.knowledgeBase"),resources:l.knowledgeBases})}),a.jsxs(R_,{label:i("blocks.createAgents.toolsLabel"),count:d,icon:a.jsx(bat,{"aria-hidden":"true"}),children:[a.jsx(L4,{label:i("blocks.createAgents.builtinTool"),resources:l.builtinTools}),a.jsx(Sjt,{tools:l.pythonTools})]}),a.jsx(R_,{label:i("blocks.createAgents.subAgents"),count:l.subAgentCount,icon:a.jsx(vat,{"aria-hidden":"true"}),children:a.jsx(Ejt,{agents:l.subAgents})})]})]},l.name)})}):n==="running"?a.jsx(FLe,{label:i("blocks.createAgents.creating")}):a.jsxs("div",{className:"create-agent-card__message",children:[a.jsx("span",{className:"create-agent-card__message-title",children:i("blocks.createAgents.noAgents")}),a.jsx("span",{children:i("blocks.createAgents.noAgentResult")})]})]})}const Tjt={web_search:{name:"web_search",runningLabel:"Searching the web",doneLabel:"Web search complete",tone:"search",icon:$ne},link_reader:{name:"link_reader",runningLabel:"Reading webpage",doneLabel:"Webpage read complete",tone:"search",icon:$ne},run_code:{name:"run_code",runningLabel:"Running code in the AgentKit sandbox",doneLabel:"Code execution completed in the AgentKit sandbox",tone:"sandbox",icon:y_t},list_envs:{name:"list_envs",runningLabel:"Checking available environments",doneLabel:"Available environments loaded",tone:"resources",icon:x_t},get_env_manifest:{name:"get_env_manifest",runningLabel:"Loading the environment manifest",doneLabel:"Environment manifest loaded",tone:"knowledge",icon:w_t},execute_in_sandbox:{name:"execute_in_sandbox",runningLabel:"Running a command in the environment",doneLabel:"Command completed in the environment",tone:"sandbox",icon:Bne},delegate_to_codex_sandbox:{name:"delegate_to_codex_sandbox",runningLabel:"Codex Sandbox is running",doneLabel:"Codex Sandbox completed",failedLabel:"Codex Sandbox failed",tone:"sandbox",icon:Bne},image_generate:{name:"image_generate",runningLabel:"Generating image",doneLabel:"Image generated",tone:"image",icon:h_t},video_generate:{name:"video_generate",runningLabel:"Generating video",doneLabel:"Video generated",tone:"video",icon:cq},ppt_generate:{name:"ppt_generate",runningLabel:"Generating presentation",doneLabel:"Presentation generated",tone:"presentation",icon:p_t},load_memory:{name:"load_memory",runningLabel:"Searching long-term memory",doneLabel:"Memory search complete",tone:"memory",icon:m_t},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"Searching the knowledge base",doneLabel:"Knowledge base search complete",tone:"knowledge",icon:g_t},load_skill:{name:"load_skill",runningLabel:"Loading skill",doneLabel:"Skill loaded",tone:"skill",icon:b_t},collect_resources:{name:"collect_resources",runningLabel:"Collecting available resources",doneLabel:"Resource collection complete",failedLabel:"Resource collection failed",tone:"resources",icon:v_t,detailRenderer:Cjt},create_agents:{name:"create_agents",runningLabel:"Creating and running agents",doneLabel:"Agent creation complete",failedLabel:"Agent creation failed",tone:"agent",icon:Fne,detailRenderer:Ajt},branch_compare:{name:"branch_compare",runningLabel:"",doneLabel:"",failedLabel:"",tone:"search",icon:Fne,detailRenderer:V_t,hideHeader:!0}};function gq(e){return Tjt[e]}function _jt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3h8l4 4v14H6Z"}),a.jsx("path",{d:"M14 3v5h5"}),a.jsx("path",{d:"m10 12-2 2 2 2M14 12l2 2-2 2"})]})}function jjt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M12 3 19 6v5c0 4.6-2.8 7.8-7 10-4.2-2.2-7-5.4-7-10V6l7-3Z"}),a.jsx("path",{d:"m9 12 2 2 4-4"})]})}function Njt(e,t){const n=new Map(e.map(o=>[o.path,o.content])),i=new Map(t.map(o=>[o.path,o.content])),r=new Set([...n.keys(),...i.keys()]),s=[];for(const o of[...r].sort((l,c)=>l.localeCompare(c))){const l=n.get(o),c=i.get(o);l!==c&&s.push({path:o,status:l===void 0?"added":c===void 0?"deleted":"modified",before:l??"",after:c??""})}return s}function _b(e){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...e}}function BLe(e){return a.jsx("svg",{..._b(e),children:a.jsx("path",{d:"m9 7-5 5 5 5M15 7l5 5-5 5M13.5 4l-3 16"})})}function $4(e){return a.jsx("svg",{..._b(e),children:a.jsx("path",{d:"M6.5 3.75h7l4 4V20.25h-11zM13.5 3.75v4h4M9 12h6M9 15.5h4.5"})})}function Rjt(e){return a.jsx("svg",{..._b(e),children:a.jsx("path",{d:"M3.75 7.25h6l1.75 2h8.75v9.25H3.75zM3.75 7.25V5.5h5l1.5 1.75"})})}function Ijt(e){return a.jsx("svg",{..._b(e),children:a.jsx("path",{d:"m9 5 7 7-7 7"})})}function ST(e){return a.jsx("svg",{..._b(e),children:a.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function Pjt(e){return a.jsxs("svg",{..._b(e),children:[a.jsx("circle",{cx:"12",cy:"12",r:"3.25"}),a.jsx("path",{d:"M12 2.75v2M12 19.25v2M2.75 12h2M19.25 12h2M5.45 5.45l1.4 1.4M17.15 17.15l1.4 1.4M18.55 5.45l-1.4 1.4M6.85 17.15l-1.4 1.4"})]})}function Djt(e){return a.jsx("svg",{..._b(e),children:a.jsx("path",{d:"M19.25 15.25A8 8 0 0 1 8.75 4.75a8 8 0 1 0 10.5 10.5Z"})})}function ULe(e){return a.jsxs("svg",{..._b(e),children:[a.jsx("path",{d:"M19.25 8.25V4.5l-1.8 1.8a7.5 7.5 0 1 0 1.8 7.65"}),a.jsx("path",{d:"M19.25 4.5H15.5"})]})}const Mjt=p.lazy(()=>Ys(()=>Promise.resolve().then(()=>EFe),void 0)),Ljt=p.lazy(()=>Ys(()=>import("../chunks/CodeDiffEditor-DwCjEhR1.js"),[])),QLe="veadk-code-workspace-theme";function $jt(e){const t={name:"",children:new Map};for(const n of e){const i=n.path.split("/").filter(Boolean);let r=t;i.forEach((s,o)=>{let l=r.children.get(s);l||(l={name:s,children:new Map},r.children.set(s,l)),o===i.length-1&&(l.path=n.path),r=l})}return t}function Fjt(e,t=!1){return[...e.children.values()].sort((n,i)=>{const r=n.children.size>0&&n.path===void 0,s=i.children.size>0&&i.path===void 0;return r!==s?t?r?1:-1:r?-1:1:n.name.localeCompare(i.name)})}function Bjt(){if(typeof window>"u")return"light";try{return window.localStorage.getItem(QLe)==="dark"?"dark":"light"}catch{return"light"}}function Ujt(e){return e===""?0:e.split(` -`).length}function c1({project:e,open:t,onClose:n,onChange:i,readOnly:r=!1,comparison:s}){var N;const{t:o}=_e("workspaceTools"),l=p.useId(),c=p.useRef(null),u=p.useRef(null),d=p.useRef(n),[f,h]=p.useState(Bjt),m=p.useMemo(()=>s?Njt(s.baseProject.files,e.files):[],[s,e.files]),g=p.useMemo(()=>s?m.map(P=>({path:P.path,content:P.status==="deleted"?P.before:P.after})):e.files,[m,s,e.files]),b=p.useMemo(()=>new Map(m.map(P=>[P.path,P.status])),[m]),[v,y]=p.useState(((N=g[0])==null?void 0:N.path)??null),[w,x]=p.useState(new Set),k=p.useMemo(()=>$jt(g),[g]),S=g.find(P=>P.path===v)??null,O=m.find(P=>P.path===v)??null;if(d.current=n,p.useEffect(()=>{try{window.localStorage.setItem(QLe,f)}catch{}},[f]),p.useEffect(()=>{var _;if(!t)return;const P=document.body.style.overflow,I=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(_=u.current)==null||_.focus();const D=L=>{if(L.key==="Escape"){L.preventDefault(),d.current();return}if(L.key!=="Tab"||!c.current)return;const F=[...c.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')].filter(q=>q.offsetParent!==null);if(F.length===0)return;const M=F[0],H=F[F.length-1];L.shiftKey&&document.activeElement===M?(L.preventDefault(),H.focus()):!L.shiftKey&&document.activeElement===H&&(L.preventDefault(),M.focus())};return window.addEventListener("keydown",D),()=>{document.body.style.overflow=P,window.removeEventListener("keydown",D),I!=null&&I.isConnected&&I.focus()}},[t]),p.useEffect(()=>{S||g.length===0||y(g[0].path)},[g,S]),!t)return null;function A(P){x(I=>{const D=new Set(I);return D.has(P)?D.delete(P):D.add(P),D})}function E(P){return P?a.jsx("span",{className:`code-browser-change is-${P}`,children:o(`codeBrowser.change.${P}`)}):null}function j(P,I,D){return Fjt(P,I===0).map(_=>{const L=D?`${D}/${_.name}`:_.name;if(!(_.children.size>0&&_.path===void 0)&&_.path){const H=b.get(_.path);return a.jsxs("button",{type:"button",className:`code-browser-file${v===_.path?" is-active":""}`,style:{paddingLeft:`${12+I*16}px`},onClick:()=>y(_.path??null),title:_.path,"aria-pressed":v===_.path,children:[a.jsx($4,{}),a.jsx("span",{children:_.name}),E(H)]},L)}const M=w.has(L);return a.jsxs("div",{children:[a.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+I*16}px`},onClick:()=>A(L),"aria-expanded":!M,children:[a.jsx(Ijt,{className:M?"":"is-open"}),a.jsx(Rjt,{}),a.jsx("span",{children:_.name})]}),!M&&j(_,I+1,L)]},L)})}function T(P){!S||s||i({...e,files:e.files.map(I=>I.path===S.path?{...I,content:P}:I)})}const R=f==="light"?"dark":"light",C=o(s?"codeBrowser.noChanges":"codeBrowser.chooseFile");return vi.createPortal(a.jsx("div",{className:"code-browser-backdrop",onMouseDown:P=>{P.target===P.currentTarget&&n()},children:a.jsxs("section",{ref:c,className:`code-browser-dialog is-${f}`,role:"dialog","aria-modal":"true","aria-labelledby":l,children:[a.jsxs("header",{className:"code-browser-head",children:[a.jsxs("div",{className:"code-browser-title-wrap",children:[a.jsx("span",{className:"code-browser-title-icon",children:a.jsx(BLe,{})}),a.jsxs("div",{children:[a.jsx("h2",{id:l,children:o(s?"codeBrowser.compareTitle":"codeBrowser.workspaceTitle")}),a.jsx("p",{title:e.name,children:e.name||o("codeBrowser.projectFallback")})]})]}),a.jsxs("div",{className:"code-browser-head-actions",children:[a.jsx("button",{type:"button",className:"code-browser-icon-button",onClick:()=>h(R),"aria-label":o("codeBrowser.switchTheme"),title:o("codeBrowser.switchThemeTitle",{theme:o(`codeBrowser.themes.${R}`)}),children:f==="light"?a.jsx(Djt,{}):a.jsx(Pjt,{})}),a.jsx("button",{ref:u,type:"button",className:"code-browser-icon-button",onClick:n,"aria-label":o("codeBrowser.closeWorkspace"),title:o("codeBrowser.close"),children:a.jsx(ST,{})})]})]}),a.jsxs("div",{className:"code-browser-workspace",children:[a.jsxs("aside",{className:"code-browser-sidebar","aria-label":o(s?"codeBrowser.changedFiles":"codeBrowser.projectFiles"),children:[a.jsxs("div",{className:"code-browser-sidebar-head",children:[a.jsx("span",{children:o(s?"codeBrowser.changes":"codeBrowser.files")}),a.jsx("span",{children:g.length})]}),a.jsx("div",{className:"code-browser-tree",children:g.length>0?j(k,0,""):a.jsx("div",{className:"code-browser-empty",children:C})})]}),a.jsxs("main",{className:"code-browser-main",children:[a.jsx("div",{className:"code-browser-tabs",role:"tablist","aria-label":o("codeBrowser.openFiles"),children:S?a.jsxs("div",{className:"code-browser-tab",role:"tab","aria-selected":"true",children:[a.jsx($4,{}),a.jsx("span",{children:S.path.split("/").pop()}),E(O==null?void 0:O.status)]}):null}),a.jsxs("div",{className:"code-browser-path",children:[a.jsx($4,{}),a.jsx("span",{children:(S==null?void 0:S.path)??o("codeBrowser.noFileSelected")})]}),s?a.jsxs("div",{className:"code-browser-diff-labels","aria-label":o("codeBrowser.comparisonDirection"),children:[a.jsx("span",{children:s.baseLabel??o("codeBrowser.before")}),a.jsx("span",{children:s.targetLabel??o("codeBrowser.after")})]}):null,a.jsx("div",{className:"code-browser-editor",children:S?a.jsx(p.Suspense,{fallback:a.jsx("div",{className:"code-browser-empty",children:o("codeBrowser.loadingEditor")}),children:O?a.jsx(Ljt,{before:O.before,after:O.after,path:O.path,theme:f}):a.jsx(Mjt,{value:S.content,path:S.path,onChange:T,readOnly:r,theme:f})}):a.jsx("div",{className:"code-browser-empty",children:C})}),a.jsxs("footer",{className:"code-browser-statusbar",children:[a.jsx("span",{children:s?o("codeBrowser.changedFileCount",{count:m.length}):o("codeBrowser.fileCount",{count:e.files.length})}),a.jsx("span",{children:S?o("codeBrowser.lineCount",{count:Ujt(S.content)}):"UTF-8"})]})]})]})]})}),document.body)}function Qjt({project:e,onChange:t,className:n="",label:i}){const{t:r}=_e("workspaceTools"),[s,o]=p.useState(!1),l=i??r("codeBrowser.viewSource");return a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:`code-browser-trigger ${n}`.trim(),onClick:()=>o(!0),"aria-label":r("codeBrowser.viewSourceAria"),title:l,children:[a.jsx(BLe,{}),a.jsx("span",{children:l})]}),a.jsx(c1,{project:e,open:s,onClose:()=>o(!1),onChange:t})]})}const dy="••••••••",I_=5,V0=8e3,zjt=8,Vjt=/(?:authorization|cookie|password|passwd|secret|token|api[_-]?key|access[_-]?key|credential|signature|^env(?:ironment)?$|^ak$|^sk$)/i,zLe=/\u001b\[[0-?]*[ -/]*[@-~]/g,VLe=/\u001b\][^\u0007]*(?:\u0007|\u001b\\)/g,HLe=/[\u0000-\u0008\u000b\u000c\u000e-\u001a\u001c-\u001f\u007f-\u009f]/g,Hjt=new Set(["exec_command","commandExecution","command_execution","run_code","execute_in_sandbox","Run command"]),qjt=new Set(["web_search","search","grep","rg"]),Wjt=new Set(["read_file","read","list_files","glob","ls"]),Kjt=new Set(["apply_patch","file_change","fileChange"]),Gjt=new Set(["create_goal","update_goal","get_goal"]);function yg(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function hv(...e){for(const t of e)if(typeof t=="string"&&t.trim())return t.trim();return""}function F4(...e){for(const t of e){if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"&&t.trim()&&Number.isFinite(Number(t)))return Number(t)}}function II(e){const t=yg(e);if(!t)return[];const n=[t];for(const i of["payload","input","arguments","args","goal","result","display","safeCommandSummary","safeInputSummary"]){const r=yg(t[i]);r&&n.push(r)}return n}function yE(e,...t){return hv(...e.flatMap(n=>t.map(i=>n[i])))}function Xjt(e){let t=e.replace(zLe,"").replace(VLe,"").replace(HLe,"");return/[=:]|Bearer|Cookie|AKLT/i.test(t)&&(t=t.replace(/\bBearer\s+[^\s,;]+/gi,`Bearer ${dy}`).replace(/\b(?:set-)?cookie\s*:\s*[^\r\n]*/gi,`cookie: ${dy}`).replace(/\bAKLT[A-Za-z0-9_-]{6,}\b/g,dy).replace(/((?:access[_-]?key(?:[_-]?id)?|secret(?:[_-]?(?:access)?[_-]?key)?|session[_-]?token|security[_-]?token|client[_-]?secret|api[_-]?key|authorization|cookie|[a-z0-9_-]{0,80}(?:password|secret|token)|credential|ak|sk)\s*[:=]\s*)(?:"[^"]*"|'[^']*'|[^\s,;&]+)/gi,`$1${dy}`).replace(/([?&](?:access[_-]?key|api[_-]?key|client[_-]?secret|security[_-]?token|session[_-]?token|secret|token|password|authorization|cookie|credential)=)[^&#\s]+/gi,`$1${dy}`).replace(/([?&](?:x-amz-(?:credential|signature|security-token)|x-tos-signature|signature)=)[^&#\s]+/gi,`$1${dy}`)),t}function tf(e){return Xjt(e).replace(zLe,"").replace(VLe,"").replace(HLe,"")}function PI(e,t=0,n=new WeakSet){if(t>=zjt)return"[truncated: maximum depth]";if(typeof e=="string")return tf(e);if(e===null||typeof e!="object")return e;if(n.has(e))return"[circular]";if(n.add(e),Array.isArray(e))return e.map(r=>PI(r,t+1,n));const i=yg(e);return i?Object.fromEntries(Object.entries(i).map(([r,s])=>[r,Vjt.test(r)?dy:PI(s,t+1,n)])):e}function B4(e){const t=tf(e).trimEnd();if(!t)return;const n=t.split(/\r?\n/);return t.length>V0*2?{text:t.slice(0,V0)+t.slice(-V0),head:[t.slice(0,V0)],tail:[t.slice(-V0)],omittedLines:0,omittedCharacters:t.length-V0*2}:n.length<=I_*2?{text:t,head:n,tail:[],omittedLines:0,omittedCharacters:0}:{text:t,head:n.slice(0,I_),tail:n.slice(-I_),omittedLines:n.length-I_*2,omittedCharacters:0}}function Yjt(e){return Gjt.has(e)?"goal":Hjt.has(e)?"command":qjt.has(e)||/search/i.test(e)?"search":Wjt.has(e)||/(?:read|list|glob)/i.test(e)?"read":Kjt.has(e)||/(?:write|edit|patch|file.?change)/i.test(e)?"file-change":/^(?:mcp|tool__)/i.test(e)||e.includes("/")?"mcp":/auth|credential|approval/i.test(e)?"authorization":"generic"}function Zjt(e,t){if(e.status)return e.status;const n=hv(t==null?void 0:t.status).toLowerCase();return(t==null?void 0:t.ok)===!1||["failed","error","cancelled","denied","timeout"].includes(n)?"failed":e.done||["completed","done","success"].includes(n)?"completed":"running"}function qne(e){return typeof e=="string"?e.trim()?[e.trim()]:[]:Array.isArray(e)?e.flatMap(t=>{if(typeof t=="string")return t.trim()?[t.trim()]:[];const n=yg(t),i=hv(n==null?void 0:n.path,n==null?void 0:n.filename,n==null?void 0:n.name);return i?[i]:[]}):[]}function Jjt(e,t,n,i,r){const s=[...II(n),...II(i)];return e==="goal"?tf(yE(s,"objective","title","name")):e==="command"?tf(yE(s,"command","cmd","script","commandPreview","binary")):e==="search"?tf(yE(s,"query","pattern","search")):e==="read"||e==="file-change"?r.slice(0,2).map(tf).join(", "):tf(e==="mcp"?hv(n==null?void 0:n.query,n==null?void 0:n.resource,n==null?void 0:n.path):hv(n==null?void 0:n.title,n==null?void 0:n.name,i==null?void 0:i.message,i==null?void 0:i.status,t))}function bq(e){const t=yg(e.args),n=yg(e.response),i=e.args===void 0?void 0:PI(e.args),r=e.response===void 0?void 0:PI(e.response),s=[...II(e.args),...II(e.response)],o=Yjt(e.name),l=Zjt(e,n),c=yg(n==null?void 0:n.display)??yg(t==null?void 0:t.display),u=hv(n==null?void 0:n.aggregatedOutput,n==null?void 0:n.aggregated_output,n==null?void 0:n.output,n==null?void 0:n.errorMessage,n==null?void 0:n.error_message),d=[...qne((t==null?void 0:t.paths)??(t==null?void 0:t.files)??(t==null?void 0:t.changes)??(t==null?void 0:t.path)),...qne((n==null?void 0:n.paths)??(n==null?void 0:n.files)??(n==null?void 0:n.changes))],f=F4(n==null?void 0:n.exitCode,n==null?void 0:n.exit_code),h=F4(n==null?void 0:n.durationMs,n==null?void 0:n.duration_ms,c==null?void 0:c.durationMs),m=F4(n==null?void 0:n.count,n==null?void 0:n.total,n==null?void 0:n.totalCount);return{category:o,titleKey:o==="generic"?`generic.named.${l}`:`${o}.${l}`,titleParams:o==="generic"?{tool:e.name}:void 0,title:e.title,summary:Jjt(o,e.name,t,n,d),status:l,source:e.source,command:o==="command"?tf(hv(yE(s,"command","cmd","script","commandPreview","binary"))):void 0,cwd:o==="command"&&tf(yE(s,"cwd"))||void 0,output:B4(u),exitCode:f,durationMs:h,resultCount:m,paths:[...new Set(d.map(tf))],defaultOpen:e.defaultOpen===!0||l==="running"||l==="failed",rawArgs:i,rawResponse:r,rawArgsPreview:i===void 0?void 0:B4(Wne(i)),rawResponsePreview:r===void 0?void 0:B4(Wne(r))}}function Wne(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function Kne(e){return e.status==="completed"&&(e.category==="read"||e.category==="search")}function Pd(e){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...e}}function eNt(e){return a.jsxs("svg",{...Pd(e),children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("path",{d:"m7.5 9 2.7 2.5L7.5 14M12.7 14h3.8M3.8 7.5h16.4"})]})}function qLe(e){return a.jsxs("svg",{...Pd(e),children:[a.jsx("path",{d:"M6 3.5h7l5 5v12H6zM13 3.5v5h5M8.8 13h5.7M8.8 16h3.8"}),a.jsx("circle",{cx:"16.8",cy:"16.5",r:"2.3"}),a.jsx("path",{d:"m18.5 18.2 1.8 1.8"})]})}function tNt(e){return a.jsxs("svg",{...Pd(e),children:[a.jsx("circle",{cx:"10.5",cy:"10.5",r:"5.75"}),a.jsx("path",{d:"m15 15 4.25 4.25"})]})}function nNt(e){return a.jsxs("svg",{...Pd(e),children:[a.jsx("path",{d:"M5.5 3.5h7l4 4v4M12.5 3.5v4h4M10.5 20.5h-5v-17"}),a.jsx("path",{d:"m12.5 17.5 5.6-5.6 2 2-5.6 5.6-2.8.8z"})]})}function iNt(e){return a.jsxs("svg",{...Pd(e),children:[a.jsx("path",{d:"M8 8V4.5M16 8V4.5M6.5 8h11v3.5a5.5 5.5 0 0 1-11 0zM12 17v3"}),a.jsx("path",{d:"M5.5 4.5h5M13.5 4.5h5"})]})}function rNt(e){return a.jsxs("svg",{...Pd(e),children:[a.jsx("path",{d:"M12 3.5 19 6v5.2c0 4.3-2.7 7.6-7 9.3-4.3-1.7-7-5-7-9.3V6z"}),a.jsx("path",{d:"m8.8 12 2 2 4.4-4.4"})]})}function Gne(e){return a.jsx("svg",{...Pd(e),children:a.jsx("path",{d:"M14.8 6.2a4.1 4.1 0 0 0-5.6 5.6l-5.4 5.4a2 2 0 0 0 2.8 2.8l5.4-5.4a4.1 4.1 0 0 0 5.6-5.6l-2.5 2.5-2.6-.6-.6-2.6z"})})}function yq(e){return a.jsx("svg",{...Pd(e),children:a.jsx("path",{d:"m9 5 7 7-7 7"})})}function WLe(e){return a.jsx("svg",{...Pd(e),children:a.jsx("path",{d:"m5 12.5 4.5 4.5L19 7.5"})})}function sNt(e){return a.jsxs("svg",{...Pd(e),children:[a.jsx("circle",{cx:"12",cy:"12",r:"8.5"}),a.jsx("path",{d:"M12 7.5v5.25M12 16.25h.01"})]})}function aNt(e){return a.jsx("svg",{...Pd(e),children:a.jsx("path",{d:"M20 12a8 8 0 1 1-2.35-5.65"})})}function oNt(e){return a.jsxs("svg",{...Pd(e),children:[a.jsx("rect",{x:"8",y:"8",width:"11",height:"11",rx:"2"}),a.jsx("path",{d:"M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"})]})}const lNt={goal:Gne,command:eNt,read:qLe,search:tNt,"file-change":nNt,mcp:iNt,authorization:rNt,generic:Gne};function cNt(e){return e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(e<1e4?1:0)} s`}function KLe(e){if(e===void 0)return"";if(typeof e=="string"){const t=e.trim();if(t.startsWith("{")||t.startsWith("["))try{return JSON.stringify(JSON.parse(t),null,2)}catch{return e}return e}try{return JSON.stringify(e,null,2)}catch{return String(e)}}function uNt({status:e}){return e==="running"||e==="queued"?a.jsx(aNt,{className:"tool-activity__status-icon is-spinning"}):e==="failed"?a.jsx(sNt,{className:"tool-activity__status-icon"}):a.jsx(WLe,{className:"tool-activity__status-icon"})}function dNt({presentation:e,callId:t}){const{t:n}=_e("conversation"),[i,r]=p.useState(!1),[s,o]=p.useState(""),[l,c]=p.useState(!1),u=p.useRef(void 0);p.useEffect(()=>()=>window.clearTimeout(u.current),[]);const d=async(f,h)=>{window.clearTimeout(u.current);try{await navigator.clipboard.writeText(typeof h=="string"?h:KLe(h)),o(f),c(!1),u.current=window.setTimeout(()=>o(""),1500)}catch{o(""),c(!0),u.current=window.setTimeout(()=>c(!1),3e3)}};return e.rawArgs===void 0&&e.rawResponse===void 0&&!t?null:a.jsxs("div",{className:"tool-activity__raw",children:[a.jsxs("button",{type:"button",onClick:()=>r(f=>!f),"aria-expanded":i,children:[n("blocks.toolActivity.rawData"),a.jsx(yq,{className:i?"is-open":""})]}),i?a.jsxs("div",{className:"tool-activity__raw-body",children:[t?a.jsxs("div",{className:"tool-activity__raw-id",children:[a.jsx("span",{children:n("blocks.toolActivity.callId")}),a.jsx("code",{children:t}),a.jsx("button",{type:"button",onClick:()=>void d("id",t),"aria-label":n("blocks.toolActivity.copyCallId"),children:a.jsx(oNt,{})})]}):null,e.rawArgs!==void 0?a.jsx(Xne,{label:n("blocks.arguments"),value:e.rawArgs,preview:e.rawArgsPreview,copied:s==="input",onCopy:()=>void d("input",e.rawArgs)}):null,e.rawResponse!==void 0?a.jsx(Xne,{label:n("blocks.result"),value:e.rawResponse,preview:e.rawResponsePreview,copied:s==="result",onCopy:()=>void d("result",e.rawResponse)}):null,l?a.jsx("span",{className:"tool-activity__copy-error",role:"alert",children:n("blocks.toolActivity.copyFailed")}):null]}):null]})}function Xne({label:e,value:t,preview:n,copied:i,onCopy:r}){const{t:s}=_e("conversation");return a.jsxs("section",{className:"tool-activity__raw-section",children:[a.jsxs("div",{children:[a.jsx("span",{children:e}),a.jsx("button",{type:"button",onClick:r,children:s(i?"blocks.toolActivity.copied":"blocks.toolActivity.copy")})]}),a.jsxs("pre",{children:[(n==null?void 0:n.head.join(` -`))??KLe(t),n&&n.omittedCharacters>0?` +`+v+"]"}return r.pop(),s=v,w}};const gTt={parse:cTt,stringify:mTt};var GMe=gTt;const bTt=2e5,yTt=new Set(["__proto__","constructor","prototype"]),vTt=/^(?:https?:|data:|blob:|file:|javascript:|image:\/\/)/i;function bS(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function RI(e,t=0){if(t>30)throw new Error("ECharts option nesting is too deep");if(typeof e=="number"&&!Number.isFinite(e))throw new Error("ECharts option contains a non-finite number");if(typeof e=="string"&&vTt.test(e.trim()))throw new Error("ECharts option contains an external resource");if(Array.isArray(e)){for(const n of e)RI(n,t+1);return}if(bS(e))for(const[n,i]of Object.entries(e)){if(yTt.has(n))throw new Error("ECharts option contains an unsafe key");RI(i,t+1)}}function xTt(e){var i;const t=e.trim(),n=t.match(/^(?:(?:const|let|var)\s+)?option\s*=\s*([\s\S]*?)\s*;?$/);return((i=n==null?void 0:n[1])==null?void 0:i.trim())||t}function wTt(e,t){let n=1,i="",r=!1,s=!1,o=!1;for(let l=t+1;li+2)throw new Error("Invalid ECharts gradient argument count");const r=n.slice(0,i).map(kTt),s=n[i],o=n[i+1]??!1;if(!Array.isArray(s)||typeof o!="boolean")throw new Error("Invalid ECharts gradient data");return e==="linear"?{type:e,x:r[0],y:r[1],x2:r[2],y2:r[3],colorStops:s,global:o}:{type:e,x:r[0],y:r[1],r:r[2],colorStops:s,global:o}}function STt(e,t){const n=/^(?:new\s+)?echarts\.graphic\.(LinearGradient|RadialGradient)\s*\(/;let i="",r=!1,s=!1,o=!1;for(let l=t;lbTt)throw new Error("ECharts option is too large");const n=ETt(xTt(e));let i;try{i=GMe.parse(n)}catch(o){throw/\bfunction\s*\(|=>/.test(n)?new Error("ECharts function callbacks are not supported"):o}if(!bS(i))throw new Error("ECharts option must be a data object");RI(i);const r={...i};r.aria={...bS(r.aria)?r.aria:{},enabled:!0};const s=r.tooltip;return bS(s)?r.tooltip={...s,renderMode:"richText"}:Array.isArray(s)&&(r.tooltip=s.map(o=>bS(o)?{...o,renderMode:"richText"}:o)),t&&(r.animation=!1),r}let I4;function CTt(){return I4??(I4=Ys(()=>import("../visualizations/echarts/index-CGT341lL.js"),[]).catch(e=>{throw I4=void 0,e})),I4}function ATt({source:e}){const{t}=_e("conversation"),n=p.useRef(null),[i,r]=p.useState(!1),[s,o]=p.useState("");return p.useEffect(()=>{let l=!1,c,u,d;r(!1);try{d=XMe(e,window.matchMedia("(prefers-reduced-motion: reduce)").matches),o("")}catch{o("invalid");return}return CTt().then(f=>{const h=n.current;l||!h||(c=f.init(h,void 0,{renderer:"svg"}),c.setOption(d,{notMerge:!0}),typeof ResizeObserver<"u"&&(u=new ResizeObserver(()=>c==null?void 0:c.resize()),u.observe(h)),r(!0))}).catch(()=>{c==null||c.dispose(),c=void 0,l||o("render")}),()=>{l=!0,u==null||u.disconnect(),c==null||c.dispose()}},[e]),a.jsxs("div",{className:`echarts-diagram${s?" echarts-diagram--error":""}`,role:"img","aria-label":t("visualization.echartsAria"),"aria-busy":!i&&!s,children:[a.jsx("div",{ref:n,className:"echarts-diagram__canvas",hidden:!!s}),!i&&!s?a.jsx("div",{className:"echarts-diagram__state","aria-live":"polite",children:a.jsx(on,{duration:2.2,spread:15,children:t("visualization.rendering")})}):null,s?a.jsx("p",{className:"echarts-diagram__error",role:"alert",children:t(s==="invalid"?"visualization.invalidEcharts":"visualization.renderFailed")}):null]})}const TTt=p.memo(ATt);let _ne,jne=Promise.resolve(),_Tt=0;function jTt(){return _ne??(_ne=Ys(async()=>{const{default:e}=await import("../visualizations/mermaid/mermaid.core-DX8cWFj6.js").then(t=>t.ay);return{default:e}},__vite__mapDeps([0,1])).then(({default:e})=>(e.initialize({startOnLoad:!1,securityLevel:"strict",suppressErrorRendering:!0,theme:"neutral"}),e))),_ne}function NTt(e){const t=jne.then(async()=>{const n=await jTt(),i=`mermaid-diagram-${_Tt+=1}`;return n.render(i,e)});return jne=t.then(()=>{},()=>{}),t}function RTt({source:e}){const{t}=_e("conversation"),n=p.useRef(null),[i,r]=p.useState(null),[s,o]=p.useState(!1);return p.useEffect(()=>{let l=!1;return r(null),o(!1),NTt(e).then(c=>{l||r(c)}).catch(()=>{l||o(!0)}),()=>{l=!0}},[e]),p.useEffect(()=>{!(i!=null&&i.bindFunctions)||!n.current||i.bindFunctions(n.current)},[i]),s?a.jsx("div",{className:"mermaid-diagram mermaid-diagram--error",children:a.jsx("p",{className:"mermaid-diagram__error",role:"alert",children:t("visualization.mermaidFailed")})}):i?a.jsx("div",{ref:n,className:"mermaid-diagram",role:"img","aria-label":t("visualization.mermaidAria"),dangerouslySetInnerHTML:{__html:i.svg}}):a.jsx("div",{className:"mermaid-diagram mermaid-diagram--loading","aria-live":"polite",children:a.jsx(on,{duration:2.2,spread:15,children:t("visualization.rendering")})})}const ITt=p.memo(RTt),PTt="_SegmentedControl_1sl7d_1",DTt="_SegmentedControlOption_1sl7d_140",MTt="_SegmentedControlThumb_1sl7d_219",r9={SegmentedControl:PTt,SegmentedControlOption:DTt,SegmentedControlThumb:MTt},dd=({value:e,onChange:t,children:n,block:i,pill:r=!0,size:s="md",gutterSize:o,className:l,onClick:c,...u})=>{const d=p.useRef(null),f=p.useRef(null),h=p.useCallback(g=>{const b=d.current,v=f.current;if(!b||!v)return;const y=b==null?void 0:b.querySelector('[data-state="on"]');if(!y)return;const w=b.clientWidth;let x=Math.floor(y.clientWidth);const k=y.offsetLeft;if(w-(x+k)<2&&(x=x-1),v.style.width=`${Math.floor(x)}px`,v.style.transform=`translateX(${k}px)`,b.scrollWidth>w){const S=w*.15,O=b.scrollLeft,A=y.offsetLeft,E=A+x;(AO+w-S)&&g&&y.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"})}},[]);oNe({ref:d,onResize:()=>{const g=f.current;if(!g)return;const b=g.style.transition;g.style.transition="",h(!1),g.style.transition=b}}),p.useLayoutEffect(()=>{const g=d.current,b=f.current;!g||!b||(h(!!b.style.transition),b.style.transition||hI(()=>{b.style.transition="width 300ms var(--cubic-enter), transform 300ms var(--cubic-enter)"}))},[h,e,s,o,r]);const m=g=>{g&&t&&t(g)};return a.jsxs(Sft,{ref:d,className:qi(r9.SegmentedControl,l),type:"single",value:e,loop:!1,onValueChange:m,onClick:c,"data-block":i?"":void 0,"data-pill":r?"":void 0,"data-size":s,"data-gutter-size":o,...u,children:[a.jsx("div",{className:r9.SegmentedControlThumb,ref:f}),n]})},LTt=({children:e,...t})=>a.jsx(_ft,{className:r9.SegmentedControlOption,...t,onPointerEnter:SV,children:a.jsx("span",{className:"relative",children:e})});dd.Option=LTt;function $Tt({children:e,label:t,language:n,source:i,streaming:r=!1}){const{t:s}=_e("conversation"),[o,l]=p.useState("preview"),c=r?"code":o;return a.jsxs("section",{className:"visualization-card","aria-label":s("visualization.cardAria",{label:t}),children:[a.jsx("div",{className:"visualization-card__toolbar",children:a.jsxs(dd,{className:"visualization-card__tabs",value:c,size:"sm",gutterSize:"sm",pill:!1,"aria-label":s("visualization.viewAria",{label:t}),onChange:u=>{r||l(u)},children:[a.jsx(dd.Option,{value:"preview",disabled:r,children:s("visualization.preview")}),a.jsx(dd.Option,{value:"code",children:s("visualization.code")})]})}),a.jsx("div",{className:"visualization-card__body",children:c==="code"?a.jsx("pre",{className:"visualization-card__code",children:a.jsx("code",{className:`language-${n}`,children:i})}):e})]})}const FTt=p.memo($Tt);function YMe(e){const t=e==null?void 0:e.trim().toLowerCase();if(t==="mermaid")return"mermaid";if(t==="echart"||t==="echarts")return"echarts"}const ZMe=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function s9(e){return typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(s9).join(""):p.isValidElement(e)?s9(e.props.children):""}function BTt(e){var i;const t=p.Children.toArray(e)[0];if(!p.isValidElement(t))return;const n=(i=t.props.className)==null?void 0:i.split(/\s+/).find(r=>r.startsWith("language-"));return YMe(n==null?void 0:n.slice(9))}function JMe(e){if(!e)return!1;try{const t=e.toLowerCase();return ZMe.some(n=>t.includes(n))}catch{return!1}}function UTt(e){var i;const t=(i=e==null?void 0:e.properties)==null?void 0:i.href;if(!t)return!1;if(JMe(t))return!0;const n=e==null?void 0:e.children;if(n&&Array.isArray(n)){const r=n.map(s=>(s==null?void 0:s.value)||"").join("").toLowerCase();return ZMe.some(s=>r.includes(s))}return!1}function QTt({text:e,className:t,allowRawHtml:n=!0,streaming:i=!1}){const{t:r}=_e("conversation"),s=p.useContext(Rje),[o,l]=p.useState(null),c=(f,h)=>{if(f.src)return f.src;if(h){const m=b=>{var v;if(!b)return null;if(b.type==="source"&&((v=b.properties)!=null&&v.src))return b.properties.src;if(b.children)for(const y of b.children){const w=m(y);if(w)return w}return null},g=m({children:h});if(g)return g}return""},u=f=>{try{const m=new URL(f).pathname.split("/");return m[m.length-1]||"video.mp4"}catch{return"video.mp4"}},d=f=>f?Array.isArray(f)?f.map(h=>(h==null?void 0:h.value)||"").join("")||"video":(f==null?void 0:f.value)||"video":"video";return a.jsxs("div",{className:t?`md ${t}`:"md",children:[a.jsx(YPe,{disallowedElements:s?["file-card","personal-drive-enable-card"]:void 0,remarkPlugins:[kDe],rehypePlugins:n?[iTt,cne]:[cne],components:{pre:({node:f,children:h,...m})=>{const g=BTt(h);if(g==="mermaid"||g==="echarts"){const b=s9(h).replace(/\n$/,"");return a.jsx(FTt,{label:g==="mermaid"?"Mermaid":"ECharts",language:g,source:b,streaming:i,children:g==="mermaid"?a.jsx(ITt,{source:b}):a.jsx(TTt,{source:b})})}return a.jsx("pre",{...m,children:h})},a:({node:f,...h})=>{const m=h.href,g=s&&Wst(m);if(g)return a.jsx(Kst,{...s,path:g,children:h.children});if(m&&(JMe(m)||UTt(f))){const b=m,v=d(f==null?void 0:f.children);return a.jsxs("div",{className:"video-container",children:[a.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":r("markdown.playVideo",{name:v}),onClick:()=>l({src:b,title:v}),children:[a.jsx("video",{src:b,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),a.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:a.jsx(aE,{})})]}),a.jsx("div",{className:"video-caption",children:a.jsx("a",{href:b,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:v})})]})}return a.jsx("a",{...h,target:"_blank",rel:"noopener noreferrer"})},img:({node:f,src:h,alt:m,...g})=>{const b=a.jsx("img",{...g,src:h,alt:m??"",loading:"lazy"});return h?a.jsx(UAe,{src:h,children:a.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":r("markdown.enlargeImage",{name:m||r("markdown.image")}),children:[b,a.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:a.jsx(aE,{})})]})}):b},video:({node:f,src:h,children:m,...g})=>{const b=c({src:h},m);return b?a.jsx("div",{className:"video-container",children:a.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":r("markdown.enlargeVideo"),onClick:()=>l({src:b}),children:[a.jsx("video",{src:b,...g,playsInline:!0,className:"video-thumbnail",children:m}),a.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:a.jsx(aE,{})})]})}):a.jsx("video",{src:h,controls:!0,playsInline:!0,className:"video-inline",...g,children:m})}},children:e}),o&&a.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":r("markdown.videoPreview"),onClick:()=>l(null),children:a.jsxs("div",{className:"video-viewer",onClick:f=>f.stopPropagation(),children:[a.jsxs("div",{className:"video-viewer-header",children:[a.jsx("div",{className:"video-viewer-title",children:o.title||u(o.src)}),a.jsxs("nav",{className:"video-viewer-nav",children:[a.jsx("a",{href:o.src,download:o.title||u(o.src),"aria-label":r("markdown.downloadVideo"),title:r("markdown.downloadVideo"),className:"video-viewer-download",children:a.jsx(JD,{})}),a.jsx("button",{type:"button",className:"video-viewer-close","aria-label":r("markdown.close"),onClick:()=>l(null),children:a.jsx(Bo,{})})]})]}),a.jsx("div",{className:"video-viewer-body",children:a.jsx("video",{src:o.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const Nd=p.memo(QTt);function P4(e){return(e==null?void 0:e.trim())||Cb("resourceMetadata.unknownSource")}function eLe(e){return(e==null?void 0:e.trim())||Cb("resourceMetadata.unknownCreator")}function zTt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5 5.5A2.5 2.5 0 0 1 7.5 3H19v16H7.5A2.5 2.5 0 0 0 5 21.5v-16Z"}),a.jsx("path",{d:"M5 18.5A2.5 2.5 0 0 1 7.5 16H19"}),a.jsx("path",{d:"M9 7h6M9 10h4"})]})}function VTt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3h8l4 4v14H6V3Z"}),a.jsx("path",{d:"M14 3v5h5M9 12h6M9 16h6"})]})}function HTt(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m7 7 10 10M17 7 7 17"})})}function qTt(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 5v14M5 12h14"})})}function kT({title:e,children:t,onClose:n,busy:i=!1,className:r=""}){const{t:s}=_e("ui"),o=p.useId(),l=p.useRef(null),c=p.useRef(null),u=p.useRef(i),d=p.useRef(n);return p.useEffect(()=>{u.current=i,d.current=n},[i,n]),p.useEffect(()=>{var g;const f=document.activeElement instanceof HTMLElement?document.activeElement:null,h=document.body.style.overflow;document.body.style.overflow="hidden",(g=l.current)==null||g.focus();const m=b=>{if(b.key==="Escape"&&!u.current){d.current();return}if(b.key!=="Tab")return;const v=c.current;if(!v)return;const y=Array.from(v.querySelectorAll('button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), a[href], audio[controls], video[controls], iframe, [tabindex]:not([tabindex="-1"])')).filter(k=>k.getClientRects().length>0);if(y.length===0){b.preventDefault();return}const w=y[0],x=y[y.length-1];b.shiftKey&&(document.activeElement===w||!v.contains(document.activeElement))?(b.preventDefault(),x.focus()):!b.shiftKey&&(document.activeElement===x||!v.contains(document.activeElement))&&(b.preventDefault(),w.focus())};return window.addEventListener("keydown",m),()=>{window.removeEventListener("keydown",m),document.body.style.overflow=h,f!=null&&f.isConnected&&f.focus()}},[]),vi.createPortal(a.jsx("div",{className:"knowledge-dialog-backdrop",onMouseDown:f=>{f.target===f.currentTarget&&!i&&n()},children:a.jsxs("section",{ref:c,className:`knowledge-dialog${r?` ${r}`:""}`,role:"dialog","aria-modal":"true","aria-labelledby":o,"aria-busy":i||void 0,children:[a.jsxs("header",{className:"knowledge-dialog__header",children:[a.jsx("h2",{id:o,children:e}),a.jsx("button",{ref:l,type:"button",onClick:n,disabled:i,"aria-label":s("common.close"),children:a.jsx(HTt,{})})]}),t]})}),document.body)}function jC({message:e}){return e?a.jsx("div",{className:"knowledge-form-error",role:"alert",children:e}):null}function a9(e){return e instanceof DOMException&&e.name==="AbortError"}function WTt(e,t){if(!e)return"";const n=Date.parse(e);return Number.isFinite(n)?new Intl.DateTimeFormat(t,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(n):e}const tLe=[".jpg",".jpeg",".png"].join(","),KTt=new Set(tLe.split(",")),nLe=[".pdf",".pptx",".docx",".xlsx",".txt"].join(","),GTt=new Set(nLe.split(",")),XTt=200*1024*1024;function o9(e){const t=e.lastIndexOf(".");return t<0?"":e.slice(t).toLocaleLowerCase()}function YTt(e,t,n){return e.size>XTt?n("knowledge.errors.fileTooLarge"):t==="image"?KTt.has(o9(e.name))?"":n("knowledge.errors.invalidImageType"):GTt.has(o9(e.name))?"":n("knowledge.errors.invalidDocumentType")}function oq(e){return e<=0?"-":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function l9(e){var r;const t=e.type.trim().replace(/^\./,"");if(t)return t.toUpperCase();const n=e.name.trim(),i=n.includes(".")?(r=n.split(".").pop())==null?void 0:r.trim():"";return i?i.toUpperCase():"-"}function ZTt({region:e,onClose:t,onCreated:n}){const{t:i}=_e("ui"),[r,s]=p.useState(""),[o,l]=p.useState(""),[c,u]=p.useState(!1),[d,f]=p.useState(!1),[h,m]=p.useState(""),g=r.trim(),b=!!(g&&!/^[A-Za-z][A-Za-z0-9_]{0,47}$/.test(g)),v=async y=>{if(y.preventDefault(),u(!0),!g||b)return;f(!0),m("");const w={name:g,description:o.trim()||void 0,region:e};try{n(await Pbt(w))}catch(x){m(Sl(x,i("knowledge.errors.createBase")))}finally{f(!1)}};return a.jsx(kT,{title:i("knowledge.createBase"),onClose:t,busy:d,children:a.jsxs("form",{onSubmit:y=>void v(y),children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:i("common.name")}),a.jsx("input",{autoFocus:!0,value:r,maxLength:48,"aria-invalid":c&&b||void 0,"aria-describedby":"knowledge-name-help",onBlur:()=>u(!0),onChange:y=>s(y.target.value)})]}),a.jsx("p",{id:"knowledge-name-help",className:`knowledge-dialog__note${c&&b?" is-error":""}`,role:c&&b?"alert":void 0,children:i(c&&b?"knowledge.invalidName":"knowledge.nameHelp")}),a.jsxs("label",{children:[a.jsx("span",{children:i("knowledge.optionalDescription")}),a.jsx("textarea",{value:o,maxLength:80,onChange:y=>l(y.target.value)})]}),a.jsx(jC,{message:h})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:t,disabled:d,children:i("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:d||!g||b,children:i(d?"common.creating":"common.create")})]})]})})}function JTt({item:e,onClose:t,onUpdated:n}){const{t:i}=_e("ui"),[r,s]=p.useState(e.description),[o,l]=p.useState(!1),[c,u]=p.useState(""),d=async f=>{f.preventDefault(),l(!0),u("");try{n(await Dbt(e.id,e.region,{description:r.trim()}))}catch(h){u(Sl(h,i("knowledge.errors.updateBase")))}finally{l(!1)}};return a.jsx(kT,{title:i("knowledge.editBase"),onClose:t,busy:o,children:a.jsxs("form",{onSubmit:f=>void d(f),children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:i("common.name")}),a.jsx("input",{value:e.name,disabled:!0})]}),a.jsxs("label",{children:[a.jsx("span",{children:i("common.description")}),a.jsx("textarea",{autoFocus:!0,value:r,maxLength:80,onChange:f=>s(f.target.value)})]}),a.jsx("p",{className:"knowledge-dialog__note",children:i("knowledge.descriptionOnly")}),a.jsx(jC,{message:c})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:t,disabled:o,children:i("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:o,children:i(o?"common.saving":"common.save")})]})]})})}function iLe(e,t){if(!e.trim())return{};const n=JSON.parse(e);if(!n||Array.isArray(n)||typeof n!="object")throw new Error(t);return n}function e2t({base:e,onClose:t,onCreated:n,onAssociationInvalid:i}){const{t:r}=_e("ui"),[s,o]=p.useState("document"),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(""),[m,g]=p.useState(null),[b,v]=p.useState(!1),[y,w]=p.useState("{}"),[x,k]=p.useState(""),[S,O]=p.useState(""),[A,E]=p.useState(null),j=p.useRef(null),T=p.useRef(null),R=p.useRef(null),C=p.useRef(0),N=!!x;p.useEffect(()=>{var L;A&&!N&&((L=R.current)==null||L.focus())},[N,A]);const P=L=>{N||L===s||(o(L),g(null),h(""),c(""),d(""),O(""),E(null),v(!1),C.current=0,j.current&&(j.current.value=""))},I=L=>{if(!L||s==="web")return;const F=YTt(L,s,r);if(F){g(null),c(""),d(""),O(F);return}g(L),O(""),c(L.name.replace(/\.[^.]+$/,"")),d(o9(L.name).slice(1))},D=async L=>{if(L.preventDefault(),s==="web"?!f.trim():!m)return;let F;try{F=iLe(y,r("knowledge.errors.metadataObject"))}catch(M){O(Sl(M,r("knowledge.errors.metadataFormat")));return}k(s==="web"?A?"save":"preview":"upload"),O("");try{if(s==="web")if(A){const M={sourceType:"url",metadata:A.metadata,url:A.preview.url,sourceTitle:A.preview.name,sourceMarkdown:A.preview.sourceMarkdown};await Fbt(e.id,e.region,M),n()}else{const M=await Bbt(e.id,e.region,{url:f.trim()});if(!M.sourceMarkdown.trim())throw new Error(r("knowledge.errors.noWebPreview"));E({preview:M,metadata:F})}else m&&(await Ubt(e.id,e.region,{file:m,name:l.trim()||void 0,documentType:u.trim()||void 0,metadata:F}),n())}catch(M){M instanceof mM&&M.errorCode===uPe?i(M):O(Sl(M,r(s==="web"?A?"knowledge.errors.addWeb":"knowledge.errors.previewWeb":"knowledge.errors.uploadFile")))}finally{k("")}},_=()=>{N||(E(null),O(""),requestAnimationFrame(()=>{var L;return(L=T.current)==null?void 0:L.focus()}))};return a.jsx(kT,{title:r(A?"knowledge.previewWeb":"knowledge.addData"),onClose:t,busy:N,className:A?"knowledge-dialog--preview knowledge-dialog--web-confirm":"",children:a.jsx("form",{onSubmit:L=>void D(L),children:A?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"knowledge-preview knowledge-web-preview",children:[a.jsxs("div",{className:"knowledge-preview__meta",children:[a.jsx("strong",{title:A.preview.name,children:A.preview.name}),a.jsx("a",{href:A.preview.url,target:"_blank",rel:"noopener noreferrer",children:r("knowledge.openOriginalWeb")})]}),a.jsx("div",{className:"knowledge-preview__body","aria-live":"polite",children:a.jsx("div",{className:"knowledge-preview__markdown-shell",children:a.jsx(Nd,{text:A.preview.sourceMarkdown,allowRawHtml:!1,className:"knowledge-preview__markdown"})})}),S?a.jsx("div",{className:"knowledge-web-preview__error",children:a.jsx(jC,{message:S})}):null]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",className:"is-back",onClick:_,disabled:N,children:r("knowledge.backToEdit")}),a.jsx("button",{type:"button",onClick:t,disabled:N,children:r("common.cancel")}),a.jsx("button",{ref:R,type:"submit",className:"is-primary",disabled:N,children:r(x==="save"?"common.adding":"knowledge.confirmAdd")})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsx("div",{className:"knowledge-source-tabs",role:"tablist","aria-label":r("knowledge.source"),children:[["image",r("knowledge.image")],["document",r("knowledge.documentFile")],["web",r("knowledge.webPage")]].map(([L,F])=>a.jsx("button",{type:"button",role:"tab",id:`knowledge-source-${L}-tab`,"aria-controls":`knowledge-source-${L}-panel`,"aria-selected":s===L,tabIndex:s===L?0:-1,className:s===L?"is-active":"",disabled:N,onClick:()=>P(L),onKeyDown:M=>{const H=["image","document","web"];if(!["ArrowLeft","ArrowRight","Home","End"].includes(M.key))return;M.preventDefault();const q=H.indexOf(L),U=M.key==="Home"?H[0]:M.key==="End"?H[H.length-1]:H[(q+(M.key==="ArrowRight"?1:-1)+H.length)%H.length];P(U),requestAnimationFrame(()=>{var Z;return(Z=document.getElementById(`knowledge-source-${U}-tab`))==null?void 0:Z.focus()})},children:F},L))}),a.jsx("div",{id:`knowledge-source-${s}-panel`,className:"knowledge-source-panel",role:"tabpanel","aria-labelledby":`knowledge-source-${s}-tab`,children:s==="web"?a.jsxs(a.Fragment,{children:[a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.webUrl")}),a.jsx("input",{ref:T,autoFocus:!0,type:"url",value:f,disabled:N,onChange:L=>{h(L.target.value),O("")},placeholder:"https://example.com/article"})]}),a.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:x==="preview"?a.jsx(on,{children:r("knowledge.generatingWebPreview")}):null})]}):a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:j,className:"knowledge-upload-input",type:"file","aria-label":r("knowledge.selectFile"),accept:s==="image"?tLe:nLe,disabled:N,onChange:L=>{var F;I(((F=L.currentTarget.files)==null?void 0:F[0])??null),L.currentTarget.value=""}}),a.jsxs("button",{type:"button",className:`knowledge-upload-dropzone${b?" is-dragging":""}${m?" is-ready":""}`,disabled:N,onClick:()=>{var L;return(L=j.current)==null?void 0:L.click()},onDragEnter:L=>{L.preventDefault(),!N&&(C.current+=1,v(!0))},onDragOver:L=>{L.preventDefault(),N||(L.dataTransfer.dropEffect="copy")},onDragLeave:L=>{L.preventDefault(),C.current=Math.max(0,C.current-1),C.current===0&&v(!1)},onDrop:L=>{var F;L.preventDefault(),C.current=0,v(!1),N||I(((F=L.dataTransfer.files)==null?void 0:F[0])??null)},children:[a.jsx("strong",{children:m?m.name:r("knowledge.selectOrDropFile")}),a.jsx("span",{children:m?r("knowledge.selectedFile",{size:oq(m.size)}):r(s==="image"?"knowledge.imageFileHelp":"knowledge.documentFileHelp")})]}),a.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:N?a.jsx(on,{children:r("knowledge.uploadingFile")}):null})]})}),s!=="web"?a.jsxs("div",{className:"knowledge-dialog__fields",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.optionalName")}),a.jsx("input",{value:l,disabled:N,maxLength:256,onChange:L=>c(L.target.value)})]}),a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.optionalType")}),a.jsx("input",{value:u,disabled:N,maxLength:64,onChange:L=>d(L.target.value),placeholder:"pdf, docx, png"})]})]}):null,a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.metadataJson")}),a.jsx("textarea",{className:"is-code",value:y,disabled:N,onChange:L=>w(L.target.value),spellCheck:!1})]}),a.jsx(jC,{message:S})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:t,disabled:N,children:r("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:N||(s==="web"?!f.trim():!m),children:r(N?s==="web"?"common.generating":"common.uploading":s==="web"?"knowledge.generatePreview":"knowledge.uploadFile")})]})]})})})}function t2t({base:e,item:t,onClose:n,onUpdated:i}){const{t:r}=_e("ui"),[s,o]=p.useState(()=>JSON.stringify(t.metadata??{},null,2)),[l,c]=p.useState(!1),[u,d]=p.useState(""),f=async h=>{h.preventDefault();let m;try{m=iLe(s,r("knowledge.errors.metadataObject"))}catch(g){d(Sl(g,r("knowledge.errors.metadataFormat")));return}c(!0),d("");try{i(await Qbt(e.id,t.id,e.region,{metadata:m}))}catch(g){d(Sl(g,r("knowledge.errors.updateDocument")))}finally{c(!1)}};return a.jsx(kT,{title:r("knowledge.editMetadata"),onClose:n,busy:l,children:a.jsxs("form",{onSubmit:h=>void f(h),children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.knowledge")}),a.jsx("input",{value:t.name||t.id,disabled:!0})]}),a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.metadataJson")}),a.jsx("textarea",{autoFocus:!0,className:"is-code knowledge-metadata-editor",value:s,onChange:h=>o(h.target.value),spellCheck:!1})]}),a.jsx(jC,{message:u})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:n,disabled:l,children:r("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:l,children:r(l?"common.saving":"common.save")})]})]})})}const rLe=new Set(["avif","bmp","gif","jpeg","jpg","png","svg","webp"]),sLe=new Set(["aac","flac","m4a","mp3","ogg","wav","webm"]),aLe=new Set(["m4v","mov","mp4","mpeg","mpg","ogg","webm"]),n2t=new Set(["pdf"]),i2t=new Set(["doc","docx","ppt","pptx","xls","xlsx"]),r2t=new Set(["creating","indexing","pending","processing","queued","submitted"]),s2t=new Set(["error","failed","unavailable"]);function Nne(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function j_(e){if(e==null||e==="")return"-";if(["string","number","boolean"].includes(typeof e))return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function a2t(e,t){if(Array.isArray(e)){if(e.length===0)return null;const r=e.map(Nne);if(r.some(s=>Object.keys(s).length>0)){const s=[...new Set(r.flatMap(o=>Object.keys(o)))];return{columns:s,rows:r.map(o=>s.map(l=>j_(o[l])))}}return{columns:[t("knowledge.value")],rows:e.map(s=>[j_(s)])}}const n=Nne(e),i=Object.entries(n);if(i.length===0)return null;if(i.every(([,r])=>Array.isArray(r))){const r=i.map(([o])=>o),s=Math.max(...i.map(([,o])=>o.length));return{columns:r,rows:Array.from({length:s},(o,l)=>i.map(([,c])=>j_(c[l])))}}return{columns:[t("knowledge.field"),t("knowledge.value")],rows:i.map(([r,s])=>[r,j_(s)])}}function oLe(e){const t=e.trim();if(!t||t.startsWith("//"))return"";if(t.startsWith("/"))return t;try{const n=new URL(t);return["http:","https:"].includes(n.protocol)?n.href:""}catch{return""}}function o2t(e){const t=oLe(e);return t.startsWith("http://")||t.startsWith("https://")?t:""}function l2t(e){var r;const t=e.attachmentType.trim().toLocaleLowerCase();if(t==="image"||t==="doc-image"||t.startsWith("image/"))return"image";if(t==="audio"||t.startsWith("audio/"))return"audio";if(t==="video"||t.startsWith("video/"))return"video";if(t==="pdf"||t==="application/pdf")return"pdf";const n=e.attachmentUrl.split(/[?#]/,1)[0],i=n.includes(".")?((r=n.split(".").pop())==null?void 0:r.toLocaleLowerCase())??"":"";return rLe.has(i)?"image":sLe.has(i)?"audio":aLe.has(i)?"video":n2t.has(i)?"pdf":t||i?"file":"none"}function c2t(e,t){const n=e.status.trim().toLocaleLowerCase();if(r2t.has(n))return{title:t("knowledge.preview.processingTitle"),detail:t("knowledge.preview.processingDetail")};if(s2t.has(n))return{title:t("knowledge.preview.failedTitle"),detail:t("knowledge.preview.failedDetail")};const i=l9(e).toLocaleLowerCase();return i==="pdf"||i2t.has(i)?{title:t("knowledge.preview.noParsedTitle"),detail:t("knowledge.preview.noParsedDetail")}:rLe.has(i)||sLe.has(i)||aLe.has(i)?{title:t("knowledge.preview.noMediaTitle"),detail:t("knowledge.preview.noMediaDetail")}:{title:t("knowledge.preview.noDataTitle"),detail:t("knowledge.preview.noDataDetail")}}function u2t({chunk:e}){const{t}=_e("ui"),[n,i]=p.useState(!1),r=oLe(e.attachmentUrl),s=l2t(e);return!r||s==="none"?null:n?a.jsx("div",{className:"knowledge-preview__attachment-error",children:t("knowledge.preview.attachmentError")}):s==="image"?a.jsx("img",{className:"knowledge-preview__image",src:r,alt:e.title||t("knowledge.preview.imageAlt"),loading:"lazy",onError:()=>i(!0)}):s==="audio"?a.jsx("audio",{className:"knowledge-preview__audio",src:r,controls:!0,preload:"metadata",onError:()=>i(!0),children:t("knowledge.preview.audioUnsupported")}):s==="video"?a.jsx("video",{className:"knowledge-preview__video",src:r,controls:!0,playsInline:!0,preload:"metadata",onError:()=>i(!0),children:t("knowledge.preview.videoUnsupported")}):s==="pdf"?a.jsxs("div",{className:"knowledge-preview__pdf",children:[a.jsx("iframe",{src:r,title:e.title?t("knowledge.preview.namedPdf",{name:e.title}):t("knowledge.preview.pdf"),sandbox:"",referrerPolicy:"no-referrer",onError:()=>i(!0)}),a.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:t("knowledge.preview.openPdf")})]}):a.jsxs("div",{className:"knowledge-preview__file-fallback",children:[a.jsx("p",{children:t("knowledge.preview.fileUnsupported")}),a.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:t("knowledge.preview.openOriginalFile")})]})}function d2t({base:e,item:t,onClose:n}){const{t:i}=_e("ui"),[r,s]=p.useState([]),[o,l]=p.useState(t),[c,u]=p.useState(""),[d,f]=p.useState(!0),[h,m]=p.useState(!1),[g,b]=p.useState(!1),[v,y]=p.useState(""),w=p.useRef(0),x=p.useRef(null),k=p.useCallback(async(E=0)=>{var R;(R=x.current)==null||R.abort();const j=new AbortController;x.current=j;const T=w.current+1;w.current=T,E>0?m(!0):f(!0),y(""),E===0&&(s([]),b(!1));try{const C=await $bt(e.id,t.id,{region:e.region,offset:E,signal:j.signal});if(w.current!==T)return;l(C.document.id?C.document:t),u(C.sourceMarkdown||C.document.sourceMarkdown),s(N=>E>0?[...N,...C.chunks]:C.chunks),b(C.hasMore)}catch(C){!a9(C)&&w.current===T&&y(Sl(C,i("knowledge.errors.loadPreview")))}finally{w.current===T&&(f(!1),m(!1))}},[e.id,e.region,t,i]);p.useEffect(()=>(k(),()=>{var E;(E=x.current)==null||E.abort(),w.current+=1}),[k]);const S=o2t(o.url||t.url),O=c2t(o,i),A=o.metadata._veadk_content_format==="markdown";return a.jsx(kT,{title:o.name||t.name||t.id,onClose:n,className:"knowledge-dialog--preview",children:a.jsxs("div",{className:"knowledge-preview",children:[o.sizeBytes>0||S?a.jsxs("div",{className:"knowledge-preview__meta",children:[o.sizeBytes>0?a.jsx("span",{children:oq(o.sizeBytes)}):null,S?a.jsx("a",{href:S,target:"_blank",rel:"noopener noreferrer",children:i("knowledge.openOriginalWeb")}):null]}):null,a.jsx("div",{className:"knowledge-preview__body","aria-live":"polite",children:c?a.jsx("div",{className:"knowledge-preview__markdown-shell",children:a.jsx(Nd,{text:c,allowRawHtml:!1,className:"knowledge-preview__markdown"})}):d?a.jsx("div",{className:"knowledge-preview__state",role:"status",children:a.jsx(on,{as:"span",duration:2.4,children:i("knowledge.preview.loading")})}):v&&r.length===0?a.jsxs("div",{className:"knowledge-preview__state is-error",role:"alert",children:[a.jsx("p",{children:v}),a.jsx("button",{type:"button",onClick:()=>void k(),children:i("common.retry")})]}):r.length===0?a.jsxs("div",{className:"knowledge-preview__state",children:[a.jsx("p",{children:O.title}),a.jsx("span",{children:S?i("knowledge.preview.openOriginalHint"):O.detail}),a.jsx("button",{type:"button",onClick:()=>void k(),children:i("common.reload")})]}):a.jsxs("div",{className:"knowledge-preview__chunks",children:[r.map((E,j)=>{const T=a2t(E.tableFields,i),R=E.id||`${j}:${E.title}`;return a.jsxs("article",{className:"knowledge-preview__chunk",children:[a.jsx("header",{children:a.jsx("h3",{children:E.title||i("knowledge.preview.chunk",{index:j+1})})}),E.content?A?a.jsx(Nd,{text:E.content,allowRawHtml:!1,className:"knowledge-preview__markdown"}):a.jsx("p",{className:"knowledge-preview__content",children:E.content}):null,T?a.jsx("div",{className:"knowledge-preview__table-wrap",children:a.jsxs("table",{children:[a.jsx("thead",{children:a.jsx("tr",{children:T.columns.map((C,N)=>a.jsx("th",{scope:"col",children:C},`${C}:${N}`))})}),a.jsx("tbody",{children:T.rows.map((C,N)=>a.jsx("tr",{children:C.map((P,I)=>a.jsx("td",{children:P},I))},N))})]})}):null,a.jsx(u2t,{chunk:E})]},R)}),v?a.jsx("div",{className:"knowledge-preview__more-error",role:"alert",children:v}):null,g?a.jsx("button",{type:"button",className:"knowledge-preview__load-more",disabled:h,onClick:()=>void k(r.length),children:h?a.jsx(on,{as:"span",duration:2.4,children:i("knowledge.preview.loadingMore")}):i("knowledge.preview.loadMore")}):null]})})]})})}function f2t({cloudProvider:e,region:t,active:n=!0,activationRevision:i=0,onDetailChange:r,toolbarLeading:s,toolbarFilters:o}){const{t:l,i18n:c}=_e("ui"),[u,d]=p.useState([]),[f,h]=p.useState({}),[m,g]=p.useState([]),[b,v]=p.useState(""),[y,w]=p.useState("overview"),[x,k]=p.useState(""),[S,O]=p.useState(""),[A,E]=p.useState(!0),[j,T]=p.useState(!1),[R,C]=p.useState(""),[N,P]=p.useState([]),[I,D]=p.useState(!1),[_,L]=p.useState(""),[F,M]=p.useState(""),[H,q]=p.useState(""),[U,Z]=p.useState(!1),[z,J]=p.useState(!1),[ne,W]=p.useState(!1),[X,ce]=p.useState(null),[V,Y]=p.useState(null),[K,de]=p.useState(null),[ee,Oe]=p.useState(null),[he,ge]=p.useState(null),[Se,xe]=p.useState(!1),Pe=p.useRef(0),Ue=p.useRef(0),Ke=p.useRef([]),Me=p.useRef(!1),re=p.useRef(!1),ue=p.useRef(null),be=p.useRef(null),Ce=p.useRef({}),Ee=p.useRef(!1),Ve=p.useRef(null),Ge=p.useRef(null),ye=p.useRef(null),oe=p.useRef(null),ie=p.useMemo(()=>[t],[t]),Ae=p.useCallback(qe=>`${qe.region}\0${qe.id}`,[]),Re=u.find(qe=>Ae(qe)===b)??null,St=!!(Re&&H===Ae(Re));p.useEffect(()=>{r==null||r(!!Re)},[r,Re]),p.useEffect(()=>{w("overview"),O("")},[b]);const Nt=p.useMemo(()=>{const qe=x.trim().toLocaleLowerCase();return qe?u.filter(vt=>[vt.name,vt.description,vt.ownerLabel,vt.providerKnowledgeId].some(We=>We.toLocaleLowerCase().includes(qe))):u},[u,x]),Dt=p.useMemo(()=>{const qe=S.trim().toLocaleLowerCase();return qe?N.filter(vt=>[vt.name,vt.id,l9(vt)].some(We=>We.toLocaleLowerCase().includes(qe))):N},[S,N]);p.useEffect(()=>{Y(null)},[Re==null?void 0:Re.id,Re==null?void 0:Re.region]);const Et=p.useCallback(async(qe=!1)=>{var ot;if(qe&&(Ee.current||Object.keys(Ce.current).length===0))return;(ot=ue.current)==null||ot.abort();const vt=new AbortController;ue.current=vt;const We=Pe.current+1;Pe.current=We,Ee.current=!0,qe?T(!0):E(!0),C(""),qe||g([]);try{const it=await Ibt({regions:ie,nextTokens:qe?Ce.current:void 0,signal:vt.signal});if(Pe.current!==We)return;d(At=>qe?[...At,...it.items.filter(Ot=>!At.some(Ut=>Ae(Ut)===Ae(Ot)))]:it.items),Ce.current=it.nextTokens,h(it.nextTokens);const tt=it.failures.map(({region:At,error:Ot})=>`${Sh(At,e)}: ${Sl(Ot,l("common.loadFailed"))}`);g(At=>qe?[...new Set([...At,...tt])]:tt),qe||v(At=>it.items.some(Ot=>Ae(Ot)===At)?At:"")}catch(it){if(a9(it))return;Pe.current===We&&(qe?g(tt=>[...new Set([...tt,Sl(it,l("knowledge.errors.loadMoreBases"))])]):C(Sl(it,l("knowledge.errors.loadBases"))))}finally{Pe.current===We&&(Ee.current=!1,E(!1),T(!1))}},[Ae,e,ie,l]),$t=p.useCallback(async(qe,vt=!1)=>{var it;if(vt&&Me.current)return;(it=be.current)==null||it.abort();const We=new AbortController;be.current=We;const ot=Ue.current+1;Ue.current=ot,vt||(Ke.current=[],re.current=!1,P([]),Z(!1),M("")),Me.current=!0,D(!0),vt?M(""):L("");try{const tt=await Lbt(qe.id,{region:qe.region,offset:vt?Ke.current.length:0,signal:We.signal});if(Ue.current!==ot)return;q(Mt=>Mt===Ae(qe)?"":Mt);const At=Ke.current,Ot=vt?[...At,...tt.items.filter(Mt=>!Mt.id||!At.some(Ze=>Ze.id===Mt.id))]:tt.items,Ut=tt.hasMore&&(!vt||Ot.length>At.length);Ke.current=Ot,re.current=Ut,P(Ot),Z(Ut)}catch(tt){if(a9(tt))return;Ue.current===ot&&(tt instanceof mM&&tt.errorCode===uPe&&(q(Ae(qe)),ce(Ot=>Ot&&Ae(Ot)===Ae(qe)?null:Ot)),vt?M(Sl(tt,l("knowledge.errors.loadMoreData"))):L(Sl(tt,l("knowledge.errors.loadData"))))}finally{Ue.current===ot&&(Me.current=!1,D(!1))}},[Ae,l]);p.useEffect(()=>{var qe;(qe=ue.current)==null||qe.abort(),Pe.current+=1,Ee.current=!1,Ce.current={},d([]),h({}),g([]),v(""),q(""),C(""),E(!0)},[e]),p.useEffect(()=>{if(n)return Et(),()=>{var qe;(qe=ue.current)==null||qe.abort(),Pe.current+=1,Ee.current=!1}},[n,i,Et]),p.useEffect(()=>{var qe,vt;if(!n){(qe=be.current)==null||qe.abort(),Ue.current+=1,Me.current=!1;return}if(!Re){(vt=be.current)==null||vt.abort(),Ue.current+=1,Ke.current=[],Me.current=!1,re.current=!1,P([]),Z(!1),M("");return}return $t(Re),()=>{var We;(We=be.current)==null||We.abort(),Ue.current+=1,Me.current=!1}},[n,i,Re==null?void 0:Re.id,Re==null?void 0:Re.region]);const He=n&&!Re&&!x.trim()&&!A&&!j&&!R&&Object.keys(f).length>0;p.useEffect(()=>{const qe=Ge.current,vt=Ve.current;if(!qe||!vt||!He)return;const We=new IntersectionObserver(([ot])=>{ot.isIntersecting&&Et(!0)},{root:vt,rootMargin:"240px 0px",threshold:.01});return We.observe(qe),()=>We.disconnect()},[He,Et]);const yt=()=>{const qe=Ve.current;!qe||!He||qe.scrollHeight-qe.scrollTop-qe.clientHeight<=240&&Et(!0)},je=!!(Re&&N.length>0&&U&&!I&&!F);p.useEffect(()=>{const qe=oe.current,vt=ye.current;if(!Re||!qe||!vt||!je)return;const We=new IntersectionObserver(([ot])=>{ot.isIntersecting&&$t(Re,!0)},{root:ye.current,rootMargin:"240px 0px",threshold:.01});return We.observe(qe),()=>We.disconnect()},[je,$t,Re==null?void 0:Re.id,Re==null?void 0:Re.region]);const kt=()=>{const qe=ye.current;if(!Re||!qe||!re.current||Me.current||F)return;const{scrollHeight:vt,scrollTop:We,clientHeight:ot}=qe;vt-We-ot<=240&&$t(Re,!0)},_t=qe=>{d(vt=>vt.map(We=>Ae(We)===Ae(qe)?qe:We))},fn=async()=>{if(ee){xe(!0);try{await Mbt(ee.id,ee.region),d(qe=>qe.filter(vt=>Ae(vt)!==Ae(ee))),q(qe=>qe===Ae(ee)?"":qe),b===Ae(ee)&&v(""),Oe(null)}catch(qe){C(Sl(qe,l("knowledge.errors.deleteBase"))),Oe(null)}finally{xe(!1)}}},tn=async()=>{if(!(!Re||!he)){xe(!0);try{await zbt(Re.id,he.id,Re.region);const qe=Ke.current.filter(vt=>vt.id!==he.id);Ke.current=qe,P(qe),ge(null)}catch(qe){L(Sl(qe,l("knowledge.errors.deleteDocument"))),ge(null)}finally{xe(!1)}}};return a.jsxs("section",{className:`knowledge-library${Re?" is-detail":" resource-collection"}`,"aria-label":l("knowledge.library"),children:[Re?a.jsx(dT,{className:"knowledge-library__detail",title:Re.name,description:Re.description||l("common.noDescription"),identitySeed:Re.name,backLabel:l("knowledge.backToList"),onBack:()=>v(""),sections:[{key:"overview",label:l("skillCenter.overview"),content:a.jsx("section",{className:"knowledge-overview",children:a.jsxs(yH,{className:"knowledge-overview__summary",children:[a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.provider")}),a.jsx("dd",{children:Re.providerType||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.knowledgeId")}),a.jsx("dd",{className:"knowledge-keyboard-reveal",tabIndex:0,title:Re.providerKnowledgeId,children:Re.providerKnowledgeId||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.project")}),a.jsx("dd",{children:Re.projectName||"default"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.creator")}),a.jsx("dd",{children:P4(Re.ownerLabel)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("skillCenter.updatedAt")}),a.jsx("dd",{children:WTt(Re.updatedAt,c.resolvedLanguage??c.language)||"-"})]})]})})},{key:"data",label:l("knowledge.data"),content:a.jsx("section",{className:"knowledge-documents",children:a.jsx("div",{className:`knowledge-documents__body${N.length>0?" is-table":""}`,"aria-live":"polite",children:I&&N.length===0?a.jsx(fl,{}):_&&N.length===0?a.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[a.jsx("p",{children:_}),St&&Re.canManage?a.jsx("button",{type:"button",onClick:()=>Oe(Re),children:l("knowledge.deleteInvalidAssociation")}):a.jsx("button",{type:"button",onClick:()=>void $t(Re),children:l("common.retry")})]}):N.length===0?a.jsxs("div",{className:"knowledge-library__state",children:[a.jsx(VTt,{}),a.jsx("p",{children:l("knowledge.noData")}),Re.canManage&&a.jsx("button",{type:"button",onClick:()=>ce(Re),children:l("knowledge.addFirstData")})]}):a.jsx(vH,{rows:Dt,rowKey:qe=>qe.id,rowLabel:qe=>qe.name||qe.id,columns:[{key:"name",header:l("common.name"),className:"is-primary-column",render:qe=>a.jsx("span",{title:qe.name||qe.id,children:qe.name||qe.id})},{key:"format",header:l("knowledge.format"),className:"is-compact-column",render:qe=>l9(qe)},{key:"size",header:l("knowledge.size"),className:"is-compact-column",render:qe=>oq(qe.sizeBytes)}],searchValue:S,onSearchChange:O,searchPlaceholder:l("knowledge.searchData"),searchLabel:l("knowledge.searchLibraryData"),primaryAction:Re.canManage?{label:l(St?"knowledge.associationInvalid":"knowledge.addData"),disabled:St,title:St?l("knowledge.providerMissing"):void 0,onClick:()=>ce(Re)}:void 0,rowActions:qe=>[{label:l("common.preview"),onSelect:()=>Y(qe)},...Re.canManage?[{label:l("common.edit"),onSelect:()=>de(qe)},{label:l("common.delete"),onSelect:()=>ge(qe),danger:!0}]:[]],scrollRef:ye,onScroll:kt,busy:I,emptyLabel:l("knowledge.noMatchingData"),footer:I?a.jsxs("div",{className:"knowledge-document-pagination",role:"status","aria-live":"polite",children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:l("knowledge.loadingMoreData")})]}):F?a.jsxs("div",{className:"knowledge-document-pagination is-error",role:"alert",children:[a.jsx("span",{children:F}),a.jsx("button",{type:"button",onClick:()=>void $t(Re,!0),children:l("knowledge.retryLoading")})]}):U?a.jsx("div",{ref:oe,className:"knowledge-document-pagination",role:"status","aria-live":"polite",children:l("skillCenter.scrollForMore")}):null})})})}],activeSectionKey:y,navigationLabel:l("knowledge.details"),onSectionChange:w,actions:Re.canManage?a.jsxs(a.Fragment,{children:[a.jsx(Tt,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>Oe(Re),children:l("common.delete")}),a.jsx(Tt,{type:"button",color:"primary",size:"lg",pill:!1,onClick:()=>W(!0),children:l("common.edit")})]}):void 0}):a.jsxs(a.Fragment,{children:[a.jsxs(ib,{className:"knowledge-library__toolbar library-resource-toolbar",children:[s,a.jsxs("div",{className:"resource-toolbar__actions",children:[o,a.jsx(em,{value:x,onChange:qe=>k(qe.target.value),placeholder:l("knowledge.searchBases"),"aria-label":l("knowledge.searchBases")})]})]}),a.jsxs(tm,{ref:Ve,"aria-live":"polite",onScroll:yt,children:[m.length>0&&!A&&a.jsxs("div",{className:"knowledge-region-warning",role:"status",children:[a.jsx("span",{children:l("knowledge.someBasesFailed")}),a.jsx("button",{type:"button",onClick:()=>void Et(),children:l("common.retry")})]}),A&&u.length===0?a.jsx(fl,{}):R?a.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[a.jsx("p",{children:R}),a.jsx("button",{type:"button",onClick:()=>void Et(),children:l("common.retry")})]}):Nt.length===0&&x.trim()?a.jsxs("div",{className:"knowledge-library__state",children:[a.jsx(zTt,{}),a.jsx("p",{children:l("knowledge.noMatchingBases")})]}):a.jsxs(zv,{children:[x.trim()?null:a.jsx(ab,{"aria-label":l("knowledge.createBase"),icon:a.jsx(qTt,{}),onClick:()=>J(!0),children:l("knowledge.createBase")}),Nt.map(qe=>a.jsx(Hv,{className:"knowledge-card",title:qe.name,description:qe.description||l("common.noDescription"),metadata:[{label:l("knowledge.creator"),value:P4(qe.ownerLabel),title:P4(qe.ownerLabel)},{label:l("knowledge.project"),value:qe.projectName||"default",title:qe.projectName||"default"}],action:{label:H===Ae(qe)?l("knowledge.associationInvalid"):l("knowledge.addData"),icon:"plus",disabled:!qe.canManage||H===Ae(qe),title:qe.canManage?H===Ae(qe)?l("knowledge.providerMissing"):void 0:l("knowledge.noManagePermission"),onClick:()=>ce(qe)},detailAction:{label:l("common.viewDetails"),onClick:()=>v(Ae(qe))}},Ae(qe)))]}),He||j?a.jsx("div",{ref:Ge,className:"my-agent-load-more",role:"status","aria-live":"polite",children:j?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:l("knowledge.loadingMoreBases")})]}):He?a.jsx("span",{children:l("skillCenter.scrollForMore")}):null}):null]})]}),z&&a.jsx(ZTt,{region:t,onClose:()=>J(!1),onCreated:qe=>{d(vt=>[qe,...vt]),v(Ae(qe)),J(!1)}}),Re&&ne&&a.jsx(JTt,{item:Re,onClose:()=>W(!1),onUpdated:qe=>{_t(qe),W(!1)}}),Re&&V&&a.jsx(d2t,{base:Re,item:V,onClose:()=>Y(null)}),X&&a.jsx(e2t,{base:X,onClose:()=>ce(null),onAssociationInvalid:qe=>{q(Ae(X)),Re&&Ae(Re)===Ae(X)&&L(Sl(qe,l("knowledge.associationInvalid"))),ce(null)},onCreated:()=>{Re&&Ae(Re)===Ae(X)&&$t(Re),ce(null)}}),Re&&K&&a.jsx(t2t,{base:Re,item:K,onClose:()=>de(null),onUpdated:qe=>{const vt=Ke.current.map(We=>We.id===qe.id?qe:We);Ke.current=vt,P(vt),de(null)}}),ee&&a.jsx(_d,{title:l("knowledge.deleteBaseTitle"),description:l("knowledge.deleteBaseDescription",{name:ee.name}),confirmLabel:l(Se?"common.deleting":"common.delete"),variant:"danger",busy:Se,onCancel:()=>Oe(null),onConfirm:()=>void fn()}),he&&a.jsx(_d,{title:l("knowledge.deleteDocumentTitle"),description:l("knowledge.deleteDocumentDescription",{name:he.name||he.id}),confirmLabel:l(Se?"common.deleting":"common.delete"),variant:"danger",busy:Se,onCancel:()=>ge(null),onConfirm:()=>void tn()})]})}const h2t="_EmptyMessage_1r5gu_1",p2t="_IconBadge_1r5gu_16",m2t="_Title_1r5gu_54",g2t="_Description_1r5gu_69",b2t="_ActionRow_1r5gu_77",OT={EmptyMessage:h2t,IconBadge:p2t,Title:m2t,Description:g2t,ActionRow:b2t},qn=({children:e,className:t,fill:n="static"})=>a.jsx("div",{className:qi(OT.EmptyMessage,t),"data-fill":n,children:e}),y2t=({size:e="md",color:t="secondary",children:n,className:i})=>a.jsx("div",{className:qi(OT.IconBadge,i),"data-size":e,"data-color":t,children:n}),v2t=({children:e,className:t,color:n="secondary"})=>a.jsx("div",{className:qi(OT.Title,t),"data-color":n,children:e}),x2t=({children:e,className:t})=>a.jsx("div",{className:qi(OT.Description,t),children:e}),w2t=({children:e,className:t})=>a.jsx("div",{className:qi(OT.ActionRow,t),children:e});qn.Icon=y2t;qn.Title=v2t;qn.Description=x2t;qn.ActionRow=w2t;bn.hasResourceBundle("en-US","skills")||bn.addResourceBundle("en-US","skills",Kme,!0,!0);bn.hasResourceBundle("zh-CN","skills")||bn.addResourceBundle("zh-CN","skills",e1e,!0,!0);function en(e,t={}){return bn.t(e,{...t,ns:"skills"})}const k2t="/web/skill-workbench";class c9 extends Error{constructor(t,n,i="SKILL_WORKBENCH_ERROR",r=!1,s="",o,l=""){super(t),this.status=n,this.code=i,this.retryable=r,this.statusText=s,this.originalError=o,this.rawResponse=l,this.name="SkillWorkbenchApiError"}}function Ed(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(en("api.invalidFormat",{label:t}));return e}function Rne(e,t){if(e!=null){if(typeof e!="string"||!e.trim()||e.trim().length>256)throw new Error(en("api.invalidFormat",{label:t}));return e.trim()}}function O2t(e){if(e!=null){if(e==="pending"||e==="ready"||e==="failed"||e==="unknown")return e;throw new Error(en("api.invalidFormat",{label:en("api.recoveryStatus")}))}}async function Ah(e,t={},n=eo){return fetch(Na(`${k2t}${e}`),{...t,headers:oc(t.headers),signal:po(t.signal,n)})}async function lq(e,t){var i;const n=await e.text().catch(()=>"");try{const r=Ed(JSON.parse(n),en("api.errorResponse")),s=r.detail&&typeof r.detail=="object"?Ed(r.detail,en("api.errorDetails")):r;return new c9(typeof s.message=="string"?s.message:t,e.status,typeof s.code=="string"?s.code:"SKILL_WORKBENCH_ERROR",s.retryable===!0,e.statusText,s.originalError&&typeof s.originalError=="object"?s.originalError:void 0,n)}catch{const r=((i=e.headers.get("content-type"))==null?void 0:i.split(";",1)[0])||en("api.missingContentType");return new c9(en("api.gatewayError",{fallback:t,status:e.status,contentType:r}),e.status,"SKILL_WORKBENCH_ERROR",!1,e.statusText,void 0,n)}}async function lb(e,t){if(!e.ok)throw await lq(e,t);const n=e.headers.get("content-type")??"";if(!n.includes("application/json")){const i=n.split(";",1)[0]||en("api.missingContentType");throw new Error(en("api.nonJson",{fallback:t,status:e.status,contentType:i}))}return e.json()}function S2t(e){return Array.isArray(e)?e.map(t=>{const n=Ed(t,en("api.activity")),i=n.kind,r=n.status;if(typeof n.id!="string"||!["status","thinking","message","tool"].includes(String(i))||!["running","done"].includes(String(r)))throw new Error(en("api.invalidActivity"));if(i==="tool"){if(typeof n.name!="string")throw new Error(en("api.invalidToolActivity"));return{id:n.id,kind:i,status:r,name:n.name,...n.input!==void 0?{args:n.input}:{},...n.output!==void 0?{response:n.output}:{}}}if(typeof n.text!="string")throw new Error(en("api.invalidTextActivity"));return{id:n.id,kind:i,status:r,text:n.text}}):[]}function E2t(e){if(e==null)return;const t=Ed(e,en("api.publication"));if(typeof t.revision!="number"||typeof t.skillId!="string"||typeof t.version!="string"||!Array.isArray(t.skillSpaceIds)||!t.skillSpaceIds.every(n=>typeof n=="string")||t.disposition!=="create-new"&&t.disposition!=="update-source"||!ED(t.region)||typeof t.projectName!="string")throw new Error(en("api.invalidFormat",{label:en("api.publication")}));return{revision:t.revision,skillId:t.skillId,version:t.version,skillSpaceIds:t.skillSpaceIds,disposition:t.disposition,region:t.region,projectName:t.projectName}}function NC(e){const t=Ed(e,en("api.task"));if(typeof t.jobId!="string"||t.operation!=="create"&&t.operation!=="optimize"||typeof t.intent!="string"||typeof t.revision!="number"||typeof t.state!="string")throw new Error(en("api.invalidFormat",{label:en("api.task")}));const n=Array.isArray(t.files)?t.files.flatMap(l=>{const c=Ed(l,en("api.file"));return typeof c.path=="string"&&typeof c.size=="number"?[{path:c.path,size:c.size}]:[]}):[];if(!["running","ready","failed","cancelled","expired","published"].includes(t.state))throw new Error(en("api.unknownTaskState"));const r=Rne(t.toolId,"Tool ID"),s=Rne(t.sessionId,"Session ID"),o=O2t(t.recoveryStatus);return{jobId:t.jobId,operation:t.operation,intent:t.intent,...typeof t.model=="string"?{model:t.model}:{},...typeof t.style=="string"?{style:t.style}:{},...typeof t.requestedName=="string"?{requestedName:t.requestedName}:{},revision:t.revision,...r?{toolId:r}:{},...s?{sessionId:s}:{},...typeof t.sessionTtlSeconds=="number"?{sessionTtlSeconds:t.sessionTtlSeconds}:{},...typeof t.expiresAt=="string"?{expiresAt:t.expiresAt}:{},...typeof t.recoveryAvailable=="boolean"?{recoveryAvailable:t.recoveryAvailable}:{},...o?{recoveryStatus:o}:{},...typeof t.recoveredFromSnapshot=="boolean"?{recoveredFromSnapshot:t.recoveredFromSnapshot}:{},state:t.state,stage:typeof t.stage=="string"?t.stage:"generating",activities:S2t(t.activities),files:n,...t.source&&typeof t.source=="object"?{source:t.source}:{},...typeof t.name=="string"?{name:t.name}:{},...typeof t.description=="string"?{description:t.description}:{},...typeof t.skillMd=="string"?{skillMd:t.skillMd}:{},...typeof t.error=="string"?{error:t.error}:{},...t.validation&&typeof t.validation=="object"?{validation:t.validation}:{},...t.publication?{publication:E2t(t.publication)}:{}}}async function _M(e){const t=Ed(await lb(await Ah("/capabilities",{signal:e}),en("api.loadCapability")),en("api.capability"));return{enabled:t.enabled===!0,reason:typeof t.reason=="string"?t.reason:"",operations:Array.isArray(t.operations)?t.operations.filter(n=>n==="create"||n==="optimize"):[],models:Array.isArray(t.models)?t.models.flatMap(n=>{if(!n||typeof n!="object")return[];const i=n;return typeof i.id=="string"&&typeof i.label=="string"?[{id:i.id,label:i.label}]:[]}):[],styles:t.styles&&typeof t.styles=="object"&&!Array.isArray(t.styles)?Object.fromEntries(Object.entries(t.styles).filter(n=>typeof n[1]=="string")):{},...typeof t.maxUploadBytes=="number"?{maxUploadBytes:t.maxUploadBytes}:{}}}async function C2t(e){if(e.file){const n=new URLSearchParams({operation:"optimize",intent:e.intent});e.jobId&&n.set("job_id",e.jobId),e.model&&n.set("model",e.model),e.style&&n.set("style",e.style),e.name&&n.set("name",e.name);const i=await Ah(`/tasks/from-upload?${n}`,{method:"POST",body:e.file,headers:{"Content-Type":"application/zip"},signal:e.signal},yr);return NC(await lb(i,en("api.startOptimization")))}const t=await Ah("/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operation:e.operation,intent:e.intent,...e.model?{model:e.model}:{},...e.style?{style:e.style}:{},...e.name?{name:e.name}:{},...e.jobId?{jobId:e.jobId}:{},...e.source?{source:{kind:"skill-center",skillId:e.source.skillId,skillName:e.source.name,version:e.source.version,region:e.source.region,projectName:e.source.projectName,skillSpaceId:e.source.skillSpaceId,skillSpaceName:e.source.skillSpaceName}}:{}}),signal:e.signal},yr);return NC(await lb(t,en("api.startTask")))}async function A2t(e,t){return NC(await lb(await Ah(`/tasks/${encodeURIComponent(e)}`,{signal:t}),en("api.loadTask")))}async function D4(e,t,n){const i=new URLSearchParams;i.set("expected_revision",String(t));const r=Ed(await lb(await Ah(`/tasks/${encodeURIComponent(e)}/artifact?${i.toString()}`,{signal:n}),en("api.loadArtifact")),en("api.artifact"));if(r.jobId!==e||r.revision!==t||!Number.isSafeInteger(r.revision)||r.revision<1||typeof r.sha256!="string"||!/^[0-9a-f]{64}$/.test(r.sha256)||typeof r.name!="string"||typeof r.description!="string"||!Array.isArray(r.files))throw new Error(en("api.invalidFormat",{label:en("api.artifact")}));const s=r.files.map(o=>{const l=Ed(o,en("api.artifactFile"));if(typeof l.path!="string"||typeof l.size!="number"||typeof l.content!="string")throw new Error(en("api.invalidFormat",{label:en("api.artifactFile")}));return{path:l.path,size:l.size,content:l.content}});return{jobId:r.jobId,revision:r.revision,sha256:r.sha256,name:r.name,description:r.description,files:s}}async function M4(e){const t=await Ah(`/tasks/${encodeURIComponent(e.jobId)}/refinements`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({intent:e.intent,expectedRevision:e.expectedRevision})},yr);return NC(await lb(t,en("api.refine")))}async function T2t(e){const t=await Ah(`/tasks/${encodeURIComponent(e.jobId)}/stop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedRevision:e.expectedRevision})});return NC(await lb(t,en("api.stop")))}async function _2t(e){const t=await Ah(`/tasks/${encodeURIComponent(e.jobId)}/publish-stream`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/x-ndjson"},body:JSON.stringify({disposition:e.disposition,expectedRevision:e.expectedRevision,expectedArtifactSha256:e.expectedArtifactSha256,skillSpaceIds:e.skillSpaceIds??[],projectName:e.projectName,region:e.region}),signal:e.signal},0);if(!t.ok)throw await lq(t,en("api.publish"));if(!(t.headers.get("content-type")??"").includes("application/x-ndjson"))throw new Error(en("api.nonNdjson"));if(!t.body)throw new Error(en("api.missingStream"));const i=new Set(["preparing","uploading","registering","activating","publishing"]);let r=null,s="";const o=new TextDecoder,l=t.body.getReader(),c=u=>{var h;if(!u.trim())return;const d=Ed(JSON.parse(u),en("api.publishProgress"));if(d.type==="progress"){if(typeof d.phase!="string"||!i.has(d.phase)||typeof d.message!="string")throw new Error(en("api.invalidPublishProgress"));(h=e.onProgress)==null||h.call(e,{phase:d.phase,message:d.message});return}if(d.type==="error"){const m=Ed(d.error,en("api.publishError"));throw new c9(typeof m.message=="string"?m.message:en("api.publish"),500,typeof m.code=="string"?m.code:"SKILL_PUBLISH_FAILED",m.retryable===!0,"",m.originalError&&typeof m.originalError=="object"?m.originalError:void 0,JSON.stringify(d.error))}if(d.type!=="complete")throw new Error(en("api.unknownPublishEvent"));const f=Ed(d.result,en("api.publishResult"));if(typeof f.skillId!="string"||typeof f.version!="string"||!Array.isArray(f.skillSpaceIds)||!f.skillSpaceIds.every(m=>typeof m=="string")||f.disposition!=="create-new"&&f.disposition!=="update-source"||!ED(f.region)||typeof f.projectName!="string")throw new Error(en("api.invalidFormat",{label:en("api.publishResult")}));r={skillId:f.skillId,version:f.version,skillSpaceIds:f.skillSpaceIds,disposition:f.disposition,region:f.region,projectName:f.projectName}};for(;;){const{value:u,done:d}=await l.read();s+=o.decode(u,{stream:!d});const f=s.split(` +`);if(s=f.pop()??"",f.forEach(c),d)break}if(c(s),!r)throw new Error(en("api.streamEnded"));return r}async function j2t(e){await lb(await Ah(`/tasks/${encodeURIComponent(e)}`,{method:"DELETE"}),en("api.deleteTask"))}async function N2t(e,t,n){var c;const i=new URLSearchParams;i.set("expected_revision",String(t)),i.set("expected_sha256",n);const r=await Ah(`/tasks/${encodeURIComponent(e)}/download?${i.toString()}`,{},yr);if(!r.ok)throw await lq(r,en("api.download"));const o=((c=(r.headers.get("content-disposition")??"").match(/filename="([^"]+)"/))==null?void 0:c[1])??"skill.zip",l=URL.createObjectURL(await r.blob());try{const u=document.createElement("a");u.href=l,u.download=o,u.click()}finally{URL.revokeObjectURL(l)}}const lLe=p.createContext(void 0);function Xv(e){const t=p.useContext(lLe);if(t===void 0&&!e)throw new Error(Uc(47));return t}const R2t={...xje,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class I2t extends $D{constructor(n,i,r){const s=new uV;super(P2t(n,s,i,r),D2t(s),R2t);Zt(this,"setOpen",(n,i)=>{var f,h;const r=i.reason===vu,s=i.reason===e1&&i.event.detail===0,o=!n&&(i.reason===I_e||i.reason==null),l=cst(i),c=this.select("activeTriggerId");if(!n&&i.reason===R_e&&i.trigger==null&&c!=null&&(i.trigger=this.context.triggerElements.getById(c)??this.select("activeTriggerElement")??void 0),(h=(f=this.context).onOpenChange)==null||h.call(f,n,i),i.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,i);const u=()=>{const m={open:n,openChangeReason:i.reason};dje(m,n,i.trigger,l()),this.update(m)};r?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(Lit,()=>{this.set("stickIfOpen",!1)}),vi.flushSync(u)):u();let d;s?d="click":o?d="dismiss":i.reason===fC&&(d="focus"),this.set("instantType",d)})}}function P2t(e,t,n,i=!1){const r={...bje(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return r.open&&(e==null?void 0:e.mounted)===void 0&&(r.mounted=!0),r.floatingRootContext=yje(t,n,i),r}function D2t(e){return{popupRef:p.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:p.createRef(),beforeContentFocusGuardRef:p.createRef(),stickIfOpenTimeout:new Qu,triggerElements:e}}function Ine({props:e}){const{children:t,open:n,defaultOpen:i=!1,onOpenChange:r,onOpenChangeComplete:s,modal:o=!1,handle:l,triggerId:c,defaultTriggerId:u=null}=e,d=L2t(l,{modal:o,open:i,openProp:n,activeTriggerId:u,triggerIdProp:c});d.useControlledProp("openProp",n),d.useControlledProp("triggerIdProp",c);const f=d.useState("open"),h=d.useState("mounted"),m=d.useState("payload");d.useContextCallback("onOpenChange",r),d.useContextCallback("onOpenChangeComplete",s),gje(d,f),hje(d);const{forceUnmount:g}=pje(f,d,()=>{d.update({stickIfOpen:!0,openChangeReason:null})});d.useSyncedValues({modal:o}),p.useEffect(()=>{f||d.context.stickIfOpenTimeout.clear()},[d,f]),p.useImperativeHandle(e.actionsRef,()=>({unmount:g,close:()=>d.setOpen(!1,pa(P_e))}),[g,d]);const b=f||h;return a.jsxs(lLe.Provider,{value:d,children:[l&&a.jsx(uje,{handle:l,store:d}),b&&a.jsx($2t,{store:d,modal:o}),typeof t=="function"?t({payload:m}):t]})}function M2t(e){return Xv(!0)?a.jsx(Ine,{props:e}):a.jsx(grt,{children:a.jsx(Ine,{props:e})})}function L2t(e,t){const n=cje((i,r)=>new I2t(t,i,r));return p.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function $2t({store:e,modal:t}){const n=e.useState("floatingRootContext"),i=q_e(n,{outsidePressEvent:{mouse:t==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),r=i.reference,s=i.floating;return mje(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:s}),null}const F2t=300;function nm(e){return KA(e,"base-ui")}function B2t(e,t){const n=p.useRef(null);function i(s){vi.flushSync(()=>{e.setOpen(!1,pa(fC,s.nativeEvent,s.currentTarget))});const o=hit(n.current);o==null||o.focus()}function r(s){var l;const o=e.select("positionerElement");if(o&&aw(s,o))(l=e.context.beforeContentFocusGuardRef.current)==null||l.focus();else{vi.flushSync(()=>{e.setOpen(!1,pa(fC,s.nativeEvent,s.currentTarget))});let c=fit(e.context.triggerFocusTargetRef.current||t.current);for(;c!==null&&ii(o,c);){const u=c;if(c=eV(c),c===u)break}c==null||c.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:i,handleFocusTargetFocus:r}}function U2t(e){const t=p.useRef(""),n=p.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:p.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r?e(r,r.pointerType):e(r,t.current),t.current=""},[e]),onPointerDown:n}}function cLe(e,t){const n=oi((s,o)=>{(typeof e=="function"?e():e)||t(o||(zD?"touch":""))}),{onClick:i,onPointerDown:r}=U2t(n);return p.useMemo(()=>({onClick:i,onPointerDown:r}),[i,r])}const Q2t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,disabled:o=!1,nativeButton:l=!0,handle:c,payload:u,openOnHover:d=!1,delay:f=F2t,closeDelay:h=0,id:m,...g}=t,b=Xv(!0),y=wje(c)??b;if(!y)throw new Error(Uc(74));const w=nm(m),x=y.useState("isTriggerActive",w),k=y.useState("floatingRootContext"),S=y.useState("isOpenedByTrigger",w),O=y.useState("triggerPopupId",w),A=p.useRef(null),{registerTrigger:E,isMountedByThisTrigger:j}=fje(w,A,y,{payload:u,disabled:o,openOnHover:d,closeDelay:h}),T=y.useState("openChangeReason"),R=y.useState("stickIfOpen"),C=y.useState("openMethod"),N=y.useState("focusManagerModal"),P=gst(k,{enabled:!o&&d&&(C!=="touch"||T!==e1),mouseOnly:!0,move:!1,handleClose:vst(),restMs:f,delay:{close:h},triggerElementRef:A,isActiveTrigger:x,isClosing:()=>y.select("transitionStatus")==="ending"}),I=H_e(k,{stickIfOpen:R}),D=cLe(()=>y.select("open"),ne=>{y.set("openMethod",ne)}),_=y.useState("triggerProps",j),{getButtonProps:L,buttonRef:F}=WD({disabled:o,native:l}),M={open(ne){return ne&&T===e1?Ist.open(ne):Eje.open(ne)}},{preFocusGuardRef:H,handlePreFocusGuardFocus:q,handleFocusTargetFocus:U}=B2t(y,A),z=Da("button",t,{state:{disabled:o,open:S},ref:[F,n,E,A],props:[I.reference,P,_,D,{[aV]:"",id:w,"aria-haspopup":"dialog","aria-expanded":S,"aria-controls":O},g,L],stateAttributesMapping:M}),J=a.jsx(p.Fragment,{children:z},w);return j&&!N?a.jsxs(p.Fragment,{children:[a.jsx(lv,{ref:H,onFocus:q}),J,a.jsx(lv,{ref:y.context.triggerFocusTargetRef,onFocus:U})]}):J}),uLe=p.createContext(void 0);function z2t(){const e=p.useContext(uLe);if(e===void 0)throw new Error(Uc(45));return e}const V2t=p.forwardRef(function(t,n){const{keepMounted:i=!1,...r}=t;return Xv().useState("mounted")||i?a.jsx(uLe.Provider,{value:i,children:a.jsx($_e,{ref:n,...r})}):null}),dLe=p.createContext(void 0);function H2t(){const e=p.useContext(dLe);if(!e)throw new Error(Uc(46));return e}const fLe=p.forwardRef(function(t,n){const{cutout:i,...r}=t;let s;if(i){const o=i.getBoundingClientRect();s=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${o.left}px ${o.top}px,${o.left}px ${o.bottom}px,${o.right}px ${o.bottom}px,${o.right}px ${o.top}px,${o.left}px ${o.top}px)`}return a.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...r,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});let Pne={},Dne={},Mne="";function jM(e,t){return HA(e)?e:t}function Lne(e,t,n){return/hidden|clip/.test(e.getComputedStyle(jM(t,n)).overflowY)}function q2t(e){if(typeof document>"u")return!1;const t=Cr(e);return ea(t).innerWidth-t.documentElement.clientWidth>0}function W2t(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Cr(e),i=n.documentElement,r=n.body,s=jM(i,r),o=s.style.overflowY,l=i.style.scrollbarGutter;i.style.scrollbarGutter="stable",s.style.overflowY="scroll";const c=s.offsetWidth;s.style.overflowY="hidden";const u=s.offsetWidth;return s.style.overflowY=o,i.style.scrollbarGutter=l,c===u}function K2t(e){const t=Cr(e),n=t.documentElement,i=t.body,r=jM(n,i),s={overflowY:r.style.overflowY,overflowX:r.style.overflowX};return Object.assign(r.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(r.style,s)}}function G2t(e){var m;const t=Cr(e),n=t.documentElement,i=t.body,r=ea(n);let s=0,o=0,l=!1;const c=Cc.create();if(q1&&(((m=r.visualViewport)==null?void 0:m.scale)??1)!==1)return()=>{};function u(){const g=r.getComputedStyle(n),b=r.getComputedStyle(i),w=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,o=n.scrollLeft,Pne={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Mne=n.style.scrollBehavior,Dne={position:i.style.position,height:i.style.height,width:i.style.width,boxSizing:i.style.boxSizing,overflowY:i.style.overflowY,overflowX:i.style.overflowX,scrollBehavior:i.style.scrollBehavior};const x=n.scrollHeight>n.clientHeight,k=n.scrollWidth>n.clientWidth,S=g.overflowY==="scroll"||b.overflowY==="scroll",O=g.overflowX==="scroll"||b.overflowX==="scroll",A=Math.max(0,r.innerWidth-i.clientWidth),E=Math.max(0,r.innerHeight-i.clientHeight),j=parseFloat(b.marginTop)+parseFloat(b.marginBottom),T=parseFloat(b.marginLeft)+parseFloat(b.marginRight),R=jM(n,i);if(l=W2t(e),l){n.style.scrollbarGutter=w,R.style.overflowY="hidden",R.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:w,overflowY:"hidden",overflowX:"hidden"}),(x||S)&&(n.style.overflowY="scroll"),(k||O)&&(n.style.overflowX="scroll"),Object.assign(i.style,{position:"relative",height:j||E?`calc(100dvh - ${j+E}px)`:"100dvh",width:T||A?`calc(100vw - ${T+A}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),i.scrollTop=s,i.scrollLeft=o,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function d(){Object.assign(n.style,Pne),Object.assign(i.style,Dne),l||(n.scrollTop=s,n.scrollLeft=o,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Mne)}function f(){d(),c.request(u)}u();const h=Di(r,"resize",f);return()=>{c.cancel(),d(),typeof r.removeEventListener=="function"&&h()}}class X2t{constructor(){Zt(this,"lockCount",0);Zt(this,"restore",null);Zt(this,"timeoutLock",Qu.create());Zt(this,"timeoutUnlock",Qu.create());Zt(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});Zt(this,"unlock",()=>{var t;this.lockCount===0&&this.restore&&((t=this.restore)==null||t.call(this),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const n=Cr(t),i=n.documentElement,r=n.body,s=ea(i);if(Lne(s,i,r)){const l=new s.MutationObserver(()=>{Lne(s,i,r)||(l.disconnect(),this.restore=null,this.lock(t))}),c={attributes:!0};l.observe(i,c),l.observe(r,c),this.restore=()=>l.disconnect();return}const o=zD||!q2t(t);this.restore=o?K2t(t):G2t(t)}}const Y2t=new X2t;function hLe(e=!0,t=null){ti(()=>{if(e)return Y2t.acquire(t)},[e,t])}const Z2t=20;function J2t(e,t,n,i){const[r,s]=p.useState(!1);ti(()=>{if(!e||!t||n==null){s(!1);return}const o=Cr(n).documentElement.clientWidth,l=n.offsetWidth;s(o>0&&l>0&&l>=o-Z2t)},[e,t,n]),hLe(e&&(!t||r),i)}const e_t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,anchor:o,positionMethod:l,side:c,align:u,sideOffset:d,alignOffset:f,collisionBoundary:h="clipping-ancestors",collisionPadding:m,arrowPadding:g,sticky:b,disableAnchorTracking:v=!1,collisionAvoidance:y=zit,...w}=t,x=Xv(),k=z2t(),S=prt(),O=x.useState("floatingRootContext"),A=x.useState("mounted"),E=x.useState("open"),j=x.useState("openChangeReason"),T=x.useState("activeTriggerElement"),R=x.useState("modal"),C=x.useState("openMethod"),N=x.useState("positionerElement"),P=x.useState("instantType"),I=x.useState("transitionStatus"),D=x.useState("adaptiveOrigin"),_=p.useRef(null),L=sV(N),F=Cst({anchor:o,floatingRootContext:O,positionMethod:l,mounted:A,side:c,sideOffset:d,align:u,alignOffset:f,arrowPadding:g,collisionBoundary:h,collisionPadding:m,sticky:b,disableAnchorTracking:v,keepMounted:k,nodeId:S,collisionAvoidance:y,adaptiveOrigin:D}),M=O.useState("domReferenceElement");ti(()=>{const z=M,J=_.current;if(z&&(_.current=z),J&&z&&z!==J){x.set("instantType",void 0);const ne=new AbortController;return L(()=>{x.set("instantType","trigger-change")},ne.signal),()=>{ne.abort()}}},[M,L,x]);const H=R===!0&&j!==vu;J2t(E&&H,C==="touch",N,T);const q=x.useStateSetter("positionerElement"),U={open:E,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:P},Z=Pst(t,U,{styles:F.positionerStyles,transitionStatus:I,props:w,refs:[n,q],hidden:!A,inert:!E});return a.jsxs(dLe.Provider,{value:F,children:[A&&H&&a.jsx(fLe,{inert:rV(!E),cutout:T}),a.jsx(mrt,{id:S,children:Z})]})}),t_t="ArrowUp",n_t="ArrowDown",i_t="ArrowLeft",r_t="ArrowRight",s_t="Home",a_t="End",pLe=new Set([t_t,n_t,i_t,r_t,s_t,a_t]),o_t=p.createContext(void 0);function l_t(e){return p.useContext(o_t)}const c_t=p.createContext(void 0);function u_t(){const[e,t]=p.useState(0),n=oi(()=>(t(r=>r+1),()=>{t(r=>Math.max(0,r-1))}));return{context:p.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}const d_t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,initialFocus:o,finalFocus:l,...c}=t,u=Xv(),d=H2t(),f=l_t()!=null,{context:h,hasClosePart:m}=u_t(),g=u.useState("open"),b=u.useState("openMethod"),v=u.useState("instantType"),y=u.useState("transitionStatus"),w=u.useState("popupProps"),x=u.useState("titleElementId"),k=u.useState("descriptionElementId"),S=u.useState("modal"),O=u.useState("mounted"),A=u.useState("openChangeReason"),E=u.useState("activeTriggerElement"),j=u.useState("floatingRootContext"),T=j.useState("floatingId"),R=u.useState("disabled"),C=u.useState("openOnHover"),N=u.useState("closeDelay");WA({open:g,ref:u.context.popupRef,onComplete(){var F,M;g&&((M=(F=u.context).onOpenChangeComplete)==null||M.call(F,!0))}}),pst(j,{enabled:C&&!R,closeDelay:N});const P=o===void 0?lje(u.context.popupRef):o,I=S!==!1&&m;u.useSyncedValue("focusManagerModal",I);const D=u.useStateSetter("popupElement"),_={open:g,side:d.side,align:d.align,instant:v,transitionStatus:y},L=Da("div",t,{state:_,ref:[n,u.context.popupRef,D],props:[w,{id:T,role:"dialog",...oje,"aria-labelledby":x,"aria-describedby":k,onKeyDown(F){f&&pLe.has(F.key)&&F.stopPropagation()}},Aje(y),c],stateAttributesMapping:Cje});return a.jsx(V_e,{context:j,openInteractionType:b,modal:I,disabled:!O||A===vu,initialFocus:P,returnFocus:l,restoreFocus:"popup",previousFocusableElement:Zs(E)?E:void 0,nextFocusableElement:u.context.triggerFocusTargetRef,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:a.jsx(c_t.Provider,{value:h,children:L})})}),f_t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...o}=t,l=Xv(),c=nm(o.id);return l.useSyncedValueWithCleanup("titleElementId",c),Da("h2",t,{ref:n,props:[{id:c},o]})}),h_t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...o}=t,l=Xv(),c=nm(o.id);return l.useSyncedValueWithCleanup("descriptionElementId",c),Da("p",t,{ref:n,props:[{id:c},o]})});function $ne(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),a.jsx("path",{d:"M4.15 10.25h12.2M10.25 4c1.65 1.72 2.5 3.8 2.5 6.25s-.85 4.53-2.5 6.25M10.25 4c-1.65 1.72-2.5 3.8-2.5 6.25s.85 4.53 2.5 6.25M14.8 14.8 20 20"})]})}function p_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),a.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),a.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),a.jsx("path",{d:"m19.4 2.75.48 1.37 1.37.48-1.37.48-.48 1.37-.48-1.37-1.37-.48 1.37-.48.48-1.37Z",fill:"currentColor",stroke:"none"})]})}function cq(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{className:"video-generate-icon__body",d:"M3.25 9h17.5v7.35a2.4 2.4 0 0 1-2.4 2.4H5.65a2.4 2.4 0 0 1-2.4-2.4V9Z"}),a.jsxs("g",{className:"video-generate-icon__clapper",children:[a.jsx("path",{d:"M3.25 9V7.65a2.4 2.4 0 0 1 2.4-2.4h12.7a2.4 2.4 0 0 1 2.4 2.4V9H3.25Z"}),a.jsx("path",{d:"M6.75 5.25 9.3 9M12 5.25 14.55 9M17.25 5.25 19.8 9"})]}),a.jsx("path",{d:"m10.25 11.45 4 2.55-4 2.55v-5.1Z"})]})}function m_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.25 5.25h15.5v10.5H4.25zM8.25 19.75h7.5M12 15.75v4"}),a.jsx("path",{d:"m7.25 12.75 2.35-2.4 2.15 1.65 3.4-3.6 1.6 1.55"}),a.jsx("circle",{cx:"7.25",cy:"8.4",r:".7",fill:"currentColor",stroke:"none"})]})}function g_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5 7.4c0-1.55 3.13-2.8 7-2.8s7 1.25 7 2.8-3.13 2.8-7 2.8-7-1.25-7-2.8Z"}),a.jsx("path",{d:"M5 7.4v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8V7.4M5 11.95v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8v-4.55"}),a.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function b_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),a.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),a.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),a.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function y_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.25 6.25h6.25c1 0 1.5.55 1.5 1.45v11.05c0-.9-.5-1.45-1.5-1.45H4.25V6.25Z"}),a.jsx("path",{d:"M19.75 9.1v8.2H13.5c-1 0-1.5.55-1.5 1.45V7.7c0-.9.5-1.45 1.5-1.45h2.15"}),a.jsx("path",{d:"m19 3.2.58 1.62 1.62.58-1.62.58L19 7.6l-.58-1.62-1.62-.58 1.62-.58L19 3.2Z",fill:"currentColor",stroke:"none"})]})}function v_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"m4.2 8.4 1.15 10.2h13.3L19.8 8.4"}),a.jsx("path",{d:"M4.2 8.4h15.6L17.9 5H6.1L4.2 8.4Z"}),a.jsx("path",{d:"M7.2 12.2c1.1-1 2.25 1.25 3.4.25 1.05-.9 2.15 1.3 3.3.25"}),a.jsx("path",{d:"m8.2 15.1 1.45 1.35 1.45-1.35M13.55 16.45h2.35"})]})}function x_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"6",cy:"6.25",r:"2.25"}),a.jsx("circle",{cx:"18",cy:"6.25",r:"2.25"}),a.jsx("circle",{cx:"12",cy:"17.75",r:"2.25"}),a.jsx("path",{d:"m7.7 7.75 2.7 7.55M16.3 7.75l-2.7 7.55M8.25 6.25h7.5"})]})}function Fne(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"9",cy:"8",r:"3"}),a.jsx("path",{d:"M3.75 18.75c.45-3.05 2.2-4.65 5.25-4.65s4.8 1.6 5.25 4.65"}),a.jsx("path",{d:"M17.75 4.25v5.5M15 7h5.5M16 13.25h4.25M18.125 11.125v4.25"})]})}function w_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"4",y:"4.25",width:"16",height:"5",rx:"1.5"}),a.jsx("rect",{x:"4",y:"14.75",width:"16",height:"5",rx:"1.5"}),a.jsx("path",{d:"M7.25 6.75h.01M7.25 17.25h.01M10 6.75h6.5M10 17.25h6.5"})]})}function k_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3.75h8l4 4v12.5H6V3.75Z"}),a.jsx("path",{d:"M14 3.75v4h4M8.75 11h6.5M8.75 14.25h6.5M8.75 17.5h4"})]})}function Bne(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.75",y:"4.5",width:"16.5",height:"15",rx:"2.5"}),a.jsx("path",{d:"m7.5 9 2.75 2.5L7.5 14M12.5 14h4"}),a.jsx("path",{d:"M3.75 7.5h16.5",opacity:".62"})]})}function ck(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function O_t({value:e}){const{t,i18n:n}=_e("adk"),[i,r]=p.useState(!1),s=f=>f==null?t("developmentRuns.notReported"):f.toLocaleString(n.resolvedLanguage||n.language),o=K2e,l=e.usage,c=(l==null?void 0:l.inputTokens)!=null&&l.cachedInputTokens!=null&&l.cachedInputTokens<=l.inputTokens?l.inputTokens-l.cachedInputTokens:void 0,u=l!=null&&l.inputTokens&&l.cachedInputTokens!=null&&c!=null?`${(l.cachedInputTokens/l.inputTokens*100).toFixed(1)}%`:void 0,d=[["inputTokens",l==null?void 0:l.inputTokens],["cachedInputTokens",l==null?void 0:l.cachedInputTokens],["uncachedInputTokens",c],["cacheWriteInputTokens",l==null?void 0:l.cacheWriteInputTokens],["outputTokens",l==null?void 0:l.outputTokens],["reasoningOutputTokens",l==null?void 0:l.reasoningOutputTokens]];return a.jsxs("div",{className:"development-turn-summary","data-turn-id":e.turnId,children:[a.jsx("span",{children:t(`developmentRuns.turnStatus.${e.status}`)}),a.jsx("span",{children:t("developmentRuns.toolCalls",{count:e.toolCalls})}),a.jsx("span",{children:t("developmentRuns.turnDuration",{duration:o(e.durationMs)})}),a.jsx("span",{title:t("developmentRuns.toolDurationHelp"),children:t(e.toolDurationComplete?"developmentRuns.toolDuration":"developmentRuns.toolDurationPartial",{duration:o(e.toolDurationMs)})}),a.jsxs(M2t,{open:i,onOpenChange:r,children:[a.jsxs(Q2t,{className:"development-token-trigger",openOnHover:!0,delay:150,closeDelay:150,onFocus:f=>{f.currentTarget.matches(":focus-visible")&&r(!0)},children:[a.jsx("span",{children:"Tokens"}),a.jsx("span",{className:"development-token-value",children:s(l==null?void 0:l.totalTokens)}),e.usageIncomplete&&a.jsxs("span",{children:["· ",t("developmentRuns.partial")]}),a.jsx(ck,{className:"development-token-chevron"})]}),a.jsx(V2t,{children:a.jsx(e_t,{side:"top",align:"end",sideOffset:8,className:"development-token-positioner",children:a.jsxs(d_t,{className:"development-token-popup",initialFocus:!1,finalFocus:!1,children:[a.jsx(f_t,{className:"development-token-title",children:t("developmentRuns.tokenDetails")}),a.jsxs("dl",{children:[a.jsxs("div",{children:[a.jsx("dt",{children:t("developmentRuns.model")}),a.jsx("dd",{children:e.model||t("developmentRuns.notReported")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:t("developmentRuns.totalTokens")}),a.jsx("dd",{children:s(l==null?void 0:l.totalTokens)})]}),d.map(([f,h])=>a.jsxs("div",{children:[a.jsx("dt",{children:t(`developmentRuns.${f}`)}),a.jsx("dd",{children:s(h)})]},f)),a.jsxs("div",{children:[a.jsx("dt",{children:t("developmentRuns.cacheHitRate")}),a.jsx("dd",{children:u||t("developmentRuns.notReported")})]})]}),a.jsxs(h_t,{className:"development-token-note",children:[t("developmentRuns.tokenHelp"),e.usageIncomplete?` ${t("developmentRuns.partialHelp")}`:""]})]})})})]})]})}function uq(e){return a.jsx("svg",{viewBox:"0 0 111 117",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M0 5.6016C7.82288e-05 0.621244 6.02226 -1.87314 9.54395 1.64847L40.1289 32.2334L68.5732 3.7891C69.5834 2.77903 70.9533 2.21099 72.3818 2.21097H82.7031C82.7917 2.20658 82.8806 2.20414 82.9697 2.20414H104.775C109.574 2.20427 111.977 8.00691 108.584 11.4004L64.916 55.0664C64.3075 55.8528 63.9436 56.7647 63.8242 57.6993C63.7142 56.4884 63.1964 55.3069 62.2695 54.3799L45.4082 37.5186H45.4072L40.124 32.2354L17.832 54.5284C16.7671 55.5933 16.2416 56.993 16.2549 58.3887C16.2417 59.7843 16.7672 61.1842 17.832 62.2491L39.9287 84.3467L9.54395 114.733C6.0223 118.255 0.000223474 115.761 0 110.78V5.6016ZM63.8018 58.8702C63.8962 59.9086 64.2936 60.9229 64.9961 61.7735L108.591 105.368C111.984 108.762 109.58 114.564 104.781 114.564H94.4336C94.3543 114.568 94.274 114.569 94.1934 114.569H72.3877C70.9592 114.569 69.5892 114.002 68.5791 112.992L39.9336 84.3467L58.4531 65.8282L58.4453 65.8203L62.2695 61.9981C63.1476 61.12 63.6567 60.0136 63.8018 58.8702Z",fill:"currentColor"})})}function NM({kind:e,...t}){return e==="thinking"?a.jsx(uq,{...t}):a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:e==="tool"?a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"3"}),a.jsx("path",{d:"m7 9 3 3-3 3m6 0h4"})]}):e==="plan"?a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"m4 7 1.5 1.5L8 6m-4 7 1.5 1.5L8 12M11 7h9m-9 6h9m-9 6h9"}),a.jsx("circle",{cx:"6",cy:"19",r:"1"})]}):a.jsx(a.Fragment,{children:a.jsx("path",{d:"M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9zM14 3v6h6M8 13h8m-4-3v6M8 18h8"})})})}function S_t({blocks:e,active:t,status:n,render:i}){const{t:r}=_e("adk"),[s,o]=p.useState(!1),l=[...e].reverse().find(h=>"done"in h&&!h.done),c=e.filter(h=>h.kind==="tool"),u=c.filter(h=>h.durationMs!=null),d=u.reduce((h,m)=>h+(m.durationMs||0),0);let f=r("developmentRuns.processSummary",{count:e.length});return t&&(f=n||((l==null?void 0:l.kind)==="thinking"?r("developmentRuns.thinking"):(l==null?void 0:l.kind)==="tool"?G2e(l):(l==null?void 0:l.kind)==="plan"?r("developmentRuns.plan"):(l==null?void 0:l.kind)==="diff"?r("developmentRuns.diff"):r("developmentRuns.processing"))),a.jsxs("section",{className:"development-process",children:[a.jsxs("button",{type:"button",className:"development-process__toggle","aria-expanded":s,onClick:()=>o(!s),children:[a.jsx(ck,{className:`tool-chevron${s?" is-open":""}`}),a.jsx("span",{className:"tool-icon",children:a.jsx(NM,{kind:(l==null?void 0:l.kind)==="thinking"||(l==null?void 0:l.kind)==="plan"||(l==null?void 0:l.kind)==="diff"?l.kind:"tool"})}),t?a.jsx(on,{className:"development-process__title","aria-live":"polite",children:f}):a.jsx("span",{className:"development-process__title",children:f}),!t&&c.length>0&&a.jsxs("span",{className:"development-process__duration",children:[r("developmentRuns.toolCalls",{count:c.length}),u.length>0?` · ${r(u.length===c.length?"developmentRuns.toolDuration":"developmentRuns.toolDurationPartial",{duration:K2e(d)})}`:""]})]}),a.jsx("div",{className:"development-process__items",hidden:!s,children:i(e)})]})}function E_t({blocks:e,active:t,status:n="",render:i}){const{t:r}=_e("adk"),s=ant(e),o=s[s.length-1],l=[...e].reverse().find(u=>u.kind==="progress"),c=n||((l==null?void 0:l.kind)==="progress"?l.text:"");return a.jsxs(a.Fragment,{children:[s.map(u=>u.process?a.jsx(S_t,{blocks:u.blocks,active:t&&u===o,status:c,render:i},u.id):a.jsx("div",{"data-assistant-phase":u.blocks[0].phase,children:i(u.blocks)},u.id)),t&&!(o!=null&&o.process)&&a.jsxs("div",{className:"development-process__status",role:"status",children:[a.jsx("span",{className:"tool-icon",children:a.jsx(NM,{kind:"thinking"})}),a.jsx(on,{children:c||r("developmentRuns.processing")})]})]})}const C_t={formatDate(e){const t=e.value??e.date??e.timestamp;if(t==null)return"";const n=new Date(t);return isNaN(n.getTime())?String(t):n.toLocaleString()}};function A_t(e,t){if(!t||t==="/")return e;const n=t.replace(/^\//,"").split("/").map(r=>r.replace(/~1/g,"/").replace(/~0/g,"~"));let i=e;for(const r of n){if(i==null||typeof i!="object")return;i=i[r]}return i}function T_t(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function __t(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function dq(e,t){if(T_t(e))return A_t(t,e.path);if(__t(e)){const n=C_t[e.call],i={};for(const[r,s]of Object.entries(e.args??{}))i[r]=dq(s,t);return n?n(i):`[unknown fn: ${e.call}]`}return e}function j_t(e,t){const n=dq(e,t);return n==null?"":typeof n=="string"?n:String(n)}const mLe=new Map;function Yv(e,t){mLe.set(e,t)}function N_t(e){return mLe.get(e)}function R_t(e,t,n){const i=t.replace(/^\//,"").split("/").map(s=>s.replace(/~1/g,"/").replace(/~0/g,"~"));let r=e;for(let s=0;sdq(i,e.dataModel),resolveString:i=>j_t(i,e.dataModel),dispatchAction:t,render:i=>{if(!i)return null;const r=e.components[i];if(!r)return null;const s=N_t(r.component)??I_t;return a.jsx(s,{node:r,ctx:n},i)}};return a.jsx("div",{className:"a2ui-surface","data-a2ui-surface":e.surfaceId,children:n.render(e.rootId)})}function bLe(e){const t=p.useRef(null),n=p.useRef(!0),i=28,r=p.useCallback(()=>{const s=t.current;s&&(n.current=s.scrollHeight-s.scrollTop-s.clientHeight{const s=t.current;s&&n.current&&(s.scrollTop=s.scrollHeight)},[e]),{ref:t,onScroll:r}}function RM({value:e,skillPrefix:t="/",onRemoveSkill:n,onRemoveAgent:i}){const{t:r}=_e("conversation");return e.skills.length===0&&!e.targetAgent?null:a.jsxs("div",{className:"invocation-chips","aria-label":r("invocation.ariaLabel"),children:[e.skills.map(s=>a.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:s.description,children:[a.jsx(gC,{"aria-hidden":!0}),a.jsxs("span",{children:[t,s.name]}),n?a.jsx("button",{type:"button",onClick:()=>n(s.name),"aria-label":r("invocation.removeSkill",{name:s.name}),children:a.jsx(Bo,{})}):null]},s.name)),e.targetAgent?a.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[a.jsx(Uje,{"aria-hidden":!0}),a.jsx("span",{children:e.targetAgent.name}),i?a.jsx("button",{type:"button",onClick:i,"aria-label":r("invocation.removeAgent",{name:e.targetAgent.name}),children:a.jsx(Bo,{})}):null]}):null]})}function fq(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function yLe(e){var n,i,r,s;const t=fq(e.mimeType);return t==="pdf"?"PDF":t==="markdown"?"MD":t==="video"?((i=(n=e.mimeType)==null?void 0:n.split("/")[1])==null?void 0:i.toUpperCase())??"VIDEO":t==="image"?((s=(r=e.mimeType)==null?void 0:r.split("/")[1])==null?void 0:s.toUpperCase())??"IMAGE":"TXT"}function vLe(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function xLe(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?yTe(t,e.uri):""}function D_t({kind:e}){return e==="image"?a.jsx(yV,{}):e==="video"?a.jsx(zje,{}):e==="pdf"?a.jsx($at,{}):a.jsx(gV,{})}function IM({appName:e,items:t,compact:n=!1,onRemove:i}){const{t:r}=_e("conversation"),[s,o]=p.useState(null);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(l=>{const c=fq(l.mimeType),u=xLe(l,e),d=l.status==="uploading"||l.status==="error"||!u,f=a.jsxs("button",{type:"button",className:"media-card-main",disabled:d,onClick:c==="image"?void 0:()=>o(l),"aria-label":r("media.preview",{name:l.name??r("media.attachment")}),children:[c==="image"&&u?a.jsx("img",{className:"media-card-image",src:u,alt:l.name??r("media.image"),loading:"lazy"}):c==="video"&&u?a.jsxs("div",{className:"media-card-video-container",children:[a.jsx("video",{className:"media-card-video",src:u,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),a.jsx("span",{className:"media-card-video-play",children:a.jsx(qje,{})})]}):a.jsx("span",{className:"media-card-icon",children:a.jsx(D_t,{kind:c})}),a.jsxs("span",{className:"media-card-copy",children:[a.jsx("span",{className:"media-card-name",children:l.name??r("media.attachment")}),a.jsxs("span",{className:"media-card-meta",children:[a.jsx("span",{className:"media-card-type",children:yLe(l)}),l.status==="uploading"?a.jsxs(a.Fragment,{children:[a.jsx(Vi,{className:"media-card-spinner"})," ",r("media.uploading")]}):l.status==="error"?l.error??r("media.uploadFailed"):vLe(l.sizeBytes)]})]}),!n&&l.status!=="uploading"&&l.status!=="error"?a.jsx(aE,{className:"media-card-open"}):null]});return a.jsxs(_r.div,{className:`media-card media-card--${c}${l.status==="error"?" media-card--error":""}`,layout:!0,initial:{opacity:0,scale:.985,y:4},animate:{opacity:1,scale:1,y:0},children:[c==="image"&&!d?a.jsx(UAe,{src:u,children:f}):f,i?a.jsx("button",{type:"button",className:"media-card-remove","aria-label":r("media.remove",{name:l.name??r("media.attachment")}),onClick:()=>i(l.id),children:a.jsx(Bo,{})}):null]},l.id)})}),a.jsx(uf,{children:s?a.jsx(M_t,{appName:e,item:s,onClose:()=>o(null)}):null})]})}function M_t({appName:e,item:t,onClose:n}){const{t:i}=_e("conversation"),r=p.useMemo(()=>xLe(t,e),[e,t]),s=fq(t.mimeType),[o,l]=p.useState(""),[c,u]=p.useState(s==="text"||s==="markdown"),[d,f]=p.useState("");return p.useEffect(()=>{const h=m=>{m.key==="Escape"&&n()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[n]),p.useEffect(()=>{if(s!=="text"&&s!=="markdown")return;const h=new AbortController;return u(!0),f(""),fetch(r,{signal:h.signal}).then(m=>{if(!m.ok)throw new Error(`HTTP ${m.status}`);return m.text()}).then(l).catch(m=>{h.signal.aborted||f(m instanceof Error?m.message:String(m))}).finally(()=>{h.signal.aborted||u(!1)}),()=>h.abort()},[s,r]),a.jsx(_r.div,{className:"media-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":i("media.previewDialog",{name:t.name??i("media.attachment")}),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onMouseDown:h=>{h.target===h.currentTarget&&n()},children:a.jsxs(_r.div,{className:"media-viewer",initial:{opacity:0,y:18,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.99},transition:{type:"spring",stiffness:420,damping:30},children:[a.jsxs("header",{className:"media-viewer-header",children:[a.jsxs("div",{children:[a.jsx("strong",{children:t.name??i("media.attachment")}),a.jsxs("span",{children:[yLe(t),t.sizeBytes?` · ${vLe(t.sizeBytes)}`:""]})]}),a.jsxs("nav",{children:[a.jsx("a",{href:r,download:t.name,"aria-label":i("media.download"),children:a.jsx(JD,{})}),a.jsx("button",{type:"button",onClick:n,"aria-label":i("media.close"),children:a.jsx(Bo,{})})]})]}),a.jsxs("div",{className:`media-viewer-body media-viewer-body--${s}`,children:[s==="image"?a.jsx("img",{src:r,alt:t.name??i("media.image")}):null,s==="video"?a.jsx("div",{className:"media-viewer-video-wrapper",children:a.jsx("video",{src:r,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,s==="pdf"?a.jsx("iframe",{src:r,title:t.name??"PDF"}):null,c?a.jsxs("div",{className:"media-viewer-loading",children:[a.jsx(Vi,{})," ",i("media.reading")]}):null,!c&&d?a.jsx("div",{className:"media-viewer-loading",children:i("media.loadFailed",{error:d})}):null,!c&&s==="markdown"?a.jsx("div",{className:"media-document",children:a.jsx(Nd,{text:o})}):null,!c&&s==="text"?a.jsx("pre",{className:"media-document media-document--plain",children:o}):null]})]})})}function L_t({definition:e,label:t,done:n,open:i,onToggle:r}){const{t:s}=_e("conversation"),o=e.icon,l=n?e.doneLabel:e.runningLabel,c=t??s(`blocks.tools.${e.name}.${n?"done":"running"}`,{defaultValue:l});return a.jsxs("button",{type:"button",className:`builtin-tool-head${n?" is-done":" is-running"}`,"data-tool-tone":e.tone,onClick:r,"aria-expanded":i,children:[a.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:a.jsx(o,{})}),n?a.jsx("span",{className:"builtin-tool-label",children:c}):a.jsx(on,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:c}),a.jsx(ck,{className:`builtin-tool-chevron${i?" is-open":""}`})]})}function Mu(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Hn(e){return typeof e=="string"?e:""}function Une(e){return typeof e=="number"&&Number.isFinite(e)?e:0}function fd(e){return Array.isArray(e)?e:[]}function u9(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return{}}const n=Mu(t)??{};return Mu(n.result)??n}function PM(e){if(typeof e=="string")try{return PM(JSON.parse(e))}catch{return e}const t=Mu(e);if(!t)return"";const n=Mu(t.result);return Hn(t.error)||Hn(t.message)||Hn(n==null?void 0:n.error)||Hn(n==null?void 0:n.message)}function $_t(e){if(e.kind==="tool")return"tool";if(e.kind==="knowledge_base")return"knowledge_base";const t=Mu(e.metadata),n=Hn(t==null?void 0:t.source_type).toLowerCase(),i=Hn(e.source).toLowerCase();return n==="skillhub"||i.startsWith("skill_hub:")?"skill_hub":"skill_space"}const wLe={tool:"Tools",knowledge:"AgentKit Knowledge Base",skillCenter:"AgentKit Skill Center",unknownSource:"Unknown source",unnamedResource:"Unnamed resource",unnamedAgent:"Unnamed agent"};function F_t(e,t){return e==="veadk_builtin_tools"?t.tool:e==="agentkit_knowledge"?t.knowledge:e.startsWith("skill_hub:")?`Skill Hub ${e.slice(10)}`:e.startsWith("skill_space:")?`${t.skillCenter} ${e.slice(12)}`:e||t.unknownSource}function B_t(e){return e==="veadk_builtin_tools"?"tool":e==="agentkit_knowledge"?"knowledge_base":e.startsWith("skill_hub:")?"skill_hub":"skill_space"}function U_t(e,t=wLe){const n=u9(e),i=Mu(n.capabilities)??{},r=fd(n.resources).flatMap(o=>{const l=Mu(o);if(!l)return[];const c=l.kind==="tool"?"tool":l.kind==="knowledge_base"?"knowledge_base":"skill";return[{ref:Hn(l.ref),kind:c,category:$_t(l),name:Hn(l.name)||Hn(l.ref)||t.unnamedResource,description:Hn(l.description),source:Hn(l.source),version:Hn(l.version)}]}),s=fd(n.sources).flatMap(o=>{const l=Mu(o);if(!l)return[];const c=Hn(l.source),u=Hn(l.status),d=u==="error"?"error":u==="skipped"?"skipped":"ok";return[{source:c,category:B_t(c),label:F_t(c,t),status:d,count:Une(l.count),message:Hn(l.message),searchKeywords:fd(l.search_keywords).map(Hn).filter(Boolean)}]});return{collectionId:Hn(n.collection_id),capabilities:{googleAdkVersion:Hn(i.google_adk_version),agentTypes:fd(i.agent_types).map(Hn).filter(Boolean),maxOrchestrationDepth:Une(i.max_orchestration_depth)},resources:r,sources:s,counts:{all:r.length,skill_hub:r.filter(o=>o.category==="skill_hub").length,skill_space:r.filter(o=>o.category==="skill_space").length,knowledge_base:r.filter(o=>o.category==="knowledge_base").length,tool:r.filter(o=>o.category==="tool").length}}}function Q_t(e,t){return{resources:e.resources.filter(n=>n.category===t),sources:e.sources.filter(n=>n.category===t)}}function kLe(e,t,n=wLe){const i=u9(e),r=u9(t),s=new Map(fd(r.results).flatMap(d=>{const f=Mu(d),h=Hn(f==null?void 0:f.name);return f&&h?[[h,f]]:[]})),o=fd(i.agents).flatMap(d=>{const f=Mu(d),h=Hn(f==null?void 0:f.name);return f&&h?[f]:[]}),l=new Set(o.map(d=>Hn(d.name))),c=[...s.entries()].filter(([d])=>!l.has(d)).map(([d])=>({name:d})),u=[...o,...c].map(d=>{const f=Hn(d.name),h=fd(d.nodes).flatMap(A=>{const E=Mu(A);return E?[E]:[]}),m=Hn(d.root_node),g=h.find(A=>Hn(A.id)===m),b=h.filter(A=>Hn(A.id)!==m).map(A=>({id:Hn(A.id)||n.unnamedAgent,type:Hn(A.type)||"llm",description:Hn(A.description)})),v=s.get(f),y=Hn(v==null?void 0:v.status),w=y==="failed"?"failed":y==="completed"?"completed":"running",x=Qne(v==null?void 0:v.resources),k=x.length>0?x:Qne(h.flatMap(A=>fd(A.resources))),S=zne(v==null?void 0:v.python_tools),O=S.length>0?S:zne(h.flatMap(A=>fd(A.python_tools)));return{name:f,description:Hn(v==null?void 0:v.description)||Hn(g==null?void 0:g.description)||Hn(d.task),task:Hn(d.task),rootType:Hn(v==null?void 0:v.root_type)||Hn(g==null?void 0:g.type)||"llm",nodeCount:h.length,subAgentCount:b.length,resourceCount:k.length,pythonToolCount:O.length,skills:k.filter(A=>A.kind==="skill"),knowledgeBases:k.filter(A=>A.kind==="knowledge_base"),builtinTools:k.filter(A=>A.kind==="tool"),pythonTools:O,subAgents:b,status:w,output:Hn(v==null?void 0:v.output),error:Hn(v==null?void 0:v.error)}});return{collectionId:Hn(r.collection_id)||Hn(i.collection_id),agents:u,completedCount:u.filter(d=>d.status==="completed").length,failedCount:u.filter(d=>d.status==="failed").length,runningCount:u.filter(d=>d.status==="running").length}}function z_t(e,t){return!!PM(t)||kLe(e,t).failedCount>0}function Qne(e){const t=new Set;return fd(e).flatMap(n=>{const i=Mu(n),r=Hn(i?i.ref:n);if(!r||t.has(r))return[];t.add(r);const s=Hn(i==null?void 0:i.kind),o=s==="tool"||r.startsWith("veadk_tool:")?"tool":s==="knowledge_base"||r.startsWith("agentkit_kb:")?"knowledge_base":"skill",l=r.split(":");return[{ref:r,kind:o,name:Hn(i==null?void 0:i.name)||l[l.length-1]||r,description:Hn(i==null?void 0:i.description),version:Hn(i==null?void 0:i.version),source:Hn(i==null?void 0:i.source)}]})}function zne(e){const t=new Set;return fd(e).flatMap(n=>{const i=Mu(n),r=Hn(i==null?void 0:i.name),s=Hn(i==null?void 0:i.code),o=`${r}\0${s}`;return!i||!r||t.has(o)?[]:(t.add(o),[{name:r,description:Hn(i.description),code:s,entrypoint:Hn(i.entrypoint)||r,dependencies:fd(i.dependencies).map(Hn).filter(Boolean)}])})}function V_t({branch:e}){return a.jsxs("div",{className:`branch-compare__body${e.status==="running"?" is-streaming":""}`,"aria-live":"polite",children:[e.content?a.jsx(Nd,{text:e.content,streaming:e.status==="running"}):null,e.status==="running"?a.jsx("span",{className:"branch-compare__caret","aria-hidden":"true"}):null,e.error?a.jsx("p",{className:"branch-compare__error",children:e.error}):null]})}function H_t({args:e,response:t,status:n,onBranchSelect:i}){const{t:r}=_e("conversation"),s=p.useMemo(()=>Gje(e,t,n),[e,t,n]),[o,l]=p.useState(0);return a.jsxs("section",{className:"branch-compare","aria-label":r("blocks.branchCompare.ariaLabel"),children:[a.jsx("div",{className:"branch-compare__tabs",role:"tablist","aria-label":r("blocks.branchCompare.selectDirection"),children:s.branches.map((c,u)=>a.jsx("button",{className:`branch-compare__tab${o===u?" is-active":""}`,type:"button",role:"tab","aria-selected":o===u,"aria-controls":`branch-compare-panel-${u}`,onClick:()=>l(u),children:a.jsx(Za,{color:"info",size:"sm",variant:"soft",children:c.label})},`${c.label}:${u}`))}),a.jsx("div",{className:"branch-compare__branches",children:s.branches.map((c,u)=>a.jsxs("article",{className:`branch-compare__branch${o===u?" is-active":""}`,id:`branch-compare-panel-${u}`,role:"tabpanel",children:[a.jsx("header",{className:"branch-compare__head",children:a.jsx(Za,{color:"info",size:"sm",variant:"soft",children:c.label})}),a.jsx(V_t,{branch:c}),a.jsx("footer",{className:"branch-compare__footer",children:a.jsx(Tt,{type:"button",color:"info",variant:"ghost",size:"sm",pill:!1,disabled:c.status!=="completed",onClick:()=>i==null?void 0:i(c),children:r("blocks.branchCompare.continue")})})]},`${c.label}:${u}`))})]})}function OLe({controlled:e,default:t,name:n,state:i="value"}){const{current:r}=p.useRef(e!==void 0),[s,o]=p.useState(t),l=r?e:s,c=p.useCallback(u=>{r||o(u)},[]);return[l,c]}const SLe=p.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function q_t(){return p.useContext(SLe)}function W_t(e){const{children:t,elementsRef:n,labelsRef:i,onMapChange:r}=e,s=oi(r),[,o]=p.useState(!1),l=Td(G_t).current,c=Td(K_t).current,u=p.useRef(0),d=p.useRef(!0),f=p.useRef([]),h=p.useRef(null),m=oi(()=>{d.current||(d.current=!0,o(S=>!S))}),g=oi((S,O)=>{c.set(S,O),m()}),b=oi(S=>{c.delete(S),m()}),v=oi(S=>{const O=new Map;return n.current.length=0,i&&(i.current.length=0),S.forEach(A=>{var E,j;O.set(A.element,{...A.registration.metadata??{},index:A.index}),n.current[A.index]=A.element,i&&(i.current[A.index]=A.registration.label!==void 0?A.registration.label:((j=(E=A.registration.textRef)==null?void 0:E.current)==null?void 0:j.textContent)??A.element.textContent)}),u.current=n.current.length,O});function y(S){var E;if((E=h.current)==null||E.disconnect(),h.current=null,typeof MutationObserver!="function"||S.length<2)return;const O=new MutationObserver(j=>{if(!Z_t(j))return;let T=null;for(const R of S)if(R.isConnected){if(T&&ELe(T,R)>0){O.disconnect(),m();return}T=R}});h.current=O;const A=new Set;for(let j=1;jO.observe(j,{childList:!0}))}const w=oi(()=>{const[S,O]=X_t(c),A=v(S);y(O),f.current=S,d.current=!1,l.forEach(E=>E(A)),s(A)});ti(()=>(d.current||v(f.current),()=>{n.current=[],i&&(i.current=[])}),[n,i,v]),ti(()=>{d.current&&w()}),ti(()=>()=>{var S;(S=h.current)==null||S.disconnect(),d.current=!0},[]);const x=oi(S=>(l.add(S),()=>{l.delete(S)})),k=p.useMemo(()=>({register:g,unregister:b,subscribeMapChange:x,nextIndexRef:u}),[g,b,x,u]);return a.jsx(SLe.Provider,{value:k,children:t})}function K_t(){return new Map}function G_t(){return new Set}function X_t(e){const t=new Set,n=[],i=[];e.forEach((s,o)=>{if(!o.isConnected)return;const l=s.index,c={index:l??-1,element:o,registration:s};l===null?i.push(c):l>=0&&(t.add(l),n.push(c))});let r=0;return i.sort((s,o)=>ELe(s.element,o.element)),i.forEach(s=>{for(;t.has(r);)r+=1;s.index=r,n.push(s),r+=1}),t.size>0&&n.sort((s,o)=>s.index-o.index),[n,i.map(s=>s.element)]}function Y_t(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function Z_t(e){for(const t of e)for(let n=0;nnull},TLe=p.forwardRef(function(t,n){const{render:i,className:r,disabled:s=!1,hiddenUntilFound:o,keepMounted:l,loopFocus:c,onValueChange:u,multiple:d=!1,orientation:f="vertical",value:h,defaultValue:m,style:g,...b}=t,v=p.useMemo(()=>{if(h===void 0)return m??[]},[h,m]),y=p.useRef([]),[w,x]=OLe({controlled:h,default:v,name:"Accordion",state:"value"}),k=oi((E,j,T)=>{if(d)if(j){const R=w.slice();if(R.push(E),u==null||u(R,T),T.isCanceled)return;x(R)}else{const R=w.filter(C=>C!==E);if(u==null||u(R,T),T.isCanceled)return;x(R)}else{const R=w[0]===E?[]:[E];if(u==null||u(R,T),T.isCanceled)return;x(R)}}),S=p.useMemo(()=>({value:w,disabled:s,orientation:f}),[w,s,f]),O=p.useMemo(()=>({disabled:s,handleValueChange:k,hiddenUntilFound:o??!1,keepMounted:l??!1,state:S,value:w}),[s,k,o,l,S,w]),A=Da("div",t,{state:S,ref:n,props:b,stateAttributesMapping:J_t});return a.jsx(CLe.Provider,{value:O,children:a.jsx(W_t,{elementsRef:y,children:A})})});function ejt(e){const{open:t,defaultOpen:n,onOpenChange:i,disabled:r}=e,[s,o]=OLe({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:l,setMounted:c,transitionStatus:u}=aje(s,!0,!0),d=nm(),[f,h]=p.useState(),m=f===null?void 0:f??d,g=oi(b=>{const v=!s,y=pa(e1,b.nativeEvent);i(v,y),!y.isCanceled&&o(v)});return p.useMemo(()=>({defaultPanelId:d,disabled:r,handleTrigger:g,mounted:l,open:s,panelId:m,setMounted:c,setOpen:o,setPanelIdState:h,transitionStatus:u}),[d,r,g,l,s,m,c,o,h,u])}const _Le=p.createContext(void 0);function jLe(){const e=p.useContext(_Le);if(e===void 0)throw new Error(Uc(15));return e}function tjt(e={}){const{guess:t,label:n,metadata:i,textRef:r,index:s}=e,{register:o,unregister:l,subscribeMapChange:c,nextIndexRef:u}=q_t(),d=p.useRef(-1),[f,h]=p.useState(s==null&&t?()=>{if(d.current===-1){const v=u.current;u.current+=1,d.current=v}return d.current}:-1),m=s??f,g=p.useRef(null),b=p.useCallback(v=>{const y=g.current;y&&l(y),g.current=v,v&&o(v,{metadata:i??null,index:s??null,label:n,textRef:r})},[s,o,l,i,n,r]);return ti(()=>{if(s==null)return c(v=>{var w;const y=g.current?(w=v.get(g.current))==null?void 0:w.index:null;y!=null&&h(y)})},[s,c]),{ref:b,index:m}}const NLe=p.createContext(void 0);function hq(){const e=p.useContext(NLe);if(e===void 0)throw new Error(Uc(9));return e}let pq=function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=aI.startingStyle]="startingStyle",e[e.endingStyle=aI.endingStyle]="endingStyle",e}({}),njt=function(e){return e.panelOpen="data-panel-open",e}({});const ijt={[pq.open]:""},rjt={[pq.closed]:""},sjt={open(e){return e?{[njt.panelOpen]:""}:null}},ajt={open(e){return e?ijt:rjt}};let ojt=function(e){return e.index="data-index",e.disabled="data-disabled",e.open="data-open",e}({});const mq={...ajt,index:e=>({[ojt.index]:String(e)}),...qD,value:()=>null},RLe=p.forwardRef(function(t,n){const{className:i,disabled:r=!1,onOpenChange:s,render:o,value:l,style:c,...u}=t,{ref:d,index:f}=tjt(),h=Jw(n,d),{disabled:m,handleValueChange:g,state:b,value:v}=ALe(),y=nm(),w=l??y,x=r||m,k=v.indexOf(w)!==-1,S=oi((D,_)=>{s==null||s(D,_),!_.isCanceled&&g(w,D,_)}),O=ejt({open:k,onOpenChange:S,disabled:x}),A=p.useMemo(()=>({open:O.open,disabled:O.disabled,transitionStatus:O.transitionStatus}),[O.open,O.disabled,O.transitionStatus]),E=p.useMemo(()=>({...O,onOpenChange:S,state:A}),[O,A,S]),j=p.useMemo(()=>({...b,hidden:!k&&!O.mounted,index:f,disabled:x,open:k}),[O.mounted,x,f,k,b]),T=nm(),[R,C]=p.useState(),N=R===null?void 0:R??T,P=p.useMemo(()=>({defaultTriggerId:T,open:k,state:j,setTriggerId:C,triggerId:N}),[T,k,j,C,N]),I=Da("div",t,{state:j,ref:h,props:u,stateAttributesMapping:mq});return a.jsx(_Le.Provider,{value:E,children:a.jsx(NLe.Provider,{value:P,children:I})})}),ILe=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...o}=t,{state:l}=hq();return Da("h3",t,{state:l,ref:n,props:o,stateAttributesMapping:mq})}),PLe=p.forwardRef(function(t,n){const{disabled:i,className:r,id:s,render:o,nativeButton:l=!0,style:c,...u}=t,{panelId:d,open:f,handleTrigger:h,disabled:m}=jLe(),g=i||m,{getButtonProps:b,buttonRef:v}=WD({disabled:g,focusableWhenDisabled:!0,native:l}),{defaultTriggerId:y,state:w,setTriggerId:x}=hq(),k=s||void 0,S=k??y;return ti(()=>(x(E=>k??(E===null?void 0:E)),()=>{x(E=>E===k?null:E)}),[k,x]),Da("button",t,{state:w,ref:[n,v],props:[{"aria-controls":f?d:void 0,"aria-expanded":f,id:S,onClick:h},u,b],stateAttributesMapping:sjt})}),OO={height:void 0,width:void 0};function ljt(e){const{externalRef:t,hiddenUntilFound:n,id:i,keepMounted:r,mounted:s,onOpenChange:o,open:l,setMounted:c,setOpen:u,transitionStatus:d}=e,f=p.useRef(null),h=p.useRef(null),[m,g]=p.useState(OO),b=p.useRef(OO),v=p.useRef(!1),y=p.useRef(l),w=p.useRef(!1),[x,k]=p.useState(!1),S=p.useRef(null),O=Jw(t,f),A=Gl(l),E=sV(f),j=!l&&!s,T=x?"idle":d,R=l&&(y.current||w.current),C=!l&&s&&h.current==="css-animation"&&m.height===void 0&&m.width===void 0?b.current:m,N=n&&j&&h.current!=="css-animation",P=oi((F,M=!0)=>{M&&(b.current=F),g(F)}),I=oi(()=>{var F;(F=S.current)==null||F.call(S),S.current=null}),D=oi(F=>{I(),S.current=()=>{S.current=null,F()}}),_=oi(()=>{l&&s&&h.current==="css-animation"&&(w.current=!0)});ti(()=>{!x||d==="starting"||k(!1)},[x,d]),p.useEffect(()=>()=>{_(),I()},[_,I]),ti(()=>{const F=f.current;if(!F)return;!l&&S.current&&I();const M=cjt(F,R);if(h.current=M,l&&d==="idle"&&y.current&&M==="css-animation"){b.current=z0(F);return}if(l&&d==="starting"){const U=v.current;if(v.current=!1,M==="none"){P(z0(F)),k(!0);return}if(M==="css-transition"){const J=ujt(F);if(P(z0(F)),!U)return J;const ne=N_(F,"transition-duration","0s");return D(ne),k(!0),J}P(z0(F));const Z=N_(F,"animation-name","none");if(!U){Z();return}const z=N_(F,"animation-duration","0s");Z(),D(z),k(!0);return}if(!l&&s&&(d==="idle"||d==="starting")){if(y.current=!1,w.current=!1,M==="none"){P(OO,!1),c(!1);return}P(z0(F));return}if(d!=="ending")return;if(M==="none"){c(!1);return}const H=z0(F);if(!(H.height>0||H.width>0)){c(!1);return}P(H),M==="css-animation"&&N_(F,"animation-name","none")()},[s,l,I,P,c,D,R,d]),WA({enabled:l&&s&&T==="idle",open:!0,ref:f,onComplete(){l&&P(OO,!1)}}),p.useEffect(()=>{if(l||!s||T!=="ending"||!f.current)return;const M=new AbortController;let H=-1;function q(){A.current||(c(!1),P(OO,!1))}return H=Cc.request(()=>{E(q,M.signal)}),()=>{Cc.cancel(H),M.abort()}},[A,s,l,T,E,P,c]),ti(()=>{const F=f.current;!F||!n||!j||F.setAttribute("hidden","until-found")},[j,n]),p.useEffect(function(){const M=f.current;if(!M)return;function H(q){const U=pa(j_e,q);o(!0,U),!U.isCanceled&&(v.current=!0,u(!0))}return Di(M,"beforematch",H)},[o,u]);const L=r||n||s||l;return{height:C.height,props:{...N?{[pq.startingStyle]:""}:void 0,hidden:j,id:i},ref:O,shouldPreventOpenAnimation:R,shouldRender:L,transitionStatus:T,width:C.width}}function z0(e){return{height:e.scrollHeight,width:e.scrollWidth}}function cjt(e,t){const n=ea(e).getComputedStyle(e),i=(n.animationName.split(",").map(s=>s.trim()).some(s=>s!==""&&s!=="none")||t)&&Vne(n.animationDuration),r=Vne(n.transitionDuration);return i&&r||r?"css-transition":i?"css-animation":"none"}function Vne(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function N_(e,t,n){const i=e.style.getPropertyValue(t),r=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(i===""){e.style.removeProperty(t);return}e.style.setProperty(t,i,r)}}function ujt(e){const t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(r=>{e.style.setProperty(r,"initial","important")});function n(){Object.entries(t).forEach(([r,s])=>{if(s===""){e.style.removeProperty(r);return}e.style.setProperty(r,s)})}const i=Cc.request(n);return()=>{Cc.cancel(i),n()}}let Hne=function(e){return e.accordionPanelHeight="--accordion-panel-height",e.accordionPanelWidth="--accordion-panel-width",e}({});const DLe=p.forwardRef(function(t,n){const{className:i,hiddenUntilFound:r,keepMounted:s,id:o,render:l,style:c,...u}=t,{hiddenUntilFound:d,keepMounted:f}=ALe(),{defaultPanelId:h,mounted:m,onOpenChange:g,open:b,setMounted:v,setOpen:y,setPanelIdState:w,transitionStatus:x}=jLe(),k=r??d,S=s??f,O=o||void 0,A=o??h;ti(()=>(w(M=>O??(M===null?void 0:M)),()=>{w(M=>M===O?null:M)}),[O,w]);const{height:E,props:j,ref:T,shouldPreventOpenAnimation:R,shouldRender:C,transitionStatus:N,width:P}=ljt({externalRef:n,hiddenUntilFound:k,id:A,keepMounted:S,mounted:m,onOpenChange:g,open:b,setMounted:v,setOpen:y,transitionStatus:x}),{state:I,triggerId:D}=hq(),_={...I,transitionStatus:N},L=x_e(c,_),F=Da("div",{...t,style:void 0},{state:_,ref:T,props:[j,{"aria-labelledby":D,role:"region",style:{[Hne.accordionPanelHeight]:E===void 0?"auto":`${E}px`,[Hne.accordionPanelWidth]:P===void 0?"auto":`${P}px`}},u,L?{style:L}:void 0,R?{style:{animationName:"none"}}:void 0],stateAttributesMapping:mq});return C?F:null}),djt=(e,t)=>{const n=e.currentTarget,i={x:e.clientX,y:e.clientY},r=fjt(i,n.getBoundingClientRect()),s=hjt(i,r),o=pjt(t.getBoundingClientRect());return gjt([...s,...o])};function fjt(e,t){const n=Math.abs(t.top-e.y),i=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,i,r,s)){case s:return"left";case r:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function hjt(e,t,n=5){const i=[];switch(t){case"top":i.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":i.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":i.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":i.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return i}function pjt(e){const{top:t,right:n,bottom:i,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:i},{x:r,y:i}]}function mjt(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,o=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}function gjt(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),bjt(t)}function bjt(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let i=e.length-1;i>=0;i--){const r=e[i];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const yjt="_Transition_1wdpp_1",vjt="_Popover_1wdpp_3",MLe={Transition:yjt,Popover:vjt},LLe=p.createContext(null),DM=()=>{const e=p.use(LLe);if(!e)throw new Error("Popover components must be wrapped in ");return e},Dg=({open:e,onOpenChange:t,showOnHover:n=!1,hoverOpenDelay:i=150,children:r})=>{const[s,o]=p.useState(!1),[l,c]=p.useState(!1),u=p.useRef(null),d=p.useRef(null),f=p.useRef(void 0),h=p.useRef(!1),m=p.useRef(!1),g=e??s,[b,v]=p.useState(!1);OV(()=>v(!1),b?500:null);const y=nb(t),w=nb(A=>{var E,j;clearTimeout(f.current),g!==A&&(A||(c(!1),n&&h.current&&((E=u.current)==null||E.focus()),h.current=!1),(j=y.current)==null||j.call(y,A),o(A),n&&v(A))}),x=p.useCallback(A=>{w.current(A)},[w]),k=p.useCallback(()=>{f.current=setTimeout(()=>x(!0),i)},[x,i]),S=p.useCallback(()=>{clearTimeout(f.current)},[]);p.useEffect(()=>()=>{clearTimeout(f.current)},[]);const O=p.useMemo(()=>({open:g,setOpen:x,shake:l,setShake:c,showOnHover:n,temporarilyPreventClickToClose:b,onTriggerEnter:k,onTriggerLeave:S,isPointerInTransitRef:m,triggerRef:u,contentRef:d,hoverOpenFocusedWithTab:h}),[g,x,l,c,n,b,h,m,k,S]);return a.jsx(LLe,{value:O,children:a.jsx($Re,{open:g,onOpenChange:x,modal:!1,children:r})})},xjt=({children:e,onPointerDown:t,onClick:n})=>{const{setOpen:i,showOnHover:r,temporarilyPreventClickToClose:s,onTriggerEnter:o,onTriggerLeave:l,isPointerInTransitRef:c,triggerRef:u,contentRef:d}=DM(),f=p.useRef(!1),h=b=>{!(b.currentTarget.nodeName.toLocaleLowerCase()==="a")&&s&&(b.preventDefault(),b.stopPropagation())},m=b=>{b.pointerType!=="touch"&&!f.current&&!c.current&&(o(),f.current=!0)},g=()=>{f.current&&(l(),f.current=!1)};return a.jsx(FRe,{asChild:!0,ref:u,onPointerDown:b=>{h(b),t==null||t(b)},onClick:b=>{h(b),n==null||n(b)},onPointerMove:r?m:void 0,onPointerLeave:r?g:void 0,onFocus:r?()=>i(!0):void 0,onBlur:r?()=>{setTimeout(()=>{var b;(b=d.current)!=null&&b.contains(document.activeElement)||i(!1)},50)}:void 0,children:e})},$Le=({children:e,avoidCollisions:t,width:n,minWidth:i,maxWidth:r,side:s,sideOffset:o=8,align:l,alignOffset:c,translucent:u,className:d,autoFocus:f=!0})=>{const{showOnHover:h,shake:m,contentRef:g}=DM(),b=v=>{const y=g.current;if(y&&v.target===y&&v.key==="Tab"&&v.shiftKey){v.preventDefault(),v.stopPropagation();const w=uNe(y),x=w[w.length-1];x==null||x.focus()}};return p.useEffect(()=>{const v=g.current;!v||!f||v!=null&&v.contains(document.activeElement)||h||v.focus({preventScroll:!0})},[g,h,f]),a.jsx(URe,{forceMount:!0,ref:g,className:qi(MLe.Popover,d),style:Fv({"popover-width":n,"popover-min-width":i,"popover-max-width":r}),onCloseAutoFocus:h?Lp:void 0,"data-animate":m?"shake":void 0,"data-translucent":u?"true":void 0,side:s,sideOffset:o,align:l,alignOffset:c??(l==="center"?0:-5),avoidCollisions:t??!0,hideWhenDetached:!0,collisionPadding:20,onOpenAutoFocus:Lp,onEscapeKeyDown:Lp,onKeyDown:b,children:e})},wjt=e=>{const{setOpen:t,triggerRef:n,contentRef:i,isPointerInTransitRef:r,hoverOpenFocusedWithTab:s}=DM(),[o,l]=p.useState(null),c=p.useCallback(()=>{l(null),r.current=!1},[r]),u=p.useCallback((d,f)=>{const h=djt(d,f);l(h),r.current=!0},[r]);return p.useEffect(()=>()=>c(),[c]),p.useEffect(()=>{const d=n.current,f=i.current;if(!d||!f)return;const h=g=>u(g,f),m=g=>u(g,d);return d.addEventListener("pointerleave",h),f.addEventListener("pointerleave",m),()=>{d.removeEventListener("pointerleave",h),f.removeEventListener("pointerleave",m)}},[i,n,u,c]),p.useEffect(()=>{if(!o)return;const d=f=>{const h=n.current,m=i.current,g=f.target,b={x:f.clientX,y:f.clientY},v=(h==null?void 0:h.contains(g))||(m==null?void 0:m.contains(g)),y=!mjt(b,o),w=g.hasAttribute("aria-haspopup");v?c():(y||w)&&(c(),t(!1))};return document.addEventListener("pointermove",d),()=>document.removeEventListener("pointermove",d)},[o,t,c,n,i]),p.useEffect(()=>{const d=f=>{if(i.current&&f.key==="Tab"&&!f.shiftKey){const[h]=uNe(i.current);h&&(f.preventDefault(),h.focus(),s.current=!0,document.removeEventListener("keydown",d))}};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[i,s]),a.jsx($Le,{...e})},kjt=e=>{const{open:t,showOnHover:n,setOpen:i}=DM();return iT(t,()=>{i(!1)}),a.jsx(BRe,{forceMount:!0,children:a.jsx(ek,{enterDuration:600,exitDuration:300,className:MLe.Transition,disableAnimations:!0,children:t&&(n?a.jsx(wjt,{...e},"popover-hover"):a.jsx($Le,{...e},"popover"))})})};Dg.Trigger=xjt;Dg.Content=kjt;const Ojt=["skill_hub","skill_space","knowledge_base","tool"];function FLe(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m4 6 4 4 4-4"})})}function BLe({label:e}){return a.jsx("div",{className:"create-agent-card__loading",role:"status","aria-label":e,children:[0,1,2].map(t=>a.jsxs("div",{className:"create-agent-card__skeleton-row","aria-hidden":"true",children:[a.jsx("span",{}),a.jsx("span",{})]},t))})}function Sjt(e,t){return e.kind==="tool"?t("blocks.createAgents.builtinTool"):e.kind==="knowledge_base"?t("blocks.createAgents.knowledgeBase"):e.source.startsWith("skill_hub:")?"Skill Hub":e.source.startsWith("skill_space:")?t("blocks.createAgents.skillCenter"):"Skill"}function L4({label:e,resources:t}){const{t:n}=_e("conversation");return t.length===0?null:a.jsxs("section",{className:"create-agent-card__popover-section",children:[a.jsx("h4",{children:e}),a.jsx("div",{className:"create-agent-card__popover-list",children:t.map(i=>a.jsxs("div",{className:"create-agent-card__popover-item",children:[a.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[a.jsx("strong",{children:i.name}),a.jsx(Za,{color:"secondary",size:"sm",variant:"soft",children:Sjt(i,n)})]}),i.description?a.jsx("p",{children:i.description}):null]},i.ref))})]})}function Ejt({tools:e}){const{t}=_e("conversation");return e.length===0?null:a.jsxs("section",{className:"create-agent-card__popover-section",children:[a.jsx("h4",{children:t("blocks.createAgents.selfAuthoredTools")}),a.jsx(TLe,{children:e.map((n,i)=>a.jsxs(RLe,{className:"create-agent-card__python-tool",value:`${n.name}:${i}`,children:[a.jsx(ILe,{className:"create-agent-card__python-tool-header",children:a.jsxs(PLe,{className:"create-agent-card__python-tool-trigger",children:[a.jsxs("span",{children:[a.jsx("strong",{children:n.name}),n.description?a.jsx("small",{children:n.description}):null]}),a.jsxs("span",{className:"create-agent-card__python-tool-meta",children:[a.jsx(Za,{color:"secondary",size:"sm",variant:"soft",children:t("blocks.createAgents.selfAuthoredTools")}),a.jsx(FLe,{className:"create-agent-card__python-tool-chevron"})]})]})}),a.jsxs(DLe,{className:"create-agent-card__python-tool-panel",children:[n.dependencies.length>0?a.jsx("div",{className:"create-agent-card__python-tool-dependencies",children:t("blocks.createAgents.dependencies",{items:n.dependencies.join(", ")})}):null,a.jsx("pre",{tabIndex:0,"aria-label":t("blocks.createAgents.fullCode",{name:n.name}),children:a.jsx("code",{children:n.code})})]})]},`${n.name}:${i}`))})]})}function Cjt({agents:e}){const{t}=_e("conversation");return e.length===0?null:a.jsxs("section",{className:"create-agent-card__popover-section",children:[a.jsx("h4",{children:t("blocks.createAgents.subAgents")}),a.jsx("div",{className:"create-agent-card__popover-list",children:e.map(n=>a.jsxs("div",{className:"create-agent-card__popover-item",children:[a.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[a.jsx("strong",{children:n.id}),a.jsx(Za,{color:"secondary",size:"sm",variant:"soft",children:t(`blocks.createAgents.agentTypes.${n.type}`,{defaultValue:n.type})})]}),n.description?a.jsx("p",{children:n.description}):null]},n.id))})]})}function R_({label:e,count:t,icon:n,children:i}){const{t:r}=_e("conversation"),s=a.jsxs("button",{className:"create-agent-card__resource-metric",type:"button",disabled:t===0,"aria-label":r("blocks.createAgents.itemCount",{label:e,count:t}),children:[n,a.jsx("span",{children:t})]});return t===0?s:a.jsxs(Dg,{showOnHover:!0,hoverOpenDelay:120,children:[a.jsx(Dg.Trigger,{children:s}),a.jsx(Dg.Content,{side:"top",align:"start",minWidth:"auto",maxWidth:360,className:"create-agent-card__resource-popover",children:i})]})}function Ajt({response:e,status:t}){const{t:n}=_e("conversation"),i=p.useMemo(()=>({tool:n("blocks.createAgents.sourceLabels.tool"),knowledge:n("blocks.createAgents.sourceLabels.knowledge"),skillCenter:n("blocks.createAgents.sourceLabels.skillCenter"),unknownSource:n("blocks.createAgents.sourceLabels.unknown"),unnamedResource:n("blocks.createAgents.unnamedResource"),unnamedAgent:n("blocks.createAgents.unnamedAgent")}),[n]),r=p.useMemo(()=>U_t(e,i),[i,e]),s=p.useMemo(()=>Ojt.map(c=>{const u=Q_t(r,c);return{value:c,label:n(`blocks.createAgents.categories.${c}`),...u,searchKeywords:[...new Set(u.sources.flatMap(d=>d.searchKeywords))]}}),[r,n]),o=t==="failed",l=o?PM(e):"";return a.jsx("section",{className:"create-agent-tool-card","aria-label":n("blocks.createAgents.collectionAria"),children:t==="running"?a.jsx(BLe,{label:n("blocks.createAgents.retrieving")}):o?a.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[a.jsx("span",{className:"create-agent-card__message-title",children:n("blocks.createAgents.retrievalFailed")}),a.jsx("span",{children:l||n("blocks.createAgents.checkConfig")})]}):a.jsx(TLe,{className:"create-agent-card__accordion",children:s.map(c=>a.jsxs(RLe,{className:"create-agent-card__accordion-item",value:c.value,children:[a.jsx(ILe,{className:"create-agent-card__accordion-header",children:a.jsxs(PLe,{className:"create-agent-card__accordion-trigger",children:[a.jsx("span",{children:c.label}),a.jsxs("span",{className:"create-agent-card__accordion-meta",children:[a.jsx(Za,{color:"secondary",size:"sm",variant:"soft",children:c.sources.length===0?c.value==="skill_hub"?n("blocks.createAgents.notSearched"):n("blocks.createAgents.notConfigured"):c.resources.length}),a.jsx(FLe,{className:"create-agent-card__accordion-chevron"})]})]})}),a.jsx(DLe,{className:"create-agent-card__accordion-content",children:a.jsxs("div",{className:"create-agent-card__accordion-scroll",role:"region","aria-label":n("blocks.createAgents.resourceList",{label:c.label}),tabIndex:0,children:[c.value==="skill_hub"&&c.searchKeywords.length>0?a.jsxs("div",{className:"create-agent-card__search-keywords",children:[a.jsx("span",{children:n("blocks.createAgents.searchKeywords")}),a.jsx("span",{children:c.searchKeywords.join("、")})]}):null,c.resources.length>0?a.jsx("div",{className:"create-agent-card__resource-list",children:c.resources.map(u=>a.jsx("div",{className:"create-agent-card__resource",children:a.jsxs("div",{className:"create-agent-card__resource-main",children:[a.jsxs("div",{className:"create-agent-card__resource-title",children:[a.jsx("span",{className:"create-agent-card__resource-name",children:u.name}),u.version?a.jsx(Za,{className:"create-agent-card__resource-version",color:"secondary",size:"sm",variant:"soft",children:u.version}):null]}),u.description?a.jsx("p",{children:u.description}):null]})},u.ref))}):a.jsxs("div",{className:"create-agent-card__empty-category",children:[a.jsx("p",{children:c.sources.length===0?c.value==="skill_hub"?n("blocks.createAgents.skillHubSkipped"):n("blocks.createAgents.sourceSkipped",{label:c.label}):n("blocks.createAgents.noResources")}),c.sources.filter(u=>u.message).map(u=>a.jsx("p",{className:"create-agent-card__raw-source-error",children:u.message},u.source))]})]})})]},c.value))},r.collectionId||"collected-resources")})}function Tjt({args:e,response:t,status:n}){const{t:i}=_e("conversation"),r=p.useMemo(()=>({tool:i("blocks.createAgents.sourceLabels.tool"),knowledge:i("blocks.createAgents.sourceLabels.knowledge"),skillCenter:i("blocks.createAgents.sourceLabels.skillCenter"),unknownSource:i("blocks.createAgents.sourceLabels.unknown"),unnamedResource:i("blocks.createAgents.unnamedResource"),unnamedAgent:i("blocks.createAgents.unnamedAgent")}),[i]),s=p.useMemo(()=>kLe(e,t,r),[e,r,t]),o=n==="failed"?PM(t):"";return a.jsxs("section",{className:"create-agent-tool-card is-agent-results","aria-label":i("blocks.createAgents.resultAria"),children:[o?a.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[a.jsx("span",{className:"create-agent-card__message-title",children:i("blocks.createAgents.creationFailed")}),a.jsx("span",{children:o})]}):null,s.agents.length>0?a.jsx("div",{className:"create-agent-card__agent-grid",children:s.agents.map(l=>{const c=n==="failed"?"failed":l.status,u=l.error||c==="failed"&&o,d=l.builtinTools.length+l.pythonTools.length;return a.jsxs(xH,{className:`create-agent-card__agent-card${u?" is-error":""}`,children:[a.jsx(wH,{leading:a.jsx(r1,{seed:l.name}),title:l.name,titleText:l.name,status:a.jsx(Za,{color:"secondary",size:"sm",variant:"soft",children:i(`blocks.createAgents.agentTypes.${l.rootType}`,{defaultValue:l.rootType})})}),l.description?a.jsx(kH,{children:l.description}):null,u?a.jsx("div",{className:"create-agent-card__agent-result is-error",role:"alert",children:u}):null,a.jsxs("div",{className:"create-agent-card__agent-resources","aria-label":i("blocks.createAgents.agentResources",{name:l.name}),children:[a.jsx(R_,{label:i("blocks.createAgents.skill"),count:l.skills.length,icon:a.jsx(mN,{"aria-hidden":"true"}),children:a.jsx(L4,{label:i("blocks.createAgents.skill"),resources:l.skills})}),a.jsx(R_,{label:i("blocks.createAgents.knowledgeBase"),count:l.knowledgeBases.length,icon:a.jsx(xIe,{"aria-hidden":"true"}),children:a.jsx(L4,{label:i("blocks.createAgents.knowledgeBase"),resources:l.knowledgeBases})}),a.jsxs(R_,{label:i("blocks.createAgents.toolsLabel"),count:d,icon:a.jsx(yat,{"aria-hidden":"true"}),children:[a.jsx(L4,{label:i("blocks.createAgents.builtinTool"),resources:l.builtinTools}),a.jsx(Ejt,{tools:l.pythonTools})]}),a.jsx(R_,{label:i("blocks.createAgents.subAgents"),count:l.subAgentCount,icon:a.jsx(xat,{"aria-hidden":"true"}),children:a.jsx(Cjt,{agents:l.subAgents})})]})]},l.name)})}):n==="running"?a.jsx(BLe,{label:i("blocks.createAgents.creating")}):a.jsxs("div",{className:"create-agent-card__message",children:[a.jsx("span",{className:"create-agent-card__message-title",children:i("blocks.createAgents.noAgents")}),a.jsx("span",{children:i("blocks.createAgents.noAgentResult")})]})]})}const _jt={web_search:{name:"web_search",runningLabel:"Searching the web",doneLabel:"Web search complete",tone:"search",icon:$ne},link_reader:{name:"link_reader",runningLabel:"Reading webpage",doneLabel:"Webpage read complete",tone:"search",icon:$ne},run_code:{name:"run_code",runningLabel:"Running code in the AgentKit sandbox",doneLabel:"Code execution completed in the AgentKit sandbox",tone:"sandbox",icon:v_t},list_envs:{name:"list_envs",runningLabel:"Checking available environments",doneLabel:"Available environments loaded",tone:"resources",icon:w_t},get_env_manifest:{name:"get_env_manifest",runningLabel:"Loading the environment manifest",doneLabel:"Environment manifest loaded",tone:"knowledge",icon:k_t},execute_in_sandbox:{name:"execute_in_sandbox",runningLabel:"Running a command in the environment",doneLabel:"Command completed in the environment",tone:"sandbox",icon:Bne},delegate_to_codex_sandbox:{name:"delegate_to_codex_sandbox",runningLabel:"Codex Sandbox is running",doneLabel:"Codex Sandbox completed",failedLabel:"Codex Sandbox failed",tone:"sandbox",icon:Bne},image_generate:{name:"image_generate",runningLabel:"Generating image",doneLabel:"Image generated",tone:"image",icon:p_t},video_generate:{name:"video_generate",runningLabel:"Generating video",doneLabel:"Video generated",tone:"video",icon:cq},ppt_generate:{name:"ppt_generate",runningLabel:"Generating presentation",doneLabel:"Presentation generated",tone:"presentation",icon:m_t},load_memory:{name:"load_memory",runningLabel:"Searching long-term memory",doneLabel:"Memory search complete",tone:"memory",icon:g_t},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"Searching the knowledge base",doneLabel:"Knowledge base search complete",tone:"knowledge",icon:b_t},load_skill:{name:"load_skill",runningLabel:"Loading skill",doneLabel:"Skill loaded",tone:"skill",icon:y_t},collect_resources:{name:"collect_resources",runningLabel:"Collecting available resources",doneLabel:"Resource collection complete",failedLabel:"Resource collection failed",tone:"resources",icon:x_t,detailRenderer:Ajt},create_agents:{name:"create_agents",runningLabel:"Creating and running agents",doneLabel:"Agent creation complete",failedLabel:"Agent creation failed",tone:"agent",icon:Fne,detailRenderer:Tjt},branch_compare:{name:"branch_compare",runningLabel:"",doneLabel:"",failedLabel:"",tone:"search",icon:Fne,detailRenderer:H_t,hideHeader:!0}};function gq(e){return _jt[e]}function jjt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3h8l4 4v14H6Z"}),a.jsx("path",{d:"M14 3v5h5"}),a.jsx("path",{d:"m10 12-2 2 2 2M14 12l2 2-2 2"})]})}function Njt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M12 3 19 6v5c0 4.6-2.8 7.8-7 10-4.2-2.2-7-5.4-7-10V6l7-3Z"}),a.jsx("path",{d:"m9 12 2 2 4-4"})]})}function Rjt(e,t){const n=new Map(e.map(o=>[o.path,o.content])),i=new Map(t.map(o=>[o.path,o.content])),r=new Set([...n.keys(),...i.keys()]),s=[];for(const o of[...r].sort((l,c)=>l.localeCompare(c))){const l=n.get(o),c=i.get(o);l!==c&&s.push({path:o,status:l===void 0?"added":c===void 0?"deleted":"modified",before:l??"",after:c??""})}return s}function _b(e){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...e}}function ULe(e){return a.jsx("svg",{..._b(e),children:a.jsx("path",{d:"m9 7-5 5 5 5M15 7l5 5-5 5M13.5 4l-3 16"})})}function $4(e){return a.jsx("svg",{..._b(e),children:a.jsx("path",{d:"M6.5 3.75h7l4 4V20.25h-11zM13.5 3.75v4h4M9 12h6M9 15.5h4.5"})})}function Ijt(e){return a.jsx("svg",{..._b(e),children:a.jsx("path",{d:"M3.75 7.25h6l1.75 2h8.75v9.25H3.75zM3.75 7.25V5.5h5l1.5 1.75"})})}function Pjt(e){return a.jsx("svg",{..._b(e),children:a.jsx("path",{d:"m9 5 7 7-7 7"})})}function ST(e){return a.jsx("svg",{..._b(e),children:a.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function Djt(e){return a.jsxs("svg",{..._b(e),children:[a.jsx("circle",{cx:"12",cy:"12",r:"3.25"}),a.jsx("path",{d:"M12 2.75v2M12 19.25v2M2.75 12h2M19.25 12h2M5.45 5.45l1.4 1.4M17.15 17.15l1.4 1.4M18.55 5.45l-1.4 1.4M6.85 17.15l-1.4 1.4"})]})}function Mjt(e){return a.jsx("svg",{..._b(e),children:a.jsx("path",{d:"M19.25 15.25A8 8 0 0 1 8.75 4.75a8 8 0 1 0 10.5 10.5Z"})})}function QLe(e){return a.jsxs("svg",{..._b(e),children:[a.jsx("path",{d:"M19.25 8.25V4.5l-1.8 1.8a7.5 7.5 0 1 0 1.8 7.65"}),a.jsx("path",{d:"M19.25 4.5H15.5"})]})}const Ljt=p.lazy(()=>Ys(()=>Promise.resolve().then(()=>CFe),void 0)),$jt=p.lazy(()=>Ys(()=>import("../chunks/CodeDiffEditor-j5M342U7.js"),[])),zLe="veadk-code-workspace-theme";function Fjt(e){const t={name:"",children:new Map};for(const n of e){const i=n.path.split("/").filter(Boolean);let r=t;i.forEach((s,o)=>{let l=r.children.get(s);l||(l={name:s,children:new Map},r.children.set(s,l)),o===i.length-1&&(l.path=n.path),r=l})}return t}function Bjt(e,t=!1){return[...e.children.values()].sort((n,i)=>{const r=n.children.size>0&&n.path===void 0,s=i.children.size>0&&i.path===void 0;return r!==s?t?r?1:-1:r?-1:1:n.name.localeCompare(i.name)})}function Ujt(){if(typeof window>"u")return"light";try{return window.localStorage.getItem(zLe)==="dark"?"dark":"light"}catch{return"light"}}function Qjt(e){return e===""?0:e.split(` +`).length}function c1({project:e,open:t,onClose:n,onChange:i,readOnly:r=!1,comparison:s}){var N;const{t:o}=_e("workspaceTools"),l=p.useId(),c=p.useRef(null),u=p.useRef(null),d=p.useRef(n),[f,h]=p.useState(Ujt),m=p.useMemo(()=>s?Rjt(s.baseProject.files,e.files):[],[s,e.files]),g=p.useMemo(()=>s?m.map(P=>({path:P.path,content:P.status==="deleted"?P.before:P.after})):e.files,[m,s,e.files]),b=p.useMemo(()=>new Map(m.map(P=>[P.path,P.status])),[m]),[v,y]=p.useState(((N=g[0])==null?void 0:N.path)??null),[w,x]=p.useState(new Set),k=p.useMemo(()=>Fjt(g),[g]),S=g.find(P=>P.path===v)??null,O=m.find(P=>P.path===v)??null;if(d.current=n,p.useEffect(()=>{try{window.localStorage.setItem(zLe,f)}catch{}},[f]),p.useEffect(()=>{var _;if(!t)return;const P=document.body.style.overflow,I=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(_=u.current)==null||_.focus();const D=L=>{if(L.key==="Escape"){L.preventDefault(),d.current();return}if(L.key!=="Tab"||!c.current)return;const F=[...c.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')].filter(q=>q.offsetParent!==null);if(F.length===0)return;const M=F[0],H=F[F.length-1];L.shiftKey&&document.activeElement===M?(L.preventDefault(),H.focus()):!L.shiftKey&&document.activeElement===H&&(L.preventDefault(),M.focus())};return window.addEventListener("keydown",D),()=>{document.body.style.overflow=P,window.removeEventListener("keydown",D),I!=null&&I.isConnected&&I.focus()}},[t]),p.useEffect(()=>{S||g.length===0||y(g[0].path)},[g,S]),!t)return null;function A(P){x(I=>{const D=new Set(I);return D.has(P)?D.delete(P):D.add(P),D})}function E(P){return P?a.jsx("span",{className:`code-browser-change is-${P}`,children:o(`codeBrowser.change.${P}`)}):null}function j(P,I,D){return Bjt(P,I===0).map(_=>{const L=D?`${D}/${_.name}`:_.name;if(!(_.children.size>0&&_.path===void 0)&&_.path){const H=b.get(_.path);return a.jsxs("button",{type:"button",className:`code-browser-file${v===_.path?" is-active":""}`,style:{paddingLeft:`${12+I*16}px`},onClick:()=>y(_.path??null),title:_.path,"aria-pressed":v===_.path,children:[a.jsx($4,{}),a.jsx("span",{children:_.name}),E(H)]},L)}const M=w.has(L);return a.jsxs("div",{children:[a.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+I*16}px`},onClick:()=>A(L),"aria-expanded":!M,children:[a.jsx(Pjt,{className:M?"":"is-open"}),a.jsx(Ijt,{}),a.jsx("span",{children:_.name})]}),!M&&j(_,I+1,L)]},L)})}function T(P){!S||s||i({...e,files:e.files.map(I=>I.path===S.path?{...I,content:P}:I)})}const R=f==="light"?"dark":"light",C=o(s?"codeBrowser.noChanges":"codeBrowser.chooseFile");return vi.createPortal(a.jsx("div",{className:"code-browser-backdrop",onMouseDown:P=>{P.target===P.currentTarget&&n()},children:a.jsxs("section",{ref:c,className:`code-browser-dialog is-${f}`,role:"dialog","aria-modal":"true","aria-labelledby":l,children:[a.jsxs("header",{className:"code-browser-head",children:[a.jsxs("div",{className:"code-browser-title-wrap",children:[a.jsx("span",{className:"code-browser-title-icon",children:a.jsx(ULe,{})}),a.jsxs("div",{children:[a.jsx("h2",{id:l,children:o(s?"codeBrowser.compareTitle":"codeBrowser.workspaceTitle")}),a.jsx("p",{title:e.name,children:e.name||o("codeBrowser.projectFallback")})]})]}),a.jsxs("div",{className:"code-browser-head-actions",children:[a.jsx("button",{type:"button",className:"code-browser-icon-button",onClick:()=>h(R),"aria-label":o("codeBrowser.switchTheme"),title:o("codeBrowser.switchThemeTitle",{theme:o(`codeBrowser.themes.${R}`)}),children:f==="light"?a.jsx(Mjt,{}):a.jsx(Djt,{})}),a.jsx("button",{ref:u,type:"button",className:"code-browser-icon-button",onClick:n,"aria-label":o("codeBrowser.closeWorkspace"),title:o("codeBrowser.close"),children:a.jsx(ST,{})})]})]}),a.jsxs("div",{className:"code-browser-workspace",children:[a.jsxs("aside",{className:"code-browser-sidebar","aria-label":o(s?"codeBrowser.changedFiles":"codeBrowser.projectFiles"),children:[a.jsxs("div",{className:"code-browser-sidebar-head",children:[a.jsx("span",{children:o(s?"codeBrowser.changes":"codeBrowser.files")}),a.jsx("span",{children:g.length})]}),a.jsx("div",{className:"code-browser-tree",children:g.length>0?j(k,0,""):a.jsx("div",{className:"code-browser-empty",children:C})})]}),a.jsxs("main",{className:"code-browser-main",children:[a.jsx("div",{className:"code-browser-tabs",role:"tablist","aria-label":o("codeBrowser.openFiles"),children:S?a.jsxs("div",{className:"code-browser-tab",role:"tab","aria-selected":"true",children:[a.jsx($4,{}),a.jsx("span",{children:S.path.split("/").pop()}),E(O==null?void 0:O.status)]}):null}),a.jsxs("div",{className:"code-browser-path",children:[a.jsx($4,{}),a.jsx("span",{children:(S==null?void 0:S.path)??o("codeBrowser.noFileSelected")})]}),s?a.jsxs("div",{className:"code-browser-diff-labels","aria-label":o("codeBrowser.comparisonDirection"),children:[a.jsx("span",{children:s.baseLabel??o("codeBrowser.before")}),a.jsx("span",{children:s.targetLabel??o("codeBrowser.after")})]}):null,a.jsx("div",{className:"code-browser-editor",children:S?a.jsx(p.Suspense,{fallback:a.jsx("div",{className:"code-browser-empty",children:o("codeBrowser.loadingEditor")}),children:O?a.jsx($jt,{before:O.before,after:O.after,path:O.path,theme:f}):a.jsx(Ljt,{value:S.content,path:S.path,onChange:T,readOnly:r,theme:f})}):a.jsx("div",{className:"code-browser-empty",children:C})}),a.jsxs("footer",{className:"code-browser-statusbar",children:[a.jsx("span",{children:s?o("codeBrowser.changedFileCount",{count:m.length}):o("codeBrowser.fileCount",{count:e.files.length})}),a.jsx("span",{children:S?o("codeBrowser.lineCount",{count:Qjt(S.content)}):"UTF-8"})]})]})]})]})}),document.body)}function zjt({project:e,onChange:t,className:n="",label:i}){const{t:r}=_e("workspaceTools"),[s,o]=p.useState(!1),l=i??r("codeBrowser.viewSource");return a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:`code-browser-trigger ${n}`.trim(),onClick:()=>o(!0),"aria-label":r("codeBrowser.viewSourceAria"),title:l,children:[a.jsx(ULe,{}),a.jsx("span",{children:l})]}),a.jsx(c1,{project:e,open:s,onClose:()=>o(!1),onChange:t})]})}const dy="••••••••",I_=5,V0=8e3,Vjt=8,Hjt=/(?:authorization|cookie|password|passwd|secret|token|api[_-]?key|access[_-]?key|credential|signature|^env(?:ironment)?$|^ak$|^sk$)/i,VLe=/\u001b\[[0-?]*[ -/]*[@-~]/g,HLe=/\u001b\][^\u0007]*(?:\u0007|\u001b\\)/g,qLe=/[\u0000-\u0008\u000b\u000c\u000e-\u001a\u001c-\u001f\u007f-\u009f]/g,qjt=new Set(["exec_command","commandExecution","command_execution","run_code","execute_in_sandbox","Run command"]),Wjt=new Set(["web_search","search","grep","rg"]),Kjt=new Set(["read_file","read","list_files","glob","ls"]),Gjt=new Set(["apply_patch","file_change","fileChange"]),Xjt=new Set(["create_goal","update_goal","get_goal"]);function yg(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function hv(...e){for(const t of e)if(typeof t=="string"&&t.trim())return t.trim();return""}function F4(...e){for(const t of e){if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"&&t.trim()&&Number.isFinite(Number(t)))return Number(t)}}function II(e){const t=yg(e);if(!t)return[];const n=[t];for(const i of["payload","input","arguments","args","goal","result","display","safeCommandSummary","safeInputSummary"]){const r=yg(t[i]);r&&n.push(r)}return n}function yE(e,...t){return hv(...e.flatMap(n=>t.map(i=>n[i])))}function Yjt(e){let t=e.replace(VLe,"").replace(HLe,"").replace(qLe,"");return/[=:]|Bearer|Cookie|AKLT/i.test(t)&&(t=t.replace(/\bBearer\s+[^\s,;]+/gi,`Bearer ${dy}`).replace(/\b(?:set-)?cookie\s*:\s*[^\r\n]*/gi,`cookie: ${dy}`).replace(/\bAKLT[A-Za-z0-9_-]{6,}\b/g,dy).replace(/((?:access[_-]?key(?:[_-]?id)?|secret(?:[_-]?(?:access)?[_-]?key)?|session[_-]?token|security[_-]?token|client[_-]?secret|api[_-]?key|authorization|cookie|[a-z0-9_-]{0,80}(?:password|secret|token)|credential|ak|sk)\s*[:=]\s*)(?:"[^"]*"|'[^']*'|[^\s,;&]+)/gi,`$1${dy}`).replace(/([?&](?:access[_-]?key|api[_-]?key|client[_-]?secret|security[_-]?token|session[_-]?token|secret|token|password|authorization|cookie|credential)=)[^&#\s]+/gi,`$1${dy}`).replace(/([?&](?:x-amz-(?:credential|signature|security-token)|x-tos-signature|signature)=)[^&#\s]+/gi,`$1${dy}`)),t}function tf(e){return Yjt(e).replace(VLe,"").replace(HLe,"").replace(qLe,"")}function PI(e,t=0,n=new WeakSet){if(t>=Vjt)return"[truncated: maximum depth]";if(typeof e=="string")return tf(e);if(e===null||typeof e!="object")return e;if(n.has(e))return"[circular]";if(n.add(e),Array.isArray(e))return e.map(r=>PI(r,t+1,n));const i=yg(e);return i?Object.fromEntries(Object.entries(i).map(([r,s])=>[r,Hjt.test(r)?dy:PI(s,t+1,n)])):e}function B4(e){const t=tf(e).trimEnd();if(!t)return;const n=t.split(/\r?\n/);return t.length>V0*2?{text:t.slice(0,V0)+t.slice(-V0),head:[t.slice(0,V0)],tail:[t.slice(-V0)],omittedLines:0,omittedCharacters:t.length-V0*2}:n.length<=I_*2?{text:t,head:n,tail:[],omittedLines:0,omittedCharacters:0}:{text:t,head:n.slice(0,I_),tail:n.slice(-I_),omittedLines:n.length-I_*2,omittedCharacters:0}}function Zjt(e){return Xjt.has(e)?"goal":qjt.has(e)?"command":Wjt.has(e)||/search/i.test(e)?"search":Kjt.has(e)||/(?:read|list|glob)/i.test(e)?"read":Gjt.has(e)||/(?:write|edit|patch|file.?change)/i.test(e)?"file-change":/^(?:mcp|tool__)/i.test(e)||e.includes("/")?"mcp":/auth|credential|approval/i.test(e)?"authorization":"generic"}function Jjt(e,t){if(e.status)return e.status;const n=hv(t==null?void 0:t.status).toLowerCase();return(t==null?void 0:t.ok)===!1||["failed","error","cancelled","denied","timeout"].includes(n)?"failed":e.done||["completed","done","success"].includes(n)?"completed":"running"}function qne(e){return typeof e=="string"?e.trim()?[e.trim()]:[]:Array.isArray(e)?e.flatMap(t=>{if(typeof t=="string")return t.trim()?[t.trim()]:[];const n=yg(t),i=hv(n==null?void 0:n.path,n==null?void 0:n.filename,n==null?void 0:n.name);return i?[i]:[]}):[]}function eNt(e,t,n,i,r){const s=[...II(n),...II(i)];return e==="goal"?tf(yE(s,"objective","title","name")):e==="command"?tf(yE(s,"command","cmd","script","commandPreview","binary")):e==="search"?tf(yE(s,"query","pattern","search")):e==="read"||e==="file-change"?r.slice(0,2).map(tf).join(", "):tf(e==="mcp"?hv(n==null?void 0:n.query,n==null?void 0:n.resource,n==null?void 0:n.path):hv(n==null?void 0:n.title,n==null?void 0:n.name,i==null?void 0:i.message,i==null?void 0:i.status,t))}function bq(e){const t=yg(e.args),n=yg(e.response),i=e.args===void 0?void 0:PI(e.args),r=e.response===void 0?void 0:PI(e.response),s=[...II(e.args),...II(e.response)],o=Zjt(e.name),l=Jjt(e,n),c=yg(n==null?void 0:n.display)??yg(t==null?void 0:t.display),u=hv(n==null?void 0:n.aggregatedOutput,n==null?void 0:n.aggregated_output,n==null?void 0:n.output,n==null?void 0:n.errorMessage,n==null?void 0:n.error_message),d=[...qne((t==null?void 0:t.paths)??(t==null?void 0:t.files)??(t==null?void 0:t.changes)??(t==null?void 0:t.path)),...qne((n==null?void 0:n.paths)??(n==null?void 0:n.files)??(n==null?void 0:n.changes))],f=F4(n==null?void 0:n.exitCode,n==null?void 0:n.exit_code),h=F4(n==null?void 0:n.durationMs,n==null?void 0:n.duration_ms,c==null?void 0:c.durationMs),m=F4(n==null?void 0:n.count,n==null?void 0:n.total,n==null?void 0:n.totalCount);return{category:o,titleKey:o==="generic"?`generic.named.${l}`:`${o}.${l}`,titleParams:o==="generic"?{tool:e.name}:void 0,title:e.title,summary:eNt(o,e.name,t,n,d),status:l,source:e.source,command:o==="command"?tf(hv(yE(s,"command","cmd","script","commandPreview","binary"))):void 0,cwd:o==="command"&&tf(yE(s,"cwd"))||void 0,output:B4(u),exitCode:f,durationMs:h,resultCount:m,paths:[...new Set(d.map(tf))],defaultOpen:e.defaultOpen===!0||l==="running"||l==="failed",rawArgs:i,rawResponse:r,rawArgsPreview:i===void 0?void 0:B4(Wne(i)),rawResponsePreview:r===void 0?void 0:B4(Wne(r))}}function Wne(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function Kne(e){return e.status==="completed"&&(e.category==="read"||e.category==="search")}function Pd(e){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...e}}function tNt(e){return a.jsxs("svg",{...Pd(e),children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("path",{d:"m7.5 9 2.7 2.5L7.5 14M12.7 14h3.8M3.8 7.5h16.4"})]})}function WLe(e){return a.jsxs("svg",{...Pd(e),children:[a.jsx("path",{d:"M6 3.5h7l5 5v12H6zM13 3.5v5h5M8.8 13h5.7M8.8 16h3.8"}),a.jsx("circle",{cx:"16.8",cy:"16.5",r:"2.3"}),a.jsx("path",{d:"m18.5 18.2 1.8 1.8"})]})}function nNt(e){return a.jsxs("svg",{...Pd(e),children:[a.jsx("circle",{cx:"10.5",cy:"10.5",r:"5.75"}),a.jsx("path",{d:"m15 15 4.25 4.25"})]})}function iNt(e){return a.jsxs("svg",{...Pd(e),children:[a.jsx("path",{d:"M5.5 3.5h7l4 4v4M12.5 3.5v4h4M10.5 20.5h-5v-17"}),a.jsx("path",{d:"m12.5 17.5 5.6-5.6 2 2-5.6 5.6-2.8.8z"})]})}function rNt(e){return a.jsxs("svg",{...Pd(e),children:[a.jsx("path",{d:"M8 8V4.5M16 8V4.5M6.5 8h11v3.5a5.5 5.5 0 0 1-11 0zM12 17v3"}),a.jsx("path",{d:"M5.5 4.5h5M13.5 4.5h5"})]})}function sNt(e){return a.jsxs("svg",{...Pd(e),children:[a.jsx("path",{d:"M12 3.5 19 6v5.2c0 4.3-2.7 7.6-7 9.3-4.3-1.7-7-5-7-9.3V6z"}),a.jsx("path",{d:"m8.8 12 2 2 4.4-4.4"})]})}function Gne(e){return a.jsx("svg",{...Pd(e),children:a.jsx("path",{d:"M14.8 6.2a4.1 4.1 0 0 0-5.6 5.6l-5.4 5.4a2 2 0 0 0 2.8 2.8l5.4-5.4a4.1 4.1 0 0 0 5.6-5.6l-2.5 2.5-2.6-.6-.6-2.6z"})})}function yq(e){return a.jsx("svg",{...Pd(e),children:a.jsx("path",{d:"m9 5 7 7-7 7"})})}function KLe(e){return a.jsx("svg",{...Pd(e),children:a.jsx("path",{d:"m5 12.5 4.5 4.5L19 7.5"})})}function aNt(e){return a.jsxs("svg",{...Pd(e),children:[a.jsx("circle",{cx:"12",cy:"12",r:"8.5"}),a.jsx("path",{d:"M12 7.5v5.25M12 16.25h.01"})]})}function oNt(e){return a.jsx("svg",{...Pd(e),children:a.jsx("path",{d:"M20 12a8 8 0 1 1-2.35-5.65"})})}function lNt(e){return a.jsxs("svg",{...Pd(e),children:[a.jsx("rect",{x:"8",y:"8",width:"11",height:"11",rx:"2"}),a.jsx("path",{d:"M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"})]})}const cNt={goal:Gne,command:tNt,read:WLe,search:nNt,"file-change":iNt,mcp:rNt,authorization:sNt,generic:Gne};function uNt(e){return e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(e<1e4?1:0)} s`}function GLe(e){if(e===void 0)return"";if(typeof e=="string"){const t=e.trim();if(t.startsWith("{")||t.startsWith("["))try{return JSON.stringify(JSON.parse(t),null,2)}catch{return e}return e}try{return JSON.stringify(e,null,2)}catch{return String(e)}}function dNt({status:e}){return e==="running"||e==="queued"?a.jsx(oNt,{className:"tool-activity__status-icon is-spinning"}):e==="failed"?a.jsx(aNt,{className:"tool-activity__status-icon"}):a.jsx(KLe,{className:"tool-activity__status-icon"})}function fNt({presentation:e,callId:t}){const{t:n}=_e("conversation"),[i,r]=p.useState(!1),[s,o]=p.useState(""),[l,c]=p.useState(!1),u=p.useRef(void 0);p.useEffect(()=>()=>window.clearTimeout(u.current),[]);const d=async(f,h)=>{window.clearTimeout(u.current);try{await navigator.clipboard.writeText(typeof h=="string"?h:GLe(h)),o(f),c(!1),u.current=window.setTimeout(()=>o(""),1500)}catch{o(""),c(!0),u.current=window.setTimeout(()=>c(!1),3e3)}};return e.rawArgs===void 0&&e.rawResponse===void 0&&!t?null:a.jsxs("div",{className:"tool-activity__raw",children:[a.jsxs("button",{type:"button",onClick:()=>r(f=>!f),"aria-expanded":i,children:[n("blocks.toolActivity.rawData"),a.jsx(yq,{className:i?"is-open":""})]}),i?a.jsxs("div",{className:"tool-activity__raw-body",children:[t?a.jsxs("div",{className:"tool-activity__raw-id",children:[a.jsx("span",{children:n("blocks.toolActivity.callId")}),a.jsx("code",{children:t}),a.jsx("button",{type:"button",onClick:()=>void d("id",t),"aria-label":n("blocks.toolActivity.copyCallId"),children:a.jsx(lNt,{})})]}):null,e.rawArgs!==void 0?a.jsx(Xne,{label:n("blocks.arguments"),value:e.rawArgs,preview:e.rawArgsPreview,copied:s==="input",onCopy:()=>void d("input",e.rawArgs)}):null,e.rawResponse!==void 0?a.jsx(Xne,{label:n("blocks.result"),value:e.rawResponse,preview:e.rawResponsePreview,copied:s==="result",onCopy:()=>void d("result",e.rawResponse)}):null,l?a.jsx("span",{className:"tool-activity__copy-error",role:"alert",children:n("blocks.toolActivity.copyFailed")}):null]}):null]})}function Xne({label:e,value:t,preview:n,copied:i,onCopy:r}){const{t:s}=_e("conversation");return a.jsxs("section",{className:"tool-activity__raw-section",children:[a.jsxs("div",{children:[a.jsx("span",{children:e}),a.jsx("button",{type:"button",onClick:r,children:s(i?"blocks.toolActivity.copied":"blocks.toolActivity.copy")})]}),a.jsxs("pre",{children:[(n==null?void 0:n.head.join(` +`))??GLe(t),n&&n.omittedCharacters>0?` ${s("blocks.toolActivity.omittedCharacters",{count:n.omittedCharacters})} ${n.tail.join(` `)}`:n&&n.omittedLines>0?` ${s("blocks.toolActivity.omittedLines",{count:n.omittedLines})} ${n.tail.join(` -`)}`:""]})]})}function fNt({presentation:e}){const{t}=_e("conversation"),n=e.output;return n?a.jsxs("pre",{className:"tool-activity__output",children:[n.head.join(` +`)}`:""]})]})}function hNt({presentation:e}){const{t}=_e("conversation"),n=e.output;return n?a.jsxs("pre",{className:"tool-activity__output",children:[n.head.join(` `),n.omittedCharacters>0?` `+t("blocks.toolActivity.omittedCharacters",{count:n.omittedCharacters})+` `+n.tail.join(` `):n.omittedLines>0?` ${t("blocks.toolActivity.omittedLines",{count:n.omittedLines})} ${n.tail.join(` -`)}`:""]}):null}function GLe({input:e,children:t}){const{t:n}=_e("conversation"),i=bq(e),[r,s]=p.useState(i.defaultOpen),o=p.useRef(!1);p.useEffect(()=>{o.current||s(i.defaultOpen)},[i.defaultOpen]);const l=lNt[i.category],c=i.title||n(`blocks.toolActivity.${i.titleKey}`,{...i.titleParams,defaultValue:e.name||n("blocks.toolActivity.generic.completed")}),u=[i.durationMs===void 0?"":cNt(i.durationMs),i.exitCode===void 0?"":n("blocks.toolActivity.exitCode",{code:i.exitCode})].filter(Boolean),d=!!(t||i.command||i.output||i.paths.length||i.rawArgs!==void 0||i.rawResponse!==void 0);return a.jsxs("section",{className:"tool-activity","data-status":i.status,"data-category":i.category,children:[a.jsxs("button",{className:"tool-activity__head",type:"button","aria-expanded":d?r:void 0,disabled:!d,onClick:()=>{o.current=!0,s(f=>!f)},children:[a.jsx("span",{className:"tool-activity__icon","aria-hidden":"true",children:a.jsx(l,{})}),a.jsx("span",{className:"tool-activity__status",role:"img","aria-label":n(`blocks.toolActivity.status.${i.status}`),children:a.jsx(uNt,{status:i.status})}),a.jsx("span",{className:"tool-activity__title",children:c}),i.summary?a.jsx("span",{className:"tool-activity__summary",children:i.summary}):null,u.length?a.jsx("span",{className:"tool-activity__metrics",children:u.join(" · ")}):null,d?a.jsx(yq,{className:`tool-activity__chevron${r?" is-open":""}`,"aria-hidden":"true"}):null]}),a.jsx("div",{className:`tool-activity__collapse${r&&d?" is-open":""}`,"aria-hidden":!r||!d,inert:!r||!d?!0:void 0,children:a.jsx("div",{className:"tool-activity__collapse-inner",children:a.jsxs("div",{className:"tool-activity__detail",children:[i.command?a.jsxs("code",{className:"tool-activity__command",children:["$ ",i.command]}):null,i.cwd?a.jsx("div",{className:"tool-activity__cwd",children:i.cwd}):null,i.paths.length?a.jsx("ul",{className:"tool-activity__paths",children:i.paths.map(f=>a.jsx("li",{children:f},f))}):null,a.jsx(fNt,{presentation:i}),t,a.jsx(dNt,{presentation:i,callId:e.callId})]})})})]})}function hNt({items:e}){const{t}=_e("conversation"),[n,i]=p.useState(!1);return a.jsxs("section",{className:"tool-activity tool-activity--exploration",children:[a.jsxs("button",{className:"tool-activity__head",type:"button","aria-expanded":n,onClick:()=>i(r=>!r),children:[a.jsx("span",{className:"tool-activity__icon","aria-hidden":"true",children:a.jsx(qLe,{})}),a.jsx("span",{className:"tool-activity__status",role:"img","aria-label":t("blocks.toolActivity.status.completed"),children:a.jsx(WLe,{className:"tool-activity__status-icon"})}),a.jsx("span",{className:"tool-activity__title",children:t("blocks.toolActivity.explored",{count:e.length})}),a.jsx("span",{className:"tool-activity__summary",children:e.map(r=>bq(r).summary).filter(Boolean).slice(0,2).join(", ")}),a.jsx(yq,{className:`tool-activity__chevron${n?" is-open":""}`,"aria-hidden":"true"})]}),a.jsx("div",{className:`tool-activity__collapse${n?" is-open":""}`,"aria-hidden":!n,inert:n?void 0:!0,children:a.jsx("div",{className:"tool-activity__collapse-inner",children:a.jsx("div",{className:"tool-activity__exploration-items",children:e.map((r,s)=>a.jsx(GLe,{input:r},r.callId||`${r.name}:${s}`))})})})]})}const XLe="send_a2ui_json_to_client",pNt=28,mNt=3e3;function gNt(e,t,n){let i=t;for(let r=0;r65535?2:1}return i}function bNt(e){return e<=4?1:Math.min(18,Math.max(2,Math.ceil(e/6)))}function YLe(e,t,n,i){const[r,s]=p.useState(()=>t?"":e),o=p.useRef(r),l=p.useRef(e),c=p.useRef(null),u=p.useRef(0),d=p.useRef(n);return l.current=e,d.current=n,p.useEffect(()=>{const f=o.current,h=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(!t||h||!e.startsWith(f)){c.current!==null&&window.cancelAnimationFrame(c.current),c.current=null,f!==e&&(o.current=e,s(e));return}if(f===e||c.current!==null)return;const m=g=>{const b=l.current,v=o.current;if(!b.startsWith(v)){o.current=b,s(b),c.current=null;return}if(g-u.current{var f;(f=d.current)==null||f.call(d)},[r]),p.useEffect(()=>{r===e&&(i==null||i())},[r,i,e]),p.useEffect(()=>()=>{c.current!==null&&(window.cancelAnimationFrame(c.current),c.current=null)},[]),r}function yNt(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M14.3 5.25a4.6 4.6 0 0 0-5.55 5.55L3.6 15.95a1.8 1.8 0 0 0 0 2.55l1.9 1.9a1.8 1.8 0 0 0 2.55 0l5.15-5.15a4.6 4.6 0 0 0 5.55-5.55l-2.9 2.9-2.45-.55-.55-2.45 2.9-2.9a4.6 4.6 0 0 0-1.45-1.45Z"})})}function vNt(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"m4.5 7 1.8 1.8L9.5 5.5"}),a.jsx("path",{d:"M12 7h7.5"}),a.jsx("path",{d:"m4.5 13 1.8 1.8 3.2-3.3"}),a.jsx("path",{d:"M12 13h7.5"}),a.jsx("path",{d:"M5 19h4"}),a.jsx("path",{d:"M12 19h7.5"})]})}function xNt(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M5 5v7.25A3.75 3.75 0 0 0 8.75 16H19"}),a.jsx("path",{d:"m15.5 12.5 3.5 3.5-3.5 3.5"})]})}function wNt({activity:e}){const{t}=_e("conversation"),n=[["Agent Session",e.agentSessionId],["Sandbox Session",e.sandboxSessionId],["Codex Thread",e.threadId]].filter(i=>!!i[1]);return n.length?a.jsx("dl",{className:"codex-sandbox-run__identity","aria-label":t("blocks.sandboxIdentity"),children:n.map(([i,r])=>a.jsxs("div",{children:[a.jsx("dt",{children:i}),a.jsx("dd",{title:r,children:r})]},i))}):null}function d9(e,t,n){if(e!=="load_skill"||t==null||typeof t!="object"||Array.isArray(t))return;const i=t.skill_name;if(!(typeof i!="string"||!i.trim()))return n("blocks.useSkill",{name:i.trim()})}function ZLe({text:e,done:t,thoughtKind:n="thought",answerStarted:i=!1,streaming:r=!1,onStreamFrame:s}){const{t:o}=_e("conversation"),[l,c]=p.useState(!(t||i)),u=p.useRef(!1);p.useEffect(()=>{u.current||c(!(t||i))},[i,t]);const d=()=>{u.current=!0,c(b=>!b)},f=e.replace(/\r\n?/g,` +`)}`:""]}):null}function XLe({input:e,children:t}){const{t:n}=_e("conversation"),i=bq(e),[r,s]=p.useState(i.defaultOpen),o=p.useRef(!1);p.useEffect(()=>{o.current||s(i.defaultOpen)},[i.defaultOpen]);const l=cNt[i.category],c=i.title||n(`blocks.toolActivity.${i.titleKey}`,{...i.titleParams,defaultValue:e.name||n("blocks.toolActivity.generic.completed")}),u=[i.durationMs===void 0?"":uNt(i.durationMs),i.exitCode===void 0?"":n("blocks.toolActivity.exitCode",{code:i.exitCode})].filter(Boolean),d=!!(t||i.command||i.output||i.paths.length||i.rawArgs!==void 0||i.rawResponse!==void 0);return a.jsxs("section",{className:"tool-activity","data-status":i.status,"data-category":i.category,children:[a.jsxs("button",{className:"tool-activity__head",type:"button","aria-expanded":d?r:void 0,disabled:!d,onClick:()=>{o.current=!0,s(f=>!f)},children:[a.jsx("span",{className:"tool-activity__icon","aria-hidden":"true",children:a.jsx(l,{})}),a.jsx("span",{className:"tool-activity__status",role:"img","aria-label":n(`blocks.toolActivity.status.${i.status}`),children:a.jsx(dNt,{status:i.status})}),a.jsx("span",{className:"tool-activity__title",children:c}),i.summary?a.jsx("span",{className:"tool-activity__summary",children:i.summary}):null,u.length?a.jsx("span",{className:"tool-activity__metrics",children:u.join(" · ")}):null,d?a.jsx(yq,{className:`tool-activity__chevron${r?" is-open":""}`,"aria-hidden":"true"}):null]}),a.jsx("div",{className:`tool-activity__collapse${r&&d?" is-open":""}`,"aria-hidden":!r||!d,inert:!r||!d?!0:void 0,children:a.jsx("div",{className:"tool-activity__collapse-inner",children:a.jsxs("div",{className:"tool-activity__detail",children:[i.command?a.jsxs("code",{className:"tool-activity__command",children:["$ ",i.command]}):null,i.cwd?a.jsx("div",{className:"tool-activity__cwd",children:i.cwd}):null,i.paths.length?a.jsx("ul",{className:"tool-activity__paths",children:i.paths.map(f=>a.jsx("li",{children:f},f))}):null,a.jsx(hNt,{presentation:i}),t,a.jsx(fNt,{presentation:i,callId:e.callId})]})})})]})}function pNt({items:e}){const{t}=_e("conversation"),[n,i]=p.useState(!1);return a.jsxs("section",{className:"tool-activity tool-activity--exploration",children:[a.jsxs("button",{className:"tool-activity__head",type:"button","aria-expanded":n,onClick:()=>i(r=>!r),children:[a.jsx("span",{className:"tool-activity__icon","aria-hidden":"true",children:a.jsx(WLe,{})}),a.jsx("span",{className:"tool-activity__status",role:"img","aria-label":t("blocks.toolActivity.status.completed"),children:a.jsx(KLe,{className:"tool-activity__status-icon"})}),a.jsx("span",{className:"tool-activity__title",children:t("blocks.toolActivity.explored",{count:e.length})}),a.jsx("span",{className:"tool-activity__summary",children:e.map(r=>bq(r).summary).filter(Boolean).slice(0,2).join(", ")}),a.jsx(yq,{className:`tool-activity__chevron${n?" is-open":""}`,"aria-hidden":"true"})]}),a.jsx("div",{className:`tool-activity__collapse${n?" is-open":""}`,"aria-hidden":!n,inert:n?void 0:!0,children:a.jsx("div",{className:"tool-activity__collapse-inner",children:a.jsx("div",{className:"tool-activity__exploration-items",children:e.map((r,s)=>a.jsx(XLe,{input:r},r.callId||`${r.name}:${s}`))})})})]})}const YLe="send_a2ui_json_to_client",mNt=28,gNt=3e3;function bNt(e,t,n){let i=t;for(let r=0;r65535?2:1}return i}function yNt(e){return e<=4?1:Math.min(18,Math.max(2,Math.ceil(e/6)))}function ZLe(e,t,n,i){const[r,s]=p.useState(()=>t?"":e),o=p.useRef(r),l=p.useRef(e),c=p.useRef(null),u=p.useRef(0),d=p.useRef(n);return l.current=e,d.current=n,p.useEffect(()=>{const f=o.current,h=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(!t||h||!e.startsWith(f)){c.current!==null&&window.cancelAnimationFrame(c.current),c.current=null,f!==e&&(o.current=e,s(e));return}if(f===e||c.current!==null)return;const m=g=>{const b=l.current,v=o.current;if(!b.startsWith(v)){o.current=b,s(b),c.current=null;return}if(g-u.current{var f;(f=d.current)==null||f.call(d)},[r]),p.useEffect(()=>{r===e&&(i==null||i())},[r,i,e]),p.useEffect(()=>()=>{c.current!==null&&(window.cancelAnimationFrame(c.current),c.current=null)},[]),r}function vNt(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M14.3 5.25a4.6 4.6 0 0 0-5.55 5.55L3.6 15.95a1.8 1.8 0 0 0 0 2.55l1.9 1.9a1.8 1.8 0 0 0 2.55 0l5.15-5.15a4.6 4.6 0 0 0 5.55-5.55l-2.9 2.9-2.45-.55-.55-2.45 2.9-2.9a4.6 4.6 0 0 0-1.45-1.45Z"})})}function xNt(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"m4.5 7 1.8 1.8L9.5 5.5"}),a.jsx("path",{d:"M12 7h7.5"}),a.jsx("path",{d:"m4.5 13 1.8 1.8 3.2-3.3"}),a.jsx("path",{d:"M12 13h7.5"}),a.jsx("path",{d:"M5 19h4"}),a.jsx("path",{d:"M12 19h7.5"})]})}function wNt(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M5 5v7.25A3.75 3.75 0 0 0 8.75 16H19"}),a.jsx("path",{d:"m15.5 12.5 3.5 3.5-3.5 3.5"})]})}function kNt({activity:e}){const{t}=_e("conversation"),n=[["Agent Session",e.agentSessionId],["Sandbox Session",e.sandboxSessionId],["Codex Thread",e.threadId]].filter(i=>!!i[1]);return n.length?a.jsx("dl",{className:"codex-sandbox-run__identity","aria-label":t("blocks.sandboxIdentity"),children:n.map(([i,r])=>a.jsxs("div",{children:[a.jsx("dt",{children:i}),a.jsx("dd",{title:r,children:r})]},i))}):null}function d9(e,t,n){if(e!=="load_skill"||t==null||typeof t!="object"||Array.isArray(t))return;const i=t.skill_name;if(!(typeof i!="string"||!i.trim()))return n("blocks.useSkill",{name:i.trim()})}function JLe({text:e,done:t,thoughtKind:n="thought",answerStarted:i=!1,streaming:r=!1,onStreamFrame:s}){const{t:o}=_e("conversation"),[l,c]=p.useState(!(t||i)),u=p.useRef(!1);p.useEffect(()=>{u.current||c(!(t||i))},[i,t]);const d=()=>{u.current=!0,c(b=>!b)},f=e.replace(/\r\n?/g,` `).trimStart().split(/\n{2,}/).map(b=>b.replace(/[^\S\n]*\n[^\S\n]*/g,(v,y,w)=>{const x=w[y-1]??"",k=w[y+v.length]??"";return!x||!k||new RegExp("\\p{Script=Han}","u").test(x)&&new RegExp("\\p{Script=Han}","u").test(k)||/[(\[{“‘/]/u.test(x)||/[),.\]},。!?;:、”’]/u.test(k)?"":" "})).join(` -`),h=YLe(f,!t||r,s),{ref:m,onScroll:g}=gLe(h);return a.jsxs("div",{className:"block-thinking",children:[a.jsxs("button",{className:"think-head",onClick:d,type:"button",children:[a.jsx("span",{className:"think-icon","aria-hidden":"true",children:a.jsx(uq,{className:`thinking-logo ${t?"":"is-active"}`})}),t?a.jsx("span",{className:"think-label think-label--done",children:o(n==="reasoning"?"blocks.reasoningDone":"blocks.thinkingDone")}):a.jsx(on,{className:"think-label",duration:2.4,spread:18,children:o(n==="reasoning"?"blocks.reasoning":"blocks.thinking")}),a.jsx(GA,{className:`chev ${l?"open":""}`})]}),a.jsx("div",{className:`think-collapse ${l&&h?"open":""}`,children:a.jsx("div",{className:"think-collapse-inner",children:a.jsx("div",{className:"think-body scroll",ref:m,onScroll:g,children:h})})})]})}function JLe({text:e}){return a.jsx("div",{className:"block-progress",role:"status","aria-live":"polite","aria-atomic":"true",children:a.jsxs("div",{className:"think-head progress-head",children:[a.jsx("span",{className:"think-icon","aria-hidden":"true",children:a.jsx(uq,{className:"thinking-logo is-active"})}),a.jsx(on,{className:"think-label",duration:2.4,spread:18,children:e})]})})}function kNt({value:e,onResolve:t,onResolveComparison:n,onDownload:i,onDeploy:r}){const{t:s,i18n:o}=_e("conversation"),l=N=>N.split(new RegExp("(?<=[/_-])")).map((P,I)=>a.jsxs(p.Fragment,{children:[P,a.jsx("wbr",{})]},`${I}:${P}`)),[c,u]=p.useState(e.files?e:null),[d,f]=p.useState(!1),[h,m]=p.useState(!1),[g,b]=p.useState(null),[v,y]=p.useState(null),[w,x]=p.useState(""),[k,S]=p.useState(null),O=new Date(e.validatedAt),A=e.validatedAt?Number.isNaN(O.getTime())?e.validatedAt:O.toLocaleString(o.resolvedLanguage??o.language,{hour12:!1}):s("blocks.justNow");p.useEffect(()=>{if(!k)return;const N=window.setTimeout(()=>S(null),mNt);return()=>window.clearTimeout(N)},[k]);async function E(){if(c)return c;if(!t)throw new Error(s("blocks.sourceUnavailable"));const N=await t(e);return u(N),N}async function j(){y("source"),x(""),S(null);try{await E(),f(!0)}catch(N){x(N instanceof Error?N.message:String(N))}finally{y(null)}}async function T(){if(i){y("download"),x(""),S(null);try{await i(e),S({message:s("blocks.downloadStarted")})}catch(N){x(N instanceof Error?N.message:String(N))}finally{y(null)}}}async function R(){if(n){y("compare"),x(""),S(null);try{const N=g??await n(e);b(N),m(!0)}catch(N){x(N instanceof Error?N.message:String(N))}finally{y(null)}}}async function C(){y("deploy"),x(""),S(null);try{r==null||r(await E())}catch(N){x(N instanceof Error?N.message:String(N))}finally{y(null)}}return a.jsxs(a.Fragment,{children:[a.jsxs("section",{className:`delivery-card${e.verified?" is-verified":" is-unverified"}`,"aria-label":e.verified?s("blocks.verifiedDelivery"):s("blocks.generatedSource"),children:[a.jsxs("header",{className:"delivery-card-header",children:[a.jsx("span",{className:"delivery-card-icon",children:e.verified?a.jsx(jjt,{}):a.jsx(_jt,{})}),a.jsxs("div",{className:"delivery-card-heading",children:[a.jsx("strong",{children:l(e.agentName)}),a.jsx("span",{children:e.verified?s("blocks.verifiedDelivery"):s("blocks.generatedSource")})]})]}),a.jsxs("dl",{className:"delivery-card-grid",children:[a.jsxs("div",{className:"delivery-card-entry",children:[a.jsx("dt",{children:s("blocks.entryPoint")}),a.jsx("dd",{children:a.jsx("code",{children:l(e.entryPoint)})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("blocks.fileCount")}),a.jsx("dd",{children:e.fileCount})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("blocks.size")}),a.jsxs("dd",{children:[(e.artifactSize/1024).toFixed(1)," KiB"]})]}),a.jsxs("div",{className:"delivery-card-time",children:[a.jsx("dt",{children:e.verified?s("blocks.validationTime"):s("blocks.generationTime")}),a.jsx("dd",{children:A})]})]}),a.jsxs("p",{className:"delivery-card-gates",children:[e.verified?s("blocks.checksPassed",{count:e.gateSummary.length}):s("blocks.sourceReady")," ","· ",a.jsx("code",{children:e.artifactSha256.slice(0,12)})]}),e.verified?null:a.jsx("p",{className:"delivery-card-guidance",children:s("blocks.sourceGuidance")}),a.jsxs("div",{className:"delivery-card-actions",children:[a.jsxs("div",{className:"delivery-card-secondary-actions",children:[a.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void j(),disabled:!t||v!==null,children:[v==="source"?a.jsx(Vi,{className:"spin","aria-hidden":"true"}):null,s("blocks.viewSource")]}),e.projectId&&e.versionId&&e.parentVersionId?a.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void R(),disabled:!n||v!==null,children:[v==="compare"?a.jsx(Vi,{className:"spin","aria-hidden":"true"}):null,s(v==="compare"?"blocks.preparing":"blocks.viewChanges")]}):null,a.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void T(),disabled:!i||v!==null,"aria-busy":v==="download",children:[v==="download"?a.jsx(Vi,{className:"spin","aria-hidden":"true"}):null,s(v==="download"?"blocks.preparing":"blocks.downloadSource")]})]}),a.jsxs("button",{type:"button",className:"delivery-card-primary",onClick:()=>void C(),disabled:!e.deployable||!r||!t||v!==null,title:e.deployable?s("blocks.manualDeploy"):s("blocks.sourceNotReady"),children:[v==="deploy"?a.jsx(Vi,{className:"spin","aria-hidden":"true"}):null,s("blocks.deployAgent")]})]}),w?a.jsx("p",{className:"delivery-card-error",role:"alert",children:w}):null,k?a.jsx("p",{className:"delivery-card-status",role:"status","aria-live":"polite",children:k.message}):null]}),a.jsx(c1,{project:{name:e.agentName,files:(c==null?void 0:c.files)??[]},open:d,onClose:()=>f(!1),onChange:()=>{},readOnly:!0}),a.jsx(c1,{project:{name:(g==null?void 0:g.target.agentName)??e.agentName,files:(g==null?void 0:g.target.files)??[]},comparison:g?{baseProject:{name:g.base.agentName,files:g.base.files??[]},baseLabel:s("blocks.beforeOptimization"),targetLabel:s("blocks.afterOptimization")}:void 0,open:h,onClose:()=>m(!1),onChange:()=>{},readOnly:!0})]})}function e5e({a2aStatus:e}){const{t}=_e("conversation");return e==="connecting"||e==="submitted"||e==="working"?a.jsx(JLe,{text:t(`blocks.a2a.${e}`)}):a.jsx(ZLe,{text:"",done:!1})}const ONt=p.memo(function({text:t,streaming:n,onStreamFrame:i,onStreamComplete:r}){const s=YLe(t,n,i,r);return s?a.jsx("div",{className:"bubble",children:a.jsx(Nd,{text:s,streaming:n})}):null});function SNt({title:e,summary:t,items:n,done:i}){const{t:r}=_e("conversation"),[s,o]=p.useState(!i),l=p.useRef(!1);p.useEffect(()=>{l.current||o(!i)},[i]);const c=()=>{l.current=!0,o(u=>!u)};return a.jsxs("div",{className:"block-plan",children:[a.jsxs("button",{className:"plan-head",type:"button",onClick:c,"aria-expanded":n.length>0?s:void 0,disabled:n.length===0,children:[a.jsx("span",{className:"plan-icon","aria-hidden":"true",children:a.jsx(vNt,{})}),i?a.jsx("span",{className:"plan-title",children:e}):a.jsx(on,{className:"plan-title",duration:2.2,spread:15,children:e}),t?a.jsx("span",{className:"plan-summary",children:t}):null,n.length>0?a.jsx(ck,{className:`plan-chevron${s?" is-open":""}`}):null]}),a.jsx("div",{className:`think-collapse ${s&&n.length>0?"open":""}`,children:a.jsx("div",{className:"think-collapse-inner",children:n.length>0?a.jsx("ol",{className:"plan-items",children:n.map((u,d)=>a.jsxs("li",{"data-status":u.status,children:[a.jsx("span",{className:"plan-item-marker","aria-hidden":"true"}),a.jsx("span",{className:"plan-item-text",children:u.text}),a.jsx("small",{children:r(`blocks.planStatuses.${u.status}`)})]},`${d}:${u.text}`))}):null})})]})}function ENt(e){if(!e||typeof e!="object")return[];const t=e,n=t.result;let i=[];if(Array.isArray(t.studio_artifacts))i=t.studio_artifacts;else if(n&&typeof n=="object"){const r=n.studio_artifacts;Array.isArray(r)&&(i=r)}return i.flatMap(r=>{if(!r||typeof r!="object")return[];const s=r;return typeof s.name=="string"&&typeof s.contentUrl=="string"?[{name:s.name,contentUrl:s.contentUrl}]:[]})}function CNt({name:e,callId:t,args:n,response:i,done:r,status:s,defaultOpen:o=!1,retrying:l=!1,codexActivity:c,native:u=!1,progressText:d,source:f,onBranchSelect:h,onAction:m}){const{t:g}=_e("conversation"),v=e==="create_agents"&&r&&Q_t(n,i)?"failed":s??(r?"completed":"running"),y=e==="create_agents"&&v==="failed"&&l,w=gq(e),x=w==null?void 0:w.detailRenderer,k=(w==null?void 0:w.hideHeader)===!0,S=k||o||!!x||!!c,[O,A]=p.useState(S),E=p.useRef(!1);p.useEffect(()=>{!E.current&&S&&A(!0)},[S]);const j=()=>{E.current=!0,A(P=>!P)},T=e===XLe?g("blocks.renderUi"):e,R=ENt(i);if((!w||!x)&&!c){const P=w?v==="failed"?g(`blocks.tools.${w.name}.failed`,{defaultValue:w.failedLabel??w.doneLabel}):v==="running"?g(`blocks.tools.${w.name}.running`,{defaultValue:w.runningLabel}):g(`blocks.tools.${w.name}.done`,{defaultValue:w.doneLabel}):void 0;return a.jsx(GLe,{input:{name:e,title:d9(e,n,g)??P,callId:t,args:n,response:i,done:r,status:v,defaultOpen:o,source:f},children:R.length>0?a.jsx("div",{className:"studio-tool-artifacts",children:R.map(I=>a.jsx("a",{href:I.contentUrl,download:I.name,children:g("blocks.downloadNamed",{name:I.name})},`${I.contentUrl}:${I.name}`))}):null})}const C=i==null?null:typeof i=="string"?i:JSON.stringify(i,null,2),N=!u&&C&&C.length>2e3?`${C.slice(0,2e3)} -${g("blocks.truncated")}`:C;return a.jsxs(_r.div,{className:`block-tool${w?" block-tool--builtin":""}`,"data-status":v,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[w&&!k?a.jsx(M_t,{definition:w,label:y?g("blocks.agentAdjusting"):v==="failed"?g(`blocks.tools.${w.name}.failed`,{defaultValue:w.failedLabel??w.doneLabel}):d9(e,n,g),done:r,open:O,onToggle:j}):w?null:a.jsxs("button",{className:"tool-head tool-head--generic",onClick:j,type:"button","aria-expanded":O,children:[a.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:u?a.jsx(NM,{kind:"tool"}):a.jsx(yNt,{})}),r?a.jsx("span",{className:"tool-name",children:T}):a.jsx(on,{className:"tool-name",duration:2.2,spread:15,children:T}),u&&v==="failed"&&a.jsx("span",{className:"development-tool-failure",children:a.jsx(Pw,{ns:"adk",i18nKey:"developmentRuns.toolFailed"})}),a.jsx(ck,{className:`tool-chevron${O?" is-open":""}`})]}),a.jsx("div",{className:`${k?"":"think-collapse "}${O?"open":""}`,children:a.jsxs("div",{className:"think-collapse-inner",children:[c?a.jsxs("section",{className:"codex-sandbox-run","aria-label":g("blocks.sandboxDetails"),children:[a.jsxs("div",{className:"codex-sandbox-run__label",children:[a.jsxs("span",{className:"codex-sandbox-run__badge",children:[a.jsx(xNt,{}),a.jsx("span",{children:"Codex Sandbox"})]}),a.jsx("span",{className:"codex-sandbox-run__title",children:c.title})]}),a.jsx(wNt,{activity:c}),a.jsx("div",{className:"codex-sandbox-run__stream",children:c.items.length>0?a.jsx(pv,{blocks:c.items.map(P=>P.block),streaming:!r,onAction:m}):a.jsx(on,{className:"codex-sandbox-run__empty",children:g("blocks.waitingCodex")})})]}):null,x?a.jsx(x,{args:n,response:i,status:v,onBranchSelect:h}):c?null:a.jsxs("div",{className:"tool-detail",children:[d&&a.jsx("div",{className:"development-tool-meta",children:d}),n!=null&&a.jsxs("div",{className:"tool-section",children:[a.jsx("div",{className:"tool-section-label",children:g("blocks.arguments")}),a.jsx("pre",{className:"tool-args",children:JSON.stringify(n,null,2)})]}),N!=null&&a.jsxs("div",{className:"tool-section",children:[a.jsx("div",{className:"tool-section-label",children:g("blocks.result")}),a.jsx("pre",{className:"tool-args tool-result",children:N})]}),R.length>0&&a.jsxs("div",{className:"tool-section",children:[a.jsx("div",{className:"tool-section-label",children:g("blocks.artifacts")}),a.jsx("div",{className:"studio-tool-artifacts",children:R.map(P=>a.jsx("a",{href:P.contentUrl,download:P.name,children:g("blocks.downloadNamed",{name:P.name})},`${P.contentUrl}:${P.name}`))})]})]})]})})]})}function ANt({block:e,onDownload:t,onPreview:n}){const{t:i}=_e("conversation"),[r,s]=p.useState(""),[o,l]=p.useState(""),[c,u]=p.useState(null);p.useEffect(()=>()=>{c&&URL.revokeObjectURL(c.url)},[c]);const d=()=>u(null),f=async(g,b)=>{if(t){s(`download:${g}`),l("");try{await t(g,b)}catch(v){l(v instanceof Error?v.message:String(v))}finally{s("")}}},h=async(g,b,v)=>{if(n){s(`preview:${v}`),l("");try{const y=await n(g,b);u({name:v,url:y})}catch(y){l(y instanceof Error?y.message:String(y))}finally{s("")}}},m=e.files.filter(g=>!g.filename.endsWith(".preview.webp"));return a.jsxs("div",{className:"artifact-list",children:[m.map(g=>{const b=`${g.filename.replace(/\.pptx$/i,"")}.preview.webp`,v=e.files.find(y=>y.filename===b);return a.jsxs("div",{className:"artifact-card",children:[a.jsx("span",{className:"artifact-card__icon","aria-hidden":"true",children:a.jsx(gV,{})}),a.jsxs("span",{className:"artifact-card__copy",children:[a.jsx("span",{className:"artifact-card__name",children:g.filename}),a.jsx("span",{className:"artifact-card__hint",children:i("blocks.powerpoint")})]}),a.jsxs("span",{className:"artifact-card__actions",children:[v&&a.jsxs("button",{className:"artifact-card__action",type:"button",disabled:!n||r!=="",onClick:()=>void h(v.filename,v.version,g.filename),children:[r===`preview:${g.filename}`?a.jsx(Vi,{className:"spin"}):a.jsx(Pat,{}),i("blocks.preview")]}),a.jsxs("button",{className:"artifact-card__action artifact-card__action--primary",type:"button",disabled:!t||r!=="",onClick:()=>void f(g.filename,g.version),children:[r===`download:${g.filename}`?a.jsx(Vi,{className:"spin"}):a.jsx(JD,{}),i("blocks.download")]})]})]},`${g.filename}:${g.version}`)}),o&&a.jsx("div",{className:"artifact-card__error",children:o}),c&&a.jsxs("div",{className:"artifact-preview",role:"dialog","aria-modal":"true","aria-label":i("blocks.previewDialog",{name:c.name}),children:[a.jsx("button",{className:"artifact-preview__backdrop",type:"button","aria-label":i("blocks.closePreview"),onClick:d}),a.jsxs("div",{className:"artifact-preview__panel",children:[a.jsxs("div",{className:"artifact-preview__header",children:[a.jsx("span",{children:c.name}),a.jsx("button",{type:"button","aria-label":i("blocks.closePreview"),onClick:d,children:a.jsx(Bo,{})})]}),a.jsx("div",{className:"artifact-preview__canvas",children:a.jsx("img",{src:c.url,alt:i("blocks.slidePreview",{name:c.name})})})]})]})]})}function TNt({block:e,onAuth:t}){const{t:n}=_e("conversation"),[i,r]=p.useState(e.done?"done":"idle"),[s,o]=p.useState(""),l=e.label||n("blocks.mcpToolset"),c=(()=>{try{return e.authUri?new URL(e.authUri).host:""}catch{return""}})(),u=async()=>{if(t){o(""),r("authorizing");try{await t(e),r("done")}catch(f){o(f instanceof Error?f.message:String(f)),r("idle")}}};return e.done||i==="done"?a.jsxs(_r.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[a.jsx(JJ,{className:"auth-card-icon auth-card-icon--done"}),a.jsx("span",{children:n("blocks.authorized",{tool:l})})]}):a.jsxs(_r.div,{className:"auth-card",initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[a.jsxs("div",{className:"auth-card-head",children:[a.jsx(JJ,{className:"auth-card-icon"}),a.jsx("span",{className:"auth-card-title",children:n("blocks.authorizationRequired",{tool:l})})]}),a.jsxs("p",{className:"auth-card-desc",children:[a.jsx(Pw,{t:n,i18nKey:"blocks.oauthDescription",values:{tool:l},components:{code:a.jsx("code",{className:"auth-card-code"})}}),c&&a.jsxs(a.Fragment,{children:[" ",a.jsx(Pw,{t:n,i18nKey:"blocks.oauthProvider",values:{provider:c},components:{code:a.jsx("code",{className:"auth-card-code"})}})," "]}),n("blocks.oauthContinue")]}),a.jsx("button",{className:"auth-card-btn",onClick:u,disabled:i==="authorizing"||!e.authUri,children:i==="authorizing"?a.jsxs(a.Fragment,{children:[a.jsx(Vi,{className:"cw-i spin"})," ",n("blocks.waitingAuthorization")]}):a.jsx(a.Fragment,{children:n("blocks.authorize")})}),!e.authUri&&a.jsx("div",{className:"auth-card-err",children:n("blocks.missingAuthorizationUrl")}),s&&a.jsx("div",{className:"auth-card-err",children:s})]})}function _Nt(e,t,n){const i=gq(e.name),r=d9(e.name,e.args,n);if(r||!i)return r;const s=t==="failed"?"failed":t==="running"?"running":"done",o=t==="failed"?i.failedLabel??i.doneLabel:t==="running"?i.runningLabel:i.doneLabel;return n(`blocks.tools.${i.name}.${s}`,{defaultValue:o})}function Yne(e,t){const n=e.status??(e.done?"completed":"running");return{name:e.name,title:t?_Nt(e,n,t):void 0,callId:e.callId,args:e.args,response:e.response,done:e.done,status:e.status,defaultOpen:e.defaultOpen,source:e.source}}function jNt(e,t){var s;const n=[];let i=[];const r=()=>{i.length&&(n.push(i.length>1?{kind:"tool-exploration",items:i.map(o=>Yne(o,t))}:i[0]),i=[])};for(const o of e){if(o.kind!=="tool"||(s=gq(o.name))!=null&&s.detailRenderer){r(),n.push(o);continue}const l=bq(Yne(o)),c=!i.length||i[i.length-1].source===o.source;if(Kne(l)&&c){i.push(o);continue}r(),Kne(l)?i.push(o):n.push(o)}return r(),n}function pv({groupProcess:e=!1,liveStatus:t,blocks:n,appName:i="",streaming:r=!1,onStreamFrame:s,onStreamComplete:o,onAction:l,onAuth:c,onArtifactDownload:u,onArtifactPreview:d,onResolveDelivery:f,onResolveDeliveryComparison:h,onDownloadDelivery:m,onDeployDelivery:g,onBranchSelect:b}){if(e)return a.jsx(S_t,{blocks:n,active:r,status:t,render:x=>a.jsx(pv,{blocks:x,appName:i,streaming:r,onStreamFrame:s,onStreamComplete:o,onAction:l,onAuth:c,onArtifactDownload:u,onArtifactPreview:d,onResolveDelivery:f,onResolveDeliveryComparison:h,onDownloadDelivery:m,onDeployDelivery:g,onBranchSelect:b})});const{t:v}=_e("conversation"),y=jNt(Eot(n),v),w=y.reduce((x,k,S)=>k.kind==="text"?S:x,-1);return a.jsx(a.Fragment,{children:y.map((x,k)=>{switch(x.kind){case"turn-summary":return a.jsx(k_t,{value:x.value},x.id||k);case"diff":return a.jsxs("details",{className:"development-diff",children:[a.jsxs("summary",{children:[a.jsx("span",{className:"tool-icon",children:a.jsx(NM,{kind:"diff"})}),a.jsx("span",{children:a.jsx(Pw,{ns:"adk",i18nKey:"developmentRuns.diff"})}),a.jsx(ck,{className:"tool-chevron"})]}),a.jsx("pre",{children:x.text})]},x.id??k);case"progress":return a.jsx(JLe,{text:x.text},"build-progress");case"activity-source":return a.jsx("div",{className:"tool-activity-source",children:x.label},`${k}:${x.label}`);case"tool-exploration":return a.jsx(hNt,{items:x.items},`exploration:${k}`);case"thinking":{const S=y.slice(k+1).some(O=>O.kind==="text"&&!!O.text.trim());return a.jsx(ZLe,{text:x.text,done:x.done,thoughtKind:x.thoughtKind,answerStarted:S,streaming:r,onStreamFrame:s},x.id??k)}case"text":{const S=x.text.replace(/^\s+/,"");return S?a.jsx(ONt,{text:S,streaming:r,onStreamFrame:s,onStreamComplete:k===w?o:void 0},x.id??k):null}case"plan":return a.jsx(SNt,{title:x.title,summary:x.summary,items:x.items,done:x.done},x.id??k);case"attachment":return a.jsx(IM,{appName:i,items:x.files},x.id??k);case"artifact":return a.jsx(ANt,{block:x,onDownload:u,onPreview:d},x.id??k);case"delivery":return a.jsx(kNt,{value:x.value,onResolve:f,onResolveComparison:h,onDownload:m,onDeploy:g},x.id??k);case"invocation":return a.jsx(RM,{value:x.value},x.id??k);case"tool":{if(x.name===XLe&&x.done)return null;const S=x.name==="create_agents"&&y.slice(k+1).some(O=>O.kind==="tool"&&O.name==="create_agents");return a.jsx(CNt,{name:x.itemType?K2e(x):x.name,callId:x.callId,native:!!x.itemType,progressText:x.progressText,args:x.args,response:x.response,done:x.done,status:x.status,defaultOpen:x.defaultOpen,retrying:x.name==="create_agents"&&(r||S),codexActivity:x.codexActivity,source:x.source,onBranchSelect:b,onAction:l},x.id??k)}case"agent-transfer":return null;case"auth":return a.jsx(TNt,{block:x,onAuth:c},x.id??k);case"a2ui":return mLe(x.messages).filter(S=>S.components[S.rootId]).map(S=>a.jsx(_r.div,{initial:{opacity:0,y:8,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:380,damping:30},children:a.jsx(I_t,{surface:S,onAction:l})},`${k}-${S.surfaceId}`));default:return null}})})}const NNt=()=>{};function RNt(e){if(e.kind==="message")return{kind:"text",text:e.text};if(e.kind==="thinking")return{kind:"thinking",text:e.text,done:e.status==="done"};if(e.kind==="tool")return{kind:"tool",name:e.name,args:e.args,response:e.response,done:e.status==="done"};throw new Error(en("conversation.unsupportedActivity"))}function INt({activities:e}){const{t}=_e("skills"),n=p.useMemo(()=>e.filter(i=>i.kind!=="status").map(RNt),[e]);return n.length===0?null:a.jsx("div",{className:"skill-conversation","aria-label":t("conversation.ariaLabel"),"aria-live":"polite",children:a.jsx(pv,{blocks:n,onAction:NNt})})}function Zne(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m7 9 5 5 5-5",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}function RN({label:e,value:t,options:n,onChange:i,disabled:r=!1,allowCustom:s=!1,required:o=!1,placeholder:l,error:c}){const{t:u}=_e("skills"),d=l??u("configSelect.placeholder"),f=p.useId(),h=p.useId(),m=p.useId(),g=p.useRef(null),b=p.useRef(null),v=p.useRef(null),y=p.useRef(null),w=p.useRef([]),x=n.findIndex(I=>I.value===t),k=t.trim().toLocaleLowerCase(),S=s&&k?n.filter(I=>I.value.toLocaleLowerCase().includes(k)||I.label.toLocaleLowerCase().includes(k)):n,[O,A]=p.useState(!1),[E,j]=p.useState(Math.max(0,x)),T=x>=0?n[x]:void 0,R=r||!s&&n.length===0,C=(I=!1)=>{A(!1),I&&window.requestAnimationFrame(()=>{var D,_;return s?(D=v.current)==null?void 0:D.focus():(_=b.current)==null?void 0:_.focus()})},N=I=>{R||S.length!==0&&(j(Math.min(Math.max(I,0),S.length-1)),A(!0))};p.useEffect(()=>{if(!O)return;const I=y.current,D=s?void 0:window.requestAnimationFrame(()=>{var M;(M=w.current[E])==null||M.focus()}),_=M=>{if(!I)return;const H=I.scrollTop<=0,q=I.scrollTop+I.clientHeight>=I.scrollHeight-1;(I.scrollHeight<=I.clientHeight||M.deltaY<0&&H||M.deltaY>0&&q)&&M.preventDefault(),M.stopPropagation()},L=M=>{var H;M.target instanceof Node&&!((H=g.current)!=null&&H.contains(M.target))&&C()},F=M=>{M.key==="Escape"&&C(!0)};return I==null||I.addEventListener("wheel",_,{passive:!1}),window.addEventListener("pointerdown",L),window.addEventListener("keydown",F),()=>{D!==void 0&&window.cancelAnimationFrame(D),I==null||I.removeEventListener("wheel",_),window.removeEventListener("pointerdown",L),window.removeEventListener("keydown",F)}},[E,s,O]);const P=I=>{var _;if(S.length===0)return;const D=(I+S.length)%S.length;j(D),(_=w.current[D])==null||_.focus()};return a.jsxs("div",{ref:g,className:`skill-config-select${O?" is-open":""}`,onBlur:I=>{var D;(!I.relatedTarget||!((D=g.current)!=null&&D.contains(I.relatedTarget)))&&C()},children:[a.jsxs("span",{id:h,className:"skill-config-select__label",children:[e,o?a.jsx("span",{className:"skill-required-mark","aria-hidden":"true",children:"*"}):null]}),s?a.jsxs("div",{className:`skill-config-select__trigger is-editable${r?" is-disabled":""}`,"aria-expanded":O,children:[a.jsx("input",{ref:v,value:t,disabled:r,role:"combobox","aria-autocomplete":"list","aria-expanded":O,"aria-controls":O?f:void 0,"aria-labelledby":h,"aria-required":o,"aria-invalid":!!c,"aria-describedby":c?m:void 0,placeholder:d,onChange:I=>{i(I.target.value),j(0),n.length>0&&A(!0)},onClick:()=>{!O&&S.length>0&&N(0)},onKeyDown:I=>{var D,_;if(!(I.nativeEvent.isComposing||I.keyCode===229))if(I.key==="ArrowDown")I.preventDefault(),O?(D=w.current[E])==null||D.focus():N(0);else if(I.key==="ArrowUp")I.preventDefault(),O?(_=w.current[S.length-1])==null||_.focus():N(S.length-1);else if(I.key==="Enter"&&O){I.preventDefault();const L=S[E];L&&i(L.value),C()}else I.key==="Escape"&&(I.preventDefault(),C())}}),a.jsx("button",{type:"button",className:"skill-config-select__toggle",disabled:r||n.length===0,"aria-label":u(O?"configSelect.collapseOptions":"configSelect.expandOptions"),onClick:()=>{O?C():N(0)},children:a.jsx(Zne,{})})]}):a.jsxs("button",{ref:b,type:"button",className:"skill-config-select__trigger",disabled:R,"aria-haspopup":"listbox","aria-expanded":O,"aria-controls":O?f:void 0,"aria-labelledby":h,"aria-required":o,onClick:()=>{O?C():N(x>=0?x:0)},onKeyDown:I=>{I.key==="ArrowDown"?(I.preventDefault(),N(x>=0?x:0)):I.key==="ArrowUp"&&(I.preventDefault(),N(x>=0?x:n.length-1))},children:[a.jsx("span",{className:T?void 0:"is-placeholder",title:T==null?void 0:T.label,children:(T==null?void 0:T.label)||(n.length===0?u("configSelect.noOptions"):d)}),a.jsx(Zne,{})]}),O?a.jsxs("div",{ref:y,id:f,className:"skill-config-select__menu",role:"listbox","aria-labelledby":h,children:[S.length===0?a.jsx("div",{className:"skill-config-select__empty",role:"status",children:u("configSelect.noMatches")}):null,S.map((I,D)=>{const _=I.value===t;return a.jsx("button",{ref:L=>{w.current[D]=L},type:"button",role:"option","aria-selected":_,tabIndex:D===E?0:-1,className:`skill-config-select__option${_?" is-selected":""}`,title:I.label,onFocus:()=>j(D),onClick:()=>{i(I.value),C(!0)},onKeyDown:L=>{L.key==="Enter"||L.key===" "?(L.preventDefault(),i(I.value),C(!0)):L.key==="ArrowDown"?(L.preventDefault(),P(D+1)):L.key==="ArrowUp"?(L.preventDefault(),P(D-1)):L.key==="Home"?(L.preventDefault(),P(0)):L.key==="End"&&(L.preventDefault(),P(n.length-1))},children:I.label},I.value)})]}):null,c?a.jsx("span",{id:m,className:"skill-config-select__error",role:"alert",children:c}):null]})}function Lr(e,t){return e instanceof Error?e:typeof e=="string"&&e.trim()?new Error(e.trim()):new Error(t)}function Rs({error:e}){var s,o,l,c,u;const{t}=_e("skills"),n=e,i=(o=(s=n.originalError)==null?void 0:s.message)==null?void 0:o.trim(),r=[typeof n.status=="number"?`HTTP ${n.status}${n.statusText?` ${n.statusText}`:""}`:"",n.code?t("errorDetails.code",{code:n.code}):"",(l=n.originalError)!=null&&l.type?t("errorDetails.type",{type:n.originalError.type}):"",(c=n.originalError)!=null&&c.repr&&n.originalError.repr!==i?t("errorDetails.representation",{value:n.originalError.repr}):"",(u=n.rawResponse)!=null&&u.trim()?t("errorDetails.rawResponse",{value:n.rawResponse.trim()}):""].filter(Boolean);return a.jsxs("div",{className:"skill-error-details",children:[a.jsx("div",{className:"skill-error-details__summary",children:e.message}),i?a.jsx("div",{className:"skill-error-details__original",children:t("errorDetails.original",{message:i})}):null,r.length>0?a.jsxs("details",{children:[a.jsx("summary",{children:t("errorDetails.details")}),a.jsx("pre",{children:r.join(` -`)})]}):null]})}const vq=Symbol.for("yaml.alias"),f9=Symbol.for("yaml.document"),Mg=Symbol.for("yaml.map"),t5e=Symbol.for("yaml.pair"),Th=Symbol.for("yaml.scalar"),uk=Symbol.for("yaml.seq"),Rd=Symbol.for("yaml.node.type"),dk=e=>!!e&&typeof e=="object"&&e[Rd]===vq,ET=e=>!!e&&typeof e=="object"&&e[Rd]===f9,CT=e=>!!e&&typeof e=="object"&&e[Rd]===Mg,Ia=e=>!!e&&typeof e=="object"&&e[Rd]===t5e,Ss=e=>!!e&&typeof e=="object"&&e[Rd]===Th,AT=e=>!!e&&typeof e=="object"&&e[Rd]===uk;function _a(e){if(e&&typeof e=="object")switch(e[Rd]){case Mg:case uk:return!0}return!1}function Ra(e){if(e&&typeof e=="object")switch(e[Rd]){case vq:case Mg:case Th:case uk:return!0}return!1}const n5e=e=>(Ss(e)||_a(e))&&!!e.anchor,fy=Symbol("break visit"),PNt=Symbol("skip children"),vE=Symbol("remove node");function fk(e,t){const n=DNt(t);ET(e)?$x(null,e.contents,n,Object.freeze([e]))===vE&&(e.contents=null):$x(null,e,n,Object.freeze([]))}fk.BREAK=fy;fk.SKIP=PNt;fk.REMOVE=vE;function $x(e,t,n,i){const r=MNt(e,t,n,i);if(Ra(r)||Ia(r))return LNt(e,i,r),$x(e,r,n,i);if(typeof r!="symbol"){if(_a(t)){i=Object.freeze(i.concat(t));for(let s=0;se.replace(/[!,[\]{}]/g,t=>$Nt[t]);class Wl{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Wl.defaultYaml,t),this.tags=Object.assign({},Wl.defaultTags,n)}clone(){const t=new Wl(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Wl(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Wl.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Wl.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Wl.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Wl.defaultTags),this.atNextDocument=!1);const i=t.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;const[s,o]=i;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[s]=i;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{const o=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,o),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const o=t.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,i,r]=t.match(/^(.*!)([^!]*)$/s);r||n(`The ${t} tag has no suffix`);const s=this.tags[i];if(s)try{return s+decodeURIComponent(r)}catch(o){return n(String(o)),null}return i==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,i]of Object.entries(this.tags))if(t.startsWith(i))return n+FNt(t.substring(i.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags);let r;if(t&&i.length>0&&Ra(t.contents)){const s={};fk(t.contents,(o,l)=>{Ra(l)&&l.tag&&(s[l.tag]=!0)}),r=Object.keys(s)}else r=[];for(const[s,o]of i)s==="!!"&&o==="tag:yaml.org,2002:"||(!t||r.some(l=>l.startsWith(o)))&&n.push(`%TAG ${s} ${o}`);return n.join(` -`)}}Wl.defaultYaml={explicit:!1,version:"1.2"};Wl.defaultTags={"!!":"tag:yaml.org,2002:"};function i5e(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function r5e(e){const t=new Set;return fk(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function s5e(e,t){for(let n=1;;++n){const i=`${e}${n}`;if(!t.has(i))return i}}function BNt(e,t){const n=[],i=new Map;let r=null;return{onAnchor:s=>{n.push(s),r??(r=r5e(e));const o=s5e(t,r);return r.add(o),o},setAnchors:()=>{for(const s of n){const o=i.get(s);if(typeof o=="object"&&o.anchor&&(Ss(o.node)||_a(o.node)))o.node.anchor=o.anchor;else{const l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},sourceObjects:i}}function Fx(e,t,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,s=i.length;rCd(i,String(r),n));if(e&&typeof e.toJSON=="function"){if(!n||!n5e(e))return e.toJSON(t,n);const i={aliasCount:0,count:1,res:void 0};n.anchors.set(e,i),n.onCreate=s=>{i.res=s,delete n.onCreate};const r=e.toJSON(t,n);return n.onCreate&&n.onCreate(r),r}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class xq{constructor(t){Object.defineProperty(this,Rd,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:s}={}){if(!ET(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=Cd(this,"",o);if(typeof r=="function")for(const{count:c,res:u}of o.anchors.values())r(u,c);return typeof s=="function"?Fx(s,{"":l},"",l):l}}let wq=class extends xq{constructor(t){super(vq),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if((n==null?void 0:n.maxAliasCount)===0)throw new ReferenceError("Alias resolution is disabled");let i;n!=null&&n.aliasResolveCache?i=n.aliasResolveCache:(i=[],fk(t,{Node:(s,o)=>{(dk(o)||n5e(o))&&i.push(o)}}),n&&(n.aliasResolveCache=i));let r;for(const s of i){if(s===this)break;s.anchor===this.source&&(r=s)}return r}toJSON(t,n){if(!n)return{source:this.source};const{anchors:i,doc:r,maxAliasCount:s}=n,o=this.resolve(r,n);if(!o){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let l=i.get(o);if(l||(Cd(o,null,n),l=i.get(o)),(l==null?void 0:l.res)===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(s>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=IN(r,o,i)),l.count*l.aliasCount>s)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return l.res}toString(t,n,i){const r=`*${this.source}`;if(t){if(i5e(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(t.implicitKey)return`${r} `}return r}};function IN(e,t,n){if(dk(t)){const i=t.resolve(e),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(_a(t)){let i=0;for(const r of t.items){const s=IN(e,r,n);s>i&&(i=s)}return i}else if(Ia(t)){const i=IN(e,t.key,n),r=IN(e,t.value,n);return Math.max(i,r)}return 1}const a5e=e=>!e||typeof e!="function"&&typeof e!="object";class Oi extends xq{constructor(t){super(Th),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:Cd(this.value,t,n)}toString(){return String(this.value)}}Oi.BLOCK_FOLDED="BLOCK_FOLDED";Oi.BLOCK_LITERAL="BLOCK_LITERAL";Oi.PLAIN="PLAIN";Oi.QUOTE_DOUBLE="QUOTE_DOUBLE";Oi.QUOTE_SINGLE="QUOTE_SINGLE";const UNt="tag:yaml.org,2002:";function QNt(e,t,n){if(t){const i=n.filter(s=>s.tag===t),r=i.find(s=>!s.format)??i[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find(i=>{var r;return((r=i.identify)==null?void 0:r.call(i,e))&&!i.format})}function RC(e,t,n){var f,h,m;if(ET(e)&&(e=e.contents),Ra(e))return e;if(Ia(e)){const g=(h=(f=n.schema[Mg]).createNode)==null?void 0:h.call(f,n.schema,null,n);return g.items.push(e),g}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:i,onAnchor:r,onTagObj:s,schema:o,sourceObjects:l}=n;let c;if(i&&e&&typeof e=="object"){if(c=l.get(e),c)return c.anchor??(c.anchor=r(e)),new wq(c.anchor);c={anchor:null,node:null},l.set(e,c)}t!=null&&t.startsWith("!!")&&(t=UNt+t.slice(2));let u=QNt(e,t,o.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const g=new Oi(e);return c&&(c.node=g),g}u=e instanceof Map?o[Mg]:Symbol.iterator in Object(e)?o[uk]:o[Mg]}s&&(s(u),delete n.onTagObj);const d=u!=null&&u.createNode?u.createNode(n.schema,e,n):typeof((m=u==null?void 0:u.nodeClass)==null?void 0:m.from)=="function"?u.nodeClass.from(n.schema,e,n):new Oi(e);return t?d.tag=t:u.default||(d.tag=u.tag),c&&(c.node=d),d}function DI(e,t,n){let i=n;for(let r=t.length-1;r>=0;--r){const s=t[r];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){const o=[];o[s]=i,i=o}else i=new Map([[s,i]])}return RC(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const yS=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class o5e extends xq{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(i=>Ra(i)||Ia(i)?i.clone(t):i),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(yS(t))this.add(n);else{const[i,...r]=t,s=this.get(i,!0);if(_a(s))s.addIn(r,n);else if(s===void 0&&this.schema)this.set(i,DI(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(t){const[n,...i]=t;if(i.length===0)return this.delete(n);const r=this.get(n,!0);if(_a(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(t,n){const[i,...r]=t,s=this.get(i,!0);return r.length===0?!n&&Ss(s)?s.value:s:_a(s)?s.getIn(r,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Ia(n))return!1;const i=n.value;return i==null||t&&Ss(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(t){const[n,...i]=t;if(i.length===0)return this.has(n);const r=this.get(n,!0);return _a(r)?r.hasIn(i):!1}setIn(t,n){const[i,...r]=t;if(r.length===0)this.set(i,n);else{const s=this.get(i,!0);if(_a(s))s.setIn(r,n);else if(s===void 0&&this.schema)this.set(i,DI(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}}const zNt=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Ap(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Ty=(e,t,n)=>e.endsWith(` +`),h=ZLe(f,!t||r,s),{ref:m,onScroll:g}=bLe(h);return a.jsxs("div",{className:"block-thinking",children:[a.jsxs("button",{className:"think-head",onClick:d,type:"button",children:[a.jsx("span",{className:"think-icon","aria-hidden":"true",children:a.jsx(uq,{className:`thinking-logo ${t?"":"is-active"}`})}),t?a.jsx("span",{className:"think-label think-label--done",children:o(n==="reasoning"?"blocks.reasoningDone":"blocks.thinkingDone")}):a.jsx(on,{className:"think-label",duration:2.4,spread:18,children:o(n==="reasoning"?"blocks.reasoning":"blocks.thinking")}),a.jsx(GA,{className:`chev ${l?"open":""}`})]}),a.jsx("div",{className:`think-collapse ${l&&h?"open":""}`,children:a.jsx("div",{className:"think-collapse-inner",children:a.jsx("div",{className:"think-body scroll",ref:m,onScroll:g,children:h})})})]})}function e5e({text:e}){return a.jsx("div",{className:"block-progress",role:"status","aria-live":"polite","aria-atomic":"true",children:a.jsxs("div",{className:"think-head progress-head",children:[a.jsx("span",{className:"think-icon","aria-hidden":"true",children:a.jsx(uq,{className:"thinking-logo is-active"})}),a.jsx(on,{className:"think-label",duration:2.4,spread:18,children:e})]})})}function ONt({value:e,onResolve:t,onResolveComparison:n,onDownload:i,onDeploy:r}){const{t:s,i18n:o}=_e("conversation"),l=N=>N.split(new RegExp("(?<=[/_-])")).map((P,I)=>a.jsxs(p.Fragment,{children:[P,a.jsx("wbr",{})]},`${I}:${P}`)),[c,u]=p.useState(e.files?e:null),[d,f]=p.useState(!1),[h,m]=p.useState(!1),[g,b]=p.useState(null),[v,y]=p.useState(null),[w,x]=p.useState(""),[k,S]=p.useState(null),O=new Date(e.validatedAt),A=e.validatedAt?Number.isNaN(O.getTime())?e.validatedAt:O.toLocaleString(o.resolvedLanguage??o.language,{hour12:!1}):s("blocks.justNow");p.useEffect(()=>{if(!k)return;const N=window.setTimeout(()=>S(null),gNt);return()=>window.clearTimeout(N)},[k]);async function E(){if(c)return c;if(!t)throw new Error(s("blocks.sourceUnavailable"));const N=await t(e);return u(N),N}async function j(){y("source"),x(""),S(null);try{await E(),f(!0)}catch(N){x(N instanceof Error?N.message:String(N))}finally{y(null)}}async function T(){if(i){y("download"),x(""),S(null);try{await i(e),S({message:s("blocks.downloadStarted")})}catch(N){x(N instanceof Error?N.message:String(N))}finally{y(null)}}}async function R(){if(n){y("compare"),x(""),S(null);try{const N=g??await n(e);b(N),m(!0)}catch(N){x(N instanceof Error?N.message:String(N))}finally{y(null)}}}async function C(){y("deploy"),x(""),S(null);try{r==null||r(await E())}catch(N){x(N instanceof Error?N.message:String(N))}finally{y(null)}}return a.jsxs(a.Fragment,{children:[a.jsxs("section",{className:`delivery-card${e.verified?" is-verified":" is-unverified"}`,"aria-label":e.verified?s("blocks.verifiedDelivery"):s("blocks.generatedSource"),children:[a.jsxs("header",{className:"delivery-card-header",children:[a.jsx("span",{className:"delivery-card-icon",children:e.verified?a.jsx(Njt,{}):a.jsx(jjt,{})}),a.jsxs("div",{className:"delivery-card-heading",children:[a.jsx("strong",{children:l(e.agentName)}),a.jsx("span",{children:e.verified?s("blocks.verifiedDelivery"):s("blocks.generatedSource")})]})]}),a.jsxs("dl",{className:"delivery-card-grid",children:[a.jsxs("div",{className:"delivery-card-entry",children:[a.jsx("dt",{children:s("blocks.entryPoint")}),a.jsx("dd",{children:a.jsx("code",{children:l(e.entryPoint)})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("blocks.fileCount")}),a.jsx("dd",{children:e.fileCount})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("blocks.size")}),a.jsxs("dd",{children:[(e.artifactSize/1024).toFixed(1)," KiB"]})]}),a.jsxs("div",{className:"delivery-card-time",children:[a.jsx("dt",{children:e.verified?s("blocks.validationTime"):s("blocks.generationTime")}),a.jsx("dd",{children:A})]})]}),a.jsxs("p",{className:"delivery-card-gates",children:[e.verified?s("blocks.checksPassed",{count:e.gateSummary.length}):s("blocks.sourceReady")," ","· ",a.jsx("code",{children:e.artifactSha256.slice(0,12)})]}),e.verified?null:a.jsx("p",{className:"delivery-card-guidance",children:s("blocks.sourceGuidance")}),a.jsxs("div",{className:"delivery-card-actions",children:[a.jsxs("div",{className:"delivery-card-secondary-actions",children:[a.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void j(),disabled:!t||v!==null,children:[v==="source"?a.jsx(Vi,{className:"spin","aria-hidden":"true"}):null,s("blocks.viewSource")]}),e.projectId&&e.versionId&&e.parentVersionId?a.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void R(),disabled:!n||v!==null,children:[v==="compare"?a.jsx(Vi,{className:"spin","aria-hidden":"true"}):null,s(v==="compare"?"blocks.preparing":"blocks.viewChanges")]}):null,a.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void T(),disabled:!i||v!==null,"aria-busy":v==="download",children:[v==="download"?a.jsx(Vi,{className:"spin","aria-hidden":"true"}):null,s(v==="download"?"blocks.preparing":"blocks.downloadSource")]})]}),a.jsxs("button",{type:"button",className:"delivery-card-primary",onClick:()=>void C(),disabled:!e.deployable||!r||!t||v!==null,title:e.deployable?s("blocks.manualDeploy"):s("blocks.sourceNotReady"),children:[v==="deploy"?a.jsx(Vi,{className:"spin","aria-hidden":"true"}):null,s("blocks.deployAgent")]})]}),w?a.jsx("p",{className:"delivery-card-error",role:"alert",children:w}):null,k?a.jsx("p",{className:"delivery-card-status",role:"status","aria-live":"polite",children:k.message}):null]}),a.jsx(c1,{project:{name:e.agentName,files:(c==null?void 0:c.files)??[]},open:d,onClose:()=>f(!1),onChange:()=>{},readOnly:!0}),a.jsx(c1,{project:{name:(g==null?void 0:g.target.agentName)??e.agentName,files:(g==null?void 0:g.target.files)??[]},comparison:g?{baseProject:{name:g.base.agentName,files:g.base.files??[]},baseLabel:s("blocks.beforeOptimization"),targetLabel:s("blocks.afterOptimization")}:void 0,open:h,onClose:()=>m(!1),onChange:()=>{},readOnly:!0})]})}function t5e({a2aStatus:e}){const{t}=_e("conversation");return e==="connecting"||e==="submitted"||e==="working"?a.jsx(e5e,{text:t(`blocks.a2a.${e}`)}):a.jsx(JLe,{text:"",done:!1})}const SNt=p.memo(function({text:t,streaming:n,onStreamFrame:i,onStreamComplete:r}){const s=ZLe(t,n,i,r);return s?a.jsx("div",{className:"bubble",children:a.jsx(Nd,{text:s,streaming:n})}):null});function ENt({title:e,summary:t,items:n,done:i}){const{t:r}=_e("conversation"),[s,o]=p.useState(!i),l=p.useRef(!1);p.useEffect(()=>{l.current||o(!i)},[i]);const c=()=>{l.current=!0,o(u=>!u)};return a.jsxs("div",{className:"block-plan",children:[a.jsxs("button",{className:"plan-head",type:"button",onClick:c,"aria-expanded":n.length>0?s:void 0,disabled:n.length===0,children:[a.jsx("span",{className:"plan-icon","aria-hidden":"true",children:a.jsx(xNt,{})}),i?a.jsx("span",{className:"plan-title",children:e}):a.jsx(on,{className:"plan-title",duration:2.2,spread:15,children:e}),t?a.jsx("span",{className:"plan-summary",children:t}):null,n.length>0?a.jsx(ck,{className:`plan-chevron${s?" is-open":""}`}):null]}),a.jsx("div",{className:`think-collapse ${s&&n.length>0?"open":""}`,children:a.jsx("div",{className:"think-collapse-inner",children:n.length>0?a.jsx("ol",{className:"plan-items",children:n.map((u,d)=>a.jsxs("li",{"data-status":u.status,children:[a.jsx("span",{className:"plan-item-marker","aria-hidden":"true"}),a.jsx("span",{className:"plan-item-text",children:u.text}),a.jsx("small",{children:r(`blocks.planStatuses.${u.status}`)})]},`${d}:${u.text}`))}):null})})]})}function CNt(e){if(!e||typeof e!="object")return[];const t=e,n=t.result;let i=[];if(Array.isArray(t.studio_artifacts))i=t.studio_artifacts;else if(n&&typeof n=="object"){const r=n.studio_artifacts;Array.isArray(r)&&(i=r)}return i.flatMap(r=>{if(!r||typeof r!="object")return[];const s=r;return typeof s.name=="string"&&typeof s.contentUrl=="string"?[{name:s.name,contentUrl:s.contentUrl}]:[]})}function ANt({name:e,callId:t,args:n,response:i,done:r,status:s,defaultOpen:o=!1,retrying:l=!1,codexActivity:c,native:u=!1,progressText:d,source:f,onBranchSelect:h,onAction:m}){const{t:g}=_e("conversation"),v=e==="create_agents"&&r&&z_t(n,i)?"failed":s??(r?"completed":"running"),y=e==="create_agents"&&v==="failed"&&l,w=gq(e),x=w==null?void 0:w.detailRenderer,k=(w==null?void 0:w.hideHeader)===!0,S=k||o||!!x||!!c,[O,A]=p.useState(S),E=p.useRef(!1);p.useEffect(()=>{!E.current&&S&&A(!0)},[S]);const j=()=>{E.current=!0,A(P=>!P)},T=e===YLe?g("blocks.renderUi"):e,R=CNt(i);if((!w||!x)&&!c){const P=w?v==="failed"?g(`blocks.tools.${w.name}.failed`,{defaultValue:w.failedLabel??w.doneLabel}):v==="running"?g(`blocks.tools.${w.name}.running`,{defaultValue:w.runningLabel}):g(`blocks.tools.${w.name}.done`,{defaultValue:w.doneLabel}):void 0;return a.jsx(XLe,{input:{name:e,title:d9(e,n,g)??P,callId:t,args:n,response:i,done:r,status:v,defaultOpen:o,source:f},children:R.length>0?a.jsx("div",{className:"studio-tool-artifacts",children:R.map(I=>a.jsx("a",{href:I.contentUrl,download:I.name,children:g("blocks.downloadNamed",{name:I.name})},`${I.contentUrl}:${I.name}`))}):null})}const C=i==null?null:typeof i=="string"?i:JSON.stringify(i,null,2),N=!u&&C&&C.length>2e3?`${C.slice(0,2e3)} +${g("blocks.truncated")}`:C;return a.jsxs(_r.div,{className:`block-tool${w?" block-tool--builtin":""}`,"data-status":v,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[w&&!k?a.jsx(L_t,{definition:w,label:y?g("blocks.agentAdjusting"):v==="failed"?g(`blocks.tools.${w.name}.failed`,{defaultValue:w.failedLabel??w.doneLabel}):d9(e,n,g),done:r,open:O,onToggle:j}):w?null:a.jsxs("button",{className:"tool-head tool-head--generic",onClick:j,type:"button","aria-expanded":O,children:[a.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:u?a.jsx(NM,{kind:"tool"}):a.jsx(vNt,{})}),r?a.jsx("span",{className:"tool-name",children:T}):a.jsx(on,{className:"tool-name",duration:2.2,spread:15,children:T}),u&&v==="failed"&&a.jsx("span",{className:"development-tool-failure",children:a.jsx(Pw,{ns:"adk",i18nKey:"developmentRuns.toolFailed"})}),a.jsx(ck,{className:`tool-chevron${O?" is-open":""}`})]}),a.jsx("div",{className:`${k?"":"think-collapse "}${O?"open":""}`,children:a.jsxs("div",{className:"think-collapse-inner",children:[c?a.jsxs("section",{className:"codex-sandbox-run","aria-label":g("blocks.sandboxDetails"),children:[a.jsxs("div",{className:"codex-sandbox-run__label",children:[a.jsxs("span",{className:"codex-sandbox-run__badge",children:[a.jsx(wNt,{}),a.jsx("span",{children:"Codex Sandbox"})]}),a.jsx("span",{className:"codex-sandbox-run__title",children:c.title})]}),a.jsx(kNt,{activity:c}),a.jsx("div",{className:"codex-sandbox-run__stream",children:c.items.length>0?a.jsx(pv,{blocks:c.items.map(P=>P.block),streaming:!r,onAction:m}):a.jsx(on,{className:"codex-sandbox-run__empty",children:g("blocks.waitingCodex")})})]}):null,x?a.jsx(x,{args:n,response:i,status:v,onBranchSelect:h}):c?null:a.jsxs("div",{className:"tool-detail",children:[d&&a.jsx("div",{className:"development-tool-meta",children:d}),n!=null&&a.jsxs("div",{className:"tool-section",children:[a.jsx("div",{className:"tool-section-label",children:g("blocks.arguments")}),a.jsx("pre",{className:"tool-args",children:JSON.stringify(n,null,2)})]}),N!=null&&a.jsxs("div",{className:"tool-section",children:[a.jsx("div",{className:"tool-section-label",children:g("blocks.result")}),a.jsx("pre",{className:"tool-args tool-result",children:N})]}),R.length>0&&a.jsxs("div",{className:"tool-section",children:[a.jsx("div",{className:"tool-section-label",children:g("blocks.artifacts")}),a.jsx("div",{className:"studio-tool-artifacts",children:R.map(P=>a.jsx("a",{href:P.contentUrl,download:P.name,children:g("blocks.downloadNamed",{name:P.name})},`${P.contentUrl}:${P.name}`))})]})]})]})})]})}function TNt({block:e,onDownload:t,onPreview:n}){const{t:i}=_e("conversation"),[r,s]=p.useState(""),[o,l]=p.useState(""),[c,u]=p.useState(null);p.useEffect(()=>()=>{c&&URL.revokeObjectURL(c.url)},[c]);const d=()=>u(null),f=async(g,b)=>{if(t){s(`download:${g}`),l("");try{await t(g,b)}catch(v){l(v instanceof Error?v.message:String(v))}finally{s("")}}},h=async(g,b,v)=>{if(n){s(`preview:${v}`),l("");try{const y=await n(g,b);u({name:v,url:y})}catch(y){l(y instanceof Error?y.message:String(y))}finally{s("")}}},m=e.files.filter(g=>!g.filename.endsWith(".preview.webp"));return a.jsxs("div",{className:"artifact-list",children:[m.map(g=>{const b=`${g.filename.replace(/\.pptx$/i,"")}.preview.webp`,v=e.files.find(y=>y.filename===b);return a.jsxs("div",{className:"artifact-card",children:[a.jsx("span",{className:"artifact-card__icon","aria-hidden":"true",children:a.jsx(gV,{})}),a.jsxs("span",{className:"artifact-card__copy",children:[a.jsx("span",{className:"artifact-card__name",children:g.filename}),a.jsx("span",{className:"artifact-card__hint",children:i("blocks.powerpoint")})]}),a.jsxs("span",{className:"artifact-card__actions",children:[v&&a.jsxs("button",{className:"artifact-card__action",type:"button",disabled:!n||r!=="",onClick:()=>void h(v.filename,v.version,g.filename),children:[r===`preview:${g.filename}`?a.jsx(Vi,{className:"spin"}):a.jsx(Dat,{}),i("blocks.preview")]}),a.jsxs("button",{className:"artifact-card__action artifact-card__action--primary",type:"button",disabled:!t||r!=="",onClick:()=>void f(g.filename,g.version),children:[r===`download:${g.filename}`?a.jsx(Vi,{className:"spin"}):a.jsx(JD,{}),i("blocks.download")]})]})]},`${g.filename}:${g.version}`)}),o&&a.jsx("div",{className:"artifact-card__error",children:o}),c&&a.jsxs("div",{className:"artifact-preview",role:"dialog","aria-modal":"true","aria-label":i("blocks.previewDialog",{name:c.name}),children:[a.jsx("button",{className:"artifact-preview__backdrop",type:"button","aria-label":i("blocks.closePreview"),onClick:d}),a.jsxs("div",{className:"artifact-preview__panel",children:[a.jsxs("div",{className:"artifact-preview__header",children:[a.jsx("span",{children:c.name}),a.jsx("button",{type:"button","aria-label":i("blocks.closePreview"),onClick:d,children:a.jsx(Bo,{})})]}),a.jsx("div",{className:"artifact-preview__canvas",children:a.jsx("img",{src:c.url,alt:i("blocks.slidePreview",{name:c.name})})})]})]})]})}function _Nt({block:e,onAuth:t}){const{t:n}=_e("conversation"),[i,r]=p.useState(e.done?"done":"idle"),[s,o]=p.useState(""),l=e.label||n("blocks.mcpToolset"),c=(()=>{try{return e.authUri?new URL(e.authUri).host:""}catch{return""}})(),u=async()=>{if(t){o(""),r("authorizing");try{await t(e),r("done")}catch(f){o(f instanceof Error?f.message:String(f)),r("idle")}}};return e.done||i==="done"?a.jsxs(_r.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[a.jsx(JJ,{className:"auth-card-icon auth-card-icon--done"}),a.jsx("span",{children:n("blocks.authorized",{tool:l})})]}):a.jsxs(_r.div,{className:"auth-card",initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[a.jsxs("div",{className:"auth-card-head",children:[a.jsx(JJ,{className:"auth-card-icon"}),a.jsx("span",{className:"auth-card-title",children:n("blocks.authorizationRequired",{tool:l})})]}),a.jsxs("p",{className:"auth-card-desc",children:[a.jsx(Pw,{t:n,i18nKey:"blocks.oauthDescription",values:{tool:l},components:{code:a.jsx("code",{className:"auth-card-code"})}}),c&&a.jsxs(a.Fragment,{children:[" ",a.jsx(Pw,{t:n,i18nKey:"blocks.oauthProvider",values:{provider:c},components:{code:a.jsx("code",{className:"auth-card-code"})}})," "]}),n("blocks.oauthContinue")]}),a.jsx("button",{className:"auth-card-btn",onClick:u,disabled:i==="authorizing"||!e.authUri,children:i==="authorizing"?a.jsxs(a.Fragment,{children:[a.jsx(Vi,{className:"cw-i spin"})," ",n("blocks.waitingAuthorization")]}):a.jsx(a.Fragment,{children:n("blocks.authorize")})}),!e.authUri&&a.jsx("div",{className:"auth-card-err",children:n("blocks.missingAuthorizationUrl")}),s&&a.jsx("div",{className:"auth-card-err",children:s})]})}function jNt(e,t,n){const i=gq(e.name),r=d9(e.name,e.args,n);if(r||!i)return r;const s=t==="failed"?"failed":t==="running"?"running":"done",o=t==="failed"?i.failedLabel??i.doneLabel:t==="running"?i.runningLabel:i.doneLabel;return n(`blocks.tools.${i.name}.${s}`,{defaultValue:o})}function Yne(e,t){const n=e.status??(e.done?"completed":"running");return{name:e.name,title:t?jNt(e,n,t):void 0,callId:e.callId,args:e.args,response:e.response,done:e.done,status:e.status,defaultOpen:e.defaultOpen,source:e.source}}function NNt(e,t){var s;const n=[];let i=[];const r=()=>{i.length&&(n.push(i.length>1?{kind:"tool-exploration",items:i.map(o=>Yne(o,t))}:i[0]),i=[])};for(const o of e){if(o.kind!=="tool"||(s=gq(o.name))!=null&&s.detailRenderer){r(),n.push(o);continue}const l=bq(Yne(o)),c=!i.length||i[i.length-1].source===o.source;if(Kne(l)&&c){i.push(o);continue}r(),Kne(l)?i.push(o):n.push(o)}return r(),n}function pv({groupProcess:e=!1,liveStatus:t,blocks:n,appName:i="",streaming:r=!1,onStreamFrame:s,onStreamComplete:o,onAction:l,onAuth:c,onArtifactDownload:u,onArtifactPreview:d,onResolveDelivery:f,onResolveDeliveryComparison:h,onDownloadDelivery:m,onDeployDelivery:g,onBranchSelect:b}){if(e)return a.jsx(E_t,{blocks:n,active:r,status:t,render:x=>a.jsx(pv,{blocks:x,appName:i,streaming:r,onStreamFrame:s,onStreamComplete:o,onAction:l,onAuth:c,onArtifactDownload:u,onArtifactPreview:d,onResolveDelivery:f,onResolveDeliveryComparison:h,onDownloadDelivery:m,onDeployDelivery:g,onBranchSelect:b})});const{t:v}=_e("conversation"),y=NNt(Cot(n),v),w=y.reduce((x,k,S)=>k.kind==="text"?S:x,-1);return a.jsx(a.Fragment,{children:y.map((x,k)=>{switch(x.kind){case"turn-summary":return a.jsx(O_t,{value:x.value},x.id||k);case"diff":return a.jsxs("details",{className:"development-diff",children:[a.jsxs("summary",{children:[a.jsx("span",{className:"tool-icon",children:a.jsx(NM,{kind:"diff"})}),a.jsx("span",{children:a.jsx(Pw,{ns:"adk",i18nKey:"developmentRuns.diff"})}),a.jsx(ck,{className:"tool-chevron"})]}),a.jsx("pre",{children:x.text})]},x.id??k);case"progress":return a.jsx(e5e,{text:x.text},"build-progress");case"activity-source":return a.jsx("div",{className:"tool-activity-source",children:x.label},`${k}:${x.label}`);case"tool-exploration":return a.jsx(pNt,{items:x.items},`exploration:${k}`);case"thinking":{const S=y.slice(k+1).some(O=>O.kind==="text"&&!!O.text.trim());return a.jsx(JLe,{text:x.text,done:x.done,thoughtKind:x.thoughtKind,answerStarted:S,streaming:r,onStreamFrame:s},x.id??k)}case"text":{const S=x.text.replace(/^\s+/,"");return S?a.jsx(SNt,{text:S,streaming:r,onStreamFrame:s,onStreamComplete:k===w?o:void 0},x.id??k):null}case"plan":return a.jsx(ENt,{title:x.title,summary:x.summary,items:x.items,done:x.done},x.id??k);case"attachment":return a.jsx(IM,{appName:i,items:x.files},x.id??k);case"artifact":return a.jsx(TNt,{block:x,onDownload:u,onPreview:d},x.id??k);case"delivery":return a.jsx(ONt,{value:x.value,onResolve:f,onResolveComparison:h,onDownload:m,onDeploy:g},x.id??k);case"invocation":return a.jsx(RM,{value:x.value},x.id??k);case"tool":{if(x.name===YLe&&x.done)return null;const S=x.name==="create_agents"&&y.slice(k+1).some(O=>O.kind==="tool"&&O.name==="create_agents");return a.jsx(ANt,{name:x.itemType?G2e(x):x.name,callId:x.callId,native:!!x.itemType,progressText:x.progressText,args:x.args,response:x.response,done:x.done,status:x.status,defaultOpen:x.defaultOpen,retrying:x.name==="create_agents"&&(r||S),codexActivity:x.codexActivity,source:x.source,onBranchSelect:b,onAction:l},x.id??k)}case"agent-transfer":return null;case"auth":return a.jsx(_Nt,{block:x,onAuth:c},x.id??k);case"a2ui":return gLe(x.messages).filter(S=>S.components[S.rootId]).map(S=>a.jsx(_r.div,{initial:{opacity:0,y:8,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:380,damping:30},children:a.jsx(P_t,{surface:S,onAction:l})},`${k}-${S.surfaceId}`));default:return null}})})}const RNt=()=>{};function INt(e){if(e.kind==="message")return{kind:"text",text:e.text};if(e.kind==="thinking")return{kind:"thinking",text:e.text,done:e.status==="done"};if(e.kind==="tool")return{kind:"tool",name:e.name,args:e.args,response:e.response,done:e.status==="done"};throw new Error(en("conversation.unsupportedActivity"))}function PNt({activities:e}){const{t}=_e("skills"),n=p.useMemo(()=>e.filter(i=>i.kind!=="status").map(INt),[e]);return n.length===0?null:a.jsx("div",{className:"skill-conversation","aria-label":t("conversation.ariaLabel"),"aria-live":"polite",children:a.jsx(pv,{blocks:n,onAction:RNt})})}function Zne(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m7 9 5 5 5-5",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}function RN({label:e,value:t,options:n,onChange:i,disabled:r=!1,allowCustom:s=!1,required:o=!1,placeholder:l,error:c}){const{t:u}=_e("skills"),d=l??u("configSelect.placeholder"),f=p.useId(),h=p.useId(),m=p.useId(),g=p.useRef(null),b=p.useRef(null),v=p.useRef(null),y=p.useRef(null),w=p.useRef([]),x=n.findIndex(I=>I.value===t),k=t.trim().toLocaleLowerCase(),S=s&&k?n.filter(I=>I.value.toLocaleLowerCase().includes(k)||I.label.toLocaleLowerCase().includes(k)):n,[O,A]=p.useState(!1),[E,j]=p.useState(Math.max(0,x)),T=x>=0?n[x]:void 0,R=r||!s&&n.length===0,C=(I=!1)=>{A(!1),I&&window.requestAnimationFrame(()=>{var D,_;return s?(D=v.current)==null?void 0:D.focus():(_=b.current)==null?void 0:_.focus()})},N=I=>{R||S.length!==0&&(j(Math.min(Math.max(I,0),S.length-1)),A(!0))};p.useEffect(()=>{if(!O)return;const I=y.current,D=s?void 0:window.requestAnimationFrame(()=>{var M;(M=w.current[E])==null||M.focus()}),_=M=>{if(!I)return;const H=I.scrollTop<=0,q=I.scrollTop+I.clientHeight>=I.scrollHeight-1;(I.scrollHeight<=I.clientHeight||M.deltaY<0&&H||M.deltaY>0&&q)&&M.preventDefault(),M.stopPropagation()},L=M=>{var H;M.target instanceof Node&&!((H=g.current)!=null&&H.contains(M.target))&&C()},F=M=>{M.key==="Escape"&&C(!0)};return I==null||I.addEventListener("wheel",_,{passive:!1}),window.addEventListener("pointerdown",L),window.addEventListener("keydown",F),()=>{D!==void 0&&window.cancelAnimationFrame(D),I==null||I.removeEventListener("wheel",_),window.removeEventListener("pointerdown",L),window.removeEventListener("keydown",F)}},[E,s,O]);const P=I=>{var _;if(S.length===0)return;const D=(I+S.length)%S.length;j(D),(_=w.current[D])==null||_.focus()};return a.jsxs("div",{ref:g,className:`skill-config-select${O?" is-open":""}`,onBlur:I=>{var D;(!I.relatedTarget||!((D=g.current)!=null&&D.contains(I.relatedTarget)))&&C()},children:[a.jsxs("span",{id:h,className:"skill-config-select__label",children:[e,o?a.jsx("span",{className:"skill-required-mark","aria-hidden":"true",children:"*"}):null]}),s?a.jsxs("div",{className:`skill-config-select__trigger is-editable${r?" is-disabled":""}`,"aria-expanded":O,children:[a.jsx("input",{ref:v,value:t,disabled:r,role:"combobox","aria-autocomplete":"list","aria-expanded":O,"aria-controls":O?f:void 0,"aria-labelledby":h,"aria-required":o,"aria-invalid":!!c,"aria-describedby":c?m:void 0,placeholder:d,onChange:I=>{i(I.target.value),j(0),n.length>0&&A(!0)},onClick:()=>{!O&&S.length>0&&N(0)},onKeyDown:I=>{var D,_;if(!(I.nativeEvent.isComposing||I.keyCode===229))if(I.key==="ArrowDown")I.preventDefault(),O?(D=w.current[E])==null||D.focus():N(0);else if(I.key==="ArrowUp")I.preventDefault(),O?(_=w.current[S.length-1])==null||_.focus():N(S.length-1);else if(I.key==="Enter"&&O){I.preventDefault();const L=S[E];L&&i(L.value),C()}else I.key==="Escape"&&(I.preventDefault(),C())}}),a.jsx("button",{type:"button",className:"skill-config-select__toggle",disabled:r||n.length===0,"aria-label":u(O?"configSelect.collapseOptions":"configSelect.expandOptions"),onClick:()=>{O?C():N(0)},children:a.jsx(Zne,{})})]}):a.jsxs("button",{ref:b,type:"button",className:"skill-config-select__trigger",disabled:R,"aria-haspopup":"listbox","aria-expanded":O,"aria-controls":O?f:void 0,"aria-labelledby":h,"aria-required":o,onClick:()=>{O?C():N(x>=0?x:0)},onKeyDown:I=>{I.key==="ArrowDown"?(I.preventDefault(),N(x>=0?x:0)):I.key==="ArrowUp"&&(I.preventDefault(),N(x>=0?x:n.length-1))},children:[a.jsx("span",{className:T?void 0:"is-placeholder",title:T==null?void 0:T.label,children:(T==null?void 0:T.label)||(n.length===0?u("configSelect.noOptions"):d)}),a.jsx(Zne,{})]}),O?a.jsxs("div",{ref:y,id:f,className:"skill-config-select__menu",role:"listbox","aria-labelledby":h,children:[S.length===0?a.jsx("div",{className:"skill-config-select__empty",role:"status",children:u("configSelect.noMatches")}):null,S.map((I,D)=>{const _=I.value===t;return a.jsx("button",{ref:L=>{w.current[D]=L},type:"button",role:"option","aria-selected":_,tabIndex:D===E?0:-1,className:`skill-config-select__option${_?" is-selected":""}`,title:I.label,onFocus:()=>j(D),onClick:()=>{i(I.value),C(!0)},onKeyDown:L=>{L.key==="Enter"||L.key===" "?(L.preventDefault(),i(I.value),C(!0)):L.key==="ArrowDown"?(L.preventDefault(),P(D+1)):L.key==="ArrowUp"?(L.preventDefault(),P(D-1)):L.key==="Home"?(L.preventDefault(),P(0)):L.key==="End"&&(L.preventDefault(),P(n.length-1))},children:I.label},I.value)})]}):null,c?a.jsx("span",{id:m,className:"skill-config-select__error",role:"alert",children:c}):null]})}function Lr(e,t){return e instanceof Error?e:typeof e=="string"&&e.trim()?new Error(e.trim()):new Error(t)}function Rs({error:e}){var s,o,l,c,u;const{t}=_e("skills"),n=e,i=(o=(s=n.originalError)==null?void 0:s.message)==null?void 0:o.trim(),r=[typeof n.status=="number"?`HTTP ${n.status}${n.statusText?` ${n.statusText}`:""}`:"",n.code?t("errorDetails.code",{code:n.code}):"",(l=n.originalError)!=null&&l.type?t("errorDetails.type",{type:n.originalError.type}):"",(c=n.originalError)!=null&&c.repr&&n.originalError.repr!==i?t("errorDetails.representation",{value:n.originalError.repr}):"",(u=n.rawResponse)!=null&&u.trim()?t("errorDetails.rawResponse",{value:n.rawResponse.trim()}):""].filter(Boolean);return a.jsxs("div",{className:"skill-error-details",children:[a.jsx("div",{className:"skill-error-details__summary",children:e.message}),i?a.jsx("div",{className:"skill-error-details__original",children:t("errorDetails.original",{message:i})}):null,r.length>0?a.jsxs("details",{children:[a.jsx("summary",{children:t("errorDetails.details")}),a.jsx("pre",{children:r.join(` +`)})]}):null]})}const vq=Symbol.for("yaml.alias"),f9=Symbol.for("yaml.document"),Mg=Symbol.for("yaml.map"),n5e=Symbol.for("yaml.pair"),Th=Symbol.for("yaml.scalar"),uk=Symbol.for("yaml.seq"),Rd=Symbol.for("yaml.node.type"),dk=e=>!!e&&typeof e=="object"&&e[Rd]===vq,ET=e=>!!e&&typeof e=="object"&&e[Rd]===f9,CT=e=>!!e&&typeof e=="object"&&e[Rd]===Mg,Ia=e=>!!e&&typeof e=="object"&&e[Rd]===n5e,Ss=e=>!!e&&typeof e=="object"&&e[Rd]===Th,AT=e=>!!e&&typeof e=="object"&&e[Rd]===uk;function _a(e){if(e&&typeof e=="object")switch(e[Rd]){case Mg:case uk:return!0}return!1}function Ra(e){if(e&&typeof e=="object")switch(e[Rd]){case vq:case Mg:case Th:case uk:return!0}return!1}const i5e=e=>(Ss(e)||_a(e))&&!!e.anchor,fy=Symbol("break visit"),DNt=Symbol("skip children"),vE=Symbol("remove node");function fk(e,t){const n=MNt(t);ET(e)?$x(null,e.contents,n,Object.freeze([e]))===vE&&(e.contents=null):$x(null,e,n,Object.freeze([]))}fk.BREAK=fy;fk.SKIP=DNt;fk.REMOVE=vE;function $x(e,t,n,i){const r=LNt(e,t,n,i);if(Ra(r)||Ia(r))return $Nt(e,i,r),$x(e,r,n,i);if(typeof r!="symbol"){if(_a(t)){i=Object.freeze(i.concat(t));for(let s=0;se.replace(/[!,[\]{}]/g,t=>FNt[t]);class Wl{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Wl.defaultYaml,t),this.tags=Object.assign({},Wl.defaultTags,n)}clone(){const t=new Wl(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Wl(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Wl.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Wl.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Wl.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Wl.defaultTags),this.atNextDocument=!1);const i=t.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;const[s,o]=i;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[s]=i;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{const o=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,o),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const o=t.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,i,r]=t.match(/^(.*!)([^!]*)$/s);r||n(`The ${t} tag has no suffix`);const s=this.tags[i];if(s)try{return s+decodeURIComponent(r)}catch(o){return n(String(o)),null}return i==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,i]of Object.entries(this.tags))if(t.startsWith(i))return n+BNt(t.substring(i.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags);let r;if(t&&i.length>0&&Ra(t.contents)){const s={};fk(t.contents,(o,l)=>{Ra(l)&&l.tag&&(s[l.tag]=!0)}),r=Object.keys(s)}else r=[];for(const[s,o]of i)s==="!!"&&o==="tag:yaml.org,2002:"||(!t||r.some(l=>l.startsWith(o)))&&n.push(`%TAG ${s} ${o}`);return n.join(` +`)}}Wl.defaultYaml={explicit:!1,version:"1.2"};Wl.defaultTags={"!!":"tag:yaml.org,2002:"};function r5e(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function s5e(e){const t=new Set;return fk(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function a5e(e,t){for(let n=1;;++n){const i=`${e}${n}`;if(!t.has(i))return i}}function UNt(e,t){const n=[],i=new Map;let r=null;return{onAnchor:s=>{n.push(s),r??(r=s5e(e));const o=a5e(t,r);return r.add(o),o},setAnchors:()=>{for(const s of n){const o=i.get(s);if(typeof o=="object"&&o.anchor&&(Ss(o.node)||_a(o.node)))o.node.anchor=o.anchor;else{const l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},sourceObjects:i}}function Fx(e,t,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,s=i.length;rCd(i,String(r),n));if(e&&typeof e.toJSON=="function"){if(!n||!i5e(e))return e.toJSON(t,n);const i={aliasCount:0,count:1,res:void 0};n.anchors.set(e,i),n.onCreate=s=>{i.res=s,delete n.onCreate};const r=e.toJSON(t,n);return n.onCreate&&n.onCreate(r),r}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class xq{constructor(t){Object.defineProperty(this,Rd,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:s}={}){if(!ET(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=Cd(this,"",o);if(typeof r=="function")for(const{count:c,res:u}of o.anchors.values())r(u,c);return typeof s=="function"?Fx(s,{"":l},"",l):l}}let wq=class extends xq{constructor(t){super(vq),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if((n==null?void 0:n.maxAliasCount)===0)throw new ReferenceError("Alias resolution is disabled");let i;n!=null&&n.aliasResolveCache?i=n.aliasResolveCache:(i=[],fk(t,{Node:(s,o)=>{(dk(o)||i5e(o))&&i.push(o)}}),n&&(n.aliasResolveCache=i));let r;for(const s of i){if(s===this)break;s.anchor===this.source&&(r=s)}return r}toJSON(t,n){if(!n)return{source:this.source};const{anchors:i,doc:r,maxAliasCount:s}=n,o=this.resolve(r,n);if(!o){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let l=i.get(o);if(l||(Cd(o,null,n),l=i.get(o)),(l==null?void 0:l.res)===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(s>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=IN(r,o,i)),l.count*l.aliasCount>s)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return l.res}toString(t,n,i){const r=`*${this.source}`;if(t){if(r5e(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(t.implicitKey)return`${r} `}return r}};function IN(e,t,n){if(dk(t)){const i=t.resolve(e),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(_a(t)){let i=0;for(const r of t.items){const s=IN(e,r,n);s>i&&(i=s)}return i}else if(Ia(t)){const i=IN(e,t.key,n),r=IN(e,t.value,n);return Math.max(i,r)}return 1}const o5e=e=>!e||typeof e!="function"&&typeof e!="object";class Oi extends xq{constructor(t){super(Th),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:Cd(this.value,t,n)}toString(){return String(this.value)}}Oi.BLOCK_FOLDED="BLOCK_FOLDED";Oi.BLOCK_LITERAL="BLOCK_LITERAL";Oi.PLAIN="PLAIN";Oi.QUOTE_DOUBLE="QUOTE_DOUBLE";Oi.QUOTE_SINGLE="QUOTE_SINGLE";const QNt="tag:yaml.org,2002:";function zNt(e,t,n){if(t){const i=n.filter(s=>s.tag===t),r=i.find(s=>!s.format)??i[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find(i=>{var r;return((r=i.identify)==null?void 0:r.call(i,e))&&!i.format})}function RC(e,t,n){var f,h,m;if(ET(e)&&(e=e.contents),Ra(e))return e;if(Ia(e)){const g=(h=(f=n.schema[Mg]).createNode)==null?void 0:h.call(f,n.schema,null,n);return g.items.push(e),g}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:i,onAnchor:r,onTagObj:s,schema:o,sourceObjects:l}=n;let c;if(i&&e&&typeof e=="object"){if(c=l.get(e),c)return c.anchor??(c.anchor=r(e)),new wq(c.anchor);c={anchor:null,node:null},l.set(e,c)}t!=null&&t.startsWith("!!")&&(t=QNt+t.slice(2));let u=zNt(e,t,o.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const g=new Oi(e);return c&&(c.node=g),g}u=e instanceof Map?o[Mg]:Symbol.iterator in Object(e)?o[uk]:o[Mg]}s&&(s(u),delete n.onTagObj);const d=u!=null&&u.createNode?u.createNode(n.schema,e,n):typeof((m=u==null?void 0:u.nodeClass)==null?void 0:m.from)=="function"?u.nodeClass.from(n.schema,e,n):new Oi(e);return t?d.tag=t:u.default||(d.tag=u.tag),c&&(c.node=d),d}function DI(e,t,n){let i=n;for(let r=t.length-1;r>=0;--r){const s=t[r];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){const o=[];o[s]=i,i=o}else i=new Map([[s,i]])}return RC(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const yS=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class l5e extends xq{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(i=>Ra(i)||Ia(i)?i.clone(t):i),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(yS(t))this.add(n);else{const[i,...r]=t,s=this.get(i,!0);if(_a(s))s.addIn(r,n);else if(s===void 0&&this.schema)this.set(i,DI(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(t){const[n,...i]=t;if(i.length===0)return this.delete(n);const r=this.get(n,!0);if(_a(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(t,n){const[i,...r]=t,s=this.get(i,!0);return r.length===0?!n&&Ss(s)?s.value:s:_a(s)?s.getIn(r,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Ia(n))return!1;const i=n.value;return i==null||t&&Ss(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(t){const[n,...i]=t;if(i.length===0)return this.has(n);const r=this.get(n,!0);return _a(r)?r.hasIn(i):!1}setIn(t,n){const[i,...r]=t;if(r.length===0)this.set(i,n);else{const s=this.get(i,!0);if(_a(s))s.setIn(r,n);else if(s===void 0&&this.schema)this.set(i,DI(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}}const VNt=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Ap(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Ty=(e,t,n)=>e.endsWith(` `)?Ap(n,t):n.includes(` `)?` -`+Ap(n,t):(e.endsWith(" ")?"":" ")+n,l5e="flow",h9="block",PN="quoted";function MM(e,t,n="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:s=20,onFold:o,onOverflow:l}={}){if(!r||r<0)return e;rr-Math.max(2,s)?u.push(0):f=r-i);let h,m,g=!1,b=-1,v=-1,y=-1;n===h9&&(b=Jne(e,b,t.length),b!==-1&&(f=b+c));for(let x;x=e[b+=1];){if(n===PN&&x==="\\"){switch(v=b,e[b+1]){case"x":b+=3;break;case"u":b+=5;break;case"U":b+=9;break;default:b+=1}y=b}if(x===` +`+Ap(n,t):(e.endsWith(" ")?"":" ")+n,c5e="flow",h9="block",PN="quoted";function MM(e,t,n="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:s=20,onFold:o,onOverflow:l}={}){if(!r||r<0)return e;rr-Math.max(2,s)?u.push(0):f=r-i);let h,m,g=!1,b=-1,v=-1,y=-1;n===h9&&(b=Jne(e,b,t.length),b!==-1&&(f=b+c));for(let x;x=e[b+=1];){if(n===PN&&x==="\\"){switch(v=b,e[b+1]){case"x":b+=3;break;case"u":b+=5;break;case"U":b+=9;break;default:b+=1}y=b}if(x===` `)n===h9&&(b=Jne(e,b,t.length)),f=b+t.length+c,h=void 0;else{if(x===" "&&m&&m!==" "&&m!==` `&&m!==" "){const k=e[b+1];k&&k!==" "&&k!==` `&&k!==" "&&(h=b)}if(b>=f)if(h)u.push(h),f=h+c,h=void 0;else if(n===PN){for(;m===" "||m===" ";)m=x,x=e[b+=1],g=!0;const k=b>y+1?b-2:v-1;if(d[k])return e;u.push(k),d[k]=!0,f=k+c,h=void 0}else g=!0}m=x}if(g&&l&&l(),u.length===0)return e;o&&o();let w=e.slice(0,u[0]);for(let x=0;x({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),$M=e=>/^(%|---|\.\.\.)/m.test(e);function VNt(e,t,n){if(!t||t<0)return!1;const i=t-n,r=e.length;if(r<=i)return!1;for(let s=0,o=0;s({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),$M=e=>/^(%|---|\.\.\.)/m.test(e);function HNt(e,t,n){if(!t||t<0)return!1;const i=t-n,r=e.length;if(r<=i)return!1;for(let s=0,o=0;si)return!0;if(o=s+1,r-o<=i)return!1}return!0}function xE(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:i}=t,r=t.options.doubleQuotedMinMultiLineLength,s=t.indent||($M(e)?" ":"");let o="",l=0;for(let c=0,u=n[c];u;u=n[++c])if(u===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(o+=n.slice(l,c)+"\\ ",c+=1,l=c,u="\\"),u==="\\")switch(n[c+1]){case"u":{o+=n.slice(l,c);const d=n.substr(c+2,4);switch(d){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:d.substr(0,2)==="00"?o+="\\x"+d.substr(2):o+=n.substr(c,6)}c+=5,l=c+1}break;case"n":if(i||n[c+2]==='"'||n.length `;let f,h;for(h=n.length;h>0;--h){const S=n[h-1];if(S!==` `&&S!==" "&&S!==" ")break}let m=n.substring(h);const g=m.indexOf(` @@ -628,12 +628,12 @@ ${n}`)+"'";return t.implicitKey?i:MM(i,n,l5e,LM(t,!1))}function Bx(e,t){const{si `)y=v;else break}let w=n.substring(0,y{O=!0});const E=MM(`${w}${S}${m}`,u,h9,A);if(!O)return`>${k} ${u}${E}`}return n=n.replace(/\n+/g,`$&${u}`),`|${k} -${u}${w}${n}${m}`}function HNt(e,t,n,i){const{type:r,value:s}=e,{actualString:o,implicitKey:l,indent:c,indentStep:u,inFlow:d}=t;if(l&&s.includes(` +${u}${w}${n}${m}`}function qNt(e,t,n,i){const{type:r,value:s}=e,{actualString:o,implicitKey:l,indent:c,indentStep:u,inFlow:d}=t;if(l&&s.includes(` `)||d&&/[[\]{},]/.test(s))return Bx(s,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||d||!s.includes(` `)?Bx(s,t):DN(e,t,n,i);if(!l&&!d&&r!==Oi.PLAIN&&s.includes(` `))return DN(e,t,n,i);if($M(s)){if(c==="")return t.forceBlockIndent=!0,DN(e,t,n,i);if(l&&c===u)return Bx(s,t)}const f=s.replace(/\n+/g,`$& -${c}`);if(o){const h=b=>{var v;return b.default&&b.tag!=="tag:yaml.org,2002:str"&&((v=b.test)==null?void 0:v.test(f))},{compat:m,tags:g}=t.doc.schema;if(g.some(h)||m!=null&&m.some(h))return Bx(s,t)}return l?f:MM(f,c,l5e,LM(t,!1))}function kq(e,t,n,i){const{implicitKey:r,inFlow:s}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:l}=e;l!==Oi.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=Oi.QUOTE_DOUBLE);const c=d=>{switch(d){case Oi.BLOCK_FOLDED:case Oi.BLOCK_LITERAL:return r||s?Bx(o.value,t):DN(o,t,n,i);case Oi.QUOTE_DOUBLE:return xE(o.value,t);case Oi.QUOTE_SINGLE:return p9(o.value,t);case Oi.PLAIN:return HNt(o,t,n,i);default:return null}};let u=c(l);if(u===null){const{defaultKeyType:d,defaultStringType:f}=t.options,h=r&&d||f;if(u=c(h),u===null)throw new Error(`Unsupported default string type ${h}`)}return u}function c5e(e,t){const n=Object.assign({blockQuote:!0,commentString:zNt,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function qNt(e,t){var r;if(t.tag){const s=e.filter(o=>o.tag===t.tag);if(s.length>0)return s.find(o=>o.format===t.format)??s[0]}let n,i;if(Ss(t)){i=t.value;let s=e.filter(o=>{var l;return(l=o.identify)==null?void 0:l.call(o,i)});if(s.length>1){const o=s.filter(l=>l.test);o.length>0&&(s=o)}n=s.find(o=>o.format===t.format)??s.find(o=>!o.format)}else i=t,n=e.find(s=>s.nodeClass&&i instanceof s.nodeClass);if(!n){const s=((r=i==null?void 0:i.constructor)==null?void 0:r.name)??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${s} value`)}return n}function WNt(e,t,{anchors:n,doc:i}){if(!i.directives)return"";const r=[],s=(Ss(e)||_a(e))&&e.anchor;s&&i5e(s)&&(n.add(s),r.push(`&${s}`));const o=e.tag??(t.default?null:t.tag);return o&&r.push(i.directives.tagString(o)),r.join(" ")}function u1(e,t,n,i){var c;if(Ia(e))return e.toString(t,n,i);if(dk(e)){if(t.doc.directives)return e.toString(t);if((c=t.resolvedAliases)!=null&&c.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let r;const s=Ra(e)?e:t.doc.createNode(e,{onTagObj:u=>r=u});r??(r=qNt(t.doc.schema.tags,s));const o=WNt(s,r,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const l=typeof r.stringify=="function"?r.stringify(s,t,n,i):Ss(s)?kq(s,t,n,i):s.toString(t,n,i);return o?Ss(s)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o} -${t.indent}${l}`:l}function KNt({key:e,value:t},n,i,r){const{allNullValues:s,doc:o,indent:l,indentStep:c,options:{commentString:u,indentSeq:d,simpleKeys:f}}=n;let h=Ra(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(_a(e)||!Ra(e)&&typeof e=="object"){const A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let m=!f&&(!e||h&&t==null&&!n.inFlow||_a(e)||(Ss(e)?e.type===Oi.BLOCK_FOLDED||e.type===Oi.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!m&&(f||!s),indent:l+c});let g=!1,b=!1,v=u1(e,n,()=>g=!0,()=>b=!0);if(!m&&!n.inFlow&&v.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(n.inFlow){if(s||t==null)return g&&i&&i(),v===""?"?":m?`? ${v}`:v}else if(s&&!f||t==null&&m)return v=`? ${v}`,h&&!g?v+=Ty(v,n.indent,u(h)):b&&r&&r(),v;g&&(h=null),m?(h&&(v+=Ty(v,n.indent,u(h))),v=`? ${v} +${c}`);if(o){const h=b=>{var v;return b.default&&b.tag!=="tag:yaml.org,2002:str"&&((v=b.test)==null?void 0:v.test(f))},{compat:m,tags:g}=t.doc.schema;if(g.some(h)||m!=null&&m.some(h))return Bx(s,t)}return l?f:MM(f,c,c5e,LM(t,!1))}function kq(e,t,n,i){const{implicitKey:r,inFlow:s}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:l}=e;l!==Oi.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=Oi.QUOTE_DOUBLE);const c=d=>{switch(d){case Oi.BLOCK_FOLDED:case Oi.BLOCK_LITERAL:return r||s?Bx(o.value,t):DN(o,t,n,i);case Oi.QUOTE_DOUBLE:return xE(o.value,t);case Oi.QUOTE_SINGLE:return p9(o.value,t);case Oi.PLAIN:return qNt(o,t,n,i);default:return null}};let u=c(l);if(u===null){const{defaultKeyType:d,defaultStringType:f}=t.options,h=r&&d||f;if(u=c(h),u===null)throw new Error(`Unsupported default string type ${h}`)}return u}function u5e(e,t){const n=Object.assign({blockQuote:!0,commentString:VNt,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function WNt(e,t){var r;if(t.tag){const s=e.filter(o=>o.tag===t.tag);if(s.length>0)return s.find(o=>o.format===t.format)??s[0]}let n,i;if(Ss(t)){i=t.value;let s=e.filter(o=>{var l;return(l=o.identify)==null?void 0:l.call(o,i)});if(s.length>1){const o=s.filter(l=>l.test);o.length>0&&(s=o)}n=s.find(o=>o.format===t.format)??s.find(o=>!o.format)}else i=t,n=e.find(s=>s.nodeClass&&i instanceof s.nodeClass);if(!n){const s=((r=i==null?void 0:i.constructor)==null?void 0:r.name)??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${s} value`)}return n}function KNt(e,t,{anchors:n,doc:i}){if(!i.directives)return"";const r=[],s=(Ss(e)||_a(e))&&e.anchor;s&&r5e(s)&&(n.add(s),r.push(`&${s}`));const o=e.tag??(t.default?null:t.tag);return o&&r.push(i.directives.tagString(o)),r.join(" ")}function u1(e,t,n,i){var c;if(Ia(e))return e.toString(t,n,i);if(dk(e)){if(t.doc.directives)return e.toString(t);if((c=t.resolvedAliases)!=null&&c.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let r;const s=Ra(e)?e:t.doc.createNode(e,{onTagObj:u=>r=u});r??(r=WNt(t.doc.schema.tags,s));const o=KNt(s,r,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const l=typeof r.stringify=="function"?r.stringify(s,t,n,i):Ss(s)?kq(s,t,n,i):s.toString(t,n,i);return o?Ss(s)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o} +${t.indent}${l}`:l}function GNt({key:e,value:t},n,i,r){const{allNullValues:s,doc:o,indent:l,indentStep:c,options:{commentString:u,indentSeq:d,simpleKeys:f}}=n;let h=Ra(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(_a(e)||!Ra(e)&&typeof e=="object"){const A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let m=!f&&(!e||h&&t==null&&!n.inFlow||_a(e)||(Ss(e)?e.type===Oi.BLOCK_FOLDED||e.type===Oi.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!m&&(f||!s),indent:l+c});let g=!1,b=!1,v=u1(e,n,()=>g=!0,()=>b=!0);if(!m&&!n.inFlow&&v.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(n.inFlow){if(s||t==null)return g&&i&&i(),v===""?"?":m?`? ${v}`:v}else if(s&&!f||t==null&&m)return v=`? ${v}`,h&&!g?v+=Ty(v,n.indent,u(h)):b&&r&&r(),v;g&&(h=null),m?(h&&(v+=Ty(v,n.indent,u(h))),v=`? ${v} ${l}:`):(v=`${v}:`,h&&(v+=Ty(v,n.indent,u(h))));let y,w,x;Ra(t)?(y=!!t.spaceBefore,w=t.commentBefore,x=t.comment):(y=!1,w=null,x=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!m&&!h&&Ss(t)&&(n.indentAtStart=v.length+1),b=!1,!d&&c.length>=2&&!n.inFlow&&!m&&AT(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let k=!1;const S=u1(t,n,()=>k=!0,()=>b=!0);let O=" ";if(h||y||w){if(O=y?` `:"",w){const A=u(w);O+=` ${Ap(A,n.indent)}`}S===""&&!n.inFlow?O===` @@ -643,32 +643,32 @@ ${Ap(A,n.indent)}`}S===""&&!n.inFlow?O===` ${n.indent}`}else if(!m&&_a(t)){const A=S[0],E=S.indexOf(` `),j=E!==-1,T=n.inFlow??t.flow??t.items.length===0;if(j||!T){let R=!1;if(j&&(A==="&"||A==="!")){let C=S.indexOf(" ");A==="&"&&C!==-1&&Ce===P_||typeof e=="symbol"&&e.description===P_,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Oi(Symbol(P_)),{addToJSMap:d5e}),stringify:()=>P_},GNt=(e,t)=>(Up.identify(t)||Ss(t)&&(!t.type||t.type===Oi.PLAIN)&&Up.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Up.tag&&n.default));function d5e(e,t,n){const i=f5e(e,n);if(AT(i))for(const r of i.items)U4(e,t,r);else if(Array.isArray(i))for(const r of i)U4(e,t,r);else U4(e,t,i)}function U4(e,t,n){const i=f5e(e,n);if(!CT(i))throw new Error("Merge sources must be maps or map aliases");const r=i.toJSON(null,e,Map);for(const[s,o]of r)t instanceof Map?t.has(s)||t.set(s,o):t instanceof Set?t.add(s):Object.prototype.hasOwnProperty.call(t,s)||Object.defineProperty(t,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function f5e(e,t){return e&&dk(t)?t.resolve(e.doc,e):t}function h5e(e,t,{key:n,value:i}){if(Ra(n)&&n.addToJSMap)n.addToJSMap(e,t,i);else if(GNt(e,n))d5e(e,t,i);else{const r=Cd(n,"",e);if(t instanceof Map)t.set(r,Cd(i,r,e));else if(t instanceof Set)t.add(r);else{const s=XNt(n,r,e),o=Cd(i,s,e);s in t?Object.defineProperty(t,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[s]=o}}return t}function XNt(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Ra(e)&&(n!=null&&n.doc)){const i=c5e(n.doc,{});i.anchors=new Set;for(const s of n.anchors.keys())i.anchors.add(s.anchor);i.inFlow=!0,i.inStringifyKey=!0;const r=e.toString(i);if(!n.mapKeyWarned){let s=JSON.stringify(r);s.length>40&&(s=s.substring(0,36)+'..."'),u5e(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function Oq(e,t,n){const i=RC(e,void 0,n),r=RC(t,void 0,n);return new nc(i,r)}class nc{constructor(t,n=null){Object.defineProperty(this,Rd,{value:t5e}),this.key=t,this.value=n}clone(t){let{key:n,value:i}=this;return Ra(n)&&(n=n.clone(t)),Ra(i)&&(i=i.clone(t)),new nc(n,i)}toJSON(t,n){const i=n!=null&&n.mapAsMap?new Map:{};return h5e(n,i,this)}toString(t,n,i){return t!=null&&t.doc?KNt(this,t,n,i):JSON.stringify(this)}}function p5e(e,t,n){return(t.inFlow??e.flow?ZNt:YNt)(e,t,n)}function YNt({comment:e,items:t},n,{blockItemPrefix:i,flowChars:r,itemIndent:s,onChompKeep:o,onComment:l}){const{indent:c,options:{commentString:u}}=n,d=Object.assign({},n,{indent:s,type:null});let f=!1;const h=[];for(let g=0;gv=null,()=>f=!0);v&&(y+=Ty(y,s,u(v))),f&&v&&(f=!1),h.push(i+y)}let m;if(h.length===0)m=r.start+r.end;else{m=h[0];for(let g=1;ge===P_||typeof e=="symbol"&&e.description===P_,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Oi(Symbol(P_)),{addToJSMap:f5e}),stringify:()=>P_},XNt=(e,t)=>(Up.identify(t)||Ss(t)&&(!t.type||t.type===Oi.PLAIN)&&Up.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Up.tag&&n.default));function f5e(e,t,n){const i=h5e(e,n);if(AT(i))for(const r of i.items)U4(e,t,r);else if(Array.isArray(i))for(const r of i)U4(e,t,r);else U4(e,t,i)}function U4(e,t,n){const i=h5e(e,n);if(!CT(i))throw new Error("Merge sources must be maps or map aliases");const r=i.toJSON(null,e,Map);for(const[s,o]of r)t instanceof Map?t.has(s)||t.set(s,o):t instanceof Set?t.add(s):Object.prototype.hasOwnProperty.call(t,s)||Object.defineProperty(t,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function h5e(e,t){return e&&dk(t)?t.resolve(e.doc,e):t}function p5e(e,t,{key:n,value:i}){if(Ra(n)&&n.addToJSMap)n.addToJSMap(e,t,i);else if(XNt(e,n))f5e(e,t,i);else{const r=Cd(n,"",e);if(t instanceof Map)t.set(r,Cd(i,r,e));else if(t instanceof Set)t.add(r);else{const s=YNt(n,r,e),o=Cd(i,s,e);s in t?Object.defineProperty(t,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[s]=o}}return t}function YNt(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Ra(e)&&(n!=null&&n.doc)){const i=u5e(n.doc,{});i.anchors=new Set;for(const s of n.anchors.keys())i.anchors.add(s.anchor);i.inFlow=!0,i.inStringifyKey=!0;const r=e.toString(i);if(!n.mapKeyWarned){let s=JSON.stringify(r);s.length>40&&(s=s.substring(0,36)+'..."'),d5e(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function Oq(e,t,n){const i=RC(e,void 0,n),r=RC(t,void 0,n);return new nc(i,r)}class nc{constructor(t,n=null){Object.defineProperty(this,Rd,{value:n5e}),this.key=t,this.value=n}clone(t){let{key:n,value:i}=this;return Ra(n)&&(n=n.clone(t)),Ra(i)&&(i=i.clone(t)),new nc(n,i)}toJSON(t,n){const i=n!=null&&n.mapAsMap?new Map:{};return p5e(n,i,this)}toString(t,n,i){return t!=null&&t.doc?GNt(this,t,n,i):JSON.stringify(this)}}function m5e(e,t,n){return(t.inFlow??e.flow?JNt:ZNt)(e,t,n)}function ZNt({comment:e,items:t},n,{blockItemPrefix:i,flowChars:r,itemIndent:s,onChompKeep:o,onComment:l}){const{indent:c,options:{commentString:u}}=n,d=Object.assign({},n,{indent:s,type:null});let f=!1;const h=[];for(let g=0;gv=null,()=>f=!0);v&&(y+=Ty(y,s,u(v))),f&&v&&(f=!1),h.push(i+y)}let m;if(h.length===0)m=r.start+r.end;else{m=h[0];for(let g=1;gv=null);u||(u=f.length>d||y.includes(` +`+Ap(u(e),c),l&&l()):f&&o&&o(),m}function JNt({items:e},t,{flowChars:n,itemIndent:i}){const{indent:r,indentStep:s,flowCollectionPadding:o,options:{commentString:l}}=t;i+=s;const c=Object.assign({},t,{indent:i,inFlow:!0,type:null});let u=!1,d=0;const f=[];for(let g=0;gv=null);u||(u=f.length>d||y.includes(` `)),g0&&(u||(u=f.reduce((w,x)=>w+x.length+2,2)+(y.length+2)>t.options.lineWidth)),u&&(y+=",")),v&&(y+=Ty(y,i,l(v))),f.push(y),d=f.length}const{start:h,end:m}=n;if(f.length===0)return h+m;if(!u){const g=f.reduce((b,v)=>b+v.length+2,2);u=t.options.lineWidth>0&&g>t.options.lineWidth}if(u){let g=h;for(const b of f)g+=b?` ${s}${r}${b}`:` `;return`${g} -${r}${m}`}else return`${h}${o}${f.join(" ")}${o}${m}`}function MI({indent:e,options:{commentString:t}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){const s=Ap(t(i),e);n.push(s.trimStart())}}function _y(e,t){const n=Ss(t)?t.value:t;for(const i of e)if(Ia(i)&&(i.key===t||i.key===n||Ss(i.key)&&i.key.value===n))return i}class hd extends o5e{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Mg,t),this.items=[]}static from(t,n,i){const{keepUndefined:r,replacer:s}=i,o=new this(t),l=(c,u)=>{if(typeof s=="function")u=s.call(n,c,u);else if(Array.isArray(s)&&!s.includes(c))return;(u!==void 0||r)&&o.items.push(Oq(c,u,i))};if(n instanceof Map)for(const[c,u]of n)l(c,u);else if(n&&typeof n=="object")for(const c of Object.keys(n))l(c,n[c]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){var o;let i;Ia(t)?i=t:!t||typeof t!="object"||!("key"in t)?i=new nc(t,t==null?void 0:t.value):i=new nc(t.key,t.value);const r=_y(this.items,i.key),s=(o=this.schema)==null?void 0:o.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);Ss(r.value)&&a5e(i.value)?r.value.value=i.value:r.value=i.value}else if(s){const l=this.items.findIndex(c=>s(i,c)<0);l===-1?this.items.push(i):this.items.splice(l,0,i)}else this.items.push(i)}delete(t){const n=_y(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=_y(this.items,t),r=i==null?void 0:i.value;return(!n&&Ss(r)?r.value:r)??void 0}has(t){return!!_y(this.items,t)}set(t,n){this.add(new nc(t,n),!0)}toJSON(t,n,i){const r=i?new i:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(r);for(const s of this.items)h5e(n,r,s);return r}toString(t,n,i){if(!t)return JSON.stringify(this);for(const r of this.items)if(!Ia(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),p5e(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:i,onComment:n})}}const hk={collection:"map",default:!0,nodeClass:hd,tag:"tag:yaml.org,2002:map",resolve(e,t){return CT(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>hd.from(e,t,n)};class mv extends o5e{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(uk,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=D_(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const i=D_(t);if(typeof i!="number")return;const r=this.items[i];return!n&&Ss(r)?r.value:r}has(t){const n=D_(t);return typeof n=="number"&&n=0?t:null}const pk={collection:"seq",default:!0,nodeClass:mv,tag:"tag:yaml.org,2002:seq",resolve(e,t){return AT(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>mv.from(e,t,n)},FM={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,i){return t=Object.assign({actualString:!0},t),kq(e,t,n,i)}},BM={identify:e=>e==null,createNode:()=>new Oi(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Oi(null),stringify:({source:e},t)=>typeof e=="string"&&BM.test.test(e)?e:t.options.nullStr},Sq={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Oi(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Sq.test.test(e)){const i=e[0]==="t"||e[0]==="T";if(t===i)return e}return t?n.options.trueStr:n.options.falseStr}};function Af({format:e,minFractionDigits:t,tag:n,value:i}){if(typeof i=="bigint")return String(i);const r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let s=Object.is(i,-0)?"-0":JSON.stringify(i);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let o=s.indexOf(".");o<0&&(o=s.length,s+=".");let l=t-(s.length-o-1);for(;l-- >0;)s+="0"}return s}const m5e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Af},g5e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Af(e)}},b5e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new Oi(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Af},UM=e=>typeof e=="bigint"||Number.isInteger(e),Eq=(e,t,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e.substring(t),n);function y5e(e,t,n){const{value:i}=e;return UM(i)&&i>=0?n+i.toString(t):Af(e)}const v5e={identify:e=>UM(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Eq(e,2,8,n),stringify:e=>y5e(e,8,"0o")},x5e={identify:UM,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Eq(e,0,10,n),stringify:Af},w5e={identify:e=>UM(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Eq(e,2,16,n),stringify:e=>y5e(e,16,"0x")},JNt=[hk,pk,FM,BM,Sq,v5e,x5e,w5e,m5e,g5e,b5e];function eie(e){return typeof e=="bigint"||Number.isInteger(e)}const M_=({value:e})=>JSON.stringify(e),eRt=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:M_},{identify:e=>e==null,createNode:()=>new Oi(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:M_},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:M_},{identify:eie,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>eie(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:M_}],tRt={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},nRt=[hk,pk].concat(eRt,tRt),Cq={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let r=0;r1&&t("Each pair must have its own sequence indicator");const r=i.items[0]||new nc(new Oi(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore} +${r}${m}`}else return`${h}${o}${f.join(" ")}${o}${m}`}function MI({indent:e,options:{commentString:t}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){const s=Ap(t(i),e);n.push(s.trimStart())}}function _y(e,t){const n=Ss(t)?t.value:t;for(const i of e)if(Ia(i)&&(i.key===t||i.key===n||Ss(i.key)&&i.key.value===n))return i}class hd extends l5e{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Mg,t),this.items=[]}static from(t,n,i){const{keepUndefined:r,replacer:s}=i,o=new this(t),l=(c,u)=>{if(typeof s=="function")u=s.call(n,c,u);else if(Array.isArray(s)&&!s.includes(c))return;(u!==void 0||r)&&o.items.push(Oq(c,u,i))};if(n instanceof Map)for(const[c,u]of n)l(c,u);else if(n&&typeof n=="object")for(const c of Object.keys(n))l(c,n[c]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){var o;let i;Ia(t)?i=t:!t||typeof t!="object"||!("key"in t)?i=new nc(t,t==null?void 0:t.value):i=new nc(t.key,t.value);const r=_y(this.items,i.key),s=(o=this.schema)==null?void 0:o.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);Ss(r.value)&&o5e(i.value)?r.value.value=i.value:r.value=i.value}else if(s){const l=this.items.findIndex(c=>s(i,c)<0);l===-1?this.items.push(i):this.items.splice(l,0,i)}else this.items.push(i)}delete(t){const n=_y(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=_y(this.items,t),r=i==null?void 0:i.value;return(!n&&Ss(r)?r.value:r)??void 0}has(t){return!!_y(this.items,t)}set(t,n){this.add(new nc(t,n),!0)}toJSON(t,n,i){const r=i?new i:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(r);for(const s of this.items)p5e(n,r,s);return r}toString(t,n,i){if(!t)return JSON.stringify(this);for(const r of this.items)if(!Ia(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),m5e(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:i,onComment:n})}}const hk={collection:"map",default:!0,nodeClass:hd,tag:"tag:yaml.org,2002:map",resolve(e,t){return CT(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>hd.from(e,t,n)};class mv extends l5e{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(uk,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=D_(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const i=D_(t);if(typeof i!="number")return;const r=this.items[i];return!n&&Ss(r)?r.value:r}has(t){const n=D_(t);return typeof n=="number"&&n=0?t:null}const pk={collection:"seq",default:!0,nodeClass:mv,tag:"tag:yaml.org,2002:seq",resolve(e,t){return AT(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>mv.from(e,t,n)},FM={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,i){return t=Object.assign({actualString:!0},t),kq(e,t,n,i)}},BM={identify:e=>e==null,createNode:()=>new Oi(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Oi(null),stringify:({source:e},t)=>typeof e=="string"&&BM.test.test(e)?e:t.options.nullStr},Sq={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Oi(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Sq.test.test(e)){const i=e[0]==="t"||e[0]==="T";if(t===i)return e}return t?n.options.trueStr:n.options.falseStr}};function Af({format:e,minFractionDigits:t,tag:n,value:i}){if(typeof i=="bigint")return String(i);const r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let s=Object.is(i,-0)?"-0":JSON.stringify(i);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let o=s.indexOf(".");o<0&&(o=s.length,s+=".");let l=t-(s.length-o-1);for(;l-- >0;)s+="0"}return s}const g5e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Af},b5e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Af(e)}},y5e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new Oi(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Af},UM=e=>typeof e=="bigint"||Number.isInteger(e),Eq=(e,t,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e.substring(t),n);function v5e(e,t,n){const{value:i}=e;return UM(i)&&i>=0?n+i.toString(t):Af(e)}const x5e={identify:e=>UM(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Eq(e,2,8,n),stringify:e=>v5e(e,8,"0o")},w5e={identify:UM,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Eq(e,0,10,n),stringify:Af},k5e={identify:e=>UM(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Eq(e,2,16,n),stringify:e=>v5e(e,16,"0x")},eRt=[hk,pk,FM,BM,Sq,x5e,w5e,k5e,g5e,b5e,y5e];function eie(e){return typeof e=="bigint"||Number.isInteger(e)}const M_=({value:e})=>JSON.stringify(e),tRt=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:M_},{identify:e=>e==null,createNode:()=>new Oi(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:M_},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:M_},{identify:eie,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>eie(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:M_}],nRt={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},iRt=[hk,pk].concat(tRt,nRt),Cq={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let r=0;r1&&t("Each pair must have its own sequence indicator");const r=i.items[0]||new nc(new Oi(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore} ${r.key.commentBefore}`:i.commentBefore),i.comment){const s=r.value??r.key;s.comment=s.comment?`${i.comment} -${s.comment}`:i.comment}i=r}e.items[n]=Ia(i)?i:new nc(i)}}else t("Expected a sequence for this tag");return e}function O5e(e,t,n){const{replacer:i}=n,r=new mv(e);r.tag="tag:yaml.org,2002:pairs";let s=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof i=="function"&&(o=i.call(t,String(s++),o));let l,c;if(Array.isArray(o))if(o.length===2)l=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const u=Object.keys(o);if(u.length===1)l=u[0],c=o[l];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else l=o;r.items.push(Oq(l,c,n))}return r}const Aq={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:k5e,createNode:O5e};class mw extends mv{constructor(){super(),this.add=hd.prototype.add.bind(this),this.delete=hd.prototype.delete.bind(this),this.get=hd.prototype.get.bind(this),this.has=hd.prototype.has.bind(this),this.set=hd.prototype.set.bind(this),this.tag=mw.tag}toJSON(t,n){if(!n)return super.toJSON(t);const i=new Map;n!=null&&n.onCreate&&n.onCreate(i);for(const r of this.items){let s,o;if(Ia(r)?(s=Cd(r.key,"",n),o=Cd(r.value,s,n)):s=Cd(r,"",n),i.has(s))throw new Error("Ordered maps must not include duplicate keys");i.set(s,o)}return i}static from(t,n,i){const r=O5e(t,n,i),s=new this;return s.items=r.items,s}}mw.tag="tag:yaml.org,2002:omap";const Tq={collection:"seq",identify:e=>e instanceof Map,nodeClass:mw,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=k5e(e,t),i=[];for(const{key:r}of n.items)Ss(r)&&(i.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new mw,n)},createNode:(e,t,n)=>mw.from(e,t,n)};function S5e({value:e,source:t},n){return t&&(e?E5e:C5e).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const E5e={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Oi(!0),stringify:S5e},C5e={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Oi(!1),stringify:S5e},iRt={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Af},rRt={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Af(e)}},sRt={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new Oi(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const i=e.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(t.minFractionDigits=i.length)}return t},stringify:Af},TT=e=>typeof e=="bigint"||Number.isInteger(e);function QM(e,t,n,{intAsBigInt:i}){const r=e[0];if((r==="-"||r==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),i){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const o=BigInt(e);return r==="-"?BigInt(-1)*o:o}const s=parseInt(e,n);return r==="-"?-1*s:s}function _q(e,t,n){const{value:i}=e;if(TT(i)){const r=i.toString(t);return i<0?"-"+n+r.substr(1):n+r}return Af(e)}const aRt={identify:TT,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>QM(e,2,2,n),stringify:e=>_q(e,2,"0b")},oRt={identify:TT,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>QM(e,1,8,n),stringify:e=>_q(e,8,"0")},lRt={identify:TT,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>QM(e,0,10,n),stringify:Af},cRt={identify:TT,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>QM(e,2,16,n),stringify:e=>_q(e,16,"0x")};class gw extends hd{constructor(t){super(t),this.tag=gw.tag}add(t){let n;Ia(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new nc(t.key,null):n=new nc(t,null),_y(this.items,n.key)||this.items.push(n)}get(t,n){const i=_y(this.items,t);return!n&&Ia(i)?Ss(i.key)?i.key.value:i.key:i}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const i=_y(this.items,t);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new nc(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,i){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(t,n,i){const{replacer:r}=i,s=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof r=="function"&&(o=r.call(n,o,o)),s.items.push(Oq(o,null,i));return s}}gw.tag="tag:yaml.org,2002:set";const jq={collection:"map",identify:e=>e instanceof Set,nodeClass:gw,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>gw.from(e,t,n),resolve(e,t){if(CT(e)){if(e.hasAllNullValues(!0))return Object.assign(new gw,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Nq(e,t){const n=e[0],i=n==="-"||n==="+"?e.substring(1):e,r=o=>t?BigInt(o):Number(o),s=i.replace(/_/g,"").split(":").reduce((o,l)=>o*r(60)+r(l),r(0));return n==="-"?r(-1)*s:s}function A5e(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return Af(e);let i="";t<0&&(i="-",t*=n(-1));const r=n(60),s=[t%r];return t<60?s.unshift(0):(t=(t-s[0])/r,s.unshift(t%r),t>=60&&(t=(t-s[0])/r,s.unshift(t))),i+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const T5e={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>Nq(e,n),stringify:A5e},_5e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Nq(e,!1),stringify:A5e},zM={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(zM.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,i,r,s,o,l]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let u=Date.UTC(n,i-1,r,s||0,o||0,l||0,c);const d=t[8];if(d&&d!=="Z"){let f=Nq(d,!1);Math.abs(f)<30&&(f*=60),u-=6e4*f}return new Date(u)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},tie=[hk,pk,FM,BM,E5e,C5e,aRt,oRt,lRt,cRt,iRt,rRt,sRt,Cq,Up,Tq,Aq,jq,T5e,_5e,zM],nie=new Map([["core",JNt],["failsafe",[hk,pk,FM]],["json",nRt],["yaml11",tie],["yaml-1.1",tie]]),iie={binary:Cq,bool:Sq,float:b5e,floatExp:g5e,floatNaN:m5e,floatTime:_5e,int:x5e,intHex:w5e,intOct:v5e,intTime:T5e,map:hk,merge:Up,null:BM,omap:Tq,pairs:Aq,seq:pk,set:jq,timestamp:zM},uRt={"tag:yaml.org,2002:binary":Cq,"tag:yaml.org,2002:merge":Up,"tag:yaml.org,2002:omap":Tq,"tag:yaml.org,2002:pairs":Aq,"tag:yaml.org,2002:set":jq,"tag:yaml.org,2002:timestamp":zM};function Q4(e,t,n){const i=nie.get(t);if(i&&!e)return n&&!i.includes(Up)?i.concat(Up):i.slice();let r=i;if(!r)if(Array.isArray(e))r=[];else{const s=Array.from(nie.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${s} or define customTags array`)}if(Array.isArray(e))for(const s of e)r=r.concat(s);else typeof e=="function"&&(r=e(r.slice()));return n&&(r=r.concat(Up)),r.reduce((s,o)=>{const l=typeof o=="string"?iie[o]:o;if(!l){const c=JSON.stringify(o),u=Object.keys(iie).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return s.includes(l)||s.push(l),s},[])}const dRt=(e,t)=>e.keyt.key?1:0;let fRt=class j5e{constructor({compat:t,customTags:n,merge:i,resolveKnownTags:r,schema:s,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(t)?Q4(t,"compat"):t?Q4(null,t):null,this.name=typeof s=="string"&&s||"core",this.knownTags=r?uRt:{},this.tags=Q4(n,this.name,i),this.toStringOptions=l??null,Object.defineProperty(this,Mg,{value:hk}),Object.defineProperty(this,Th,{value:FM}),Object.defineProperty(this,uk,{value:pk}),this.sortMapEntries=typeof o=="function"?o:o===!0?dRt:null}clone(){const t=Object.create(j5e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function hRt(e,t){var c;const n=[];let i=t.directives===!0;if(t.directives!==!1&&e.directives){const u=e.directives.toString(e);u?(n.push(u),i=!0):e.directives.docStart&&(i=!0)}i&&n.push("---");const r=c5e(e,t),{commentString:s}=r.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=s(e.commentBefore);n.unshift(Ap(u,""))}let o=!1,l=null;if(e.contents){if(Ra(e.contents)){if(e.contents.spaceBefore&&i&&n.push(""),e.contents.commentBefore){const f=s(e.contents.commentBefore);n.push(Ap(f,""))}r.forceBlockIndent=!!e.comment,l=e.contents.comment}const u=l?void 0:()=>o=!0;let d=u1(e.contents,r,()=>l=null,u);l&&(d+=Ty(d,"",s(l))),(d[0]==="|"||d[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${d}`:n.push(d)}else n.push(u1(e.contents,r));if((c=e.directives)!=null&&c.docEnd)if(e.comment){const u=s(e.comment);u.includes(` +${s.comment}`:i.comment}i=r}e.items[n]=Ia(i)?i:new nc(i)}}else t("Expected a sequence for this tag");return e}function S5e(e,t,n){const{replacer:i}=n,r=new mv(e);r.tag="tag:yaml.org,2002:pairs";let s=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof i=="function"&&(o=i.call(t,String(s++),o));let l,c;if(Array.isArray(o))if(o.length===2)l=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const u=Object.keys(o);if(u.length===1)l=u[0],c=o[l];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else l=o;r.items.push(Oq(l,c,n))}return r}const Aq={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:O5e,createNode:S5e};class mw extends mv{constructor(){super(),this.add=hd.prototype.add.bind(this),this.delete=hd.prototype.delete.bind(this),this.get=hd.prototype.get.bind(this),this.has=hd.prototype.has.bind(this),this.set=hd.prototype.set.bind(this),this.tag=mw.tag}toJSON(t,n){if(!n)return super.toJSON(t);const i=new Map;n!=null&&n.onCreate&&n.onCreate(i);for(const r of this.items){let s,o;if(Ia(r)?(s=Cd(r.key,"",n),o=Cd(r.value,s,n)):s=Cd(r,"",n),i.has(s))throw new Error("Ordered maps must not include duplicate keys");i.set(s,o)}return i}static from(t,n,i){const r=S5e(t,n,i),s=new this;return s.items=r.items,s}}mw.tag="tag:yaml.org,2002:omap";const Tq={collection:"seq",identify:e=>e instanceof Map,nodeClass:mw,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=O5e(e,t),i=[];for(const{key:r}of n.items)Ss(r)&&(i.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new mw,n)},createNode:(e,t,n)=>mw.from(e,t,n)};function E5e({value:e,source:t},n){return t&&(e?C5e:A5e).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const C5e={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Oi(!0),stringify:E5e},A5e={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Oi(!1),stringify:E5e},rRt={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Af},sRt={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Af(e)}},aRt={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new Oi(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const i=e.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(t.minFractionDigits=i.length)}return t},stringify:Af},TT=e=>typeof e=="bigint"||Number.isInteger(e);function QM(e,t,n,{intAsBigInt:i}){const r=e[0];if((r==="-"||r==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),i){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const o=BigInt(e);return r==="-"?BigInt(-1)*o:o}const s=parseInt(e,n);return r==="-"?-1*s:s}function _q(e,t,n){const{value:i}=e;if(TT(i)){const r=i.toString(t);return i<0?"-"+n+r.substr(1):n+r}return Af(e)}const oRt={identify:TT,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>QM(e,2,2,n),stringify:e=>_q(e,2,"0b")},lRt={identify:TT,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>QM(e,1,8,n),stringify:e=>_q(e,8,"0")},cRt={identify:TT,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>QM(e,0,10,n),stringify:Af},uRt={identify:TT,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>QM(e,2,16,n),stringify:e=>_q(e,16,"0x")};class gw extends hd{constructor(t){super(t),this.tag=gw.tag}add(t){let n;Ia(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new nc(t.key,null):n=new nc(t,null),_y(this.items,n.key)||this.items.push(n)}get(t,n){const i=_y(this.items,t);return!n&&Ia(i)?Ss(i.key)?i.key.value:i.key:i}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const i=_y(this.items,t);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new nc(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,i){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(t,n,i){const{replacer:r}=i,s=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof r=="function"&&(o=r.call(n,o,o)),s.items.push(Oq(o,null,i));return s}}gw.tag="tag:yaml.org,2002:set";const jq={collection:"map",identify:e=>e instanceof Set,nodeClass:gw,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>gw.from(e,t,n),resolve(e,t){if(CT(e)){if(e.hasAllNullValues(!0))return Object.assign(new gw,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Nq(e,t){const n=e[0],i=n==="-"||n==="+"?e.substring(1):e,r=o=>t?BigInt(o):Number(o),s=i.replace(/_/g,"").split(":").reduce((o,l)=>o*r(60)+r(l),r(0));return n==="-"?r(-1)*s:s}function T5e(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return Af(e);let i="";t<0&&(i="-",t*=n(-1));const r=n(60),s=[t%r];return t<60?s.unshift(0):(t=(t-s[0])/r,s.unshift(t%r),t>=60&&(t=(t-s[0])/r,s.unshift(t))),i+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const _5e={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>Nq(e,n),stringify:T5e},j5e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Nq(e,!1),stringify:T5e},zM={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(zM.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,i,r,s,o,l]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let u=Date.UTC(n,i-1,r,s||0,o||0,l||0,c);const d=t[8];if(d&&d!=="Z"){let f=Nq(d,!1);Math.abs(f)<30&&(f*=60),u-=6e4*f}return new Date(u)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},tie=[hk,pk,FM,BM,C5e,A5e,oRt,lRt,cRt,uRt,rRt,sRt,aRt,Cq,Up,Tq,Aq,jq,_5e,j5e,zM],nie=new Map([["core",eRt],["failsafe",[hk,pk,FM]],["json",iRt],["yaml11",tie],["yaml-1.1",tie]]),iie={binary:Cq,bool:Sq,float:y5e,floatExp:b5e,floatNaN:g5e,floatTime:j5e,int:w5e,intHex:k5e,intOct:x5e,intTime:_5e,map:hk,merge:Up,null:BM,omap:Tq,pairs:Aq,seq:pk,set:jq,timestamp:zM},dRt={"tag:yaml.org,2002:binary":Cq,"tag:yaml.org,2002:merge":Up,"tag:yaml.org,2002:omap":Tq,"tag:yaml.org,2002:pairs":Aq,"tag:yaml.org,2002:set":jq,"tag:yaml.org,2002:timestamp":zM};function Q4(e,t,n){const i=nie.get(t);if(i&&!e)return n&&!i.includes(Up)?i.concat(Up):i.slice();let r=i;if(!r)if(Array.isArray(e))r=[];else{const s=Array.from(nie.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${s} or define customTags array`)}if(Array.isArray(e))for(const s of e)r=r.concat(s);else typeof e=="function"&&(r=e(r.slice()));return n&&(r=r.concat(Up)),r.reduce((s,o)=>{const l=typeof o=="string"?iie[o]:o;if(!l){const c=JSON.stringify(o),u=Object.keys(iie).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return s.includes(l)||s.push(l),s},[])}const fRt=(e,t)=>e.keyt.key?1:0;let hRt=class N5e{constructor({compat:t,customTags:n,merge:i,resolveKnownTags:r,schema:s,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(t)?Q4(t,"compat"):t?Q4(null,t):null,this.name=typeof s=="string"&&s||"core",this.knownTags=r?dRt:{},this.tags=Q4(n,this.name,i),this.toStringOptions=l??null,Object.defineProperty(this,Mg,{value:hk}),Object.defineProperty(this,Th,{value:FM}),Object.defineProperty(this,uk,{value:pk}),this.sortMapEntries=typeof o=="function"?o:o===!0?fRt:null}clone(){const t=Object.create(N5e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function pRt(e,t){var c;const n=[];let i=t.directives===!0;if(t.directives!==!1&&e.directives){const u=e.directives.toString(e);u?(n.push(u),i=!0):e.directives.docStart&&(i=!0)}i&&n.push("---");const r=u5e(e,t),{commentString:s}=r.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=s(e.commentBefore);n.unshift(Ap(u,""))}let o=!1,l=null;if(e.contents){if(Ra(e.contents)){if(e.contents.spaceBefore&&i&&n.push(""),e.contents.commentBefore){const f=s(e.contents.commentBefore);n.push(Ap(f,""))}r.forceBlockIndent=!!e.comment,l=e.contents.comment}const u=l?void 0:()=>o=!0;let d=u1(e.contents,r,()=>l=null,u);l&&(d+=Ty(d,"",s(l))),(d[0]==="|"||d[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${d}`:n.push(d)}else n.push(u1(e.contents,r));if((c=e.directives)!=null&&c.docEnd)if(e.comment){const u=s(e.comment);u.includes(` `)?(n.push("..."),n.push(Ap(u,""))):n.push(`... ${u}`)}else n.push("...");else{let u=e.comment;u&&o&&(u=u.replace(/^\n+/,"")),u&&((!o||l)&&n[n.length-1]!==""&&n.push(""),n.push(Ap(s(u),"")))}return n.join(` `)+` -`}class _T{constructor(t,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Rd,{value:f9});let r=null;typeof n=="function"||Array.isArray(n)?r=n:i===void 0&&n&&(i=n,n=void 0);const s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=s;let{version:o}=s;i!=null&&i._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Wl({version:o}),this.setSchema(o,i),this.contents=t===void 0?null:this.createNode(t,r,i)}clone(){const t=Object.create(_T.prototype,{[Rd]:{value:f9}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Ra(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){H0(this.contents)&&this.contents.add(t)}addIn(t,n){H0(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const i=r5e(this);t.anchor=!n||i.has(n)?s5e(n||"a",i):n}return new wq(t.anchor)}createNode(t,n,i){let r;if(typeof n=="function")t=n.call({"":t},"",t),r=n;else if(Array.isArray(n)){const v=w=>typeof w=="number"||w instanceof String||w instanceof Number,y=n.filter(v).map(String);y.length>0&&(n=n.concat(y)),r=n}else i===void 0&&n&&(i=n,n=void 0);const{aliasDuplicateObjects:s,anchorPrefix:o,flow:l,keepUndefined:c,onTagObj:u,tag:d}=i??{},{onAnchor:f,setAnchors:h,sourceObjects:m}=BNt(this,o||"a"),g={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:u,replacer:r,schema:this.schema,sourceObjects:m},b=RC(t,d,g);return l&&_a(b)&&(b.flow=!0),h(),b}createPair(t,n,i={}){const r=this.createNode(t,null,i),s=this.createNode(n,null,i);return new nc(r,s)}delete(t){return H0(this.contents)?this.contents.delete(t):!1}deleteIn(t){return yS(t)?this.contents==null?!1:(this.contents=null,!0):H0(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return _a(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return yS(t)?!n&&Ss(this.contents)?this.contents.value:this.contents:_a(this.contents)?this.contents.getIn(t,n):void 0}has(t){return _a(this.contents)?this.contents.has(t):!1}hasIn(t){return yS(t)?this.contents!==void 0:_a(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=DI(this.schema,[t],n):H0(this.contents)&&this.contents.set(t,n)}setIn(t,n){yS(t)?this.contents=n:this.contents==null?this.contents=DI(this.schema,Array.from(t),n):H0(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let i;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Wl({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new Wl({version:t}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{const r=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new fRt(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:i,maxAliasCount:r,onAnchor:s,reviver:o}={}){const l={anchors:new Map,doc:this,keep:!t,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=Cd(this.contents,n??"",l);if(typeof s=="function")for(const{count:u,res:d}of l.anchors.values())s(d,u);return typeof o=="function"?Fx(o,{"":c},"",c):c}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return hRt(this,t)}}function H0(e){if(_a(e))return!0;throw new Error("Expected a YAML collection as document contents")}class N5e extends Error{constructor(t,n,i,r){super(),this.name=t,this.code=i,this.message=r,this.pos=n}}class vS extends N5e{constructor(t,n,i){super("YAMLParseError",t,n,i)}}class pRt extends N5e{constructor(t,n,i){super("YAMLWarning",t,n,i)}}const rie=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(l=>t.linePos(l));const{line:i,col:r}=n.linePos[0];n.message+=` at line ${i}, column ${r}`;let s=r-1,o=e.substring(t.lineStarts[i-1],t.lineStarts[i]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){const l=Math.min(s-39,o.length-79);o="…"+o.substring(l),s-=l-1}if(o.length>80&&(o=o.substring(0,79)+"…"),i>1&&/^ *$/.test(o.substring(0,s))){let l=e.substring(t.lineStarts[i-2],t.lineStarts[i-1]);l.length>80&&(l=l.substring(0,79)+`… +`}class _T{constructor(t,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Rd,{value:f9});let r=null;typeof n=="function"||Array.isArray(n)?r=n:i===void 0&&n&&(i=n,n=void 0);const s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=s;let{version:o}=s;i!=null&&i._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Wl({version:o}),this.setSchema(o,i),this.contents=t===void 0?null:this.createNode(t,r,i)}clone(){const t=Object.create(_T.prototype,{[Rd]:{value:f9}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Ra(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){H0(this.contents)&&this.contents.add(t)}addIn(t,n){H0(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const i=s5e(this);t.anchor=!n||i.has(n)?a5e(n||"a",i):n}return new wq(t.anchor)}createNode(t,n,i){let r;if(typeof n=="function")t=n.call({"":t},"",t),r=n;else if(Array.isArray(n)){const v=w=>typeof w=="number"||w instanceof String||w instanceof Number,y=n.filter(v).map(String);y.length>0&&(n=n.concat(y)),r=n}else i===void 0&&n&&(i=n,n=void 0);const{aliasDuplicateObjects:s,anchorPrefix:o,flow:l,keepUndefined:c,onTagObj:u,tag:d}=i??{},{onAnchor:f,setAnchors:h,sourceObjects:m}=UNt(this,o||"a"),g={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:u,replacer:r,schema:this.schema,sourceObjects:m},b=RC(t,d,g);return l&&_a(b)&&(b.flow=!0),h(),b}createPair(t,n,i={}){const r=this.createNode(t,null,i),s=this.createNode(n,null,i);return new nc(r,s)}delete(t){return H0(this.contents)?this.contents.delete(t):!1}deleteIn(t){return yS(t)?this.contents==null?!1:(this.contents=null,!0):H0(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return _a(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return yS(t)?!n&&Ss(this.contents)?this.contents.value:this.contents:_a(this.contents)?this.contents.getIn(t,n):void 0}has(t){return _a(this.contents)?this.contents.has(t):!1}hasIn(t){return yS(t)?this.contents!==void 0:_a(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=DI(this.schema,[t],n):H0(this.contents)&&this.contents.set(t,n)}setIn(t,n){yS(t)?this.contents=n:this.contents==null?this.contents=DI(this.schema,Array.from(t),n):H0(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let i;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Wl({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new Wl({version:t}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{const r=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new hRt(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:i,maxAliasCount:r,onAnchor:s,reviver:o}={}){const l={anchors:new Map,doc:this,keep:!t,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=Cd(this.contents,n??"",l);if(typeof s=="function")for(const{count:u,res:d}of l.anchors.values())s(d,u);return typeof o=="function"?Fx(o,{"":c},"",c):c}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return pRt(this,t)}}function H0(e){if(_a(e))return!0;throw new Error("Expected a YAML collection as document contents")}class R5e extends Error{constructor(t,n,i,r){super(),this.name=t,this.code=i,this.message=r,this.pos=n}}class vS extends R5e{constructor(t,n,i){super("YAMLParseError",t,n,i)}}class mRt extends R5e{constructor(t,n,i){super("YAMLWarning",t,n,i)}}const rie=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(l=>t.linePos(l));const{line:i,col:r}=n.linePos[0];n.message+=` at line ${i}, column ${r}`;let s=r-1,o=e.substring(t.lineStarts[i-1],t.lineStarts[i]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){const l=Math.min(s-39,o.length-79);o="…"+o.substring(l),s-=l-1}if(o.length>80&&(o=o.substring(0,79)+"…"),i>1&&/^ *$/.test(o.substring(0,s))){let l=e.substring(t.lineStarts[i-2],t.lineStarts[i-1]);l.length>80&&(l=l.substring(0,79)+`… `),o=l+o}if(/[^ ]/.test(o)){let l=1;const c=n.linePos[1];(c==null?void 0:c.line)===i&&c.col>r&&(l=Math.max(1,Math.min(c.col-r,80-s)));const u=" ".repeat(s)+"^".repeat(l);n.message+=`: ${o} ${u} `}};function d1(e,{flow:t,indicator:n,next:i,offset:r,onError:s,parentIndent:o,startOnNewline:l}){let c=!1,u=l,d=l,f="",h="",m=!1,g=!1,b=null,v=null,y=null,w=null,x=null,k=null,S=null;for(const E of e)switch(g&&(E.type!=="space"&&E.type!=="newline"&&E.type!=="comma"&&s(E.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),b&&(u&&E.type!=="comment"&&E.type!=="newline"&&s(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),b=null),E.type){case"space":!t&&(n!=="doc-start"||(i==null?void 0:i.type)!=="flow-collection")&&E.source.includes(" ")&&(b=E),d=!0;break;case"comment":{d||s(E,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const j=E.source.substring(1)||" ";f?f+=h+j:f=j,h="",u=!1;break}case"newline":u?f?f+=E.source:(!k||n!=="seq-item-ind")&&(c=!0):h+=E.source,u=!0,m=!0,(v||y)&&(w=E),d=!0;break;case"anchor":v&&s(E,"MULTIPLE_ANCHORS","A node can have at most one anchor"),E.source.endsWith(":")&&s(E.offset+E.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),v=E,S??(S=E.offset),u=!1,d=!1,g=!0;break;case"tag":{y&&s(E,"MULTIPLE_TAGS","A node can have at most one tag"),y=E,S??(S=E.offset),u=!1,d=!1,g=!0;break}case n:(v||y)&&s(E,"BAD_PROP_ORDER",`Anchors and tags must be after the ${E.source} indicator`),k&&s(E,"UNEXPECTED_TOKEN",`Unexpected ${E.source} in ${t??"collection"}`),k=E,u=n==="seq-item-ind"||n==="explicit-key-ind",d=!1;break;case"comma":if(t){x&&s(E,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),x=E,u=!1,d=!1;break}default:s(E,"UNEXPECTED_TOKEN",`Unexpected ${E.type} token`),u=!1,d=!1}const O=e[e.length-1],A=O?O.offset+O.source.length:r;return g&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&s(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),b&&(u&&b.indent<=o||(i==null?void 0:i.type)==="block-map"||(i==null?void 0:i.type)==="block-seq")&&s(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:x,found:k,spaceBefore:c,comment:f,hasNewline:m,anchor:v,tag:y,newlineAfterProp:w,end:A,start:S??A}}function IC(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(` -`))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(IC(t.key)||IC(t.value))return!0}return!1;default:return!0}}function g9(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const i=t.end[0];i.indent===e&&(i.source==="]"||i.source==="}")&&IC(t)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function R5e(e,t,n){const{uniqueKeys:i}=e.options;if(i===!1)return!1;const r=typeof i=="function"?i:(s,o)=>s===o||Ss(s)&&Ss(o)&&s.value===o.value;return t.some(s=>r(s.key,n))}const sie="All mapping items must start at the same column";function mRt({composeNode:e,composeEmptyNode:t},n,i,r,s){var d;const o=(s==null?void 0:s.nodeClass)??hd,l=new o(n.schema);n.atRoot&&(n.atRoot=!1);let c=i.offset,u=null;for(const f of i.items){const{start:h,key:m,sep:g,value:b}=f,v=d1(h,{indicator:"explicit-key-ind",next:m??(g==null?void 0:g[0]),offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0}),y=!v.found;if(y){if(m&&(m.type==="block-seq"?r(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in m&&m.indent!==i.indent&&r(c,"BAD_INDENT",sie)),!v.anchor&&!v.tag&&!g){u=v.end,v.comment&&(l.comment?l.comment+=` -`+v.comment:l.comment=v.comment);continue}(v.newlineAfterProp||IC(m))&&r(m??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((d=v.found)==null?void 0:d.indent)!==i.indent&&r(c,"BAD_INDENT",sie);n.atKey=!0;const w=v.end,x=m?e(n,m,v,r):t(n,w,h,null,v,r);n.schema.compat&&g9(i.indent,m,r),n.atKey=!1,R5e(n,l.items,x)&&r(w,"DUPLICATE_KEY","Map keys must be unique");const k=d1(g??[],{indicator:"map-value-ind",next:b,offset:x.range[2],onError:r,parentIndent:i.indent,startOnNewline:!m||m.type==="block-scalar"});if(c=k.end,k.found){y&&((b==null?void 0:b.type)==="block-map"&&!k.hasNewline&&r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&v.starte&&(e.type==="block-map"||e.type==="block-seq");function bRt({composeNode:e,composeEmptyNode:t},n,i,r,s){var v;const o=i.start.source==="{",l=o?"flow map":"flow sequence",c=(s==null?void 0:s.nodeClass)??(o?hd:mv),u=new c(n.schema);u.flow=!0;const d=n.atRoot;d&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=i.offset+i.start.source.length;for(let y=0;ys===o||Ss(s)&&Ss(o)&&s.value===o.value;return t.some(s=>r(s.key,n))}const sie="All mapping items must start at the same column";function gRt({composeNode:e,composeEmptyNode:t},n,i,r,s){var d;const o=(s==null?void 0:s.nodeClass)??hd,l=new o(n.schema);n.atRoot&&(n.atRoot=!1);let c=i.offset,u=null;for(const f of i.items){const{start:h,key:m,sep:g,value:b}=f,v=d1(h,{indicator:"explicit-key-ind",next:m??(g==null?void 0:g[0]),offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0}),y=!v.found;if(y){if(m&&(m.type==="block-seq"?r(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in m&&m.indent!==i.indent&&r(c,"BAD_INDENT",sie)),!v.anchor&&!v.tag&&!g){u=v.end,v.comment&&(l.comment?l.comment+=` +`+v.comment:l.comment=v.comment);continue}(v.newlineAfterProp||IC(m))&&r(m??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((d=v.found)==null?void 0:d.indent)!==i.indent&&r(c,"BAD_INDENT",sie);n.atKey=!0;const w=v.end,x=m?e(n,m,v,r):t(n,w,h,null,v,r);n.schema.compat&&g9(i.indent,m,r),n.atKey=!1,I5e(n,l.items,x)&&r(w,"DUPLICATE_KEY","Map keys must be unique");const k=d1(g??[],{indicator:"map-value-ind",next:b,offset:x.range[2],onError:r,parentIndent:i.indent,startOnNewline:!m||m.type==="block-scalar"});if(c=k.end,k.found){y&&((b==null?void 0:b.type)==="block-map"&&!k.hasNewline&&r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&v.starte&&(e.type==="block-map"||e.type==="block-seq");function yRt({composeNode:e,composeEmptyNode:t},n,i,r,s){var v;const o=i.start.source==="{",l=o?"flow map":"flow sequence",c=(s==null?void 0:s.nodeClass)??(o?hd:mv),u=new c(n.schema);u.flow=!0;const d=n.atRoot;d&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=i.offset+i.start.source.length;for(let y=0;y0){const y=jT(g,b,n.options.strict,r);y.comment&&(u.comment?u.comment+=` -`+y.comment:u.comment=y.comment),u.range=[i.offset,b,y.offset]}else u.range=[i.offset,b,b];return u}function H4(e,t,n,i,r,s){const o=n.type==="block-map"?mRt(e,t,n,i,s):n.type==="block-seq"?gRt(e,t,n,i,s):bRt(e,t,n,i,s),l=o.constructor;return r==="!"||r===l.tagName?(o.tag=l.tagName,o):(r&&(o.tag=r),o)}function yRt(e,t,n,i,r){var h;const s=i.tag,o=s?t.directives.tagName(s.source,m=>r(s,"TAG_RESOLVE_FAILED",m)):null;if(n.type==="block-seq"){const{anchor:m,newlineAfterProp:g}=i,b=m&&s?m.offset>s.offset?m:s:m??s;b&&(!g||g.offsetm.tag===o&&m.collection===l);if(!c){const m=t.schema.knownTags[o];if((m==null?void 0:m.collection)===l)t.schema.tags.push(Object.assign({},m,{default:!1})),c=m;else return m?r(s,"BAD_COLLECTION_TYPE",`${m.tag} used for ${l} collection, but expects ${m.collection??"scalar"}`,!0):r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),H4(e,t,n,r,o)}const u=H4(e,t,n,r,o,c),d=((h=c.resolve)==null?void 0:h.call(c,u,m=>r(s,"TAG_RESOLVE_FAILED",m),t.options))??u,f=Ra(d)?d:new Oi(d);return f.range=u.range,f.tag=o,c!=null&&c.format&&(f.format=c.format),f}function vRt(e,t,n){const i=t.offset,r=xRt(t,e.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};const s=r.mode===">"?Oi.BLOCK_FOLDED:Oi.BLOCK_LITERAL,o=t.source?wRt(t.source):[];let l=o.length;for(let b=o.length-1;b>=0;--b){const v=o[b][1];if(v===""||v==="\r")l=b;else break}if(l===0){const b=r.chomp==="+"&&o.length>0?` +`+T.comment:j.comment=T.comment);const C=new nc(j,R);if(n.options.keepSourceTokens&&(C.srcToken=w),o){const N=u;I5e(n,N.items,j)&&r(E,"DUPLICATE_KEY","Map keys must be unique"),N.items.push(C)}else{const N=new hd(n.schema);N.flow=!0,N.items.push(C);const P=(R??j).range;N.range=[j.range[0],P[1],P[2]],u.items.push(N)}f=R?R.range[2]:T.end}}const h=o?"}":"]",[m,...g]=i.end;let b=f;if((m==null?void 0:m.source)===h)b=m.offset+m.source.length;else{const y=l[0].toUpperCase()+l.substring(1),w=d?`${y} must end with a ${h}`:`${y} in block collection must be sufficiently indented and end with a ${h}`;r(f,d?"MISSING_CHAR":"BAD_INDENT",w),m&&m.source.length!==1&&g.unshift(m)}if(g.length>0){const y=jT(g,b,n.options.strict,r);y.comment&&(u.comment?u.comment+=` +`+y.comment:u.comment=y.comment),u.range=[i.offset,b,y.offset]}else u.range=[i.offset,b,b];return u}function H4(e,t,n,i,r,s){const o=n.type==="block-map"?gRt(e,t,n,i,s):n.type==="block-seq"?bRt(e,t,n,i,s):yRt(e,t,n,i,s),l=o.constructor;return r==="!"||r===l.tagName?(o.tag=l.tagName,o):(r&&(o.tag=r),o)}function vRt(e,t,n,i,r){var h;const s=i.tag,o=s?t.directives.tagName(s.source,m=>r(s,"TAG_RESOLVE_FAILED",m)):null;if(n.type==="block-seq"){const{anchor:m,newlineAfterProp:g}=i,b=m&&s?m.offset>s.offset?m:s:m??s;b&&(!g||g.offsetm.tag===o&&m.collection===l);if(!c){const m=t.schema.knownTags[o];if((m==null?void 0:m.collection)===l)t.schema.tags.push(Object.assign({},m,{default:!1})),c=m;else return m?r(s,"BAD_COLLECTION_TYPE",`${m.tag} used for ${l} collection, but expects ${m.collection??"scalar"}`,!0):r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),H4(e,t,n,r,o)}const u=H4(e,t,n,r,o,c),d=((h=c.resolve)==null?void 0:h.call(c,u,m=>r(s,"TAG_RESOLVE_FAILED",m),t.options))??u,f=Ra(d)?d:new Oi(d);return f.range=u.range,f.tag=o,c!=null&&c.format&&(f.format=c.format),f}function xRt(e,t,n){const i=t.offset,r=wRt(t,e.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};const s=r.mode===">"?Oi.BLOCK_FOLDED:Oi.BLOCK_LITERAL,o=t.source?kRt(t.source):[];let l=o.length;for(let b=o.length-1;b>=0;--b){const v=o[b][1];if(v===""||v==="\r")l=b;else break}if(l===0){const b=r.chomp==="+"&&o.length>0?` `.repeat(Math.max(1,o.length-1)):"";let v=i+r.length;return t.source&&(v+=t.source.length),{value:b,type:s,comment:r.comment,range:[i,v,v]}}let c=t.indent+r.indent,u=t.offset+r.length,d=0;for(let b=0;bc&&(c=v.length);else{v.length=l;--b)o[b][0].length>c&&(l=b+1);let f="",h="",m=!1;for(let b=0;bc||y[0]===" "?(h===" "?h=` @@ -683,38 +683,38 @@ ${u} `+o[b][0].slice(c);f[f.length-1]!==` `&&(f+=` `);break;default:f+=` -`}const g=i+r.length+t.source.length;return{value:f,type:s,comment:r.comment,range:[i,g,g]}}function xRt({offset:e,props:t},n,i){if(t[0].type!=="block-scalar-header")return i(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:r}=t[0],s=r[0];let o=0,l="",c=-1;for(let h=1;hn(i+h,m,g);switch(r){case"scalar":l=Oi.PLAIN,c=ORt(s,u);break;case"single-quoted-scalar":l=Oi.QUOTE_SINGLE,c=SRt(s,u);break;case"double-quoted-scalar":l=Oi.QUOTE_DOUBLE,c=ERt(s,u);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+s.length,i+s.length]}}const d=i+s.length,f=jT(o,d,t,n);return{value:c,type:l,comment:f.comment,range:[i,d,f.offset]}}function ORt(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),I5e(e)}function SRt(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),I5e(e.slice(1,-1)).replace(/''/g,"'")}function I5e(e){let t,n;try{t=new RegExp(`(.*?)(?n(i+h,m,g);switch(r){case"scalar":l=Oi.PLAIN,c=SRt(s,u);break;case"single-quoted-scalar":l=Oi.QUOTE_SINGLE,c=ERt(s,u);break;case"double-quoted-scalar":l=Oi.QUOTE_DOUBLE,c=CRt(s,u);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+s.length,i+s.length]}}const d=i+s.length,f=jT(o,d,t,n);return{value:c,type:l,comment:f.comment,range:[i,d,f.offset]}}function SRt(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),P5e(e)}function ERt(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),P5e(e.slice(1,-1)).replace(/''/g,"'")}function P5e(e){let t,n;try{t=new RegExp(`(.*?)(?s?e.slice(s,i+1):r)}else n+=r}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function CRt(e,t){let n="",i=e[t+1];for(;(i===" "||i===" "||i===` +`)&&(n+=i>s?e.slice(s,i+1):r)}else n+=r}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function ARt(e,t){let n="",i=e[t+1];for(;(i===" "||i===" "||i===` `||i==="\r")&&!(i==="\r"&&e[t+2]!==` `);)i===` `&&(n+=` -`),t+=1,i=e[t+1];return n||(n=" "),{fold:n,offset:t}}const ARt={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` -`,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function TRt(e,t,n,i){const r=e.substr(t,n),o=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(o)}catch{const l=e.substr(t-2,n+2);return i(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}function P5e(e,t,n,i){const{value:r,type:s,comment:o,range:l}=t.type==="block-scalar"?vRt(e,t,i):kRt(t,e.options.strict,i),c=n?e.directives.tagName(n.source,f=>i(n,"TAG_RESOLVE_FAILED",f)):null;let u;e.options.stringKeys&&e.atKey?u=e.schema[Th]:c?u=_Rt(e.schema,r,c,n,i):t.type==="scalar"?u=jRt(e,r,t,i):u=e.schema[Th];let d;try{const f=u.resolve(r,h=>i(n??t,"TAG_RESOLVE_FAILED",h),e.options);d=Ss(f)?f:new Oi(f)}catch(f){const h=f instanceof Error?f.message:String(f);i(n??t,"TAG_RESOLVE_FAILED",h),d=new Oi(r)}return d.range=l,d.source=r,s&&(d.type=s),c&&(d.tag=c),u.format&&(d.format=u.format),o&&(d.comment=o),d}function _Rt(e,t,n,i,r){var l;if(n==="!")return e[Th];const s=[];for(const c of e.tags)if(!c.collection&&c.tag===n)if(c.default&&c.test)s.push(c);else return c;for(const c of s)if((l=c.test)!=null&&l.test(t))return c;const o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Th])}function jRt({atKey:e,directives:t,schema:n},i,r,s){const o=n.tags.find(l=>{var c;return(l.default===!0||e&&l.default==="key")&&((c=l.test)==null?void 0:c.test(i))})||n[Th];if(n.compat){const l=n.compat.find(c=>{var u;return c.default&&((u=c.test)==null?void 0:u.test(i))})??n[Th];if(o.tag!==l.tag){const c=t.tagString(o.tag),u=t.tagString(l.tag),d=`Value may be parsed as either ${c} or ${u}`;s(r,"TAG_RESOLVE_FAILED",d,!0)}}return o}function NRt(e,t,n){if(t){n??(n=t.length);for(let i=n-1;i>=0;--i){let r=t[i];switch(r.type){case"space":case"comment":case"newline":e-=r.source.length;continue}for(r=t[++i];(r==null?void 0:r.type)==="space";)e+=r.source.length,r=t[++i];break}}return e}const RRt={composeNode:D5e,composeEmptyNode:Rq};function D5e(e,t,n,i){const r=e.atKey,{spaceBefore:s,comment:o,anchor:l,tag:c}=n;let u,d=!0;switch(t.type){case"alias":u=IRt(e,t,i),(l||c)&&i(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":u=P5e(e,t,c,i),l&&(u.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=yRt(RRt,e,t,n,i),l&&(u.anchor=l.source.substring(1))}catch(f){const h=f instanceof Error?f.message:String(f);i(t,"RESOURCE_EXHAUSTION",h)}break;default:{const f=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;i(t,"UNEXPECTED_TOKEN",f),d=!1}}return u??(u=Rq(e,t.offset,void 0,null,n,i)),l&&u.anchor===""&&i(l,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!Ss(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&i(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(u.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?u.comment=o:u.commentBefore=o),e.options.keepSourceTokens&&d&&(u.srcToken=t),u}function Rq(e,t,n,i,{spaceBefore:r,comment:s,anchor:o,tag:l,end:c},u){const d={type:"scalar",offset:NRt(t,n,i),indent:-1,source:""},f=P5e(e,d,l,u);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&u(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(f.spaceBefore=!0),s&&(f.comment=s,f.range[2]=c),f}function IRt({options:e},{offset:t,source:n,end:i},r){const s=new wq(n.substring(1));s.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&r(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+n.length,l=jT(i,o,e.strict,r);return s.range=[t,o,l.offset],l.comment&&(s.comment=l.comment),s}function PRt(e,t,{offset:n,start:i,value:r,end:s},o){const l=Object.assign({_directives:t},e),c=new _T(void 0,l),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=d1(i,{indicator:"doc-start",next:r??(s==null?void 0:s[0]),offset:n,onError:o,parentIndent:0,startOnNewline:!0});d.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!d.hasNewline&&o(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?D5e(u,r,d,o):Rq(u,d.end,i,null,d,o);const f=c.contents.range[2],h=jT(s,f,!1,o);return h.comment&&(c.comment=h.comment),c.range=[n,f,h.offset],c}function SO(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function aie(e){var r;let t="",n=!1,i=!1;for(let s=0;si(n,"TAG_RESOLVE_FAILED",f)):null;let u;e.options.stringKeys&&e.atKey?u=e.schema[Th]:c?u=jRt(e.schema,r,c,n,i):t.type==="scalar"?u=NRt(e,r,t,i):u=e.schema[Th];let d;try{const f=u.resolve(r,h=>i(n??t,"TAG_RESOLVE_FAILED",h),e.options);d=Ss(f)?f:new Oi(f)}catch(f){const h=f instanceof Error?f.message:String(f);i(n??t,"TAG_RESOLVE_FAILED",h),d=new Oi(r)}return d.range=l,d.source=r,s&&(d.type=s),c&&(d.tag=c),u.format&&(d.format=u.format),o&&(d.comment=o),d}function jRt(e,t,n,i,r){var l;if(n==="!")return e[Th];const s=[];for(const c of e.tags)if(!c.collection&&c.tag===n)if(c.default&&c.test)s.push(c);else return c;for(const c of s)if((l=c.test)!=null&&l.test(t))return c;const o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Th])}function NRt({atKey:e,directives:t,schema:n},i,r,s){const o=n.tags.find(l=>{var c;return(l.default===!0||e&&l.default==="key")&&((c=l.test)==null?void 0:c.test(i))})||n[Th];if(n.compat){const l=n.compat.find(c=>{var u;return c.default&&((u=c.test)==null?void 0:u.test(i))})??n[Th];if(o.tag!==l.tag){const c=t.tagString(o.tag),u=t.tagString(l.tag),d=`Value may be parsed as either ${c} or ${u}`;s(r,"TAG_RESOLVE_FAILED",d,!0)}}return o}function RRt(e,t,n){if(t){n??(n=t.length);for(let i=n-1;i>=0;--i){let r=t[i];switch(r.type){case"space":case"comment":case"newline":e-=r.source.length;continue}for(r=t[++i];(r==null?void 0:r.type)==="space";)e+=r.source.length,r=t[++i];break}}return e}const IRt={composeNode:M5e,composeEmptyNode:Rq};function M5e(e,t,n,i){const r=e.atKey,{spaceBefore:s,comment:o,anchor:l,tag:c}=n;let u,d=!0;switch(t.type){case"alias":u=PRt(e,t,i),(l||c)&&i(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":u=D5e(e,t,c,i),l&&(u.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=vRt(IRt,e,t,n,i),l&&(u.anchor=l.source.substring(1))}catch(f){const h=f instanceof Error?f.message:String(f);i(t,"RESOURCE_EXHAUSTION",h)}break;default:{const f=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;i(t,"UNEXPECTED_TOKEN",f),d=!1}}return u??(u=Rq(e,t.offset,void 0,null,n,i)),l&&u.anchor===""&&i(l,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!Ss(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&i(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(u.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?u.comment=o:u.commentBefore=o),e.options.keepSourceTokens&&d&&(u.srcToken=t),u}function Rq(e,t,n,i,{spaceBefore:r,comment:s,anchor:o,tag:l,end:c},u){const d={type:"scalar",offset:RRt(t,n,i),indent:-1,source:""},f=D5e(e,d,l,u);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&u(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(f.spaceBefore=!0),s&&(f.comment=s,f.range[2]=c),f}function PRt({options:e},{offset:t,source:n,end:i},r){const s=new wq(n.substring(1));s.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&r(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+n.length,l=jT(i,o,e.strict,r);return s.range=[t,o,l.offset],l.comment&&(s.comment=l.comment),s}function DRt(e,t,{offset:n,start:i,value:r,end:s},o){const l=Object.assign({_directives:t},e),c=new _T(void 0,l),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=d1(i,{indicator:"doc-start",next:r??(s==null?void 0:s[0]),offset:n,onError:o,parentIndent:0,startOnNewline:!0});d.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!d.hasNewline&&o(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?M5e(u,r,d,o):Rq(u,d.end,i,null,d,o);const f=c.contents.range[2],h=jT(s,f,!1,o);return h.comment&&(c.comment=h.comment),c.range=[n,f,h.offset],c}function SO(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function aie(e){var r;let t="",n=!1,i=!1;for(let s=0;s{const o=SO(n);s?this.warnings.push(new pRt(o,i,r)):this.errors.push(new vS(o,i,r))},this.directives=new Wl({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:i,afterEmptyLine:r}=aie(this.prelude);if(i){const s=t.contents;if(n)t.comment=t.comment?`${t.comment} +`)+(o.substring(1)||" "),n=!0,i=!1;break;case"%":((r=e[s+1])==null?void 0:r[0])!=="#"&&(s+=1),n=!1;break;default:n||(i=!0),n=!1}}return{comment:t,afterEmptyLine:i}}let MRt=class{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,r,s)=>{const o=SO(n);s?this.warnings.push(new mRt(o,i,r)):this.errors.push(new vS(o,i,r))},this.directives=new Wl({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:i,afterEmptyLine:r}=aie(this.prelude);if(i){const s=t.contents;if(n)t.comment=t.comment?`${t.comment} ${i}`:i;else if(r||t.directives.docStart||!s)t.commentBefore=i;else if(_a(s)&&!s.flow&&s.items.length>0){let o=s.items[0];Ia(o)&&(o=o.key);const l=o.commentBefore;o.commentBefore=l?`${i} ${l}`:i}else{const o=s.commentBefore;s.commentBefore=o?`${i} -${o}`:i}}if(n){for(let s=0;s{const s=SO(t);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",i,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=PRt(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,i=new vS(SO(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){const i="Unexpected doc-end without preceding document";this.errors.push(new vS(SO(t),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;const n=jT(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const i=this.doc.comment;this.doc.comment=i?`${i} -${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new vS(SO(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const i=Object.assign({_directives:this.directives},this.options),r=new _T(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}};const M5e="\uFEFF",L5e="",$5e="",b9="";function MRt(e){switch(e){case M5e:return"byte-order-mark";case L5e:return"doc-mode";case $5e:return"flow-error-end";case b9:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` +${o}`:i}}if(n){for(let s=0;s{const s=SO(t);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",i,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=DRt(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,i=new vS(SO(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){const i="Unexpected doc-end without preceding document";this.errors.push(new vS(SO(t),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;const n=jT(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const i=this.doc.comment;this.doc.comment=i?`${i} +${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new vS(SO(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const i=Object.assign({_directives:this.directives},this.options),r=new _T(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}};const L5e="\uFEFF",$5e="",F5e="",b9="";function LRt(e){switch(e){case L5e:return"byte-order-mark";case $5e:return"doc-mode";case F5e:return"flow-error-end";case b9:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` `:case`\r `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function qd(e){switch(e){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}const oie=new Set("0123456789ABCDEFabcdef"),LRt=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),L_=new Set(",[]{}"),$Rt=new Set(` ,[]{} -\r `),q4=e=>!e||$Rt.has(e);class FRt{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let i=this.next??"stream";for(;i&&(n||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===` +`:case"\r":case" ":return!0;default:return!1}}const oie=new Set("0123456789ABCDEFabcdef"),$Rt=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),L_=new Set(",[]{}"),FRt=new Set(` ,[]{} +\r `),q4=e=>!e||FRt.has(e);class BRt{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let i=this.next??"stream";for(;i&&(n||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===` `?!0:n==="\r"?this.buffer[t+1]===` `:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let i=0;for(;n===" ";)n=this.buffer[++i+t];if(n==="\r"){const r=this.buffer[i+t+1];if(r===` `||!r&&!this.atEnd)return t+i+1}return n===` `||i>=this.indentNext||!n&&!this.atEnd?t+i:-1}if(n==="-"||n==="."){const i=this.buffer.substr(t,3);if((i==="---"||i==="...")&&qd(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&tthis.indentValue&&!qd(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&qd(n)){const i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(q4),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,i=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=i=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&ithis.indentValue&&!qd(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&qd(n)){const i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(q4),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,i=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=i=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&i"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>qd(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,i;e:for(let s=this.pos;i=this.buffer[s];++s)switch(i){case" ":n+=1;break;case` `:t=s,n=0;break;case"\r":{const o=this.buffer[s+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===` @@ -724,25 +724,25 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus `&&s>=this.pos&&s+1+n>l)t=s;else break}while(!0);return yield b9,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,i=this.pos-1,r;for(;r=this.buffer[++i];)if(r===":"){const s=this.buffer[i+1];if(qd(s)||t&&L_.has(s))break;n=i}else if(qd(r)){let s=this.buffer[i+1];if(r==="\r"&&(s===` `?(i+=1,r=` `,s=this.buffer[i+1]):n=i),s==="#"||t&&L_.has(s))break;if(r===` -`){const o=this.continueScalar(i+1);if(o===-1)break;i=Math.max(i,o-2)}}else{if(t&&L_.has(r))break;n=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield b9,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const i=this.buffer.slice(this.pos,t);return i?(yield i,this.pos+=i.length,i.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(q4),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,i=this.charAt(1);if(qd(i)||n&&L_.has(i)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!qd(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(LRt.has(n))n=this.buffer[++t];else if(n==="%"&&oie.has(this.buffer[t+1])&&oie.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===` +`){const o=this.continueScalar(i+1);if(o===-1)break;i=Math.max(i,o-2)}}else{if(t&&L_.has(r))break;n=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield b9,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const i=this.buffer.slice(this.pos,t);return i?(yield i,this.pos+=i.length,i.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(q4),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,i=this.charAt(1);if(qd(i)||n&&L_.has(i)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!qd(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if($Rt.has(n))n=this.buffer[++t];else if(n==="%"&&oie.has(this.buffer[t+1])&&oie.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===` `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===` -`?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,i;do i=this.buffer[++n];while(i===" "||t&&i===" ");const r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(t){let n=this.pos,i=this.buffer[n];for(;!t(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class BRt{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,i=this.lineStarts.length;for(;n>1;this.lineStarts[s]=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function LI(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&(t==null?void 0:t.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const i=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in i?i.indent:0:n.type==="flow-collection"&&i.type==="document"&&(n.indent=0),n.type==="flow-collection"&&cie(n),i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{const r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{const r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{const r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&lie(r.start)===-1&&(n.indent===0||r.start.every(s=>s.type!=="comment"||s.indent0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(t){let n=this.pos,i=this.buffer[n];for(;!t(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class URt{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,i=this.lineStarts.length;for(;n>1;this.lineStarts[s]=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function LI(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&(t==null?void 0:t.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const i=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in i?i.indent:0:n.type==="flow-collection"&&i.type==="document"&&(n.indent=0),n.type==="flow-collection"&&cie(n),i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{const r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{const r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{const r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&lie(r.start)===-1&&(n.indent===0||r.start.every(s=>s.type!=="comment"||s.indent=t.indent){const r=!this.onKeyLine&&this.indent===t.indent,s=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let o=[];if(s&&n.sep&&!n.value){const l=[];for(let c=0;ct.indent&&(l.length=0);break;default:l.length=0}}l.length>=2&&(o=n.sep.splice(l[1]))}switch(this.type){case"anchor":case"tag":s||n.value?(o.push(this.sourceToken),t.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):s||n.value?(o.push(this.sourceToken),t.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Km(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(F5e(n.key)&&!Km(n.sep,"newline")){const l=q0(n.start),c=n.key,u=n.sep;u.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:c,sep:u}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(Km(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=q0(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||s?t.items.push({start:o,key:null,sep:[this.sourceToken]}):Km(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const l=this.flowScalar(this.type);s||n.value?(t.items.push({start:o,key:l,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(l):(Object.assign(n,{key:l,sep:[]}),this.onKeyLine=!0);return}default:{const l=this.startBlockValue(t);if(l){if(l.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Km(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&t.items.push({start:o});this.stack.push(l);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var i;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const r="end"in n.value?n.value.end:void 0,s=Array.isArray(r)?r[r.length-1]:void 0;(s==null?void 0:s.type)==="comment"?r==null||r.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const r=t.items[t.items.length-2],s=(i=r==null?void 0:r.value)==null?void 0:i.end;if(Array.isArray(s)){LI(s,n.start),s.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Km(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const r=this.startBlockValue(t);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while((i==null?void 0:i.type)==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const r=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const i=this.startBlockValue(t);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{const i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===t.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){const r=$_(i),s=q0(r);cie(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const l={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:s,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(` +`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){var i;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const r="end"in n.value?n.value.end:void 0,s=Array.isArray(r)?r[r.length-1]:void 0;(s==null?void 0:s.type)==="comment"?r==null||r.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const r=t.items[t.items.length-2],s=(i=r==null?void 0:r.value)==null?void 0:i.end;if(Array.isArray(s)){LI(s,n.start),s.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const r=!this.onKeyLine&&this.indent===t.indent,s=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let o=[];if(s&&n.sep&&!n.value){const l=[];for(let c=0;ct.indent&&(l.length=0);break;default:l.length=0}}l.length>=2&&(o=n.sep.splice(l[1]))}switch(this.type){case"anchor":case"tag":s||n.value?(o.push(this.sourceToken),t.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):s||n.value?(o.push(this.sourceToken),t.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Km(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(B5e(n.key)&&!Km(n.sep,"newline")){const l=q0(n.start),c=n.key,u=n.sep;u.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:c,sep:u}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(Km(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=q0(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||s?t.items.push({start:o,key:null,sep:[this.sourceToken]}):Km(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const l=this.flowScalar(this.type);s||n.value?(t.items.push({start:o,key:l,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(l):(Object.assign(n,{key:l,sep:[]}),this.onKeyLine=!0);return}default:{const l=this.startBlockValue(t);if(l){if(l.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Km(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&t.items.push({start:o});this.stack.push(l);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var i;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const r="end"in n.value?n.value.end:void 0,s=Array.isArray(r)?r[r.length-1]:void 0;(s==null?void 0:s.type)==="comment"?r==null||r.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const r=t.items[t.items.length-2],s=(i=r==null?void 0:r.value)==null?void 0:i.end;if(Array.isArray(s)){LI(s,n.start),s.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Km(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const r=this.startBlockValue(t);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while((i==null?void 0:i.type)==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const r=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const i=this.startBlockValue(t);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{const i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===t.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){const r=$_(i),s=q0(r);cie(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const l={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:s,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(` `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(` -`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=$_(t),i=q0(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=$_(t),i=q0(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};function QRt(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new BRt||null,prettyErrors:t}}function B5e(e,t={}){const{lineCounter:n,prettyErrors:i}=QRt(t),r=new URt(n==null?void 0:n.addNewLine),s=new DRt(t);let o=null;for(const l of s.compose(r.parse(e),!0,e.length))if(!o)o=l;else if(o.options.logLevel!=="silent"){o.errors.push(new vS(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(o.errors.forEach(rie(e,n)),o.warnings.forEach(rie(e,n))),o}function zRt(e,t,n){let i;const r=B5e(e,n);if(!r)return null;if(r.warnings.forEach(s=>u5e(r.options.logLevel,s)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},n))}function VM(e,t,n){let i=null;if(typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){const r=Math.round(n);n=r<1?void 0:r>8?{indent:8}:{indent:r}}if(e===void 0){const{keepUndefined:r}=n??t??{};if(!r)return}return ET(e)&&!i?e.toString(n):new _T(e,i,n).toString(n)}const U5e=1024;let VRt=0,gd=class{constructor(t,n){this.from=t,this.to=n}};class li{constructor(t={}){this.id=VRt++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=t.combine||null}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof t!="function"&&(t=Ja.match(t)),n=>{let i=t(n);return i===void 0?null:[this,i]}}}li.closedBy=new li({deserialize:e=>e.split(" ")});li.openedBy=new li({deserialize:e=>e.split(" ")});li.group=new li({deserialize:e=>e.split(" ")});li.isolate=new li({deserialize:e=>{if(e&&e!="rtl"&&e!="ltr"&&e!="auto")throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}});li.contextHash=new li({perNode:!0});li.lookAhead=new li({perNode:!0});li.mounted=new li({perNode:!0});class bw{constructor(t,n,i,r=!1){this.tree=t,this.overlay=n,this.parser=i,this.bracketed=r}static get(t){return t&&t.props&&t.props[li.mounted.id]}}const HRt=Object.create(null);class Ja{constructor(t,n,i,r=0){this.name=t,this.props=n,this.id=i,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):HRt,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),r=new Ja(t.name||"",n,t.id,i);if(t.props){for(let s of t.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[s[0].id]=s[1]}}return r}prop(t){return this.props[t.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(t){if(typeof t=="string"){if(this.name==t)return!0;let n=this.prop(li.group);return n?n.indexOf(t)>-1:!1}return this.id==t}static match(t){let n=Object.create(null);for(let i in t)for(let r of i.split(" "))n[r]=t[i];return i=>{for(let r=i.prop(li.group),s=-1;s<(r?r.length:0);s++){let o=n[s<0?i.name:r[s]];if(o)return o}}}}Ja.none=new Ja("",Object.create(null),0,8);class mk{constructor(t){this.types=t;for(let n=0;n0;for(let c=this.cursor(o|Ar.IncludeAnonymous);;){let u=!1;if(c.from<=s&&c.to>=r&&(!l&&c.type.isAnonymous||n(c)!==!1)){if(c.firstChild())continue;u=!0}for(;u&&i&&(l||!c.type.isAnonymous)&&i(c),!c.nextSibling();){if(!c.parent())return;u=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let n in this.props)t.push([+n,this.props[n]]);return t}balance(t={}){return this.children.length<=8?this:Dq(Ja.none,this.children,this.positions,0,this.children.length,0,this.length,(n,i,r)=>new Hi(this.type,n,i,r,this.propValues),t.makeTree||((n,i,r)=>new Hi(Ja.none,n,i,r)))}static build(t){return GRt(t)}}Hi.empty=new Hi(Ja.none,[],[],0);class Iq{constructor(t,n){this.buffer=t,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Iq(this.buffer,this.index)}}class cb{constructor(t,n,i){this.buffer=t,this.length=n,this.set=i}get type(){return Ja.none}toString(){let t=[];for(let n=0;n0));c=o[c+3]);return l}slice(t,n,i){let r=this.buffer,s=new Uint16Array(n-t),o=0;for(let l=t,c=0;l=t&&nt;case 1:return n<=t&&i>t;case 2:return i>t;case 4:return!0}}function PC(e,t,n,i){for(var r;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to0?l.length:-1;t!=u;t+=n){let d=l[t],f=c[t]+o.from,h;if(!(!(s&Ar.EnterBracketed&&d instanceof Hi&&(h=bw.get(d))&&!h.overlay&&h.bracketed&&i>=f&&i<=f+d.length)&&!Q5e(r,i,f,f+d.length))){if(d instanceof cb){if(s&Ar.ExcludeBuffers)continue;let m=d.findChild(0,d.buffer.length,n,i-f,r);if(m>-1)return new ch(new qRt(o,d,t,f),null,m)}else if(s&Ar.IncludeAnonymous||!d.type.isAnonymous||Pq(d)){let m;if(!(s&Ar.IgnoreMounts)&&(m=bw.get(d))&&!m.overlay)return new _l(m.tree,f,t,o);let g=new _l(d,f,t,o);return s&Ar.IncludeAnonymous||!g.type.isAnonymous?g:g.nextChild(n<0?d.children.length-1:0,n,i,r,s)}}}if(s&Ar.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?t=o.index+n:t=n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}prop(t){return this._tree.prop(t)}enter(t,n,i=0){let r;if(!(i&Ar.IgnoreOverlays)&&(r=bw.get(this._tree))&&r.overlay){let s=t-this.from,o=i&Ar.EnterBracketed&&r.bracketed;for(let{from:l,to:c}of r.overlay)if((n>0||o?l<=s:l=s:c>s))return new _l(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,i)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function die(e,t,n,i){let r=e.cursor(),s=[];if(!r.firstChild())return s;if(n!=null){for(let o=!1;!o;)if(o=r.type.is(n),!r.nextSibling())return s}for(;;){if(i!=null&&r.type.is(i))return s;if(r.type.is(t)&&s.push(r.node),!r.nextSibling())return i==null?s:[]}}function y9(e,t,n=t.length-1){for(let i=e;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(t[n]&&t[n]!=i.name)return!1;n--}}return!0}class qRt{constructor(t,n,i,r){this.parent=t,this.buffer=n,this.index=i,this.start=r}}class ch extends z5e{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,n,i){super(),this.context=t,this._parent=n,this.index=i,this.type=t.buffer.set.types[t.buffer.buffer[i]]}child(t,n,i){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t,n-this.context.start,i);return s<0?null:new ch(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}prop(t){return this.type.prop(t)}enter(t,n,i=0){if(i&Ar.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return s<0?null:new ch(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new ch(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new ch(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],n=[],{buffer:i}=this.context,r=this.index+4,s=i.buffer[this.index+3];if(s>r){let o=i.buffer[this.index+1];t.push(i.slice(r,s,o)),n.push(0)}return new Hi(this.type,t,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function V5e(e){if(!e.length)return null;let t=0,n=e[0];for(let s=1;sn.from||o.to=t){let l=new _l(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(PC(l,t,n,!1))}}return r?V5e(r):i}class $I{get name(){return this.type.name}constructor(t,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~Ar.EnterBracketed,t instanceof _l)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let i=t._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return t?(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0):!1}yieldBuf(t,n){this.index=t;let{start:i,buffer:r}=this.buffer;return this.type=n||r.set.types[r.buffer[t]],this.from=i+r.buffer[t+1],this.to=i+r.buffer[t+2],!0}yield(t){return t?t instanceof _l?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,n,i){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,n,i,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],t,n-this.buffer.start,i);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,n,i=this.mode){return this.buffer?i&Ar.ExcludeBuffers?!1:this.enterChild(1,t,n):this.yield(this._tree.enter(t,n,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Ar.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&Ar.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode)):!1;let{buffer:n}=this.buffer,i=this.stack.length-1;if(t<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(n.findChild(r,this.index,-1,0,4))}else{let r=n.buffer[this.index+3];if(r<(i<0?n.buffer.length:n.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let n,i,{buffer:r}=this;if(r){if(t>0){if(this.index-1)for(let s=n+t,o=t<0?-1:i._tree.children.length;s!=o;s+=t){let l=i._tree.children[s];if(this.mode&Ar.IncludeAnonymous||l instanceof cb||!l.type.isAnonymous||Pq(l))return!1}return!0}move(t,n){if(n&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,n=0){for(;(this.from==this.to||(n<1?this.from>=t:this.from>t)||(n>-1?this.to<=t:this.to=0;){for(let o=t;o;o=o._parent)if(o.index==r){if(r==this.index)return o;n=o,i=s+1;break e}r=this.stack[--s]}for(let r=i;r=0;s--){if(s<0)return y9(this._tree,t,r);let o=i[n.buffer[this.stack[s]]];if(!o.isAnonymous){if(t[r]&&t[r]!=o.name)return!1;r--}}return!0}}function Pq(e){return e.children.some(t=>t instanceof cb||!t.type.isAnonymous||Pq(t))}function GRt(e){var t;let{buffer:n,nodeSet:i,maxBufferLength:r=U5e,reused:s=[],minRepeatType:o=i.types.length}=e,l=Array.isArray(n)?new Iq(n,n.length):n,c=i.types,u=0,d=0;function f(S,O,A,E,j,T){let{id:R,start:C,end:N,size:P}=l,I=d,D=u;if(P<0)if(l.next(),P==-1){let H=s[R];A.push(H),E.push(C-S);return}else if(P==-3){u=R;return}else if(P==-4){d=R;return}else throw new RangeError(`Unrecognized record size: ${P}`);let _=c[R],L,F,M=C-S;if(N-C<=r&&(F=v(l.pos-O,j))){let H=new Uint16Array(F.size-F.skip),q=l.pos-F.size,U=H.length;for(;l.pos>q;)U=y(F.start,H,U);L=new cb(H,N-F.start,i),M=F.start-S}else{let H=l.pos-P;l.next();let q=[],U=[],Z=R>=o?R:-1,z=0,J=N;for(;l.pos>H;)Z>=0&&l.id==Z&&l.size>=0?(l.end<=J-r&&(g(q,U,C,z,l.end,J,Z,I,D),z=q.length,J=l.end),l.next()):T>2500?h(C,H,q,U):f(C,H,q,U,Z,T+1);if(Z>=0&&z>0&&z-1&&z>0){let ne=m(_,D);L=Dq(_,q,U,0,q.length,0,N-C,ne,ne)}else L=b(_,q,U,N-C,I-N,D)}A.push(L),E.push(M)}function h(S,O,A,E){let j=[],T=0,R=-1;for(;l.pos>O;){let{id:C,start:N,end:P,size:I}=l;if(I>4)l.next();else{if(R>-1&&N=0;P-=3)C[I++]=j[P],C[I++]=j[P+1]-N,C[I++]=j[P+2]-N,C[I++]=I;A.push(new cb(C,j[2]-N,i)),E.push(N-S)}}function m(S,O){return(A,E,j)=>{let T=0,R=A.length-1,C,N;if(R>=0&&(C=A[R])instanceof Hi){if(!R&&C.type==S&&C.length==j)return C;(N=C.prop(li.lookAhead))&&(T=E[R]+C.length+N)}return b(S,A,E,j,T,O)}}function g(S,O,A,E,j,T,R,C,N){let P=[],I=[];for(;S.length>E;)P.push(S.pop()),I.push(O.pop()+A-j);S.push(b(i.types[R],P,I,T-j,C-T,N)),O.push(j-A)}function b(S,O,A,E,j,T,R){if(T){let C=[li.contextHash,T];R=R?[C].concat(R):[C]}if(j>25){let C=[li.lookAhead,j];R=R?[C].concat(R):[C]}return new Hi(S,O,A,E,R)}function v(S,O){let A=l.fork(),E=0,j=0,T=0,R=A.end-r,C={size:0,start:0,skip:0};e:for(let N=A.pos-S;A.pos>N;){let P=A.size;if(A.id==O&&P>=0){C.size=E,C.start=j,C.skip=T,T+=4,E+=4,A.next();continue}let I=A.pos-P;if(P<0||I=o?4:0,_=A.start;for(A.next();A.pos>I;){if(A.size<0)if(A.size==-3||A.size==-4)D+=4;else break e;else A.id>=o&&(D+=4);A.next()}j=_,E+=P,T+=D}return(O<0||E==S)&&(C.size=E,C.start=j,C.skip=T),C.size>4?C:void 0}function y(S,O,A){let{id:E,start:j,end:T,size:R}=l;if(l.next(),R>=0&&E4){let N=l.pos-(R-4);for(;l.pos>N;)A=y(S,O,A)}O[--A]=C,O[--A]=T-S,O[--A]=j-S,O[--A]=E}else R==-3?u=E:R==-4&&(d=E);return A}let w=[],x=[];for(;l.pos>0;)f(e.start||0,e.bufferStart||0,w,x,-1,0);let k=(t=e.length)!==null&&t!==void 0?t:w.length?x[0]+w[0].length:0;return new Hi(c[e.topID],w.reverse(),x.reverse(),k)}const fie=new WeakMap;function MN(e,t){if(!e.isAnonymous||t instanceof cb||t.type!=e)return 1;let n=fie.get(t);if(n==null){n=1;for(let i of t.children){if(i.type!=e||!(i instanceof Hi)){n=1;break}n+=MN(e,i)}fie.set(t,n)}return n}function Dq(e,t,n,i,r,s,o,l,c){let u=0;for(let g=i;g=d)break;O+=A}if(x==k+1){if(O>d){let A=g[k];m(A.children,A.positions,0,A.children.length,b[k]+w);continue}f.push(g[k])}else{let A=b[x-1]+g[x-1].length-S;f.push(Dq(e,g,b,k,x,S,A,null,c))}h.push(S+w-s)}}return m(t,n,i,r,0),(l||c)(f,h,o)}class Mq{constructor(){this.map=new WeakMap}setBuffer(t,n,i){let r=this.map.get(t);r||this.map.set(t,r=new Map),r.set(n,i)}getBuffer(t,n){let i=this.map.get(t);return i&&i.get(n)}set(t,n){t instanceof ch?this.setBuffer(t.context.buffer,t.index,n):t instanceof _l&&this.map.set(t.tree,n)}get(t){return t instanceof ch?this.getBuffer(t.context.buffer,t.index):t instanceof _l?this.map.get(t.tree):void 0}cursorSet(t,n){t.buffer?this.setBuffer(t.buffer.buffer,t.index,n):this.map.set(t.tree,n)}cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree)}}class Qp{constructor(t,n,i,r,s=!1,o=!1){this.from=t,this.to=n,this.tree=i,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],i=!1){let r=[new Qp(0,t.length,t,0,!1,i)];for(let s of n)s.to>t.length&&r.push(s);return r}static applyChanges(t,n,i=128){if(!n.length)return t;let r=[],s=1,o=t.length?t[0]:null;for(let l=0,c=0,u=0;;l++){let d=l=i)for(;o&&o.from=h.from||f<=h.to||u){let m=Math.max(h.from,c)-u,g=Math.min(h.to,f)-u;h=m>=g?null:new Qp(m,g,h.tree,h.offset+u,l>0,!!d)}if(h&&r.push(h),o.to>f)break;o=snew gd(r.from,r.to)):[new gd(0,0)]:[new gd(0,t.length)],this.createParse(t,n||[],i)}parse(t,n,i){let r=this.startParse(t,n,i);for(;;){let s=r.advance();if(s)return s}}}class XRt{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,n){return this.string.slice(t,n)}}function H5e(e){return(t,n,i,r)=>new ZRt(t,e,n,i,r)}class hie{constructor(t,n,i,r,s,o){this.parser=t,this.parse=n,this.overlay=i,this.bracketed=r,this.target=s,this.from=o}}function pie(e){if(!e.length||e.some(t=>t.from>=t.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(e))}class YRt{constructor(t,n,i,r,s,o,l,c){this.parser=t,this.predicate=n,this.mounts=i,this.index=r,this.start=s,this.bracketed=o,this.target=l,this.prev=c,this.depth=0,this.ranges=[]}}const v9=new li({perNode:!0});class ZRt{constructor(t,n,i,r,s){this.nest=n,this.input=i,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=t}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new Hi(i.type,i.children,i.positions,i.length,i.propValues.concat([[v9,this.stoppedAt]]))),i}let t=this.inner[this.innerDone],n=t.parse.advance();if(n){this.innerDone++;let i=Object.assign(Object.create(null),t.target.props);i[li.mounted.id]=new bw(n,t.overlay,t.parser,t.bracketed),t.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let t=this.input.length;for(let n=this.innerDone;n=this.stoppedAt)l=!1;else if(t.hasNode(r)){if(n){let u=n.mounts.find(d=>d.frag.from<=r.from&&d.frag.to>=r.to&&d.mount.overlay);if(u)for(let d of u.mount.overlay){let f=d.from+u.pos,h=d.to+u.pos;f>=r.from&&h<=r.to&&!n.ranges.some(m=>m.fromf)&&n.ranges.push({from:f,to:h})}}l=!1}else if(i&&(o=JRt(i.ranges,r.from,r.to)))l=o!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.fromnew gd(f.from-r.from,f.to-r.from)):null,!!s.bracketed,r.tree,d.length?d[0].from:r.from)),s.overlay?d.length&&(i={ranges:d,depth:0,prev:i}):l=!1}}else if(n&&(c=n.predicate(r))&&(c===!0&&(c=new gd(r.from,r.to)),c.from=0&&n.ranges[u].to==c.from?n.ranges[u]={from:n.ranges[u].from,to:c.to}:n.ranges.push(c)}if(l&&r.firstChild())n&&n.depth++,i&&i.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(n&&!--n.depth){let u=bie(this.ranges,n.ranges);u.length&&(pie(u),this.inner.splice(n.index,0,new hie(n.parser,n.parser.startParse(this.input,yie(n.mounts,u),u),n.ranges.map(d=>new gd(d.from-n.start,d.to-n.start)),n.bracketed,n.target,u[0].from))),n=n.prev}i&&!--i.depth&&(i=i.prev)}}}}function JRt(e,t,n){for(let i of e){if(i.from>=n)break;if(i.to>t)return i.from<=t&&i.to>=n?2:1}return 0}function mie(e,t,n,i,r,s){if(t=t&&n.enter(i,1,Ar.IgnoreOverlays|Ar.ExcludeBuffers)))if(n.to<=t)n.next(!1)||(this.done=!0);else break}hasNode(t){if(this.moveTo(t.from),!this.done&&this.cursor.from+this.offset==t.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==t.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof Hi)n=n.children[0];else break}return!1}}let tIt=class{constructor(t){var n;if(this.fragments=t,this.curTo=0,this.fragI=0,t.length){let i=this.curFrag=t[0];this.curTo=(n=i.tree.prop(v9))!==null&&n!==void 0?n:i.to,this.inner=new gie(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(t){for(;this.curFrag&&t.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=t.from&&this.curTo>=t.to&&this.inner.hasNode(t)}nextFrag(){var t;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let n=this.curFrag=this.fragments[this.fragI];this.curTo=(t=n.tree.prop(v9))!==null&&t!==void 0?t:n.to,this.inner=new gie(n.tree,-n.offset)}}findMounts(t,n){var i;let r=[];if(this.inner){this.inner.cursor.moveTo(t,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(i=s.tree)===null||i===void 0?void 0:i.prop(li.mounted);if(o&&o.parser==n)for(let l=this.fragI;l=s.to)break;c.tree==this.curFrag.tree&&r.push({frag:c,pos:s.from-c.offset,mount:o})}}}return r}};function bie(e,t){let n=null,i=t;for(let r=1,s=0;r=l)break;c.to<=o||(n||(i=n=t.slice()),c.froml&&n.splice(s+1,0,new gd(l,c.to))):c.to>l?n[s--]=new gd(l,c.to):n.splice(s--,1))}}return i}function nIt(e,t,n,i){let r=0,s=0,o=!1,l=!1,c=-1e9,u=[];for(;;){let d=r==e.length?1e9:o?e[r].to:e[r].from,f=s==t.length?1e9:l?t[s].to:t[s].from;if(o!=l){let h=Math.max(c,n),m=Math.min(d,f,i);hnew gd(h.from+i,h.to+i)),f=nIt(t,d,c,u);for(let h=0,m=c;;h++){let g=h==f.length,b=g?u:f[h].from;if(b>m&&n.push(new Qp(m,b,r.tree,-o,s.from>=m||s.openStart,s.to<=b||s.openEnd)),g)break;m=f[h].to}}else n.push(new Qp(c,u,r.tree,-o,s.from>=o||s.openStart,s.to<=l||s.openEnd))}return n}let x9=[],q5e=[];(()=>{let e="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(t=>t?parseInt(t,36):1);for(let t=0,n=0;t>1;if(e=q5e[i])t=i+1;else return!0;if(t==n)return!1}}function vie(e){return e>=127462&&e<=127487}const xie=8205;function rIt(e,t,n=!0,i=!0){return(n?W5e:sIt)(e,t,i)}function W5e(e,t,n){if(t==e.length)return t;t&&K5e(e.charCodeAt(t))&&G5e(e.charCodeAt(t-1))&&t--;let i=W4(e,t);for(t+=wie(i);t=0&&vie(W4(e,o));)s++,o-=2;if(s%2==0)break;t+=2}else break}return t}function sIt(e,t,n){for(;t>1;){let i=W5e(e,t-2,n);if(i=56320&&e<57344}function G5e(e){return e>=55296&&e<56320}function wie(e){return e<65536?1:2}let Or=class X5e{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,n,i){[t,n]=f1(this,t,n);let r=[];return this.decompose(0,t,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(n,this.length,r,1),th.from(r,this.length-(n-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,n=this.length){[t,n]=f1(this,t,n);let i=[];return this.decompose(t,n,i,0),th.from(i,n-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let n=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),r=new wE(this),s=new wE(t);for(let o=n,l=n;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=i)return!0}}iter(t=1){return new wE(this,t)}iterRange(t,n=this.length){return new Y5e(this,t,n)}iterLines(t,n){let i;if(t==null)i=this.iter();else{n==null&&(n=this.lines+1);let r=this.line(t).from;i=this.iterRange(r,Math.max(r,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new Z5e(i)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length==1&&!t[0]?X5e.empty:t.length<=32?new Sa(t):th.from(Sa.split(t,[]))}};class Sa extends Or{constructor(t,n=aIt(t)){super(),this.text=t,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(t,n,i,r){for(let s=0;;s++){let o=this.text[s],l=r+o.length;if((n?i:l)>=t)return new oIt(r,l,i,o);r=l+1,i++}}decompose(t,n,i,r){let s=t<=0&&n>=this.length?this:new Sa(kie(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(r&1){let o=i.pop(),l=LN(s.text,o.text.slice(),0,s.length);if(l.length<=32)i.push(new Sa(l,o.length+s.length));else{let c=l.length>>1;i.push(new Sa(l.slice(0,c)),new Sa(l.slice(c)))}}else i.push(s)}replace(t,n,i){if(!(i instanceof Sa))return super.replace(t,n,i);[t,n]=f1(this,t,n);let r=LN(this.text,LN(i.text,kie(this.text,0,t)),n),s=this.length+i.length-(n-t);return r.length<=32?new Sa(r,s):th.from(Sa.split(r,[]),s)}sliceString(t,n=this.length,i=` +`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=$_(t),i=q0(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=$_(t),i=q0(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};function zRt(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new URt||null,prettyErrors:t}}function U5e(e,t={}){const{lineCounter:n,prettyErrors:i}=zRt(t),r=new QRt(n==null?void 0:n.addNewLine),s=new MRt(t);let o=null;for(const l of s.compose(r.parse(e),!0,e.length))if(!o)o=l;else if(o.options.logLevel!=="silent"){o.errors.push(new vS(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(o.errors.forEach(rie(e,n)),o.warnings.forEach(rie(e,n))),o}function VRt(e,t,n){let i;const r=U5e(e,n);if(!r)return null;if(r.warnings.forEach(s=>d5e(r.options.logLevel,s)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},n))}function VM(e,t,n){let i=null;if(typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){const r=Math.round(n);n=r<1?void 0:r>8?{indent:8}:{indent:r}}if(e===void 0){const{keepUndefined:r}=n??t??{};if(!r)return}return ET(e)&&!i?e.toString(n):new _T(e,i,n).toString(n)}const Q5e=1024;let HRt=0,gd=class{constructor(t,n){this.from=t,this.to=n}};class li{constructor(t={}){this.id=HRt++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=t.combine||null}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof t!="function"&&(t=Ja.match(t)),n=>{let i=t(n);return i===void 0?null:[this,i]}}}li.closedBy=new li({deserialize:e=>e.split(" ")});li.openedBy=new li({deserialize:e=>e.split(" ")});li.group=new li({deserialize:e=>e.split(" ")});li.isolate=new li({deserialize:e=>{if(e&&e!="rtl"&&e!="ltr"&&e!="auto")throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}});li.contextHash=new li({perNode:!0});li.lookAhead=new li({perNode:!0});li.mounted=new li({perNode:!0});class bw{constructor(t,n,i,r=!1){this.tree=t,this.overlay=n,this.parser=i,this.bracketed=r}static get(t){return t&&t.props&&t.props[li.mounted.id]}}const qRt=Object.create(null);class Ja{constructor(t,n,i,r=0){this.name=t,this.props=n,this.id=i,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):qRt,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),r=new Ja(t.name||"",n,t.id,i);if(t.props){for(let s of t.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[s[0].id]=s[1]}}return r}prop(t){return this.props[t.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(t){if(typeof t=="string"){if(this.name==t)return!0;let n=this.prop(li.group);return n?n.indexOf(t)>-1:!1}return this.id==t}static match(t){let n=Object.create(null);for(let i in t)for(let r of i.split(" "))n[r]=t[i];return i=>{for(let r=i.prop(li.group),s=-1;s<(r?r.length:0);s++){let o=n[s<0?i.name:r[s]];if(o)return o}}}}Ja.none=new Ja("",Object.create(null),0,8);class mk{constructor(t){this.types=t;for(let n=0;n0;for(let c=this.cursor(o|Ar.IncludeAnonymous);;){let u=!1;if(c.from<=s&&c.to>=r&&(!l&&c.type.isAnonymous||n(c)!==!1)){if(c.firstChild())continue;u=!0}for(;u&&i&&(l||!c.type.isAnonymous)&&i(c),!c.nextSibling();){if(!c.parent())return;u=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let n in this.props)t.push([+n,this.props[n]]);return t}balance(t={}){return this.children.length<=8?this:Dq(Ja.none,this.children,this.positions,0,this.children.length,0,this.length,(n,i,r)=>new Hi(this.type,n,i,r,this.propValues),t.makeTree||((n,i,r)=>new Hi(Ja.none,n,i,r)))}static build(t){return XRt(t)}}Hi.empty=new Hi(Ja.none,[],[],0);class Iq{constructor(t,n){this.buffer=t,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Iq(this.buffer,this.index)}}class cb{constructor(t,n,i){this.buffer=t,this.length=n,this.set=i}get type(){return Ja.none}toString(){let t=[];for(let n=0;n0));c=o[c+3]);return l}slice(t,n,i){let r=this.buffer,s=new Uint16Array(n-t),o=0;for(let l=t,c=0;l=t&&nt;case 1:return n<=t&&i>t;case 2:return i>t;case 4:return!0}}function PC(e,t,n,i){for(var r;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to0?l.length:-1;t!=u;t+=n){let d=l[t],f=c[t]+o.from,h;if(!(!(s&Ar.EnterBracketed&&d instanceof Hi&&(h=bw.get(d))&&!h.overlay&&h.bracketed&&i>=f&&i<=f+d.length)&&!z5e(r,i,f,f+d.length))){if(d instanceof cb){if(s&Ar.ExcludeBuffers)continue;let m=d.findChild(0,d.buffer.length,n,i-f,r);if(m>-1)return new ch(new WRt(o,d,t,f),null,m)}else if(s&Ar.IncludeAnonymous||!d.type.isAnonymous||Pq(d)){let m;if(!(s&Ar.IgnoreMounts)&&(m=bw.get(d))&&!m.overlay)return new _l(m.tree,f,t,o);let g=new _l(d,f,t,o);return s&Ar.IncludeAnonymous||!g.type.isAnonymous?g:g.nextChild(n<0?d.children.length-1:0,n,i,r,s)}}}if(s&Ar.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?t=o.index+n:t=n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}prop(t){return this._tree.prop(t)}enter(t,n,i=0){let r;if(!(i&Ar.IgnoreOverlays)&&(r=bw.get(this._tree))&&r.overlay){let s=t-this.from,o=i&Ar.EnterBracketed&&r.bracketed;for(let{from:l,to:c}of r.overlay)if((n>0||o?l<=s:l=s:c>s))return new _l(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,i)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function die(e,t,n,i){let r=e.cursor(),s=[];if(!r.firstChild())return s;if(n!=null){for(let o=!1;!o;)if(o=r.type.is(n),!r.nextSibling())return s}for(;;){if(i!=null&&r.type.is(i))return s;if(r.type.is(t)&&s.push(r.node),!r.nextSibling())return i==null?s:[]}}function y9(e,t,n=t.length-1){for(let i=e;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(t[n]&&t[n]!=i.name)return!1;n--}}return!0}class WRt{constructor(t,n,i,r){this.parent=t,this.buffer=n,this.index=i,this.start=r}}class ch extends V5e{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,n,i){super(),this.context=t,this._parent=n,this.index=i,this.type=t.buffer.set.types[t.buffer.buffer[i]]}child(t,n,i){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t,n-this.context.start,i);return s<0?null:new ch(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}prop(t){return this.type.prop(t)}enter(t,n,i=0){if(i&Ar.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return s<0?null:new ch(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new ch(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new ch(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],n=[],{buffer:i}=this.context,r=this.index+4,s=i.buffer[this.index+3];if(s>r){let o=i.buffer[this.index+1];t.push(i.slice(r,s,o)),n.push(0)}return new Hi(this.type,t,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function H5e(e){if(!e.length)return null;let t=0,n=e[0];for(let s=1;sn.from||o.to=t){let l=new _l(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(PC(l,t,n,!1))}}return r?H5e(r):i}class $I{get name(){return this.type.name}constructor(t,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~Ar.EnterBracketed,t instanceof _l)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let i=t._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return t?(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0):!1}yieldBuf(t,n){this.index=t;let{start:i,buffer:r}=this.buffer;return this.type=n||r.set.types[r.buffer[t]],this.from=i+r.buffer[t+1],this.to=i+r.buffer[t+2],!0}yield(t){return t?t instanceof _l?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,n,i){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,n,i,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],t,n-this.buffer.start,i);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,n,i=this.mode){return this.buffer?i&Ar.ExcludeBuffers?!1:this.enterChild(1,t,n):this.yield(this._tree.enter(t,n,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Ar.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&Ar.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode)):!1;let{buffer:n}=this.buffer,i=this.stack.length-1;if(t<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(n.findChild(r,this.index,-1,0,4))}else{let r=n.buffer[this.index+3];if(r<(i<0?n.buffer.length:n.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let n,i,{buffer:r}=this;if(r){if(t>0){if(this.index-1)for(let s=n+t,o=t<0?-1:i._tree.children.length;s!=o;s+=t){let l=i._tree.children[s];if(this.mode&Ar.IncludeAnonymous||l instanceof cb||!l.type.isAnonymous||Pq(l))return!1}return!0}move(t,n){if(n&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,n=0){for(;(this.from==this.to||(n<1?this.from>=t:this.from>t)||(n>-1?this.to<=t:this.to=0;){for(let o=t;o;o=o._parent)if(o.index==r){if(r==this.index)return o;n=o,i=s+1;break e}r=this.stack[--s]}for(let r=i;r=0;s--){if(s<0)return y9(this._tree,t,r);let o=i[n.buffer[this.stack[s]]];if(!o.isAnonymous){if(t[r]&&t[r]!=o.name)return!1;r--}}return!0}}function Pq(e){return e.children.some(t=>t instanceof cb||!t.type.isAnonymous||Pq(t))}function XRt(e){var t;let{buffer:n,nodeSet:i,maxBufferLength:r=Q5e,reused:s=[],minRepeatType:o=i.types.length}=e,l=Array.isArray(n)?new Iq(n,n.length):n,c=i.types,u=0,d=0;function f(S,O,A,E,j,T){let{id:R,start:C,end:N,size:P}=l,I=d,D=u;if(P<0)if(l.next(),P==-1){let H=s[R];A.push(H),E.push(C-S);return}else if(P==-3){u=R;return}else if(P==-4){d=R;return}else throw new RangeError(`Unrecognized record size: ${P}`);let _=c[R],L,F,M=C-S;if(N-C<=r&&(F=v(l.pos-O,j))){let H=new Uint16Array(F.size-F.skip),q=l.pos-F.size,U=H.length;for(;l.pos>q;)U=y(F.start,H,U);L=new cb(H,N-F.start,i),M=F.start-S}else{let H=l.pos-P;l.next();let q=[],U=[],Z=R>=o?R:-1,z=0,J=N;for(;l.pos>H;)Z>=0&&l.id==Z&&l.size>=0?(l.end<=J-r&&(g(q,U,C,z,l.end,J,Z,I,D),z=q.length,J=l.end),l.next()):T>2500?h(C,H,q,U):f(C,H,q,U,Z,T+1);if(Z>=0&&z>0&&z-1&&z>0){let ne=m(_,D);L=Dq(_,q,U,0,q.length,0,N-C,ne,ne)}else L=b(_,q,U,N-C,I-N,D)}A.push(L),E.push(M)}function h(S,O,A,E){let j=[],T=0,R=-1;for(;l.pos>O;){let{id:C,start:N,end:P,size:I}=l;if(I>4)l.next();else{if(R>-1&&N=0;P-=3)C[I++]=j[P],C[I++]=j[P+1]-N,C[I++]=j[P+2]-N,C[I++]=I;A.push(new cb(C,j[2]-N,i)),E.push(N-S)}}function m(S,O){return(A,E,j)=>{let T=0,R=A.length-1,C,N;if(R>=0&&(C=A[R])instanceof Hi){if(!R&&C.type==S&&C.length==j)return C;(N=C.prop(li.lookAhead))&&(T=E[R]+C.length+N)}return b(S,A,E,j,T,O)}}function g(S,O,A,E,j,T,R,C,N){let P=[],I=[];for(;S.length>E;)P.push(S.pop()),I.push(O.pop()+A-j);S.push(b(i.types[R],P,I,T-j,C-T,N)),O.push(j-A)}function b(S,O,A,E,j,T,R){if(T){let C=[li.contextHash,T];R=R?[C].concat(R):[C]}if(j>25){let C=[li.lookAhead,j];R=R?[C].concat(R):[C]}return new Hi(S,O,A,E,R)}function v(S,O){let A=l.fork(),E=0,j=0,T=0,R=A.end-r,C={size:0,start:0,skip:0};e:for(let N=A.pos-S;A.pos>N;){let P=A.size;if(A.id==O&&P>=0){C.size=E,C.start=j,C.skip=T,T+=4,E+=4,A.next();continue}let I=A.pos-P;if(P<0||I=o?4:0,_=A.start;for(A.next();A.pos>I;){if(A.size<0)if(A.size==-3||A.size==-4)D+=4;else break e;else A.id>=o&&(D+=4);A.next()}j=_,E+=P,T+=D}return(O<0||E==S)&&(C.size=E,C.start=j,C.skip=T),C.size>4?C:void 0}function y(S,O,A){let{id:E,start:j,end:T,size:R}=l;if(l.next(),R>=0&&E4){let N=l.pos-(R-4);for(;l.pos>N;)A=y(S,O,A)}O[--A]=C,O[--A]=T-S,O[--A]=j-S,O[--A]=E}else R==-3?u=E:R==-4&&(d=E);return A}let w=[],x=[];for(;l.pos>0;)f(e.start||0,e.bufferStart||0,w,x,-1,0);let k=(t=e.length)!==null&&t!==void 0?t:w.length?x[0]+w[0].length:0;return new Hi(c[e.topID],w.reverse(),x.reverse(),k)}const fie=new WeakMap;function MN(e,t){if(!e.isAnonymous||t instanceof cb||t.type!=e)return 1;let n=fie.get(t);if(n==null){n=1;for(let i of t.children){if(i.type!=e||!(i instanceof Hi)){n=1;break}n+=MN(e,i)}fie.set(t,n)}return n}function Dq(e,t,n,i,r,s,o,l,c){let u=0;for(let g=i;g=d)break;O+=A}if(x==k+1){if(O>d){let A=g[k];m(A.children,A.positions,0,A.children.length,b[k]+w);continue}f.push(g[k])}else{let A=b[x-1]+g[x-1].length-S;f.push(Dq(e,g,b,k,x,S,A,null,c))}h.push(S+w-s)}}return m(t,n,i,r,0),(l||c)(f,h,o)}class Mq{constructor(){this.map=new WeakMap}setBuffer(t,n,i){let r=this.map.get(t);r||this.map.set(t,r=new Map),r.set(n,i)}getBuffer(t,n){let i=this.map.get(t);return i&&i.get(n)}set(t,n){t instanceof ch?this.setBuffer(t.context.buffer,t.index,n):t instanceof _l&&this.map.set(t.tree,n)}get(t){return t instanceof ch?this.getBuffer(t.context.buffer,t.index):t instanceof _l?this.map.get(t.tree):void 0}cursorSet(t,n){t.buffer?this.setBuffer(t.buffer.buffer,t.index,n):this.map.set(t.tree,n)}cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree)}}class Qp{constructor(t,n,i,r,s=!1,o=!1){this.from=t,this.to=n,this.tree=i,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],i=!1){let r=[new Qp(0,t.length,t,0,!1,i)];for(let s of n)s.to>t.length&&r.push(s);return r}static applyChanges(t,n,i=128){if(!n.length)return t;let r=[],s=1,o=t.length?t[0]:null;for(let l=0,c=0,u=0;;l++){let d=l=i)for(;o&&o.from=h.from||f<=h.to||u){let m=Math.max(h.from,c)-u,g=Math.min(h.to,f)-u;h=m>=g?null:new Qp(m,g,h.tree,h.offset+u,l>0,!!d)}if(h&&r.push(h),o.to>f)break;o=snew gd(r.from,r.to)):[new gd(0,0)]:[new gd(0,t.length)],this.createParse(t,n||[],i)}parse(t,n,i){let r=this.startParse(t,n,i);for(;;){let s=r.advance();if(s)return s}}}class YRt{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,n){return this.string.slice(t,n)}}function q5e(e){return(t,n,i,r)=>new JRt(t,e,n,i,r)}class hie{constructor(t,n,i,r,s,o){this.parser=t,this.parse=n,this.overlay=i,this.bracketed=r,this.target=s,this.from=o}}function pie(e){if(!e.length||e.some(t=>t.from>=t.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(e))}class ZRt{constructor(t,n,i,r,s,o,l,c){this.parser=t,this.predicate=n,this.mounts=i,this.index=r,this.start=s,this.bracketed=o,this.target=l,this.prev=c,this.depth=0,this.ranges=[]}}const v9=new li({perNode:!0});class JRt{constructor(t,n,i,r,s){this.nest=n,this.input=i,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=t}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new Hi(i.type,i.children,i.positions,i.length,i.propValues.concat([[v9,this.stoppedAt]]))),i}let t=this.inner[this.innerDone],n=t.parse.advance();if(n){this.innerDone++;let i=Object.assign(Object.create(null),t.target.props);i[li.mounted.id]=new bw(n,t.overlay,t.parser,t.bracketed),t.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let t=this.input.length;for(let n=this.innerDone;n=this.stoppedAt)l=!1;else if(t.hasNode(r)){if(n){let u=n.mounts.find(d=>d.frag.from<=r.from&&d.frag.to>=r.to&&d.mount.overlay);if(u)for(let d of u.mount.overlay){let f=d.from+u.pos,h=d.to+u.pos;f>=r.from&&h<=r.to&&!n.ranges.some(m=>m.fromf)&&n.ranges.push({from:f,to:h})}}l=!1}else if(i&&(o=eIt(i.ranges,r.from,r.to)))l=o!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.fromnew gd(f.from-r.from,f.to-r.from)):null,!!s.bracketed,r.tree,d.length?d[0].from:r.from)),s.overlay?d.length&&(i={ranges:d,depth:0,prev:i}):l=!1}}else if(n&&(c=n.predicate(r))&&(c===!0&&(c=new gd(r.from,r.to)),c.from=0&&n.ranges[u].to==c.from?n.ranges[u]={from:n.ranges[u].from,to:c.to}:n.ranges.push(c)}if(l&&r.firstChild())n&&n.depth++,i&&i.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(n&&!--n.depth){let u=bie(this.ranges,n.ranges);u.length&&(pie(u),this.inner.splice(n.index,0,new hie(n.parser,n.parser.startParse(this.input,yie(n.mounts,u),u),n.ranges.map(d=>new gd(d.from-n.start,d.to-n.start)),n.bracketed,n.target,u[0].from))),n=n.prev}i&&!--i.depth&&(i=i.prev)}}}}function eIt(e,t,n){for(let i of e){if(i.from>=n)break;if(i.to>t)return i.from<=t&&i.to>=n?2:1}return 0}function mie(e,t,n,i,r,s){if(t=t&&n.enter(i,1,Ar.IgnoreOverlays|Ar.ExcludeBuffers)))if(n.to<=t)n.next(!1)||(this.done=!0);else break}hasNode(t){if(this.moveTo(t.from),!this.done&&this.cursor.from+this.offset==t.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==t.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof Hi)n=n.children[0];else break}return!1}}let nIt=class{constructor(t){var n;if(this.fragments=t,this.curTo=0,this.fragI=0,t.length){let i=this.curFrag=t[0];this.curTo=(n=i.tree.prop(v9))!==null&&n!==void 0?n:i.to,this.inner=new gie(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(t){for(;this.curFrag&&t.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=t.from&&this.curTo>=t.to&&this.inner.hasNode(t)}nextFrag(){var t;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let n=this.curFrag=this.fragments[this.fragI];this.curTo=(t=n.tree.prop(v9))!==null&&t!==void 0?t:n.to,this.inner=new gie(n.tree,-n.offset)}}findMounts(t,n){var i;let r=[];if(this.inner){this.inner.cursor.moveTo(t,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(i=s.tree)===null||i===void 0?void 0:i.prop(li.mounted);if(o&&o.parser==n)for(let l=this.fragI;l=s.to)break;c.tree==this.curFrag.tree&&r.push({frag:c,pos:s.from-c.offset,mount:o})}}}return r}};function bie(e,t){let n=null,i=t;for(let r=1,s=0;r=l)break;c.to<=o||(n||(i=n=t.slice()),c.froml&&n.splice(s+1,0,new gd(l,c.to))):c.to>l?n[s--]=new gd(l,c.to):n.splice(s--,1))}}return i}function iIt(e,t,n,i){let r=0,s=0,o=!1,l=!1,c=-1e9,u=[];for(;;){let d=r==e.length?1e9:o?e[r].to:e[r].from,f=s==t.length?1e9:l?t[s].to:t[s].from;if(o!=l){let h=Math.max(c,n),m=Math.min(d,f,i);hnew gd(h.from+i,h.to+i)),f=iIt(t,d,c,u);for(let h=0,m=c;;h++){let g=h==f.length,b=g?u:f[h].from;if(b>m&&n.push(new Qp(m,b,r.tree,-o,s.from>=m||s.openStart,s.to<=b||s.openEnd)),g)break;m=f[h].to}}else n.push(new Qp(c,u,r.tree,-o,s.from>=o||s.openStart,s.to<=l||s.openEnd))}return n}let x9=[],W5e=[];(()=>{let e="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(t=>t?parseInt(t,36):1);for(let t=0,n=0;t>1;if(e=W5e[i])t=i+1;else return!0;if(t==n)return!1}}function vie(e){return e>=127462&&e<=127487}const xie=8205;function sIt(e,t,n=!0,i=!0){return(n?K5e:aIt)(e,t,i)}function K5e(e,t,n){if(t==e.length)return t;t&&G5e(e.charCodeAt(t))&&X5e(e.charCodeAt(t-1))&&t--;let i=W4(e,t);for(t+=wie(i);t=0&&vie(W4(e,o));)s++,o-=2;if(s%2==0)break;t+=2}else break}return t}function aIt(e,t,n){for(;t>1;){let i=K5e(e,t-2,n);if(i=56320&&e<57344}function X5e(e){return e>=55296&&e<56320}function wie(e){return e<65536?1:2}let Or=class Y5e{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,n,i){[t,n]=f1(this,t,n);let r=[];return this.decompose(0,t,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(n,this.length,r,1),th.from(r,this.length-(n-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,n=this.length){[t,n]=f1(this,t,n);let i=[];return this.decompose(t,n,i,0),th.from(i,n-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let n=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),r=new wE(this),s=new wE(t);for(let o=n,l=n;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=i)return!0}}iter(t=1){return new wE(this,t)}iterRange(t,n=this.length){return new Z5e(this,t,n)}iterLines(t,n){let i;if(t==null)i=this.iter();else{n==null&&(n=this.lines+1);let r=this.line(t).from;i=this.iterRange(r,Math.max(r,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new J5e(i)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length==1&&!t[0]?Y5e.empty:t.length<=32?new Sa(t):th.from(Sa.split(t,[]))}};class Sa extends Or{constructor(t,n=oIt(t)){super(),this.text=t,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(t,n,i,r){for(let s=0;;s++){let o=this.text[s],l=r+o.length;if((n?i:l)>=t)return new lIt(r,l,i,o);r=l+1,i++}}decompose(t,n,i,r){let s=t<=0&&n>=this.length?this:new Sa(kie(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(r&1){let o=i.pop(),l=LN(s.text,o.text.slice(),0,s.length);if(l.length<=32)i.push(new Sa(l,o.length+s.length));else{let c=l.length>>1;i.push(new Sa(l.slice(0,c)),new Sa(l.slice(c)))}}else i.push(s)}replace(t,n,i){if(!(i instanceof Sa))return super.replace(t,n,i);[t,n]=f1(this,t,n);let r=LN(this.text,LN(i.text,kie(this.text,0,t)),n),s=this.length+i.length-(n-t);return r.length<=32?new Sa(r,s):th.from(Sa.split(r,[]),s)}sliceString(t,n=this.length,i=` `){[t,n]=f1(this,t,n);let r="";for(let s=0,o=0;s<=n&&ot&&o&&(r+=i),ts&&(r+=l.slice(Math.max(0,t-s),n-s)),s=c+1}return r}flatten(t){for(let n of this.text)t.push(n)}scanIdentical(){return 0}static split(t,n){let i=[],r=-1;for(let s of t)i.push(s),r+=s.length+1,i.length==32&&(n.push(new Sa(i,r)),i=[],r=-1);return r>-1&&n.push(new Sa(i,r)),n}}class th extends Or{constructor(t,n){super(),this.children=t,this.length=n,this.lines=0;for(let i of t)this.lines+=i.lines}lineInner(t,n,i,r){for(let s=0;;s++){let o=this.children[s],l=r+o.length,c=i+o.lines-1;if((n?c:l)>=t)return o.lineInner(t,n,i,r);r=l+1,i=c+1}}decompose(t,n,i,r){for(let s=0,o=0;o<=n&&s=o){let u=r&((o<=t?1:0)|(c>=n?2:0));o>=t&&c<=n&&!u?i.push(l):l.decompose(t-o,n-o,i,u)}o=c+1}}replace(t,n,i){if([t,n]=f1(this,t,n),i.lines=s&&n<=l){let c=o.replace(t-s,n-s,i),u=this.lines-o.lines+c.lines;if(c.lines>4&&c.lines>u>>6){let d=this.children.slice();return d[r]=c,new th(d,this.length-(n-t)+i.length)}return super.replace(s,l,c)}s=l+1}return super.replace(t,n,i)}sliceString(t,n=this.length,i=` -`){[t,n]=f1(this,t,n);let r="";for(let s=0,o=0;st&&s&&(r+=i),to&&(r+=l.sliceString(t-o,n-o,i)),o=c+1}return r}flatten(t){for(let n of this.children)n.flatten(t)}scanIdentical(t,n){if(!(t instanceof th))return 0;let i=0,[r,s,o,l]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;r+=n,s+=n){if(r==o||s==l)return i;let c=this.children[r],u=t.children[s];if(c!=u)return i+c.scanIdentical(u,n);i+=c.length+1}}static from(t,n=t.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let m of t)i+=m.lines;if(i<32){let m=[];for(let g of t)g.flatten(m);return new Sa(m,n)}let r=Math.max(32,i>>5),s=r<<1,o=r>>1,l=[],c=0,u=-1,d=[];function f(m){let g;if(m.lines>s&&m instanceof th)for(let b of m.children)f(b);else m.lines>o&&(c>o||!c)?(h(),l.push(m)):m instanceof Sa&&c&&(g=d[d.length-1])instanceof Sa&&m.lines+g.lines<=32?(c+=m.lines,u+=m.length+1,d[d.length-1]=new Sa(g.text.concat(m.text),g.length+1+m.length)):(c+m.lines>r&&h(),c+=m.lines,u+=m.length+1,d.push(m))}function h(){c!=0&&(l.push(d.length==1?d[0]:th.from(d,u)),u=-1,c=d.length=0)}for(let m of t)f(m);return h(),l.length==1?l[0]:new th(l,n)}}Or.empty=new Sa([""],0);function aIt(e){let t=-1;for(let n of e)t+=n.length+1;return t}function LN(e,t,n=0,i=1e9){for(let r=0,s=0,o=!0;s=n&&(c>i&&(l=l.slice(0,i-r)),r0?1:(t instanceof Sa?t.text.length:t.children.length)<<1]}nextInner(t,n){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],s=this.offsets[i],o=s>>1,l=r instanceof Sa?r.text.length:r.children.length;if(o==(n>0?l:0)){if(i==0)return this.done=!0,this.value="",this;n>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(n>0?0:1)){if(this.offsets[i]+=n,t==0)return this.lineBreak=!0,this.value=` -`,this;t--}else if(r instanceof Sa){let c=r.text[o+(n<0?-1:0)];if(this.offsets[i]+=n,c.length>Math.max(0,t))return this.value=t==0?c:n>0?c.slice(t):c.slice(0,c.length-t),this;t-=c.length}else{let c=r.children[o+(n<0?-1:0)];t>c.length?(t-=c.length,this.offsets[i]+=n):(n<0&&this.offsets[i]--,this.nodes.push(c),this.offsets.push(n>0?1:(c instanceof Sa?c.text.length:c.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class Y5e{constructor(t,n,i){this.value="",this.done=!1,this.cursor=new wE(t,n>i?-1:1),this.pos=n>i?t.length:0,this.from=Math.min(n,i),this.to=Math.max(n,i)}nextInner(t,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let i=n<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;let{value:r}=this.cursor.next(t);return this.pos+=(r.length+t)*n,this.value=r.length<=i?r:n<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Z5e{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:n,lineBreak:i,value:r}=this.inner.next(t);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Or.prototype[Symbol.iterator]=function(){return this.iter()},wE.prototype[Symbol.iterator]=Y5e.prototype[Symbol.iterator]=Z5e.prototype[Symbol.iterator]=function(){return this});let oIt=class{constructor(t,n,i,r){this.from=t,this.to=n,this.number=i,this.text=r}get length(){return this.to-this.from}};function f1(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function Lo(e,t,n=!0,i=!0){return rIt(e,t,n,i)}function lIt(e){return e>=56320&&e<57344}function cIt(e){return e>=55296&&e<56320}function Ac(e,t){let n=e.charCodeAt(t);if(!cIt(n)||t+1==e.length)return n;let i=e.charCodeAt(t+1);return lIt(i)?(n-55296<<10)+(i-56320)+65536:n}function Lq(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function nh(e){return e<65536?1:2}const w9=/\r\n?|\n/;var al=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(al||(al={}));class xh{constructor(t){this.sections=t}get length(){let t=0;for(let n=0;nt)return s+(t-r);s+=l}else{if(i!=al.Simple&&u>=t&&(i==al.TrackDel&&rt||i==al.TrackBefore&&rt))return null;if(u>t||u==t&&n<0&&!l)return t==r||n<0?s:s+c;s+=c}r=u}if(t>r)throw new RangeError(`Position ${t} is out of range for changeset of length ${r}`);return s}touchesRange(t,n=t){for(let i=0,r=0;i=0&&r<=n&&l>=t)return rn?"cover":!0;r=l}return!1}toString(){let t="";for(let n=0;n=0?":"+r:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new xh(t)}static create(t){return new xh(t)}}class co extends xh{constructor(t,n){super(t),this.inserted=n}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return k9(this,(n,i,r,s,o)=>t=t.replace(r,r+(i-n),o),!1),t}mapDesc(t,n=!1){return O9(this,t,n,!0)}invert(t){let n=this.sections.slice(),i=[];for(let r=0,s=0;r=0){n[r]=l,n[r+1]=o;let c=r>>1;for(;i.length0&&vg(i,n,s.text),s.forward(d),l+=d}let u=t[o++];for(;l>1].toJSON()))}return t}static of(t,n,i){let r=[],s=[],o=0,l=null;function c(d=!1){if(!d&&!r.length)return;oh||f<0||h>n)throw new RangeError(`Invalid change range ${f} to ${h} (in doc of length ${n})`);let g=m?typeof m=="string"?Or.of(m.split(i||w9)):m:Or.empty,b=g.length;if(f==h&&b==0)return;fo&&El(r,f-o,-1),El(r,h-f,b),vg(s,r,g),o=h}}return u(t),c(!l),l}static empty(t){return new co(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],i=[];for(let r=0;rl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;i.length=0&&n<=0&&n==e[r+1]?e[r]+=t:r>=0&&t==0&&e[r]==0?e[r+1]+=n:i?(e[r]+=t,e[r+1]+=n):e.push(t,n)}function vg(e,t,n){if(n.length==0)return;let i=t.length-2>>1;if(i>1])),!(n||o==e.sections.length||e.sections[o+1]<0);)l=e.sections[o++],c=e.sections[o++];t(r,u,s,d,f),r=u,s=d}}}function O9(e,t,n,i=!1){let r=[],s=i?[]:null,o=new DC(e),l=new DC(t);for(let c=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let u=Math.min(o.len,l.len);El(r,u,-1),o.forward(u),l.forward(u)}else if(l.ins>=0&&(o.ins<0||c==o.i||o.off==0&&(l.len=0&&c=0){let u=0,d=o.len;for(;d;)if(l.ins==-1){let f=Math.min(d,l.len);u+=f,d-=f,l.forward(f)}else if(l.ins==0&&l.lenc||o.ins>=0&&o.len>c)&&(l||i.length>u),s.forward2(c),o.forward(c)}}}}class DC{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i>1;return n>=t.length?Or.empty:t[n]}textBit(t){let{inserted:n}=this.set,i=this.i-2>>1;return i>=n.length&&!t?Or.empty:n[i].slice(this.off,t==null?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class sg{constructor(t,n,i,r){this.from=t,this.to=n,this.flags=i,this.goalColumn=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let t=this.flags&7;return t==7?null:t}map(t,n=-1){let i,r;return this.empty?i=r=t.mapPos(this.from,n):(i=t.mapPos(this.from,1),r=t.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new sg(i,r,this.flags,this.goalColumn)}extend(t,n=t,i=0){if(t<=this.anchor&&n>=this.anchor)return pt.range(t,n,void 0,void 0,i);let r=Math.abs(t-this.anchor)>Math.abs(n-this.anchor)?t:n;return pt.range(this.anchor,r,void 0,void 0,i)}eq(t,n=!1){return this.anchor==t.anchor&&this.head==t.head&&this.goalColumn==t.goalColumn&&(!n||!this.empty||this.assoc==t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return pt.range(t.anchor,t.head)}static create(t,n,i,r){return new sg(t,n,i,r)}}class pt{constructor(t,n){this.ranges=t,this.mainIndex=n}map(t,n=-1){return t.empty?this:pt.create(this.ranges.map(i=>i.map(t,n)),this.mainIndex)}eq(t,n=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let i=0;it.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!="number"||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new pt(t.ranges.map(n=>sg.fromJSON(n)),t.main)}static single(t,n=t){return new pt([pt.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,r=0;rr.from-s.from),n=t.indexOf(i);for(let r=1;rs.head?pt.range(c,l):pt.range(l,c))}}return new pt(t,n)}}function e3e(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let $q=0;class pn{constructor(t,n,i,r,s){this.combine=t,this.compareInput=n,this.compare=i,this.isStatic=r,this.id=$q++,this.default=t([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(t={}){return new pn(t.combine||(n=>n),t.compareInput||((n,i)=>n===i),t.compare||(t.combine?(n,i)=>n===i:Fq),!!t.static,t.enables)}of(t){return new $N([],this,0,t)}compute(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new $N(t,this,1,n)}computeN(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new $N(t,this,2,n)}from(t,n){return n||(n=i=>i),this.compute([t],i=>n(i.field(t)))}}function Fq(e,t){return e==t||e.length==t.length&&e.every((n,i)=>n===t[i])}class $N{constructor(t,n,i,r){this.dependencies=t,this.facet=n,this.type=i,this.value=r,this.id=$q++}dynamicSlot(t){var n;let i=this.value,r=this.facet.compareInput,s=this.id,o=t[s]>>1,l=this.type==2,c=!1,u=!1,d=[];for(let f of this.dependencies)f=="doc"?c=!0:f=="selection"?u=!0:((n=t[f.id])!==null&&n!==void 0?n:1)&1||d.push(t[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,h){if(c&&h.docChanged||u&&(h.docChanged||h.selection)||S9(f,d)){let m=i(f);if(l?!Oie(m,f.values[o],r):!r(m,f.values[o]))return f.values[o]=m,1}return 0},reconfigure:(f,h)=>{let m,g=h.config.address[s];if(g!=null){let b=BI(h,g);if(this.dependencies.every(v=>v instanceof pn?h.facet(v)===f.facet(v):v instanceof pl?h.field(v,!1)==f.field(v,!1):!0)||(l?Oie(m=i(f),b,r):r(m=i(f),b)))return f.values[o]=b,0}else m=i(f);return f.values[o]=m,1}}}get extension(){return this}}function Oie(e,t,n){if(e.length!=t.length)return!1;for(let i=0;ie[c.id]),r=n.map(c=>c.type),s=i.filter(c=>!(c&1)),o=e[t.id]>>1;function l(c){let u=[];for(let d=0;di===r),t);return t.provide&&(n.provides=t.provide(n)),n}create(t){let n=t.facet(B_).find(i=>i.field==this);return((n==null?void 0:n.create)||this.createF)(t)}slot(t){let n=t[this.id]>>1;return{create:i=>(i.values[n]=this.create(i),1),update:(i,r)=>{let s=i.values[n],o=this.updateF(s,r);return this.compareF(s,o)?0:(i.values[n]=o,1)},reconfigure:(i,r)=>{let s=i.facet(B_),o=r.facet(B_),l;return(l=s.find(c=>c.field==this))&&l!=o.find(c=>c.field==this)?(i.values[n]=l.create(i),1):r.config.address[this.id]!=null?(i.values[n]=r.field(this),0):(i.values[n]=this.create(i),1)}}}init(t){return[this,B_.of({field:this,create:t})]}get extension(){return this}}const by={lowest:4,low:3,default:2,high:1,highest:0};function EO(e){return t=>new t3e(t,e)}const ym={highest:EO(by.highest),high:EO(by.high),default:EO(by.default),low:EO(by.low),lowest:EO(by.lowest)};class t3e{constructor(t,n){this.inner=t,this.prec=n}get extension(){return this}}class qM{of(t){return new E9(this,t)}reconfigure(t){return qM.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class E9{constructor(t,n){this.compartment=t,this.inner=n}get extension(){return this}}class FI{constructor(t,n,i,r,s,o){for(this.base=t,this.compartments=n,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(t,n,i){let r=[],s=Object.create(null),o=new Map;for(let h of dIt(t,n,o))h instanceof pl?r.push(h):(s[h.facet.id]||(s[h.facet.id]=[])).push(h);let l=Object.create(null),c=[],u=[];for(let h of r)l[h.id]=u.length<<1,u.push(m=>h.slot(m));let d=i==null?void 0:i.config.facets;for(let h in s){let m=s[h],g=m[0].facet,b=d&&d[h]||[];if(m.every(v=>v.type==0))if(l[g.id]=c.length<<1|1,Fq(b,m))c.push(i.facet(g));else{let v=g.combine(m.map(y=>y.value));c.push(i&&g.compare(v,i.facet(g))?i.facet(g):v)}else{for(let v of m)v.type==0?(l[v.id]=c.length<<1|1,c.push(v.value)):(l[v.id]=u.length<<1,u.push(y=>v.dynamicSlot(y)));l[g.id]=u.length<<1,u.push(v=>uIt(v,g,m))}}let f=u.map(h=>h(l));return new FI(t,o,f,l,c,s)}}function dIt(e,t,n){let i=[[],[],[],[],[]],r=new Map;function s(o,l){let c=r.get(o);if(c!=null){if(c<=l)return;let u=i[c].indexOf(o);u>-1&&i[c].splice(u,1),o instanceof E9&&n.delete(o.compartment)}if(r.set(o,l),Array.isArray(o))for(let u of o)s(u,l);else if(o instanceof E9){if(n.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let u=t.get(o.compartment)||o.inner;n.set(o.compartment,u),s(u,l)}else if(o instanceof t3e)s(o.inner,o.prec);else if(o instanceof pl)i[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof $N)i[l].push(o),o.facet.extensions&&s(o.facet.extensions,by.default);else{let u=o.extension;if(!u)throw new Error(`Unrecognized extension value in extension set (${o}).`);if(u==o)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(u,l)}}return s(e,by.default),i.reduce((o,l)=>o.concat(l))}function kE(e,t){if(t&1)return 2;let n=t>>1,i=e.status[n];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;e.status[n]=4;let r=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|r}function BI(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}const n3e=pn.define(),C9=pn.define({combine:e=>e.some(t=>t),static:!0}),i3e=pn.define({combine:e=>e.length?e[0]:void 0,static:!0}),r3e=pn.define(),s3e=pn.define(),a3e=pn.define(),o3e=pn.define({combine:e=>e.length?e[0]:!1});class Dh{constructor(t,n){this.type=t,this.value=n}static define(){return new fIt}}class fIt{of(t){return new Dh(this,t)}}class hIt{constructor(t){this.map=t}of(t){return new hi(this,t)}}class hi{constructor(t,n){this.type=t,this.value=n}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new hi(this.type,n)}is(t){return this.type==t}static define(t={}){return new hIt(t.map||(n=>n))}static mapEffects(t,n){if(!t.length)return t;let i=[];for(let r of t){let s=r.map(n);s&&i.push(s)}return i}}hi.reconfigure=hi.define();hi.appendConfig=hi.define();class Ya{constructor(t,n,i,r,s,o){this.startState=t,this.changes=n,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,i&&e3e(i,n.newLength),s.some(l=>l.type==Ya.time)||(this.annotations=s.concat(Ya.time.of(Date.now())))}static create(t,n,i,r,s,o){return new Ya(t,n,i,r,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let n of this.annotations)if(n.type==t)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(Ya.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]=="."))}}Ya.time=Dh.define();Ya.userEvent=Dh.define();Ya.addToHistory=Dh.define();Ya.remote=Dh.define();function pIt(e,t){let n=[];for(let i=0,r=0;;){let s,o;if(i=e[i]))s=e[i++],o=e[i++];else if(r=0;r--){let s=i[r](e);s instanceof Ya?e=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Ya?e=s[0]:e=c3e(t,yw(s),!1)}return e}function gIt(e){let t=e.startState,n=t.facet(a3e),i=e;for(let r=n.length-1;r>=0;r--){let s=n[r](e);s&&Object.keys(s).length&&(i=l3e(i,A9(t,s,e.changes.newLength),!0))}return i==e?e:Ya.create(t,e.changes,e.selection,i.effects,i.annotations,i.scrollIntoView)}const bIt=[];function yw(e){return e==null?bIt:Array.isArray(e)?e:[e]}var Qs=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(Qs||(Qs={}));const yIt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let T9;try{T9=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function vIt(e){if(T9)return T9.test(e);for(let t=0;t"€"&&(n.toUpperCase()!=n.toLowerCase()||yIt.test(n)))return!0}return!1}function xIt(e){return t=>{if(!/\S/.test(t))return Qs.Space;if(vIt(t))return Qs.Word;for(let n=0;n-1)return Qs.Word;return Qs.Other}}class sr{constructor(t,n,i,r,s,o){this.config=t,this.doc=n,this.selection=i,this.values=r,this.status=t.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;lr.set(u,c)),n=null),r.set(l.value.compartment,l.value.extension)):l.is(hi.reconfigure)?(n=null,i=l.value):l.is(hi.appendConfig)&&(n=null,i=yw(i).concat(l.value));let s;n?s=t.startState.values.slice():(n=FI.resolve(i,r,this),s=new sr(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(c,u)=>u.reconfigure(c,this),null).values);let o=t.startState.facet(C9)?t.newSelection:t.newSelection.asSingle();new sr(n,t.newDoc,o,s,(l,c)=>c.update(l,t),t)}replaceSelection(t){return typeof t=="string"&&(t=this.toText(t)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:t},range:pt.cursor(n.from+t.length)}))}changeByRange(t){let n=this.selection,i=t(n.ranges[0]),r=this.changes(i.changes),s=[i.range],o=yw(i.effects);for(let l=1;lo.spec.fromJSON(l,c)))}}return sr.create({doc:t.doc,selection:pt.fromJSON(t.selection),extensions:n.extensions?r.concat([n.extensions]):r})}static create(t={}){let n=FI.resolve(t.extensions||[],new Map),i=t.doc instanceof Or?t.doc:Or.of((t.doc||"").split(n.staticFacet(sr.lineSeparator)||w9)),r=t.selection?t.selection instanceof pt?t.selection:pt.single(t.selection.anchor,t.selection.head):pt.single(0);return e3e(r,i.length),n.staticFacet(C9)||(r=r.asSingle()),new sr(n,i,r,n.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(sr.tabSize)}get lineBreak(){return this.facet(sr.lineSeparator)||` -`}get readOnly(){return this.facet(o3e)}phrase(t,...n){for(let i of this.facet(sr.phrases))if(Object.prototype.hasOwnProperty.call(i,t)){t=i[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(i,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>n.length?i:n[s-1]})),t}languageDataAt(t,n,i=-1){let r=[];for(let s of this.facet(n3e))for(let o of s(this,n,i))Object.prototype.hasOwnProperty.call(o,t)&&r.push(o[t]);return r}charCategorizer(t){let n=this.languageDataAt("wordChars",t);return xIt(n.length?n[0]:"")}wordAt(t){let{text:n,from:i,length:r}=this.doc.lineAt(t),s=this.charCategorizer(t),o=t-i,l=t-i;for(;o>0;){let c=Lo(n,o,!1);if(s(n.slice(c,o))!=Qs.Word)break;o=c}for(;le.length?e[0]:4});sr.lineSeparator=i3e;sr.readOnly=o3e;sr.phrases=pn.define({compare(e,t){let n=Object.keys(e),i=Object.keys(t);return n.length==i.length&&n.every(r=>e[r]==t[r])}});sr.languageData=n3e;sr.changeFilter=r3e;sr.transactionFilter=s3e;sr.transactionExtender=a3e;qM.reconfigure=hi.define();function Mh(e,t,n={}){let i={};for(let r of e)for(let s of Object.keys(r)){let o=r[s],l=i[s];if(l===void 0)i[s]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(n,s))i[s]=n[s](l,o);else throw new Error("Config merge conflict for field "+s)}for(let r in t)i[r]===void 0&&(i[r]=t[r]);return i}class ub{eq(t){return this==t}range(t,n=t){return MC.create(t,n,this)}}ub.prototype.startSide=ub.prototype.endSide=0;ub.prototype.point=!1;ub.prototype.mapMode=al.TrackDel;function Bq(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}class MC{constructor(t,n,i){this.from=t,this.to=n,this.value=i}static create(t,n,i){return new MC(t,n,i)}}function _9(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class Uq{constructor(t,n,i,r){this.from=t,this.to=n,this.value=i,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(t,n,i,r=0){let s=i?this.to:this.from;for(let o=r,l=s.length;;){if(o==l)return o;let c=o+l>>1,u=s[c]-t||(i?this.value[c].endSide:this.value[c].startSide)-n;if(c==o)return u>=0?o:l;u>=0?l=c:o=c+1}}between(t,n,i,r){for(let s=this.findIndex(n,-1e9,!0),o=this.findIndex(i,1e9,!1,s);sm||h==m&&u.startSide>0&&u.endSide<=0)continue;(m-h||u.endSide-u.startSide)<0||(o<0&&(o=h),u.point&&(l=Math.max(l,m-h)),i.push(u),r.push(h-o),s.push(m-o))}return{mapped:i.length?new Uq(r,s,i,l):null,pos:o}}}class Yi{constructor(t,n,i,r){this.chunkPos=t,this.chunk=n,this.nextLayer=i,this.maxPoint=r}static create(t,n,i,r){return new Yi(t,n,i,r)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let n of this.chunk)t+=n.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:n=[],sort:i=!1,filterFrom:r=0,filterTo:s=this.length}=t,o=t.filter;if(n.length==0&&!o)return this;if(i&&(n=n.slice().sort(_9)),this.isEmpty)return n.length?Yi.of(n):this;let l=new u3e(this,null,-1).goto(0),c=0,u=[],d=new im;for(;l.value||c=0){let f=n[c++];d.addInner(f.from,f.to,f.value)||u.push(f)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||sl.to||s=s&&t<=s+o.length&&o.between(s,t-s,n-s,i)===!1)return}this.nextLayer.between(t,n,i)}}iter(t=0){return LC.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,n=0){return LC.from(t).goto(n)}static compare(t,n,i,r,s=-1){let o=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),l=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),c=Sie(o,l,i),u=new CO(o,c,s),d=new CO(l,c,s);i.iterGaps((f,h,m)=>Eie(u,f,d,h,m,r)),i.empty&&i.length==0&&Eie(u,0,d,0,0,r)}static eq(t,n,i=0,r){r==null&&(r=999999999);let s=t.filter(d=>!d.isEmpty&&n.indexOf(d)<0),o=n.filter(d=>!d.isEmpty&&t.indexOf(d)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let l=Sie(s,o),c=new CO(s,l,0).goto(i),u=new CO(o,l,0).goto(i);for(;;){if(c.to!=u.to||!j9(c.active,u.active)||c.point&&(!u.point||!Bq(c.point,u.point)))return!1;if(c.to>r)return!0;c.next(),u.next()}}static spans(t,n,i,r,s=-1){let o=new CO(t,null,s).goto(n),l=n,c=o.openStart;for(;;){let u=Math.min(o.to,i);if(o.point){let d=o.activeForPoint(o.to),f=o.pointFroml&&(r.span(l,u,o.active,c),c=o.openEnd(u));if(o.to>i)return c+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(t,n=!1){let i=new im;for(let r of t instanceof MC?[t]:n?wIt(t):t)i.add(r.from,r.to,r.value);return i.finish()}static join(t){if(!t.length)return Yi.empty;let n=t[t.length-1];for(let i=t.length-2;i>=0;i--)for(let r=t[i];r!=Yi.empty;r=r.nextLayer)n=new Yi(r.chunkPos,r.chunk,n,Math.max(r.maxPoint,n.maxPoint));return n}}Yi.empty=new Yi([],[],null,-1);function wIt(e){if(e.length>1)for(let t=e[0],n=1;n0)return e.slice().sort(_9);t=i}return e}Yi.empty.nextLayer=Yi.empty;class im{finishChunk(t){this.chunks.push(new Uq(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,n,i){this.addInner(t,n,i)||(this.nextLayer||(this.nextLayer=new im)).add(t,n,i)}addInner(t,n,i){let r=t-this.lastTo||i.startSide-this.last.endSide;if(r<=0&&(t-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(n-this.chunkStart),this.last=i,this.lastFrom=t,this.lastTo=n,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,n-t)),!0)}addChunk(t,n){if((t-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(t);let i=n.value.length-1;return this.last=n.value[i],this.lastFrom=n.from[i]+t,this.lastTo=n.to[i]+t,!0}finish(){return this.finishInner(Yi.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let n=Yi.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,n}}function Sie(e,t,n){let i=new Map;for(let s of e)for(let o=0;o=this.minPoint)break}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&r.push(new u3e(o,n,i,s));return r.length==1?r[0]:new LC(r)}get startSide(){return this.value?this.value.startSide:0}goto(t,n=-1e9){for(let i of this.heap)i.goto(t,n);for(let i=this.heap.length>>1;i>=0;i--)K4(this.heap,i);return this.next(),this}forward(t,n){for(let i of this.heap)i.forward(t,n);for(let i=this.heap.length>>1;i>=0;i--)K4(this.heap,i);(this.to-t||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),K4(this.heap,0)}}}function K4(e,t){for(let n=e[t];;){let i=(t<<1)+1;if(i>=e.length)break;let r=e[i];if(i+1=0&&(r=e[i+1],i++),n.compare(r)<0)break;e[i]=n,e[t]=r,t=i}}class CO{constructor(t,n,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=LC.from(t,n,i)}goto(t,n=-1e9){return this.cursor.goto(t,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=n,this.openStart=-1,this.next(),this}forward(t,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(t,n)}removeActive(t){U_(this.active,t),U_(this.activeTo,t),U_(this.activeRank,t),this.minActive=Cie(this.active,this.activeTo)}addActive(t){let n=0,{value:i,to:r,rank:s}=this.cursor;for(;n0;)n++;Q_(this.active,n,i),Q_(this.activeTo,n,r),Q_(this.activeRank,n,s),t&&Q_(t,n,this.cursor.from),this.minActive=Cie(this.active,this.activeTo)}next(){let t=this.to,n=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>t){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&U_(i,r)}else if(this.cursor.value)if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(i),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from=0&&i[r]=0&&!(this.activeRank[i]t||this.activeTo[i]==t&&this.active[i].endSide>=this.point.endSide)&&n.push(this.active[i]);return n.reverse()}openEnd(t){let n=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>t;i--)n++;return n}}function Eie(e,t,n,i,r,s){e.goto(t),n.goto(i);let o=i+r,l=i,c=i-t,u=!!s.boundChange;for(let d=!1;;){let f=e.to+c-n.to,h=f||e.endSide-n.endSide,m=h<0?e.to+c:n.to,g=Math.min(m,o);if(e.point||n.point?(e.point&&n.point&&Bq(e.point,n.point)&&j9(e.activeForPoint(e.to),n.activeForPoint(n.to))||s.comparePoint(l,g,e.point,n.point),d=!1):(d&&s.boundChange(l),g>l&&!j9(e.active,n.active)&&s.compareRange(l,g,e.active,n.active),u&&go)break;l=m,h<=0&&e.next(),h>=0&&n.next()}}function j9(e,t){if(e.length!=t.length)return!1;for(let n=0;n=t;i--)e[i+1]=e[i];e[t]=n}function Cie(e,t){let n=-1,i=1e9;for(let r=0;r=t)return r;if(r==e.length)break;s+=e.charCodeAt(r)==9?n-s%n:1,r=Lo(e,r)}return i===!0?-1:e.length}const R9="ͼ",Aie=typeof Symbol>"u"?"__"+R9:Symbol.for(R9),I9=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Tie=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class db{constructor(t,n){this.rules=[];let{finish:i}=n||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,l,c,u){let d=[],f=/^@(\w+)\b/.exec(o[0]),h=f&&f[1]=="keyframes";if(f&&l==null)return c.push(o[0]+";");for(let m in l){let g=l[m];if(/&/.test(m))s(m.split(/,\s*/).map(b=>o.map(v=>b.replace(/&/,v))).reduce((b,v)=>b.concat(v)),g,c);else if(g&&typeof g=="object"){if(!f)throw new RangeError("The value of a property ("+m+") should be a primitive value.");s(r(m),g,d,h)}else g!=null&&d.push(m.replace(/_.*/,"").replace(/[A-Z]/g,b=>"-"+b.toLowerCase())+": "+g+";")}(d.length||h)&&c.push((i&&!f&&!u?o.map(i):o).join(", ")+" {"+d.join(" ")+"}")}for(let o in t)s(r(o),t[o],this.rules)}getRules(){return this.rules.join(` -`)}static newName(){let t=Tie[Aie]||1;return Tie[Aie]=t+1,R9+t.toString(36)}static mount(t,n,i){let r=t[I9],s=i&&i.nonce;r?s&&r.setNonce(s):r=new kIt(t,s),r.mount(Array.isArray(n)?n:[n],t)}}let _ie=new Map;class kIt{constructor(t,n){let i=t.ownerDocument||t,r=i.defaultView;if(!t.head&&t.adoptedStyleSheets&&r.CSSStyleSheet){let s=_ie.get(i);if(s)return t[I9]=s;this.sheet=new r.CSSStyleSheet,_ie.set(i,this)}else this.styleTag=i.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],t[I9]=this}mount(t,n){let i=this.sheet,r=0,s=0;for(let o=0;o-1&&(this.modules.splice(c,1),s--,c=-1),c==-1){if(this.modules.splice(s++,0,l),i)for(let u=0;u",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},OIt=typeof navigator<"u"&&/Mac/.test(navigator.platform),SIt=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var il=0;il<10;il++)fb[48+il]=fb[96+il]=String(il);for(var il=1;il<=24;il++)fb[il+111]="F"+il;for(var il=65;il<=90;il++)fb[il]=String.fromCharCode(il+32),$C[il]=String.fromCharCode(il);for(var G4 in fb)$C.hasOwnProperty(G4)||($C[G4]=fb[G4]);function EIt(e){var t=OIt&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||SIt&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?$C:fb)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function Yr(){var e=arguments[0];typeof e=="string"&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i];typeof r=="string"?e.setAttribute(i,r):r!=null&&(e[i]=r)}t++}for(;t2);var dn={mac:Rie||/Mac/.test(Kl.platform),windows:/Win/.test(Kl.platform),linux:/Linux|X11/.test(Kl.platform),ie:WM,ie_version:f3e?P9.documentMode||6:M9?+M9[1]:D9?+D9[1]:0,gecko:jie,gecko_version:jie?+(/Firefox\/(\d+)/.exec(Kl.userAgent)||[0,0])[1]:0,chrome:!!X4,chrome_version:X4?+X4[1]:0,ios:Rie,android:/Android\b/.test(Kl.userAgent),webkit:Nie,webkit_version:Nie?+(/\bAppleWebKit\/(\d+)/.exec(Kl.userAgent)||[0,0])[1]:0,safari:L9,safari_version:L9?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Kl.userAgent)||[0,0])[1]:0,tabSize:P9.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Qq(e,t){for(let n in e)n=="class"&&t.class?t.class+=" "+e.class:n=="style"&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}const UI=Object.create(null);function zq(e,t,n){if(e==t)return!0;e||(e=UI),t||(t=UI);let i=Object.keys(e),r=Object.keys(t);if(i.length-0!=r.length-0)return!1;for(let s of i)if(s!=n&&(r.indexOf(s)==-1||e[s]!==t[s]))return!1;return!0}function CIt(e,t){for(let n=e.attributes.length-1;n>=0;n--){let i=e.attributes[n].name;t[i]==null&&e.removeAttribute(i)}for(let n in t){let i=t[n];n=="style"?e.style.cssText=i:e.getAttribute(n)!=i&&e.setAttribute(n,i)}}function Iie(e,t,n){let i=!1;if(t)for(let r in t)n&&r in n||(i=!0,r=="style"?e.style.cssText="":e.removeAttribute(r));if(n)for(let r in n)t&&t[r]==n[r]||(i=!0,r=="style"?e.style.cssText=n[r]:e.setAttribute(r,n[r]));return i}function AIt(e){let t=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new gv(t,n,n,i,t.widget||null,!1)}static replace(t){let n=!!t.block,i,r;if(t.isBlockGap)i=-5e8,r=4e8;else{let{start:s,end:o}=h3e(t,n);i=(s?n?-3e8:-1:5e8)-1,r=(o?n?2e8:1:-6e8)+1}return new gv(t,i,r,n,t.widget||null,!0)}static line(t){return new RT(t)}static set(t,n=!1){return Yi.of(t,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}$n.none=Yi.empty;class NT extends $n{constructor(t){let{start:n,end:i}=h3e(t);super(n?-1:5e8,i?1:-6e8,null,t),this.tagName=t.tagName||"span",this.attrs=t.class&&t.attributes?Qq(t.attributes,{class:t.class}):t.class?{class:t.class}:t.attributes||UI}eq(t){return this==t||t instanceof NT&&this.tagName==t.tagName&&zq(this.attrs,t.attrs)}range(t,n=t){if(t>=n)throw new RangeError("Mark decorations may not be empty");return super.range(t,n)}}NT.prototype.point=!1;class RT extends $n{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof RT&&this.spec.class==t.spec.class&&zq(this.spec.attributes,t.spec.attributes)}range(t,n=t){if(n!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,n)}}RT.prototype.mapMode=al.TrackBefore;RT.prototype.point=!0;class gv extends $n{constructor(t,n,i,r,s,o){super(n,i,s,t),this.block=r,this.isReplace=o,this.mapMode=r?n<=0?al.TrackBefore:al.TrackAfter:al.TrackDel}get type(){return this.startSide!=this.endSide?ul.WidgetRange:this.startSide<=0?ul.WidgetBefore:ul.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof gv&&TIt(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,n=t){if(this.isReplace&&(t>n||t==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,n)}}gv.prototype.point=!0;function h3e(e,t=!1){let{inclusiveStart:n,inclusiveEnd:i}=e;return n==null&&(n=e.inclusive),i==null&&(i=e.inclusive),{start:n??t,end:i??t}}function TIt(e,t){return e==t||!!(e&&t&&e.compare(t))}function vw(e,t,n,i=0){let r=n.length-1;r>=0&&n[r]+i>=e?n[r]=Math.max(n[r],t):n.push(e,t)}class FC extends ub{constructor(t,n,i){super(),this.tagName=t,this.attributes=n,this.rank=i}eq(t){return t==this||t instanceof FC&&this.tagName==t.tagName&&zq(this.attributes,t.attributes)}static create(t){return new FC(t.tagName,t.attributes||UI,t.rank==null?50:Math.max(0,Math.min(t.rank,100)))}static set(t,n=!1){return Yi.of(t,n)}}FC.prototype.startSide=FC.prototype.endSide=-1;function BC(e){let t;return e.nodeType==11?t=e.getSelection?e:e.ownerDocument:t=e,t.getSelection()}function $9(e,t){return t?e==t||e.contains(t.nodeType!=1?t.parentNode:t):!1}function OE(e,t){if(!t.anchorNode)return!1;try{return $9(e,t.anchorNode)}catch{return!1}}function SE(e){return e.nodeType==3?QC(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function EE(e,t,n,i){return n?Pie(e,t,n,i,-1)||Pie(e,t,n,i,1):!1}function hb(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function QI(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function Pie(e,t,n,i,r){for(;;){if(e==n&&t==i)return!0;if(t==(r<0?0:rm(e))){if(e.nodeName=="DIV")return!1;let s=e.parentNode;if(!s||s.nodeType!=1)return!1;t=hb(e)+(r<0?0:1),e=s}else if(e.nodeType==1){if(e=e.childNodes[t+(r<0?-1:0)],e.nodeType==1&&e.contentEditable=="false")return!1;t=r<0?rm(e):0}else return!1}}function rm(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function UC(e,t){let{left:n,right:i}=e;if(n==i)return e;let r=t?n:i;return{left:r,right:r,top:e.top,bottom:e.bottom}}function _It(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function p3e(e,t){let n=t.width/e.offsetWidth,i=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(t.height-e.offsetHeight)<1)&&(i=1),{scaleX:n,scaleY:i}}function jIt(e,t,n,i,r,s,o,l){let c=e.ownerDocument,u=c.defaultView||window;for(let d=e,f=!1;d&&!f;)if(d.nodeType==1){let h,m=d==c.body,g=1,b=1;if(m)h=_It(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(d).position)&&(f=!0),d.scrollHeight<=d.clientHeight&&d.scrollWidth<=d.clientWidth){d=d.assignedSlot||d.parentNode;continue}let w=d.getBoundingClientRect();({scaleX:g,scaleY:b}=p3e(d,w)),h={left:w.left,right:w.left+d.clientWidth*g,top:w.top,bottom:w.top+d.clientHeight*b}}let v=0,y=0;if(r=="nearest")t.top0&&t.bottom>h.bottom+y&&(y=t.bottom-h.bottom+o)):t.bottom>h.bottom-o&&(y=t.bottom-h.bottom+o,n<0&&t.top-y0&&t.right>h.right+v&&(v=t.right-h.right+s)):t.right>h.right-s&&(v=t.right-h.right+s,n<0&&t.lefth.bottom||t.lefth.right)&&(t={left:Math.max(t.left,h.left),right:Math.min(t.right,h.right),top:Math.max(t.top,h.top),bottom:Math.min(t.bottom,h.bottom)}),d=d.assignedSlot||d.parentNode}else if(d.nodeType==11)d=d.host;else break}function m3e(e,t=!0){let n=e.ownerDocument,i=null,r=null;for(let s=e.parentNode;s&&!(s==n.body||(!t||i)&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),t&&!i&&s.scrollWidth>s.clientWidth&&(i=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:i,y:r}}class NIt{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:n,focusNode:i}=t;this.set(n,Math.min(t.anchorOffset,n?rm(n):0),i,Math.min(t.focusOffset,i?rm(i):0))}set(t,n,i,r){this.anchorNode=t,this.anchorOffset=n,this.focusNode=i,this.focusOffset=r}}let hy=null;dn.safari&&dn.safari_version>=26&&(hy=!1);function g3e(e){if(e.setActive)return e.setActive();if(hy)return e.focus(hy);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(hy==null?{get preventScroll(){return hy={preventScroll:!0},!0}}:void 0),!hy){hy=!1;for(let n=0;nMath.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function y3e(e,t){for(let n=e,i=t;;){if(n.nodeType==3&&i>0)return{node:n,offset:i};if(n.nodeType==1&&i>0){if(n.contentEditable=="false")return null;n=n.childNodes[i-1],i=rm(n)}else if(n.parentNode&&!QI(n))i=hb(n),n=n.parentNode;else return null}}function v3e(e,t){for(let n=e,i=t;;){if(n.nodeType==3&&i=n){if(l.level==i)return o;(s<0||(r!=0?r<0?l.fromn:t[s].level>l.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function k3e(e,t){if(e.length!=t.length)return!1;for(let n=0;n=0;b-=3)if(Qf[b+1]==-m){let v=Qf[b+2],y=v&2?r:v&4?v&1?s:r:0;y&&(ls[f]=ls[Qf[b]]=y),l=b;break}}else{if(Qf.length==189)break;Qf[l++]=f,Qf[l++]=h,Qf[l++]=c}else if((g=ls[f])==2||g==1){let b=g==r;c=b?0:1;for(let v=l-3;v>=0;v-=3){let y=Qf[v+2];if(y&2)break;if(b)Qf[v+2]|=2;else{if(y&4)break;Qf[v+2]|=4}}}}}function FIt(e,t,n,i){for(let r=0,s=i;r<=n.length;r++){let o=r?n[r-1].to:e,l=rc;)g==v&&(g=n[--b].from,v=b?n[b-1].to:e),ls[--g]=m;c=d}else s=u,c++}}}function B9(e,t,n,i,r,s,o){let l=i%2?2:1;if(i%2==r%2)for(let c=t,u=0;cc&&o.push(new uh(c,b.from,m));let v=b.direction==bv!=!(m%2);U9(e,v?i+1:i,r,b.inner,b.from,b.to,o),c=b.to}g=b.to}else{if(g==n||(d?ls[g]!=l:ls[g]==l))break;g++}h?B9(e,c,g,i+1,r,h,o):ct;){let d=!0,f=!1;if(!u||c>s[u-1].to){let b=ls[c-1];b!=l&&(d=!1,f=b==16)}let h=!d&&l==1?[]:null,m=d?i:i+1,g=c;e:for(;;)if(u&&g==s[u-1].to){if(f)break e;let b=s[--u];if(!d)for(let v=b.from,y=u;;){if(v==t)break e;if(y&&s[y-1].to==v)v=s[--y].from;else{if(ls[v-1]==l)break e;break}}if(h)h.push(b);else{b.tols.length;)ls[ls.length]=256;let i=[],r=t==bv?0:1;return U9(e,r,r,n,0,e.length,i),i}function O3e(e){return[new uh(0,e,0)]}let S3e="";function UIt(e,t,n,i,r){var s;let o=i.head-e.from,l=uh.find(t,o,(s=i.bidiLevel)!==null&&s!==void 0?s:-1,i.assoc),c=t[l],u=c.side(r,n);if(o==u){let h=l+=r?1:-1;if(h<0||h>=t.length)return null;c=t[l=h],o=c.side(!r,n),u=c.side(r,n)}let d=Lo(e.text,o,c.forward(r,n));(dc.to)&&(d=u),S3e=e.text.slice(Math.min(o,d),Math.max(o,d));let f=l==(r?t.length-1:0)?null:t[l+(r?1:-1)];return f&&d==u&&f.level+(r?0:1)e.some(t=>t)}),R3e=pn.define({combine:e=>e.some(t=>t)}),I3e=pn.define();class ww{constructor(t,n,i,r,s,o=!1){this.range=t,this.y=n,this.x=i,this.yMargin=r,this.xMargin=s,this.isSnapshot=o}map(t){return t.empty?this:new ww(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new ww(pt.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const z_=hi.define({map:(e,t)=>e.map(t)}),P3e=hi.define();function Rc(e,t,n){let i=e.facet(T3e);i.length?i[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+":",t):console.error(t))}const kp=pn.define({combine:e=>e.length?e[0]:!0});let zIt=0;const Ux=pn.define({combine(e){return e.filter((t,n)=>{for(let i=0;i{let c=[];return o&&c.push(KM.of(u=>{let d=u.plugin(l);return d?o(d):$n.none})),s&&c.push(s(l)),c})}static fromClass(t,n){return ba.define((i,r)=>new t(i,r),n)}}class Y4{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(t){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(i){if(Rc(n.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(t,this.spec.arg)}catch(n){Rc(t.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(i){Rc(t.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const D3e=pn.define(),Wq=pn.define(),KM=pn.define(),M3e=pn.define(),Kq=pn.define(),IT=pn.define(),L3e=pn.define();function Mie(e,t){let n=e.state.facet(L3e);if(!n.length)return n;let i=n.map(s=>s instanceof Function?s(e):s),r=[];return Yi.spans(i,t.from,t.to,{point(){},span(s,o,l,c){let u=s-t.from,d=o-t.from,f=r;for(let h=l.length-1;h>=0;h--,c--){let m=l[h].spec.bidiIsolate,g;if(m==null&&(m=QIt(t.text,u,d)),c>0&&f.length&&(g=f[f.length-1]).to==u&&g.direction==m)g.to=d,f=g.inner;else{let b={from:u,to:d,direction:m,inner:[]};f.push(b),f=b.inner}}}}),r}const $3e=pn.define();function Gq(e){let t=0,n=0,i=0,r=0;for(let s of e.state.facet($3e)){let o=s(e);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(r=Math.max(r,o.bottom)))}return{left:t,right:n,top:i,bottom:r}}const xS=pn.define();class bd{constructor(t,n,i,r){this.fromA=t,this.toA=n,this.fromB=i,this.toB=r}join(t){return new bd(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let n=t.length,i=this;for(;n>0;n--){let r=t[n-1];if(!(r.fromA>i.toA)){if(r.toAr.push(new bd(s,o,l,c))),this.changedRanges=r}static create(t,n,i){return new zI(t,n,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const VIt=[];class ga{constructor(t,n,i=0){this.dom=t,this.length=n,this.flags=i,this.parent=null,t.cmTile=this}get breakAfter(){return this.flags&1}get children(){return VIt}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(t){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&CIt(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(t){this.dom=t,t.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(t,n=this.posAtStart){let i=n;for(let r of this.children){if(r==t)return i;i+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(t){return this.posBefore(t)+t.length}covers(t){return!0}coordsIn(t,n,i){return null}domPosFor(t,n){let i=hb(this.dom),r=this.length?t>0:n>0;return new of(this.parent.dom,i+(r?1:0),t==0||t==this.length)}markDirty(t){this.flags&=-3,t&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let t=this;t;t=t.parent)if(t instanceof XM)return t;return null}static get(t){return t.cmTile}}class GM extends ga{constructor(t){super(t,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(t){this.children.push(t),t.parent=this}sync(t){if(this.flags&2)return;super.sync(t);let n=this.dom,i=null,r,s=(t==null?void 0:t.node)==n?t:null,o=0;for(let l of this.children){if(l.sync(t),o+=l.length+l.breakAfter,r=i?i.nextSibling:n.firstChild,s&&r!=l.dom&&(s.written=!0),l.dom.parentNode==n)for(;r&&r!=l.dom;)r=Lie(r);else n.insertBefore(l.dom,r);i=l.dom}for(r=i?i.nextSibling:n.firstChild,s&&r&&(s.written=!0);r;)r=Lie(r);this.length=o}}function Lie(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class XM extends GM{constructor(t,n){super(n),this.view=t}owns(t){for(;t;t=t.parent)if(t==this)return!0;return!1}isBlock(){return!0}nearest(t){for(;;){if(!t)return null;let n=ga.get(t);if(n&&this.owns(n))return n;t=t.parentNode}}blockTiles(t){for(let n=[],i=this,r=0,s=0;;)if(r==i.children.length){if(!n.length)return;i=i.parent,i.breakAfter&&s++,r=n.pop()}else{let o=i.children[r++];if(o instanceof zp)n.push(r),i=o,r=0;else{let l=s+o.length,c=t(o,s);if(c!==void 0)return c;s=l+o.breakAfter}}}resolveBlock(t,n){let i,r=-1,s,o=-1;if(this.blockTiles((l,c)=>{let u=c+l.length;if(t>=c&&t<=u){if(l.isWidget()&&n>=-1&&n<=1){if(l.flags&32)return!0;l.flags&16&&(i=void 0)}(ct||t==c&&(n>1?l.length:l.covers(-1)))&&(!s||!l.isWidget()&&s.isWidget())&&(s=l,o=t-c)}}),!i&&!s)throw new Error("No tile at position "+t);return i&&n<0||!s?{tile:i,offset:r}:{tile:s,offset:o}}}class zp extends GM{constructor(t,n){super(t),this.wrapper=n}isBlock(){return!0}covers(t){return this.children.length?t<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,n){let i=new zp(n||document.createElement(t.tagName),t);return n||(i.flags|=4),i}}class h1 extends GM{constructor(t,n){super(t),this.attrs=n}isLine(){return!0}static start(t,n,i){let r=new h1(n||document.createElement("div"),t);return(!n||!i)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(t,n,i){let r=null,s=-1,o=null,l=-1;function c(d,f){for(let h=0,m=0;h=f&&(g.isComposite()?c(g,f-m):(!o||o.isHidden&&(n>0&&!(o.flags&32)||i&&qIt(o,g)))&&(b>f||g.flags&32)?(o=g,l=f-m):(mr&&(t=r);let s=t,o=t,l=0;t==0&&n<0||t==r&&n>=0?dn.chrome||dn.gecko||(t?(s--,l=1):o=0)?0:c.length-1];return dn.safari&&!l&&u.width==0&&(u=Array.prototype.find.call(c,d=>d.width)||u),i==null?u:UC(u,(l?l>0:n<0)==i)}static of(t,n){let i=new jy(n||document.createTextNode(t),t);return n||(i.flags|=2),i}}class yv extends ga{constructor(t,n,i,r){super(t,n,r),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(t){return this.flags&48?!1:(this.flags&(t<0?64:128))>0}coordsIn(t,n){return this.coordsInWidget(t,n,!1)}coordsInWidget(t,n,i){let r=this.widget.coordsAt(this.dom,t,n);if(r)return r;if(i)return UC(this.dom.getBoundingClientRect(),this.length?t==0:n<=0);{let s=this.dom.getClientRects(),o=null;if(!s.length)return null;let l=this.flags&16?!0:this.flags&32?!1:t>0;for(let c=l?s.length-1:0;o=s[c],!(t>0?c==0:c==s.length-1||o.top0==i)}}class WIt{constructor(t){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=t}advance(t,n,i){let{tile:r,index:s,beforeBreak:o,parents:l}=this;for(;t||n>0;)if(r.isComposite())if(o){if(!t)break;i&&i.break(),t--,o=!1}else if(s==r.children.length){if(!t&&!l.length)break;i&&i.leave(r),o=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++}else{let c=r.children[s],u=c.breakAfter;(n>0?c.length<=t:c.length=0;l--){let c=n.marks[l],u=r.lastChild;if(u instanceof jc&&u.mark.eq(c.mark))u.dom!=c.dom&&u.setDOM(Z4(c.dom)),r=u;else{if(this.cache.reused.get(c)){let f=ga.get(c.dom);f&&f.setDOM(Z4(c.dom))}let d=jc.of(c.mark,c.dom);r.append(d),r=d}this.cache.reused.set(c,2)}let s=ga.get(t.text);s&&this.cache.reused.set(s,2);let o=new jy(t.text,t.text.nodeValue);o.flags|=8,this.pos=t.range.toB,r.append(o)}addInlineWidget(t,n,i){let r=this.afterWidget&&t.flags&48&&(this.afterWidget.flags&48)==(t.flags&48);r||this.flushBuffer();let s=this.ensureMarks(n,i);!r&&!(t.flags&16)&&s.append(this.getBuffer(1)),s.append(t),this.pos+=t.length,this.afterWidget=t}addMark(t,n,i){this.flushBuffer(),this.ensureMarks(n,i).append(t),this.pos+=t.length,this.afterWidget=null}addBlockWidget(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}continueWidget(t){let n=this.afterWidget||this.lastBlock;n.length+=t,this.pos+=t}addLineStart(t,n){var i;t||(t=F3e);let r=h1.start(t,n||((i=this.cache.find(h1))===null||i===void 0?void 0:i.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(t){this.blockPosCovered()||this.addLineStart(t)}ensureLine(t){this.curLine||this.addLineStart(t)}ensureMarks(t,n){var i;let r=this.curLine;for(let s=t.length-1;s>=0;s--){let o=t[s],l;if(n>0&&(l=r.lastChild)&&l instanceof jc&&l.mark.eq(o))r=l,n--;else{let c=jc.of(o,(i=this.cache.find(jc,u=>u.mark.eq(o)))===null||i===void 0?void 0:i.dom);r.append(c),r=c,n=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let t=this.curLine.lastChild;(!t||!$ie(this.curLine,!1)||t.dom.nodeName!="BR"&&t.isWidget()&&!(dn.ios&&$ie(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(J4,0,32)||new yv(J4.toDOM(),0,J4,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let t=this.wrappers.length-1;t>=0;t--)this.wrappers[t].to=this.pos){let n=t.rank*102+t.value.rank,i=new KIt(t.from,t.to,t.value,n),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-i.rank||this.wrappers[r-1].to-i.to)<0;)r--;this.wrappers.splice(r,0,i)}this.wrapperPos=this.pos}getBlockPos(){var t;this.updateBlockWrappers();let n=this.root;for(let i of this.wrappers){let r=n.lastChild;if(i.fromo.wrapper.eq(i.wrapper)))===null||t===void 0?void 0:t.dom);n.append(s),n=s}}return n}blockPosCovered(){let t=this.lastBlock;return t!=null&&!t.breakAfter&&(!t.isWidget()||(t.flags&160)>0)}getBuffer(t){let n=2|(t<0?16:32),i=this.cache.find(VI,void 0,1);return i&&(i.flags=n),i||new VI(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class XIt{constructor(t){this.skipCount=0,this.text="",this.textOff=0,this.cursor=t.iter()}skip(t){this.textOff+t<=this.text.length?this.textOff+=t:(this.skipCount+=t-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(t){if(this.textOff==this.text.length){let{value:r,lineBreak:s,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=r;let l=this.textOff=Math.min(t,r.length);return s?null:r.slice(0,l)}let n=Math.min(this.text.length,this.textOff+t),i=this.text.slice(this.textOff,n);return this.textOff=n,i}}const HI=[yv,h1,jy,jc,VI,zp,XM];for(let e=0;e[]),this.index=HI.map(()=>0),this.reused=new Map}add(t){let n=t.constructor.bucket,i=this.buckets[n];i.length<6?i.push(t):i[this.index[n]=(this.index[n]+1)%6]=t}find(t,n,i=2){let r=t.bucket,s=this.buckets[r],o=this.index[r];for(let l=0;l{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(t,n){let i=n&&this.getCompositionContext(n.text);for(let r=0,s=0,o=0;;){let l=or){let u=c-r;this.preserve(u,!o,!l),r=c,s+=u}if(!l)break;n&&l.fromA<=n.range.fromA&&l.toA>=n.range.toA?(this.forward(l.fromA,n.range.fromA,n.range.fromA{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(c-l);else{let u=c>0||l{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof jc&&r.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?r.length&&(r.length=s=0):o instanceof jc&&(r.shift(),s=Math.min(s,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(t)}emit(t,n){let i=null,r=this.builder,s=-1,o=Yi.spans(this.decorations,t,n,{point:(l,c,u,d,f,h)=>{if(u instanceof gv){if(this.disallowBlockEffectsFor[h]){if(u.block)throw new RangeError("Block decorations may not be specified via plugins");if(c>this.view.state.doc.lineAt(l).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=d.length,f>d.length)r.continueWidget(c-l);else{let m=u.widget||(u.block?p1.block:p1.inline),g=JIt(u),b=this.cache.findWidget(m,c-l,g)||yv.of(m,this.view,c-l,g);u.block?(u.startSide>0&&r.addLineStartIfNotCovered(i),r.addBlockWidget(b)):(r.ensureLine(i),r.addInlineWidget(b,d,f))}i=null}else i=ePt(i,u);c>l&&this.text.skip(c-l)},span:(l,c,u,d)=>{for(let f=l;f-1&&(this.openWidget=o>s),this.openWidget||r.addLineStartIfNotCovered(i),this.openMarks=o}forward(t,n,i=1){n-t<=10?this.old.advance(n-t,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-t-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(t){let n=[],i=null;for(let r=t.parentNode;;r=r.parentNode){let s=ga.get(r);if(r==this.view.contentDOM)break;s instanceof jc?n.push(s):s!=null&&s.isLine()?i=s:s instanceof zp||(r.nodeName=="DIV"&&!i&&r!=this.view.contentDOM?i=new h1(r,F3e):i||n.push(jc.of(new NT({tagName:r.nodeName.toLowerCase(),attributes:AIt(r)}),r)))}return{line:i,marks:n}}}function $ie(e,t){let n=i=>{for(let r of i.children)if((t?r.isText():r.length)||n(r))return!0;return!1};return n(e)}function JIt(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}const F3e={class:"cm-line"};function ePt(e,t){let n=t.spec.attributes,i=t.spec.class;return!n&&!i||(e||(e={class:"cm-line"}),n&&Qq(n,e),i&&(e.class+=" "+i)),e}function tPt(e){let t=[];for(let n=e.parents.length;n>1;n--){let i=n==e.parents.length?e.tile:e.parents[n].tile;i instanceof jc&&t.push(i.mark)}return t}function Z4(e){let t=ga.get(e);return t&&t.setDOM(e.cloneNode()),e}class p1 extends Tf{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}p1.inline=new p1("span");p1.block=new p1("div");const J4=new class extends Tf{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class Fie{constructor(t){this.view=t,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=$n.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new XM(t,t.contentDOM),this.updateInner([new bd(0,0,0,t.state.doc.length)],null)}update(t){var n;let i=t.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:d,toA:f})=>fthis.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?r=this.domChanged.newSel.head:!uPt(t.changes,this.hasComposition)&&!t.selectionSet&&(r=t.state.selection.main.head));let s=r>-1?iPt(this.view,t.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:d,to:f}=this.hasComposition;i=new bd(d,f,t.changes.mapPos(d,-1),t.changes.mapPos(f,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(dn.ie||dn.chrome)&&!s&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.blockWrappers;this.updateDeco();let c=aPt(o,this.decorations,t.changes);c.length&&(i=bd.extendWithRanges(i,c));let u=lPt(l,this.blockWrappers,t.changes);return u.length&&(i=bd.extendWithRanges(i,u)),s&&!i.some(d=>d.fromA<=s.range.fromA&&d.toA>=s.range.toA)&&(i=s.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,s),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,n){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(n||t.length){let o=this.tile,l=new ZIt(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&ga.get(n.text)&&l.cache.reused.set(ga.get(n.text),2),this.tile=l.run(t,n),z9(o,l.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=dn.chrome||dn.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||i.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to-1)&&OE(i,this.view.observer.selectionRange)&&!(r&&i.contains(r));if(!(s||n||o))return;let l=this.forceSelection;this.forceSelection=!1;let c=this.view.state.selection.main,u,d;if(c.empty?d=u=this.inlineDOMNearPos(c.anchor,c.assoc||1):(d=this.inlineDOMNearPos(c.head,c.head==c.from?1:-1),u=this.inlineDOMNearPos(c.anchor,c.anchor==c.from?1:-1)),dn.gecko&&c.empty&&!this.hasComposition&&nPt(u)){let h=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(h,u.node.childNodes[u.offset]||null)),u=d=new of(h,0),l=!0}let f=this.view.observer.selectionRange;(l||!f.focusNode||(!EE(u.node,u.offset,f.anchorNode,f.anchorOffset)||!EE(d.node,d.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,c))&&(this.view.observer.ignore(()=>{dn.android&&dn.chrome&&i.contains(f.focusNode)&&cPt(f.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let h=BC(this.view.root);if(h)if(c.empty){if(dn.gecko){let m=rPt(u.node,u.offset);if(m&&m!=3){let g=(m==1?y3e:v3e)(u.node,u.offset);g&&(u=new of(g.node,g.offset))}}h.collapse(u.node,u.offset),c.bidiLevel!=null&&h.caretBidiLevel!==void 0&&(h.caretBidiLevel=c.bidiLevel)}else if(h.extend){h.collapse(u.node,u.offset);try{h.extend(d.node,d.offset)}catch{}}else{let m=document.createRange();c.anchor>c.head&&([u,d]=[d,u]),m.setEnd(d.node,d.offset),m.setStart(u.node,u.offset),h.removeAllRanges(),h.addRange(m)}o&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(u,d)),this.impreciseAnchor=u.precise?null:new of(f.anchorNode,f.anchorOffset),this.impreciseHead=d.precise?null:new of(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(t,n){return this.hasComposition&&n.empty&&EE(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,n=t.state.selection.main,i=BC(t.root),{anchorNode:r,anchorOffset:s}=t.observer.selectionRange;if(!i||!n.empty||!n.assoc||!i.modify)return;let o=this.lineAt(n.head,n.assoc);if(!o)return;let l=o.posAtStart;if(n.head==l||n.head==l+o.length)return;let c=this.coordsAt(n.head,-1),u=this.coordsAt(n.head,1);if(!c||!u||c.bottom>u.top)return;let d=this.domAtPos(n.head+n.assoc,n.assoc);i.collapse(d.node,d.offset),i.modify("move",n.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let f=t.observer.selectionRange;t.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=n.from&&i.collapse(r,s)}posFromDOM(t,n){let i=this.tile.nearest(t);if(!i)return this.tile.dom.compareDocumentPosition(t)&2?0:this.view.state.doc.length;let r=i.posAtStart;if(i.isComposite()){let s;if(t==i.dom)s=i.dom.childNodes[n];else{let o=rm(t)==0?0:n==0?-1:1;for(;;){let l=t.parentNode;if(l==i.dom)break;o==0&&l.firstChild!=l.lastChild&&(t==l.firstChild?o=-1:o=1),t=l}o<0?s=t:s=t.nextSibling}if(s==i.dom.firstChild)return r;for(;s&&!ga.get(s);)s=s.nextSibling;if(!s)return r+i.length;for(let o=0,l=r;;o++){let c=i.children[o];if(c.dom==s)return l;l+=c.length+c.breakAfter}}else return i.isText()?t==i.dom?r+n:r+(n?i.length:0):r}domAtPos(t,n){let{tile:i,offset:r}=this.tile.resolveBlock(t,n);return i.isWidget()?i.domPosFor(r,n):i.domIn(r,n)}inlineDOMNearPos(t,n){let i,r=-1,s=!1,o,l=-1,c=!1;return this.tile.blockTiles((u,d)=>{if(u.isWidget()){if(u.flags&32&&d>=t)return!0;u.flags&16&&(s=!0)}else{let f=d+u.length;if(d<=t&&(i=u,r=t-d,s=f=t&&!o&&(o=u,l=t-d,c=d>t),d>t&&o)return!0}}),!i&&!o?this.domAtPos(t,n):(s&&o?i=null:c&&i&&(o=null),i&&n<0||!o?i.domIn(r,n):o.domIn(l,n))}coordsAt(t,n,i){let{tile:r,offset:s}=this.tile.resolveBlock(t,n);return r.isWidget()?r.widget instanceof e$?null:r.coordsInWidget(s,n,!0):r.coordsIn(s,n,i)}lineAt(t,n){let{tile:i}=this.tile.resolveBlock(t,n);return i.isLine()?i:null}coordsForChar(t){let{tile:n,offset:i}=this.tile.resolveBlock(t,1);if(!n.isLine())return null;function r(s,o){if(s.isComposite())for(let l of s.children){if(l.length>=o){let c=r(l,o);if(c)return c}if(o-=l.length,o<0)break}else if(s.isText()&&oMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,c=this.view.textDirection==cs.LTR,u=0,d=(f,h,m)=>{for(let g=0;gr);g++){let b=f.children[g],v=h+b.length,y=b.dom.getBoundingClientRect(),{height:w}=y;if(m&&!g&&(u+=y.top-m.top),b instanceof zp)v>i&&d(b,h,y);else if(h>=i&&(u>0&&n.push(-u),n.push(w+u),u=0,o)){let x=b.dom.lastChild,k=x?SE(x):[];if(k.length){let S=k[k.length-1],O=c?S.right-y.left:y.right-S.left;O>l&&(l=O,this.minWidth=s,this.minWidthFrom=h,this.minWidthTo=v)}}m&&g==f.children.length-1&&(u+=m.bottom-y.bottom),h=v+b.breakAfter}};return d(this.tile,0,null),n}textDirectionAt(t){let{tile:n}=this.tile.resolveBlock(t,1);return getComputedStyle(n.dom).direction=="rtl"?cs.RTL:cs.LTR}measureTextSize(){let t=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let l=0,c;for(let u of o.children){if(!u.isText()||/[^ -~]/.test(u.text))return;let d=SE(u.dom);if(d.length!=1)return;l+=d[0].width,c=d[0].height}if(l)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:l/o.length,textHeight:c}}});if(t)return t;let n=document.createElement("div"),i,r,s;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let o=SE(n.firstChild)[0];i=n.getBoundingClientRect().height,r=o&&o.width?o.width/27:7,s=o&&o.height?o.height:i,n.remove()}),{lineHeight:i,charWidth:r,textHeight:s}}computeBlockGapDeco(){let t=[],n=this.view.viewState;for(let i=0,r=0;;r++){let s=r==n.viewports.length?null:n.viewports[r],o=s?s.from-1:this.view.state.doc.length;if(o>i){let l=(n.lineBlockAt(o).bottom-n.lineBlockAt(i).top)/this.view.scaleY;t.push($n.replace({widget:new e$(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!s)break;i=s.to+1}return $n.set(t)}updateDeco(){let t=1,n=this.view.state.facet(KM).map(s=>(this.dynamicDecorationMap[t++]=typeof s=="function")?s(this.view):s),i=!1,r=this.view.state.facet(Kq).map((s,o)=>{let l=typeof s=="function";return l&&(i=!0),l?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[t++]=i,n.push(Yi.join(r))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];ttypeof s=="function"?s(this.view):s)}scrollIntoView(t){if(t.isSnapshot){let u=this.view.viewState.lineBlockAt(t.range.head);this.view.scrollDOM.scrollTop=u.top-t.yMargin,this.view.scrollDOM.scrollLeft=t.xMargin;return}for(let u of this.view.state.facet(I3e))try{if(u(this.view,t.range,t))return!0}catch(d){Rc(this.view.state,d,"scroll handler")}let{range:n}=t,i=this.coordsAt(n.head,n.assoc||(n.head>n.anchor?-1:1)),r;if(!i)return;!n.empty&&(r=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(i={left:Math.min(i.left,r.left),top:Math.min(i.top,r.top),right:Math.max(i.right,r.right),bottom:Math.max(i.bottom,r.bottom)});let s=Gq(this.view),o={left:i.left-s.left,top:i.top-s.top,right:i.right+s.right,bottom:i.bottom+s.bottom},{offsetWidth:l,offsetHeight:c}=this.view.scrollDOM;if(jIt(this.view.scrollDOM,o,n.head1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottomi.isWidget()||i.children.some(n);return n(this.tile.resolveBlock(t,1).tile)}destroy(){z9(this.tile)}}function z9(e,t){let n=t==null?void 0:t.get(e);if(n!=1){n==null&&e.destroy();for(let i of e.children)z9(i,t)}}function nPt(e){return e.node.nodeType==1&&e.node.firstChild&&(e.offset==0||e.node.childNodes[e.offset-1].contentEditable=="false")&&(e.offset==e.node.childNodes.length||e.node.childNodes[e.offset].contentEditable=="false")}function B3e(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let i=y3e(n.focusNode,n.focusOffset),r=v3e(n.focusNode,n.focusOffset),s=i||r;if(r&&i&&r.node!=i.node){let l=ga.get(r.node);if(!l||l.isText()&&l.text!=r.node.nodeValue)s=r;else if(e.docView.lastCompositionAfterCursor){let c=ga.get(i.node);!c||c.isText()&&c.text!=i.node.nodeValue||(s=r)}}if(e.docView.lastCompositionAfterCursor=s!=i,!s)return null;let o=t-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function iPt(e,t,n){let i=B3e(e,n);if(!i)return null;let{node:r,from:s,to:o}=i,l=r.nodeValue;if(/[\n\r]/.test(l)||e.state.doc.sliceString(i.from,i.to)!=l)return null;let c=t.invertedDesc;return{range:new bd(c.mapPos(s),c.mapPos(o),s,o),text:r}}function rPt(e,t){return e.nodeType!=1?0:(t&&e.childNodes[t-1].contentEditable=="false"?1:0)|(t{it.from&&(n=!0)}),n}class e$ extends Tf{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function dPt(e,t,n=1){let i=e.charCategorizer(t),r=e.doc.lineAt(t),s=t-r.from;if(r.length==0)return pt.cursor(t);s==0?n=1:s==r.length&&(n=-1);let o=s,l=s;n<0?o=Lo(r.text,s,!1):l=Lo(r.text,s);let c=i(r.text.slice(o,l));for(;o>0;){let u=Lo(r.text,o,!1);if(i(r.text.slice(u,o))!=c)break;o=u}for(;le.defaultLineHeight*1.5){let l=e.viewState.heightOracle.textHeight,c=Math.floor((r-n.top-(e.defaultLineHeight-l)*.5)/l);s+=c*e.viewState.heightOracle.lineLength}let o=e.state.sliceDoc(n.from,n.to);return n.from+N9(o,s,e.state.tabSize)}function V9(e,t,n){let i=e.lineBlockAt(t);if(Array.isArray(i.type)){let r;for(let s of i.type){if(s.from>t)break;if(!(s.tot)return s;(!r||s.type==ul.Text&&(r.type!=s.type||(n<0?s.fromt)))&&(r=s)}}return r||i}return i}function hPt(e,t,n,i){let r=V9(e,t.head,t.assoc||-1),s=!i||r.type!=ul.Text||!(e.lineWrapping||r.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>r.from?t.head-1:t.head);if(s){let o=e.dom.getBoundingClientRect(),l=e.textDirectionAt(r.from),c=e.posAtCoords({x:n==(l==cs.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(c!=null)return pt.cursor(c,n?-1:1)}return pt.cursor(n?r.to:r.from,n?-1:1)}function Bie(e,t,n,i){let r=e.state.doc.lineAt(t.head),s=e.bidiSpans(r),o=e.textDirectionAt(r.from);for(let l=t,c=null;;){let u=UIt(r,s,o,l,n),d=S3e;if(!u){if(r.number==(n?e.state.doc.lines:1))return l;d=` -`,r=e.state.doc.line(r.number+(n?1:-1)),s=e.bidiSpans(r),u=e.visualLineSide(r,!n)}if(c){if(!c(d))return l}else{if(!i)return u;c=i(d)}l=u}}function pPt(e,t,n){let i=e.state.charCategorizer(t),r=i(n);return s=>{let o=i(s);return r==Qs.Space&&(r=o),r==o}}function mPt(e,t,n,i){let r=t.head,s=n?1:-1;if(r==(n?e.state.doc.length:0))return pt.cursor(r,t.assoc);let o=t.goalColumn,l,c=e.contentDOM.getBoundingClientRect(),u=e.coordsAtPos(r,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),d=e.documentTop;if(u)o==null&&(o=u.left-c.left),l=s<0?u.top:u.bottom;else{let g=e.viewState.lineBlockAt(r);o==null&&(o=Math.min(c.right-c.left,e.defaultCharacterWidth*(r-g.from))),l=(s<0?g.top:g.bottom)+d}let f=c.left+o,h=e.viewState.heightOracle.textHeight>>1,m=i??h;for(let g=0;;g+=h){let b=l+(m+g)*s,v=H9(e,{x:f,y:b},!1,s);if(n?b>c.bottom:bl:w{if(t>s&&tr(e)),n.from,t.head>n.from?-1:1);return i==n.from?n:pt.cursor(i,ie.viewState.docHeight)return new ih(e.state.doc.length,-1);if(u=e.elementAtHeight(c),i==null)break;if(u.type==ul.Text){if(i<0?u.toe.viewport.to)break;let h=e.docView.coordsAt(i<0?u.from:u.to,i>0?-1:1);if(h&&(i<0?h.top<=c+s:h.bottom>=c+s))break}let f=e.viewState.heightOracle.textHeight/2;c=i>0?u.bottom+f:u.top-f}if(e.viewport.from>=u.to||e.viewport.to<=u.from){if(n)return null;if(u.type==ul.Text){let f=fPt(e,r,u,o,l);return new ih(f,f==u.from?1:-1)}}if(u.type!=ul.Text)return c<(u.top+u.bottom)/2?new ih(u.from,1):new ih(u.to,-1);let d=e.docView.lineAt(u.from,2);return(!d||d.length!=u.length)&&(d=e.docView.lineAt(u.from,-2)),new gPt(e,o,l,e.textDirectionAt(u.from)).scanTile(d,u.from)}class gPt{constructor(t,n,i,r){this.view=t,this.x=n,this.y=i,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(t){return(!this.line||this.line.from>t||this.line.to1||i.length&&(i[0].level!=this.baseDir||i[0].to+r.from>1;t:if(o.has(b)){let y=r+Math.floor(Math.random()*g);for(let w=0;w1)){if(w.bottomthis.y)(!u||u.top>w.top)&&(u=w),x=-1;else{let k=w.left>this.x?this.x-w.left:w.right(g+g+b)/3)return this.y=c.bottom-1,this.scan(t,n,!0);if(u&&u.top<(g+b+b)/3)return this.y=u.top+1,this.scan(t,n,!0)}let m=(l?this.dirAt(t[d],1):this.baseDir)==cs.LTR;return{i:d,after:this.x>(h.left+h.right)/2==m}}scanText(t,n){let i=[];for(let s=0;s{let o=i[s]-n,l=i[s+1]-n;return QC(t.dom,o,l).getClientRects()});return r.after?new ih(i[r.i+1],-1):new ih(i[r.i],1)}scanTile(t,n){if(!t.length)return new ih(n,1);if(t.children.length==1){let l=t.children[0];if(l.isText())return this.scanText(l,n);if(l.isComposite())return this.scanTile(l,n)}let i=[n];for(let l=0,c=n;l{let c=t.children[l];return c.flags&48?null:(c.dom.nodeType==1?c.dom:QC(c.dom,0,c.length)).getClientRects()}),s=t.children[r.i],o=i[r.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):r.after?new ih(i[r.i+1],-1):new ih(o,1)}}const dx="￿";class bPt{constructor(t,n){this.points=t,this.view=n,this.text="",this.lineSeparator=n.state.facet(sr.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=dx}readRange(t,n){if(!t)return this;let i=t.parentNode;for(let r=t;;){this.findPointBefore(i,r);let s=this.text.length;this.readNode(r);let o=ga.get(r),l=r.nextSibling;if(l==n){o!=null&&o.breakAfter&&!l&&i!=this.view.contentDOM&&this.lineBreak();break}let c=ga.get(l);(o&&c?o.breakAfter:(o?o.breakAfter:QI(r))||QI(l)&&(r.nodeName!="BR"||o!=null&&o.isWidget())&&this.text.length>s)&&!vPt(l,n)&&this.lineBreak(),r=l}return this.findPointBefore(i,n),this}readTextNode(t){let n=t.nodeValue;for(let i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,n.length));for(let i=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,l;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=r.exec(n))&&(s=l.index,o=l[0].length),this.append(n.slice(i,s<0?n.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let c of this.points)c.node==t&&c.pos>this.text.length&&(c.pos-=o-1);i=s+o}}readNode(t){let n=ga.get(t),i=n&&n.overrideDOMText;if(i!=null){this.findPointInside(t,i.length);for(let r=i.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else t.nodeType==3?this.readTextNode(t):t.nodeName=="BR"?t.nextSibling&&this.lineBreak():t.nodeType==1&&this.readRange(t.firstChild,null)}findPointBefore(t,n){for(let i of this.points)i.node==t&&t.childNodes[i.offset]==n&&(i.pos=this.text.length)}findPointInside(t,n){for(let i of this.points)(t.nodeType==3?i.node==t:t.contains(i.node))&&(i.pos=this.text.length+(yPt(t,i.node,i.offset)?n:0))}}function yPt(e,t,n){for(;;){if(!t||n-1;let{impreciseHead:s,impreciseAnchor:o}=t.docView,l=t.state.selection;if(t.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=Q3e(t.docView.tile,n,i,0))){let c=s||o?[]:kPt(t),u=new bPt(c,t);u.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=u.text,this.newSel=OPt(c,this.bounds.from)}else{let c=t.observer.selectionRange,u=s&&s.node==c.focusNode&&s.offset==c.focusOffset||!$9(t.contentDOM,c.focusNode)?l.main.head:t.docView.posFromDOM(c.focusNode,c.focusOffset),d=o&&o.node==c.anchorNode&&o.offset==c.anchorOffset||!$9(t.contentDOM,c.anchorNode)?l.main.anchor:t.docView.posFromDOM(c.anchorNode,c.anchorOffset),f=t.viewport;if((dn.ios||dn.chrome)&&u!=d&&Math.min(u,d)<=l.main.from&&Math.max(u,d)>=l.main.to&&(f.from>0||f.to-1&&l.ranges.length>1)this.newSel=l.replaceRange(pt.range(d,u));else if(t.lineWrapping&&d==u&&!(l.main.empty&&l.main.head==u)&&t.inputState.lastTouchTime>Date.now()-100){let h=t.coordsAtPos(u,-1),m=0;h&&(m=t.inputState.lastTouchY<=h.bottom?-1:1),this.newSel=pt.create([pt.cursor(u,m)])}else this.newSel=pt.single(d,u)}}}function Q3e(e,t,n,i){if(e.isComposite()){let r=-1,s=-1,o=-1,l=-1;for(let c=0,u=i,d=i;cn)return Q3e(f,t,n,u);if(h>=t&&r==-1&&(r=c,s=u),u>n&&f.dom.parentNode==e.dom){o=c,l=d;break}d=h,u=h+f.breakAfter}return{from:s,to:l<0?i+e.length:l,startDOM:(r?e.children[r-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:o=0?e.children[o].dom:null}}else return e.isText()?{from:i,to:i+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function z3e(e,t){let n,{newSel:i}=t,{state:r}=e,s=r.selection.main,o=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:l,to:c}=t.bounds,u=s.from,d=null;(o===8||dn.android&&t.text.length=l&&s.to<=c&&(t.typeOver||f!=t.text)&&f.slice(0,s.from-l)==t.text.slice(0,s.from-l)&&f.slice(s.to-l)==t.text.slice(h=t.text.length-(f.length-(s.to-l)))?n={from:s.from,to:s.to,insert:Or.of(t.text.slice(s.from-l,h).split(dx))}:(m=V3e(f,t.text,u-l,d))&&(dn.chrome&&o==13&&m.toB==m.from+2&&t.text.slice(m.from,m.toB)==dx+dx&&m.toB--,n={from:l+m.from,to:l+m.toA,insert:Or.of(t.text.slice(m.from,m.toB).split(dx))})}else i&&(!e.hasFocus&&r.facet(kp)||qI(i,s))&&(i=null);if(!n&&!i)return!1;if((dn.mac||dn.android)&&n&&n.from==n.to&&n.from==s.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute("autocorrect")=="off"?(i&&n.insert.length==2&&(i=pt.single(i.main.anchor-1,i.main.head-1)),n={from:n.from,to:n.to,insert:Or.of([n.insert.toString().replace("."," ")])}):r.doc.lineAt(s.from).toDate.now()-50?n={from:s.from,to:s.to,insert:r.toText(e.inputState.insertingText)}:dn.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==` - `&&e.lineWrapping&&(i&&(i=pt.single(i.main.anchor-1,i.main.head-1)),n={from:s.from,to:s.to,insert:Or.of([" "])}),n)return Xq(e,n,i,o);if(i&&!qI(i,s)){let l=!1,c="select";return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin=="select"&&(l=!0),c=e.inputState.lastSelectionOrigin,c=="select.pointer"&&(i=U3e(r.facet(IT).map(u=>u(e)),i))),e.dispatch({selection:i,scrollIntoView:l,userEvent:c}),!0}else return!1}function Xq(e,t,n,i=-1){if(dn.ios&&e.inputState.flushIOSKey(t))return!0;let r=e.state.selection.main;if(dn.android&&(t.to==r.to&&(t.from==r.from||t.from==r.from-1&&e.state.sliceDoc(t.from,r.from)==" ")&&t.insert.length==1&&t.insert.lines==2&&xw(e.contentDOM,"Enter",13)||(t.from==r.from-1&&t.to==r.to&&t.insert.length==0||i==8&&t.insert.lengthr.head)&&xw(e.contentDOM,"Backspace",8)||t.from==r.from&&t.to==r.to+1&&t.insert.length==0&&xw(e.contentDOM,"Delete",46)))return!0;let s=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let o,l=()=>o||(o=wPt(e,t,n));return e.state.facet(_3e).some(c=>c(e,t.from,t.to,s,l))||e.dispatch(l()),!0}function wPt(e,t,n){let i,r=e.state,s=r.selection.main,o=-1;if(t.from==t.to&&t.froms.to){let c=t.fromf(e)),u,c);t.from==d&&(o=d)}if(o>-1)i={changes:t,selection:pt.cursor(t.from+t.insert.length,-1)};else if(t.from>=s.from&&t.to<=s.to&&t.to-t.from>=(s.to-s.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let c=s.fromt.to?r.sliceDoc(t.to,s.to):"";i=r.replaceSelection(e.state.toText(c+t.insert.sliceString(0,void 0,e.state.lineBreak)+u))}else{let c=r.changes(t),u=n&&n.main.to<=c.newLength?n.main:void 0;if(r.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=s.to+10&&t.to>=s.to-10){let d=e.state.sliceDoc(t.from,t.to),f,h=n&&B3e(e,n.main.head);if(h){let g=t.insert.length-(t.to-t.from);f={from:h.from,to:h.to-g}}else f=e.state.doc.lineAt(s.head);let m=s.to-t.to;i=r.changeByRange(g=>{if(g.from==s.from&&g.to==s.to)return{changes:c,range:u||g.map(c)};let b=g.to-m,v=b-d.length;if(e.state.sliceDoc(v,b)!=d||b>=f.from&&v<=f.to)return{range:g};let y=r.changes({from:v,to:b,insert:t.insert}),w=g.to-s.to;return{changes:y,range:u?pt.range(Math.max(0,u.anchor+w),Math.max(0,u.head+w)):g.map(y)}})}else i={changes:c,selection:u&&r.selection.replaceRange(u)}}let l="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,l+=".compose",e.inputState.compositionFirstChange&&(l+=".start",e.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:l,scrollIntoView:!0})}function V3e(e,t,n,i){let r=Math.min(e.length,t.length),s=0;for(;s0&&l>0&&e.charCodeAt(o-1)==t.charCodeAt(l-1);)o--,l--;if(i=="end"){let c=Math.max(0,s-Math.min(o,l));n-=o+c-s}if(o=o?s-n:0;s-=c,l=s+(l-o),o=s}else if(l=l?s-n:0;s-=c,o=s+(o-l),l=s}return{from:s,toA:o,toB:l}}function kPt(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}=e.observer.selectionRange;return n&&(t.push(new Uie(n,i)),(r!=n||s!=i)&&t.push(new Uie(r,s))),t}function OPt(e,t){if(e.length==0)return null;let n=e[0].pos,i=e.length==2?e[1].pos:n;return n>-1&&i>-1?pt.single(n+t,i+t):null}function qI(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class SPt{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,dn.safari&&t.contentDOM.addEventListener("input",()=>null),dn.gecko&&BPt(t.contentDOM.ownerDocument)}handleEvent(t){!IPt(this.view,t)||this.ignoreDuringComposition(t)||t.type=="keydown"&&this.keydown(t)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(t.type,t)):this.runHandlers(t.type,t))}runHandlers(t,n){let i=this.handlers[t];if(i){for(let r of i.observers)r(this.view,n);for(let r of i.handlers){if(n.defaultPrevented)break;if(r(this.view,n)){n.preventDefault();break}}}}ensureHandlers(t){let n=CPt(t),i=this.handlers,r=this.view.contentDOM;for(let s in n)if(s!="scroll"){let o=!n[s].handlers.length,l=i[s];l&&o!=!l.handlers.length&&(r.removeEventListener(s,this.handleEvent),l=null),l||r.addEventListener(s,this.handleEvent,{passive:o})}for(let s in i)s!="scroll"&&!n[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=n}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&t.keyCode!=27&&q3e.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),dn.android&&dn.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;if(dn.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&(H3e.some(n=>n.keyCode==t.keyCode)&&!t.ctrlKey||APt.indexOf(t.key)>-1&&t.ctrlKey)){let n={ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey,shiftKey:t.shiftKey};return n.shiftKey&&dn.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&EPt(this.view.win)&&(n.shiftKey=!1),this.pendingIOSKey={key:t.key,keyCode:t.keyCode,mods:n},setTimeout(()=>this.flushIOSKey(),250),!0}return t.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(t){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&t&&t.from0?!0:dn.safari&&!dn.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function EPt(e){return e.visualViewport?e.visualViewport.height*e.visualViewport.scale/e.document.documentElement.clientHeight<.85:!1}function Qie(e,t){return(n,i)=>{try{return t.call(e,i,n)}catch(r){Rc(n.state,r)}}}function CPt(e){let t=Object.create(null);function n(i){return t[i]||(t[i]={observers:[],handlers:[]})}for(let i of e){let r=i.spec,s=r&&r.plugin.domEventHandlers,o=r&&r.plugin.domEventObservers;if(s)for(let l in s){let c=s[l];c&&n(l).handlers.push(Qie(i.value,c))}if(o)for(let l in o){let c=o[l];c&&n(l).observers.push(Qie(i.value,c))}}for(let i in xf)n(i).handlers.push(xf[i]);for(let i in rc)n(i).observers.push(rc[i]);return t}const H3e=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],APt="dthko",q3e=[16,17,18,20,91,92,224,225],V_=6;function H_(e){return Math.max(0,e)*.7+8}function TPt(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}class _Pt{constructor(t,n,i,r){this.view=t,this.startEvent=n,this.style=i,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=m3e(t.contentDOM),this.atoms=t.state.facet(IT).map(o=>o(t));let s=t.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=t.state.facet(sr.allowMultipleSelections)&&jPt(t,n),this.dragging=RPt(t,n)&&G3e(n)==1?null:!1}start(t){this.dragging===!1&&this.select(t)}move(t){if(t.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&TPt(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let n=0,i=0,r=0,s=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let c=Gq(this.view);t.clientX-c.left<=r+V_?n=-H_(r-t.clientX):t.clientX+c.right>=o-V_&&(n=H_(t.clientX-o)),t.clientY-c.top<=s+V_?i=-H_(s-t.clientY):t.clientY+c.bottom>=l-V_&&(i=H_(t.clientY-l)),this.setScrollSpeed(n,i)}up(t){this.dragging==null&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,n){this.scrollSpeed={x:t,y:n},t||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:n}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(t||n)&&this.view.win.scrollBy(t,n),this.dragging===!1&&this.select(this.lastEvent)}select(t){let{view:n}=this,i=U3e(this.atoms,this.style.get(t,this.extend,this.multiple));(this.mustSelect||!i.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(t){t.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(t)&&setTimeout(()=>this.select(this.lastEvent),20)}}function jPt(e,t){let n=e.state.facet(E3e);return n.length?n[0](t):dn.mac?t.metaKey:t.ctrlKey}function NPt(e,t){let n=e.state.facet(C3e);return n.length?n[0](t):dn.mac?!t.altKey:!t.ctrlKey}function RPt(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let i=BC(e.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let s=0;s=t.clientX&&o.top<=t.clientY&&o.bottom>=t.clientY)return!0}return!1}function IPt(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,i;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(i=ga.get(n))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(t))return!1;return!0}const xf=Object.create(null),rc=Object.create(null),W3e=dn.ie&&dn.ie_version<15||dn.ios&&dn.webkit_version<604;function PPt(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{e.focus(),n.remove(),K3e(e,n.value)},50)}function YM(e,t,n){for(let i of e.facet(t))n=i(n,e);return n}function K3e(e,t){t=YM(e.state,Hq,t);let{state:n}=e,i,r=1,s=n.toText(t),o=s.lines==n.selection.ranges.length;if(q9!=null&&n.selection.ranges.every(c=>c.empty)&&q9==s.toString()){let c=-1;i=n.changeByRange(u=>{let d=n.doc.lineAt(u.from);if(d.from==c)return{range:u};c=d.from;let f=n.toText((o?s.line(r++).text:t)+n.lineBreak);return{changes:{from:d.from,insert:f},range:pt.cursor(u.from+f.length)}})}else o?i=n.changeByRange(c=>{let u=s.line(r++);return{changes:{from:c.from,to:c.to,insert:u.text},range:pt.cursor(c.from+u.length)}}):i=n.replaceSelection(s);e.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}rc.scroll=e=>{let t=e.inputState;t.lastScrollTop=e.scrollDOM.scrollTop,t.lastScrollLeft=e.scrollDOM.scrollLeft,dn.ios&&!t.touchActive&&(t.lastIOSMomentumScroll=Date.now())};rc.wheel=rc.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()};xf.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1);rc.touchstart=(e,t)=>{let n=e.inputState,i=t.targetTouches[0];n.touchActive=!0,n.lastTouchTime=Date.now(),i&&(n.lastTouchX=i.clientX,n.lastTouchY=i.clientY),n.setSelectionOrigin("select.pointer")};rc.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")};rc.touchend=(e,t)=>{e.inputState.touchActive=!1};xf.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let i of e.state.facet(A3e))if(n=i(e,t),n)break;if(!n&&t.button==0&&(n=MPt(e,t)),n){let i=!e.hasFocus;e.inputState.startMouseSelection(new _Pt(e,t,n,i)),i&&e.observer.ignore(()=>{g3e(e.contentDOM);let s=e.root.activeElement;s&&!s.contains(e.contentDOM)&&s.blur()});let r=e.inputState.mouseSelection;if(r)return r.start(t),r.dragging===!1}else e.inputState.setSelectionOrigin("select.pointer");return!1};function zie(e,t,n,i){if(i==1)return pt.cursor(t,n);if(i==2)return dPt(e.state,t,n);{let r=e.docView.lineAt(t,n),s=e.state.doc.lineAt(r?r.posAtEnd:t),o=r?r.posAtStart:s.from,l=r?r.posAtEnd:s.to;return lDate.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(Hie+1)%3:1}function MPt(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),i=G3e(t),r=e.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),r=r.map(s.changes))},get(s,o,l){let c=e.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),u,d=zie(e,c.pos,c.assoc,i);if(n.pos!=c.pos&&!o){let f=zie(e,n.pos,n.assoc,i),h=Math.min(f.from,d.from),m=Math.max(f.to,d.to);d=h1&&(u=LPt(r,c.pos))?u:l?r.addRange(d):pt.create([d])}}}function LPt(e,t){for(let n=0;n=t)return pt.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}xf.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let s=r.posAtStart,o=s+r.length;(s>=n.to||o<=n.from)&&(n=pt.undirectionalRange(s,o))}}let{inputState:i}=e;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",YM(e.state,qq,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1};xf.dragend=e=>(e.inputState.draggedContent=null,!1);function Wie(e,t,n,i){if(n=YM(e.state,Hq,n),!n)return;let r=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:s}=e.inputState,o=i&&s&&NPt(e,t)?{from:s.from,to:s.to}:null,l={from:r,insert:n},c=e.state.changes(o?[o,l]:l);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(r,-1),head:c.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"}),e.inputState.draggedContent=null}xf.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let i=Array(n.length),r=0,s=()=>{++r==n.length&&Wie(e,t,i.filter(o=>o!=null).join(e.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),s()},l.readAsText(n[o])}return!0}else{let i=t.dataTransfer.getData("Text");if(i)return Wie(e,t,i,!0),!0}return!1};xf.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=W3e?null:t.clipboardData;return n?(K3e(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(PPt(e),!1)};function $Pt(e,t){let n=e.dom.parentNode;if(!n)return;let i=n.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=t,i.focus(),i.selectionEnd=t.length,i.selectionStart=0,setTimeout(()=>{i.remove(),e.focus()},50)}function FPt(e){let t=[],n=[],i=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let r=-1;for(let{from:s}of e.selection.ranges){let o=e.doc.lineAt(s);o.number>r&&(t.push(o.text),n.push({from:o.from,to:Math.min(e.doc.length,o.to+1)})),r=o.number}i=!0}return{text:YM(e,qq,t.join(e.lineBreak)),ranges:n,linewise:i}}let q9=null;xf.copy=xf.cut=(e,t)=>{if(!OE(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:i,linewise:r}=FPt(e.state);if(!n&&!r)return!1;q9=r?n:null,t.type=="cut"&&!e.state.readOnly&&e.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=W3e?null:t.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):($Pt(e,n),!1)};const X3e=Dh.define();function Y3e(e,t){let n=[];for(let i of e.facet(j3e)){let r=i(e,t);r&&n.push(r)}return n.length?e.update({effects:n,annotations:X3e.of(!0)}):null}function Z3e(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=Y3e(e.state,t);n?e.dispatch(n):e.update([])}},10)}rc.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),Z3e(e)};rc.blur=e=>{e.observer.clearSelectionRange(),Z3e(e)};rc.compositionstart=rc.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange==null&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))};rc.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,dn.chrome&&dn.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))};rc.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()};xf.beforeinput=(e,t)=>{var n,i;if((t.inputType=="insertText"||t.inputType=="insertCompositionText")&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType=="insertReplacementText"&&e.observer.editContext){let s=(n=t.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),o=t.getTargetRanges();if(s&&o.length){let l=o[0],c=e.posAtDOM(l.startContainer,l.startOffset),u=e.posAtDOM(l.endContainer,l.endOffset);return Xq(e,{from:c,to:u,insert:e.state.toText(s)},null),!0}}let r;if(dn.chrome&&dn.android&&(r=H3e.find(s=>s.inputType==t.inputType))&&(e.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return dn.ios&&t.inputType=="deleteContentForward"&&e.observer.flushSoon(),dn.safari&&t.inputType=="insertText"&&e.inputState.composing>=0&&setTimeout(()=>rc.compositionend(e,t),20),!1};const Kie=new Set;function BPt(e){Kie.has(e)||(Kie.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}const Gie=["pre-wrap","normal","pre-line","break-spaces"];let m1=!1;function Xie(){m1=!1}class UPt{constructor(t){this.lineWrapping=t,this.doc=Or.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,n){let i=this.doc.lineAt(n).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((n-t-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return Gie.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let n=!1;for(let i=0;i-1,c=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=n,this.charWidth=i,this.textHeight=r,this.lineLength=s,c){this.heightSamples={};for(let u=0;u0}set outdated(t){this.flags=(t?2:0)|this.flags&-3}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>FN&&(m1=!0),this.height=t)}replace(t,n,i){return ic.of(i)}decomposeLeft(t,n){n.push(this)}decomposeRight(t,n){n.push(this)}applyChanges(t,n,i,r){let s=this,o=i.doc;for(let l=r.length-1;l>=0;l--){let{fromA:c,toA:u,fromB:d,toB:f}=r[l],h=s.lineAt(c,xs.ByPosNoHeight,i.setDoc(n),0,0),m=h.to>=u?h:s.lineAt(u,xs.ByPosNoHeight,i,0,0);for(f+=m.to-u,u=m.to;l>0&&h.from<=r[l-1].toA;)c=r[l-1].fromA,d=r[l-1].fromB,l--,cs*2){let l=t[n-1];l.break?t.splice(--n,1,l.left,null,l.right):t.splice(--n,1,l.left,l.right),i+=1+l.break,r-=l.size}else if(s>r*2){let l=t[i];l.break?t.splice(i,1,l.left,null,l.right):t.splice(i,1,l.left,l.right),i+=2+l.break,s-=l.size}else break;else if(r=s&&o(this.lineAt(0,xs.ByPos,i,r,s))}setMeasuredHeight(t){let n=t.heights[t.index++];n<0?(this.spaceAbove=-n,n=t.heights[t.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(t,n=0,i=!1,r){return r&&r.from<=n&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class mu extends J3e{constructor(t,n,i){super(t,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(t,n){return new sf(n,this.length,t+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,i){let r=i[0];return i.length==1&&(r instanceof mu||r instanceof tl&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof tl?r=new mu(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):ic.of(i)}updateHeight(t,n=0,i=!1,r){return r&&r.from<=n&&r.more?this.setMeasuredHeight(r):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class tl extends ic{constructor(t){super(t,0)}heightMetrics(t,n){let i=t.doc.lineAt(n).number,r=t.doc.lineAt(n+this.length).number,s=r-i+1,o,l=0;if(t.lineWrapping){let c=Math.min(this.height,t.lineHeight*s);o=c/s,this.length>s+1&&(l=(this.height-c)/(this.length-s-1))}else o=this.height/s;return{firstLine:i,lastLine:r,perLine:o,perChar:l}}blockAt(t,n,i,r){let{firstLine:s,lastLine:o,perLine:l,perChar:c}=this.heightMetrics(n,r);if(n.lineWrapping){let u=r+(t0){let s=i[i.length-1];s instanceof tl?i[i.length-1]=new tl(s.length+r):i.push(null,new tl(r-1))}if(t>0){let s=i[0];s instanceof tl?i[0]=new tl(t+s.length):i.unshift(new tl(t-1),null)}return ic.of(i)}decomposeLeft(t,n){n.push(new tl(t-1),null)}decomposeRight(t,n){n.push(null,new tl(this.length-t-1))}updateHeight(t,n=0,i=!1,r){let s=n+this.length;if(r&&r.from<=n+this.length&&r.more){let o=[],l=Math.max(n,r.from),c=-1;for(r.from>n&&o.push(new tl(r.from-n-1).updateHeight(t,n));l<=s&&r.more;){let d=t.doc.lineAt(l).length;o.length&&o.push(null);let f=r.heights[r.index++],h=0;f<0&&(h=-f,f=r.heights[r.index++]),c==-1?c=f:Math.abs(f-c)>=FN&&(c=-2);let m=new mu(d,f,h);m.outdated=!1,o.push(m),l+=d+1}l<=s&&o.push(null,new tl(s-l).updateHeight(t,l));let u=ic.of(o);return(c<0||Math.abs(u.height-this.height)>=FN||Math.abs(c-this.heightMetrics(t,n).perLine)>=FN)&&(m1=!0),WI(this,u)}else(i||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class VPt extends ic{constructor(t,n,i){super(t.length+n+i.length,t.height+i.height,n|(t.outdated||i.outdated?2:0)),this.left=t,this.right=i,this.size=t.size+i.size}get break(){return this.flags&1}blockAt(t,n,i,r){let s=i+this.left.height;return tl))return u;let d=n==xs.ByPosNoHeight?xs.ByPosNoHeight:xs.ByPos;return c?u.join(this.right.lineAt(l,d,i,o,l)):this.left.lineAt(l,d,i,r,s).join(u)}forEachLine(t,n,i,r,s,o){let l=r+this.left.height,c=s+this.left.length+this.break;if(this.break)t=c&&this.right.forEachLine(t,n,i,l,c,o);else{let u=this.lineAt(c,xs.ByPos,i,r,s);t=t&&u.from<=n&&o(u),n>u.to&&this.right.forEachLine(u.to+1,n,i,l,c,o)}}replace(t,n,i){let r=this.left.length+this.break;if(nthis.left.length)return this.balanced(this.left,this.right.replace(t-r,n-r,i));let s=[];t>0&&this.decomposeLeft(t,s);let o=s.length;for(let l of i)s.push(l);if(t>0&&Yie(s,o-1),n=i&&n.push(null)),t>i&&this.right.decomposeLeft(t-i,n)}decomposeRight(t,n){let i=this.left.length,r=i+this.break;if(t>=r)return this.right.decomposeRight(t-r,n);t2*n.size||n.size>2*t.size?ic.of(this.break?[t,null,n]:[t,n]):(this.left=WI(this.left,t),this.right=WI(this.right,n),this.setHeight(t.height+n.height),this.outdated=t.outdated||n.outdated,this.size=t.size+n.size,this.length=t.length+this.break+n.length,this)}updateHeight(t,n=0,i=!1,r){let{left:s,right:o}=this,l=n+s.length+this.break,c=null;return r&&r.from<=n+s.length&&r.more?c=s=s.updateHeight(t,n,i,r):s.updateHeight(t,n,i),r&&r.from<=l+o.length&&r.more?c=o=o.updateHeight(t,l,i,r):o.updateHeight(t,l,i),c?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Yie(e,t){let n,i;e[t]==null&&(n=e[t-1])instanceof tl&&(i=e[t+1])instanceof tl&&e.splice(t-1,3,new tl(n.length+1+i.length))}const HPt=5;class Yq{constructor(t,n){this.pos=t,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,n){if(this.lineStart>-1){let i=Math.min(n,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof mu?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new mu(i-this.pos,-1,0)),this.writtenTo=i,n>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(t,n,i){if(t=HPt)&&this.addLineDeco(r,s,o)}else n>t&&this.span(t,n);this.lineEnd>-1&&this.lineEnd-1)return;let{from:t,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=n,this.writtenTot&&this.nodes.push(new mu(this.pos-t,-1,0)),this.writtenTo=this.pos}blankContent(t,n){let i=new tl(n-t);return this.oracle.doc.lineAt(t).to==n&&(i.flags|=4),i}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof mu)return t;let n=new mu(0,-1,0);return this.nodes.push(n),n}addBlock(t){this.enterLine();let n=t.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,n&&n.endSide>0&&(this.covering=t)}addLineDeco(t,n,i){let r=this.ensureLine();r.length+=i,r.collapsed+=i,r.widgetHeight=Math.max(r.widgetHeight,t),r.breaks+=n,this.writtenTo=this.pos=this.pos+i}finish(t){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof mu)&&!this.isCovered?this.nodes.push(new mu(0,-1,0)):(this.writtenTod.clientHeight||d.scrollWidth>d.clientWidth)&&f.overflow!="visible"){let h=d.getBoundingClientRect();s=Math.max(s,h.left),o=Math.min(o,h.right),l=Math.max(l,h.top),c=Math.min(u==e.parentNode?r.innerHeight:c,h.bottom)}u=f.position=="absolute"||f.position=="fixed"?d.offsetParent:d.parentNode}else if(u.nodeType==11)u=u.host;else break;return{left:s-n.left,right:Math.max(s,o)-n.left,top:l-(n.top+t),bottom:Math.max(l,c)-(n.top+t)}}function GPt(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left0&&t.top0}function XPt(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class n${constructor(t,n,i,r){this.from=t,this.to=n,this.size=i,this.displaySize=r}static same(t,n){if(t.length!=n.length)return!1;for(let i=0;itypeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new UPt(i),this.stateDeco=ere(n),this.heightMap=ic.empty().applyChanges(this.stateDeco,Or.empty,this.heightOracle.setDoc(n.doc),[new bd(0,0,0,n.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=$n.set(this.lineGaps.map(r=>r.draw(this,!1))),this.scrollParent=t.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:n}=this.state.selection;for(let i=0;i<=1;i++){let r=i?n.head:n.anchor;if(!t.some(({from:s,to:o})=>r>=s&&r<=o)){let{from:s,to:o}=this.lineBlockAt(r);t.push(new q_(s,o))}}return this.viewports=t.sort((i,r)=>i.from-r.from),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?Jie:new Zq(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,t=>{this.viewportLines.push(wS(t,this.scaler))})}update(t,n=null){this.state=t.state;let i=this.stateDeco;this.stateDeco=ere(this.state);let r=t.changedRanges,s=bd.extendWithRanges(r,qPt(i,this.stateDeco,t?t.changes:co.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);Xie(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||m1)&&(t.flags|=2),l?(this.scrollAnchorPos=t.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let c=s.length?this.mapViewport(this.viewport,t.changes):this.viewport;(n&&(n.range.headc.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,n));let u=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,t.flags|=this.updateForViewport(),(u||!t.changes.empty||t.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(t.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(t.selectionSet||t.focusChanged)&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(R3e)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:t}=this,n=t.contentDOM,i=window.getComputedStyle(n),r=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?cs.RTL:cs.LTR;let o=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",l=n.getBoundingClientRect(),c=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let u=0,d=0;if(l.width&&l.height){let{scaleX:S,scaleY:O}=p3e(n,l);(S>.005&&Math.abs(this.scaleX-S)>.005||O>.005&&Math.abs(this.scaleY-O)>.005)&&(this.scaleX=S,this.scaleY=O,u|=16,o=c=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,h=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=h)&&(this.paddingTop=f,this.paddingBottom=h,u|=18),this.editorWidth!=t.scrollDOM.clientWidth&&(r.lineWrapping&&(c=!0),this.editorWidth=t.scrollDOM.clientWidth,u|=16);let m=m3e(this.view.contentDOM,!1).y;m!=this.scrollParent&&(this.scrollParent=m,this.scrollAnchorHeight=-1,this.scrollOffset=0);let g=this.getScrollOffset();this.scrollOffset!=g&&(this.scrollAnchorHeight=-1,this.scrollOffset=g),this.scrolledToBottom=b3e(this.scrollParent||t.win);let b=(this.printing?XPt:KPt)(n,this.paddingTop),v=b.top-this.pixelViewport.top,y=b.bottom-this.pixelViewport.bottom;this.pixelViewport=b;let w=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(w!=this.inView&&(this.inView=w,w&&(c=!0)),!this.inView&&!this.scrollTarget&&!GPt(t.dom))return 0;let x=l.width;if((this.contentDOMWidth!=x||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=t.scrollDOM.clientHeight,u|=16),c){let S=t.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(S)&&(o=!0),o||r.lineWrapping&&Math.abs(x-this.contentDOMWidth)>r.charWidth){let{lineHeight:O,charWidth:A,textHeight:E}=t.docView.measureTextSize();o=O>0&&r.refresh(s,O,A,E,Math.max(5,x/A),S),o&&(t.docView.minWidth=0,u|=16)}v>0&&y>0?d=Math.max(v,y):v<0&&y<0&&(d=Math.min(v,y)),Xie();for(let O of this.viewports){let A=O.from==this.viewport.from?S:t.docView.measureVisibleLineHeights(O);this.heightMap=(o?ic.empty().applyChanges(this.stateDeco,Or.empty,this.heightOracle,[new bd(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new QPt(O.from,A))}m1&&(u|=2)}let k=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return k&&(u&2&&(u|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),u|=this.updateForViewport()),(u&2||k)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,t)),u|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),u}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,n){let i=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,c=new q_(r.lineAt(o-i*1e3,xs.ByHeight,s,0,0).from,r.lineAt(l+(1-i)*1e3,xs.ByHeight,s,0,0).to);if(n){let{head:u}=n.range;if(uc.to){let d=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=r.lineAt(u,xs.ByPos,s,0,0),h;n.y=="center"?h=(f.top+f.bottom)/2-d/2:n.y=="start"||n.y=="nearest"&&u=l+Math.max(10,Math.min(i,250)))&&r>o-2*1e3&&s>1,o=r<<1;if(this.defaultTextDirection!=cs.LTR&&!i)return[];let l=[],c=(d,f,h,m)=>{if(f-dd&&yy.from>=h.from&&y.to<=h.to&&Math.abs(y.from-d)y.fromw));if(!v){if(fx.from<=f&&x.to>=f)){let x=n.moveToLineBoundary(pt.cursor(f),!1,!0).head;x>d&&(f=x)}let y=this.gapSize(h,d,f,m),w=i||y<2e6?y:2e6;v=new n$(d,f,y,w)}l.push(v)},u=d=>{if(d.length2e6)for(let O of t)O.from>=d.from&&O.fromd.from&&c(d.from,m,d,f),gn.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(t){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let i=[];Yi.spans(n,this.viewport.from,this.viewport.to,{span(s,o){i.push({from:s,to:o})},point(){}},20);let r=0;if(i.length!=this.visibleRanges.length)r=12;else for(let s=0;s=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(n=>n.from<=t&&n.to>=t)||wS(this.heightMap.lineAt(t,xs.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=t&&n.bottom>=t)||wS(this.heightMap.lineAt(this.scaler.fromDOM(t),xs.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(t){let n=this.lineBlockAtHeight(t+8);return n.from>=this.viewport.from||this.viewportLines[0].top-t>200?n:this.viewportLines[0]}elementAtHeight(t){return wS(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}let q_=class{constructor(t,n){this.from=t,this.to=n}};function ZPt(e,t,n){let i=[],r=e,s=0;return Yi.spans(n,e,t,{span(){},point(o,l){o>r&&(i.push({from:r,to:o}),s+=o-r),r=l}},20),r=1)return t[t.length-1].to;let i=Math.floor(e*n);for(let r=0;;r++){let{from:s,to:o}=t[r],l=o-s;if(i<=l)return s+i;i-=l}}function K_(e,t){let n=0;for(let{from:i,to:r}of e.ranges){if(t<=r){n+=t-i;break}n+=r-i}return n/e.total}function JPt(e,t){for(let n of e)if(t(n))return n}const Jie={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function ere(e){let t=e.facet(KM).filter(i=>typeof i!="function"),n=e.facet(Kq).filter(i=>typeof i!="function");return n.length&&t.push(Yi.join(n)),t}class Zq{constructor(t,n,i){let r=0,s=0,o=0;this.viewports=i.map(({from:l,to:c})=>{let u=n.lineAt(l,xs.ByPos,t,0,0).top,d=n.lineAt(c,xs.ByPos,t,0,0).bottom;return r+=d-u,{from:l,to:c,top:u,bottom:d,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(n.height-r);for(let l of this.viewports)l.domTop=o+(l.top-s)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),s=l.bottom}toDOM(t){for(let n=0,i=0,r=0;;n++){let s=nn.from==t.viewports[i].from&&n.to==t.viewports[i].to):!1}}function wS(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),i=t.toDOM(e.bottom);return new sf(e.from,e.length,n,i-n,Array.isArray(e._content)?e._content.map(r=>wS(r,t)):e._content)}const G_=pn.define({combine:e=>e.join(" ")}),W9=pn.define({combine:e=>e.indexOf(!0)>-1}),K9=db.newName(),e4e=db.newName(),t4e=db.newName(),n4e={"&light":"."+e4e,"&dark":"."+t4e};function G9(e,t,n){return new db(t,{finish(i){return/&/.test(i)?i.replace(/&\w*/,r=>{if(r=="&")return e;if(!n||!n[r])throw new RangeError(`Unsupported selector: ${r}`);return n[r]}):e+" "+i}})}const eDt=G9("."+K9,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},n4e),tDt={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},i$=dn.ie&&dn.ie_version<=11;class nDt{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new NIt,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(n=>{for(let i of n)this.queue.push(i);(dn.ie&&dn.ie_version<=11||dn.ios&&t.composing)&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&dn.android&&t.constructor.EDIT_CONTEXT!==!1&&!(dn.chrome&&dn.chrome_version<126)&&(this.editContext=new rDt(t),t.state.facet(kp)&&(t.contentDOM.editContext=this.editContext.editContext)),i$&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(t){(t.type=="change"||!t.type)&&!t.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((n,i)=>n!=t[i]))){this.gapIntersection.disconnect();for(let n of t)this.gapIntersection.observe(n);this.gaps=t}}onSelectionChange(t){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,r=this.selectionRange;if(i.state.facet(kp)?i.root.activeElement!=this.dom:!OE(this.dom,r))return;let s=r.anchorNode&&i.docView.tile.nearest(r.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(t)){n||(this.selectionChanged=!1);return}(dn.ie&&dn.ie_version<=11||dn.android&&dn.chrome)&&!i.state.selection.main.empty&&r.focusNode&&EE(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,n=BC(t.root);if(!n)return!1;let i=dn.safari&&t.root.nodeType==11&&t.root.activeElement==this.dom&&iDt(this.view,n)||n;if(!i||this.selectionRange.eq(i))return!1;let r=OE(this.dom,i);return r&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&xw(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||t=="Enter")&&(this.delayedAndroidKey={key:t,keyCode:n,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let n=-1,i=-1,r=!1;for(let s of t){let o=this.readMutation(s);o&&(o.typeOver&&(r=!0),n==-1?{from:n,to:i}=o:(n=Math.min(o.from,n),i=Math.max(o.to,i)))}return{from:n,to:i,typeOver:r}}readChange(){let{from:t,to:n,typeOver:i}=this.processRecords(),r=this.selectionChanged&&OE(this.dom,this.selectionRange);if(t<0&&!r)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new xPt(this.view,t,n,i);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let i=this.view.state,r=z3e(this.view,n);return this.view.state==i&&(n.domChanged||n.newSel&&!qI(this.view.state.selection,n.newSel.main))&&this.view.update([]),r}readMutation(t){let n=this.view.docView.tile.nearest(t.target);if(!n||n.isWidget())return null;if(n.markDirty(t.type=="attributes"),t.type=="childList"){let i=tre(n,t.previousSibling||t.target.previousSibling,-1),r=tre(n,t.nextSibling||t.target.nextSibling,1);return{from:i?n.posAfter(i):n.posAtStart,to:r?n.posBefore(r):n.posAtEnd,typeOver:!1}}else return t.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(kp)!=t.state.facet(kp)&&(t.view.contentDOM.editContext=t.state.facet(kp)?this.editContext.editContext:null))}destroy(){var t,n,i;this.stop(),(t=this.intersection)===null||t===void 0||t.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function tre(e,t,n){for(;t;){let i=ga.get(t);if(i&&i.parent==e)return i;let r=t.parentNode;t=r!=e.dom?r:n>0?t.nextSibling:t.previousSibling}return null}function nre(e,t){let n=t.startContainer,i=t.startOffset,r=t.endContainer,s=t.endOffset,o=e.docView.domAtPos(e.state.selection.main.anchor,1);return EE(o.node,o.offset,r,s)&&([n,i,r,s]=[r,s,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}}function iDt(e,t){if(t.getComposedRanges){let r=t.getComposedRanges(e.root)[0];if(r)return nre(e,r)}let n=null;function i(r){r.preventDefault(),r.stopImmediatePropagation(),n=r.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",i,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",i,!0),n?nre(e,n):null}class rDt{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);let n=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=i=>{let r=t.state.selection.main,{anchor:s,head:o}=r,l=this.toEditorPos(i.updateRangeStart),c=this.toEditorPos(i.updateRangeEnd);t.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:l,drifted:!1});let u=c-l>i.text.length;l==this.from&&sthis.to&&(c=s);let d=V3e(t.state.sliceDoc(l,c),i.text,(u?r.from:r.to)-l,u?"end":null);if(!d){let h=pt.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));qI(h,r)||t.dispatch({selection:h,userEvent:"select"});return}let f={from:d.from+l,to:d.toA+l,insert:Or.of(i.text.slice(d.from,d.toB).split(` -`))};if((dn.mac||dn.android)&&f.from==o-1&&/^\. ?$/.test(i.text)&&t.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:l,to:c,insert:Or.of([i.text.replace("."," ")])}),this.pendingContextChange=f,!t.state.readOnly){let h=this.to-this.from+(f.to-f.from+f.insert.length);Xq(t,f,pt.single(this.toEditorPos(i.selectionStart,h),this.toEditorPos(i.selectionEnd,h)))}this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state)),f.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(n.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let r=[],s=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o{let r=[];for(let s of i.getTextFormats()){let o=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let c=this.toEditorPos(s.rangeStart),u=this.toEditorPos(s.rangeEnd);if(c{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(t.state)}};for(let i in this.handlers)n.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{let r=BC(i.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let n=0,i=!1,r=this.pendingContextChange;return t.changes.iterChanges((s,o,l,c,u)=>{if(i)return;let d=u.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(u)){r=this.pendingContextChange=null,n+=d,this.to+=d;return}else r=null,this.revertPending(t.state);if(s+=n,o+=n,o<=this.from)this.from+=d,this.to+=d;else if(sthis.to||this.to-this.from+u.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),u.toString()),this.to+=d}n+=d}),r&&!i&&this.revertPending(t.state),!i}update(t){let n=this.pendingContextChange,i=t.startState.selection.main;this.composing&&(this.composing.drifted||!t.changes.touchesRange(i.from,i.to)&&t.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):!this.applyEdits(t)||!this.rangeIsValid(t.state)?(this.pendingContextChange=null,this.reset(t.state)):(t.docChanged||t.selectionSet||n)&&this.setSelection(t.state),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:n}=t.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(t.doc.length,n+1e4)}reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t)}revertPending(t){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),t.doc.sliceString(n.from,n.to))}setSelection(t){let{main:n}=t.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),r=this.toContextPos(n.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(i,r)}rangeIsValid(t){let{head:n}=t.selection.main;return!(this.from>0&&n-this.from<500||this.to1e4*3)}toEditorPos(t,n=this.to-this.from){t=Math.min(t,n);let i=this.composing;return i&&i.drifted?i.editorBase+(t-i.contextBase):t+this.from}toContextPos(t){let n=this.composing;return n&&n.drifted?n.contextBase+(t-n.editorBase):t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class Jt{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:i}=t;this.dispatchTransactions=t.dispatchTransactions||i&&(r=>r.forEach(s=>i(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=t.root||RIt(t.parent)||document,this.viewState=new Zie(this,t.state||sr.create(t)),t.scrollTo&&t.scrollTo.is(z_)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Ux).map(r=>new Y4(r));for(let r of this.plugins)r.update(this);this.observer=new nDt(this),this.inputState=new SPt(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Fie(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...t){let n=t.length==1&&t[0]instanceof Ya?t:t.length==1&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(n,this)}update(t){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,i=!1,r,s=this.state;for(let h of t){if(h.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=h.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,l=0,c=null;t.some(h=>h.annotation(X3e))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,c=Y3e(s,o),c||(l=1));let u=this.observer.delayedAndroidKey,d=null;if(u?(this.observer.clearDelayedAndroidKey(),d=this.observer.readChange(),(d&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(d=null)):this.observer.clear(),s.facet(sr.phrases)!=this.state.facet(sr.phrases))return this.setState(s);r=zI.create(this,s,t),r.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let h of t){if(f&&(f=f.map(h.changes)),h.scrollIntoView){let{main:m}=h.state.selection,{x:g,y:b}=this.state.facet(Jt.cursorScrollMargin);f=new ww(m.empty?m:pt.cursor(m.head,m.head>m.anchor?-1:1),"nearest","nearest",b,g)}for(let m of h.effects)m.is(z_)&&(f=m.value.clip(this.state))}this.viewState.update(r,f),this.bidiCache=KI.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),n=this.docView.update(r),this.state.facet(xS)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(n,t.some(h=>h.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(G_)!=r.state.facet(G_)&&(this.viewState.mustMeasureContent=!0),(n||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!r.empty)for(let h of this.state.facet(Q9))try{h(r)}catch(m){Rc(this.state,m,"update listener")}(c||d)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),d&&!z3e(this,d)&&u.force&&xw(this.contentDOM,u.key,u.keyCode)})}setState(t){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=t;return}this.updateState=2;let n=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new Zie(this,t),this.plugins=t.facet(Ux).map(i=>new Y4(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new Fie(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(t){let n=t.startState.facet(Ux),i=t.state.facet(Ux);if(n!=i){let r=[];for(let s of i){let o=n.indexOf(s);if(o<0)r.push(new Y4(s));else{let l=this.plugins[o];l.mustUpdate=t,r.push(l)}}for(let s of this.plugins)s.mustUpdate!=t&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=t;for(let r=0;r-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,t&&this.observer.forceFlush();let n=null,i=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(b3e(i||this.win))s=-1,o=this.viewState.heightMap.height;else{let m=this.viewState.scrollAnchorAt(r);s=m.from,o=m.top}this.updateState=1;let c=this.viewState.measure();if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let u=[];c&4||([this.measureRequests,u]=[u,this.measureRequests]);let d=u.map(m=>{try{return m.read(this)}catch(g){return Rc(this.state,g),ire}}),f=zI.create(this,this.state,[]),h=!1;f.flags|=c,n?n.flags|=c:n=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),h=this.docView.update(f),h&&this.docViewUpdate());for(let m=0;m1||g<-1)&&!(dn.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r=r+g,i?i.scrollTop+=g:this.win.scrollBy(0,g),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let l of this.state.facet(Q9))l(n)}get themeClasses(){return K9+" "+(this.state.facet(W9)?t4e:e4e)+" "+this.state.facet(G_)}updateAttrs(){let t=rre(this,D3e,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(kp)?"true":"false",class:"cm-content",style:`${dn.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),rre(this,Wq,n);let i=this.observer.ignore(()=>{let r=Iie(this.contentDOM,this.contentAttrs,n),s=Iie(this.dom,this.editorAttrs,t);return r||s});return this.editorAttrs=t,this.contentAttrs=n,i}showAnnouncements(t){let n=!0;for(let i of t)for(let r of i.effects)if(r.is(Jt.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(xS);let t=this.state.facet(Jt.cspNonce);db.mount(this.root,this.styleModules.concat(eDt).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(this.measureRequests.indexOf(t)>-1)return;if(t.key!=null){for(let n=0;ni.plugin==t)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,n,i){return t$(this,t,Bie(this,t,n,i))}moveByGroup(t,n){return t$(this,t,Bie(this,t,n,i=>pPt(this,t.head,i)))}visualLineSide(t,n){let i=this.bidiSpans(t),r=this.textDirectionAt(t.from),s=i[n?i.length-1:0];return pt.cursor(s.side(n,r)+t.from,s.forward(!n,r)?1:-1)}moveToLineBoundary(t,n,i=!0){return hPt(this,t,n,i)}moveVertically(t,n,i){return t$(this,t,mPt(this,t,n,i))}domAtPos(t,n=1){return this.docView.domAtPos(t,n)}posAtDOM(t,n=0){return this.docView.posFromDOM(t,n)}posAtCoords(t,n=!0){this.readMeasured();let i=H9(this,t,n);return i&&i.pos}posAndSideAtCoords(t,n=!0){return this.readMeasured(),H9(this,t,n)}coordsAtPos(t,n=1){this.readMeasured();let i=this.state.doc.lineAt(t),r=this.bidiSpans(i),s=r[uh.find(r,t-i.from,-1,n)];return this.docView.coordsAt(t,n,s.dir==cs.RTL)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(N3e)||tthis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>sDt)return O3e(t.length);let n=this.textDirectionAt(t.from),i;for(let s of this.bidiCache)if(s.from==t.from&&s.dir==n&&(s.fresh||k3e(s.isolates,i=Mie(this,t))))return s.order;i||(i=Mie(this,t));let r=BIt(t.text,n,i);return this.bidiCache.push(new KI(t.from,t.to,n,i,!0,r)),r}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||dn.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{g3e(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((t.nodeType==9?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,n={}){var i,r,s,o;return z_.of(new ww(typeof t=="number"?pt.cursor(t):t,(i=n.y)!==null&&i!==void 0?i:"nearest",(r=n.x)!==null&&r!==void 0?r:"nearest",(s=n.yMargin)!==null&&s!==void 0?s:5,(o=n.xMargin)!==null&&o!==void 0?o:5))}scrollSnapshot(){let{scrollTop:t,scrollLeft:n}=this.scrollDOM,i=this.viewState.scrollAnchorAt(t);return z_.of(new ww(pt.cursor(i.from),"start","start",i.top-t,n,!0))}setTabFocusMode(t){t==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof t=="boolean"?this.inputState.tabFocusMode=t?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return ba.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return ba.define(()=>({}),{eventObservers:t})}static theme(t,n){let i=db.newName(),r=[G_.of(i),xS.of(G9(`.${i}`,t))];return n&&n.dark&&r.push(W9.of(!0)),r}static baseTheme(t){return ym.lowest(xS.of(G9("."+K9,t,n4e)))}static findFromDOM(t){var n;let i=t.querySelector(".cm-content"),r=i&&ga.get(i)||ga.get(t);return((n=r==null?void 0:r.root)===null||n===void 0?void 0:n.view)||null}}Jt.styleModule=xS;Jt.inputHandler=_3e;Jt.clipboardInputFilter=Hq;Jt.clipboardOutputFilter=qq;Jt.scrollHandler=I3e;Jt.focusChangeEffect=j3e;Jt.perLineTextDirection=N3e;Jt.exceptionSink=T3e;Jt.updateListener=Q9;Jt.editable=kp;Jt.mouseSelectionStyle=A3e;Jt.dragMovesSelection=C3e;Jt.clickAddsSelectionRange=E3e;Jt.decorations=KM;Jt.blockWrappers=M3e;Jt.outerDecorations=Kq;Jt.atomicRanges=IT;Jt.bidiIsolatedRanges=L3e;Jt.cursorScrollMargin=pn.define({combine:e=>{let t=5,n=5;for(let i of e)typeof i=="number"?t=n=i:{x:t,y:n}=i;return{x:t,y:n}}});Jt.scrollMargins=$3e;Jt.darkTheme=W9;Jt.cspNonce=pn.define({combine:e=>e.length?e[0]:""});Jt.contentAttributes=Wq;Jt.editorAttributes=D3e;Jt.lineWrapping=Jt.contentAttributes.of({class:"cm-lineWrapping"});Jt.announce=hi.define();const sDt=4096,ire={};class KI{constructor(t,n,i,r,s,o){this.from=t,this.to=n,this.dir=i,this.isolates=r,this.fresh=s,this.order=o}static update(t,n){if(n.empty&&!t.some(s=>s.fresh))return t;let i=[],r=t.length?t[t.length-1].dir:cs.LTR;for(let s=Math.max(0,t.length-10);s=0;r--){let s=i[r],o=typeof s=="function"?s(e):s;o&&Qq(o,n)}return n}const aDt=dn.mac?"mac":dn.windows?"win":dn.linux?"linux":"key";function oDt(e,t){const n=e.split(/-(?!$)/);let i=n[n.length-1];i=="Space"&&(i=" ");let r,s,o,l;for(let c=0;ci.concat(r),[]))),n}function cDt(e,t,n){return r4e(i4e(e.state),t,e,n)}let ag=null;const uDt=4e3;function dDt(e,t=aDt){let n=Object.create(null),i=Object.create(null),r=(o,l)=>{let c=i[o];if(c==null)i[o]=l;else if(c!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,l,c,u,d)=>{var f,h;let m=n[o]||(n[o]=Object.create(null)),g=l.split(/ (?!$)/).map(y=>oDt(y,t));for(let y=1;y{let k=ag={view:x,prefix:w,scope:o};return setTimeout(()=>{ag==k&&(ag=null)},uDt),!0}]})}let b=g.join(" ");r(b,!1);let v=m[b]||(m[b]={preventDefault:!1,stopPropagation:!1,run:((h=(f=m._any)===null||f===void 0?void 0:f.run)===null||h===void 0?void 0:h.slice())||[]});c&&v.run.push(c),u&&(v.preventDefault=!0),d&&(v.stopPropagation=!0)};for(let o of e){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let u of l){let d=n[u]||(n[u]=Object.create(null));d._any||(d._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let h in d)d[h].run.push(m=>f(m,X9))}let c=o[t]||o.key;if(c)for(let u of l)s(u,c,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(u,"Shift-"+c,o.shift,o.preventDefault,o.stopPropagation)}return n}let X9=null;function r4e(e,t,n,i){X9=t;let r=EIt(t),s=Ac(r,0),o=nh(s)==r.length&&r!=" ",l="",c=!1,u=!1,d=!1;ag&&ag.view==n&&ag.scope==i&&(l=ag.prefix+" ",q3e.indexOf(t.keyCode)<0&&(u=!0,ag=null));let f=new Set,h=v=>{if(v){for(let y of v.run)if(!f.has(y)&&(f.add(y),y(n)))return v.stopPropagation&&(d=!0),!0;v.preventDefault&&(v.stopPropagation&&(d=!0),u=!0)}return!1},m=e[i],g,b;return m&&(h(m[l+X_(r,t,!o)])?c=!0:o&&(t.altKey||t.metaKey||t.ctrlKey)&&!(dn.windows&&t.ctrlKey&&t.altKey)&&!(dn.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(g=fb[t.keyCode])&&g!=r?(h(m[l+X_(g,t,!0)])||t.shiftKey&&(b=$C[t.keyCode])!=r&&b!=g&&h(m[l+X_(b,t,!1)]))&&(c=!0):o&&t.shiftKey&&h(m[l+X_(r,t,!0)])&&(c=!0),!c&&h(m._any)&&(c=!0)),u&&(c=!0),c&&d&&t.stopPropagation(),X9=null,c}class Ky{constructor(t,n,i,r,s){this.className=t,this.left=n,this.top=i,this.width=r,this.height=s}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,n){return n.className!=this.className?!1:(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",this.width!=null&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,n,i){if(i.empty){let r=t.coordsAtPos(i.head,i.assoc||1);if(!r)return[];let s=s4e(t);return[new Ky(n,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return fDt(t,n,i)}}function s4e(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==cs.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function are(e,t,n,i){let r=e.coordsAtPos(t,n*2);if(!r)return i;let s=e.dom.getBoundingClientRect(),o=(r.top+r.bottom)/2,l=e.posAtCoords({x:s.left+1,y:o}),c=e.posAtCoords({x:s.right-1,y:o});return l==null||c==null?i:{from:Math.max(i.from,Math.min(l,c)),to:Math.min(i.to,Math.max(l,c))}}function fDt(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let i=Math.max(n.from,e.viewport.from),r=Math.min(n.to,e.viewport.to),s=e.textDirection==cs.LTR,o=e.contentDOM,l=o.getBoundingClientRect(),c=s4e(e),u=o.querySelector(".cm-line"),d=u&&window.getComputedStyle(u),f=l.left+(d?parseInt(d.paddingLeft)+Math.min(0,parseInt(d.textIndent)):0),h=l.right-(d?parseInt(d.paddingRight):0),m=V9(e,i,1),g=V9(e,r,-1),b=m.type==ul.Text?m:null,v=g.type==ul.Text?g:null;if(b&&(e.lineWrapping||m.widgetLineBreaks)&&(b=are(e,i,1,b)),v&&(e.lineWrapping||g.widgetLineBreaks)&&(v=are(e,r,-1,v)),b&&v&&b.from==v.from&&b.to==v.to)return w(x(n.from,n.to,b));{let S=b?x(n.from,null,b):k(m,!1),O=v?x(null,n.to,v):k(g,!0),A=[];return(b||m).to<(v||g).from-(b&&v?1:0)||m.widgetLineBreaks>1&&S.bottom+e.defaultLineHeight/2C&&P.from=D)break;M>I&&R(Math.max(F,I),S==null&&F<=C,Math.min(M,D),O==null&&M>=N,L.dir)}if(I=_.to+1,I>=D)break}return T.length==0&&R(C,S==null,N,O==null,e.textDirection),{top:E,bottom:j,horizontal:T}}function k(S,O){let A=l.top+(O?S.top:S.bottom);return{top:A,bottom:A,horizontal:[]}}}function hDt(e,t){return e.constructor==t.constructor&&e.eq(t)}class pDt{constructor(t,n){this.view=t,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,t)}update(t){t.startState.facet(BN)!=t.state.facet(BN)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){this.layer.updateOnDocViewUpdate!==!1&&t.requestMeasure(this.measureReq)}setOrder(t){let n=0,i=t.facet(BN);for(;n!hDt(n,this.drawn[i]))){let n=this.dom.firstChild,i=0;for(let r of t)r.update&&n&&r.constructor&&this.drawn[i].constructor&&r.update(n,this.drawn[i])?(n=n.nextSibling,i++):this.dom.insertBefore(r.draw(),n);for(;n;){let r=n.nextSibling;n.remove(),n=r}this.drawn=t,dn.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const BN=pn.define();function a4e(e){return[ba.define(t=>new pDt(t,e)),BN.of(e)]}const g1=pn.define({combine(e){return Mh(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(t,n)=>Math.min(t,n),drawRangeCursor:(t,n)=>t||n})}});function mDt(e={}){return[g1.of(e),gDt,bDt,yDt,R3e.of(!0)]}function o4e(e){return e.startState.facet(g1)!=e.state.facet(g1)}const gDt=a4e({above:!0,markers(e){let{state:t}=e,n=t.facet(g1),i=[];for(let r of t.selection.ranges){let s=r==t.selection.main;if(r.empty||n.drawRangeCursor&&!(s&&dn.ios&&n.iosSelectionHandles)){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=r.empty?r:pt.cursor(r.head,r.assoc);for(let c of Ky.forRange(e,o,l))i.push(c)}}return i},update(e,t){e.transactions.some(i=>i.selection)&&(t.style.animationName=t.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=o4e(e);return n&&ore(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){ore(t.state,e)},class:"cm-cursorLayer"});function ore(e,t){t.style.animationDuration=e.facet(g1).cursorBlinkRate+"ms"}const bDt=a4e({above:!1,markers(e){let t=[],{main:n,ranges:i}=e.state.selection;for(let r of i)if(!r.empty)for(let s of Ky.forRange(e,"cm-selectionBackground",r))t.push(s);if(dn.ios&&!n.empty&&e.state.facet(g1).iosSelectionHandles){for(let r of Ky.forRange(e,"cm-selectionHandle cm-selectionHandle-start",pt.cursor(n.from,1)))t.push(r);for(let r of Ky.forRange(e,"cm-selectionHandle cm-selectionHandle-end",pt.cursor(n.to,1)))t.push(r)}return t},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||o4e(e)},class:"cm-selectionLayer"}),yDt=ym.highest(Jt.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),l4e=hi.define({map(e,t){return e==null?null:t.mapPos(e)}}),kS=pl.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((n,i)=>i.is(l4e)?i.value:n,e)}}),vDt=ba.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(kS);n==null?this.cursor!=null&&((t=this.cursor)===null||t===void 0||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(kS)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(kS),n=t!=null&&e.coordsAtPos(t);if(!n)return null;let i=e.scrollDOM.getBoundingClientRect();return{left:n.left-i.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-i.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(kS)!=e&&this.view.dispatch({effects:l4e.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){(e.target==this.view.contentDOM||!this.view.contentDOM.contains(e.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function xDt(){return[kS,vDt]}function lre(e,t,n,i,r){t.lastIndex=0;for(let s=e.iterRange(n,i),o=n,l;!s.next().done;o+=s.value.length)if(!s.lineBreak)for(;l=t.exec(s.value);)r(o+l.index,l)}function wDt(e,t){let n=e.visibleRanges;if(n.length==1&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let i=[];for(let{from:r,to:s}of n)r=Math.max(e.state.doc.lineAt(r).from,r-t),s=Math.min(e.state.doc.lineAt(s).to,s+t),i.length&&i[i.length-1].to>=r?i[i.length-1].to=s:i.push({from:r,to:s});return i}class kDt{constructor(t){const{regexp:n,decoration:i,decorate:r,boundary:s,maxLength:o=1e3}=t;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,r)this.addMatch=(l,c,u,d)=>r(d,u,u+l[0].length,l,c);else if(typeof i=="function")this.addMatch=(l,c,u,d)=>{let f=i(l,c,u);f&&d(u,u+l[0].length,f)};else if(i)this.addMatch=(l,c,u,d)=>d(u,u+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=o}createDeco(t){let n=new im,i=n.add.bind(n);for(let{from:r,to:s}of wDt(t,this.maxLength))lre(t.state.doc,this.regexp,r,s,(o,l)=>this.addMatch(l,t,o,i));return n.finish()}updateDeco(t,n){let i=1e9,r=-1;return t.docChanged&&t.changes.iterChanges((s,o,l,c)=>{c>=t.view.viewport.from&&l<=t.view.viewport.to&&(i=Math.min(l,i),r=Math.max(c,r))}),t.viewportMoved||r-i>1e3?this.createDeco(t.view):r>-1?this.updateRange(t.view,n.map(t.changes),i,r):n}updateRange(t,n,i,r){for(let s of t.visibleRanges){let o=Math.max(s.from,i),l=Math.min(s.to,r);if(l>=o){let c=t.state.doc.lineAt(o),u=c.toc.from;o--)if(this.boundary.test(c.text[o-1-c.from])){d=o;break}for(;lh.push(y.range(b,v));if(c==u)for(this.regexp.lastIndex=d-c.from;(m=this.regexp.exec(c.text))&&m.indexthis.addMatch(v,t,b,g));n=n.update({filterFrom:d,filterTo:f,filter:(b,v)=>bf,add:h})}}return n}}const Y9=/x/.unicode!=null?"gu":"g",ODt=new RegExp(`[\0-\b ---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Y9),SDt={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let r$=null;function EDt(){var e;if(r$==null&&typeof document<"u"&&document.body){let t=document.body.style;r$=((e=t.tabSize)!==null&&e!==void 0?e:t.MozTabSize)!=null}return r$||!1}const UN=pn.define({combine(e){let t=Mh(e,{render:null,specialChars:ODt,addSpecialChars:null});return(t.replaceTabs=!EDt())&&(t.specialChars=new RegExp(" |"+t.specialChars.source,Y9)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,Y9)),t}});function CDt(e={}){return[UN.of(e),ADt()]}let cre=null;function ADt(){return cre||(cre=ba.fromClass(class{constructor(e){this.view=e,this.decorations=$n.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(UN)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new kDt({regexp:e.specialChars,decoration:(t,n,i)=>{let{doc:r}=n.state,s=Ac(t[0],0);if(s==9){let o=r.lineAt(i),l=n.state.tabSize,c=vf(o.text,l,i-o.from);return $n.replace({widget:new NDt((l-c%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=$n.replace({widget:new jDt(e,s)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(UN);e.startState.facet(UN)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))}const TDt="•";function _Dt(e){return e>=32?TDt:e==10?"␤":String.fromCharCode(9216+e)}class jDt extends Tf{constructor(t,n){super(),this.options=t,this.code=n}eq(t){return t.code==this.code}toDOM(t){let n=_Dt(this.code),i=t.state.phrase("Control character")+" "+(SDt[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,i,n);if(r)return r;let s=document.createElement("span");return s.textContent=n,s.title=i,s.setAttribute("aria-label",i),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class NDt extends Tf{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent=" ",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}function RDt(){return PDt}const IDt=$n.line({class:"cm-activeLine"}),PDt=ba.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let i of e.state.selection.ranges){let r=e.lineBlockAt(i.head);r.from>t&&(n.push(IDt.range(r.from)),t=r.from)}return $n.set(n)}},{decorations:e=>e.decorations});class DDt extends Tf{constructor(t){super(),this.content=t}toDOM(t){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(t):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(t){let n=t.firstChild?SE(t.firstChild):[];if(!n.length)return null;let i=window.getComputedStyle(t.parentNode),r=UC(n[0],i.direction!="rtl"),s=parseInt(i.lineHeight);return r.bottom-r.top>s*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+s}:r}ignoreEvent(){return!1}}function MDt(e){let t=ba.fromClass(class{constructor(n){this.view=n,this.placeholder=e?$n.set([$n.widget({widget:new DDt(e),side:1}).range(0)]):$n.none}get decorations(){return this.view.state.doc.length?$n.none:this.placeholder}},{decorations:n=>n.decorations});return typeof e=="string"?[t,Jt.contentAttributes.of({"aria-placeholder":e})]:t}const Z9=2e3;function LDt(e,t,n){let i=Math.min(t.line,n.line),r=Math.max(t.line,n.line),s=[];if(t.off>Z9||n.off>Z9||t.col<0||n.col<0){let o=Math.min(t.off,n.off),l=Math.max(t.off,n.off);for(let c=i;c<=r;c++){let u=e.doc.line(c);u.length<=l&&s.push(pt.range(u.from+o,u.to+l))}}else{let o=Math.min(t.col,n.col),l=Math.max(t.col,n.col);for(let c=i;c<=r;c++){let u=e.doc.line(c),d=N9(u.text,o,e.tabSize,!0);if(d<0)s.push(pt.cursor(u.to));else{let f=N9(u.text,l,e.tabSize);s.push(pt.range(u.from+d,u.from+f))}}}return s}function $Dt(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function ure(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),i=e.state.doc.lineAt(n),r=n-i.from,s=r>Z9?-1:r==i.length?$Dt(e,t.clientX):vf(i.text,e.state.tabSize,n-i.from);return{line:i.number,col:s,off:r}}function FDt(e,t){let n=ure(e,t),i=e.state.selection;return n?{update(r){if(r.docChanged){let s=r.changes.mapPos(r.startState.doc.line(n.line).from),o=r.state.doc.lineAt(s);n={line:o.number,col:n.col,off:Math.min(n.off,o.length)},i=i.map(r.changes)}},get(r,s,o){let l=ure(e,r);if(!l)return i;let c=LDt(e.state,n,l);return c.length?o?pt.create(c.concat(i.ranges)):pt.create(c):i}}:null}function BDt(e){let t=n=>n.altKey&&n.button==0;return Jt.mouseSelectionStyle.of((n,i)=>t(i)?FDt(n,i):null)}const UDt={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},QDt={style:"cursor: crosshair"};function zDt(e={}){let[t,n]=UDt[e.key||"Alt"],i=ba.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==t||n(r))},keyup(r){(r.keyCode==t||!n(r))&&this.set(!1)},mousemove(r){this.set(n(r))}}});return[i,Jt.contentAttributes.of(r=>{var s;return!((s=r.plugin(i))===null||s===void 0)&&s.isDown?QDt:null})]}const Y_="-10000px";class c4e{constructor(t,n,i,r){this.facet=n,this.createTooltipView=i,this.removeTooltipView=r,this.input=t.state.facet(n),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=i(o,s))}update(t,n){var i;let r=t.state.facet(this.facet),s=r.filter(c=>c);if(r===this.input){for(let c of this.tooltipViews)c.update&&c.update(t);return!1}let o=[],l=n?[]:null;for(let c=0;cn[u]=c),n.length=l.length),this.input=r,this.tooltips=s,this.tooltipViews=o,!0}}function VDt(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}const s$=pn.define({combine:e=>{var t,n,i;return{position:dn.ios?"absolute":((t=e.find(r=>r.position))===null||t===void 0?void 0:t.position)||"fixed",parent:((n=e.find(r=>r.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((i=e.find(r=>r.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||VDt}}}),dre=new WeakMap,Jq=ba.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(s$);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new c4e(e,eW,(n,i)=>this.createTooltip(n,i),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,i=e.state.facet(s$);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;n=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),i=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",n.dom.appendChild(r)}return n.dom.style.position=this.position,n.dom.style.top=Y_,n.dom.style.left="0px",this.container.insertBefore(n.dom,i),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(e=i.destroy)===null||e===void 0||e.call(i);this.parent&&this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(dn.safari){let o=s.getBoundingClientRect();n=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else n=!!s.offsetParent&&s.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(e=s.width/this.parent.offsetWidth,t=s.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),r=Gq(this.view);return{visible:{left:i.left+r.left,top:i.top+r.top,right:i.right-r.right,bottom:i.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(s$).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:n,space:i,scaleX:r,scaleY:s}=e,o=[];for(let l=0;l=Math.min(n.bottom,i.bottom)||f.rightMath.min(n.right,i.right)+.1)){d.style.top=Y_;continue}let m=c.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,g=m?7:0,b=h.right-h.left,v=(t=dre.get(u))!==null&&t!==void 0?t:h.bottom-h.top,y=u.offset||qDt,w=this.view.textDirection==cs.LTR,x=h.width>i.right-i.left?w?i.left:i.right-h.width:w?Math.max(i.left,Math.min(f.left-(m?14:0)+y.x,i.right-b)):Math.min(Math.max(i.left,f.left-b+(m?14:0)-y.x),i.right-b),k=this.above[l];!c.strictSide&&(k?f.top-v-g-y.yi.bottom)&&k==i.bottom-f.bottom>f.top-i.top&&(k=this.above[l]=!k);let S=(k?f.top-i.top:i.bottom-f.bottom)-g;if(Sx&&E.topO&&(O=k?E.top-v-2-g:E.bottom+g+2);if(this.position=="absolute"?(d.style.top=(O-e.parent.top)/s+"px",fre(d,(x-e.parent.left)/r)):(d.style.top=O/s+"px",fre(d,x/r)),m){let E=f.left+(w?y.x:-y.x)-(x+14-7);m.style.left=E/r+"px"}u.overlap!==!0&&o.push({left:x,top:O,right:A,bottom:O+v}),d.classList.toggle("cm-tooltip-above",k),d.classList.toggle("cm-tooltip-below",!k),u.positioned&&u.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=Y_}},{eventObservers:{scroll(){this.maybeMeasure()}}});function fre(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}const HDt=Jt.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),qDt={x:0,y:0},eW=pn.define({enables:[Jq,HDt]}),GI=pn.define({combine:e=>e.reduce((t,n)=>t.concat(n),[])});class ZM{static create(t){return new ZM(t)}constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new c4e(t,GI,(n,i)=>this.createHostedView(n,i),n=>n.dom.remove())}createHostedView(t,n){let i=t.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(t){for(let n of this.manager.tooltipViews)n.mount&&n.mount(t);this.mounted=!0}positioned(t){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(t)}update(t){this.manager.update(t)}destroy(){var t;for(let n of this.manager.tooltipViews)(t=n.destroy)===null||t===void 0||t.call(n)}passProp(t){let n;for(let i of this.manager.tooltipViews){let r=i[t];if(r!==void 0){if(n===void 0)n=r;else if(n!==r)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const WDt=eW.compute([GI],e=>{let t=e.facet(GI);return t.length===0?null:{pos:Math.min(...t.map(n=>n.pos)),end:Math.max(...t.map(n=>{var i;return(i=n.end)!==null&&i!==void 0?i:n.pos})),create:ZM.create,above:t[0].above,arrow:t.some(n=>n.arrow)}}),u4e=pn.define();class KDt{constructor(t,n,i,r,s,o){this.view=t,this.source=n,this.field=i,this.locked=r,this.setHover=s,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(t){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let t=Date.now()-this.lastMove.time;to.bottom||n.xo.right+t.defaultCharacterWidth)return;let l=t.bidiSpans(t.state.doc.lineAt(r)).find(u=>u.from<=r&&u.to>=r),c=l&&l.dir==cs.RTL?-1:1;s=n.x{if(l&&!(Array.isArray(l)&&!l.length)){let c=Array.isArray(l)?l:[l];r&&this.locked.set(c,r),t.dispatch({effects:this.setHover.of(c)})}};if(s&&"then"in s){let l=this.pending={pos:n};s.then(c=>{this.pending==l&&(this.pending=null,o(c))},c=>Rc(t.state,c,"hover tooltip"))}else o(s)}get tooltip(){let t=this.view.plugin(Jq),n=t?t.manager.tooltips.findIndex(i=>i.create==ZM.create):-1;return n>-1?t.manager.tooltipViews[n]:null}mousemove(t){var n,i;this.lastMove={x:t.clientX,y:t.clientY,target:t.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:s}=this;if(r.length&&!this.locked.has(r)&&s&&!GDt(s.dom,t)||this.pending){let{pos:o}=r[0]||this.pending,l=(i=(n=r[0])===null||n===void 0?void 0:n.end)!==null&&i!==void 0?i:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!XDt(this.view,o,l,t.clientX,t.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(t){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length&&!this.locked.has(n)){let{tooltip:i}=this;i&&i.dom.contains(t.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(t){let n=i=>{t.removeEventListener("mouseleave",n);let{active:r}=this;r.length&&!this.locked.has(r)&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};t.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const Z_=4;function GDt(e,t){let{left:n,right:i,top:r,bottom:s}=e.getBoundingClientRect(),o;if(o=e.querySelector(".cm-tooltip-arrow")){let l=o.getBoundingClientRect();r=Math.min(l.top,r),s=Math.max(l.bottom,s)}return t.clientX>=n-Z_&&t.clientX<=i+Z_&&t.clientY>=r-Z_&&t.clientY<=s+Z_}function XDt(e,t,n,i,r,s){let o=e.scrollDOM.getBoundingClientRect(),l=e.documentTop+e.documentPadding.top+e.contentHeight;if(o.left>i||o.rightr||Math.min(o.bottom,l)=t&&c<=n}function YDt(e,t={}){let n=hi.define(),i=new WeakMap,r=pl.define({create(){return[]},update(o,l){let c=i.get(o);if(o.length&&(t.hideOnChange&&(l.docChanged||l.selection)?o=[]:c&&c(l)?o=[]:t.hideOn&&(o=o.filter(u=>!t.hideOn(l,u)))),l.docChanged&&o.length){let u=[];for(let d of o){let f=l.changes.mapPos(d.pos,-1,al.TrackDel);if(f!=null){let h=Object.assign(Object.create(null),d);h.pos=f,h.end!=null&&(h.end=l.changes.mapPos(h.end)),u.push(h)}}o=u}for(let u of l.effects)u.is(n)&&(o=u.value,c=void 0),(u.is(JDt)&&!u.value||u.value==r)&&(o=[]);return o.length&&c&&i.set(o,c),o},provide:o=>GI.from(o)});const s=ba.define(o=>new KDt(o,e,r,i,n,t.hoverTime||300));return{active:r,extension:[r,s,u4e.of(s),WDt]}}function ZDt(e,t,n,i={}){var r;let s=e.state.facet(u4e).map(o=>e.plugin(o)).filter(o=>!!o);if(i.tooltip&&i.tooltip.active){let o=s.find(l=>l.field==i.tooltip.active);o&&(s=[o])}for(let o of s)o.activateHover(e,t,n,(r=i.until)!==null&&r!==void 0?r:()=>!1)}function d4e(e,t){let n=e.plugin(Jq);if(!n)return null;let i=n.manager.tooltips.indexOf(t);return i<0?null:n.manager.tooltipViews[i]}const JDt=hi.define(),hre=pn.define({combine(e){let t,n;for(let i of e)t=t||i.topContainer,n=n||i.bottomContainer;return{topContainer:t,bottomContainer:n}}});function tW(e,t){let n=e.plugin(f4e),i=n?n.specs.indexOf(t):-1;return i>-1?n.panels[i]:null}const f4e=ba.fromClass(class{constructor(e){this.input=e.state.facet(zC),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(e));let t=e.state.facet(hre);this.top=new J_(e,!0,t.topContainer),this.bottom=new J_(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(e){let t=e.state.facet(hre);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new J_(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new J_(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(zC);if(n!=this.input){let i=n.filter(c=>c),r=[],s=[],o=[],l=[];for(let c of i){let u=this.specs.indexOf(c),d;u<0?(d=c(e.view),l.push(d)):(d=this.panels[u],d.update&&d.update(e)),r.push(d),(d.top?s:o).push(d)}this.specs=i,this.panels=r,this.top.sync(s),this.bottom.sync(o);for(let c of l)c.dom.classList.add("cm-panel"),c.mount&&c.mount()}else for(let i of this.panels)i.update&&i.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>Jt.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class J_{constructor(t,n,i){this.view=t,this.top=n,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let n of this.panels)n.destroy&&t.indexOf(n)<0&&n.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let t=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;t!=n.dom;)t=pre(t);t=t.nextSibling}else this.dom.insertBefore(n.dom,t);for(;t;)t=pre(t)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function pre(e){let t=e.nextSibling;return e.remove(),t}const zC=pn.define({enables:f4e});function eMt(e,t){let n,i=new Promise(o=>n=o),r=o=>tMt(o,t,n);e.state.field(a$,!1)?e.dispatch({effects:h4e.of(r)}):e.dispatch({effects:hi.appendConfig.of(a$.init(()=>[r]))});let s=p4e.of(r);return{close:s,result:i.then(o=>((e.win.queueMicrotask||(c=>e.win.setTimeout(c,10)))(()=>{e.state.field(a$).indexOf(r)>-1&&e.dispatch({effects:s})}),o))}}const a$=pl.define({create(){return[]},update(e,t){for(let n of t.effects)n.is(h4e)?e=[n.value].concat(e):n.is(p4e)&&(e=e.filter(i=>i!=n.value));return e},provide:e=>zC.computeN([e],t=>t.field(e))}),h4e=hi.define(),p4e=hi.define();function tMt(e,t,n){let i=t.content?t.content(e,()=>o(null)):null;if(!i){if(i=Yr("form"),t.input){let l=Yr("input",t.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),i.appendChild(Yr("label",(t.label||"")+": ",l))}else i.appendChild(document.createTextNode(t.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(Yr("button",{class:"cm-button",type:"submit"},t.submitLabel||"OK"))}let r=i.nodeName=="FORM"?[i]:i.querySelectorAll("form");for(let l=0;l{u.keyCode==27?(u.preventDefault(),o(null)):u.keyCode==13&&(u.preventDefault(),o(c))}),c.addEventListener("submit",u=>{u.preventDefault(),o(c)})}let s=Yr("div",i,Yr("button",{onclick:()=>o(null),"aria-label":e.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));t.class&&(s.className=t.class),s.classList.add("cm-dialog");function o(l){s.contains(s.ownerDocument.activeElement)&&e.focus(),n(l)}return{dom:s,top:t.top,mount:()=>{if(t.focus){let l;typeof t.focus=="string"?l=i.querySelector(t.focus):l=i.querySelector("input")||i.querySelector("button"),l&&"select"in l?l.select():l&&"focus"in l&&l.focus()}}}}class sm extends ub{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}sm.prototype.elementClass="";sm.prototype.toDOM=void 0;sm.prototype.mapMode=al.TrackBefore;sm.prototype.startSide=sm.prototype.endSide=-1;sm.prototype.point=!0;const QN=pn.define(),nMt=pn.define(),iMt={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Yi.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},AE=pn.define();function rMt(e){return[m4e(),AE.of({...iMt,...e})]}const mre=pn.define({combine:e=>e.some(t=>t)});function m4e(e){return[sMt]}const sMt=ba.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(AE).map(t=>new bre(e,t)),this.fixed=!e.state.facet(mre);for(let t of this.gutters)t.config.side=="after"?this.getDOMAfter().appendChild(t.dom):this.dom.appendChild(t.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,i=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(i<(n.to-n.from)*.8)}if(e.geometryChanged){let t=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=t,this.domAfter&&(this.domAfter.style.minHeight=t)}this.view.state.facet(mre)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=Yi.iter(this.view.state.facet(QN),this.view.viewport.from),i=[],r=this.gutters.map(s=>new aMt(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(s.type)){let o=!0;for(let l of s.type)if(l.type==ul.Text&&o){J9(n,i,l.from);for(let c of r)c.line(this.view,l,i);o=!1}else if(l.widget)for(let c of r)c.widget(this.view,l)}else if(s.type==ul.Text){J9(n,i,s.from);for(let o of r)o.line(this.view,s,i)}else if(s.widget)for(let o of r)o.widget(this.view,s);for(let s of r)s.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(AE),n=e.state.facet(AE),i=e.docChanged||e.heightChanged||e.viewportChanged||!Yi.eq(e.startState.facet(QN),e.state.facet(QN),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let r of this.gutters)r.update(e)&&(i=!0);else{i=!0;let r=[];for(let s of n){let o=t.indexOf(s);o<0?r.push(new bre(this.view,s)):(this.gutters[o].update(e),r.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=r}return i}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>Jt.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||n.gutters.length==0||!n.fixed)return null;let i=n.dom.offsetWidth*t.scaleX,r=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==cs.LTR?{left:i,right:r}:{right:i,left:r}})});function gre(e){return Array.isArray(e)?e:[e]}function J9(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class aMt{constructor(t,n,i){this.gutter=t,this.height=i,this.i=0,this.cursor=Yi.iter(t.markers,n.from)}addElement(t,n,i){let{gutter:r}=this,s=(n.top-this.height)/t.scaleY,o=n.height/t.scaleY;if(this.i==r.elements.length){let l=new g4e(t,o,s,i);r.elements.push(l),r.dom.appendChild(l.dom)}else r.elements[this.i].update(t,o,s,i);this.height=n.bottom,this.i++}line(t,n,i){let r=[];J9(this.cursor,r,n.from),i.length&&(r=r.concat(i));let s=this.gutter.config.lineMarker(t,n,r);s&&r.unshift(s);let o=this.gutter;r.length==0&&!o.config.renderEmptyElements||this.addElement(t,n,r)}widget(t,n){let i=this.gutter.config.widgetMarker(t,n.widget,n),r=i?[i]:null;for(let s of t.state.facet(nMt)){let o=s(t,n.widget,n);o&&(r||(r=[])).push(o)}r&&this.addElement(t,n,r)}finish(){let t=this.gutter;for(;t.elements.length>this.i;){let n=t.elements.pop();t.dom.removeChild(n.dom),n.destroy()}}}class bre{constructor(t,n){this.view=t,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in n.domEventHandlers)this.dom.addEventListener(i,r=>{let s=r.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let c=s.getBoundingClientRect();o=(c.top+c.bottom)/2}else o=r.clientY;let l=t.lineBlockAtHeight(o-t.documentTop);n.domEventHandlers[i](t,l,r)&&r.preventDefault()});this.markers=gre(n.markers(t)),n.initialSpacer&&(this.spacer=new g4e(t,0,0,[n.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(t){let n=this.markers;if(this.markers=gre(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],t);r!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[r])}let i=t.view.viewport;return!Yi.eq(this.markers,n,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(t):!1)}destroy(){for(let t of this.elements)t.destroy()}}class g4e{constructor(t,n,i,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,n,i,r)}update(t,n,i,r){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),oMt(this.markers,r)||this.setMarkers(t,r)}setMarkers(t,n){let i="cm-gutterElement",r=this.dom.firstChild;for(let s=0,o=0;;){let l=o,c=ss(l,c,u)||o(l,c,u):o}return i}})}});class o$ extends sm{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function l$(e,t){return e.state.facet(Qx).formatNumber(t,e.state)}const uMt=AE.compute([Qx],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(t){return t.state.facet(lMt)},lineMarker(t,n,i){return i.some(r=>r.toDOM)?null:new o$(l$(t,t.state.doc.lineAt(n.from).number))},widgetMarker:(t,n,i)=>{for(let r of t.state.facet(cMt)){let s=r(t,n,i);if(s)return s}return null},lineMarkerChange:t=>t.startState.facet(Qx)!=t.state.facet(Qx),initialSpacer(t){return new o$(l$(t,yre(t.state.doc.lines)))},updateSpacer(t,n){let i=l$(n.view,yre(n.view.state.doc.lines));return i==t.number?t:new o$(i)},domEventHandlers:e.facet(Qx).domEventHandlers,side:"before"}));function b4e(e={}){return[Qx.of(e),m4e(),uMt]}function yre(e){let t=9;for(;t{let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.head).from;r>n&&(n=r,t.push(dMt.range(r)))}return Yi.of(t)});function hMt(){return fMt}let pMt=0,Xf=class e7{constructor(t,n,i,r){this.name=t,this.set=n,this.base=i,this.modified=r,this.id=pMt++}toString(){let{name:t}=this;for(let n of this.modified)n.name&&(t=`${n.name}(${t})`);return t}static define(t,n){let i=typeof t=="string"?t:"?";if(t instanceof e7&&(n=t),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let r=new e7(i,[],null,[]);if(r.set.push(r),n)for(let s of n.set)r.set.push(s);return r}static defineModifier(t){let n=new XI(t);return i=>i.modified.indexOf(n)>-1?i:XI.get(i.base||i,i.modified.concat(n).sort((r,s)=>r.id-s.id))}},mMt=0;class XI{constructor(t){this.name=t,this.instances=[],this.id=mMt++}static get(t,n){if(!n.length)return t;let i=n[0].instances.find(l=>l.base==t&&gMt(n,l.modified));if(i)return i;let r=[],s=new Xf(t.name,r,t,n);for(let l of n)l.instances.push(s);let o=bMt(n);for(let l of t.set)if(!l.modified.length)for(let c of o)r.push(XI.get(l,c));return s}}function gMt(e,t){return e.length==t.length&&e.every((n,i)=>n==t[i])}function bMt(e){let t=[[]];for(let n=0;ni.length-n.length)}function vm(e){let t=Object.create(null);for(let n in e){let i=e[n];Array.isArray(i)||(i=[i]);for(let r of n.split(" "))if(r){let s=[],o=2,l=r;for(let f=0;;){if(l=="..."&&f>0&&f+3==r.length){o=1;break}let h=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!h)throw new RangeError("Invalid path: "+r);if(s.push(h[0]=="*"?"":h[0][0]=='"'?JSON.parse(h[0]):h[0]),f+=h[0].length,f==r.length)break;let m=r[f++];if(f==r.length&&m=="!"){o=0;break}if(m!="/")throw new RangeError("Invalid path: "+r);l=r.slice(f)}let c=s.length-1,u=s[c];if(!u)throw new RangeError("Invalid path: "+r);let d=new VC(i,o,c>0?s.slice(0,c):null);t[u]=d.sort(t[u])}}return y4e.add(t)}const y4e=new li({combine(e,t){let n,i,r;for(;e||t;){if(!e||t&&e.depth>=t.depth?(r=t,t=t.next):(r=e,e=e.next),n&&n.mode==r.mode&&!r.context&&!n.context)continue;let s=new VC(r.tags,r.mode,r.context);n?n.next=s:i=s,n=s}return i}});let VC=class{constructor(t,n,i,r){this.tags=t,this.mode=n,this.context=i,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth{let o=r;for(let l of s)for(let c of l.set){let u=n[c.id];if(u){o=o?o+" "+u:u;break}}return o},scope:i}}function yMt(e,t){let n=null;for(let i of e){let r=i.style(t);r&&(n=n?n+" "+r:r)}return n}function vMt(e,t,n,i=0,r=e.length){let s=new xMt(i,Array.isArray(t)?t:[t],n);s.highlightRange(e.cursor(),i,r,"",s.highlighters),s.flush(r)}class xMt{constructor(t,n,i){this.at=t,this.highlighters=n,this.span=i,this.class=""}startSpan(t,n){n!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=n)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,n,i,r,s){let{type:o,from:l,to:c}=t;if(l>=i||c<=n)return;o.isTop&&(s=this.highlighters.filter(m=>!m.scope||m.scope(o)));let u=r,d=wMt(t)||VC.empty,f=yMt(s,d.tags);if(f&&(u&&(u+=" "),u+=f,d.mode==1&&(r+=(r?" ":"")+f)),this.startSpan(Math.max(n,l),u),d.opaque)return;let h=t.tree&&t.tree.prop(li.mounted);if(h&&h.overlay){let m=t.node.enter(h.overlay[0].from+l,1),g=this.highlighters.filter(v=>!v.scope||v.scope(h.tree.type)),b=t.firstChild();for(let v=0,y=l;;v++){let w=v=x||!t.nextSibling())););if(!w||x>i)break;y=w.to+l,y>n&&(this.highlightRange(m.cursor(),Math.max(n,w.from+l),Math.min(i,y),"",g),this.startSpan(Math.min(i,y),u))}b&&t.parent()}else if(t.firstChild()){h&&(r="");do if(!(t.to<=n)){if(t.from>=i)break;this.highlightRange(t,n,i,r,s),this.startSpan(Math.min(i,t.to),u)}while(t.nextSibling());t.parent()}}}function wMt(e){let t=e.type.prop(y4e);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}const sn=Xf.define,ej=sn(),Gm=sn(),vre=sn(Gm),xre=sn(Gm),Xm=sn(),tj=sn(Xm),c$=sn(Xm),Wf=sn(),Xb=sn(Wf),zf=sn(),Vf=sn(),t7=sn(),AO=sn(t7),nj=sn(),me={comment:ej,lineComment:sn(ej),blockComment:sn(ej),docComment:sn(ej),name:Gm,variableName:sn(Gm),typeName:vre,tagName:sn(vre),propertyName:xre,attributeName:sn(xre),className:sn(Gm),labelName:sn(Gm),namespace:sn(Gm),macroName:sn(Gm),literal:Xm,string:tj,docString:sn(tj),character:sn(tj),attributeValue:sn(tj),number:c$,integer:sn(c$),float:sn(c$),bool:sn(Xm),regexp:sn(Xm),escape:sn(Xm),color:sn(Xm),url:sn(Xm),keyword:zf,self:sn(zf),null:sn(zf),atom:sn(zf),unit:sn(zf),modifier:sn(zf),operatorKeyword:sn(zf),controlKeyword:sn(zf),definitionKeyword:sn(zf),moduleKeyword:sn(zf),operator:Vf,derefOperator:sn(Vf),arithmeticOperator:sn(Vf),logicOperator:sn(Vf),bitwiseOperator:sn(Vf),compareOperator:sn(Vf),updateOperator:sn(Vf),definitionOperator:sn(Vf),typeOperator:sn(Vf),controlOperator:sn(Vf),punctuation:t7,separator:sn(t7),bracket:AO,angleBracket:sn(AO),squareBracket:sn(AO),paren:sn(AO),brace:sn(AO),content:Wf,heading:Xb,heading1:sn(Xb),heading2:sn(Xb),heading3:sn(Xb),heading4:sn(Xb),heading5:sn(Xb),heading6:sn(Xb),contentSeparator:sn(Wf),list:sn(Wf),quote:sn(Wf),emphasis:sn(Wf),strong:sn(Wf),link:sn(Wf),monospace:sn(Wf),strikethrough:sn(Wf),inserted:sn(),deleted:sn(),changed:sn(),invalid:sn(),meta:nj,documentMeta:sn(nj),annotation:sn(nj),processingInstruction:sn(nj),definition:Xf.defineModifier("definition"),constant:Xf.defineModifier("constant"),function:Xf.defineModifier("function"),standard:Xf.defineModifier("standard"),local:Xf.defineModifier("local"),special:Xf.defineModifier("special")};for(let e in me){let t=me[e];t instanceof Xf&&(t.name=e)}v4e([{tag:me.link,class:"tok-link"},{tag:me.heading,class:"tok-heading"},{tag:me.emphasis,class:"tok-emphasis"},{tag:me.strong,class:"tok-strong"},{tag:me.keyword,class:"tok-keyword"},{tag:me.atom,class:"tok-atom"},{tag:me.bool,class:"tok-bool"},{tag:me.url,class:"tok-url"},{tag:me.labelName,class:"tok-labelName"},{tag:me.inserted,class:"tok-inserted"},{tag:me.deleted,class:"tok-deleted"},{tag:me.literal,class:"tok-literal"},{tag:me.string,class:"tok-string"},{tag:me.number,class:"tok-number"},{tag:[me.regexp,me.escape,me.special(me.string)],class:"tok-string2"},{tag:me.variableName,class:"tok-variableName"},{tag:me.local(me.variableName),class:"tok-variableName tok-local"},{tag:me.definition(me.variableName),class:"tok-variableName tok-definition"},{tag:me.special(me.variableName),class:"tok-variableName2"},{tag:me.definition(me.propertyName),class:"tok-propertyName tok-definition"},{tag:me.typeName,class:"tok-typeName"},{tag:me.namespace,class:"tok-namespace"},{tag:me.className,class:"tok-className"},{tag:me.macroName,class:"tok-macroName"},{tag:me.propertyName,class:"tok-propertyName"},{tag:me.operator,class:"tok-operator"},{tag:me.comment,class:"tok-comment"},{tag:me.meta,class:"tok-meta"},{tag:me.invalid,class:"tok-invalid"},{tag:me.punctuation,class:"tok-punctuation"}]);var u$;const xg=new li;function JM(e){return pn.define({combine:e?t=>t.concat(e):void 0})}const nW=new li;class Au{constructor(t,n,i=[],r=""){this.data=t,this.name=r,sr.prototype.hasOwnProperty("tree")||Object.defineProperty(sr.prototype,"tree",{get(){return es(this)}}),this.parser=n,this.extension=[pb.of(this),sr.languageData.of((s,o,l)=>{let c=wre(s,o,l),u=c.type.prop(xg);if(!u)return[];let d=s.facet(u),f=c.type.prop(nW);if(f){let h=c.resolve(o-c.from,l);for(let m of f)if(m.test(h,s)){let g=s.facet(m.facet);return m.type=="replace"?g:g.concat(d)}}return d})].concat(i)}isActiveAt(t,n,i=-1){return wre(t,n,i).type.prop(xg)==this.data}findRegions(t){let n=t.facet(pb);if((n==null?void 0:n.data)==this.data)return[{from:0,to:t.doc.length}];if(!n||!n.allowsNesting)return[];let i=[],r=(s,o)=>{if(s.prop(xg)==this.data){i.push({from:o,to:o+s.length});return}let l=s.prop(li.mounted);if(l){if(l.tree.prop(xg)==this.data){if(l.overlay)for(let c of l.overlay)i.push({from:c.from+o,to:c.to+o});else i.push({from:o,to:o+s.length});return}else if(l.overlay){let c=i.length;if(r(l.tree,l.overlay[0].from+o),i.length>c)return}}for(let c=0;ci.isTop?n:void 0)]}),t.name)}configure(t,n){return new am(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function es(e){let t=e.field(Au.state,!1);return t?t.tree:Hi.empty}class kMt{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,n){let i=this.cursorPos-this.string.length;return t=this.cursorPos?this.doc.sliceString(t,n):this.string.slice(t-i,n-i)}}let TO=null;class vv{constructor(t,n,i=[],r,s,o,l,c){this.parser=t,this.state=n,this.fragments=i,this.tree=r,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}static create(t,n,i){return new vv(t,n,[],Hi.empty,0,i,[],null)}startParse(){return this.parser.startParse(new kMt(this.state.doc),this.fragments)}work(t,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Hi.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof t=="number"){let r=Date.now()+t;t=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=t,this.tree=n,this.fragments=this.withoutTempSkipped(Qp.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let n=TO;TO=this;try{return t()}finally{TO=n}}withoutTempSkipped(t){for(let n;n=this.tempSkipped.pop();)t=kre(t,n.from,n.to);return t}changes(t,n){let{fragments:i,tree:r,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!t.empty){let c=[];if(t.iterChangedRanges((u,d,f,h)=>c.push({fromA:u,toA:d,fromB:f,toB:h})),i=Qp.applyChanges(i,c),r=Hi.empty,s=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){l=[];for(let u of this.skipped){let d=t.mapPos(u.from,1),f=t.mapPos(u.to,-1);dt.from&&(this.fragments=kre(this.fragments,r,s),this.skipped.splice(i--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,n){this.skipped.push({from:t,to:n})}static getSkippingParser(t){return new class extends HM{createParse(n,i,r){let s=r[0].from,o=r[r.length-1].to;return{parsedPos:s,advance(){let c=TO;if(c){for(let u of r)c.tempSkipped.push(u);t&&(c.scheduleOn=c.scheduleOn?Promise.all([c.scheduleOn,t]):t)}return this.parsedPos=o,new Hi(Ja.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let n=this.fragments;return this.treeLen>=t&&n.length&&n[0].from==0&&n[0].to>=t}static get(){return TO}}function kre(e,t,n){return Qp.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class b1{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),i=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,i)||n.takeTree(),new b1(n)}static init(t){let n=Math.min(3e3,t.doc.length),i=vv.create(t.facet(pb).parser,t,{from:0,to:n});return i.work(20,n)||i.takeTree(),new b1(i)}}Au.state=pl.define({create:b1.init,update(e,t){for(let n of t.effects)if(n.is(Au.setState))return n.value;return t.startState.facet(pb)!=t.state.facet(pb)?b1.init(t.state):e.apply(t)}});let x4e=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(x4e=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const d$=typeof navigator<"u"&&(!((u$=navigator.scheduling)===null||u$===void 0)&&u$.isInputPending)?()=>navigator.scheduling.isInputPending():null,OMt=ba.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let n=this.view.state.field(Au.state).context;(n.updateViewport(t.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:t}=this.view,n=t.field(Au.state);(n.tree!=n.context.tree||!n.context.isDone(t.doc.length))&&(this.working=x4e(this.work))}work(t){this.working=null;let n=Date.now();if(this.chunkEndr+1e3,c=s.context.work(()=>d$&&d$()||Date.now()>o,r+(l?0:1e5));this.chunkBudget-=Date.now()-n,(c||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Au.setState.of(new b1(s.context))})),this.chunkBudget>0&&!(c&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Rc(this.view.state,n)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),pb=pn.define({combine(e){return e.length?e[0]:null},enables:e=>[Au.state,OMt,Jt.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class mb{constructor(t,n=[]){this.language=t,this.support=n,this.extension=[t,n]}}class YI{constructor(t,n,i,r,s,o=void 0){this.name=t,this.alias=n,this.extensions=i,this.filename=r,this.loadFunc=s,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(t=>this.support=t,t=>{throw this.loading=null,t}))}static of(t){let{load:n,support:i}=t;if(!n){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");n=()=>Promise.resolve(i)}return new YI(t.name,(t.alias||[]).concat(t.name).map(r=>r.toLowerCase()),t.extensions||[],t.filename,n,i)}static matchFilename(t,n){for(let r of t)if(r.filename&&r.filename.test(n))return r;let i=/\.([^.]+)$/.exec(n);if(i){for(let r of t)if(r.extensions.indexOf(i[1])>-1)return r}return null}static matchLanguageName(t,n,i=!0){n=n.toLowerCase();for(let r of t)if(r.alias.some(s=>s==n))return r;if(i)for(let r of t)for(let s of r.alias){let o=n.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(n[o-1])&&!/\w/.test(n[o+s.length])))return r}return null}}const SMt=pn.define(),bk=pn.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(n=>n!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function xv(e){let t=e.facet(bk);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function HC(e,t){let n="",i=e.tabSize,r=e.facet(bk)[0];if(r==" "){for(;t>=i;)n+=" ",t-=i;r=" "}for(let s=0;s=t?EMt(e,n,t):null}class eL{constructor(t,n={}){this.state=t,this.options=n,this.unit=xv(t)}lineAt(t,n=1){let i=this.state.doc.lineAt(t),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=i.from&&r<=i.to?s&&r==t?{text:"",from:t}:(n<0?r-1&&(s+=o-this.countColumn(i,i.search(/\S|$/))),s}countColumn(t,n=t.length){return vf(t,this.state.tabSize,n)}lineIndent(t,n=1){let{text:i,from:r}=this.lineAt(t,n),s=this.options.overrideIndentation;if(s){let o=s(r);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const xm=new li;function EMt(e,t,n){let i=t.resolveStack(n),r=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(r!=i.node){let s=[];for(let o=r;o&&!(o.fromi.node.to||o.from==i.node.from&&o.type==i.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)i={node:s[o],next:i}}return w4e(i,e,n)}function w4e(e,t,n){for(let i=e;i;i=i.next){let r=AMt(i.node);if(r)return r(rW.create(t,n,i))}return 0}function CMt(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function AMt(e){let t=e.type.prop(xm);if(t)return t;let n=e.firstChild,i;if(n&&(i=n.type.prop(li.closedBy))){let r=e.lastChild,s=r&&i.indexOf(r.name)>-1;return o=>k4e(o,!0,1,void 0,s&&!CMt(o)?r.from:void 0)}return e.parent==null?TMt:null}function TMt(){return 0}class rW extends eL{constructor(t,n,i){super(t.state,t.options),this.base=t,this.pos=n,this.context=i}get node(){return this.context.node}static create(t,n,i){return new rW(t,n,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let n=this.state.doc.lineAt(t.from);for(;;){let i=t.resolve(n.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(_Mt(i,t))break;n=this.state.doc.lineAt(i.from)}return this.lineIndent(n.from)}continue(){return w4e(this.context.next,this.base,this.pos)}}function _Mt(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function jMt(e){let t=e.node,n=t.childAfter(t.from),i=t.lastChild;if(!n)return null;let r=e.options.simulateBreak,s=e.state.doc.lineAt(n.from),o=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let l=n.to;;){let c=t.childAfter(l);if(!c||c==i)return null;if(!c.type.isSkipped){if(c.from>=o)return null;let u=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+u}}l=c.to}}function kw({closing:e,align:t=!0,units:n=1}){return i=>k4e(i,t,n,e)}function k4e(e,t,n,i,r){let s=e.textAfter,o=s.match(/^\s*/)[0].length,l=i&&s.slice(o,o+i.length)==i||r==e.pos+o,c=t?jMt(e):null;return c?l?e.column(c.from):e.column(c.to):e.baseIndent+(l?0:e.unit*n)}const NMt=e=>e.baseIndent;function Ow({except:e,units:t=1}={}){return n=>{let i=e&&e.test(n.textAfter);return n.baseIndent+(i?0:t*n.unit)}}const RMt=200;function IMt(){return sr.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:i}=e.newSelection.main,r=n.lineAt(i);if(i>r.from+RMt)return e;let s=n.sliceString(r.from,i);if(!t.some(u=>u.test(s)))return e;let{state:o}=e,l=-1,c=[];for(let{head:u}of o.selection.ranges){let d=o.doc.lineAt(u);if(d.from==l)continue;l=d.from;let f=iW(o,d.from);if(f==null)continue;let h=/^\s*/.exec(d.text)[0],m=HC(o,f);h!=m&&c.push({from:d.from,to:d.from+h.length,insert:m})}return c.length?[e,{changes:c,sequential:!0}]:e})}const O4e=pn.define(),wm=new li;function PT(e){let t=e.firstChild,n=e.lastChild;return t&&t.ton)continue;if(s&&l.from=t&&u.to>n&&(s=u)}}return s}function DMt(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function ZI(e,t,n){for(let i of e.facet(O4e)){let r=i(e,t,n);if(r)return r}return PMt(e,t,n)}function S4e(e,t){let n=t.mapPos(e.from,1),i=t.mapPos(e.to,-1);return n>=i?void 0:{from:n,to:i}}const tL=hi.define({map:S4e}),DT=hi.define({map:S4e});function E4e(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(i=>i.from<=n&&i.to>=n)||t.push(e.lineBlockAt(n));return t}const wv=pl.define({create(){return $n.none},update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((i,r)=>e=Ore(e,i,r)),e=e.map(t.changes);let n=[];for(let i of t.effects)i.is(tL)&&!MMt(e,i.value.from,i.value.to)?n.push(i.value):i.is(DT)&&(e=e.update({filter:(r,s)=>i.value.from!=r||i.value.to!=s,filterFrom:i.value.from,filterTo:i.value.to}));if(n.length){let{preparePlaceholder:i}=t.state.facet(T4e),r=n.map(s=>(i?$n.replace({widget:new zMt(i(t.state,s))}):Sre).range(s.from,s.to));e=e.update({add:r})}return t.selection&&(e=Ore(e,t.selection.main.head)),e},provide:e=>Jt.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(i,r)=>{n.push(i,r)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n{rt&&(i=!0)}),i?e.update({filterFrom:t,filterTo:n,filter:(r,s)=>r>=n||s<=t}):e}function JI(e,t,n){var i;let r=null;return(i=e.field(wv,!1))===null||i===void 0||i.between(t,n,(s,o)=>{(!r||r.from>s)&&(r={from:s,to:o})}),r}function MMt(e,t,n){let i=!1;return e.between(t,t,(r,s)=>{r==t&&s==n&&(i=!0)}),i}function C4e(e,t){return e.field(wv,!1)?t:t.concat(hi.appendConfig.of(_4e()))}const LMt=e=>{for(let t of E4e(e)){let n=ZI(e.state,t.from,t.to);if(n)return e.dispatch({effects:C4e(e.state,[tL.of(n),A4e(e,n)])}),!0}return!1},$Mt=e=>{if(!e.state.field(wv,!1))return!1;let t=[];for(let n of E4e(e)){let i=JI(e.state,n.from,n.to);i&&t.push(DT.of(i),A4e(e,i,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function A4e(e,t,n=!0){let i=e.state.doc.lineAt(t.from).number,r=e.state.doc.lineAt(t.to).number;return Jt.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${i} ${e.state.phrase("to")} ${r}.`)}const FMt=e=>{let{state:t}=e,n=[];for(let i=0;i{let t=e.state.field(wv,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(i,r)=>{n.push(DT.of({from:i,to:r}))}),e.dispatch({effects:n}),!0},UMt=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:LMt},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:$Mt},{key:"Ctrl-Alt-[",run:FMt},{key:"Ctrl-Alt-]",run:BMt}],QMt={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},T4e=pn.define({combine(e){return Mh(e,QMt)}});function _4e(e){return[wv,qMt]}function j4e(e,t){let{state:n}=e,i=n.facet(T4e),r=o=>{let l=e.lineBlockAt(e.posAtDOM(o.target)),c=JI(e.state,l.from,l.to);c&&e.dispatch({effects:DT.of(c)}),o.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(e,r,t);let s=document.createElement("span");return s.textContent=i.placeholderText,s.setAttribute("aria-label",n.phrase("folded code")),s.title=n.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=r,s}const Sre=$n.replace({widget:new class extends Tf{toDOM(e){return j4e(e,null)}}});class zMt extends Tf{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return j4e(t,this.value)}}const VMt={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class f$ extends sm{constructor(t,n){super(),this.config=t,this.open=n}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=t.state.phrase(this.open?"Fold line":"Unfold line"),n}}function HMt(e={}){let t={...VMt,...e},n=new f$(t,!0),i=new f$(t,!1),r=ba.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(pb)!=o.state.facet(pb)||o.startState.field(wv,!1)!=o.state.field(wv,!1)||es(o.startState)!=es(o.state)||t.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new im;for(let c of o.viewportLineBlocks){let u=JI(o.state,c.from,c.to)?i:ZI(o.state,c.from,c.to)?n:null;u&&l.add(c.from,c.from,u)}return l.finish()}}),{domEventHandlers:s}=t;return[r,rMt({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(r))===null||l===void 0?void 0:l.markers)||Yi.empty},initialSpacer(){return new f$(t,!1)},domEventHandlers:{...s,click:(o,l,c)=>{if(s.click&&s.click(o,l,c))return!0;let u=JI(o.state,l.from,l.to);if(u)return o.dispatch({effects:DT.of(u)}),!0;let d=ZI(o.state,l.from,l.to);return d?(o.dispatch({effects:tL.of(d)}),!0):!1}}}),_4e()]}const qMt=Jt.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class MT{constructor(t,n){this.specs=t;let i;function r(l){let c=db.newName();return(i||(i=Object.create(null)))["."+c]=l,c}const s=typeof n.all=="string"?n.all:n.all?r(n.all):void 0,o=n.scope;this.scope=o instanceof Au?l=>l.prop(xg)==o.data:o?l=>l==o:void 0,this.style=v4e(t.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=i?new db(i):null,this.themeType=n.themeType}static define(t,n){return new MT(t,n||{})}}const n7=pn.define(),N4e=pn.define({combine(e){return e.length?[e[0]]:null}});function zN(e){let t=e.facet(n7);return t.length?t:e.facet(N4e)}function R4e(e,t){let n=[KMt],i;return e instanceof MT&&(e.module&&n.push(Jt.styleModule.of(e.module)),i=e.themeType),t!=null&&t.fallback?n.push(N4e.of(e)):i?n.push(n7.computeN([Jt.darkTheme],r=>r.facet(Jt.darkTheme)==(i=="dark")?[e]:[])):n.push(n7.of(e)),n}function qhn(e,t,n){let i=zN(e),r=null;if(i){for(let s of i)if(!s.scope||n){let o=s.style(t);o&&(r=r?r+" "+o:o)}}return r}class WMt{constructor(t){this.markCache=Object.create(null),this.tree=es(t.state),this.decorations=this.buildDeco(t,zN(t.state)),this.decoratedTo=t.viewport.to}update(t){let n=es(t.state),i=zN(t.state),r=i!=zN(t.startState),{viewport:s}=t.view,o=t.changes.mapPos(this.decoratedTo,1);n.length=s.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=o):(n!=this.tree||t.viewportChanged||r)&&(this.tree=n,this.decorations=this.buildDeco(t.view,i),this.decoratedTo=s.to)}buildDeco(t,n){if(!n||!this.tree.length)return $n.none;let i=new im;for(let{from:r,to:s}of t.visibleRanges)vMt(this.tree,n,(o,l,c)=>{i.add(o,l,this.markCache[c]||(this.markCache[c]=$n.mark({class:c})))},r,s);return i.finish()}}const KMt=ym.high(ba.fromClass(WMt,{decorations:e=>e.decorations})),GMt=MT.define([{tag:me.meta,color:"#404740"},{tag:me.link,textDecoration:"underline"},{tag:me.heading,textDecoration:"underline",fontWeight:"bold"},{tag:me.emphasis,fontStyle:"italic"},{tag:me.strong,fontWeight:"bold"},{tag:me.strikethrough,textDecoration:"line-through"},{tag:me.keyword,color:"#708"},{tag:[me.atom,me.bool,me.url,me.contentSeparator,me.labelName],color:"#219"},{tag:[me.literal,me.inserted],color:"#164"},{tag:[me.string,me.deleted],color:"#a11"},{tag:[me.regexp,me.escape,me.special(me.string)],color:"#e40"},{tag:me.definition(me.variableName),color:"#00f"},{tag:me.local(me.variableName),color:"#30a"},{tag:[me.typeName,me.namespace],color:"#085"},{tag:me.className,color:"#167"},{tag:[me.special(me.variableName),me.macroName],color:"#256"},{tag:me.definition(me.propertyName),color:"#00c"},{tag:me.comment,color:"#940"},{tag:me.invalid,color:"#f00"}]),XMt=Jt.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),I4e=1e4,P4e="()[]{}",D4e=pn.define({combine(e){return Mh(e,{afterCursor:!0,brackets:P4e,maxScanDistance:I4e,renderMatch:JMt})}}),YMt=$n.mark({class:"cm-matchingBracket"}),ZMt=$n.mark({class:"cm-nonmatchingBracket"});function JMt(e){let t=[],n=e.matched?YMt:ZMt;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}function Ere(e){let t=[],n=e.facet(D4e);for(let i of e.selection.ranges){if(!i.empty)continue;let r=dh(e,i.head,-1,n)||i.head>0&&dh(e,i.head-1,1,n)||n.afterCursor&&(dh(e,i.head,1,n)||i.heade.decorations}),tLt=[eLt,XMt];function nLt(e={}){return[D4e.of(e),tLt]}const M4e=new li;function i7(e,t,n){let i=e.prop(t<0?li.openedBy:li.closedBy);if(i)return i;if(e.name.length==1){let r=n.indexOf(e.name);if(r>-1&&r%2==(t<0?1:0))return[n[r+t]]}return null}function r7(e){let t=e.type.prop(M4e);return t?t(e.node):e}function dh(e,t,n,i={}){let r=i.maxScanDistance||I4e,s=i.brackets||P4e,o=es(e),l=o.resolveInner(t,n);for(let c=l;c;c=c.parent){let u=i7(c.type,n,s);if(u&&c.from0?t>=d.from&&td.from&&t<=d.to))return iLt(e,t,n,c,d,u,s)}}return rLt(e,t,n,o,l.type,r,s)}function iLt(e,t,n,i,r,s,o){let l=i.parent,c={from:r.from,to:r.to},u=0,d=l==null?void 0:l.cursor();if(d&&(n<0?d.childBefore(i.from):d.childAfter(i.to)))do if(n<0?d.to<=i.from:d.from>=i.to){if(u==0&&s.indexOf(d.type.name)>-1&&d.from0)return null;let u={from:n<0?t-1:t,to:n>0?t+1:t},d=e.doc.iterRange(t,n>0?e.doc.length:0),f=0;for(let h=0;!d.next().done&&h<=s;){let m=d.value;n<0&&(h+=m.length);let g=t+h*n;for(let b=n>0?0:m.length-1,v=n>0?m.length:-1;b!=v;b+=n){let y=o.indexOf(m[b]);if(!(y<0||i.resolveInner(g+b,1).type!=r))if(y%2==0==n>0)f++;else{if(f==1)return{start:u,end:{from:g+b,to:g+b+1},matched:y>>1==c>>1};f--}}n>0&&(h+=m.length)}return d.done?{start:u,matched:!1}:null}function Cre(e,t,n,i=0,r=0){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));let s=r;for(let o=i;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.posn}eatSpace(){let t=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t}skipToEnd(){this.pos=this.string.length}skipTo(t){let n=this.string.indexOf(t,this.pos);if(n>-1)return this.pos=n,!0}backUp(t){this.pos-=t}column(){return this.lastColumnPosi?o.toLowerCase():o,s=this.string.substr(this.pos,t.length);return r(s)==r(t)?(n!==!1&&(this.pos+=t.length),!0):null}else{let r=this.string.slice(this.pos).match(t);return r&&r.index>0?null:(r&&n!==!1&&(this.pos+=r[0].length),r)}}current(){return this.string.slice(this.start,this.pos)}}function sLt(e){return{name:e.name||"",token:e.token,blankLine:e.blankLine||(()=>{}),startState:e.startState||(()=>!0),copyState:e.copyState||aLt,indent:e.indent||(()=>null),languageData:e.languageData||{},tokenTable:e.tokenTable||oW,mergeTokens:e.mergeTokens!==!1}}function aLt(e){if(typeof e!="object")return e;let t={};for(let n in e){let i=e[n];t[n]=i instanceof Array?i.slice():i}return t}const Are=new WeakMap;class sW extends Au{constructor(t){let n=JM(t.languageData),i=sLt(t),r,s=new class extends HM{createParse(o,l,c){return new lLt(r,o,l,c)}};super(n,s,[],t.name),this.topNode=dLt(n,this),r=this,this.streamParser=i,this.stateAfter=new li({perNode:!0}),this.tokenTable=t.tokenTable?new U4e(i.tokenTable):uLt}static define(t){return new sW(t)}getIndent(t){let n,{overrideIndentation:i}=t.options;i&&(n=Are.get(t.state),n!=null&&n1e4)return null;for(;s=i&&n+t.length<=r&&t.prop(e.stateAfter);if(s)return{state:e.streamParser.copyState(s),pos:n+t.length};for(let o=t.children.length-1;o>=0;o--){let l=t.children[o],c=n+t.positions[o],u=l instanceof Hi&&c=t.length)return t;!r&&n==0&&t.type==e.topNode&&(r=!0);for(let s=t.children.length-1;s>=0;s--){let o=t.positions[s],l=t.children[s],c;if(on&&aW(e,s.tree,0-s.offset,n,l),u;if(c&&c.pos<=i&&(u=$4e(e,s.tree,n+s.offset,c.pos+s.offset,!1)))return{state:c.state,tree:u}}return{state:e.streamParser.startState(r?xv(r):4),tree:Hi.empty}}let lLt=class{constructor(t,n,i,r){this.lang=t,this.input=n,this.fragments=i,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let s=vv.get(),o=r[0].from,{state:l,tree:c}=oLt(t,i,o,this.to,s==null?void 0:s.state);this.state=l,this.parsedPos=this.chunkStart=o+c.length;for(let u=0;uu.from<=s.viewport.from&&u.to>=s.viewport.from)&&(this.state=this.lang.streamParser.startState(xv(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let t=vv.get(),n=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(n,this.chunkStart+512);for(t&&(i=Math.min(i,t.viewport.to));this.parsedPos=n?this.finish():t&&this.parsedPos>=t.viewport.to?(t.skipUntilInView(this.parsedPos,n),this.finish()):null}stopAt(t){this.stoppedAt=t}lineAfter(t){let n=this.input.chunk(t);if(this.input.lineChunks)n==` +`){[t,n]=f1(this,t,n);let r="";for(let s=0,o=0;st&&s&&(r+=i),to&&(r+=l.sliceString(t-o,n-o,i)),o=c+1}return r}flatten(t){for(let n of this.children)n.flatten(t)}scanIdentical(t,n){if(!(t instanceof th))return 0;let i=0,[r,s,o,l]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;r+=n,s+=n){if(r==o||s==l)return i;let c=this.children[r],u=t.children[s];if(c!=u)return i+c.scanIdentical(u,n);i+=c.length+1}}static from(t,n=t.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let m of t)i+=m.lines;if(i<32){let m=[];for(let g of t)g.flatten(m);return new Sa(m,n)}let r=Math.max(32,i>>5),s=r<<1,o=r>>1,l=[],c=0,u=-1,d=[];function f(m){let g;if(m.lines>s&&m instanceof th)for(let b of m.children)f(b);else m.lines>o&&(c>o||!c)?(h(),l.push(m)):m instanceof Sa&&c&&(g=d[d.length-1])instanceof Sa&&m.lines+g.lines<=32?(c+=m.lines,u+=m.length+1,d[d.length-1]=new Sa(g.text.concat(m.text),g.length+1+m.length)):(c+m.lines>r&&h(),c+=m.lines,u+=m.length+1,d.push(m))}function h(){c!=0&&(l.push(d.length==1?d[0]:th.from(d,u)),u=-1,c=d.length=0)}for(let m of t)f(m);return h(),l.length==1?l[0]:new th(l,n)}}Or.empty=new Sa([""],0);function oIt(e){let t=-1;for(let n of e)t+=n.length+1;return t}function LN(e,t,n=0,i=1e9){for(let r=0,s=0,o=!0;s=n&&(c>i&&(l=l.slice(0,i-r)),r0?1:(t instanceof Sa?t.text.length:t.children.length)<<1]}nextInner(t,n){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],s=this.offsets[i],o=s>>1,l=r instanceof Sa?r.text.length:r.children.length;if(o==(n>0?l:0)){if(i==0)return this.done=!0,this.value="",this;n>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(n>0?0:1)){if(this.offsets[i]+=n,t==0)return this.lineBreak=!0,this.value=` +`,this;t--}else if(r instanceof Sa){let c=r.text[o+(n<0?-1:0)];if(this.offsets[i]+=n,c.length>Math.max(0,t))return this.value=t==0?c:n>0?c.slice(t):c.slice(0,c.length-t),this;t-=c.length}else{let c=r.children[o+(n<0?-1:0)];t>c.length?(t-=c.length,this.offsets[i]+=n):(n<0&&this.offsets[i]--,this.nodes.push(c),this.offsets.push(n>0?1:(c instanceof Sa?c.text.length:c.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class Z5e{constructor(t,n,i){this.value="",this.done=!1,this.cursor=new wE(t,n>i?-1:1),this.pos=n>i?t.length:0,this.from=Math.min(n,i),this.to=Math.max(n,i)}nextInner(t,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let i=n<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;let{value:r}=this.cursor.next(t);return this.pos+=(r.length+t)*n,this.value=r.length<=i?r:n<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class J5e{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:n,lineBreak:i,value:r}=this.inner.next(t);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Or.prototype[Symbol.iterator]=function(){return this.iter()},wE.prototype[Symbol.iterator]=Z5e.prototype[Symbol.iterator]=J5e.prototype[Symbol.iterator]=function(){return this});let lIt=class{constructor(t,n,i,r){this.from=t,this.to=n,this.number=i,this.text=r}get length(){return this.to-this.from}};function f1(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function Lo(e,t,n=!0,i=!0){return sIt(e,t,n,i)}function cIt(e){return e>=56320&&e<57344}function uIt(e){return e>=55296&&e<56320}function Ac(e,t){let n=e.charCodeAt(t);if(!uIt(n)||t+1==e.length)return n;let i=e.charCodeAt(t+1);return cIt(i)?(n-55296<<10)+(i-56320)+65536:n}function Lq(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function nh(e){return e<65536?1:2}const w9=/\r\n?|\n/;var al=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(al||(al={}));class xh{constructor(t){this.sections=t}get length(){let t=0;for(let n=0;nt)return s+(t-r);s+=l}else{if(i!=al.Simple&&u>=t&&(i==al.TrackDel&&rt||i==al.TrackBefore&&rt))return null;if(u>t||u==t&&n<0&&!l)return t==r||n<0?s:s+c;s+=c}r=u}if(t>r)throw new RangeError(`Position ${t} is out of range for changeset of length ${r}`);return s}touchesRange(t,n=t){for(let i=0,r=0;i=0&&r<=n&&l>=t)return rn?"cover":!0;r=l}return!1}toString(){let t="";for(let n=0;n=0?":"+r:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new xh(t)}static create(t){return new xh(t)}}class co extends xh{constructor(t,n){super(t),this.inserted=n}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return k9(this,(n,i,r,s,o)=>t=t.replace(r,r+(i-n),o),!1),t}mapDesc(t,n=!1){return O9(this,t,n,!0)}invert(t){let n=this.sections.slice(),i=[];for(let r=0,s=0;r=0){n[r]=l,n[r+1]=o;let c=r>>1;for(;i.length0&&vg(i,n,s.text),s.forward(d),l+=d}let u=t[o++];for(;l>1].toJSON()))}return t}static of(t,n,i){let r=[],s=[],o=0,l=null;function c(d=!1){if(!d&&!r.length)return;oh||f<0||h>n)throw new RangeError(`Invalid change range ${f} to ${h} (in doc of length ${n})`);let g=m?typeof m=="string"?Or.of(m.split(i||w9)):m:Or.empty,b=g.length;if(f==h&&b==0)return;fo&&El(r,f-o,-1),El(r,h-f,b),vg(s,r,g),o=h}}return u(t),c(!l),l}static empty(t){return new co(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],i=[];for(let r=0;rl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;i.length=0&&n<=0&&n==e[r+1]?e[r]+=t:r>=0&&t==0&&e[r]==0?e[r+1]+=n:i?(e[r]+=t,e[r+1]+=n):e.push(t,n)}function vg(e,t,n){if(n.length==0)return;let i=t.length-2>>1;if(i>1])),!(n||o==e.sections.length||e.sections[o+1]<0);)l=e.sections[o++],c=e.sections[o++];t(r,u,s,d,f),r=u,s=d}}}function O9(e,t,n,i=!1){let r=[],s=i?[]:null,o=new DC(e),l=new DC(t);for(let c=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let u=Math.min(o.len,l.len);El(r,u,-1),o.forward(u),l.forward(u)}else if(l.ins>=0&&(o.ins<0||c==o.i||o.off==0&&(l.len=0&&c=0){let u=0,d=o.len;for(;d;)if(l.ins==-1){let f=Math.min(d,l.len);u+=f,d-=f,l.forward(f)}else if(l.ins==0&&l.lenc||o.ins>=0&&o.len>c)&&(l||i.length>u),s.forward2(c),o.forward(c)}}}}class DC{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i>1;return n>=t.length?Or.empty:t[n]}textBit(t){let{inserted:n}=this.set,i=this.i-2>>1;return i>=n.length&&!t?Or.empty:n[i].slice(this.off,t==null?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class sg{constructor(t,n,i,r){this.from=t,this.to=n,this.flags=i,this.goalColumn=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let t=this.flags&7;return t==7?null:t}map(t,n=-1){let i,r;return this.empty?i=r=t.mapPos(this.from,n):(i=t.mapPos(this.from,1),r=t.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new sg(i,r,this.flags,this.goalColumn)}extend(t,n=t,i=0){if(t<=this.anchor&&n>=this.anchor)return pt.range(t,n,void 0,void 0,i);let r=Math.abs(t-this.anchor)>Math.abs(n-this.anchor)?t:n;return pt.range(this.anchor,r,void 0,void 0,i)}eq(t,n=!1){return this.anchor==t.anchor&&this.head==t.head&&this.goalColumn==t.goalColumn&&(!n||!this.empty||this.assoc==t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return pt.range(t.anchor,t.head)}static create(t,n,i,r){return new sg(t,n,i,r)}}class pt{constructor(t,n){this.ranges=t,this.mainIndex=n}map(t,n=-1){return t.empty?this:pt.create(this.ranges.map(i=>i.map(t,n)),this.mainIndex)}eq(t,n=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let i=0;it.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!="number"||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new pt(t.ranges.map(n=>sg.fromJSON(n)),t.main)}static single(t,n=t){return new pt([pt.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,r=0;rr.from-s.from),n=t.indexOf(i);for(let r=1;rs.head?pt.range(c,l):pt.range(l,c))}}return new pt(t,n)}}function t3e(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let $q=0;class pn{constructor(t,n,i,r,s){this.combine=t,this.compareInput=n,this.compare=i,this.isStatic=r,this.id=$q++,this.default=t([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(t={}){return new pn(t.combine||(n=>n),t.compareInput||((n,i)=>n===i),t.compare||(t.combine?(n,i)=>n===i:Fq),!!t.static,t.enables)}of(t){return new $N([],this,0,t)}compute(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new $N(t,this,1,n)}computeN(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new $N(t,this,2,n)}from(t,n){return n||(n=i=>i),this.compute([t],i=>n(i.field(t)))}}function Fq(e,t){return e==t||e.length==t.length&&e.every((n,i)=>n===t[i])}class $N{constructor(t,n,i,r){this.dependencies=t,this.facet=n,this.type=i,this.value=r,this.id=$q++}dynamicSlot(t){var n;let i=this.value,r=this.facet.compareInput,s=this.id,o=t[s]>>1,l=this.type==2,c=!1,u=!1,d=[];for(let f of this.dependencies)f=="doc"?c=!0:f=="selection"?u=!0:((n=t[f.id])!==null&&n!==void 0?n:1)&1||d.push(t[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,h){if(c&&h.docChanged||u&&(h.docChanged||h.selection)||S9(f,d)){let m=i(f);if(l?!Oie(m,f.values[o],r):!r(m,f.values[o]))return f.values[o]=m,1}return 0},reconfigure:(f,h)=>{let m,g=h.config.address[s];if(g!=null){let b=BI(h,g);if(this.dependencies.every(v=>v instanceof pn?h.facet(v)===f.facet(v):v instanceof pl?h.field(v,!1)==f.field(v,!1):!0)||(l?Oie(m=i(f),b,r):r(m=i(f),b)))return f.values[o]=b,0}else m=i(f);return f.values[o]=m,1}}}get extension(){return this}}function Oie(e,t,n){if(e.length!=t.length)return!1;for(let i=0;ie[c.id]),r=n.map(c=>c.type),s=i.filter(c=>!(c&1)),o=e[t.id]>>1;function l(c){let u=[];for(let d=0;di===r),t);return t.provide&&(n.provides=t.provide(n)),n}create(t){let n=t.facet(B_).find(i=>i.field==this);return((n==null?void 0:n.create)||this.createF)(t)}slot(t){let n=t[this.id]>>1;return{create:i=>(i.values[n]=this.create(i),1),update:(i,r)=>{let s=i.values[n],o=this.updateF(s,r);return this.compareF(s,o)?0:(i.values[n]=o,1)},reconfigure:(i,r)=>{let s=i.facet(B_),o=r.facet(B_),l;return(l=s.find(c=>c.field==this))&&l!=o.find(c=>c.field==this)?(i.values[n]=l.create(i),1):r.config.address[this.id]!=null?(i.values[n]=r.field(this),0):(i.values[n]=this.create(i),1)}}}init(t){return[this,B_.of({field:this,create:t})]}get extension(){return this}}const by={lowest:4,low:3,default:2,high:1,highest:0};function EO(e){return t=>new n3e(t,e)}const ym={highest:EO(by.highest),high:EO(by.high),default:EO(by.default),low:EO(by.low),lowest:EO(by.lowest)};class n3e{constructor(t,n){this.inner=t,this.prec=n}get extension(){return this}}class qM{of(t){return new E9(this,t)}reconfigure(t){return qM.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class E9{constructor(t,n){this.compartment=t,this.inner=n}get extension(){return this}}class FI{constructor(t,n,i,r,s,o){for(this.base=t,this.compartments=n,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(t,n,i){let r=[],s=Object.create(null),o=new Map;for(let h of fIt(t,n,o))h instanceof pl?r.push(h):(s[h.facet.id]||(s[h.facet.id]=[])).push(h);let l=Object.create(null),c=[],u=[];for(let h of r)l[h.id]=u.length<<1,u.push(m=>h.slot(m));let d=i==null?void 0:i.config.facets;for(let h in s){let m=s[h],g=m[0].facet,b=d&&d[h]||[];if(m.every(v=>v.type==0))if(l[g.id]=c.length<<1|1,Fq(b,m))c.push(i.facet(g));else{let v=g.combine(m.map(y=>y.value));c.push(i&&g.compare(v,i.facet(g))?i.facet(g):v)}else{for(let v of m)v.type==0?(l[v.id]=c.length<<1|1,c.push(v.value)):(l[v.id]=u.length<<1,u.push(y=>v.dynamicSlot(y)));l[g.id]=u.length<<1,u.push(v=>dIt(v,g,m))}}let f=u.map(h=>h(l));return new FI(t,o,f,l,c,s)}}function fIt(e,t,n){let i=[[],[],[],[],[]],r=new Map;function s(o,l){let c=r.get(o);if(c!=null){if(c<=l)return;let u=i[c].indexOf(o);u>-1&&i[c].splice(u,1),o instanceof E9&&n.delete(o.compartment)}if(r.set(o,l),Array.isArray(o))for(let u of o)s(u,l);else if(o instanceof E9){if(n.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let u=t.get(o.compartment)||o.inner;n.set(o.compartment,u),s(u,l)}else if(o instanceof n3e)s(o.inner,o.prec);else if(o instanceof pl)i[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof $N)i[l].push(o),o.facet.extensions&&s(o.facet.extensions,by.default);else{let u=o.extension;if(!u)throw new Error(`Unrecognized extension value in extension set (${o}).`);if(u==o)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(u,l)}}return s(e,by.default),i.reduce((o,l)=>o.concat(l))}function kE(e,t){if(t&1)return 2;let n=t>>1,i=e.status[n];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;e.status[n]=4;let r=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|r}function BI(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}const i3e=pn.define(),C9=pn.define({combine:e=>e.some(t=>t),static:!0}),r3e=pn.define({combine:e=>e.length?e[0]:void 0,static:!0}),s3e=pn.define(),a3e=pn.define(),o3e=pn.define(),l3e=pn.define({combine:e=>e.length?e[0]:!1});class Dh{constructor(t,n){this.type=t,this.value=n}static define(){return new hIt}}class hIt{of(t){return new Dh(this,t)}}class pIt{constructor(t){this.map=t}of(t){return new hi(this,t)}}class hi{constructor(t,n){this.type=t,this.value=n}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new hi(this.type,n)}is(t){return this.type==t}static define(t={}){return new pIt(t.map||(n=>n))}static mapEffects(t,n){if(!t.length)return t;let i=[];for(let r of t){let s=r.map(n);s&&i.push(s)}return i}}hi.reconfigure=hi.define();hi.appendConfig=hi.define();class Ya{constructor(t,n,i,r,s,o){this.startState=t,this.changes=n,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,i&&t3e(i,n.newLength),s.some(l=>l.type==Ya.time)||(this.annotations=s.concat(Ya.time.of(Date.now())))}static create(t,n,i,r,s,o){return new Ya(t,n,i,r,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let n of this.annotations)if(n.type==t)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(Ya.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]=="."))}}Ya.time=Dh.define();Ya.userEvent=Dh.define();Ya.addToHistory=Dh.define();Ya.remote=Dh.define();function mIt(e,t){let n=[];for(let i=0,r=0;;){let s,o;if(i=e[i]))s=e[i++],o=e[i++];else if(r=0;r--){let s=i[r](e);s instanceof Ya?e=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Ya?e=s[0]:e=u3e(t,yw(s),!1)}return e}function bIt(e){let t=e.startState,n=t.facet(o3e),i=e;for(let r=n.length-1;r>=0;r--){let s=n[r](e);s&&Object.keys(s).length&&(i=c3e(i,A9(t,s,e.changes.newLength),!0))}return i==e?e:Ya.create(t,e.changes,e.selection,i.effects,i.annotations,i.scrollIntoView)}const yIt=[];function yw(e){return e==null?yIt:Array.isArray(e)?e:[e]}var Qs=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(Qs||(Qs={}));const vIt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let T9;try{T9=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function xIt(e){if(T9)return T9.test(e);for(let t=0;t"€"&&(n.toUpperCase()!=n.toLowerCase()||vIt.test(n)))return!0}return!1}function wIt(e){return t=>{if(!/\S/.test(t))return Qs.Space;if(xIt(t))return Qs.Word;for(let n=0;n-1)return Qs.Word;return Qs.Other}}class sr{constructor(t,n,i,r,s,o){this.config=t,this.doc=n,this.selection=i,this.values=r,this.status=t.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;lr.set(u,c)),n=null),r.set(l.value.compartment,l.value.extension)):l.is(hi.reconfigure)?(n=null,i=l.value):l.is(hi.appendConfig)&&(n=null,i=yw(i).concat(l.value));let s;n?s=t.startState.values.slice():(n=FI.resolve(i,r,this),s=new sr(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(c,u)=>u.reconfigure(c,this),null).values);let o=t.startState.facet(C9)?t.newSelection:t.newSelection.asSingle();new sr(n,t.newDoc,o,s,(l,c)=>c.update(l,t),t)}replaceSelection(t){return typeof t=="string"&&(t=this.toText(t)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:t},range:pt.cursor(n.from+t.length)}))}changeByRange(t){let n=this.selection,i=t(n.ranges[0]),r=this.changes(i.changes),s=[i.range],o=yw(i.effects);for(let l=1;lo.spec.fromJSON(l,c)))}}return sr.create({doc:t.doc,selection:pt.fromJSON(t.selection),extensions:n.extensions?r.concat([n.extensions]):r})}static create(t={}){let n=FI.resolve(t.extensions||[],new Map),i=t.doc instanceof Or?t.doc:Or.of((t.doc||"").split(n.staticFacet(sr.lineSeparator)||w9)),r=t.selection?t.selection instanceof pt?t.selection:pt.single(t.selection.anchor,t.selection.head):pt.single(0);return t3e(r,i.length),n.staticFacet(C9)||(r=r.asSingle()),new sr(n,i,r,n.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(sr.tabSize)}get lineBreak(){return this.facet(sr.lineSeparator)||` +`}get readOnly(){return this.facet(l3e)}phrase(t,...n){for(let i of this.facet(sr.phrases))if(Object.prototype.hasOwnProperty.call(i,t)){t=i[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(i,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>n.length?i:n[s-1]})),t}languageDataAt(t,n,i=-1){let r=[];for(let s of this.facet(i3e))for(let o of s(this,n,i))Object.prototype.hasOwnProperty.call(o,t)&&r.push(o[t]);return r}charCategorizer(t){let n=this.languageDataAt("wordChars",t);return wIt(n.length?n[0]:"")}wordAt(t){let{text:n,from:i,length:r}=this.doc.lineAt(t),s=this.charCategorizer(t),o=t-i,l=t-i;for(;o>0;){let c=Lo(n,o,!1);if(s(n.slice(c,o))!=Qs.Word)break;o=c}for(;le.length?e[0]:4});sr.lineSeparator=r3e;sr.readOnly=l3e;sr.phrases=pn.define({compare(e,t){let n=Object.keys(e),i=Object.keys(t);return n.length==i.length&&n.every(r=>e[r]==t[r])}});sr.languageData=i3e;sr.changeFilter=s3e;sr.transactionFilter=a3e;sr.transactionExtender=o3e;qM.reconfigure=hi.define();function Mh(e,t,n={}){let i={};for(let r of e)for(let s of Object.keys(r)){let o=r[s],l=i[s];if(l===void 0)i[s]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(n,s))i[s]=n[s](l,o);else throw new Error("Config merge conflict for field "+s)}for(let r in t)i[r]===void 0&&(i[r]=t[r]);return i}class ub{eq(t){return this==t}range(t,n=t){return MC.create(t,n,this)}}ub.prototype.startSide=ub.prototype.endSide=0;ub.prototype.point=!1;ub.prototype.mapMode=al.TrackDel;function Bq(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}class MC{constructor(t,n,i){this.from=t,this.to=n,this.value=i}static create(t,n,i){return new MC(t,n,i)}}function _9(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class Uq{constructor(t,n,i,r){this.from=t,this.to=n,this.value=i,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(t,n,i,r=0){let s=i?this.to:this.from;for(let o=r,l=s.length;;){if(o==l)return o;let c=o+l>>1,u=s[c]-t||(i?this.value[c].endSide:this.value[c].startSide)-n;if(c==o)return u>=0?o:l;u>=0?l=c:o=c+1}}between(t,n,i,r){for(let s=this.findIndex(n,-1e9,!0),o=this.findIndex(i,1e9,!1,s);sm||h==m&&u.startSide>0&&u.endSide<=0)continue;(m-h||u.endSide-u.startSide)<0||(o<0&&(o=h),u.point&&(l=Math.max(l,m-h)),i.push(u),r.push(h-o),s.push(m-o))}return{mapped:i.length?new Uq(r,s,i,l):null,pos:o}}}class Yi{constructor(t,n,i,r){this.chunkPos=t,this.chunk=n,this.nextLayer=i,this.maxPoint=r}static create(t,n,i,r){return new Yi(t,n,i,r)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let n of this.chunk)t+=n.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:n=[],sort:i=!1,filterFrom:r=0,filterTo:s=this.length}=t,o=t.filter;if(n.length==0&&!o)return this;if(i&&(n=n.slice().sort(_9)),this.isEmpty)return n.length?Yi.of(n):this;let l=new d3e(this,null,-1).goto(0),c=0,u=[],d=new im;for(;l.value||c=0){let f=n[c++];d.addInner(f.from,f.to,f.value)||u.push(f)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||sl.to||s=s&&t<=s+o.length&&o.between(s,t-s,n-s,i)===!1)return}this.nextLayer.between(t,n,i)}}iter(t=0){return LC.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,n=0){return LC.from(t).goto(n)}static compare(t,n,i,r,s=-1){let o=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),l=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),c=Sie(o,l,i),u=new CO(o,c,s),d=new CO(l,c,s);i.iterGaps((f,h,m)=>Eie(u,f,d,h,m,r)),i.empty&&i.length==0&&Eie(u,0,d,0,0,r)}static eq(t,n,i=0,r){r==null&&(r=999999999);let s=t.filter(d=>!d.isEmpty&&n.indexOf(d)<0),o=n.filter(d=>!d.isEmpty&&t.indexOf(d)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let l=Sie(s,o),c=new CO(s,l,0).goto(i),u=new CO(o,l,0).goto(i);for(;;){if(c.to!=u.to||!j9(c.active,u.active)||c.point&&(!u.point||!Bq(c.point,u.point)))return!1;if(c.to>r)return!0;c.next(),u.next()}}static spans(t,n,i,r,s=-1){let o=new CO(t,null,s).goto(n),l=n,c=o.openStart;for(;;){let u=Math.min(o.to,i);if(o.point){let d=o.activeForPoint(o.to),f=o.pointFroml&&(r.span(l,u,o.active,c),c=o.openEnd(u));if(o.to>i)return c+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(t,n=!1){let i=new im;for(let r of t instanceof MC?[t]:n?kIt(t):t)i.add(r.from,r.to,r.value);return i.finish()}static join(t){if(!t.length)return Yi.empty;let n=t[t.length-1];for(let i=t.length-2;i>=0;i--)for(let r=t[i];r!=Yi.empty;r=r.nextLayer)n=new Yi(r.chunkPos,r.chunk,n,Math.max(r.maxPoint,n.maxPoint));return n}}Yi.empty=new Yi([],[],null,-1);function kIt(e){if(e.length>1)for(let t=e[0],n=1;n0)return e.slice().sort(_9);t=i}return e}Yi.empty.nextLayer=Yi.empty;class im{finishChunk(t){this.chunks.push(new Uq(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,n,i){this.addInner(t,n,i)||(this.nextLayer||(this.nextLayer=new im)).add(t,n,i)}addInner(t,n,i){let r=t-this.lastTo||i.startSide-this.last.endSide;if(r<=0&&(t-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(n-this.chunkStart),this.last=i,this.lastFrom=t,this.lastTo=n,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,n-t)),!0)}addChunk(t,n){if((t-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(t);let i=n.value.length-1;return this.last=n.value[i],this.lastFrom=n.from[i]+t,this.lastTo=n.to[i]+t,!0}finish(){return this.finishInner(Yi.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let n=Yi.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,n}}function Sie(e,t,n){let i=new Map;for(let s of e)for(let o=0;o=this.minPoint)break}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&r.push(new d3e(o,n,i,s));return r.length==1?r[0]:new LC(r)}get startSide(){return this.value?this.value.startSide:0}goto(t,n=-1e9){for(let i of this.heap)i.goto(t,n);for(let i=this.heap.length>>1;i>=0;i--)K4(this.heap,i);return this.next(),this}forward(t,n){for(let i of this.heap)i.forward(t,n);for(let i=this.heap.length>>1;i>=0;i--)K4(this.heap,i);(this.to-t||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),K4(this.heap,0)}}}function K4(e,t){for(let n=e[t];;){let i=(t<<1)+1;if(i>=e.length)break;let r=e[i];if(i+1=0&&(r=e[i+1],i++),n.compare(r)<0)break;e[i]=n,e[t]=r,t=i}}class CO{constructor(t,n,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=LC.from(t,n,i)}goto(t,n=-1e9){return this.cursor.goto(t,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=n,this.openStart=-1,this.next(),this}forward(t,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(t,n)}removeActive(t){U_(this.active,t),U_(this.activeTo,t),U_(this.activeRank,t),this.minActive=Cie(this.active,this.activeTo)}addActive(t){let n=0,{value:i,to:r,rank:s}=this.cursor;for(;n0;)n++;Q_(this.active,n,i),Q_(this.activeTo,n,r),Q_(this.activeRank,n,s),t&&Q_(t,n,this.cursor.from),this.minActive=Cie(this.active,this.activeTo)}next(){let t=this.to,n=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>t){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&U_(i,r)}else if(this.cursor.value)if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(i),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from=0&&i[r]=0&&!(this.activeRank[i]t||this.activeTo[i]==t&&this.active[i].endSide>=this.point.endSide)&&n.push(this.active[i]);return n.reverse()}openEnd(t){let n=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>t;i--)n++;return n}}function Eie(e,t,n,i,r,s){e.goto(t),n.goto(i);let o=i+r,l=i,c=i-t,u=!!s.boundChange;for(let d=!1;;){let f=e.to+c-n.to,h=f||e.endSide-n.endSide,m=h<0?e.to+c:n.to,g=Math.min(m,o);if(e.point||n.point?(e.point&&n.point&&Bq(e.point,n.point)&&j9(e.activeForPoint(e.to),n.activeForPoint(n.to))||s.comparePoint(l,g,e.point,n.point),d=!1):(d&&s.boundChange(l),g>l&&!j9(e.active,n.active)&&s.compareRange(l,g,e.active,n.active),u&&go)break;l=m,h<=0&&e.next(),h>=0&&n.next()}}function j9(e,t){if(e.length!=t.length)return!1;for(let n=0;n=t;i--)e[i+1]=e[i];e[t]=n}function Cie(e,t){let n=-1,i=1e9;for(let r=0;r=t)return r;if(r==e.length)break;s+=e.charCodeAt(r)==9?n-s%n:1,r=Lo(e,r)}return i===!0?-1:e.length}const R9="ͼ",Aie=typeof Symbol>"u"?"__"+R9:Symbol.for(R9),I9=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Tie=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class db{constructor(t,n){this.rules=[];let{finish:i}=n||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,l,c,u){let d=[],f=/^@(\w+)\b/.exec(o[0]),h=f&&f[1]=="keyframes";if(f&&l==null)return c.push(o[0]+";");for(let m in l){let g=l[m];if(/&/.test(m))s(m.split(/,\s*/).map(b=>o.map(v=>b.replace(/&/,v))).reduce((b,v)=>b.concat(v)),g,c);else if(g&&typeof g=="object"){if(!f)throw new RangeError("The value of a property ("+m+") should be a primitive value.");s(r(m),g,d,h)}else g!=null&&d.push(m.replace(/_.*/,"").replace(/[A-Z]/g,b=>"-"+b.toLowerCase())+": "+g+";")}(d.length||h)&&c.push((i&&!f&&!u?o.map(i):o).join(", ")+" {"+d.join(" ")+"}")}for(let o in t)s(r(o),t[o],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let t=Tie[Aie]||1;return Tie[Aie]=t+1,R9+t.toString(36)}static mount(t,n,i){let r=t[I9],s=i&&i.nonce;r?s&&r.setNonce(s):r=new OIt(t,s),r.mount(Array.isArray(n)?n:[n],t)}}let _ie=new Map;class OIt{constructor(t,n){let i=t.ownerDocument||t,r=i.defaultView;if(!t.head&&t.adoptedStyleSheets&&r.CSSStyleSheet){let s=_ie.get(i);if(s)return t[I9]=s;this.sheet=new r.CSSStyleSheet,_ie.set(i,this)}else this.styleTag=i.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],t[I9]=this}mount(t,n){let i=this.sheet,r=0,s=0;for(let o=0;o-1&&(this.modules.splice(c,1),s--,c=-1),c==-1){if(this.modules.splice(s++,0,l),i)for(let u=0;u",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},SIt=typeof navigator<"u"&&/Mac/.test(navigator.platform),EIt=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var il=0;il<10;il++)fb[48+il]=fb[96+il]=String(il);for(var il=1;il<=24;il++)fb[il+111]="F"+il;for(var il=65;il<=90;il++)fb[il]=String.fromCharCode(il+32),$C[il]=String.fromCharCode(il);for(var G4 in fb)$C.hasOwnProperty(G4)||($C[G4]=fb[G4]);function CIt(e){var t=SIt&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||EIt&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?$C:fb)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function Yr(){var e=arguments[0];typeof e=="string"&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i];typeof r=="string"?e.setAttribute(i,r):r!=null&&(e[i]=r)}t++}for(;t2);var dn={mac:Rie||/Mac/.test(Kl.platform),windows:/Win/.test(Kl.platform),linux:/Linux|X11/.test(Kl.platform),ie:WM,ie_version:h3e?P9.documentMode||6:M9?+M9[1]:D9?+D9[1]:0,gecko:jie,gecko_version:jie?+(/Firefox\/(\d+)/.exec(Kl.userAgent)||[0,0])[1]:0,chrome:!!X4,chrome_version:X4?+X4[1]:0,ios:Rie,android:/Android\b/.test(Kl.userAgent),webkit:Nie,webkit_version:Nie?+(/\bAppleWebKit\/(\d+)/.exec(Kl.userAgent)||[0,0])[1]:0,safari:L9,safari_version:L9?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Kl.userAgent)||[0,0])[1]:0,tabSize:P9.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Qq(e,t){for(let n in e)n=="class"&&t.class?t.class+=" "+e.class:n=="style"&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}const UI=Object.create(null);function zq(e,t,n){if(e==t)return!0;e||(e=UI),t||(t=UI);let i=Object.keys(e),r=Object.keys(t);if(i.length-0!=r.length-0)return!1;for(let s of i)if(s!=n&&(r.indexOf(s)==-1||e[s]!==t[s]))return!1;return!0}function AIt(e,t){for(let n=e.attributes.length-1;n>=0;n--){let i=e.attributes[n].name;t[i]==null&&e.removeAttribute(i)}for(let n in t){let i=t[n];n=="style"?e.style.cssText=i:e.getAttribute(n)!=i&&e.setAttribute(n,i)}}function Iie(e,t,n){let i=!1;if(t)for(let r in t)n&&r in n||(i=!0,r=="style"?e.style.cssText="":e.removeAttribute(r));if(n)for(let r in n)t&&t[r]==n[r]||(i=!0,r=="style"?e.style.cssText=n[r]:e.setAttribute(r,n[r]));return i}function TIt(e){let t=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new gv(t,n,n,i,t.widget||null,!1)}static replace(t){let n=!!t.block,i,r;if(t.isBlockGap)i=-5e8,r=4e8;else{let{start:s,end:o}=p3e(t,n);i=(s?n?-3e8:-1:5e8)-1,r=(o?n?2e8:1:-6e8)+1}return new gv(t,i,r,n,t.widget||null,!0)}static line(t){return new RT(t)}static set(t,n=!1){return Yi.of(t,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}$n.none=Yi.empty;class NT extends $n{constructor(t){let{start:n,end:i}=p3e(t);super(n?-1:5e8,i?1:-6e8,null,t),this.tagName=t.tagName||"span",this.attrs=t.class&&t.attributes?Qq(t.attributes,{class:t.class}):t.class?{class:t.class}:t.attributes||UI}eq(t){return this==t||t instanceof NT&&this.tagName==t.tagName&&zq(this.attrs,t.attrs)}range(t,n=t){if(t>=n)throw new RangeError("Mark decorations may not be empty");return super.range(t,n)}}NT.prototype.point=!1;class RT extends $n{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof RT&&this.spec.class==t.spec.class&&zq(this.spec.attributes,t.spec.attributes)}range(t,n=t){if(n!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,n)}}RT.prototype.mapMode=al.TrackBefore;RT.prototype.point=!0;class gv extends $n{constructor(t,n,i,r,s,o){super(n,i,s,t),this.block=r,this.isReplace=o,this.mapMode=r?n<=0?al.TrackBefore:al.TrackAfter:al.TrackDel}get type(){return this.startSide!=this.endSide?ul.WidgetRange:this.startSide<=0?ul.WidgetBefore:ul.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof gv&&_It(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,n=t){if(this.isReplace&&(t>n||t==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,n)}}gv.prototype.point=!0;function p3e(e,t=!1){let{inclusiveStart:n,inclusiveEnd:i}=e;return n==null&&(n=e.inclusive),i==null&&(i=e.inclusive),{start:n??t,end:i??t}}function _It(e,t){return e==t||!!(e&&t&&e.compare(t))}function vw(e,t,n,i=0){let r=n.length-1;r>=0&&n[r]+i>=e?n[r]=Math.max(n[r],t):n.push(e,t)}class FC extends ub{constructor(t,n,i){super(),this.tagName=t,this.attributes=n,this.rank=i}eq(t){return t==this||t instanceof FC&&this.tagName==t.tagName&&zq(this.attributes,t.attributes)}static create(t){return new FC(t.tagName,t.attributes||UI,t.rank==null?50:Math.max(0,Math.min(t.rank,100)))}static set(t,n=!1){return Yi.of(t,n)}}FC.prototype.startSide=FC.prototype.endSide=-1;function BC(e){let t;return e.nodeType==11?t=e.getSelection?e:e.ownerDocument:t=e,t.getSelection()}function $9(e,t){return t?e==t||e.contains(t.nodeType!=1?t.parentNode:t):!1}function OE(e,t){if(!t.anchorNode)return!1;try{return $9(e,t.anchorNode)}catch{return!1}}function SE(e){return e.nodeType==3?QC(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function EE(e,t,n,i){return n?Pie(e,t,n,i,-1)||Pie(e,t,n,i,1):!1}function hb(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function QI(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function Pie(e,t,n,i,r){for(;;){if(e==n&&t==i)return!0;if(t==(r<0?0:rm(e))){if(e.nodeName=="DIV")return!1;let s=e.parentNode;if(!s||s.nodeType!=1)return!1;t=hb(e)+(r<0?0:1),e=s}else if(e.nodeType==1){if(e=e.childNodes[t+(r<0?-1:0)],e.nodeType==1&&e.contentEditable=="false")return!1;t=r<0?rm(e):0}else return!1}}function rm(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function UC(e,t){let{left:n,right:i}=e;if(n==i)return e;let r=t?n:i;return{left:r,right:r,top:e.top,bottom:e.bottom}}function jIt(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function m3e(e,t){let n=t.width/e.offsetWidth,i=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(t.height-e.offsetHeight)<1)&&(i=1),{scaleX:n,scaleY:i}}function NIt(e,t,n,i,r,s,o,l){let c=e.ownerDocument,u=c.defaultView||window;for(let d=e,f=!1;d&&!f;)if(d.nodeType==1){let h,m=d==c.body,g=1,b=1;if(m)h=jIt(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(d).position)&&(f=!0),d.scrollHeight<=d.clientHeight&&d.scrollWidth<=d.clientWidth){d=d.assignedSlot||d.parentNode;continue}let w=d.getBoundingClientRect();({scaleX:g,scaleY:b}=m3e(d,w)),h={left:w.left,right:w.left+d.clientWidth*g,top:w.top,bottom:w.top+d.clientHeight*b}}let v=0,y=0;if(r=="nearest")t.top0&&t.bottom>h.bottom+y&&(y=t.bottom-h.bottom+o)):t.bottom>h.bottom-o&&(y=t.bottom-h.bottom+o,n<0&&t.top-y0&&t.right>h.right+v&&(v=t.right-h.right+s)):t.right>h.right-s&&(v=t.right-h.right+s,n<0&&t.lefth.bottom||t.lefth.right)&&(t={left:Math.max(t.left,h.left),right:Math.min(t.right,h.right),top:Math.max(t.top,h.top),bottom:Math.min(t.bottom,h.bottom)}),d=d.assignedSlot||d.parentNode}else if(d.nodeType==11)d=d.host;else break}function g3e(e,t=!0){let n=e.ownerDocument,i=null,r=null;for(let s=e.parentNode;s&&!(s==n.body||(!t||i)&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),t&&!i&&s.scrollWidth>s.clientWidth&&(i=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:i,y:r}}class RIt{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:n,focusNode:i}=t;this.set(n,Math.min(t.anchorOffset,n?rm(n):0),i,Math.min(t.focusOffset,i?rm(i):0))}set(t,n,i,r){this.anchorNode=t,this.anchorOffset=n,this.focusNode=i,this.focusOffset=r}}let hy=null;dn.safari&&dn.safari_version>=26&&(hy=!1);function b3e(e){if(e.setActive)return e.setActive();if(hy)return e.focus(hy);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(hy==null?{get preventScroll(){return hy={preventScroll:!0},!0}}:void 0),!hy){hy=!1;for(let n=0;nMath.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function v3e(e,t){for(let n=e,i=t;;){if(n.nodeType==3&&i>0)return{node:n,offset:i};if(n.nodeType==1&&i>0){if(n.contentEditable=="false")return null;n=n.childNodes[i-1],i=rm(n)}else if(n.parentNode&&!QI(n))i=hb(n),n=n.parentNode;else return null}}function x3e(e,t){for(let n=e,i=t;;){if(n.nodeType==3&&i=n){if(l.level==i)return o;(s<0||(r!=0?r<0?l.fromn:t[s].level>l.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function O3e(e,t){if(e.length!=t.length)return!1;for(let n=0;n=0;b-=3)if(Qf[b+1]==-m){let v=Qf[b+2],y=v&2?r:v&4?v&1?s:r:0;y&&(ls[f]=ls[Qf[b]]=y),l=b;break}}else{if(Qf.length==189)break;Qf[l++]=f,Qf[l++]=h,Qf[l++]=c}else if((g=ls[f])==2||g==1){let b=g==r;c=b?0:1;for(let v=l-3;v>=0;v-=3){let y=Qf[v+2];if(y&2)break;if(b)Qf[v+2]|=2;else{if(y&4)break;Qf[v+2]|=4}}}}}function BIt(e,t,n,i){for(let r=0,s=i;r<=n.length;r++){let o=r?n[r-1].to:e,l=rc;)g==v&&(g=n[--b].from,v=b?n[b-1].to:e),ls[--g]=m;c=d}else s=u,c++}}}function B9(e,t,n,i,r,s,o){let l=i%2?2:1;if(i%2==r%2)for(let c=t,u=0;cc&&o.push(new uh(c,b.from,m));let v=b.direction==bv!=!(m%2);U9(e,v?i+1:i,r,b.inner,b.from,b.to,o),c=b.to}g=b.to}else{if(g==n||(d?ls[g]!=l:ls[g]==l))break;g++}h?B9(e,c,g,i+1,r,h,o):ct;){let d=!0,f=!1;if(!u||c>s[u-1].to){let b=ls[c-1];b!=l&&(d=!1,f=b==16)}let h=!d&&l==1?[]:null,m=d?i:i+1,g=c;e:for(;;)if(u&&g==s[u-1].to){if(f)break e;let b=s[--u];if(!d)for(let v=b.from,y=u;;){if(v==t)break e;if(y&&s[y-1].to==v)v=s[--y].from;else{if(ls[v-1]==l)break e;break}}if(h)h.push(b);else{b.tols.length;)ls[ls.length]=256;let i=[],r=t==bv?0:1;return U9(e,r,r,n,0,e.length,i),i}function S3e(e){return[new uh(0,e,0)]}let E3e="";function QIt(e,t,n,i,r){var s;let o=i.head-e.from,l=uh.find(t,o,(s=i.bidiLevel)!==null&&s!==void 0?s:-1,i.assoc),c=t[l],u=c.side(r,n);if(o==u){let h=l+=r?1:-1;if(h<0||h>=t.length)return null;c=t[l=h],o=c.side(!r,n),u=c.side(r,n)}let d=Lo(e.text,o,c.forward(r,n));(dc.to)&&(d=u),E3e=e.text.slice(Math.min(o,d),Math.max(o,d));let f=l==(r?t.length-1:0)?null:t[l+(r?1:-1)];return f&&d==u&&f.level+(r?0:1)e.some(t=>t)}),I3e=pn.define({combine:e=>e.some(t=>t)}),P3e=pn.define();class ww{constructor(t,n,i,r,s,o=!1){this.range=t,this.y=n,this.x=i,this.yMargin=r,this.xMargin=s,this.isSnapshot=o}map(t){return t.empty?this:new ww(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new ww(pt.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const z_=hi.define({map:(e,t)=>e.map(t)}),D3e=hi.define();function Rc(e,t,n){let i=e.facet(_3e);i.length?i[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+":",t):console.error(t))}const kp=pn.define({combine:e=>e.length?e[0]:!0});let VIt=0;const Ux=pn.define({combine(e){return e.filter((t,n)=>{for(let i=0;i{let c=[];return o&&c.push(KM.of(u=>{let d=u.plugin(l);return d?o(d):$n.none})),s&&c.push(s(l)),c})}static fromClass(t,n){return ba.define((i,r)=>new t(i,r),n)}}class Y4{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(t){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(i){if(Rc(n.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(t,this.spec.arg)}catch(n){Rc(t.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(i){Rc(t.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const M3e=pn.define(),Wq=pn.define(),KM=pn.define(),L3e=pn.define(),Kq=pn.define(),IT=pn.define(),$3e=pn.define();function Mie(e,t){let n=e.state.facet($3e);if(!n.length)return n;let i=n.map(s=>s instanceof Function?s(e):s),r=[];return Yi.spans(i,t.from,t.to,{point(){},span(s,o,l,c){let u=s-t.from,d=o-t.from,f=r;for(let h=l.length-1;h>=0;h--,c--){let m=l[h].spec.bidiIsolate,g;if(m==null&&(m=zIt(t.text,u,d)),c>0&&f.length&&(g=f[f.length-1]).to==u&&g.direction==m)g.to=d,f=g.inner;else{let b={from:u,to:d,direction:m,inner:[]};f.push(b),f=b.inner}}}}),r}const F3e=pn.define();function Gq(e){let t=0,n=0,i=0,r=0;for(let s of e.state.facet(F3e)){let o=s(e);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(r=Math.max(r,o.bottom)))}return{left:t,right:n,top:i,bottom:r}}const xS=pn.define();class bd{constructor(t,n,i,r){this.fromA=t,this.toA=n,this.fromB=i,this.toB=r}join(t){return new bd(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let n=t.length,i=this;for(;n>0;n--){let r=t[n-1];if(!(r.fromA>i.toA)){if(r.toAr.push(new bd(s,o,l,c))),this.changedRanges=r}static create(t,n,i){return new zI(t,n,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const HIt=[];class ga{constructor(t,n,i=0){this.dom=t,this.length=n,this.flags=i,this.parent=null,t.cmTile=this}get breakAfter(){return this.flags&1}get children(){return HIt}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(t){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&AIt(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(t){this.dom=t,t.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(t,n=this.posAtStart){let i=n;for(let r of this.children){if(r==t)return i;i+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(t){return this.posBefore(t)+t.length}covers(t){return!0}coordsIn(t,n,i){return null}domPosFor(t,n){let i=hb(this.dom),r=this.length?t>0:n>0;return new of(this.parent.dom,i+(r?1:0),t==0||t==this.length)}markDirty(t){this.flags&=-3,t&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let t=this;t;t=t.parent)if(t instanceof XM)return t;return null}static get(t){return t.cmTile}}class GM extends ga{constructor(t){super(t,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(t){this.children.push(t),t.parent=this}sync(t){if(this.flags&2)return;super.sync(t);let n=this.dom,i=null,r,s=(t==null?void 0:t.node)==n?t:null,o=0;for(let l of this.children){if(l.sync(t),o+=l.length+l.breakAfter,r=i?i.nextSibling:n.firstChild,s&&r!=l.dom&&(s.written=!0),l.dom.parentNode==n)for(;r&&r!=l.dom;)r=Lie(r);else n.insertBefore(l.dom,r);i=l.dom}for(r=i?i.nextSibling:n.firstChild,s&&r&&(s.written=!0);r;)r=Lie(r);this.length=o}}function Lie(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class XM extends GM{constructor(t,n){super(n),this.view=t}owns(t){for(;t;t=t.parent)if(t==this)return!0;return!1}isBlock(){return!0}nearest(t){for(;;){if(!t)return null;let n=ga.get(t);if(n&&this.owns(n))return n;t=t.parentNode}}blockTiles(t){for(let n=[],i=this,r=0,s=0;;)if(r==i.children.length){if(!n.length)return;i=i.parent,i.breakAfter&&s++,r=n.pop()}else{let o=i.children[r++];if(o instanceof zp)n.push(r),i=o,r=0;else{let l=s+o.length,c=t(o,s);if(c!==void 0)return c;s=l+o.breakAfter}}}resolveBlock(t,n){let i,r=-1,s,o=-1;if(this.blockTiles((l,c)=>{let u=c+l.length;if(t>=c&&t<=u){if(l.isWidget()&&n>=-1&&n<=1){if(l.flags&32)return!0;l.flags&16&&(i=void 0)}(ct||t==c&&(n>1?l.length:l.covers(-1)))&&(!s||!l.isWidget()&&s.isWidget())&&(s=l,o=t-c)}}),!i&&!s)throw new Error("No tile at position "+t);return i&&n<0||!s?{tile:i,offset:r}:{tile:s,offset:o}}}class zp extends GM{constructor(t,n){super(t),this.wrapper=n}isBlock(){return!0}covers(t){return this.children.length?t<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,n){let i=new zp(n||document.createElement(t.tagName),t);return n||(i.flags|=4),i}}class h1 extends GM{constructor(t,n){super(t),this.attrs=n}isLine(){return!0}static start(t,n,i){let r=new h1(n||document.createElement("div"),t);return(!n||!i)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(t,n,i){let r=null,s=-1,o=null,l=-1;function c(d,f){for(let h=0,m=0;h=f&&(g.isComposite()?c(g,f-m):(!o||o.isHidden&&(n>0&&!(o.flags&32)||i&&WIt(o,g)))&&(b>f||g.flags&32)?(o=g,l=f-m):(mr&&(t=r);let s=t,o=t,l=0;t==0&&n<0||t==r&&n>=0?dn.chrome||dn.gecko||(t?(s--,l=1):o=0)?0:c.length-1];return dn.safari&&!l&&u.width==0&&(u=Array.prototype.find.call(c,d=>d.width)||u),i==null?u:UC(u,(l?l>0:n<0)==i)}static of(t,n){let i=new jy(n||document.createTextNode(t),t);return n||(i.flags|=2),i}}class yv extends ga{constructor(t,n,i,r){super(t,n,r),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(t){return this.flags&48?!1:(this.flags&(t<0?64:128))>0}coordsIn(t,n){return this.coordsInWidget(t,n,!1)}coordsInWidget(t,n,i){let r=this.widget.coordsAt(this.dom,t,n);if(r)return r;if(i)return UC(this.dom.getBoundingClientRect(),this.length?t==0:n<=0);{let s=this.dom.getClientRects(),o=null;if(!s.length)return null;let l=this.flags&16?!0:this.flags&32?!1:t>0;for(let c=l?s.length-1:0;o=s[c],!(t>0?c==0:c==s.length-1||o.top0==i)}}class KIt{constructor(t){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=t}advance(t,n,i){let{tile:r,index:s,beforeBreak:o,parents:l}=this;for(;t||n>0;)if(r.isComposite())if(o){if(!t)break;i&&i.break(),t--,o=!1}else if(s==r.children.length){if(!t&&!l.length)break;i&&i.leave(r),o=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++}else{let c=r.children[s],u=c.breakAfter;(n>0?c.length<=t:c.length=0;l--){let c=n.marks[l],u=r.lastChild;if(u instanceof jc&&u.mark.eq(c.mark))u.dom!=c.dom&&u.setDOM(Z4(c.dom)),r=u;else{if(this.cache.reused.get(c)){let f=ga.get(c.dom);f&&f.setDOM(Z4(c.dom))}let d=jc.of(c.mark,c.dom);r.append(d),r=d}this.cache.reused.set(c,2)}let s=ga.get(t.text);s&&this.cache.reused.set(s,2);let o=new jy(t.text,t.text.nodeValue);o.flags|=8,this.pos=t.range.toB,r.append(o)}addInlineWidget(t,n,i){let r=this.afterWidget&&t.flags&48&&(this.afterWidget.flags&48)==(t.flags&48);r||this.flushBuffer();let s=this.ensureMarks(n,i);!r&&!(t.flags&16)&&s.append(this.getBuffer(1)),s.append(t),this.pos+=t.length,this.afterWidget=t}addMark(t,n,i){this.flushBuffer(),this.ensureMarks(n,i).append(t),this.pos+=t.length,this.afterWidget=null}addBlockWidget(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}continueWidget(t){let n=this.afterWidget||this.lastBlock;n.length+=t,this.pos+=t}addLineStart(t,n){var i;t||(t=B3e);let r=h1.start(t,n||((i=this.cache.find(h1))===null||i===void 0?void 0:i.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(t){this.blockPosCovered()||this.addLineStart(t)}ensureLine(t){this.curLine||this.addLineStart(t)}ensureMarks(t,n){var i;let r=this.curLine;for(let s=t.length-1;s>=0;s--){let o=t[s],l;if(n>0&&(l=r.lastChild)&&l instanceof jc&&l.mark.eq(o))r=l,n--;else{let c=jc.of(o,(i=this.cache.find(jc,u=>u.mark.eq(o)))===null||i===void 0?void 0:i.dom);r.append(c),r=c,n=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let t=this.curLine.lastChild;(!t||!$ie(this.curLine,!1)||t.dom.nodeName!="BR"&&t.isWidget()&&!(dn.ios&&$ie(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(J4,0,32)||new yv(J4.toDOM(),0,J4,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let t=this.wrappers.length-1;t>=0;t--)this.wrappers[t].to=this.pos){let n=t.rank*102+t.value.rank,i=new GIt(t.from,t.to,t.value,n),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-i.rank||this.wrappers[r-1].to-i.to)<0;)r--;this.wrappers.splice(r,0,i)}this.wrapperPos=this.pos}getBlockPos(){var t;this.updateBlockWrappers();let n=this.root;for(let i of this.wrappers){let r=n.lastChild;if(i.fromo.wrapper.eq(i.wrapper)))===null||t===void 0?void 0:t.dom);n.append(s),n=s}}return n}blockPosCovered(){let t=this.lastBlock;return t!=null&&!t.breakAfter&&(!t.isWidget()||(t.flags&160)>0)}getBuffer(t){let n=2|(t<0?16:32),i=this.cache.find(VI,void 0,1);return i&&(i.flags=n),i||new VI(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class YIt{constructor(t){this.skipCount=0,this.text="",this.textOff=0,this.cursor=t.iter()}skip(t){this.textOff+t<=this.text.length?this.textOff+=t:(this.skipCount+=t-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(t){if(this.textOff==this.text.length){let{value:r,lineBreak:s,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=r;let l=this.textOff=Math.min(t,r.length);return s?null:r.slice(0,l)}let n=Math.min(this.text.length,this.textOff+t),i=this.text.slice(this.textOff,n);return this.textOff=n,i}}const HI=[yv,h1,jy,jc,VI,zp,XM];for(let e=0;e[]),this.index=HI.map(()=>0),this.reused=new Map}add(t){let n=t.constructor.bucket,i=this.buckets[n];i.length<6?i.push(t):i[this.index[n]=(this.index[n]+1)%6]=t}find(t,n,i=2){let r=t.bucket,s=this.buckets[r],o=this.index[r];for(let l=0;l{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(t,n){let i=n&&this.getCompositionContext(n.text);for(let r=0,s=0,o=0;;){let l=or){let u=c-r;this.preserve(u,!o,!l),r=c,s+=u}if(!l)break;n&&l.fromA<=n.range.fromA&&l.toA>=n.range.toA?(this.forward(l.fromA,n.range.fromA,n.range.fromA{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(c-l);else{let u=c>0||l{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof jc&&r.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?r.length&&(r.length=s=0):o instanceof jc&&(r.shift(),s=Math.min(s,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(t)}emit(t,n){let i=null,r=this.builder,s=-1,o=Yi.spans(this.decorations,t,n,{point:(l,c,u,d,f,h)=>{if(u instanceof gv){if(this.disallowBlockEffectsFor[h]){if(u.block)throw new RangeError("Block decorations may not be specified via plugins");if(c>this.view.state.doc.lineAt(l).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=d.length,f>d.length)r.continueWidget(c-l);else{let m=u.widget||(u.block?p1.block:p1.inline),g=ePt(u),b=this.cache.findWidget(m,c-l,g)||yv.of(m,this.view,c-l,g);u.block?(u.startSide>0&&r.addLineStartIfNotCovered(i),r.addBlockWidget(b)):(r.ensureLine(i),r.addInlineWidget(b,d,f))}i=null}else i=tPt(i,u);c>l&&this.text.skip(c-l)},span:(l,c,u,d)=>{for(let f=l;f-1&&(this.openWidget=o>s),this.openWidget||r.addLineStartIfNotCovered(i),this.openMarks=o}forward(t,n,i=1){n-t<=10?this.old.advance(n-t,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-t-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(t){let n=[],i=null;for(let r=t.parentNode;;r=r.parentNode){let s=ga.get(r);if(r==this.view.contentDOM)break;s instanceof jc?n.push(s):s!=null&&s.isLine()?i=s:s instanceof zp||(r.nodeName=="DIV"&&!i&&r!=this.view.contentDOM?i=new h1(r,B3e):i||n.push(jc.of(new NT({tagName:r.nodeName.toLowerCase(),attributes:TIt(r)}),r)))}return{line:i,marks:n}}}function $ie(e,t){let n=i=>{for(let r of i.children)if((t?r.isText():r.length)||n(r))return!0;return!1};return n(e)}function ePt(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}const B3e={class:"cm-line"};function tPt(e,t){let n=t.spec.attributes,i=t.spec.class;return!n&&!i||(e||(e={class:"cm-line"}),n&&Qq(n,e),i&&(e.class+=" "+i)),e}function nPt(e){let t=[];for(let n=e.parents.length;n>1;n--){let i=n==e.parents.length?e.tile:e.parents[n].tile;i instanceof jc&&t.push(i.mark)}return t}function Z4(e){let t=ga.get(e);return t&&t.setDOM(e.cloneNode()),e}class p1 extends Tf{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}p1.inline=new p1("span");p1.block=new p1("div");const J4=new class extends Tf{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class Fie{constructor(t){this.view=t,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=$n.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new XM(t,t.contentDOM),this.updateInner([new bd(0,0,0,t.state.doc.length)],null)}update(t){var n;let i=t.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:d,toA:f})=>fthis.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?r=this.domChanged.newSel.head:!dPt(t.changes,this.hasComposition)&&!t.selectionSet&&(r=t.state.selection.main.head));let s=r>-1?rPt(this.view,t.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:d,to:f}=this.hasComposition;i=new bd(d,f,t.changes.mapPos(d,-1),t.changes.mapPos(f,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(dn.ie||dn.chrome)&&!s&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.blockWrappers;this.updateDeco();let c=oPt(o,this.decorations,t.changes);c.length&&(i=bd.extendWithRanges(i,c));let u=cPt(l,this.blockWrappers,t.changes);return u.length&&(i=bd.extendWithRanges(i,u)),s&&!i.some(d=>d.fromA<=s.range.fromA&&d.toA>=s.range.toA)&&(i=s.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,s),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,n){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(n||t.length){let o=this.tile,l=new JIt(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&ga.get(n.text)&&l.cache.reused.set(ga.get(n.text),2),this.tile=l.run(t,n),z9(o,l.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=dn.chrome||dn.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||i.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to-1)&&OE(i,this.view.observer.selectionRange)&&!(r&&i.contains(r));if(!(s||n||o))return;let l=this.forceSelection;this.forceSelection=!1;let c=this.view.state.selection.main,u,d;if(c.empty?d=u=this.inlineDOMNearPos(c.anchor,c.assoc||1):(d=this.inlineDOMNearPos(c.head,c.head==c.from?1:-1),u=this.inlineDOMNearPos(c.anchor,c.anchor==c.from?1:-1)),dn.gecko&&c.empty&&!this.hasComposition&&iPt(u)){let h=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(h,u.node.childNodes[u.offset]||null)),u=d=new of(h,0),l=!0}let f=this.view.observer.selectionRange;(l||!f.focusNode||(!EE(u.node,u.offset,f.anchorNode,f.anchorOffset)||!EE(d.node,d.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,c))&&(this.view.observer.ignore(()=>{dn.android&&dn.chrome&&i.contains(f.focusNode)&&uPt(f.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let h=BC(this.view.root);if(h)if(c.empty){if(dn.gecko){let m=sPt(u.node,u.offset);if(m&&m!=3){let g=(m==1?v3e:x3e)(u.node,u.offset);g&&(u=new of(g.node,g.offset))}}h.collapse(u.node,u.offset),c.bidiLevel!=null&&h.caretBidiLevel!==void 0&&(h.caretBidiLevel=c.bidiLevel)}else if(h.extend){h.collapse(u.node,u.offset);try{h.extend(d.node,d.offset)}catch{}}else{let m=document.createRange();c.anchor>c.head&&([u,d]=[d,u]),m.setEnd(d.node,d.offset),m.setStart(u.node,u.offset),h.removeAllRanges(),h.addRange(m)}o&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(u,d)),this.impreciseAnchor=u.precise?null:new of(f.anchorNode,f.anchorOffset),this.impreciseHead=d.precise?null:new of(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(t,n){return this.hasComposition&&n.empty&&EE(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,n=t.state.selection.main,i=BC(t.root),{anchorNode:r,anchorOffset:s}=t.observer.selectionRange;if(!i||!n.empty||!n.assoc||!i.modify)return;let o=this.lineAt(n.head,n.assoc);if(!o)return;let l=o.posAtStart;if(n.head==l||n.head==l+o.length)return;let c=this.coordsAt(n.head,-1),u=this.coordsAt(n.head,1);if(!c||!u||c.bottom>u.top)return;let d=this.domAtPos(n.head+n.assoc,n.assoc);i.collapse(d.node,d.offset),i.modify("move",n.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let f=t.observer.selectionRange;t.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=n.from&&i.collapse(r,s)}posFromDOM(t,n){let i=this.tile.nearest(t);if(!i)return this.tile.dom.compareDocumentPosition(t)&2?0:this.view.state.doc.length;let r=i.posAtStart;if(i.isComposite()){let s;if(t==i.dom)s=i.dom.childNodes[n];else{let o=rm(t)==0?0:n==0?-1:1;for(;;){let l=t.parentNode;if(l==i.dom)break;o==0&&l.firstChild!=l.lastChild&&(t==l.firstChild?o=-1:o=1),t=l}o<0?s=t:s=t.nextSibling}if(s==i.dom.firstChild)return r;for(;s&&!ga.get(s);)s=s.nextSibling;if(!s)return r+i.length;for(let o=0,l=r;;o++){let c=i.children[o];if(c.dom==s)return l;l+=c.length+c.breakAfter}}else return i.isText()?t==i.dom?r+n:r+(n?i.length:0):r}domAtPos(t,n){let{tile:i,offset:r}=this.tile.resolveBlock(t,n);return i.isWidget()?i.domPosFor(r,n):i.domIn(r,n)}inlineDOMNearPos(t,n){let i,r=-1,s=!1,o,l=-1,c=!1;return this.tile.blockTiles((u,d)=>{if(u.isWidget()){if(u.flags&32&&d>=t)return!0;u.flags&16&&(s=!0)}else{let f=d+u.length;if(d<=t&&(i=u,r=t-d,s=f=t&&!o&&(o=u,l=t-d,c=d>t),d>t&&o)return!0}}),!i&&!o?this.domAtPos(t,n):(s&&o?i=null:c&&i&&(o=null),i&&n<0||!o?i.domIn(r,n):o.domIn(l,n))}coordsAt(t,n,i){let{tile:r,offset:s}=this.tile.resolveBlock(t,n);return r.isWidget()?r.widget instanceof e$?null:r.coordsInWidget(s,n,!0):r.coordsIn(s,n,i)}lineAt(t,n){let{tile:i}=this.tile.resolveBlock(t,n);return i.isLine()?i:null}coordsForChar(t){let{tile:n,offset:i}=this.tile.resolveBlock(t,1);if(!n.isLine())return null;function r(s,o){if(s.isComposite())for(let l of s.children){if(l.length>=o){let c=r(l,o);if(c)return c}if(o-=l.length,o<0)break}else if(s.isText()&&oMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,c=this.view.textDirection==cs.LTR,u=0,d=(f,h,m)=>{for(let g=0;gr);g++){let b=f.children[g],v=h+b.length,y=b.dom.getBoundingClientRect(),{height:w}=y;if(m&&!g&&(u+=y.top-m.top),b instanceof zp)v>i&&d(b,h,y);else if(h>=i&&(u>0&&n.push(-u),n.push(w+u),u=0,o)){let x=b.dom.lastChild,k=x?SE(x):[];if(k.length){let S=k[k.length-1],O=c?S.right-y.left:y.right-S.left;O>l&&(l=O,this.minWidth=s,this.minWidthFrom=h,this.minWidthTo=v)}}m&&g==f.children.length-1&&(u+=m.bottom-y.bottom),h=v+b.breakAfter}};return d(this.tile,0,null),n}textDirectionAt(t){let{tile:n}=this.tile.resolveBlock(t,1);return getComputedStyle(n.dom).direction=="rtl"?cs.RTL:cs.LTR}measureTextSize(){let t=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let l=0,c;for(let u of o.children){if(!u.isText()||/[^ -~]/.test(u.text))return;let d=SE(u.dom);if(d.length!=1)return;l+=d[0].width,c=d[0].height}if(l)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:l/o.length,textHeight:c}}});if(t)return t;let n=document.createElement("div"),i,r,s;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let o=SE(n.firstChild)[0];i=n.getBoundingClientRect().height,r=o&&o.width?o.width/27:7,s=o&&o.height?o.height:i,n.remove()}),{lineHeight:i,charWidth:r,textHeight:s}}computeBlockGapDeco(){let t=[],n=this.view.viewState;for(let i=0,r=0;;r++){let s=r==n.viewports.length?null:n.viewports[r],o=s?s.from-1:this.view.state.doc.length;if(o>i){let l=(n.lineBlockAt(o).bottom-n.lineBlockAt(i).top)/this.view.scaleY;t.push($n.replace({widget:new e$(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!s)break;i=s.to+1}return $n.set(t)}updateDeco(){let t=1,n=this.view.state.facet(KM).map(s=>(this.dynamicDecorationMap[t++]=typeof s=="function")?s(this.view):s),i=!1,r=this.view.state.facet(Kq).map((s,o)=>{let l=typeof s=="function";return l&&(i=!0),l?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[t++]=i,n.push(Yi.join(r))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];ttypeof s=="function"?s(this.view):s)}scrollIntoView(t){if(t.isSnapshot){let u=this.view.viewState.lineBlockAt(t.range.head);this.view.scrollDOM.scrollTop=u.top-t.yMargin,this.view.scrollDOM.scrollLeft=t.xMargin;return}for(let u of this.view.state.facet(P3e))try{if(u(this.view,t.range,t))return!0}catch(d){Rc(this.view.state,d,"scroll handler")}let{range:n}=t,i=this.coordsAt(n.head,n.assoc||(n.head>n.anchor?-1:1)),r;if(!i)return;!n.empty&&(r=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(i={left:Math.min(i.left,r.left),top:Math.min(i.top,r.top),right:Math.max(i.right,r.right),bottom:Math.max(i.bottom,r.bottom)});let s=Gq(this.view),o={left:i.left-s.left,top:i.top-s.top,right:i.right+s.right,bottom:i.bottom+s.bottom},{offsetWidth:l,offsetHeight:c}=this.view.scrollDOM;if(NIt(this.view.scrollDOM,o,n.head1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottomi.isWidget()||i.children.some(n);return n(this.tile.resolveBlock(t,1).tile)}destroy(){z9(this.tile)}}function z9(e,t){let n=t==null?void 0:t.get(e);if(n!=1){n==null&&e.destroy();for(let i of e.children)z9(i,t)}}function iPt(e){return e.node.nodeType==1&&e.node.firstChild&&(e.offset==0||e.node.childNodes[e.offset-1].contentEditable=="false")&&(e.offset==e.node.childNodes.length||e.node.childNodes[e.offset].contentEditable=="false")}function U3e(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let i=v3e(n.focusNode,n.focusOffset),r=x3e(n.focusNode,n.focusOffset),s=i||r;if(r&&i&&r.node!=i.node){let l=ga.get(r.node);if(!l||l.isText()&&l.text!=r.node.nodeValue)s=r;else if(e.docView.lastCompositionAfterCursor){let c=ga.get(i.node);!c||c.isText()&&c.text!=i.node.nodeValue||(s=r)}}if(e.docView.lastCompositionAfterCursor=s!=i,!s)return null;let o=t-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function rPt(e,t,n){let i=U3e(e,n);if(!i)return null;let{node:r,from:s,to:o}=i,l=r.nodeValue;if(/[\n\r]/.test(l)||e.state.doc.sliceString(i.from,i.to)!=l)return null;let c=t.invertedDesc;return{range:new bd(c.mapPos(s),c.mapPos(o),s,o),text:r}}function sPt(e,t){return e.nodeType!=1?0:(t&&e.childNodes[t-1].contentEditable=="false"?1:0)|(t{it.from&&(n=!0)}),n}class e$ extends Tf{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function fPt(e,t,n=1){let i=e.charCategorizer(t),r=e.doc.lineAt(t),s=t-r.from;if(r.length==0)return pt.cursor(t);s==0?n=1:s==r.length&&(n=-1);let o=s,l=s;n<0?o=Lo(r.text,s,!1):l=Lo(r.text,s);let c=i(r.text.slice(o,l));for(;o>0;){let u=Lo(r.text,o,!1);if(i(r.text.slice(u,o))!=c)break;o=u}for(;le.defaultLineHeight*1.5){let l=e.viewState.heightOracle.textHeight,c=Math.floor((r-n.top-(e.defaultLineHeight-l)*.5)/l);s+=c*e.viewState.heightOracle.lineLength}let o=e.state.sliceDoc(n.from,n.to);return n.from+N9(o,s,e.state.tabSize)}function V9(e,t,n){let i=e.lineBlockAt(t);if(Array.isArray(i.type)){let r;for(let s of i.type){if(s.from>t)break;if(!(s.tot)return s;(!r||s.type==ul.Text&&(r.type!=s.type||(n<0?s.fromt)))&&(r=s)}}return r||i}return i}function pPt(e,t,n,i){let r=V9(e,t.head,t.assoc||-1),s=!i||r.type!=ul.Text||!(e.lineWrapping||r.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>r.from?t.head-1:t.head);if(s){let o=e.dom.getBoundingClientRect(),l=e.textDirectionAt(r.from),c=e.posAtCoords({x:n==(l==cs.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(c!=null)return pt.cursor(c,n?-1:1)}return pt.cursor(n?r.to:r.from,n?-1:1)}function Bie(e,t,n,i){let r=e.state.doc.lineAt(t.head),s=e.bidiSpans(r),o=e.textDirectionAt(r.from);for(let l=t,c=null;;){let u=QIt(r,s,o,l,n),d=E3e;if(!u){if(r.number==(n?e.state.doc.lines:1))return l;d=` +`,r=e.state.doc.line(r.number+(n?1:-1)),s=e.bidiSpans(r),u=e.visualLineSide(r,!n)}if(c){if(!c(d))return l}else{if(!i)return u;c=i(d)}l=u}}function mPt(e,t,n){let i=e.state.charCategorizer(t),r=i(n);return s=>{let o=i(s);return r==Qs.Space&&(r=o),r==o}}function gPt(e,t,n,i){let r=t.head,s=n?1:-1;if(r==(n?e.state.doc.length:0))return pt.cursor(r,t.assoc);let o=t.goalColumn,l,c=e.contentDOM.getBoundingClientRect(),u=e.coordsAtPos(r,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),d=e.documentTop;if(u)o==null&&(o=u.left-c.left),l=s<0?u.top:u.bottom;else{let g=e.viewState.lineBlockAt(r);o==null&&(o=Math.min(c.right-c.left,e.defaultCharacterWidth*(r-g.from))),l=(s<0?g.top:g.bottom)+d}let f=c.left+o,h=e.viewState.heightOracle.textHeight>>1,m=i??h;for(let g=0;;g+=h){let b=l+(m+g)*s,v=H9(e,{x:f,y:b},!1,s);if(n?b>c.bottom:bl:w{if(t>s&&tr(e)),n.from,t.head>n.from?-1:1);return i==n.from?n:pt.cursor(i,ie.viewState.docHeight)return new ih(e.state.doc.length,-1);if(u=e.elementAtHeight(c),i==null)break;if(u.type==ul.Text){if(i<0?u.toe.viewport.to)break;let h=e.docView.coordsAt(i<0?u.from:u.to,i>0?-1:1);if(h&&(i<0?h.top<=c+s:h.bottom>=c+s))break}let f=e.viewState.heightOracle.textHeight/2;c=i>0?u.bottom+f:u.top-f}if(e.viewport.from>=u.to||e.viewport.to<=u.from){if(n)return null;if(u.type==ul.Text){let f=hPt(e,r,u,o,l);return new ih(f,f==u.from?1:-1)}}if(u.type!=ul.Text)return c<(u.top+u.bottom)/2?new ih(u.from,1):new ih(u.to,-1);let d=e.docView.lineAt(u.from,2);return(!d||d.length!=u.length)&&(d=e.docView.lineAt(u.from,-2)),new bPt(e,o,l,e.textDirectionAt(u.from)).scanTile(d,u.from)}class bPt{constructor(t,n,i,r){this.view=t,this.x=n,this.y=i,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(t){return(!this.line||this.line.from>t||this.line.to1||i.length&&(i[0].level!=this.baseDir||i[0].to+r.from>1;t:if(o.has(b)){let y=r+Math.floor(Math.random()*g);for(let w=0;w1)){if(w.bottomthis.y)(!u||u.top>w.top)&&(u=w),x=-1;else{let k=w.left>this.x?this.x-w.left:w.right(g+g+b)/3)return this.y=c.bottom-1,this.scan(t,n,!0);if(u&&u.top<(g+b+b)/3)return this.y=u.top+1,this.scan(t,n,!0)}let m=(l?this.dirAt(t[d],1):this.baseDir)==cs.LTR;return{i:d,after:this.x>(h.left+h.right)/2==m}}scanText(t,n){let i=[];for(let s=0;s{let o=i[s]-n,l=i[s+1]-n;return QC(t.dom,o,l).getClientRects()});return r.after?new ih(i[r.i+1],-1):new ih(i[r.i],1)}scanTile(t,n){if(!t.length)return new ih(n,1);if(t.children.length==1){let l=t.children[0];if(l.isText())return this.scanText(l,n);if(l.isComposite())return this.scanTile(l,n)}let i=[n];for(let l=0,c=n;l{let c=t.children[l];return c.flags&48?null:(c.dom.nodeType==1?c.dom:QC(c.dom,0,c.length)).getClientRects()}),s=t.children[r.i],o=i[r.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):r.after?new ih(i[r.i+1],-1):new ih(o,1)}}const dx="￿";class yPt{constructor(t,n){this.points=t,this.view=n,this.text="",this.lineSeparator=n.state.facet(sr.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=dx}readRange(t,n){if(!t)return this;let i=t.parentNode;for(let r=t;;){this.findPointBefore(i,r);let s=this.text.length;this.readNode(r);let o=ga.get(r),l=r.nextSibling;if(l==n){o!=null&&o.breakAfter&&!l&&i!=this.view.contentDOM&&this.lineBreak();break}let c=ga.get(l);(o&&c?o.breakAfter:(o?o.breakAfter:QI(r))||QI(l)&&(r.nodeName!="BR"||o!=null&&o.isWidget())&&this.text.length>s)&&!xPt(l,n)&&this.lineBreak(),r=l}return this.findPointBefore(i,n),this}readTextNode(t){let n=t.nodeValue;for(let i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,n.length));for(let i=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,l;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=r.exec(n))&&(s=l.index,o=l[0].length),this.append(n.slice(i,s<0?n.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let c of this.points)c.node==t&&c.pos>this.text.length&&(c.pos-=o-1);i=s+o}}readNode(t){let n=ga.get(t),i=n&&n.overrideDOMText;if(i!=null){this.findPointInside(t,i.length);for(let r=i.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else t.nodeType==3?this.readTextNode(t):t.nodeName=="BR"?t.nextSibling&&this.lineBreak():t.nodeType==1&&this.readRange(t.firstChild,null)}findPointBefore(t,n){for(let i of this.points)i.node==t&&t.childNodes[i.offset]==n&&(i.pos=this.text.length)}findPointInside(t,n){for(let i of this.points)(t.nodeType==3?i.node==t:t.contains(i.node))&&(i.pos=this.text.length+(vPt(t,i.node,i.offset)?n:0))}}function vPt(e,t,n){for(;;){if(!t||n-1;let{impreciseHead:s,impreciseAnchor:o}=t.docView,l=t.state.selection;if(t.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=z3e(t.docView.tile,n,i,0))){let c=s||o?[]:OPt(t),u=new yPt(c,t);u.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=u.text,this.newSel=SPt(c,this.bounds.from)}else{let c=t.observer.selectionRange,u=s&&s.node==c.focusNode&&s.offset==c.focusOffset||!$9(t.contentDOM,c.focusNode)?l.main.head:t.docView.posFromDOM(c.focusNode,c.focusOffset),d=o&&o.node==c.anchorNode&&o.offset==c.anchorOffset||!$9(t.contentDOM,c.anchorNode)?l.main.anchor:t.docView.posFromDOM(c.anchorNode,c.anchorOffset),f=t.viewport;if((dn.ios||dn.chrome)&&u!=d&&Math.min(u,d)<=l.main.from&&Math.max(u,d)>=l.main.to&&(f.from>0||f.to-1&&l.ranges.length>1)this.newSel=l.replaceRange(pt.range(d,u));else if(t.lineWrapping&&d==u&&!(l.main.empty&&l.main.head==u)&&t.inputState.lastTouchTime>Date.now()-100){let h=t.coordsAtPos(u,-1),m=0;h&&(m=t.inputState.lastTouchY<=h.bottom?-1:1),this.newSel=pt.create([pt.cursor(u,m)])}else this.newSel=pt.single(d,u)}}}function z3e(e,t,n,i){if(e.isComposite()){let r=-1,s=-1,o=-1,l=-1;for(let c=0,u=i,d=i;cn)return z3e(f,t,n,u);if(h>=t&&r==-1&&(r=c,s=u),u>n&&f.dom.parentNode==e.dom){o=c,l=d;break}d=h,u=h+f.breakAfter}return{from:s,to:l<0?i+e.length:l,startDOM:(r?e.children[r-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:o=0?e.children[o].dom:null}}else return e.isText()?{from:i,to:i+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function V3e(e,t){let n,{newSel:i}=t,{state:r}=e,s=r.selection.main,o=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:l,to:c}=t.bounds,u=s.from,d=null;(o===8||dn.android&&t.text.length=l&&s.to<=c&&(t.typeOver||f!=t.text)&&f.slice(0,s.from-l)==t.text.slice(0,s.from-l)&&f.slice(s.to-l)==t.text.slice(h=t.text.length-(f.length-(s.to-l)))?n={from:s.from,to:s.to,insert:Or.of(t.text.slice(s.from-l,h).split(dx))}:(m=H3e(f,t.text,u-l,d))&&(dn.chrome&&o==13&&m.toB==m.from+2&&t.text.slice(m.from,m.toB)==dx+dx&&m.toB--,n={from:l+m.from,to:l+m.toA,insert:Or.of(t.text.slice(m.from,m.toB).split(dx))})}else i&&(!e.hasFocus&&r.facet(kp)||qI(i,s))&&(i=null);if(!n&&!i)return!1;if((dn.mac||dn.android)&&n&&n.from==n.to&&n.from==s.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute("autocorrect")=="off"?(i&&n.insert.length==2&&(i=pt.single(i.main.anchor-1,i.main.head-1)),n={from:n.from,to:n.to,insert:Or.of([n.insert.toString().replace("."," ")])}):r.doc.lineAt(s.from).toDate.now()-50?n={from:s.from,to:s.to,insert:r.toText(e.inputState.insertingText)}:dn.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==` + `&&e.lineWrapping&&(i&&(i=pt.single(i.main.anchor-1,i.main.head-1)),n={from:s.from,to:s.to,insert:Or.of([" "])}),n)return Xq(e,n,i,o);if(i&&!qI(i,s)){let l=!1,c="select";return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin=="select"&&(l=!0),c=e.inputState.lastSelectionOrigin,c=="select.pointer"&&(i=Q3e(r.facet(IT).map(u=>u(e)),i))),e.dispatch({selection:i,scrollIntoView:l,userEvent:c}),!0}else return!1}function Xq(e,t,n,i=-1){if(dn.ios&&e.inputState.flushIOSKey(t))return!0;let r=e.state.selection.main;if(dn.android&&(t.to==r.to&&(t.from==r.from||t.from==r.from-1&&e.state.sliceDoc(t.from,r.from)==" ")&&t.insert.length==1&&t.insert.lines==2&&xw(e.contentDOM,"Enter",13)||(t.from==r.from-1&&t.to==r.to&&t.insert.length==0||i==8&&t.insert.lengthr.head)&&xw(e.contentDOM,"Backspace",8)||t.from==r.from&&t.to==r.to+1&&t.insert.length==0&&xw(e.contentDOM,"Delete",46)))return!0;let s=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let o,l=()=>o||(o=kPt(e,t,n));return e.state.facet(j3e).some(c=>c(e,t.from,t.to,s,l))||e.dispatch(l()),!0}function kPt(e,t,n){let i,r=e.state,s=r.selection.main,o=-1;if(t.from==t.to&&t.froms.to){let c=t.fromf(e)),u,c);t.from==d&&(o=d)}if(o>-1)i={changes:t,selection:pt.cursor(t.from+t.insert.length,-1)};else if(t.from>=s.from&&t.to<=s.to&&t.to-t.from>=(s.to-s.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let c=s.fromt.to?r.sliceDoc(t.to,s.to):"";i=r.replaceSelection(e.state.toText(c+t.insert.sliceString(0,void 0,e.state.lineBreak)+u))}else{let c=r.changes(t),u=n&&n.main.to<=c.newLength?n.main:void 0;if(r.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=s.to+10&&t.to>=s.to-10){let d=e.state.sliceDoc(t.from,t.to),f,h=n&&U3e(e,n.main.head);if(h){let g=t.insert.length-(t.to-t.from);f={from:h.from,to:h.to-g}}else f=e.state.doc.lineAt(s.head);let m=s.to-t.to;i=r.changeByRange(g=>{if(g.from==s.from&&g.to==s.to)return{changes:c,range:u||g.map(c)};let b=g.to-m,v=b-d.length;if(e.state.sliceDoc(v,b)!=d||b>=f.from&&v<=f.to)return{range:g};let y=r.changes({from:v,to:b,insert:t.insert}),w=g.to-s.to;return{changes:y,range:u?pt.range(Math.max(0,u.anchor+w),Math.max(0,u.head+w)):g.map(y)}})}else i={changes:c,selection:u&&r.selection.replaceRange(u)}}let l="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,l+=".compose",e.inputState.compositionFirstChange&&(l+=".start",e.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:l,scrollIntoView:!0})}function H3e(e,t,n,i){let r=Math.min(e.length,t.length),s=0;for(;s0&&l>0&&e.charCodeAt(o-1)==t.charCodeAt(l-1);)o--,l--;if(i=="end"){let c=Math.max(0,s-Math.min(o,l));n-=o+c-s}if(o=o?s-n:0;s-=c,l=s+(l-o),o=s}else if(l=l?s-n:0;s-=c,o=s+(o-l),l=s}return{from:s,toA:o,toB:l}}function OPt(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}=e.observer.selectionRange;return n&&(t.push(new Uie(n,i)),(r!=n||s!=i)&&t.push(new Uie(r,s))),t}function SPt(e,t){if(e.length==0)return null;let n=e[0].pos,i=e.length==2?e[1].pos:n;return n>-1&&i>-1?pt.single(n+t,i+t):null}function qI(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class EPt{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,dn.safari&&t.contentDOM.addEventListener("input",()=>null),dn.gecko&&UPt(t.contentDOM.ownerDocument)}handleEvent(t){!PPt(this.view,t)||this.ignoreDuringComposition(t)||t.type=="keydown"&&this.keydown(t)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(t.type,t)):this.runHandlers(t.type,t))}runHandlers(t,n){let i=this.handlers[t];if(i){for(let r of i.observers)r(this.view,n);for(let r of i.handlers){if(n.defaultPrevented)break;if(r(this.view,n)){n.preventDefault();break}}}}ensureHandlers(t){let n=APt(t),i=this.handlers,r=this.view.contentDOM;for(let s in n)if(s!="scroll"){let o=!n[s].handlers.length,l=i[s];l&&o!=!l.handlers.length&&(r.removeEventListener(s,this.handleEvent),l=null),l||r.addEventListener(s,this.handleEvent,{passive:o})}for(let s in i)s!="scroll"&&!n[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=n}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&t.keyCode!=27&&W3e.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),dn.android&&dn.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;if(dn.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&(q3e.some(n=>n.keyCode==t.keyCode)&&!t.ctrlKey||TPt.indexOf(t.key)>-1&&t.ctrlKey)){let n={ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey,shiftKey:t.shiftKey};return n.shiftKey&&dn.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&CPt(this.view.win)&&(n.shiftKey=!1),this.pendingIOSKey={key:t.key,keyCode:t.keyCode,mods:n},setTimeout(()=>this.flushIOSKey(),250),!0}return t.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(t){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&t&&t.from0?!0:dn.safari&&!dn.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function CPt(e){return e.visualViewport?e.visualViewport.height*e.visualViewport.scale/e.document.documentElement.clientHeight<.85:!1}function Qie(e,t){return(n,i)=>{try{return t.call(e,i,n)}catch(r){Rc(n.state,r)}}}function APt(e){let t=Object.create(null);function n(i){return t[i]||(t[i]={observers:[],handlers:[]})}for(let i of e){let r=i.spec,s=r&&r.plugin.domEventHandlers,o=r&&r.plugin.domEventObservers;if(s)for(let l in s){let c=s[l];c&&n(l).handlers.push(Qie(i.value,c))}if(o)for(let l in o){let c=o[l];c&&n(l).observers.push(Qie(i.value,c))}}for(let i in xf)n(i).handlers.push(xf[i]);for(let i in rc)n(i).observers.push(rc[i]);return t}const q3e=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],TPt="dthko",W3e=[16,17,18,20,91,92,224,225],V_=6;function H_(e){return Math.max(0,e)*.7+8}function _Pt(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}class jPt{constructor(t,n,i,r){this.view=t,this.startEvent=n,this.style=i,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=g3e(t.contentDOM),this.atoms=t.state.facet(IT).map(o=>o(t));let s=t.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=t.state.facet(sr.allowMultipleSelections)&&NPt(t,n),this.dragging=IPt(t,n)&&X3e(n)==1?null:!1}start(t){this.dragging===!1&&this.select(t)}move(t){if(t.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&_Pt(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let n=0,i=0,r=0,s=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let c=Gq(this.view);t.clientX-c.left<=r+V_?n=-H_(r-t.clientX):t.clientX+c.right>=o-V_&&(n=H_(t.clientX-o)),t.clientY-c.top<=s+V_?i=-H_(s-t.clientY):t.clientY+c.bottom>=l-V_&&(i=H_(t.clientY-l)),this.setScrollSpeed(n,i)}up(t){this.dragging==null&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,n){this.scrollSpeed={x:t,y:n},t||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:n}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(t||n)&&this.view.win.scrollBy(t,n),this.dragging===!1&&this.select(this.lastEvent)}select(t){let{view:n}=this,i=Q3e(this.atoms,this.style.get(t,this.extend,this.multiple));(this.mustSelect||!i.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(t){t.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(t)&&setTimeout(()=>this.select(this.lastEvent),20)}}function NPt(e,t){let n=e.state.facet(C3e);return n.length?n[0](t):dn.mac?t.metaKey:t.ctrlKey}function RPt(e,t){let n=e.state.facet(A3e);return n.length?n[0](t):dn.mac?!t.altKey:!t.ctrlKey}function IPt(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let i=BC(e.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let s=0;s=t.clientX&&o.top<=t.clientY&&o.bottom>=t.clientY)return!0}return!1}function PPt(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,i;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(i=ga.get(n))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(t))return!1;return!0}const xf=Object.create(null),rc=Object.create(null),K3e=dn.ie&&dn.ie_version<15||dn.ios&&dn.webkit_version<604;function DPt(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{e.focus(),n.remove(),G3e(e,n.value)},50)}function YM(e,t,n){for(let i of e.facet(t))n=i(n,e);return n}function G3e(e,t){t=YM(e.state,Hq,t);let{state:n}=e,i,r=1,s=n.toText(t),o=s.lines==n.selection.ranges.length;if(q9!=null&&n.selection.ranges.every(c=>c.empty)&&q9==s.toString()){let c=-1;i=n.changeByRange(u=>{let d=n.doc.lineAt(u.from);if(d.from==c)return{range:u};c=d.from;let f=n.toText((o?s.line(r++).text:t)+n.lineBreak);return{changes:{from:d.from,insert:f},range:pt.cursor(u.from+f.length)}})}else o?i=n.changeByRange(c=>{let u=s.line(r++);return{changes:{from:c.from,to:c.to,insert:u.text},range:pt.cursor(c.from+u.length)}}):i=n.replaceSelection(s);e.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}rc.scroll=e=>{let t=e.inputState;t.lastScrollTop=e.scrollDOM.scrollTop,t.lastScrollLeft=e.scrollDOM.scrollLeft,dn.ios&&!t.touchActive&&(t.lastIOSMomentumScroll=Date.now())};rc.wheel=rc.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()};xf.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1);rc.touchstart=(e,t)=>{let n=e.inputState,i=t.targetTouches[0];n.touchActive=!0,n.lastTouchTime=Date.now(),i&&(n.lastTouchX=i.clientX,n.lastTouchY=i.clientY),n.setSelectionOrigin("select.pointer")};rc.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")};rc.touchend=(e,t)=>{e.inputState.touchActive=!1};xf.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let i of e.state.facet(T3e))if(n=i(e,t),n)break;if(!n&&t.button==0&&(n=LPt(e,t)),n){let i=!e.hasFocus;e.inputState.startMouseSelection(new jPt(e,t,n,i)),i&&e.observer.ignore(()=>{b3e(e.contentDOM);let s=e.root.activeElement;s&&!s.contains(e.contentDOM)&&s.blur()});let r=e.inputState.mouseSelection;if(r)return r.start(t),r.dragging===!1}else e.inputState.setSelectionOrigin("select.pointer");return!1};function zie(e,t,n,i){if(i==1)return pt.cursor(t,n);if(i==2)return fPt(e.state,t,n);{let r=e.docView.lineAt(t,n),s=e.state.doc.lineAt(r?r.posAtEnd:t),o=r?r.posAtStart:s.from,l=r?r.posAtEnd:s.to;return lDate.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(Hie+1)%3:1}function LPt(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),i=X3e(t),r=e.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),r=r.map(s.changes))},get(s,o,l){let c=e.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),u,d=zie(e,c.pos,c.assoc,i);if(n.pos!=c.pos&&!o){let f=zie(e,n.pos,n.assoc,i),h=Math.min(f.from,d.from),m=Math.max(f.to,d.to);d=h1&&(u=$Pt(r,c.pos))?u:l?r.addRange(d):pt.create([d])}}}function $Pt(e,t){for(let n=0;n=t)return pt.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}xf.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let s=r.posAtStart,o=s+r.length;(s>=n.to||o<=n.from)&&(n=pt.undirectionalRange(s,o))}}let{inputState:i}=e;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",YM(e.state,qq,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1};xf.dragend=e=>(e.inputState.draggedContent=null,!1);function Wie(e,t,n,i){if(n=YM(e.state,Hq,n),!n)return;let r=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:s}=e.inputState,o=i&&s&&RPt(e,t)?{from:s.from,to:s.to}:null,l={from:r,insert:n},c=e.state.changes(o?[o,l]:l);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(r,-1),head:c.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"}),e.inputState.draggedContent=null}xf.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let i=Array(n.length),r=0,s=()=>{++r==n.length&&Wie(e,t,i.filter(o=>o!=null).join(e.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),s()},l.readAsText(n[o])}return!0}else{let i=t.dataTransfer.getData("Text");if(i)return Wie(e,t,i,!0),!0}return!1};xf.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=K3e?null:t.clipboardData;return n?(G3e(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(DPt(e),!1)};function FPt(e,t){let n=e.dom.parentNode;if(!n)return;let i=n.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=t,i.focus(),i.selectionEnd=t.length,i.selectionStart=0,setTimeout(()=>{i.remove(),e.focus()},50)}function BPt(e){let t=[],n=[],i=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let r=-1;for(let{from:s}of e.selection.ranges){let o=e.doc.lineAt(s);o.number>r&&(t.push(o.text),n.push({from:o.from,to:Math.min(e.doc.length,o.to+1)})),r=o.number}i=!0}return{text:YM(e,qq,t.join(e.lineBreak)),ranges:n,linewise:i}}let q9=null;xf.copy=xf.cut=(e,t)=>{if(!OE(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:i,linewise:r}=BPt(e.state);if(!n&&!r)return!1;q9=r?n:null,t.type=="cut"&&!e.state.readOnly&&e.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=K3e?null:t.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(FPt(e,n),!1)};const Y3e=Dh.define();function Z3e(e,t){let n=[];for(let i of e.facet(N3e)){let r=i(e,t);r&&n.push(r)}return n.length?e.update({effects:n,annotations:Y3e.of(!0)}):null}function J3e(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=Z3e(e.state,t);n?e.dispatch(n):e.update([])}},10)}rc.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),J3e(e)};rc.blur=e=>{e.observer.clearSelectionRange(),J3e(e)};rc.compositionstart=rc.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange==null&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))};rc.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,dn.chrome&&dn.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))};rc.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()};xf.beforeinput=(e,t)=>{var n,i;if((t.inputType=="insertText"||t.inputType=="insertCompositionText")&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType=="insertReplacementText"&&e.observer.editContext){let s=(n=t.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),o=t.getTargetRanges();if(s&&o.length){let l=o[0],c=e.posAtDOM(l.startContainer,l.startOffset),u=e.posAtDOM(l.endContainer,l.endOffset);return Xq(e,{from:c,to:u,insert:e.state.toText(s)},null),!0}}let r;if(dn.chrome&&dn.android&&(r=q3e.find(s=>s.inputType==t.inputType))&&(e.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return dn.ios&&t.inputType=="deleteContentForward"&&e.observer.flushSoon(),dn.safari&&t.inputType=="insertText"&&e.inputState.composing>=0&&setTimeout(()=>rc.compositionend(e,t),20),!1};const Kie=new Set;function UPt(e){Kie.has(e)||(Kie.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}const Gie=["pre-wrap","normal","pre-line","break-spaces"];let m1=!1;function Xie(){m1=!1}class QPt{constructor(t){this.lineWrapping=t,this.doc=Or.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,n){let i=this.doc.lineAt(n).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((n-t-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return Gie.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let n=!1;for(let i=0;i-1,c=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=n,this.charWidth=i,this.textHeight=r,this.lineLength=s,c){this.heightSamples={};for(let u=0;u0}set outdated(t){this.flags=(t?2:0)|this.flags&-3}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>FN&&(m1=!0),this.height=t)}replace(t,n,i){return ic.of(i)}decomposeLeft(t,n){n.push(this)}decomposeRight(t,n){n.push(this)}applyChanges(t,n,i,r){let s=this,o=i.doc;for(let l=r.length-1;l>=0;l--){let{fromA:c,toA:u,fromB:d,toB:f}=r[l],h=s.lineAt(c,xs.ByPosNoHeight,i.setDoc(n),0,0),m=h.to>=u?h:s.lineAt(u,xs.ByPosNoHeight,i,0,0);for(f+=m.to-u,u=m.to;l>0&&h.from<=r[l-1].toA;)c=r[l-1].fromA,d=r[l-1].fromB,l--,cs*2){let l=t[n-1];l.break?t.splice(--n,1,l.left,null,l.right):t.splice(--n,1,l.left,l.right),i+=1+l.break,r-=l.size}else if(s>r*2){let l=t[i];l.break?t.splice(i,1,l.left,null,l.right):t.splice(i,1,l.left,l.right),i+=2+l.break,s-=l.size}else break;else if(r=s&&o(this.lineAt(0,xs.ByPos,i,r,s))}setMeasuredHeight(t){let n=t.heights[t.index++];n<0?(this.spaceAbove=-n,n=t.heights[t.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(t,n=0,i=!1,r){return r&&r.from<=n&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class mu extends e4e{constructor(t,n,i){super(t,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(t,n){return new sf(n,this.length,t+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,i){let r=i[0];return i.length==1&&(r instanceof mu||r instanceof tl&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof tl?r=new mu(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):ic.of(i)}updateHeight(t,n=0,i=!1,r){return r&&r.from<=n&&r.more?this.setMeasuredHeight(r):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class tl extends ic{constructor(t){super(t,0)}heightMetrics(t,n){let i=t.doc.lineAt(n).number,r=t.doc.lineAt(n+this.length).number,s=r-i+1,o,l=0;if(t.lineWrapping){let c=Math.min(this.height,t.lineHeight*s);o=c/s,this.length>s+1&&(l=(this.height-c)/(this.length-s-1))}else o=this.height/s;return{firstLine:i,lastLine:r,perLine:o,perChar:l}}blockAt(t,n,i,r){let{firstLine:s,lastLine:o,perLine:l,perChar:c}=this.heightMetrics(n,r);if(n.lineWrapping){let u=r+(t0){let s=i[i.length-1];s instanceof tl?i[i.length-1]=new tl(s.length+r):i.push(null,new tl(r-1))}if(t>0){let s=i[0];s instanceof tl?i[0]=new tl(t+s.length):i.unshift(new tl(t-1),null)}return ic.of(i)}decomposeLeft(t,n){n.push(new tl(t-1),null)}decomposeRight(t,n){n.push(null,new tl(this.length-t-1))}updateHeight(t,n=0,i=!1,r){let s=n+this.length;if(r&&r.from<=n+this.length&&r.more){let o=[],l=Math.max(n,r.from),c=-1;for(r.from>n&&o.push(new tl(r.from-n-1).updateHeight(t,n));l<=s&&r.more;){let d=t.doc.lineAt(l).length;o.length&&o.push(null);let f=r.heights[r.index++],h=0;f<0&&(h=-f,f=r.heights[r.index++]),c==-1?c=f:Math.abs(f-c)>=FN&&(c=-2);let m=new mu(d,f,h);m.outdated=!1,o.push(m),l+=d+1}l<=s&&o.push(null,new tl(s-l).updateHeight(t,l));let u=ic.of(o);return(c<0||Math.abs(u.height-this.height)>=FN||Math.abs(c-this.heightMetrics(t,n).perLine)>=FN)&&(m1=!0),WI(this,u)}else(i||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class HPt extends ic{constructor(t,n,i){super(t.length+n+i.length,t.height+i.height,n|(t.outdated||i.outdated?2:0)),this.left=t,this.right=i,this.size=t.size+i.size}get break(){return this.flags&1}blockAt(t,n,i,r){let s=i+this.left.height;return tl))return u;let d=n==xs.ByPosNoHeight?xs.ByPosNoHeight:xs.ByPos;return c?u.join(this.right.lineAt(l,d,i,o,l)):this.left.lineAt(l,d,i,r,s).join(u)}forEachLine(t,n,i,r,s,o){let l=r+this.left.height,c=s+this.left.length+this.break;if(this.break)t=c&&this.right.forEachLine(t,n,i,l,c,o);else{let u=this.lineAt(c,xs.ByPos,i,r,s);t=t&&u.from<=n&&o(u),n>u.to&&this.right.forEachLine(u.to+1,n,i,l,c,o)}}replace(t,n,i){let r=this.left.length+this.break;if(nthis.left.length)return this.balanced(this.left,this.right.replace(t-r,n-r,i));let s=[];t>0&&this.decomposeLeft(t,s);let o=s.length;for(let l of i)s.push(l);if(t>0&&Yie(s,o-1),n=i&&n.push(null)),t>i&&this.right.decomposeLeft(t-i,n)}decomposeRight(t,n){let i=this.left.length,r=i+this.break;if(t>=r)return this.right.decomposeRight(t-r,n);t2*n.size||n.size>2*t.size?ic.of(this.break?[t,null,n]:[t,n]):(this.left=WI(this.left,t),this.right=WI(this.right,n),this.setHeight(t.height+n.height),this.outdated=t.outdated||n.outdated,this.size=t.size+n.size,this.length=t.length+this.break+n.length,this)}updateHeight(t,n=0,i=!1,r){let{left:s,right:o}=this,l=n+s.length+this.break,c=null;return r&&r.from<=n+s.length&&r.more?c=s=s.updateHeight(t,n,i,r):s.updateHeight(t,n,i),r&&r.from<=l+o.length&&r.more?c=o=o.updateHeight(t,l,i,r):o.updateHeight(t,l,i),c?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Yie(e,t){let n,i;e[t]==null&&(n=e[t-1])instanceof tl&&(i=e[t+1])instanceof tl&&e.splice(t-1,3,new tl(n.length+1+i.length))}const qPt=5;class Yq{constructor(t,n){this.pos=t,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,n){if(this.lineStart>-1){let i=Math.min(n,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof mu?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new mu(i-this.pos,-1,0)),this.writtenTo=i,n>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(t,n,i){if(t=qPt)&&this.addLineDeco(r,s,o)}else n>t&&this.span(t,n);this.lineEnd>-1&&this.lineEnd-1)return;let{from:t,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=n,this.writtenTot&&this.nodes.push(new mu(this.pos-t,-1,0)),this.writtenTo=this.pos}blankContent(t,n){let i=new tl(n-t);return this.oracle.doc.lineAt(t).to==n&&(i.flags|=4),i}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof mu)return t;let n=new mu(0,-1,0);return this.nodes.push(n),n}addBlock(t){this.enterLine();let n=t.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,n&&n.endSide>0&&(this.covering=t)}addLineDeco(t,n,i){let r=this.ensureLine();r.length+=i,r.collapsed+=i,r.widgetHeight=Math.max(r.widgetHeight,t),r.breaks+=n,this.writtenTo=this.pos=this.pos+i}finish(t){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof mu)&&!this.isCovered?this.nodes.push(new mu(0,-1,0)):(this.writtenTod.clientHeight||d.scrollWidth>d.clientWidth)&&f.overflow!="visible"){let h=d.getBoundingClientRect();s=Math.max(s,h.left),o=Math.min(o,h.right),l=Math.max(l,h.top),c=Math.min(u==e.parentNode?r.innerHeight:c,h.bottom)}u=f.position=="absolute"||f.position=="fixed"?d.offsetParent:d.parentNode}else if(u.nodeType==11)u=u.host;else break;return{left:s-n.left,right:Math.max(s,o)-n.left,top:l-(n.top+t),bottom:Math.max(l,c)-(n.top+t)}}function XPt(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left0&&t.top0}function YPt(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class n${constructor(t,n,i,r){this.from=t,this.to=n,this.size=i,this.displaySize=r}static same(t,n){if(t.length!=n.length)return!1;for(let i=0;itypeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new QPt(i),this.stateDeco=ere(n),this.heightMap=ic.empty().applyChanges(this.stateDeco,Or.empty,this.heightOracle.setDoc(n.doc),[new bd(0,0,0,n.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=$n.set(this.lineGaps.map(r=>r.draw(this,!1))),this.scrollParent=t.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:n}=this.state.selection;for(let i=0;i<=1;i++){let r=i?n.head:n.anchor;if(!t.some(({from:s,to:o})=>r>=s&&r<=o)){let{from:s,to:o}=this.lineBlockAt(r);t.push(new q_(s,o))}}return this.viewports=t.sort((i,r)=>i.from-r.from),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?Jie:new Zq(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,t=>{this.viewportLines.push(wS(t,this.scaler))})}update(t,n=null){this.state=t.state;let i=this.stateDeco;this.stateDeco=ere(this.state);let r=t.changedRanges,s=bd.extendWithRanges(r,WPt(i,this.stateDeco,t?t.changes:co.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);Xie(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||m1)&&(t.flags|=2),l?(this.scrollAnchorPos=t.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let c=s.length?this.mapViewport(this.viewport,t.changes):this.viewport;(n&&(n.range.headc.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,n));let u=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,t.flags|=this.updateForViewport(),(u||!t.changes.empty||t.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(t.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(t.selectionSet||t.focusChanged)&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(I3e)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:t}=this,n=t.contentDOM,i=window.getComputedStyle(n),r=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?cs.RTL:cs.LTR;let o=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",l=n.getBoundingClientRect(),c=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let u=0,d=0;if(l.width&&l.height){let{scaleX:S,scaleY:O}=m3e(n,l);(S>.005&&Math.abs(this.scaleX-S)>.005||O>.005&&Math.abs(this.scaleY-O)>.005)&&(this.scaleX=S,this.scaleY=O,u|=16,o=c=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,h=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=h)&&(this.paddingTop=f,this.paddingBottom=h,u|=18),this.editorWidth!=t.scrollDOM.clientWidth&&(r.lineWrapping&&(c=!0),this.editorWidth=t.scrollDOM.clientWidth,u|=16);let m=g3e(this.view.contentDOM,!1).y;m!=this.scrollParent&&(this.scrollParent=m,this.scrollAnchorHeight=-1,this.scrollOffset=0);let g=this.getScrollOffset();this.scrollOffset!=g&&(this.scrollAnchorHeight=-1,this.scrollOffset=g),this.scrolledToBottom=y3e(this.scrollParent||t.win);let b=(this.printing?YPt:GPt)(n,this.paddingTop),v=b.top-this.pixelViewport.top,y=b.bottom-this.pixelViewport.bottom;this.pixelViewport=b;let w=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(w!=this.inView&&(this.inView=w,w&&(c=!0)),!this.inView&&!this.scrollTarget&&!XPt(t.dom))return 0;let x=l.width;if((this.contentDOMWidth!=x||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=t.scrollDOM.clientHeight,u|=16),c){let S=t.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(S)&&(o=!0),o||r.lineWrapping&&Math.abs(x-this.contentDOMWidth)>r.charWidth){let{lineHeight:O,charWidth:A,textHeight:E}=t.docView.measureTextSize();o=O>0&&r.refresh(s,O,A,E,Math.max(5,x/A),S),o&&(t.docView.minWidth=0,u|=16)}v>0&&y>0?d=Math.max(v,y):v<0&&y<0&&(d=Math.min(v,y)),Xie();for(let O of this.viewports){let A=O.from==this.viewport.from?S:t.docView.measureVisibleLineHeights(O);this.heightMap=(o?ic.empty().applyChanges(this.stateDeco,Or.empty,this.heightOracle,[new bd(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new zPt(O.from,A))}m1&&(u|=2)}let k=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return k&&(u&2&&(u|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),u|=this.updateForViewport()),(u&2||k)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,t)),u|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),u}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,n){let i=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,c=new q_(r.lineAt(o-i*1e3,xs.ByHeight,s,0,0).from,r.lineAt(l+(1-i)*1e3,xs.ByHeight,s,0,0).to);if(n){let{head:u}=n.range;if(uc.to){let d=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=r.lineAt(u,xs.ByPos,s,0,0),h;n.y=="center"?h=(f.top+f.bottom)/2-d/2:n.y=="start"||n.y=="nearest"&&u=l+Math.max(10,Math.min(i,250)))&&r>o-2*1e3&&s>1,o=r<<1;if(this.defaultTextDirection!=cs.LTR&&!i)return[];let l=[],c=(d,f,h,m)=>{if(f-dd&&yy.from>=h.from&&y.to<=h.to&&Math.abs(y.from-d)y.fromw));if(!v){if(fx.from<=f&&x.to>=f)){let x=n.moveToLineBoundary(pt.cursor(f),!1,!0).head;x>d&&(f=x)}let y=this.gapSize(h,d,f,m),w=i||y<2e6?y:2e6;v=new n$(d,f,y,w)}l.push(v)},u=d=>{if(d.length2e6)for(let O of t)O.from>=d.from&&O.fromd.from&&c(d.from,m,d,f),gn.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(t){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let i=[];Yi.spans(n,this.viewport.from,this.viewport.to,{span(s,o){i.push({from:s,to:o})},point(){}},20);let r=0;if(i.length!=this.visibleRanges.length)r=12;else for(let s=0;s=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(n=>n.from<=t&&n.to>=t)||wS(this.heightMap.lineAt(t,xs.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=t&&n.bottom>=t)||wS(this.heightMap.lineAt(this.scaler.fromDOM(t),xs.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(t){let n=this.lineBlockAtHeight(t+8);return n.from>=this.viewport.from||this.viewportLines[0].top-t>200?n:this.viewportLines[0]}elementAtHeight(t){return wS(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}let q_=class{constructor(t,n){this.from=t,this.to=n}};function JPt(e,t,n){let i=[],r=e,s=0;return Yi.spans(n,e,t,{span(){},point(o,l){o>r&&(i.push({from:r,to:o}),s+=o-r),r=l}},20),r=1)return t[t.length-1].to;let i=Math.floor(e*n);for(let r=0;;r++){let{from:s,to:o}=t[r],l=o-s;if(i<=l)return s+i;i-=l}}function K_(e,t){let n=0;for(let{from:i,to:r}of e.ranges){if(t<=r){n+=t-i;break}n+=r-i}return n/e.total}function eDt(e,t){for(let n of e)if(t(n))return n}const Jie={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function ere(e){let t=e.facet(KM).filter(i=>typeof i!="function"),n=e.facet(Kq).filter(i=>typeof i!="function");return n.length&&t.push(Yi.join(n)),t}class Zq{constructor(t,n,i){let r=0,s=0,o=0;this.viewports=i.map(({from:l,to:c})=>{let u=n.lineAt(l,xs.ByPos,t,0,0).top,d=n.lineAt(c,xs.ByPos,t,0,0).bottom;return r+=d-u,{from:l,to:c,top:u,bottom:d,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(n.height-r);for(let l of this.viewports)l.domTop=o+(l.top-s)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),s=l.bottom}toDOM(t){for(let n=0,i=0,r=0;;n++){let s=nn.from==t.viewports[i].from&&n.to==t.viewports[i].to):!1}}function wS(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),i=t.toDOM(e.bottom);return new sf(e.from,e.length,n,i-n,Array.isArray(e._content)?e._content.map(r=>wS(r,t)):e._content)}const G_=pn.define({combine:e=>e.join(" ")}),W9=pn.define({combine:e=>e.indexOf(!0)>-1}),K9=db.newName(),t4e=db.newName(),n4e=db.newName(),i4e={"&light":"."+t4e,"&dark":"."+n4e};function G9(e,t,n){return new db(t,{finish(i){return/&/.test(i)?i.replace(/&\w*/,r=>{if(r=="&")return e;if(!n||!n[r])throw new RangeError(`Unsupported selector: ${r}`);return n[r]}):e+" "+i}})}const tDt=G9("."+K9,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},i4e),nDt={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},i$=dn.ie&&dn.ie_version<=11;class iDt{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new RIt,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(n=>{for(let i of n)this.queue.push(i);(dn.ie&&dn.ie_version<=11||dn.ios&&t.composing)&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&dn.android&&t.constructor.EDIT_CONTEXT!==!1&&!(dn.chrome&&dn.chrome_version<126)&&(this.editContext=new sDt(t),t.state.facet(kp)&&(t.contentDOM.editContext=this.editContext.editContext)),i$&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(t){(t.type=="change"||!t.type)&&!t.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((n,i)=>n!=t[i]))){this.gapIntersection.disconnect();for(let n of t)this.gapIntersection.observe(n);this.gaps=t}}onSelectionChange(t){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,r=this.selectionRange;if(i.state.facet(kp)?i.root.activeElement!=this.dom:!OE(this.dom,r))return;let s=r.anchorNode&&i.docView.tile.nearest(r.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(t)){n||(this.selectionChanged=!1);return}(dn.ie&&dn.ie_version<=11||dn.android&&dn.chrome)&&!i.state.selection.main.empty&&r.focusNode&&EE(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,n=BC(t.root);if(!n)return!1;let i=dn.safari&&t.root.nodeType==11&&t.root.activeElement==this.dom&&rDt(this.view,n)||n;if(!i||this.selectionRange.eq(i))return!1;let r=OE(this.dom,i);return r&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&xw(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||t=="Enter")&&(this.delayedAndroidKey={key:t,keyCode:n,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let n=-1,i=-1,r=!1;for(let s of t){let o=this.readMutation(s);o&&(o.typeOver&&(r=!0),n==-1?{from:n,to:i}=o:(n=Math.min(o.from,n),i=Math.max(o.to,i)))}return{from:n,to:i,typeOver:r}}readChange(){let{from:t,to:n,typeOver:i}=this.processRecords(),r=this.selectionChanged&&OE(this.dom,this.selectionRange);if(t<0&&!r)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new wPt(this.view,t,n,i);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let i=this.view.state,r=V3e(this.view,n);return this.view.state==i&&(n.domChanged||n.newSel&&!qI(this.view.state.selection,n.newSel.main))&&this.view.update([]),r}readMutation(t){let n=this.view.docView.tile.nearest(t.target);if(!n||n.isWidget())return null;if(n.markDirty(t.type=="attributes"),t.type=="childList"){let i=tre(n,t.previousSibling||t.target.previousSibling,-1),r=tre(n,t.nextSibling||t.target.nextSibling,1);return{from:i?n.posAfter(i):n.posAtStart,to:r?n.posBefore(r):n.posAtEnd,typeOver:!1}}else return t.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(kp)!=t.state.facet(kp)&&(t.view.contentDOM.editContext=t.state.facet(kp)?this.editContext.editContext:null))}destroy(){var t,n,i;this.stop(),(t=this.intersection)===null||t===void 0||t.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function tre(e,t,n){for(;t;){let i=ga.get(t);if(i&&i.parent==e)return i;let r=t.parentNode;t=r!=e.dom?r:n>0?t.nextSibling:t.previousSibling}return null}function nre(e,t){let n=t.startContainer,i=t.startOffset,r=t.endContainer,s=t.endOffset,o=e.docView.domAtPos(e.state.selection.main.anchor,1);return EE(o.node,o.offset,r,s)&&([n,i,r,s]=[r,s,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}}function rDt(e,t){if(t.getComposedRanges){let r=t.getComposedRanges(e.root)[0];if(r)return nre(e,r)}let n=null;function i(r){r.preventDefault(),r.stopImmediatePropagation(),n=r.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",i,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",i,!0),n?nre(e,n):null}class sDt{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);let n=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=i=>{let r=t.state.selection.main,{anchor:s,head:o}=r,l=this.toEditorPos(i.updateRangeStart),c=this.toEditorPos(i.updateRangeEnd);t.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:l,drifted:!1});let u=c-l>i.text.length;l==this.from&&sthis.to&&(c=s);let d=H3e(t.state.sliceDoc(l,c),i.text,(u?r.from:r.to)-l,u?"end":null);if(!d){let h=pt.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));qI(h,r)||t.dispatch({selection:h,userEvent:"select"});return}let f={from:d.from+l,to:d.toA+l,insert:Or.of(i.text.slice(d.from,d.toB).split(` +`))};if((dn.mac||dn.android)&&f.from==o-1&&/^\. ?$/.test(i.text)&&t.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:l,to:c,insert:Or.of([i.text.replace("."," ")])}),this.pendingContextChange=f,!t.state.readOnly){let h=this.to-this.from+(f.to-f.from+f.insert.length);Xq(t,f,pt.single(this.toEditorPos(i.selectionStart,h),this.toEditorPos(i.selectionEnd,h)))}this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state)),f.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(n.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let r=[],s=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o{let r=[];for(let s of i.getTextFormats()){let o=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let c=this.toEditorPos(s.rangeStart),u=this.toEditorPos(s.rangeEnd);if(c{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(t.state)}};for(let i in this.handlers)n.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{let r=BC(i.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let n=0,i=!1,r=this.pendingContextChange;return t.changes.iterChanges((s,o,l,c,u)=>{if(i)return;let d=u.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(u)){r=this.pendingContextChange=null,n+=d,this.to+=d;return}else r=null,this.revertPending(t.state);if(s+=n,o+=n,o<=this.from)this.from+=d,this.to+=d;else if(sthis.to||this.to-this.from+u.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),u.toString()),this.to+=d}n+=d}),r&&!i&&this.revertPending(t.state),!i}update(t){let n=this.pendingContextChange,i=t.startState.selection.main;this.composing&&(this.composing.drifted||!t.changes.touchesRange(i.from,i.to)&&t.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):!this.applyEdits(t)||!this.rangeIsValid(t.state)?(this.pendingContextChange=null,this.reset(t.state)):(t.docChanged||t.selectionSet||n)&&this.setSelection(t.state),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:n}=t.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(t.doc.length,n+1e4)}reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t)}revertPending(t){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),t.doc.sliceString(n.from,n.to))}setSelection(t){let{main:n}=t.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),r=this.toContextPos(n.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(i,r)}rangeIsValid(t){let{head:n}=t.selection.main;return!(this.from>0&&n-this.from<500||this.to1e4*3)}toEditorPos(t,n=this.to-this.from){t=Math.min(t,n);let i=this.composing;return i&&i.drifted?i.editorBase+(t-i.contextBase):t+this.from}toContextPos(t){let n=this.composing;return n&&n.drifted?n.contextBase+(t-n.editorBase):t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class Jt{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:i}=t;this.dispatchTransactions=t.dispatchTransactions||i&&(r=>r.forEach(s=>i(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=t.root||IIt(t.parent)||document,this.viewState=new Zie(this,t.state||sr.create(t)),t.scrollTo&&t.scrollTo.is(z_)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Ux).map(r=>new Y4(r));for(let r of this.plugins)r.update(this);this.observer=new iDt(this),this.inputState=new EPt(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Fie(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...t){let n=t.length==1&&t[0]instanceof Ya?t:t.length==1&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(n,this)}update(t){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,i=!1,r,s=this.state;for(let h of t){if(h.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=h.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,l=0,c=null;t.some(h=>h.annotation(Y3e))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,c=Z3e(s,o),c||(l=1));let u=this.observer.delayedAndroidKey,d=null;if(u?(this.observer.clearDelayedAndroidKey(),d=this.observer.readChange(),(d&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(d=null)):this.observer.clear(),s.facet(sr.phrases)!=this.state.facet(sr.phrases))return this.setState(s);r=zI.create(this,s,t),r.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let h of t){if(f&&(f=f.map(h.changes)),h.scrollIntoView){let{main:m}=h.state.selection,{x:g,y:b}=this.state.facet(Jt.cursorScrollMargin);f=new ww(m.empty?m:pt.cursor(m.head,m.head>m.anchor?-1:1),"nearest","nearest",b,g)}for(let m of h.effects)m.is(z_)&&(f=m.value.clip(this.state))}this.viewState.update(r,f),this.bidiCache=KI.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),n=this.docView.update(r),this.state.facet(xS)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(n,t.some(h=>h.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(G_)!=r.state.facet(G_)&&(this.viewState.mustMeasureContent=!0),(n||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!r.empty)for(let h of this.state.facet(Q9))try{h(r)}catch(m){Rc(this.state,m,"update listener")}(c||d)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),d&&!V3e(this,d)&&u.force&&xw(this.contentDOM,u.key,u.keyCode)})}setState(t){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=t;return}this.updateState=2;let n=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new Zie(this,t),this.plugins=t.facet(Ux).map(i=>new Y4(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new Fie(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(t){let n=t.startState.facet(Ux),i=t.state.facet(Ux);if(n!=i){let r=[];for(let s of i){let o=n.indexOf(s);if(o<0)r.push(new Y4(s));else{let l=this.plugins[o];l.mustUpdate=t,r.push(l)}}for(let s of this.plugins)s.mustUpdate!=t&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=t;for(let r=0;r-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,t&&this.observer.forceFlush();let n=null,i=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(y3e(i||this.win))s=-1,o=this.viewState.heightMap.height;else{let m=this.viewState.scrollAnchorAt(r);s=m.from,o=m.top}this.updateState=1;let c=this.viewState.measure();if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let u=[];c&4||([this.measureRequests,u]=[u,this.measureRequests]);let d=u.map(m=>{try{return m.read(this)}catch(g){return Rc(this.state,g),ire}}),f=zI.create(this,this.state,[]),h=!1;f.flags|=c,n?n.flags|=c:n=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),h=this.docView.update(f),h&&this.docViewUpdate());for(let m=0;m1||g<-1)&&!(dn.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r=r+g,i?i.scrollTop+=g:this.win.scrollBy(0,g),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let l of this.state.facet(Q9))l(n)}get themeClasses(){return K9+" "+(this.state.facet(W9)?n4e:t4e)+" "+this.state.facet(G_)}updateAttrs(){let t=rre(this,M3e,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(kp)?"true":"false",class:"cm-content",style:`${dn.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),rre(this,Wq,n);let i=this.observer.ignore(()=>{let r=Iie(this.contentDOM,this.contentAttrs,n),s=Iie(this.dom,this.editorAttrs,t);return r||s});return this.editorAttrs=t,this.contentAttrs=n,i}showAnnouncements(t){let n=!0;for(let i of t)for(let r of i.effects)if(r.is(Jt.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(xS);let t=this.state.facet(Jt.cspNonce);db.mount(this.root,this.styleModules.concat(tDt).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(this.measureRequests.indexOf(t)>-1)return;if(t.key!=null){for(let n=0;ni.plugin==t)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,n,i){return t$(this,t,Bie(this,t,n,i))}moveByGroup(t,n){return t$(this,t,Bie(this,t,n,i=>mPt(this,t.head,i)))}visualLineSide(t,n){let i=this.bidiSpans(t),r=this.textDirectionAt(t.from),s=i[n?i.length-1:0];return pt.cursor(s.side(n,r)+t.from,s.forward(!n,r)?1:-1)}moveToLineBoundary(t,n,i=!0){return pPt(this,t,n,i)}moveVertically(t,n,i){return t$(this,t,gPt(this,t,n,i))}domAtPos(t,n=1){return this.docView.domAtPos(t,n)}posAtDOM(t,n=0){return this.docView.posFromDOM(t,n)}posAtCoords(t,n=!0){this.readMeasured();let i=H9(this,t,n);return i&&i.pos}posAndSideAtCoords(t,n=!0){return this.readMeasured(),H9(this,t,n)}coordsAtPos(t,n=1){this.readMeasured();let i=this.state.doc.lineAt(t),r=this.bidiSpans(i),s=r[uh.find(r,t-i.from,-1,n)];return this.docView.coordsAt(t,n,s.dir==cs.RTL)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(R3e)||tthis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>aDt)return S3e(t.length);let n=this.textDirectionAt(t.from),i;for(let s of this.bidiCache)if(s.from==t.from&&s.dir==n&&(s.fresh||O3e(s.isolates,i=Mie(this,t))))return s.order;i||(i=Mie(this,t));let r=UIt(t.text,n,i);return this.bidiCache.push(new KI(t.from,t.to,n,i,!0,r)),r}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||dn.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{b3e(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((t.nodeType==9?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,n={}){var i,r,s,o;return z_.of(new ww(typeof t=="number"?pt.cursor(t):t,(i=n.y)!==null&&i!==void 0?i:"nearest",(r=n.x)!==null&&r!==void 0?r:"nearest",(s=n.yMargin)!==null&&s!==void 0?s:5,(o=n.xMargin)!==null&&o!==void 0?o:5))}scrollSnapshot(){let{scrollTop:t,scrollLeft:n}=this.scrollDOM,i=this.viewState.scrollAnchorAt(t);return z_.of(new ww(pt.cursor(i.from),"start","start",i.top-t,n,!0))}setTabFocusMode(t){t==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof t=="boolean"?this.inputState.tabFocusMode=t?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return ba.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return ba.define(()=>({}),{eventObservers:t})}static theme(t,n){let i=db.newName(),r=[G_.of(i),xS.of(G9(`.${i}`,t))];return n&&n.dark&&r.push(W9.of(!0)),r}static baseTheme(t){return ym.lowest(xS.of(G9("."+K9,t,i4e)))}static findFromDOM(t){var n;let i=t.querySelector(".cm-content"),r=i&&ga.get(i)||ga.get(t);return((n=r==null?void 0:r.root)===null||n===void 0?void 0:n.view)||null}}Jt.styleModule=xS;Jt.inputHandler=j3e;Jt.clipboardInputFilter=Hq;Jt.clipboardOutputFilter=qq;Jt.scrollHandler=P3e;Jt.focusChangeEffect=N3e;Jt.perLineTextDirection=R3e;Jt.exceptionSink=_3e;Jt.updateListener=Q9;Jt.editable=kp;Jt.mouseSelectionStyle=T3e;Jt.dragMovesSelection=A3e;Jt.clickAddsSelectionRange=C3e;Jt.decorations=KM;Jt.blockWrappers=L3e;Jt.outerDecorations=Kq;Jt.atomicRanges=IT;Jt.bidiIsolatedRanges=$3e;Jt.cursorScrollMargin=pn.define({combine:e=>{let t=5,n=5;for(let i of e)typeof i=="number"?t=n=i:{x:t,y:n}=i;return{x:t,y:n}}});Jt.scrollMargins=F3e;Jt.darkTheme=W9;Jt.cspNonce=pn.define({combine:e=>e.length?e[0]:""});Jt.contentAttributes=Wq;Jt.editorAttributes=M3e;Jt.lineWrapping=Jt.contentAttributes.of({class:"cm-lineWrapping"});Jt.announce=hi.define();const aDt=4096,ire={};class KI{constructor(t,n,i,r,s,o){this.from=t,this.to=n,this.dir=i,this.isolates=r,this.fresh=s,this.order=o}static update(t,n){if(n.empty&&!t.some(s=>s.fresh))return t;let i=[],r=t.length?t[t.length-1].dir:cs.LTR;for(let s=Math.max(0,t.length-10);s=0;r--){let s=i[r],o=typeof s=="function"?s(e):s;o&&Qq(o,n)}return n}const oDt=dn.mac?"mac":dn.windows?"win":dn.linux?"linux":"key";function lDt(e,t){const n=e.split(/-(?!$)/);let i=n[n.length-1];i=="Space"&&(i=" ");let r,s,o,l;for(let c=0;ci.concat(r),[]))),n}function uDt(e,t,n){return s4e(r4e(e.state),t,e,n)}let ag=null;const dDt=4e3;function fDt(e,t=oDt){let n=Object.create(null),i=Object.create(null),r=(o,l)=>{let c=i[o];if(c==null)i[o]=l;else if(c!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,l,c,u,d)=>{var f,h;let m=n[o]||(n[o]=Object.create(null)),g=l.split(/ (?!$)/).map(y=>lDt(y,t));for(let y=1;y{let k=ag={view:x,prefix:w,scope:o};return setTimeout(()=>{ag==k&&(ag=null)},dDt),!0}]})}let b=g.join(" ");r(b,!1);let v=m[b]||(m[b]={preventDefault:!1,stopPropagation:!1,run:((h=(f=m._any)===null||f===void 0?void 0:f.run)===null||h===void 0?void 0:h.slice())||[]});c&&v.run.push(c),u&&(v.preventDefault=!0),d&&(v.stopPropagation=!0)};for(let o of e){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let u of l){let d=n[u]||(n[u]=Object.create(null));d._any||(d._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let h in d)d[h].run.push(m=>f(m,X9))}let c=o[t]||o.key;if(c)for(let u of l)s(u,c,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(u,"Shift-"+c,o.shift,o.preventDefault,o.stopPropagation)}return n}let X9=null;function s4e(e,t,n,i){X9=t;let r=CIt(t),s=Ac(r,0),o=nh(s)==r.length&&r!=" ",l="",c=!1,u=!1,d=!1;ag&&ag.view==n&&ag.scope==i&&(l=ag.prefix+" ",W3e.indexOf(t.keyCode)<0&&(u=!0,ag=null));let f=new Set,h=v=>{if(v){for(let y of v.run)if(!f.has(y)&&(f.add(y),y(n)))return v.stopPropagation&&(d=!0),!0;v.preventDefault&&(v.stopPropagation&&(d=!0),u=!0)}return!1},m=e[i],g,b;return m&&(h(m[l+X_(r,t,!o)])?c=!0:o&&(t.altKey||t.metaKey||t.ctrlKey)&&!(dn.windows&&t.ctrlKey&&t.altKey)&&!(dn.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(g=fb[t.keyCode])&&g!=r?(h(m[l+X_(g,t,!0)])||t.shiftKey&&(b=$C[t.keyCode])!=r&&b!=g&&h(m[l+X_(b,t,!1)]))&&(c=!0):o&&t.shiftKey&&h(m[l+X_(r,t,!0)])&&(c=!0),!c&&h(m._any)&&(c=!0)),u&&(c=!0),c&&d&&t.stopPropagation(),X9=null,c}class Ky{constructor(t,n,i,r,s){this.className=t,this.left=n,this.top=i,this.width=r,this.height=s}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,n){return n.className!=this.className?!1:(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",this.width!=null&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,n,i){if(i.empty){let r=t.coordsAtPos(i.head,i.assoc||1);if(!r)return[];let s=a4e(t);return[new Ky(n,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return hDt(t,n,i)}}function a4e(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==cs.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function are(e,t,n,i){let r=e.coordsAtPos(t,n*2);if(!r)return i;let s=e.dom.getBoundingClientRect(),o=(r.top+r.bottom)/2,l=e.posAtCoords({x:s.left+1,y:o}),c=e.posAtCoords({x:s.right-1,y:o});return l==null||c==null?i:{from:Math.max(i.from,Math.min(l,c)),to:Math.min(i.to,Math.max(l,c))}}function hDt(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let i=Math.max(n.from,e.viewport.from),r=Math.min(n.to,e.viewport.to),s=e.textDirection==cs.LTR,o=e.contentDOM,l=o.getBoundingClientRect(),c=a4e(e),u=o.querySelector(".cm-line"),d=u&&window.getComputedStyle(u),f=l.left+(d?parseInt(d.paddingLeft)+Math.min(0,parseInt(d.textIndent)):0),h=l.right-(d?parseInt(d.paddingRight):0),m=V9(e,i,1),g=V9(e,r,-1),b=m.type==ul.Text?m:null,v=g.type==ul.Text?g:null;if(b&&(e.lineWrapping||m.widgetLineBreaks)&&(b=are(e,i,1,b)),v&&(e.lineWrapping||g.widgetLineBreaks)&&(v=are(e,r,-1,v)),b&&v&&b.from==v.from&&b.to==v.to)return w(x(n.from,n.to,b));{let S=b?x(n.from,null,b):k(m,!1),O=v?x(null,n.to,v):k(g,!0),A=[];return(b||m).to<(v||g).from-(b&&v?1:0)||m.widgetLineBreaks>1&&S.bottom+e.defaultLineHeight/2C&&P.from=D)break;M>I&&R(Math.max(F,I),S==null&&F<=C,Math.min(M,D),O==null&&M>=N,L.dir)}if(I=_.to+1,I>=D)break}return T.length==0&&R(C,S==null,N,O==null,e.textDirection),{top:E,bottom:j,horizontal:T}}function k(S,O){let A=l.top+(O?S.top:S.bottom);return{top:A,bottom:A,horizontal:[]}}}function pDt(e,t){return e.constructor==t.constructor&&e.eq(t)}class mDt{constructor(t,n){this.view=t,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,t)}update(t){t.startState.facet(BN)!=t.state.facet(BN)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){this.layer.updateOnDocViewUpdate!==!1&&t.requestMeasure(this.measureReq)}setOrder(t){let n=0,i=t.facet(BN);for(;n!pDt(n,this.drawn[i]))){let n=this.dom.firstChild,i=0;for(let r of t)r.update&&n&&r.constructor&&this.drawn[i].constructor&&r.update(n,this.drawn[i])?(n=n.nextSibling,i++):this.dom.insertBefore(r.draw(),n);for(;n;){let r=n.nextSibling;n.remove(),n=r}this.drawn=t,dn.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const BN=pn.define();function o4e(e){return[ba.define(t=>new mDt(t,e)),BN.of(e)]}const g1=pn.define({combine(e){return Mh(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(t,n)=>Math.min(t,n),drawRangeCursor:(t,n)=>t||n})}});function gDt(e={}){return[g1.of(e),bDt,yDt,vDt,I3e.of(!0)]}function l4e(e){return e.startState.facet(g1)!=e.state.facet(g1)}const bDt=o4e({above:!0,markers(e){let{state:t}=e,n=t.facet(g1),i=[];for(let r of t.selection.ranges){let s=r==t.selection.main;if(r.empty||n.drawRangeCursor&&!(s&&dn.ios&&n.iosSelectionHandles)){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=r.empty?r:pt.cursor(r.head,r.assoc);for(let c of Ky.forRange(e,o,l))i.push(c)}}return i},update(e,t){e.transactions.some(i=>i.selection)&&(t.style.animationName=t.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=l4e(e);return n&&ore(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){ore(t.state,e)},class:"cm-cursorLayer"});function ore(e,t){t.style.animationDuration=e.facet(g1).cursorBlinkRate+"ms"}const yDt=o4e({above:!1,markers(e){let t=[],{main:n,ranges:i}=e.state.selection;for(let r of i)if(!r.empty)for(let s of Ky.forRange(e,"cm-selectionBackground",r))t.push(s);if(dn.ios&&!n.empty&&e.state.facet(g1).iosSelectionHandles){for(let r of Ky.forRange(e,"cm-selectionHandle cm-selectionHandle-start",pt.cursor(n.from,1)))t.push(r);for(let r of Ky.forRange(e,"cm-selectionHandle cm-selectionHandle-end",pt.cursor(n.to,1)))t.push(r)}return t},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||l4e(e)},class:"cm-selectionLayer"}),vDt=ym.highest(Jt.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),c4e=hi.define({map(e,t){return e==null?null:t.mapPos(e)}}),kS=pl.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((n,i)=>i.is(c4e)?i.value:n,e)}}),xDt=ba.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(kS);n==null?this.cursor!=null&&((t=this.cursor)===null||t===void 0||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(kS)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(kS),n=t!=null&&e.coordsAtPos(t);if(!n)return null;let i=e.scrollDOM.getBoundingClientRect();return{left:n.left-i.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-i.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(kS)!=e&&this.view.dispatch({effects:c4e.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){(e.target==this.view.contentDOM||!this.view.contentDOM.contains(e.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function wDt(){return[kS,xDt]}function lre(e,t,n,i,r){t.lastIndex=0;for(let s=e.iterRange(n,i),o=n,l;!s.next().done;o+=s.value.length)if(!s.lineBreak)for(;l=t.exec(s.value);)r(o+l.index,l)}function kDt(e,t){let n=e.visibleRanges;if(n.length==1&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let i=[];for(let{from:r,to:s}of n)r=Math.max(e.state.doc.lineAt(r).from,r-t),s=Math.min(e.state.doc.lineAt(s).to,s+t),i.length&&i[i.length-1].to>=r?i[i.length-1].to=s:i.push({from:r,to:s});return i}class ODt{constructor(t){const{regexp:n,decoration:i,decorate:r,boundary:s,maxLength:o=1e3}=t;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,r)this.addMatch=(l,c,u,d)=>r(d,u,u+l[0].length,l,c);else if(typeof i=="function")this.addMatch=(l,c,u,d)=>{let f=i(l,c,u);f&&d(u,u+l[0].length,f)};else if(i)this.addMatch=(l,c,u,d)=>d(u,u+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=o}createDeco(t){let n=new im,i=n.add.bind(n);for(let{from:r,to:s}of kDt(t,this.maxLength))lre(t.state.doc,this.regexp,r,s,(o,l)=>this.addMatch(l,t,o,i));return n.finish()}updateDeco(t,n){let i=1e9,r=-1;return t.docChanged&&t.changes.iterChanges((s,o,l,c)=>{c>=t.view.viewport.from&&l<=t.view.viewport.to&&(i=Math.min(l,i),r=Math.max(c,r))}),t.viewportMoved||r-i>1e3?this.createDeco(t.view):r>-1?this.updateRange(t.view,n.map(t.changes),i,r):n}updateRange(t,n,i,r){for(let s of t.visibleRanges){let o=Math.max(s.from,i),l=Math.min(s.to,r);if(l>=o){let c=t.state.doc.lineAt(o),u=c.toc.from;o--)if(this.boundary.test(c.text[o-1-c.from])){d=o;break}for(;lh.push(y.range(b,v));if(c==u)for(this.regexp.lastIndex=d-c.from;(m=this.regexp.exec(c.text))&&m.indexthis.addMatch(v,t,b,g));n=n.update({filterFrom:d,filterTo:f,filter:(b,v)=>bf,add:h})}}return n}}const Y9=/x/.unicode!=null?"gu":"g",SDt=new RegExp(`[\0-\b +--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Y9),EDt={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let r$=null;function CDt(){var e;if(r$==null&&typeof document<"u"&&document.body){let t=document.body.style;r$=((e=t.tabSize)!==null&&e!==void 0?e:t.MozTabSize)!=null}return r$||!1}const UN=pn.define({combine(e){let t=Mh(e,{render:null,specialChars:SDt,addSpecialChars:null});return(t.replaceTabs=!CDt())&&(t.specialChars=new RegExp(" |"+t.specialChars.source,Y9)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,Y9)),t}});function ADt(e={}){return[UN.of(e),TDt()]}let cre=null;function TDt(){return cre||(cre=ba.fromClass(class{constructor(e){this.view=e,this.decorations=$n.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(UN)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new ODt({regexp:e.specialChars,decoration:(t,n,i)=>{let{doc:r}=n.state,s=Ac(t[0],0);if(s==9){let o=r.lineAt(i),l=n.state.tabSize,c=vf(o.text,l,i-o.from);return $n.replace({widget:new RDt((l-c%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=$n.replace({widget:new NDt(e,s)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(UN);e.startState.facet(UN)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))}const _Dt="•";function jDt(e){return e>=32?_Dt:e==10?"␤":String.fromCharCode(9216+e)}class NDt extends Tf{constructor(t,n){super(),this.options=t,this.code=n}eq(t){return t.code==this.code}toDOM(t){let n=jDt(this.code),i=t.state.phrase("Control character")+" "+(EDt[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,i,n);if(r)return r;let s=document.createElement("span");return s.textContent=n,s.title=i,s.setAttribute("aria-label",i),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class RDt extends Tf{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent=" ",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}function IDt(){return DDt}const PDt=$n.line({class:"cm-activeLine"}),DDt=ba.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let i of e.state.selection.ranges){let r=e.lineBlockAt(i.head);r.from>t&&(n.push(PDt.range(r.from)),t=r.from)}return $n.set(n)}},{decorations:e=>e.decorations});class MDt extends Tf{constructor(t){super(),this.content=t}toDOM(t){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(t):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(t){let n=t.firstChild?SE(t.firstChild):[];if(!n.length)return null;let i=window.getComputedStyle(t.parentNode),r=UC(n[0],i.direction!="rtl"),s=parseInt(i.lineHeight);return r.bottom-r.top>s*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+s}:r}ignoreEvent(){return!1}}function LDt(e){let t=ba.fromClass(class{constructor(n){this.view=n,this.placeholder=e?$n.set([$n.widget({widget:new MDt(e),side:1}).range(0)]):$n.none}get decorations(){return this.view.state.doc.length?$n.none:this.placeholder}},{decorations:n=>n.decorations});return typeof e=="string"?[t,Jt.contentAttributes.of({"aria-placeholder":e})]:t}const Z9=2e3;function $Dt(e,t,n){let i=Math.min(t.line,n.line),r=Math.max(t.line,n.line),s=[];if(t.off>Z9||n.off>Z9||t.col<0||n.col<0){let o=Math.min(t.off,n.off),l=Math.max(t.off,n.off);for(let c=i;c<=r;c++){let u=e.doc.line(c);u.length<=l&&s.push(pt.range(u.from+o,u.to+l))}}else{let o=Math.min(t.col,n.col),l=Math.max(t.col,n.col);for(let c=i;c<=r;c++){let u=e.doc.line(c),d=N9(u.text,o,e.tabSize,!0);if(d<0)s.push(pt.cursor(u.to));else{let f=N9(u.text,l,e.tabSize);s.push(pt.range(u.from+d,u.from+f))}}}return s}function FDt(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function ure(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),i=e.state.doc.lineAt(n),r=n-i.from,s=r>Z9?-1:r==i.length?FDt(e,t.clientX):vf(i.text,e.state.tabSize,n-i.from);return{line:i.number,col:s,off:r}}function BDt(e,t){let n=ure(e,t),i=e.state.selection;return n?{update(r){if(r.docChanged){let s=r.changes.mapPos(r.startState.doc.line(n.line).from),o=r.state.doc.lineAt(s);n={line:o.number,col:n.col,off:Math.min(n.off,o.length)},i=i.map(r.changes)}},get(r,s,o){let l=ure(e,r);if(!l)return i;let c=$Dt(e.state,n,l);return c.length?o?pt.create(c.concat(i.ranges)):pt.create(c):i}}:null}function UDt(e){let t=n=>n.altKey&&n.button==0;return Jt.mouseSelectionStyle.of((n,i)=>t(i)?BDt(n,i):null)}const QDt={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},zDt={style:"cursor: crosshair"};function VDt(e={}){let[t,n]=QDt[e.key||"Alt"],i=ba.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==t||n(r))},keyup(r){(r.keyCode==t||!n(r))&&this.set(!1)},mousemove(r){this.set(n(r))}}});return[i,Jt.contentAttributes.of(r=>{var s;return!((s=r.plugin(i))===null||s===void 0)&&s.isDown?zDt:null})]}const Y_="-10000px";class u4e{constructor(t,n,i,r){this.facet=n,this.createTooltipView=i,this.removeTooltipView=r,this.input=t.state.facet(n),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=i(o,s))}update(t,n){var i;let r=t.state.facet(this.facet),s=r.filter(c=>c);if(r===this.input){for(let c of this.tooltipViews)c.update&&c.update(t);return!1}let o=[],l=n?[]:null;for(let c=0;cn[u]=c),n.length=l.length),this.input=r,this.tooltips=s,this.tooltipViews=o,!0}}function HDt(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}const s$=pn.define({combine:e=>{var t,n,i;return{position:dn.ios?"absolute":((t=e.find(r=>r.position))===null||t===void 0?void 0:t.position)||"fixed",parent:((n=e.find(r=>r.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((i=e.find(r=>r.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||HDt}}}),dre=new WeakMap,Jq=ba.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(s$);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new u4e(e,eW,(n,i)=>this.createTooltip(n,i),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,i=e.state.facet(s$);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;n=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),i=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",n.dom.appendChild(r)}return n.dom.style.position=this.position,n.dom.style.top=Y_,n.dom.style.left="0px",this.container.insertBefore(n.dom,i),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(e=i.destroy)===null||e===void 0||e.call(i);this.parent&&this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(dn.safari){let o=s.getBoundingClientRect();n=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else n=!!s.offsetParent&&s.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(e=s.width/this.parent.offsetWidth,t=s.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),r=Gq(this.view);return{visible:{left:i.left+r.left,top:i.top+r.top,right:i.right-r.right,bottom:i.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(s$).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:n,space:i,scaleX:r,scaleY:s}=e,o=[];for(let l=0;l=Math.min(n.bottom,i.bottom)||f.rightMath.min(n.right,i.right)+.1)){d.style.top=Y_;continue}let m=c.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,g=m?7:0,b=h.right-h.left,v=(t=dre.get(u))!==null&&t!==void 0?t:h.bottom-h.top,y=u.offset||WDt,w=this.view.textDirection==cs.LTR,x=h.width>i.right-i.left?w?i.left:i.right-h.width:w?Math.max(i.left,Math.min(f.left-(m?14:0)+y.x,i.right-b)):Math.min(Math.max(i.left,f.left-b+(m?14:0)-y.x),i.right-b),k=this.above[l];!c.strictSide&&(k?f.top-v-g-y.yi.bottom)&&k==i.bottom-f.bottom>f.top-i.top&&(k=this.above[l]=!k);let S=(k?f.top-i.top:i.bottom-f.bottom)-g;if(Sx&&E.topO&&(O=k?E.top-v-2-g:E.bottom+g+2);if(this.position=="absolute"?(d.style.top=(O-e.parent.top)/s+"px",fre(d,(x-e.parent.left)/r)):(d.style.top=O/s+"px",fre(d,x/r)),m){let E=f.left+(w?y.x:-y.x)-(x+14-7);m.style.left=E/r+"px"}u.overlap!==!0&&o.push({left:x,top:O,right:A,bottom:O+v}),d.classList.toggle("cm-tooltip-above",k),d.classList.toggle("cm-tooltip-below",!k),u.positioned&&u.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=Y_}},{eventObservers:{scroll(){this.maybeMeasure()}}});function fre(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}const qDt=Jt.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),WDt={x:0,y:0},eW=pn.define({enables:[Jq,qDt]}),GI=pn.define({combine:e=>e.reduce((t,n)=>t.concat(n),[])});class ZM{static create(t){return new ZM(t)}constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new u4e(t,GI,(n,i)=>this.createHostedView(n,i),n=>n.dom.remove())}createHostedView(t,n){let i=t.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(t){for(let n of this.manager.tooltipViews)n.mount&&n.mount(t);this.mounted=!0}positioned(t){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(t)}update(t){this.manager.update(t)}destroy(){var t;for(let n of this.manager.tooltipViews)(t=n.destroy)===null||t===void 0||t.call(n)}passProp(t){let n;for(let i of this.manager.tooltipViews){let r=i[t];if(r!==void 0){if(n===void 0)n=r;else if(n!==r)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const KDt=eW.compute([GI],e=>{let t=e.facet(GI);return t.length===0?null:{pos:Math.min(...t.map(n=>n.pos)),end:Math.max(...t.map(n=>{var i;return(i=n.end)!==null&&i!==void 0?i:n.pos})),create:ZM.create,above:t[0].above,arrow:t.some(n=>n.arrow)}}),d4e=pn.define();class GDt{constructor(t,n,i,r,s,o){this.view=t,this.source=n,this.field=i,this.locked=r,this.setHover=s,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(t){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let t=Date.now()-this.lastMove.time;to.bottom||n.xo.right+t.defaultCharacterWidth)return;let l=t.bidiSpans(t.state.doc.lineAt(r)).find(u=>u.from<=r&&u.to>=r),c=l&&l.dir==cs.RTL?-1:1;s=n.x{if(l&&!(Array.isArray(l)&&!l.length)){let c=Array.isArray(l)?l:[l];r&&this.locked.set(c,r),t.dispatch({effects:this.setHover.of(c)})}};if(s&&"then"in s){let l=this.pending={pos:n};s.then(c=>{this.pending==l&&(this.pending=null,o(c))},c=>Rc(t.state,c,"hover tooltip"))}else o(s)}get tooltip(){let t=this.view.plugin(Jq),n=t?t.manager.tooltips.findIndex(i=>i.create==ZM.create):-1;return n>-1?t.manager.tooltipViews[n]:null}mousemove(t){var n,i;this.lastMove={x:t.clientX,y:t.clientY,target:t.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:s}=this;if(r.length&&!this.locked.has(r)&&s&&!XDt(s.dom,t)||this.pending){let{pos:o}=r[0]||this.pending,l=(i=(n=r[0])===null||n===void 0?void 0:n.end)!==null&&i!==void 0?i:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!YDt(this.view,o,l,t.clientX,t.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(t){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length&&!this.locked.has(n)){let{tooltip:i}=this;i&&i.dom.contains(t.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(t){let n=i=>{t.removeEventListener("mouseleave",n);let{active:r}=this;r.length&&!this.locked.has(r)&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};t.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const Z_=4;function XDt(e,t){let{left:n,right:i,top:r,bottom:s}=e.getBoundingClientRect(),o;if(o=e.querySelector(".cm-tooltip-arrow")){let l=o.getBoundingClientRect();r=Math.min(l.top,r),s=Math.max(l.bottom,s)}return t.clientX>=n-Z_&&t.clientX<=i+Z_&&t.clientY>=r-Z_&&t.clientY<=s+Z_}function YDt(e,t,n,i,r,s){let o=e.scrollDOM.getBoundingClientRect(),l=e.documentTop+e.documentPadding.top+e.contentHeight;if(o.left>i||o.rightr||Math.min(o.bottom,l)=t&&c<=n}function ZDt(e,t={}){let n=hi.define(),i=new WeakMap,r=pl.define({create(){return[]},update(o,l){let c=i.get(o);if(o.length&&(t.hideOnChange&&(l.docChanged||l.selection)?o=[]:c&&c(l)?o=[]:t.hideOn&&(o=o.filter(u=>!t.hideOn(l,u)))),l.docChanged&&o.length){let u=[];for(let d of o){let f=l.changes.mapPos(d.pos,-1,al.TrackDel);if(f!=null){let h=Object.assign(Object.create(null),d);h.pos=f,h.end!=null&&(h.end=l.changes.mapPos(h.end)),u.push(h)}}o=u}for(let u of l.effects)u.is(n)&&(o=u.value,c=void 0),(u.is(eMt)&&!u.value||u.value==r)&&(o=[]);return o.length&&c&&i.set(o,c),o},provide:o=>GI.from(o)});const s=ba.define(o=>new GDt(o,e,r,i,n,t.hoverTime||300));return{active:r,extension:[r,s,d4e.of(s),KDt]}}function JDt(e,t,n,i={}){var r;let s=e.state.facet(d4e).map(o=>e.plugin(o)).filter(o=>!!o);if(i.tooltip&&i.tooltip.active){let o=s.find(l=>l.field==i.tooltip.active);o&&(s=[o])}for(let o of s)o.activateHover(e,t,n,(r=i.until)!==null&&r!==void 0?r:()=>!1)}function f4e(e,t){let n=e.plugin(Jq);if(!n)return null;let i=n.manager.tooltips.indexOf(t);return i<0?null:n.manager.tooltipViews[i]}const eMt=hi.define(),hre=pn.define({combine(e){let t,n;for(let i of e)t=t||i.topContainer,n=n||i.bottomContainer;return{topContainer:t,bottomContainer:n}}});function tW(e,t){let n=e.plugin(h4e),i=n?n.specs.indexOf(t):-1;return i>-1?n.panels[i]:null}const h4e=ba.fromClass(class{constructor(e){this.input=e.state.facet(zC),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(e));let t=e.state.facet(hre);this.top=new J_(e,!0,t.topContainer),this.bottom=new J_(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(e){let t=e.state.facet(hre);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new J_(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new J_(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(zC);if(n!=this.input){let i=n.filter(c=>c),r=[],s=[],o=[],l=[];for(let c of i){let u=this.specs.indexOf(c),d;u<0?(d=c(e.view),l.push(d)):(d=this.panels[u],d.update&&d.update(e)),r.push(d),(d.top?s:o).push(d)}this.specs=i,this.panels=r,this.top.sync(s),this.bottom.sync(o);for(let c of l)c.dom.classList.add("cm-panel"),c.mount&&c.mount()}else for(let i of this.panels)i.update&&i.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>Jt.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class J_{constructor(t,n,i){this.view=t,this.top=n,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let n of this.panels)n.destroy&&t.indexOf(n)<0&&n.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let t=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;t!=n.dom;)t=pre(t);t=t.nextSibling}else this.dom.insertBefore(n.dom,t);for(;t;)t=pre(t)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function pre(e){let t=e.nextSibling;return e.remove(),t}const zC=pn.define({enables:h4e});function tMt(e,t){let n,i=new Promise(o=>n=o),r=o=>nMt(o,t,n);e.state.field(a$,!1)?e.dispatch({effects:p4e.of(r)}):e.dispatch({effects:hi.appendConfig.of(a$.init(()=>[r]))});let s=m4e.of(r);return{close:s,result:i.then(o=>((e.win.queueMicrotask||(c=>e.win.setTimeout(c,10)))(()=>{e.state.field(a$).indexOf(r)>-1&&e.dispatch({effects:s})}),o))}}const a$=pl.define({create(){return[]},update(e,t){for(let n of t.effects)n.is(p4e)?e=[n.value].concat(e):n.is(m4e)&&(e=e.filter(i=>i!=n.value));return e},provide:e=>zC.computeN([e],t=>t.field(e))}),p4e=hi.define(),m4e=hi.define();function nMt(e,t,n){let i=t.content?t.content(e,()=>o(null)):null;if(!i){if(i=Yr("form"),t.input){let l=Yr("input",t.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),i.appendChild(Yr("label",(t.label||"")+": ",l))}else i.appendChild(document.createTextNode(t.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(Yr("button",{class:"cm-button",type:"submit"},t.submitLabel||"OK"))}let r=i.nodeName=="FORM"?[i]:i.querySelectorAll("form");for(let l=0;l{u.keyCode==27?(u.preventDefault(),o(null)):u.keyCode==13&&(u.preventDefault(),o(c))}),c.addEventListener("submit",u=>{u.preventDefault(),o(c)})}let s=Yr("div",i,Yr("button",{onclick:()=>o(null),"aria-label":e.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));t.class&&(s.className=t.class),s.classList.add("cm-dialog");function o(l){s.contains(s.ownerDocument.activeElement)&&e.focus(),n(l)}return{dom:s,top:t.top,mount:()=>{if(t.focus){let l;typeof t.focus=="string"?l=i.querySelector(t.focus):l=i.querySelector("input")||i.querySelector("button"),l&&"select"in l?l.select():l&&"focus"in l&&l.focus()}}}}class sm extends ub{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}sm.prototype.elementClass="";sm.prototype.toDOM=void 0;sm.prototype.mapMode=al.TrackBefore;sm.prototype.startSide=sm.prototype.endSide=-1;sm.prototype.point=!0;const QN=pn.define(),iMt=pn.define(),rMt={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Yi.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},AE=pn.define();function sMt(e){return[g4e(),AE.of({...rMt,...e})]}const mre=pn.define({combine:e=>e.some(t=>t)});function g4e(e){return[aMt]}const aMt=ba.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(AE).map(t=>new bre(e,t)),this.fixed=!e.state.facet(mre);for(let t of this.gutters)t.config.side=="after"?this.getDOMAfter().appendChild(t.dom):this.dom.appendChild(t.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,i=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(i<(n.to-n.from)*.8)}if(e.geometryChanged){let t=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=t,this.domAfter&&(this.domAfter.style.minHeight=t)}this.view.state.facet(mre)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=Yi.iter(this.view.state.facet(QN),this.view.viewport.from),i=[],r=this.gutters.map(s=>new oMt(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(s.type)){let o=!0;for(let l of s.type)if(l.type==ul.Text&&o){J9(n,i,l.from);for(let c of r)c.line(this.view,l,i);o=!1}else if(l.widget)for(let c of r)c.widget(this.view,l)}else if(s.type==ul.Text){J9(n,i,s.from);for(let o of r)o.line(this.view,s,i)}else if(s.widget)for(let o of r)o.widget(this.view,s);for(let s of r)s.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(AE),n=e.state.facet(AE),i=e.docChanged||e.heightChanged||e.viewportChanged||!Yi.eq(e.startState.facet(QN),e.state.facet(QN),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let r of this.gutters)r.update(e)&&(i=!0);else{i=!0;let r=[];for(let s of n){let o=t.indexOf(s);o<0?r.push(new bre(this.view,s)):(this.gutters[o].update(e),r.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=r}return i}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>Jt.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||n.gutters.length==0||!n.fixed)return null;let i=n.dom.offsetWidth*t.scaleX,r=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==cs.LTR?{left:i,right:r}:{right:i,left:r}})});function gre(e){return Array.isArray(e)?e:[e]}function J9(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class oMt{constructor(t,n,i){this.gutter=t,this.height=i,this.i=0,this.cursor=Yi.iter(t.markers,n.from)}addElement(t,n,i){let{gutter:r}=this,s=(n.top-this.height)/t.scaleY,o=n.height/t.scaleY;if(this.i==r.elements.length){let l=new b4e(t,o,s,i);r.elements.push(l),r.dom.appendChild(l.dom)}else r.elements[this.i].update(t,o,s,i);this.height=n.bottom,this.i++}line(t,n,i){let r=[];J9(this.cursor,r,n.from),i.length&&(r=r.concat(i));let s=this.gutter.config.lineMarker(t,n,r);s&&r.unshift(s);let o=this.gutter;r.length==0&&!o.config.renderEmptyElements||this.addElement(t,n,r)}widget(t,n){let i=this.gutter.config.widgetMarker(t,n.widget,n),r=i?[i]:null;for(let s of t.state.facet(iMt)){let o=s(t,n.widget,n);o&&(r||(r=[])).push(o)}r&&this.addElement(t,n,r)}finish(){let t=this.gutter;for(;t.elements.length>this.i;){let n=t.elements.pop();t.dom.removeChild(n.dom),n.destroy()}}}class bre{constructor(t,n){this.view=t,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in n.domEventHandlers)this.dom.addEventListener(i,r=>{let s=r.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let c=s.getBoundingClientRect();o=(c.top+c.bottom)/2}else o=r.clientY;let l=t.lineBlockAtHeight(o-t.documentTop);n.domEventHandlers[i](t,l,r)&&r.preventDefault()});this.markers=gre(n.markers(t)),n.initialSpacer&&(this.spacer=new b4e(t,0,0,[n.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(t){let n=this.markers;if(this.markers=gre(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],t);r!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[r])}let i=t.view.viewport;return!Yi.eq(this.markers,n,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(t):!1)}destroy(){for(let t of this.elements)t.destroy()}}class b4e{constructor(t,n,i,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,n,i,r)}update(t,n,i,r){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),lMt(this.markers,r)||this.setMarkers(t,r)}setMarkers(t,n){let i="cm-gutterElement",r=this.dom.firstChild;for(let s=0,o=0;;){let l=o,c=ss(l,c,u)||o(l,c,u):o}return i}})}});class o$ extends sm{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function l$(e,t){return e.state.facet(Qx).formatNumber(t,e.state)}const dMt=AE.compute([Qx],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(t){return t.state.facet(cMt)},lineMarker(t,n,i){return i.some(r=>r.toDOM)?null:new o$(l$(t,t.state.doc.lineAt(n.from).number))},widgetMarker:(t,n,i)=>{for(let r of t.state.facet(uMt)){let s=r(t,n,i);if(s)return s}return null},lineMarkerChange:t=>t.startState.facet(Qx)!=t.state.facet(Qx),initialSpacer(t){return new o$(l$(t,yre(t.state.doc.lines)))},updateSpacer(t,n){let i=l$(n.view,yre(n.view.state.doc.lines));return i==t.number?t:new o$(i)},domEventHandlers:e.facet(Qx).domEventHandlers,side:"before"}));function y4e(e={}){return[Qx.of(e),g4e(),dMt]}function yre(e){let t=9;for(;t{let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.head).from;r>n&&(n=r,t.push(fMt.range(r)))}return Yi.of(t)});function pMt(){return hMt}let mMt=0,Xf=class e7{constructor(t,n,i,r){this.name=t,this.set=n,this.base=i,this.modified=r,this.id=mMt++}toString(){let{name:t}=this;for(let n of this.modified)n.name&&(t=`${n.name}(${t})`);return t}static define(t,n){let i=typeof t=="string"?t:"?";if(t instanceof e7&&(n=t),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let r=new e7(i,[],null,[]);if(r.set.push(r),n)for(let s of n.set)r.set.push(s);return r}static defineModifier(t){let n=new XI(t);return i=>i.modified.indexOf(n)>-1?i:XI.get(i.base||i,i.modified.concat(n).sort((r,s)=>r.id-s.id))}},gMt=0;class XI{constructor(t){this.name=t,this.instances=[],this.id=gMt++}static get(t,n){if(!n.length)return t;let i=n[0].instances.find(l=>l.base==t&&bMt(n,l.modified));if(i)return i;let r=[],s=new Xf(t.name,r,t,n);for(let l of n)l.instances.push(s);let o=yMt(n);for(let l of t.set)if(!l.modified.length)for(let c of o)r.push(XI.get(l,c));return s}}function bMt(e,t){return e.length==t.length&&e.every((n,i)=>n==t[i])}function yMt(e){let t=[[]];for(let n=0;ni.length-n.length)}function vm(e){let t=Object.create(null);for(let n in e){let i=e[n];Array.isArray(i)||(i=[i]);for(let r of n.split(" "))if(r){let s=[],o=2,l=r;for(let f=0;;){if(l=="..."&&f>0&&f+3==r.length){o=1;break}let h=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!h)throw new RangeError("Invalid path: "+r);if(s.push(h[0]=="*"?"":h[0][0]=='"'?JSON.parse(h[0]):h[0]),f+=h[0].length,f==r.length)break;let m=r[f++];if(f==r.length&&m=="!"){o=0;break}if(m!="/")throw new RangeError("Invalid path: "+r);l=r.slice(f)}let c=s.length-1,u=s[c];if(!u)throw new RangeError("Invalid path: "+r);let d=new VC(i,o,c>0?s.slice(0,c):null);t[u]=d.sort(t[u])}}return v4e.add(t)}const v4e=new li({combine(e,t){let n,i,r;for(;e||t;){if(!e||t&&e.depth>=t.depth?(r=t,t=t.next):(r=e,e=e.next),n&&n.mode==r.mode&&!r.context&&!n.context)continue;let s=new VC(r.tags,r.mode,r.context);n?n.next=s:i=s,n=s}return i}});let VC=class{constructor(t,n,i,r){this.tags=t,this.mode=n,this.context=i,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth{let o=r;for(let l of s)for(let c of l.set){let u=n[c.id];if(u){o=o?o+" "+u:u;break}}return o},scope:i}}function vMt(e,t){let n=null;for(let i of e){let r=i.style(t);r&&(n=n?n+" "+r:r)}return n}function xMt(e,t,n,i=0,r=e.length){let s=new wMt(i,Array.isArray(t)?t:[t],n);s.highlightRange(e.cursor(),i,r,"",s.highlighters),s.flush(r)}class wMt{constructor(t,n,i){this.at=t,this.highlighters=n,this.span=i,this.class=""}startSpan(t,n){n!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=n)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,n,i,r,s){let{type:o,from:l,to:c}=t;if(l>=i||c<=n)return;o.isTop&&(s=this.highlighters.filter(m=>!m.scope||m.scope(o)));let u=r,d=kMt(t)||VC.empty,f=vMt(s,d.tags);if(f&&(u&&(u+=" "),u+=f,d.mode==1&&(r+=(r?" ":"")+f)),this.startSpan(Math.max(n,l),u),d.opaque)return;let h=t.tree&&t.tree.prop(li.mounted);if(h&&h.overlay){let m=t.node.enter(h.overlay[0].from+l,1),g=this.highlighters.filter(v=>!v.scope||v.scope(h.tree.type)),b=t.firstChild();for(let v=0,y=l;;v++){let w=v=x||!t.nextSibling())););if(!w||x>i)break;y=w.to+l,y>n&&(this.highlightRange(m.cursor(),Math.max(n,w.from+l),Math.min(i,y),"",g),this.startSpan(Math.min(i,y),u))}b&&t.parent()}else if(t.firstChild()){h&&(r="");do if(!(t.to<=n)){if(t.from>=i)break;this.highlightRange(t,n,i,r,s),this.startSpan(Math.min(i,t.to),u)}while(t.nextSibling());t.parent()}}}function kMt(e){let t=e.type.prop(v4e);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}const sn=Xf.define,ej=sn(),Gm=sn(),vre=sn(Gm),xre=sn(Gm),Xm=sn(),tj=sn(Xm),c$=sn(Xm),Wf=sn(),Xb=sn(Wf),zf=sn(),Vf=sn(),t7=sn(),AO=sn(t7),nj=sn(),pe={comment:ej,lineComment:sn(ej),blockComment:sn(ej),docComment:sn(ej),name:Gm,variableName:sn(Gm),typeName:vre,tagName:sn(vre),propertyName:xre,attributeName:sn(xre),className:sn(Gm),labelName:sn(Gm),namespace:sn(Gm),macroName:sn(Gm),literal:Xm,string:tj,docString:sn(tj),character:sn(tj),attributeValue:sn(tj),number:c$,integer:sn(c$),float:sn(c$),bool:sn(Xm),regexp:sn(Xm),escape:sn(Xm),color:sn(Xm),url:sn(Xm),keyword:zf,self:sn(zf),null:sn(zf),atom:sn(zf),unit:sn(zf),modifier:sn(zf),operatorKeyword:sn(zf),controlKeyword:sn(zf),definitionKeyword:sn(zf),moduleKeyword:sn(zf),operator:Vf,derefOperator:sn(Vf),arithmeticOperator:sn(Vf),logicOperator:sn(Vf),bitwiseOperator:sn(Vf),compareOperator:sn(Vf),updateOperator:sn(Vf),definitionOperator:sn(Vf),typeOperator:sn(Vf),controlOperator:sn(Vf),punctuation:t7,separator:sn(t7),bracket:AO,angleBracket:sn(AO),squareBracket:sn(AO),paren:sn(AO),brace:sn(AO),content:Wf,heading:Xb,heading1:sn(Xb),heading2:sn(Xb),heading3:sn(Xb),heading4:sn(Xb),heading5:sn(Xb),heading6:sn(Xb),contentSeparator:sn(Wf),list:sn(Wf),quote:sn(Wf),emphasis:sn(Wf),strong:sn(Wf),link:sn(Wf),monospace:sn(Wf),strikethrough:sn(Wf),inserted:sn(),deleted:sn(),changed:sn(),invalid:sn(),meta:nj,documentMeta:sn(nj),annotation:sn(nj),processingInstruction:sn(nj),definition:Xf.defineModifier("definition"),constant:Xf.defineModifier("constant"),function:Xf.defineModifier("function"),standard:Xf.defineModifier("standard"),local:Xf.defineModifier("local"),special:Xf.defineModifier("special")};for(let e in pe){let t=pe[e];t instanceof Xf&&(t.name=e)}x4e([{tag:pe.link,class:"tok-link"},{tag:pe.heading,class:"tok-heading"},{tag:pe.emphasis,class:"tok-emphasis"},{tag:pe.strong,class:"tok-strong"},{tag:pe.keyword,class:"tok-keyword"},{tag:pe.atom,class:"tok-atom"},{tag:pe.bool,class:"tok-bool"},{tag:pe.url,class:"tok-url"},{tag:pe.labelName,class:"tok-labelName"},{tag:pe.inserted,class:"tok-inserted"},{tag:pe.deleted,class:"tok-deleted"},{tag:pe.literal,class:"tok-literal"},{tag:pe.string,class:"tok-string"},{tag:pe.number,class:"tok-number"},{tag:[pe.regexp,pe.escape,pe.special(pe.string)],class:"tok-string2"},{tag:pe.variableName,class:"tok-variableName"},{tag:pe.local(pe.variableName),class:"tok-variableName tok-local"},{tag:pe.definition(pe.variableName),class:"tok-variableName tok-definition"},{tag:pe.special(pe.variableName),class:"tok-variableName2"},{tag:pe.definition(pe.propertyName),class:"tok-propertyName tok-definition"},{tag:pe.typeName,class:"tok-typeName"},{tag:pe.namespace,class:"tok-namespace"},{tag:pe.className,class:"tok-className"},{tag:pe.macroName,class:"tok-macroName"},{tag:pe.propertyName,class:"tok-propertyName"},{tag:pe.operator,class:"tok-operator"},{tag:pe.comment,class:"tok-comment"},{tag:pe.meta,class:"tok-meta"},{tag:pe.invalid,class:"tok-invalid"},{tag:pe.punctuation,class:"tok-punctuation"}]);var u$;const xg=new li;function JM(e){return pn.define({combine:e?t=>t.concat(e):void 0})}const nW=new li;class Au{constructor(t,n,i=[],r=""){this.data=t,this.name=r,sr.prototype.hasOwnProperty("tree")||Object.defineProperty(sr.prototype,"tree",{get(){return es(this)}}),this.parser=n,this.extension=[pb.of(this),sr.languageData.of((s,o,l)=>{let c=wre(s,o,l),u=c.type.prop(xg);if(!u)return[];let d=s.facet(u),f=c.type.prop(nW);if(f){let h=c.resolve(o-c.from,l);for(let m of f)if(m.test(h,s)){let g=s.facet(m.facet);return m.type=="replace"?g:g.concat(d)}}return d})].concat(i)}isActiveAt(t,n,i=-1){return wre(t,n,i).type.prop(xg)==this.data}findRegions(t){let n=t.facet(pb);if((n==null?void 0:n.data)==this.data)return[{from:0,to:t.doc.length}];if(!n||!n.allowsNesting)return[];let i=[],r=(s,o)=>{if(s.prop(xg)==this.data){i.push({from:o,to:o+s.length});return}let l=s.prop(li.mounted);if(l){if(l.tree.prop(xg)==this.data){if(l.overlay)for(let c of l.overlay)i.push({from:c.from+o,to:c.to+o});else i.push({from:o,to:o+s.length});return}else if(l.overlay){let c=i.length;if(r(l.tree,l.overlay[0].from+o),i.length>c)return}}for(let c=0;ci.isTop?n:void 0)]}),t.name)}configure(t,n){return new am(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function es(e){let t=e.field(Au.state,!1);return t?t.tree:Hi.empty}class OMt{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,n){let i=this.cursorPos-this.string.length;return t=this.cursorPos?this.doc.sliceString(t,n):this.string.slice(t-i,n-i)}}let TO=null;class vv{constructor(t,n,i=[],r,s,o,l,c){this.parser=t,this.state=n,this.fragments=i,this.tree=r,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}static create(t,n,i){return new vv(t,n,[],Hi.empty,0,i,[],null)}startParse(){return this.parser.startParse(new OMt(this.state.doc),this.fragments)}work(t,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Hi.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof t=="number"){let r=Date.now()+t;t=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=t,this.tree=n,this.fragments=this.withoutTempSkipped(Qp.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let n=TO;TO=this;try{return t()}finally{TO=n}}withoutTempSkipped(t){for(let n;n=this.tempSkipped.pop();)t=kre(t,n.from,n.to);return t}changes(t,n){let{fragments:i,tree:r,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!t.empty){let c=[];if(t.iterChangedRanges((u,d,f,h)=>c.push({fromA:u,toA:d,fromB:f,toB:h})),i=Qp.applyChanges(i,c),r=Hi.empty,s=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){l=[];for(let u of this.skipped){let d=t.mapPos(u.from,1),f=t.mapPos(u.to,-1);dt.from&&(this.fragments=kre(this.fragments,r,s),this.skipped.splice(i--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,n){this.skipped.push({from:t,to:n})}static getSkippingParser(t){return new class extends HM{createParse(n,i,r){let s=r[0].from,o=r[r.length-1].to;return{parsedPos:s,advance(){let c=TO;if(c){for(let u of r)c.tempSkipped.push(u);t&&(c.scheduleOn=c.scheduleOn?Promise.all([c.scheduleOn,t]):t)}return this.parsedPos=o,new Hi(Ja.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let n=this.fragments;return this.treeLen>=t&&n.length&&n[0].from==0&&n[0].to>=t}static get(){return TO}}function kre(e,t,n){return Qp.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class b1{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),i=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,i)||n.takeTree(),new b1(n)}static init(t){let n=Math.min(3e3,t.doc.length),i=vv.create(t.facet(pb).parser,t,{from:0,to:n});return i.work(20,n)||i.takeTree(),new b1(i)}}Au.state=pl.define({create:b1.init,update(e,t){for(let n of t.effects)if(n.is(Au.setState))return n.value;return t.startState.facet(pb)!=t.state.facet(pb)?b1.init(t.state):e.apply(t)}});let w4e=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(w4e=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const d$=typeof navigator<"u"&&(!((u$=navigator.scheduling)===null||u$===void 0)&&u$.isInputPending)?()=>navigator.scheduling.isInputPending():null,SMt=ba.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let n=this.view.state.field(Au.state).context;(n.updateViewport(t.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:t}=this.view,n=t.field(Au.state);(n.tree!=n.context.tree||!n.context.isDone(t.doc.length))&&(this.working=w4e(this.work))}work(t){this.working=null;let n=Date.now();if(this.chunkEndr+1e3,c=s.context.work(()=>d$&&d$()||Date.now()>o,r+(l?0:1e5));this.chunkBudget-=Date.now()-n,(c||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Au.setState.of(new b1(s.context))})),this.chunkBudget>0&&!(c&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Rc(this.view.state,n)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),pb=pn.define({combine(e){return e.length?e[0]:null},enables:e=>[Au.state,SMt,Jt.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class mb{constructor(t,n=[]){this.language=t,this.support=n,this.extension=[t,n]}}class YI{constructor(t,n,i,r,s,o=void 0){this.name=t,this.alias=n,this.extensions=i,this.filename=r,this.loadFunc=s,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(t=>this.support=t,t=>{throw this.loading=null,t}))}static of(t){let{load:n,support:i}=t;if(!n){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");n=()=>Promise.resolve(i)}return new YI(t.name,(t.alias||[]).concat(t.name).map(r=>r.toLowerCase()),t.extensions||[],t.filename,n,i)}static matchFilename(t,n){for(let r of t)if(r.filename&&r.filename.test(n))return r;let i=/\.([^.]+)$/.exec(n);if(i){for(let r of t)if(r.extensions.indexOf(i[1])>-1)return r}return null}static matchLanguageName(t,n,i=!0){n=n.toLowerCase();for(let r of t)if(r.alias.some(s=>s==n))return r;if(i)for(let r of t)for(let s of r.alias){let o=n.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(n[o-1])&&!/\w/.test(n[o+s.length])))return r}return null}}const EMt=pn.define(),bk=pn.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(n=>n!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function xv(e){let t=e.facet(bk);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function HC(e,t){let n="",i=e.tabSize,r=e.facet(bk)[0];if(r==" "){for(;t>=i;)n+=" ",t-=i;r=" "}for(let s=0;s=t?CMt(e,n,t):null}class eL{constructor(t,n={}){this.state=t,this.options=n,this.unit=xv(t)}lineAt(t,n=1){let i=this.state.doc.lineAt(t),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=i.from&&r<=i.to?s&&r==t?{text:"",from:t}:(n<0?r-1&&(s+=o-this.countColumn(i,i.search(/\S|$/))),s}countColumn(t,n=t.length){return vf(t,this.state.tabSize,n)}lineIndent(t,n=1){let{text:i,from:r}=this.lineAt(t,n),s=this.options.overrideIndentation;if(s){let o=s(r);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const xm=new li;function CMt(e,t,n){let i=t.resolveStack(n),r=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(r!=i.node){let s=[];for(let o=r;o&&!(o.fromi.node.to||o.from==i.node.from&&o.type==i.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)i={node:s[o],next:i}}return k4e(i,e,n)}function k4e(e,t,n){for(let i=e;i;i=i.next){let r=TMt(i.node);if(r)return r(rW.create(t,n,i))}return 0}function AMt(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function TMt(e){let t=e.type.prop(xm);if(t)return t;let n=e.firstChild,i;if(n&&(i=n.type.prop(li.closedBy))){let r=e.lastChild,s=r&&i.indexOf(r.name)>-1;return o=>O4e(o,!0,1,void 0,s&&!AMt(o)?r.from:void 0)}return e.parent==null?_Mt:null}function _Mt(){return 0}class rW extends eL{constructor(t,n,i){super(t.state,t.options),this.base=t,this.pos=n,this.context=i}get node(){return this.context.node}static create(t,n,i){return new rW(t,n,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let n=this.state.doc.lineAt(t.from);for(;;){let i=t.resolve(n.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(jMt(i,t))break;n=this.state.doc.lineAt(i.from)}return this.lineIndent(n.from)}continue(){return k4e(this.context.next,this.base,this.pos)}}function jMt(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function NMt(e){let t=e.node,n=t.childAfter(t.from),i=t.lastChild;if(!n)return null;let r=e.options.simulateBreak,s=e.state.doc.lineAt(n.from),o=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let l=n.to;;){let c=t.childAfter(l);if(!c||c==i)return null;if(!c.type.isSkipped){if(c.from>=o)return null;let u=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+u}}l=c.to}}function kw({closing:e,align:t=!0,units:n=1}){return i=>O4e(i,t,n,e)}function O4e(e,t,n,i,r){let s=e.textAfter,o=s.match(/^\s*/)[0].length,l=i&&s.slice(o,o+i.length)==i||r==e.pos+o,c=t?NMt(e):null;return c?l?e.column(c.from):e.column(c.to):e.baseIndent+(l?0:e.unit*n)}const RMt=e=>e.baseIndent;function Ow({except:e,units:t=1}={}){return n=>{let i=e&&e.test(n.textAfter);return n.baseIndent+(i?0:t*n.unit)}}const IMt=200;function PMt(){return sr.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:i}=e.newSelection.main,r=n.lineAt(i);if(i>r.from+IMt)return e;let s=n.sliceString(r.from,i);if(!t.some(u=>u.test(s)))return e;let{state:o}=e,l=-1,c=[];for(let{head:u}of o.selection.ranges){let d=o.doc.lineAt(u);if(d.from==l)continue;l=d.from;let f=iW(o,d.from);if(f==null)continue;let h=/^\s*/.exec(d.text)[0],m=HC(o,f);h!=m&&c.push({from:d.from,to:d.from+h.length,insert:m})}return c.length?[e,{changes:c,sequential:!0}]:e})}const S4e=pn.define(),wm=new li;function PT(e){let t=e.firstChild,n=e.lastChild;return t&&t.ton)continue;if(s&&l.from=t&&u.to>n&&(s=u)}}return s}function MMt(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function ZI(e,t,n){for(let i of e.facet(S4e)){let r=i(e,t,n);if(r)return r}return DMt(e,t,n)}function E4e(e,t){let n=t.mapPos(e.from,1),i=t.mapPos(e.to,-1);return n>=i?void 0:{from:n,to:i}}const tL=hi.define({map:E4e}),DT=hi.define({map:E4e});function C4e(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(i=>i.from<=n&&i.to>=n)||t.push(e.lineBlockAt(n));return t}const wv=pl.define({create(){return $n.none},update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((i,r)=>e=Ore(e,i,r)),e=e.map(t.changes);let n=[];for(let i of t.effects)i.is(tL)&&!LMt(e,i.value.from,i.value.to)?n.push(i.value):i.is(DT)&&(e=e.update({filter:(r,s)=>i.value.from!=r||i.value.to!=s,filterFrom:i.value.from,filterTo:i.value.to}));if(n.length){let{preparePlaceholder:i}=t.state.facet(_4e),r=n.map(s=>(i?$n.replace({widget:new VMt(i(t.state,s))}):Sre).range(s.from,s.to));e=e.update({add:r})}return t.selection&&(e=Ore(e,t.selection.main.head)),e},provide:e=>Jt.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(i,r)=>{n.push(i,r)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n{rt&&(i=!0)}),i?e.update({filterFrom:t,filterTo:n,filter:(r,s)=>r>=n||s<=t}):e}function JI(e,t,n){var i;let r=null;return(i=e.field(wv,!1))===null||i===void 0||i.between(t,n,(s,o)=>{(!r||r.from>s)&&(r={from:s,to:o})}),r}function LMt(e,t,n){let i=!1;return e.between(t,t,(r,s)=>{r==t&&s==n&&(i=!0)}),i}function A4e(e,t){return e.field(wv,!1)?t:t.concat(hi.appendConfig.of(j4e()))}const $Mt=e=>{for(let t of C4e(e)){let n=ZI(e.state,t.from,t.to);if(n)return e.dispatch({effects:A4e(e.state,[tL.of(n),T4e(e,n)])}),!0}return!1},FMt=e=>{if(!e.state.field(wv,!1))return!1;let t=[];for(let n of C4e(e)){let i=JI(e.state,n.from,n.to);i&&t.push(DT.of(i),T4e(e,i,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function T4e(e,t,n=!0){let i=e.state.doc.lineAt(t.from).number,r=e.state.doc.lineAt(t.to).number;return Jt.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${i} ${e.state.phrase("to")} ${r}.`)}const BMt=e=>{let{state:t}=e,n=[];for(let i=0;i{let t=e.state.field(wv,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(i,r)=>{n.push(DT.of({from:i,to:r}))}),e.dispatch({effects:n}),!0},QMt=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:$Mt},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:FMt},{key:"Ctrl-Alt-[",run:BMt},{key:"Ctrl-Alt-]",run:UMt}],zMt={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},_4e=pn.define({combine(e){return Mh(e,zMt)}});function j4e(e){return[wv,WMt]}function N4e(e,t){let{state:n}=e,i=n.facet(_4e),r=o=>{let l=e.lineBlockAt(e.posAtDOM(o.target)),c=JI(e.state,l.from,l.to);c&&e.dispatch({effects:DT.of(c)}),o.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(e,r,t);let s=document.createElement("span");return s.textContent=i.placeholderText,s.setAttribute("aria-label",n.phrase("folded code")),s.title=n.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=r,s}const Sre=$n.replace({widget:new class extends Tf{toDOM(e){return N4e(e,null)}}});class VMt extends Tf{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return N4e(t,this.value)}}const HMt={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class f$ extends sm{constructor(t,n){super(),this.config=t,this.open=n}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=t.state.phrase(this.open?"Fold line":"Unfold line"),n}}function qMt(e={}){let t={...HMt,...e},n=new f$(t,!0),i=new f$(t,!1),r=ba.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(pb)!=o.state.facet(pb)||o.startState.field(wv,!1)!=o.state.field(wv,!1)||es(o.startState)!=es(o.state)||t.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new im;for(let c of o.viewportLineBlocks){let u=JI(o.state,c.from,c.to)?i:ZI(o.state,c.from,c.to)?n:null;u&&l.add(c.from,c.from,u)}return l.finish()}}),{domEventHandlers:s}=t;return[r,sMt({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(r))===null||l===void 0?void 0:l.markers)||Yi.empty},initialSpacer(){return new f$(t,!1)},domEventHandlers:{...s,click:(o,l,c)=>{if(s.click&&s.click(o,l,c))return!0;let u=JI(o.state,l.from,l.to);if(u)return o.dispatch({effects:DT.of(u)}),!0;let d=ZI(o.state,l.from,l.to);return d?(o.dispatch({effects:tL.of(d)}),!0):!1}}}),j4e()]}const WMt=Jt.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class MT{constructor(t,n){this.specs=t;let i;function r(l){let c=db.newName();return(i||(i=Object.create(null)))["."+c]=l,c}const s=typeof n.all=="string"?n.all:n.all?r(n.all):void 0,o=n.scope;this.scope=o instanceof Au?l=>l.prop(xg)==o.data:o?l=>l==o:void 0,this.style=x4e(t.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=i?new db(i):null,this.themeType=n.themeType}static define(t,n){return new MT(t,n||{})}}const n7=pn.define(),R4e=pn.define({combine(e){return e.length?[e[0]]:null}});function zN(e){let t=e.facet(n7);return t.length?t:e.facet(R4e)}function I4e(e,t){let n=[GMt],i;return e instanceof MT&&(e.module&&n.push(Jt.styleModule.of(e.module)),i=e.themeType),t!=null&&t.fallback?n.push(R4e.of(e)):i?n.push(n7.computeN([Jt.darkTheme],r=>r.facet(Jt.darkTheme)==(i=="dark")?[e]:[])):n.push(n7.of(e)),n}function qhn(e,t,n){let i=zN(e),r=null;if(i){for(let s of i)if(!s.scope||n){let o=s.style(t);o&&(r=r?r+" "+o:o)}}return r}class KMt{constructor(t){this.markCache=Object.create(null),this.tree=es(t.state),this.decorations=this.buildDeco(t,zN(t.state)),this.decoratedTo=t.viewport.to}update(t){let n=es(t.state),i=zN(t.state),r=i!=zN(t.startState),{viewport:s}=t.view,o=t.changes.mapPos(this.decoratedTo,1);n.length=s.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=o):(n!=this.tree||t.viewportChanged||r)&&(this.tree=n,this.decorations=this.buildDeco(t.view,i),this.decoratedTo=s.to)}buildDeco(t,n){if(!n||!this.tree.length)return $n.none;let i=new im;for(let{from:r,to:s}of t.visibleRanges)xMt(this.tree,n,(o,l,c)=>{i.add(o,l,this.markCache[c]||(this.markCache[c]=$n.mark({class:c})))},r,s);return i.finish()}}const GMt=ym.high(ba.fromClass(KMt,{decorations:e=>e.decorations})),XMt=MT.define([{tag:pe.meta,color:"#404740"},{tag:pe.link,textDecoration:"underline"},{tag:pe.heading,textDecoration:"underline",fontWeight:"bold"},{tag:pe.emphasis,fontStyle:"italic"},{tag:pe.strong,fontWeight:"bold"},{tag:pe.strikethrough,textDecoration:"line-through"},{tag:pe.keyword,color:"#708"},{tag:[pe.atom,pe.bool,pe.url,pe.contentSeparator,pe.labelName],color:"#219"},{tag:[pe.literal,pe.inserted],color:"#164"},{tag:[pe.string,pe.deleted],color:"#a11"},{tag:[pe.regexp,pe.escape,pe.special(pe.string)],color:"#e40"},{tag:pe.definition(pe.variableName),color:"#00f"},{tag:pe.local(pe.variableName),color:"#30a"},{tag:[pe.typeName,pe.namespace],color:"#085"},{tag:pe.className,color:"#167"},{tag:[pe.special(pe.variableName),pe.macroName],color:"#256"},{tag:pe.definition(pe.propertyName),color:"#00c"},{tag:pe.comment,color:"#940"},{tag:pe.invalid,color:"#f00"}]),YMt=Jt.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),P4e=1e4,D4e="()[]{}",M4e=pn.define({combine(e){return Mh(e,{afterCursor:!0,brackets:D4e,maxScanDistance:P4e,renderMatch:eLt})}}),ZMt=$n.mark({class:"cm-matchingBracket"}),JMt=$n.mark({class:"cm-nonmatchingBracket"});function eLt(e){let t=[],n=e.matched?ZMt:JMt;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}function Ere(e){let t=[],n=e.facet(M4e);for(let i of e.selection.ranges){if(!i.empty)continue;let r=dh(e,i.head,-1,n)||i.head>0&&dh(e,i.head-1,1,n)||n.afterCursor&&(dh(e,i.head,1,n)||i.heade.decorations}),nLt=[tLt,YMt];function iLt(e={}){return[M4e.of(e),nLt]}const L4e=new li;function i7(e,t,n){let i=e.prop(t<0?li.openedBy:li.closedBy);if(i)return i;if(e.name.length==1){let r=n.indexOf(e.name);if(r>-1&&r%2==(t<0?1:0))return[n[r+t]]}return null}function r7(e){let t=e.type.prop(L4e);return t?t(e.node):e}function dh(e,t,n,i={}){let r=i.maxScanDistance||P4e,s=i.brackets||D4e,o=es(e),l=o.resolveInner(t,n);for(let c=l;c;c=c.parent){let u=i7(c.type,n,s);if(u&&c.from0?t>=d.from&&td.from&&t<=d.to))return rLt(e,t,n,c,d,u,s)}}return sLt(e,t,n,o,l.type,r,s)}function rLt(e,t,n,i,r,s,o){let l=i.parent,c={from:r.from,to:r.to},u=0,d=l==null?void 0:l.cursor();if(d&&(n<0?d.childBefore(i.from):d.childAfter(i.to)))do if(n<0?d.to<=i.from:d.from>=i.to){if(u==0&&s.indexOf(d.type.name)>-1&&d.from0)return null;let u={from:n<0?t-1:t,to:n>0?t+1:t},d=e.doc.iterRange(t,n>0?e.doc.length:0),f=0;for(let h=0;!d.next().done&&h<=s;){let m=d.value;n<0&&(h+=m.length);let g=t+h*n;for(let b=n>0?0:m.length-1,v=n>0?m.length:-1;b!=v;b+=n){let y=o.indexOf(m[b]);if(!(y<0||i.resolveInner(g+b,1).type!=r))if(y%2==0==n>0)f++;else{if(f==1)return{start:u,end:{from:g+b,to:g+b+1},matched:y>>1==c>>1};f--}}n>0&&(h+=m.length)}return d.done?{start:u,matched:!1}:null}function Cre(e,t,n,i=0,r=0){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));let s=r;for(let o=i;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.posn}eatSpace(){let t=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t}skipToEnd(){this.pos=this.string.length}skipTo(t){let n=this.string.indexOf(t,this.pos);if(n>-1)return this.pos=n,!0}backUp(t){this.pos-=t}column(){return this.lastColumnPosi?o.toLowerCase():o,s=this.string.substr(this.pos,t.length);return r(s)==r(t)?(n!==!1&&(this.pos+=t.length),!0):null}else{let r=this.string.slice(this.pos).match(t);return r&&r.index>0?null:(r&&n!==!1&&(this.pos+=r[0].length),r)}}current(){return this.string.slice(this.start,this.pos)}}function aLt(e){return{name:e.name||"",token:e.token,blankLine:e.blankLine||(()=>{}),startState:e.startState||(()=>!0),copyState:e.copyState||oLt,indent:e.indent||(()=>null),languageData:e.languageData||{},tokenTable:e.tokenTable||oW,mergeTokens:e.mergeTokens!==!1}}function oLt(e){if(typeof e!="object")return e;let t={};for(let n in e){let i=e[n];t[n]=i instanceof Array?i.slice():i}return t}const Are=new WeakMap;class sW extends Au{constructor(t){let n=JM(t.languageData),i=aLt(t),r,s=new class extends HM{createParse(o,l,c){return new cLt(r,o,l,c)}};super(n,s,[],t.name),this.topNode=fLt(n,this),r=this,this.streamParser=i,this.stateAfter=new li({perNode:!0}),this.tokenTable=t.tokenTable?new Q4e(i.tokenTable):dLt}static define(t){return new sW(t)}getIndent(t){let n,{overrideIndentation:i}=t.options;i&&(n=Are.get(t.state),n!=null&&n1e4)return null;for(;s=i&&n+t.length<=r&&t.prop(e.stateAfter);if(s)return{state:e.streamParser.copyState(s),pos:n+t.length};for(let o=t.children.length-1;o>=0;o--){let l=t.children[o],c=n+t.positions[o],u=l instanceof Hi&&c=t.length)return t;!r&&n==0&&t.type==e.topNode&&(r=!0);for(let s=t.children.length-1;s>=0;s--){let o=t.positions[s],l=t.children[s],c;if(on&&aW(e,s.tree,0-s.offset,n,l),u;if(c&&c.pos<=i&&(u=F4e(e,s.tree,n+s.offset,c.pos+s.offset,!1)))return{state:c.state,tree:u}}return{state:e.streamParser.startState(r?xv(r):4),tree:Hi.empty}}let cLt=class{constructor(t,n,i,r){this.lang=t,this.input=n,this.fragments=i,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let s=vv.get(),o=r[0].from,{state:l,tree:c}=lLt(t,i,o,this.to,s==null?void 0:s.state);this.state=l,this.parsedPos=this.chunkStart=o+c.length;for(let u=0;uu.from<=s.viewport.from&&u.to>=s.viewport.from)&&(this.state=this.lang.streamParser.startState(xv(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let t=vv.get(),n=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(n,this.chunkStart+512);for(t&&(i=Math.min(i,t.viewport.to));this.parsedPos=n?this.finish():t&&this.parsedPos>=t.viewport.to?(t.skipUntilInView(this.parsedPos,n),this.finish()):null}stopAt(t){this.stoppedAt=t}lineAfter(t){let n=this.input.chunk(t);if(this.input.lineChunks)n==` `&&(n="");else{let i=n.indexOf(` -`);i>-1&&(n=n.slice(0,i))}return t+n.length<=this.to?n:n.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,n=this.lineAfter(t),i=t+n.length;for(let r=this.rangeIndex;;){let s=this.ranges[r].to;if(s>=i||(n=n.slice(0,s-(i-n.length)),r++,r==this.ranges.length))break;let o=this.ranges[r].from,l=this.lineAfter(o);n+=l,i=o+l.length}return{line:n,end:i}}skipGapsTo(t,n,i){for(;;){let r=this.ranges[this.rangeIndex].to,s=t+n;if(i>0?r>s:r>=s)break;let o=this.ranges[++this.rangeIndex].from;n+=o-r}return n}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){r=this.skipGapsTo(n,r,1),n+=r;let l=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,s+=this.chunk.length-l}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&o>=0&&this.chunk[o]==t&&this.chunk[o+2]==n?this.chunk[o+2]=i:this.chunk.push(t,n,i,s),r}parseLine(t){let{line:n,end:i}=this.nextLine(),r=0,{streamParser:s}=this.lang,o=new L4e(n,t?t.state.tabSize:4,t?xv(t.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=F4e(s.token,o,this.state);if(l&&(r=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,r)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPost.start)return r}throw new Error("Stream parser failed to advance stream.")}const oW=Object.create(null),qC=[Ja.none],cLt=new mk(qC),Tre=[],_re=Object.create(null),B4e=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])B4e[e]=Q4e(oW,t);class U4e{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),B4e)}resolve(t){return t?this.table[t]||(this.table[t]=Q4e(this.extra,t)):0}}const uLt=new U4e(oW);function h$(e,t){Tre.indexOf(e)>-1||(Tre.push(e),console.warn(t))}function Q4e(e,t){let n=[];for(let l of t.split(" ")){let c=[];for(let u of l.split(".")){let d=e[u]||me[u];d?typeof d=="function"?c.length?c=c.map(d):h$(u,`Modifier ${u} used at start of tag`):c.length?h$(u,`Tag ${u} used as modifier`):c=Array.isArray(d)?d:[d]:h$(u,`Unknown highlighting tag ${u}`)}for(let u of c)n.push(u)}if(!n.length)return 0;let i=t.replace(/ /g,"_"),r=i+" "+n.map(l=>l.id),s=_re[r];if(s)return s.id;let o=_re[r]=Ja.define({id:qC.length,name:i,props:[vm({[i]:n})]});return qC.push(o),o.id}function dLt(e,t){let n=Ja.define({id:qC.length,name:"Document",props:[xg.add(()=>e),xm.add(()=>i=>t.getIndent(i))],top:!0});return qC.push(n),n}cs.RTL,cs.LTR;var jre={};class eP{constructor(t,n,i,r,s,o,l,c,u,d=0,f){this.p=t,this.stack=n,this.state=i,this.reducePos=r,this.pos=s,this.score=o,this.buffer=l,this.bufferBase=c,this.curContext=u,this.lookAhead=d,this.parent=f}toString(){return`[${this.stack.filter((t,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,n,i=0){let r=t.parser.context;return new eP(t,[],n,i,i,0,[],0,r?new Nre(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var n;let i=t>>19,r=t&65535,{parser:s}=this.p,o=this.reducePos=2e3&&!(!((n=this.p.parser.nodeSet.types[r])===null||n===void 0)&&n.isAnonymous)&&(u==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=d):this.p.lastBigReductionSizec;)this.stack.pop();this.reduceContext(r,u)}storeNode(t,n,i,r=4,s=!1){if(t==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&this.buffer[o-4]==0&&this.buffer[o-1]>-1){if(n==i)return;if(this.buffer[o-2]>=n){this.buffer[o-2]=i;return}}}if(!s||this.pos==i)this.buffer.push(t,n,i,r);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let c=o;c>0&&this.buffer[c-2]>i;c-=4)if(this.buffer[c-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>i;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=t,this.buffer[o+1]=n,this.buffer[o+2]=i,this.buffer[o+3]=r}}shift(t,n,i,r){if(t&131072)this.pushState(t&65535,this.pos);else if(t&262144)this.pos=r,this.shiftContext(n,i),n<=this.p.parser.maxNode&&this.buffer.push(n,i,r,4);else{let s=t,{parser:o}=this.p;this.pos=r;let l=o.stateFlag(s,1);!l&&(r>i||n<=o.maxNode)&&(this.reducePos=r),this.pushState(s,l?i:Math.min(i,this.reducePos)),this.shiftContext(n,i),n<=o.maxNode&&this.buffer.push(n,i,r,4)}}apply(t,n,i,r){t&65536?this.reduce(t):this.shift(t,n,i,r)}useNode(t,n){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=t)&&(this.p.reused.push(t),i++);let r=this.pos;this.reducePos=this.pos=r+t.length,this.pushState(n,r),this.buffer.push(i,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let i=t.buffer.slice(n),r=t.bufferBase+n;for(;t&&r==t.bufferBase;)t=t.parent;return new eP(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,r,this.curContext,this.lookAhead,t)}recoverByDelete(t,n){let i=t<=this.p.parser.maxNode;i&&this.storeNode(t,this.pos,n,4),this.storeNode(0,this.pos,n,i?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(t){for(let n=new fLt(this);;){let i=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,t);if(i==0)return!1;if(!(i&65536))return!0;n.reduce(i)}}recoverByInsert(t){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let r=[];for(let s=0,o;sc&1&&l==o)||r.push(n[s],o)}n=r}let i=[];for(let r=0;r>19,r=n&65535,s=this.stack.length-i*3;if(s<0||t.getGoto(this.stack[s],r,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;n=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:t}=this.p,n=[],i=(r,s)=>{if(!n.includes(r))return n.push(r),t.allActions(r,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-s;if(l>1){let c=o&65535,u=this.stack.length-l*3;if(u>=0&&t.getGoto(this.stack[u],c,!1)>=0)return l<<19|65536|c}}else{let l=i(o,s+1);if(l!=null)return l}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:t}=this.p;return t.data[t.stateSlot(this.state,1)]==65535&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let n=0;n0&&this.emitLookAhead()}}class Nre{constructor(t,n){this.tracker=t,this.context=n,this.hash=t.strict?t.hash(n):0}}class fLt{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let n=t&65535,i=t>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=r}}class tP{constructor(t,n,i){this.stack=t,this.pos=n,this.index=i,this.buffer=t.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new tP(t,n,n-t.bufferBase)}maybeNext(){let t=this.stack.parent;t!=null&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new tP(this.stack,this.pos,this.index)}}function OS(e,t=Uint16Array){if(typeof e!="string")return e;let n=null;for(let i=0,r=0;i=92&&o--,o>=34&&o--;let c=o-32;if(c>=46&&(c-=46,l=!0),s+=c,l)break;s*=46}n?n[r++]=s:n=new t(s)}return n}class VN{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Rre=new VN;class hLt{constructor(t,n){this.input=t,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Rre,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(t,n){let i=this.range,r=this.rangeIndex,s=this.pos+t;for(;si.to:s>=i.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-i.to,i=o}return s}clipPos(t){if(t>=this.range.from&&tt)return Math.max(t,n.from);return this.end}peek(t){let n=this.chunkOff+t,i,r;if(n>=0&&n=this.chunk2Pos&&il.to&&(this.chunk2=this.chunk2.slice(0,l.to-i)),r=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),r}acceptToken(t,n=0){let i=n?this.resolveOffset(n,-1):this.pos;if(i==null||i=this.chunk2Pos&&this.posthis.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,n){if(n?(this.token=n,n.start=t,n.lookAhead=t+1,n.value=n.extended=-1):this.token=Rre,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,n-this.chunkPos);if(t>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,n-this.chunk2Pos);if(t>=this.range.from&&n<=this.range.to)return this.input.read(t,n);let i="";for(let r of this.ranges){if(r.from>=n)break;r.to>t&&(i+=this.input.read(Math.max(r.from,t),Math.min(r.to,n)))}return i}}class Sw{constructor(t,n){this.data=t,this.id=n}token(t,n){let{parser:i}=n.p;z4e(this.data,t,n,this.id,i.data,i.tokenPrecTable)}}Sw.prototype.contextual=Sw.prototype.fallback=Sw.prototype.extend=!1;class nP{constructor(t,n,i){this.precTable=n,this.elseToken=i,this.data=typeof t=="string"?OS(t):t}token(t,n){let i=t.pos,r=0;for(;;){let s=t.next<0,o=t.resolveOffset(1,1);if(z4e(this.data,t,n,0,this.data,this.precTable),t.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;t.reset(o,t.token)}r&&(t.reset(i,t.token),t.acceptToken(this.elseToken,r))}}nP.prototype.contextual=Sw.prototype.fallback=Sw.prototype.extend=!1;class Ma{constructor(t,n={}){this.token=t,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function z4e(e,t,n,i,r,s){let o=0,l=1<0){let g=e[m];if(c.allows(g)&&(t.token.value==-1||t.token.value==g||pLt(g,t.token.value,r,s))){t.acceptToken(g);break}}let d=t.next,f=0,h=e[o+2];if(t.next<0&&h>f&&e[u+h*3-3]==65535){o=e[u+h*3-1];continue e}for(;f>1,g=u+m+(m<<1),b=e[g],v=e[g+1]||65536;if(d=v)f=m+1;else{o=e[g+2],t.advance();continue e}}break}}function Ire(e,t,n){for(let i=t,r;(r=e[i])!=65535;i++)if(r==n)return i-t;return-1}function pLt(e,t,n,i){let r=Ire(n,i,t);return r<0||Ire(n,i,e)t)&&!i.type.isError)return n<0?Math.max(0,Math.min(i.to-1,t-25)):Math.min(e.length,Math.max(i.from+1,t+25));if(n<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return n<0?0:e.length}}let mLt=class{constructor(t,n){this.fragments=t,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?Pre(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?Pre(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(tt)return this.nextStart=o,null;if(s instanceof Hi){if(o==t){if(o=Math.max(this.safeFrom,t)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[n]++,this.nextStart=o+s.length}}};class gLt{constructor(t,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(i=>new VN)}getActions(t){let n=0,i=null,{parser:r}=t.p,{tokenizers:s}=r,o=r.stateSlot(t.state,3),l=t.curContext?t.curContext.hash:0,c=0;for(let u=0;uf.end+25&&(c=Math.max(f.lookAhead,c)),f.value!=0)){let h=n;if(f.extended>-1&&(n=this.addActions(t,f.extended,f.end,n)),n=this.addActions(t,f.value,f.end,n),!d.extend&&(i=f,n>h))break}}for(;this.actions.length>n;)this.actions.pop();return c&&t.setLookAhead(c),!i&&t.pos==this.stream.end&&(i=new VN,i.value=t.p.parser.eofTerm,i.start=i.end=t.pos,n=this.addActions(t,i.value,i.end,n)),this.mainToken=i,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let n=new VN,{pos:i,p:r}=t;return n.start=i,n.end=Math.min(i+1,r.stream.end),n.value=i==r.stream.end?r.parser.eofTerm:0,n}updateCachedToken(t,n,i){let r=this.stream.clipPos(i.pos);if(n.token(this.stream.reset(r,t),i),t.value>-1){let{parser:s}=i.p;for(let o=0;o=0&&i.p.parser.dialect.allows(l>>1)){l&1?t.extended=l>>1:t.value=l>>1;break}}}else t.value=0,t.end=this.stream.clipPos(r+1)}putAction(t,n,i,r){for(let s=0;st.bufferLength*4?new mLt(i,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t=this.stacks,n=this.minStackPos,i=this.stacks=[],r,s;if(this.bigReductionCount>300&&t.length==1){let[o]=t;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;on)i.push(l);else{if(this.advanceStack(l,i,t))continue;{r||(r=[],s=[]),r.push(l);let c=this.tokens.getMainToken(l);s.push(c.value,c.end)}}break}}if(!i.length){let o=r&&vLt(r);if(o)return au&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw au&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,i);if(o)return au&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(i.length>o)for(i.sort((l,c)=>c.score-l.score);i.length>o;)i.pop();i.some(l=>l.reducePos>n)&&this.recovering--}else if(i.length>1){e:for(let o=0;o500&&u.buffer.length>500)if((l.score-u.score||l.buffer.length-u.buffer.length)>0)i.splice(c--,1);else{i.splice(o--,1);continue e}}}i.length>12&&(i.sort((o,l)=>l.score-o.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let u=t.curContext&&t.curContext.tracker.strict,d=u?t.curContext.hash:0;for(let f=this.fragments.nodeAt(r);f;){let h=this.parser.nodeSet.types[f.type.id]==f.type?s.getGoto(t.state,f.type.id):-1;if(h>-1&&f.length&&(!u||(f.prop(li.contextHash)||0)==d))return t.useNode(f,h),au&&console.log(o+this.stackID(t)+` (via reuse of ${s.getName(f.type.id)})`),!0;if(!(f instanceof Hi)||f.children.length==0||f.positions[0]>0)break;let m=f.children[0];if(m instanceof Hi&&f.positions[0]==0)f=m;else break}}let l=s.stateSlot(t.state,4);if(l>0)return t.reduce(l),au&&console.log(o+this.stackID(t)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let c=this.tokens.getActions(t);for(let u=0;ur?n.push(g):i.push(g)}return!1}advanceFully(t,n){let i=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>i)return Dre(t,n),!0}}runRecovery(t,n,i){let r=null,s=!1;for(let o=0;o ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),au&&console.log(d+this.stackID(l)+" (restarted)"),this.advanceFully(l,i))))continue;let f=l.split(),h=d;for(let m=0;m<10&&f.forceReduce()&&(au&&console.log(h+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,i));m++)au&&(h=this.stackID(f)+" -> ");for(let m of l.recoverByInsert(c))au&&console.log(d+this.stackID(m)+" (via recover-insert)"),this.advanceFully(m,i);this.stream.end>l.pos?(u==l.pos&&(u++,c=0),l.recoverByDelete(c,u),au&&console.log(d+this.stackID(l)+` (via recover-delete ${this.parser.getName(c)})`),Dre(l,i)):(!r||r.scoree;class nL{constructor(t){this.start=t.start,this.shift=t.shift||m$,this.reduce=t.reduce||m$,this.reuse=t.reuse||m$,this.hash=t.hash||(()=>0),this.strict=t.strict!==!1}}class om extends HM{constructor(t){if(super(),this.wrappers=[],t.version!=14)throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let n=t.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let l=0;lt.topRules[l][1]),r=[];for(let l=0;l=0)s(d,c,l[u++]);else{let f=l[u+-d];for(let h=-d;h>0;h--)s(l[u++],c,f);u++}}}this.nodeSet=new mk(n.map((l,c)=>Ja.define({name:c>=this.minRepeatTerm?void 0:l,id:c,props:r[c],top:i.indexOf(c)>-1,error:c==0,skipped:t.skippedNodes&&t.skippedNodes.indexOf(c)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=U5e;let o=OS(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new Sw(o,l):l),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,n,i){let r=new bLt(this,t,n,i);for(let s of this.wrappers)r=s(r,t,n,i);return r}getGoto(t,n,i=!1){let r=this.goto;if(n>=r[0])return-1;for(let s=r[n+1];;){let o=r[s++],l=o&1,c=r[s++];if(l&&i)return c;for(let u=s+(o>>1);s0}validAction(t,n){return!!this.allActions(t,i=>i==n?!0:null)}allActions(t,n){let i=this.stateSlot(t,4),r=i?n(i):void 0;for(let s=this.stateSlot(t,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=yp(this.data,s+2);else break;r=n(yp(this.data,s+1))}return r}nextStates(t){let n=[];for(let i=this.stateSlot(t,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=yp(this.data,i+2);else break;if(!(this.data[i+2]&1)){let r=this.data[i+1];n.some((s,o)=>o&1&&s==r)||n.push(this.data[i],r)}}return n}configure(t){let n=Object.assign(Object.create(om.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let i=this.topRules[t.top];if(!i)throw new RangeError(`Invalid top rule name ${t.top}`);n.top=i}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(i=>{let r=t.tokenizers.find(s=>s.from==i);return r?r.to:i})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((i,r)=>{let s=t.specializers.find(l=>l.from==i.external);if(!s)return i;let o=Object.assign(Object.assign({},i),{external:s.to});return n.specializers[r]=Mre(o),o})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let n=this.dynamicPrecedences;return n==null?0:n[t]||0}parseDialect(t){let n=Object.keys(this.dialects),i=n.map(()=>!1);if(t)for(let s of t.split(" ")){let o=n.indexOf(s);o>=0&&(i[o]=!0)}let r=null;for(let s=0;si)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.scoree.external(n,i)<<1|t}return e.get}const xLt=316,wLt=317,Lre=1,kLt=2,OLt=3,SLt=4,ELt=318,CLt=320,ALt=321,TLt=5,_Lt=6,jLt=0,s7=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],V4e=125,NLt=59,a7=47,RLt=42,ILt=43,PLt=45,DLt=60,MLt=44,LLt=63,$Lt=46,FLt=91,BLt=new nL({start:!1,shift(e,t){return t==TLt||t==_Lt||t==CLt?e:t==ALt},strict:!1}),ULt=new Ma((e,t)=>{let{next:n}=e;(n==V4e||n==-1||t.context)&&e.acceptToken(ELt)},{contextual:!0,fallback:!0}),QLt=new Ma((e,t)=>{let{next:n}=e,i;s7.indexOf(n)>-1||n==a7&&((i=e.peek(1))==a7||i==RLt)||n!=V4e&&n!=NLt&&n!=-1&&!t.context&&e.acceptToken(xLt)},{contextual:!0}),zLt=new Ma((e,t)=>{e.next==FLt&&!t.context&&e.acceptToken(wLt)},{contextual:!0}),VLt=new Ma((e,t)=>{let{next:n}=e;if(n==ILt||n==PLt){if(e.advance(),n==e.next){e.advance();let i=!t.context&&t.canShift(Lre);e.acceptToken(i?Lre:kLt)}}else n==LLt&&e.peek(1)==$Lt&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(OLt))},{contextual:!0});function g$(e,t){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!t&&e>=48&&e<=57}const HLt=new Ma((e,t)=>{if(e.next!=DLt||!t.dialectEnabled(jLt)||(e.advance(),e.next==a7))return;let n=0;for(;s7.indexOf(e.next)>-1;)e.advance(),n++;if(g$(e.next,!0)){for(e.advance(),n++;g$(e.next,!1);)e.advance(),n++;for(;s7.indexOf(e.next)>-1;)e.advance(),n++;if(e.next==MLt)return;for(let i=0;;i++){if(i==7){if(!g$(e.next,!0))return;break}if(e.next!="extends".charCodeAt(i))break;e.advance(),n++}}e.acceptToken(SLt,-n)}),qLt=vm({"get set async static":me.modifier,"for while do if else switch try catch finally return throw break continue default case defer":me.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":me.operatorKeyword,"let var const using function class extends":me.definitionKeyword,"import export from":me.moduleKeyword,"with debugger new":me.keyword,TemplateString:me.special(me.string),super:me.atom,BooleanLiteral:me.bool,this:me.self,null:me.null,Star:me.modifier,VariableName:me.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":me.function(me.variableName),VariableDefinition:me.definition(me.variableName),Label:me.labelName,PropertyName:me.propertyName,PrivatePropertyName:me.special(me.propertyName),"CallExpression/MemberExpression/PropertyName":me.function(me.propertyName),"FunctionDeclaration/VariableDefinition":me.function(me.definition(me.variableName)),"ClassDeclaration/VariableDefinition":me.definition(me.className),"NewExpression/VariableName":me.className,PropertyDefinition:me.definition(me.propertyName),PrivatePropertyDefinition:me.definition(me.special(me.propertyName)),UpdateOp:me.updateOperator,"LineComment Hashbang":me.lineComment,BlockComment:me.blockComment,Number:me.number,String:me.string,Escape:me.escape,ArithOp:me.arithmeticOperator,LogicOp:me.logicOperator,BitOp:me.bitwiseOperator,CompareOp:me.compareOperator,RegExp:me.regexp,Equals:me.definitionOperator,Arrow:me.function(me.punctuation),": Spread":me.punctuation,"( )":me.paren,"[ ]":me.squareBracket,"{ }":me.brace,"InterpolationStart InterpolationEnd":me.special(me.brace),".":me.derefOperator,", ;":me.separator,"@":me.meta,TypeName:me.typeName,TypeDefinition:me.definition(me.typeName),"type enum interface implements namespace module declare":me.definitionKeyword,"abstract global Privacy readonly override":me.modifier,"is keyof unique infer asserts":me.operatorKeyword,JSXAttributeValue:me.attributeValue,JSXText:me.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":me.angleBracket,"JSXIdentifier JSXNameSpacedName":me.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":me.attributeName,"JSXBuiltin/JSXIdentifier":me.standard(me.tagName)}),WLt={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},KLt={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},GLt={__proto__:null,"<":193},XLt=om.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-EtOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-EPO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-ERQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<VO!l$xO#jROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!OVO!l$xO#jVO!l$xO#jROe!iOpkOrPO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]VO!l$xO#j^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOrROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]WO!l$xO#jgPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{SU+P%]S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mR>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o>UPS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^T)z$u){V+P%]S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SS#q]SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uSSR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:mSR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:oS)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mSS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:mS#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^Q+T%aQ/c*Oo4OP>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^n=rTQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o4OP>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f]>^nZ>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f]>^nZ>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.lPQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.nSR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:BLt,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[qLt],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[QLt,zLt,VLt,HLt,2,3,4,5,6,7,8,9,10,11,12,13,14,ULt,new nP("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new nP("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:e=>WLt[e]||-1},{term:343,get:e=>KLt[e]||-1},{term:95,get:e=>GLt[e]||-1}],tokenPrec:15201});class lW{constructor(t,n,i,r){this.state=t,this.pos=n,this.explicit=i,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let n=es(this.state).resolveInner(this.pos,-1);for(;n&&t.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(t){let n=this.state.doc.lineAt(this.pos),i=Math.max(n.from,this.pos-250),r=n.text.slice(i-n.from,this.pos-n.from),s=r.search(q4e(t,!1));return s<0?null:{from:i+s,to:this.pos,text:r.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(t,n,i){t=="abort"&&this.abortListeners&&(this.abortListeners.push(n),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function $re(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function YLt(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let s=1;stypeof r=="string"?{label:r}:r),[n,i]=t.every(r=>/^\w+$/.test(r.label))?[/\w*$/,/\w+$/]:YLt(t);return r=>{let s=r.matchBefore(i);return s||r.explicit?{from:s?s.from:r.pos,options:t,validFor:n}:null}}function H4e(e,t){return n=>{for(let i=es(n.state).resolveInner(n.pos,-1);i;i=i.parent){if(e.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return t(n)}}class Fre{constructor(t,n,i,r){this.completion=t,this.source=n,this.match=i,this.score=r}}function Gy(e){return e.selection.main.from}function q4e(e,t){var n;let{source:i}=e,r=t&&i[0]!="^",s=i[i.length-1]!="$";return!r&&!s?e:new RegExp(`${r?"^":""}(?:${i})${s?"$":""}`,(n=e.flags)!==null&&n!==void 0?n:e.ignoreCase?"i":"")}const uW=Dh.define();function ZLt(e,t,n,i){let{main:r}=e.selection,s=n-r.from,o=i-r.from;return{...e.changeByRange(l=>{if(l!=r&&n!=i&&e.sliceDoc(l.from+s,l.from+o)!=e.sliceDoc(n,i))return{range:l};let c=e.toText(t);return{changes:{from:l.from+s,to:i==r.from?l.to:l.from+o,insert:c},range:pt.cursor(l.from+s+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const Bre=new WeakMap;function JLt(e){if(!Array.isArray(e))return e;let t=Bre.get(e);return t||Bre.set(e,t=cW(e)),t}const iP=hi.define(),WC=hi.define();class e5t{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n=48&&S<=57||S>=97&&S<=122?2:S>=65&&S<=90?1:0:(O=Lq(S))!=O.toLowerCase()?1:O!=O.toUpperCase()?2:0;(!w||A==1&&v||k==0&&A!=0)&&(n[f]==S||i[f]==S&&(h=!0)?o[f++]=w:o.length&&(y=!1)),k=A,w+=nh(S)}return f==c&&o[0]==0&&y?this.result(-100+(h?-200:0),o,t):m==c&&g==0?this.ret(-200-t.length+(b==t.length?0:-100),[0,b]):l>-1?this.ret(-700-t.length,[l,l+this.pattern.length]):m==c?this.ret(-900-t.length,[g,b]):f==c?this.result(-100+(h?-200:0)+-700+(y?0:-1100),o,t):n.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,t)}result(t,n,i){let r=[],s=0;for(let o of n){let l=o+(this.astral?nh(Ac(i,o)):1);s&&r[s-1]==o?r[s-1]=l:(r[s++]=o,r[s++]=l)}return this.ret(t-i.length,r)}}class t5t{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:n5t,filterStrict:!1,compareCompletions:(t,n)=>(t.sortText||t.label).localeCompare(n.sortText||n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,n)=>t&&n,closeOnBlur:(t,n)=>t&&n,icons:(t,n)=>t&&n,tooltipClass:(t,n)=>i=>Ure(t(i),n(i)),optionClass:(t,n)=>i=>Ure(t(i),n(i)),addToOptions:(t,n)=>t.concat(n),filterStrict:(t,n)=>t||n})}});function Ure(e,t){return e?t?e+" "+t:e:t}function n5t(e,t,n,i,r,s){let o=e.textDirection==cs.RTL,l=o,c=!1,u="top",d,f,h=t.left-r.left,m=r.right-t.right,g=i.right-i.left,b=i.bottom-i.top;if(l&&h=b||w>t.top?d=n.bottom-t.top:(u="bottom",d=t.bottom-n.top)}let v=(t.bottom-t.top)/s.offsetHeight,y=(t.right-t.left)/s.offsetWidth;return{style:`${u}: ${d/v}px; max-width: ${f/y}px`,class:"cm-completionInfo-"+(c?o?"left-narrow":"right-narrow":l?"left":"right")}}const dW=hi.define();function i5t(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(n){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),n.type&&i.classList.add(...n.type.split(/\s+/g).map(r=>"cm-completionIcon-"+r)),i.setAttribute("aria-hidden","true"),i},position:20}),t.push({render(n,i,r,s){let o=document.createElement("span");o.className="cm-completionLabel";let l=n.displayLabel||n.label,c=0;for(let u=0;uc&&o.appendChild(document.createTextNode(l.slice(c,d)));let h=o.appendChild(document.createElement("span"));h.appendChild(document.createTextNode(l.slice(d,f))),h.className="cm-completionMatchedText",c=f}return cn.position-i.position).map(n=>n.render)}function b$(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let r=Math.floor(t/n);return{from:r*n,to:(r+1)*n}}let i=Math.ceil((e-t)/n);return{from:e-i*n,to:e-(i-1)*n}}class r5t{constructor(t,n,i){this.view=t,this.stateField=n,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:c=>this.placeInfo(c),key:this},this.space=null,this.currentClass="";let r=t.state.field(n),{options:s,selected:o}=r.open,l=t.state.facet(Do);this.optionContent=i5t(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=b$(s.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",c=>{let{options:u}=t.state.field(n).open;for(let d=c.target,f;d&&d!=this.dom;d=d.parentNode)if(d.nodeName=="LI"&&(f=/-(\d+)$/.exec(d.id))&&+f[1]this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;d!=null&&(t.dispatch({effects:dW.of(d)}),c.preventDefault())}}),this.dom.addEventListener("focusout",c=>{let u=t.state.field(this.stateField,!1);u&&u.tooltip&&t.state.facet(Do).closeOnBlur&&c.relatedTarget!=t.contentDOM&&t.dispatch({effects:WC.of(null)})}),this.showOptions(s,r.id)}mount(){this.updateSel()}showOptions(t,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(t){var n;let i=t.state.field(this.stateField),r=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),i!=r){let{options:s,selected:o,disabled:l}=i.open;(!r.open||r.open.options!=s)&&(this.range=b$(s.length,o,t.state.facet(Do).maxRenderedOptions),this.showOptions(s,i.id)),this.updateSel(),l!=((n=r.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(t){let n=this.tooltipClass(t);if(n!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of n.split(" "))i&&this.dom.classList.add(i);this.currentClass=n}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),n=t.open;(n.selected>-1&&n.selected=this.range.to)&&(this.range=b$(n.options.length,n.selected,this.view.state.facet(Do).maxRenderedOptions),this.showOptions(n.options,t.id));let i=this.updateSelectedOption(n.selected);if(i){this.destroyInfo();let{completion:r}=n.options[n.selected],{info:s}=r;if(!s)return;let o=typeof s=="string"?document.createTextNode(s):s(r);if(!o)return;"then"in o?o.then(l=>{l&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(l,r)}).catch(l=>Rc(this.view.state,l,"completion info")):(this.addInfoPane(o,r),i.setAttribute("aria-describedby",this.info.id))}}addInfoPane(t,n){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",i.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),t.nodeType!=null)i.appendChild(t),this.infoDestroy=null;else{let{dom:r,destroy:s}=t;i.appendChild(r),this.infoDestroy=s||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let n=null;for(let i=this.list.firstChild,r=this.range.from;i;i=i.nextSibling,r++)i.nodeName!="LI"||!i.id?r--:r==t?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),n=i):i.hasAttribute("aria-selected")&&(i.removeAttribute("aria-selected"),i.removeAttribute("aria-describedby"));return n&&a5t(this.list,n),n}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let n=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),r=t.getBoundingClientRect(),s=this.space;if(!s){let o=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return r.top>Math.min(s.bottom,n.bottom)-10||r.bottom{o.target==r&&o.preventDefault()});let s=null;for(let o=i.from;oi.from||i.from==0))if(s=h,typeof u!="string"&&u.header)r.appendChild(u.header(u));else{let m=r.appendChild(document.createElement("completion-section"));m.textContent=h}}const d=r.appendChild(document.createElement("li"));d.id=n+"-"+o,d.setAttribute("role","option");let f=this.optionClass(l);f&&(d.className=f);for(let h of this.optionContent){let m=h(l,this.view.state,this.view,c);m&&d.appendChild(m)}}return i.from&&r.classList.add("cm-completionListIncompleteTop"),i.tonew r5t(n,e,t)}function a5t(e,t){let n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),r=n.height/e.offsetHeight;i.topn.bottom&&(e.scrollTop+=(i.bottom-n.bottom)/r)}function Qre(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}function o5t(e,t){let n=[],i=null,r=null,s=d=>{n.push(d);let{section:f}=d.completion;if(f){i||(i=[]);let h=typeof f=="string"?f:f.name;i.some(m=>m.name==h)||i.push(typeof f=="string"?{name:h}:f)}},o=t.facet(Do);for(let d of e)if(d.hasResult()){let f=d.result.getMatch;if(d.result.filter===!1)for(let h of d.result.options)s(new Fre(h,d.source,f?f(h):[],1e9-n.length));else{let h=t.sliceDoc(d.from,d.to),m,g=o.filterStrict?new t5t(h):new e5t(h);for(let b of d.result.options)if(m=g.match(b.label)){let v=b.displayLabel?f?f(b,m.matched):[]:m.matched,y=m.score+(b.boost||0);if(s(new Fre(b,d.source,v,y)),typeof b.section=="object"&&b.section.rank==="dynamic"){let{name:w}=b.section;r||(r=Object.create(null)),r[w]=Math.max(y,r[w]||-1e9)}}}}if(i){let d=Object.create(null),f=0,h=(m,g)=>(m.rank==="dynamic"&&g.rank==="dynamic"?r[g.name]-r[m.name]:0)||(typeof m.rank=="number"?m.rank:1e9)-(typeof g.rank=="number"?g.rank:1e9)||(m.nameh.score-f.score||u(f.completion,h.completion))){let f=d.completion;!c||c.label!=f.label||c.detail!=f.detail||c.type!=null&&f.type!=null&&c.type!=f.type||c.apply!=f.apply||c.boost!=f.boost?l.push(d):Qre(d.completion)>Qre(c)&&(l[l.length-1]=d),c=d.completion}return l}class zx{constructor(t,n,i,r,s,o){this.options=t,this.attrs=n,this.tooltip=i,this.timestamp=r,this.selected=s,this.disabled=o}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new zx(this.options,zre(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,i,r,s,o){if(r&&!o&&t.some(u=>u.isPending))return r.setDisabled();let l=o5t(t,n);if(!l.length)return r&&t.some(u=>u.isPending)?r.setDisabled():null;let c=n.facet(Do).selectOnOpen?0:-1;if(r&&r.selected!=c&&r.selected!=-1){let u=r.options[r.selected].completion;for(let d=0;dd.hasResult()?Math.min(u,d.from):u,1e8),create:h5t,above:s.aboveCursor},r?r.timestamp:Date.now(),c,!1)}map(t){return new zx(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new zx(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class rP{constructor(t,n,i){this.active=t,this.id=n,this.open=i}static start(){return new rP(d5t,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,i=n.facet(Do),s=(i.override||n.languageDataAt("autocomplete",Gy(n)).map(JLt)).map(c=>(this.active.find(d=>d.source==c)||new yd(c,this.active.some(d=>d.state!=0)?1:0)).update(t,i));s.length==this.active.length&&s.every((c,u)=>c==this.active[u])&&(s=this.active);let o=this.open,l=t.effects.some(c=>c.is(fW));o&&t.docChanged&&(o=o.map(t.changes)),t.selection||s.some(c=>c.hasResult()&&t.changes.touchesRange(c.from,c.to))||!l5t(s,this.active)||l?o=zx.build(s,n,this.id,o,i,l):o&&o.disabled&&!s.some(c=>c.isPending)&&(o=null),!o&&s.every(c=>!c.isPending)&&s.some(c=>c.hasResult())&&(s=s.map(c=>c.hasResult()?new yd(c.source,0):c));for(let c of t.effects)c.is(dW)&&(o=o&&o.setSelected(c.value,this.id));return s==this.active&&o==this.open?this:new rP(s,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?c5t:u5t}}function l5t(e,t){if(e==t)return!0;for(let n=0,i=0;;){for(;n-1&&(n["aria-activedescendant"]=e+"-"+t),n}const d5t=[];function W4e(e,t){if(e.isUserEvent("input.complete")){let i=e.annotation(uW);if(i&&t.activateOnCompletion(i))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:e.docChanged?16:0}class yd{constructor(t,n,i=!1){this.source=t,this.state=n,this.explicit=i}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let i=W4e(t,n),r=this;(i&8||i&16&&this.touches(t))&&(r=new yd(r.source,0)),i&4&&r.state==0&&(r=new yd(this.source,1)),r=r.updateFor(t,i);for(let s of t.effects)if(s.is(iP))r=new yd(r.source,1,s.value);else if(s.is(WC))r=new yd(r.source,0);else if(s.is(fW))for(let o of s.value)o.source==r.source&&(r=o);return r}updateFor(t,n){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(Gy(t.state))}}class Ew extends yd{constructor(t,n,i,r,s,o){super(t,3,n),this.limit=i,this.result=r,this.from=s,this.to=o}hasResult(){return!0}updateFor(t,n){var i;if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let s=t.changes.mapPos(this.from),o=t.changes.mapPos(this.to,1),l=Gy(t.state);if(l>o||!r||n&2&&(Gy(t.startState)==this.from||ln.map(t))}}),Tc=pl.define({create(){return rP.start()},update(e,t){return e.update(t)},provide:e=>[eW.from(e,t=>t.tooltip),Jt.contentAttributes.from(e,t=>t.attrs)]});function hW(e,t){const n=t.completion.apply||t.completion.label;let i=e.state.field(Tc).active.find(r=>r.source==t.source);return i instanceof Ew?(typeof n=="string"?e.dispatch({...ZLt(e.state,n,i.from,i.to),annotations:uW.of(t.completion)}):n(e,t.completion,i.from,i.to),!0):!1}const h5t=s5t(Tc,hW);function ij(e,t="option"){return n=>{let i=n.state.field(Tc,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+r*(e?1:-1):e?0:o-1;return l<0?l=t=="page"?0:o-1:l>=o&&(l=t=="page"?o-1:0),n.dispatch({effects:dW.of(l)}),!0}}const p5t=e=>{let t=e.state.field(Tc,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestampe.state.field(Tc,!1)?(e.dispatch({effects:iP.of(!0)}),!0):!1,m5t=e=>{let t=e.state.field(Tc,!1);return!t||!t.active.some(n=>n.state!=0)?!1:(e.dispatch({effects:WC.of(null)}),!0)};class g5t{constructor(t,n){this.active=t,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const b5t=50,y5t=1e3,v5t=ba.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(Tc).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(Tc),n=e.state.facet(Do);if(!e.selectionSet&&!e.docChanged&&e.startState.field(Tc)==t)return;let i=e.transactions.some(s=>{let o=W4e(s,n);return o&8||(s.selection||s.docChanged)&&!(o&3)});for(let s=0;sb5t&&Date.now()-o.time>y5t){for(let l of o.context.abortListeners)try{l()}catch(c){Rc(this.view.state,c)}o.context.abortListeners=null,this.running.splice(s--,1)}else o.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(s=>s.effects.some(o=>o.is(iP)))&&(this.pendingStart=!0);let r=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(s=>s.isPending&&!this.running.some(o=>o.active.source==s.source))?setTimeout(()=>this.startUpdate(),r):-1,this.composing!=0)for(let s of e.transactions)s.isUserEvent("input.type")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(Tc);for(let n of t.active)n.isPending&&!this.running.some(i=>i.active.source==n.source)&&this.startQuery(n);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Do).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=Gy(t),i=new lW(t,n,e.explicit,this.view),r=new g5t(e,i);this.running.push(r),Promise.resolve(e.source(i)).then(s=>{r.context.aborted||(r.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:WC.of(null)}),Rc(this.view.state,s)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Do).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(Do),i=this.view.state.field(Tc);for(let r=0;rl.source==s.active.source);if(o&&o.isPending)if(s.done==null){let l=new yd(s.active.source,0);for(let c of s.updates)l=l.update(c,n);l.isPending||t.push(l)}else this.startQuery(o)}(t.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:fW.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(Tc,!1);if(t&&t.tooltip&&this.view.state.facet(Do).closeOnBlur){let n=t.open&&d4e(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:WC.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:iP.of(!1)}),20),this.composing=0}}}),x5t=typeof navigator=="object"&&/Win/.test(navigator.platform),w5t=ym.highest(Jt.domEventHandlers({keydown(e,t){let n=t.state.field(Tc,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(x5t&&e.altKey)||e.metaKey)return!1;let i=n.open.options[n.open.selected],r=n.active.find(o=>o.source==i.source),s=i.completion.commitCharacters||r.result.commitCharacters;return s&&s.indexOf(e.key)>-1&&hW(t,i),!1}})),K4e=Jt.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class k5t{constructor(t,n,i,r){this.field=t,this.line=n,this.from=i,this.to=r}}class pW{constructor(t,n,i){this.field=t,this.from=n,this.to=i}map(t){let n=t.mapPos(this.from,-1,al.TrackDel),i=t.mapPos(this.to,1,al.TrackDel);return n==null||i==null?null:new pW(this.field,n,i)}}class mW{constructor(t,n){this.lines=t,this.fieldPositions=n}instantiate(t,n){let i=[],r=[n],s=t.doc.lineAt(n),o=/^\s*/.exec(s.text)[0];for(let c of this.lines){if(i.length){let u=o,d=/^\t*/.exec(c)[0].length;for(let f=0;fnew pW(c.field,r[c.line]+c.from,r[c.line]+c.to));return{text:i,ranges:l}}static parse(t){let n=[],i=[],r=[],s;for(let o of t.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let l=s[1]?+s[1]:null,c=s[2]||s[3]||"",u=-1;l===0&&(l=1e9);let d=c.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f=u&&h.field++}for(let f of r)if(f.line==i.length&&f.from>s.index){let h=s[2]?3+(s[1]||"").length:2;f.from-=h,f.to-=h}r.push(new k5t(u,i.length,s.index,s.index+d.length)),o=o.slice(0,s.index)+c+o.slice(s.index+s[0].length)}o=o.replace(/\\([{}])/g,(l,c,u)=>{for(let d of r)d.line==i.length&&d.from>u&&(d.from--,d.to--);return c}),i.push(o)}return new mW(i,r)}}let O5t=$n.widget({widget:new class extends Tf{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),S5t=$n.mark({class:"cm-snippetField"});class yk{constructor(t,n){this.ranges=t,this.active=n,this.deco=$n.set(t.map(i=>(i.from==i.to?O5t:S5t).range(i.from,i.to)),!0)}map(t){let n=[];for(let i of this.ranges){let r=i.map(t);if(!r)return null;n.push(r)}return new yk(n,this.active)}selectionInsideField(t){return t.ranges.every(n=>this.ranges.some(i=>i.field==this.active&&i.from<=n.from&&i.to>=n.to))}}const LT=hi.define({map(e,t){return e&&e.map(t)}}),E5t=hi.define(),KC=pl.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(LT))return n.value;if(n.is(E5t)&&e)return new yk(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>Jt.decorations.from(e,t=>t?t.deco:$n.none)});function gW(e,t){return pt.create(e.filter(n=>n.field==t).map(n=>pt.range(n.from,n.to)))}function C5t(e){let t=mW.parse(e);return(n,i,r,s)=>{let{text:o,ranges:l}=t.instantiate(n.state,r),{main:c}=n.state.selection,u={changes:{from:r,to:s==c.from?c.to:s,insert:Or.of(o)},scrollIntoView:!0,annotations:i?[uW.of(i),Ya.userEvent.of("input.complete")]:void 0};if(l.length&&(u.selection=gW(l,0)),l.some(d=>d.field>0)){let d=new yk(l,0),f=u.effects=[LT.of(d)];n.state.field(KC,!1)===void 0&&f.push(hi.appendConfig.of([KC,N5t,R5t,K4e]))}n.dispatch(n.state.update(u))}}function G4e(e){return({state:t,dispatch:n})=>{let i=t.field(KC,!1);if(!i||e<0&&i.active==0)return!1;let r=i.active+e,s=e>0&&!i.ranges.some(o=>o.field==r+e);return n(t.update({selection:gW(i.ranges,r),effects:LT.of(s?null:new yk(i.ranges,r)),scrollIntoView:!0})),!0}}const A5t=({state:e,dispatch:t})=>e.field(KC,!1)?(t(e.update({effects:LT.of(null)})),!0):!1,T5t=G4e(1),_5t=G4e(-1),j5t=[{key:"Tab",run:T5t,shift:_5t},{key:"Escape",run:A5t}],Vre=pn.define({combine(e){return e.length?e[0]:j5t}}),N5t=ym.highest(gk.compute([Vre],e=>e.facet(Vre)));function Xs(e,t){return{...t,apply:C5t(e)}}const R5t=Jt.domEventHandlers({mousedown(e,t){let n=t.state.field(KC,!1),i;if(!n||(i=t.posAtCoords({x:e.clientX,y:e.clientY}))==null)return!1;let r=n.ranges.find(s=>s.from<=i&&s.to>=i);return!r||r.field==n.active?!1:(t.dispatch({selection:gW(n.ranges,r.field),effects:LT.of(n.ranges.some(s=>s.field>r.field)?new yk(n.ranges,r.field):null),scrollIntoView:!0}),!0)}}),GC={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Ny=hi.define({map(e,t){let n=t.mapPos(e,-1,al.TrackAfter);return n??void 0}}),bW=new class extends ub{};bW.startSide=1;bW.endSide=-1;const X4e=pl.define({create(){return Yi.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:i=>i>=n.from&&i<=n.to})}for(let n of t.effects)n.is(Ny)&&(e=e.update({add:[bW.range(n.value,n.value+1)]}));return e}});function I5t(){return[D5t,X4e]}const v$="()[]{}<>«»»«[]{}";function Y4e(e){for(let t=0;t{if((P5t?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let r=e.state.selection.main;if(i.length>2||i.length==2&&nh(Ac(i,0))==1||t!=r.from||n!=r.to)return!1;let s=$5t(e.state,i);return s?(e.dispatch(s),!0):!1}),M5t=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=Z4e(e,e.selection.main.head).brackets||GC.brackets,r=null,s=e.changeByRange(o=>{if(o.empty){let l=F5t(e.doc,o.head);for(let c of i)if(c==l&&iL(e.doc,o.head)==Y4e(Ac(c,0)))return{changes:{from:o.head-c.length,to:o.head+c.length},range:pt.cursor(o.head-c.length)}}return{range:r=o}});return r||t(e.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},L5t=[{key:"Backspace",run:M5t}];function $5t(e,t){let n=Z4e(e,e.selection.main.head),i=n.brackets||GC.brackets;for(let r of i){let s=Y4e(Ac(r,0));if(t==r)return s==r?Q5t(e,r,i.indexOf(r+r+r)>-1,n):B5t(e,r,s,n.before||GC.before);if(t==s&&J4e(e,e.selection.main.from))return U5t(e,r,s)}return null}function J4e(e,t){let n=!1;return e.field(X4e).between(0,e.doc.length,i=>{i==t&&(n=!0)}),n}function iL(e,t){let n=e.sliceString(t,t+2);return n.slice(0,nh(Ac(n,0)))}function F5t(e,t){let n=e.sliceString(t-2,t);return nh(Ac(n,0))==n.length?n:n.slice(1)}function B5t(e,t,n,i){let r=null,s=e.changeByRange(o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:n,from:o.to}],effects:Ny.of(o.to+t.length),range:pt.range(o.anchor+t.length,o.head+t.length)};let l=iL(e.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:t+n,from:o.head},effects:Ny.of(o.head+t.length),range:pt.cursor(o.head+t.length)}:{range:r=o}});return r?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function U5t(e,t,n){let i=null,r=e.changeByRange(s=>s.empty&&iL(e.doc,s.head)==n?{changes:{from:s.head,to:s.head+n.length,insert:n},range:pt.cursor(s.head+n.length)}:i={range:s});return i?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function Q5t(e,t,n,i){let r=i.stringPrefixes||GC.stringPrefixes,s=null,o=e.changeByRange(l=>{if(!l.empty)return{changes:[{insert:t,from:l.from},{insert:t,from:l.to}],effects:Ny.of(l.to+t.length),range:pt.range(l.anchor+t.length,l.head+t.length)};let c=l.head,u=iL(e.doc,c),d;if(u==t){if(Hre(e,c))return{changes:{insert:t+t,from:c},effects:Ny.of(c+t.length),range:pt.cursor(c+t.length)};if(J4e(e,c)){let h=n&&e.sliceDoc(c,c+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:c,to:c+h.length,insert:h},range:pt.cursor(c+h.length)}}}else{if(n&&e.sliceDoc(c-2*t.length,c)==t+t&&(d=qre(e,c-2*t.length,r))>-1&&Hre(e,d))return{changes:{insert:t+t+t+t,from:c},effects:Ny.of(c+t.length),range:pt.cursor(c+t.length)};if(e.charCategorizer(c)(u)!=Qs.Word&&qre(e,c,r)>-1&&!z5t(e,c,t,r))return{changes:{insert:t+t,from:c},effects:Ny.of(c+t.length),range:pt.cursor(c+t.length)}}return{range:s=l}});return s?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function Hre(e,t){let n=es(e).resolveInner(t+1);return n.parent&&n.from==t}function z5t(e,t,n,i){let r=es(e).resolveInner(t,-1),s=i.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=e.sliceDoc(r.from,Math.min(r.to,r.from+n.length+s)),c=l.indexOf(n);if(!c||c>-1&&i.indexOf(l.slice(0,c))>-1){let d=r.firstChild;for(;d&&d.from==r.from&&d.to-d.from>n.length+c;){if(e.sliceDoc(d.to-n.length,d.to)==n)return!1;d=d.firstChild}return!0}let u=r.to==t&&r.parent;if(!u)break;r=u}return!1}function qre(e,t,n){let i=e.charCategorizer(t);if(i(e.sliceDoc(t-1,t))!=Qs.Word)return t;for(let r of n){let s=t-r.length;if(e.sliceDoc(s,t)==r&&i(e.sliceDoc(s-1,s))!=Qs.Word)return s}return-1}function V5t(e={}){return[w5t,Tc,Do.of(e),v5t,H5t,K4e]}const e$e=[{key:"Ctrl-Space",run:y$},{mac:"Alt-`",run:y$},{mac:"Alt-i",run:y$},{key:"Escape",run:m5t},{key:"ArrowDown",run:ij(!0)},{key:"ArrowUp",run:ij(!1)},{key:"PageDown",run:ij(!0,"page")},{key:"PageUp",run:ij(!1,"page")},{key:"Enter",run:p5t}],H5t=ym.highest(gk.computeN([Do],e=>e.facet(Do).defaultKeymap?[e$e]:[])),t$e=[Xs("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Xs("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Xs("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Xs("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Xs("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Xs(`try { +`);i>-1&&(n=n.slice(0,i))}return t+n.length<=this.to?n:n.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,n=this.lineAfter(t),i=t+n.length;for(let r=this.rangeIndex;;){let s=this.ranges[r].to;if(s>=i||(n=n.slice(0,s-(i-n.length)),r++,r==this.ranges.length))break;let o=this.ranges[r].from,l=this.lineAfter(o);n+=l,i=o+l.length}return{line:n,end:i}}skipGapsTo(t,n,i){for(;;){let r=this.ranges[this.rangeIndex].to,s=t+n;if(i>0?r>s:r>=s)break;let o=this.ranges[++this.rangeIndex].from;n+=o-r}return n}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){r=this.skipGapsTo(n,r,1),n+=r;let l=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,s+=this.chunk.length-l}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&o>=0&&this.chunk[o]==t&&this.chunk[o+2]==n?this.chunk[o+2]=i:this.chunk.push(t,n,i,s),r}parseLine(t){let{line:n,end:i}=this.nextLine(),r=0,{streamParser:s}=this.lang,o=new $4e(n,t?t.state.tabSize:4,t?xv(t.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=B4e(s.token,o,this.state);if(l&&(r=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,r)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPost.start)return r}throw new Error("Stream parser failed to advance stream.")}const oW=Object.create(null),qC=[Ja.none],uLt=new mk(qC),Tre=[],_re=Object.create(null),U4e=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])U4e[e]=z4e(oW,t);class Q4e{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),U4e)}resolve(t){return t?this.table[t]||(this.table[t]=z4e(this.extra,t)):0}}const dLt=new Q4e(oW);function h$(e,t){Tre.indexOf(e)>-1||(Tre.push(e),console.warn(t))}function z4e(e,t){let n=[];for(let l of t.split(" ")){let c=[];for(let u of l.split(".")){let d=e[u]||pe[u];d?typeof d=="function"?c.length?c=c.map(d):h$(u,`Modifier ${u} used at start of tag`):c.length?h$(u,`Tag ${u} used as modifier`):c=Array.isArray(d)?d:[d]:h$(u,`Unknown highlighting tag ${u}`)}for(let u of c)n.push(u)}if(!n.length)return 0;let i=t.replace(/ /g,"_"),r=i+" "+n.map(l=>l.id),s=_re[r];if(s)return s.id;let o=_re[r]=Ja.define({id:qC.length,name:i,props:[vm({[i]:n})]});return qC.push(o),o.id}function fLt(e,t){let n=Ja.define({id:qC.length,name:"Document",props:[xg.add(()=>e),xm.add(()=>i=>t.getIndent(i))],top:!0});return qC.push(n),n}cs.RTL,cs.LTR;var jre={};class eP{constructor(t,n,i,r,s,o,l,c,u,d=0,f){this.p=t,this.stack=n,this.state=i,this.reducePos=r,this.pos=s,this.score=o,this.buffer=l,this.bufferBase=c,this.curContext=u,this.lookAhead=d,this.parent=f}toString(){return`[${this.stack.filter((t,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,n,i=0){let r=t.parser.context;return new eP(t,[],n,i,i,0,[],0,r?new Nre(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var n;let i=t>>19,r=t&65535,{parser:s}=this.p,o=this.reducePos=2e3&&!(!((n=this.p.parser.nodeSet.types[r])===null||n===void 0)&&n.isAnonymous)&&(u==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=d):this.p.lastBigReductionSizec;)this.stack.pop();this.reduceContext(r,u)}storeNode(t,n,i,r=4,s=!1){if(t==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&this.buffer[o-4]==0&&this.buffer[o-1]>-1){if(n==i)return;if(this.buffer[o-2]>=n){this.buffer[o-2]=i;return}}}if(!s||this.pos==i)this.buffer.push(t,n,i,r);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let c=o;c>0&&this.buffer[c-2]>i;c-=4)if(this.buffer[c-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>i;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=t,this.buffer[o+1]=n,this.buffer[o+2]=i,this.buffer[o+3]=r}}shift(t,n,i,r){if(t&131072)this.pushState(t&65535,this.pos);else if(t&262144)this.pos=r,this.shiftContext(n,i),n<=this.p.parser.maxNode&&this.buffer.push(n,i,r,4);else{let s=t,{parser:o}=this.p;this.pos=r;let l=o.stateFlag(s,1);!l&&(r>i||n<=o.maxNode)&&(this.reducePos=r),this.pushState(s,l?i:Math.min(i,this.reducePos)),this.shiftContext(n,i),n<=o.maxNode&&this.buffer.push(n,i,r,4)}}apply(t,n,i,r){t&65536?this.reduce(t):this.shift(t,n,i,r)}useNode(t,n){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=t)&&(this.p.reused.push(t),i++);let r=this.pos;this.reducePos=this.pos=r+t.length,this.pushState(n,r),this.buffer.push(i,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let i=t.buffer.slice(n),r=t.bufferBase+n;for(;t&&r==t.bufferBase;)t=t.parent;return new eP(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,r,this.curContext,this.lookAhead,t)}recoverByDelete(t,n){let i=t<=this.p.parser.maxNode;i&&this.storeNode(t,this.pos,n,4),this.storeNode(0,this.pos,n,i?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(t){for(let n=new hLt(this);;){let i=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,t);if(i==0)return!1;if(!(i&65536))return!0;n.reduce(i)}}recoverByInsert(t){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let r=[];for(let s=0,o;sc&1&&l==o)||r.push(n[s],o)}n=r}let i=[];for(let r=0;r>19,r=n&65535,s=this.stack.length-i*3;if(s<0||t.getGoto(this.stack[s],r,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;n=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:t}=this.p,n=[],i=(r,s)=>{if(!n.includes(r))return n.push(r),t.allActions(r,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-s;if(l>1){let c=o&65535,u=this.stack.length-l*3;if(u>=0&&t.getGoto(this.stack[u],c,!1)>=0)return l<<19|65536|c}}else{let l=i(o,s+1);if(l!=null)return l}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:t}=this.p;return t.data[t.stateSlot(this.state,1)]==65535&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let n=0;n0&&this.emitLookAhead()}}class Nre{constructor(t,n){this.tracker=t,this.context=n,this.hash=t.strict?t.hash(n):0}}class hLt{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let n=t&65535,i=t>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=r}}class tP{constructor(t,n,i){this.stack=t,this.pos=n,this.index=i,this.buffer=t.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new tP(t,n,n-t.bufferBase)}maybeNext(){let t=this.stack.parent;t!=null&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new tP(this.stack,this.pos,this.index)}}function OS(e,t=Uint16Array){if(typeof e!="string")return e;let n=null;for(let i=0,r=0;i=92&&o--,o>=34&&o--;let c=o-32;if(c>=46&&(c-=46,l=!0),s+=c,l)break;s*=46}n?n[r++]=s:n=new t(s)}return n}class VN{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Rre=new VN;class pLt{constructor(t,n){this.input=t,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Rre,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(t,n){let i=this.range,r=this.rangeIndex,s=this.pos+t;for(;si.to:s>=i.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-i.to,i=o}return s}clipPos(t){if(t>=this.range.from&&tt)return Math.max(t,n.from);return this.end}peek(t){let n=this.chunkOff+t,i,r;if(n>=0&&n=this.chunk2Pos&&il.to&&(this.chunk2=this.chunk2.slice(0,l.to-i)),r=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),r}acceptToken(t,n=0){let i=n?this.resolveOffset(n,-1):this.pos;if(i==null||i=this.chunk2Pos&&this.posthis.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,n){if(n?(this.token=n,n.start=t,n.lookAhead=t+1,n.value=n.extended=-1):this.token=Rre,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,n-this.chunkPos);if(t>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,n-this.chunk2Pos);if(t>=this.range.from&&n<=this.range.to)return this.input.read(t,n);let i="";for(let r of this.ranges){if(r.from>=n)break;r.to>t&&(i+=this.input.read(Math.max(r.from,t),Math.min(r.to,n)))}return i}}class Sw{constructor(t,n){this.data=t,this.id=n}token(t,n){let{parser:i}=n.p;V4e(this.data,t,n,this.id,i.data,i.tokenPrecTable)}}Sw.prototype.contextual=Sw.prototype.fallback=Sw.prototype.extend=!1;class nP{constructor(t,n,i){this.precTable=n,this.elseToken=i,this.data=typeof t=="string"?OS(t):t}token(t,n){let i=t.pos,r=0;for(;;){let s=t.next<0,o=t.resolveOffset(1,1);if(V4e(this.data,t,n,0,this.data,this.precTable),t.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;t.reset(o,t.token)}r&&(t.reset(i,t.token),t.acceptToken(this.elseToken,r))}}nP.prototype.contextual=Sw.prototype.fallback=Sw.prototype.extend=!1;class Ma{constructor(t,n={}){this.token=t,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function V4e(e,t,n,i,r,s){let o=0,l=1<0){let g=e[m];if(c.allows(g)&&(t.token.value==-1||t.token.value==g||mLt(g,t.token.value,r,s))){t.acceptToken(g);break}}let d=t.next,f=0,h=e[o+2];if(t.next<0&&h>f&&e[u+h*3-3]==65535){o=e[u+h*3-1];continue e}for(;f>1,g=u+m+(m<<1),b=e[g],v=e[g+1]||65536;if(d=v)f=m+1;else{o=e[g+2],t.advance();continue e}}break}}function Ire(e,t,n){for(let i=t,r;(r=e[i])!=65535;i++)if(r==n)return i-t;return-1}function mLt(e,t,n,i){let r=Ire(n,i,t);return r<0||Ire(n,i,e)t)&&!i.type.isError)return n<0?Math.max(0,Math.min(i.to-1,t-25)):Math.min(e.length,Math.max(i.from+1,t+25));if(n<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return n<0?0:e.length}}let gLt=class{constructor(t,n){this.fragments=t,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?Pre(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?Pre(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(tt)return this.nextStart=o,null;if(s instanceof Hi){if(o==t){if(o=Math.max(this.safeFrom,t)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[n]++,this.nextStart=o+s.length}}};class bLt{constructor(t,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(i=>new VN)}getActions(t){let n=0,i=null,{parser:r}=t.p,{tokenizers:s}=r,o=r.stateSlot(t.state,3),l=t.curContext?t.curContext.hash:0,c=0;for(let u=0;uf.end+25&&(c=Math.max(f.lookAhead,c)),f.value!=0)){let h=n;if(f.extended>-1&&(n=this.addActions(t,f.extended,f.end,n)),n=this.addActions(t,f.value,f.end,n),!d.extend&&(i=f,n>h))break}}for(;this.actions.length>n;)this.actions.pop();return c&&t.setLookAhead(c),!i&&t.pos==this.stream.end&&(i=new VN,i.value=t.p.parser.eofTerm,i.start=i.end=t.pos,n=this.addActions(t,i.value,i.end,n)),this.mainToken=i,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let n=new VN,{pos:i,p:r}=t;return n.start=i,n.end=Math.min(i+1,r.stream.end),n.value=i==r.stream.end?r.parser.eofTerm:0,n}updateCachedToken(t,n,i){let r=this.stream.clipPos(i.pos);if(n.token(this.stream.reset(r,t),i),t.value>-1){let{parser:s}=i.p;for(let o=0;o=0&&i.p.parser.dialect.allows(l>>1)){l&1?t.extended=l>>1:t.value=l>>1;break}}}else t.value=0,t.end=this.stream.clipPos(r+1)}putAction(t,n,i,r){for(let s=0;st.bufferLength*4?new gLt(i,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t=this.stacks,n=this.minStackPos,i=this.stacks=[],r,s;if(this.bigReductionCount>300&&t.length==1){let[o]=t;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;on)i.push(l);else{if(this.advanceStack(l,i,t))continue;{r||(r=[],s=[]),r.push(l);let c=this.tokens.getMainToken(l);s.push(c.value,c.end)}}break}}if(!i.length){let o=r&&xLt(r);if(o)return au&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw au&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,i);if(o)return au&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(i.length>o)for(i.sort((l,c)=>c.score-l.score);i.length>o;)i.pop();i.some(l=>l.reducePos>n)&&this.recovering--}else if(i.length>1){e:for(let o=0;o500&&u.buffer.length>500)if((l.score-u.score||l.buffer.length-u.buffer.length)>0)i.splice(c--,1);else{i.splice(o--,1);continue e}}}i.length>12&&(i.sort((o,l)=>l.score-o.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let u=t.curContext&&t.curContext.tracker.strict,d=u?t.curContext.hash:0;for(let f=this.fragments.nodeAt(r);f;){let h=this.parser.nodeSet.types[f.type.id]==f.type?s.getGoto(t.state,f.type.id):-1;if(h>-1&&f.length&&(!u||(f.prop(li.contextHash)||0)==d))return t.useNode(f,h),au&&console.log(o+this.stackID(t)+` (via reuse of ${s.getName(f.type.id)})`),!0;if(!(f instanceof Hi)||f.children.length==0||f.positions[0]>0)break;let m=f.children[0];if(m instanceof Hi&&f.positions[0]==0)f=m;else break}}let l=s.stateSlot(t.state,4);if(l>0)return t.reduce(l),au&&console.log(o+this.stackID(t)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let c=this.tokens.getActions(t);for(let u=0;ur?n.push(g):i.push(g)}return!1}advanceFully(t,n){let i=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>i)return Dre(t,n),!0}}runRecovery(t,n,i){let r=null,s=!1;for(let o=0;o ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),au&&console.log(d+this.stackID(l)+" (restarted)"),this.advanceFully(l,i))))continue;let f=l.split(),h=d;for(let m=0;m<10&&f.forceReduce()&&(au&&console.log(h+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,i));m++)au&&(h=this.stackID(f)+" -> ");for(let m of l.recoverByInsert(c))au&&console.log(d+this.stackID(m)+" (via recover-insert)"),this.advanceFully(m,i);this.stream.end>l.pos?(u==l.pos&&(u++,c=0),l.recoverByDelete(c,u),au&&console.log(d+this.stackID(l)+` (via recover-delete ${this.parser.getName(c)})`),Dre(l,i)):(!r||r.scoree;class nL{constructor(t){this.start=t.start,this.shift=t.shift||m$,this.reduce=t.reduce||m$,this.reuse=t.reuse||m$,this.hash=t.hash||(()=>0),this.strict=t.strict!==!1}}class om extends HM{constructor(t){if(super(),this.wrappers=[],t.version!=14)throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let n=t.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let l=0;lt.topRules[l][1]),r=[];for(let l=0;l=0)s(d,c,l[u++]);else{let f=l[u+-d];for(let h=-d;h>0;h--)s(l[u++],c,f);u++}}}this.nodeSet=new mk(n.map((l,c)=>Ja.define({name:c>=this.minRepeatTerm?void 0:l,id:c,props:r[c],top:i.indexOf(c)>-1,error:c==0,skipped:t.skippedNodes&&t.skippedNodes.indexOf(c)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=Q5e;let o=OS(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new Sw(o,l):l),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,n,i){let r=new yLt(this,t,n,i);for(let s of this.wrappers)r=s(r,t,n,i);return r}getGoto(t,n,i=!1){let r=this.goto;if(n>=r[0])return-1;for(let s=r[n+1];;){let o=r[s++],l=o&1,c=r[s++];if(l&&i)return c;for(let u=s+(o>>1);s0}validAction(t,n){return!!this.allActions(t,i=>i==n?!0:null)}allActions(t,n){let i=this.stateSlot(t,4),r=i?n(i):void 0;for(let s=this.stateSlot(t,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=yp(this.data,s+2);else break;r=n(yp(this.data,s+1))}return r}nextStates(t){let n=[];for(let i=this.stateSlot(t,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=yp(this.data,i+2);else break;if(!(this.data[i+2]&1)){let r=this.data[i+1];n.some((s,o)=>o&1&&s==r)||n.push(this.data[i],r)}}return n}configure(t){let n=Object.assign(Object.create(om.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let i=this.topRules[t.top];if(!i)throw new RangeError(`Invalid top rule name ${t.top}`);n.top=i}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(i=>{let r=t.tokenizers.find(s=>s.from==i);return r?r.to:i})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((i,r)=>{let s=t.specializers.find(l=>l.from==i.external);if(!s)return i;let o=Object.assign(Object.assign({},i),{external:s.to});return n.specializers[r]=Mre(o),o})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let n=this.dynamicPrecedences;return n==null?0:n[t]||0}parseDialect(t){let n=Object.keys(this.dialects),i=n.map(()=>!1);if(t)for(let s of t.split(" ")){let o=n.indexOf(s);o>=0&&(i[o]=!0)}let r=null;for(let s=0;si)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.scoree.external(n,i)<<1|t}return e.get}const wLt=316,kLt=317,Lre=1,OLt=2,SLt=3,ELt=4,CLt=318,ALt=320,TLt=321,_Lt=5,jLt=6,NLt=0,s7=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],H4e=125,RLt=59,a7=47,ILt=42,PLt=43,DLt=45,MLt=60,LLt=44,$Lt=63,FLt=46,BLt=91,ULt=new nL({start:!1,shift(e,t){return t==_Lt||t==jLt||t==ALt?e:t==TLt},strict:!1}),QLt=new Ma((e,t)=>{let{next:n}=e;(n==H4e||n==-1||t.context)&&e.acceptToken(CLt)},{contextual:!0,fallback:!0}),zLt=new Ma((e,t)=>{let{next:n}=e,i;s7.indexOf(n)>-1||n==a7&&((i=e.peek(1))==a7||i==ILt)||n!=H4e&&n!=RLt&&n!=-1&&!t.context&&e.acceptToken(wLt)},{contextual:!0}),VLt=new Ma((e,t)=>{e.next==BLt&&!t.context&&e.acceptToken(kLt)},{contextual:!0}),HLt=new Ma((e,t)=>{let{next:n}=e;if(n==PLt||n==DLt){if(e.advance(),n==e.next){e.advance();let i=!t.context&&t.canShift(Lre);e.acceptToken(i?Lre:OLt)}}else n==$Lt&&e.peek(1)==FLt&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(SLt))},{contextual:!0});function g$(e,t){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!t&&e>=48&&e<=57}const qLt=new Ma((e,t)=>{if(e.next!=MLt||!t.dialectEnabled(NLt)||(e.advance(),e.next==a7))return;let n=0;for(;s7.indexOf(e.next)>-1;)e.advance(),n++;if(g$(e.next,!0)){for(e.advance(),n++;g$(e.next,!1);)e.advance(),n++;for(;s7.indexOf(e.next)>-1;)e.advance(),n++;if(e.next==LLt)return;for(let i=0;;i++){if(i==7){if(!g$(e.next,!0))return;break}if(e.next!="extends".charCodeAt(i))break;e.advance(),n++}}e.acceptToken(ELt,-n)}),WLt=vm({"get set async static":pe.modifier,"for while do if else switch try catch finally return throw break continue default case defer":pe.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":pe.operatorKeyword,"let var const using function class extends":pe.definitionKeyword,"import export from":pe.moduleKeyword,"with debugger new":pe.keyword,TemplateString:pe.special(pe.string),super:pe.atom,BooleanLiteral:pe.bool,this:pe.self,null:pe.null,Star:pe.modifier,VariableName:pe.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":pe.function(pe.variableName),VariableDefinition:pe.definition(pe.variableName),Label:pe.labelName,PropertyName:pe.propertyName,PrivatePropertyName:pe.special(pe.propertyName),"CallExpression/MemberExpression/PropertyName":pe.function(pe.propertyName),"FunctionDeclaration/VariableDefinition":pe.function(pe.definition(pe.variableName)),"ClassDeclaration/VariableDefinition":pe.definition(pe.className),"NewExpression/VariableName":pe.className,PropertyDefinition:pe.definition(pe.propertyName),PrivatePropertyDefinition:pe.definition(pe.special(pe.propertyName)),UpdateOp:pe.updateOperator,"LineComment Hashbang":pe.lineComment,BlockComment:pe.blockComment,Number:pe.number,String:pe.string,Escape:pe.escape,ArithOp:pe.arithmeticOperator,LogicOp:pe.logicOperator,BitOp:pe.bitwiseOperator,CompareOp:pe.compareOperator,RegExp:pe.regexp,Equals:pe.definitionOperator,Arrow:pe.function(pe.punctuation),": Spread":pe.punctuation,"( )":pe.paren,"[ ]":pe.squareBracket,"{ }":pe.brace,"InterpolationStart InterpolationEnd":pe.special(pe.brace),".":pe.derefOperator,", ;":pe.separator,"@":pe.meta,TypeName:pe.typeName,TypeDefinition:pe.definition(pe.typeName),"type enum interface implements namespace module declare":pe.definitionKeyword,"abstract global Privacy readonly override":pe.modifier,"is keyof unique infer asserts":pe.operatorKeyword,JSXAttributeValue:pe.attributeValue,JSXText:pe.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":pe.angleBracket,"JSXIdentifier JSXNameSpacedName":pe.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":pe.attributeName,"JSXBuiltin/JSXIdentifier":pe.standard(pe.tagName)}),KLt={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},GLt={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},XLt={__proto__:null,"<":193},YLt=om.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-EtOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-EPO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-ERQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<VO!l$xO#jROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!OVO!l$xO#jVO!l$xO#jROe!iOpkOrPO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]VO!l$xO#j^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOrROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]WO!l$xO#jgPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{SU+P%]S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mR>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o>UPS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^T)z$u){V+P%]S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SS#q]SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uSSR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:mSR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:oS)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mSS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:mS#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^Q+T%aQ/c*Oo4OP>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^n=rTQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o4OP>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f]>^nZ>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f]>^nZ>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.lPQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.nSR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:ULt,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[WLt],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[zLt,VLt,HLt,qLt,2,3,4,5,6,7,8,9,10,11,12,13,14,QLt,new nP("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new nP("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:e=>KLt[e]||-1},{term:343,get:e=>GLt[e]||-1},{term:95,get:e=>XLt[e]||-1}],tokenPrec:15201});class lW{constructor(t,n,i,r){this.state=t,this.pos=n,this.explicit=i,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let n=es(this.state).resolveInner(this.pos,-1);for(;n&&t.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(t){let n=this.state.doc.lineAt(this.pos),i=Math.max(n.from,this.pos-250),r=n.text.slice(i-n.from,this.pos-n.from),s=r.search(W4e(t,!1));return s<0?null:{from:i+s,to:this.pos,text:r.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(t,n,i){t=="abort"&&this.abortListeners&&(this.abortListeners.push(n),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function $re(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function ZLt(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let s=1;stypeof r=="string"?{label:r}:r),[n,i]=t.every(r=>/^\w+$/.test(r.label))?[/\w*$/,/\w+$/]:ZLt(t);return r=>{let s=r.matchBefore(i);return s||r.explicit?{from:s?s.from:r.pos,options:t,validFor:n}:null}}function q4e(e,t){return n=>{for(let i=es(n.state).resolveInner(n.pos,-1);i;i=i.parent){if(e.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return t(n)}}class Fre{constructor(t,n,i,r){this.completion=t,this.source=n,this.match=i,this.score=r}}function Gy(e){return e.selection.main.from}function W4e(e,t){var n;let{source:i}=e,r=t&&i[0]!="^",s=i[i.length-1]!="$";return!r&&!s?e:new RegExp(`${r?"^":""}(?:${i})${s?"$":""}`,(n=e.flags)!==null&&n!==void 0?n:e.ignoreCase?"i":"")}const uW=Dh.define();function JLt(e,t,n,i){let{main:r}=e.selection,s=n-r.from,o=i-r.from;return{...e.changeByRange(l=>{if(l!=r&&n!=i&&e.sliceDoc(l.from+s,l.from+o)!=e.sliceDoc(n,i))return{range:l};let c=e.toText(t);return{changes:{from:l.from+s,to:i==r.from?l.to:l.from+o,insert:c},range:pt.cursor(l.from+s+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const Bre=new WeakMap;function e5t(e){if(!Array.isArray(e))return e;let t=Bre.get(e);return t||Bre.set(e,t=cW(e)),t}const iP=hi.define(),WC=hi.define();class t5t{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n=48&&S<=57||S>=97&&S<=122?2:S>=65&&S<=90?1:0:(O=Lq(S))!=O.toLowerCase()?1:O!=O.toUpperCase()?2:0;(!w||A==1&&v||k==0&&A!=0)&&(n[f]==S||i[f]==S&&(h=!0)?o[f++]=w:o.length&&(y=!1)),k=A,w+=nh(S)}return f==c&&o[0]==0&&y?this.result(-100+(h?-200:0),o,t):m==c&&g==0?this.ret(-200-t.length+(b==t.length?0:-100),[0,b]):l>-1?this.ret(-700-t.length,[l,l+this.pattern.length]):m==c?this.ret(-900-t.length,[g,b]):f==c?this.result(-100+(h?-200:0)+-700+(y?0:-1100),o,t):n.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,t)}result(t,n,i){let r=[],s=0;for(let o of n){let l=o+(this.astral?nh(Ac(i,o)):1);s&&r[s-1]==o?r[s-1]=l:(r[s++]=o,r[s++]=l)}return this.ret(t-i.length,r)}}class n5t{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:i5t,filterStrict:!1,compareCompletions:(t,n)=>(t.sortText||t.label).localeCompare(n.sortText||n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,n)=>t&&n,closeOnBlur:(t,n)=>t&&n,icons:(t,n)=>t&&n,tooltipClass:(t,n)=>i=>Ure(t(i),n(i)),optionClass:(t,n)=>i=>Ure(t(i),n(i)),addToOptions:(t,n)=>t.concat(n),filterStrict:(t,n)=>t||n})}});function Ure(e,t){return e?t?e+" "+t:e:t}function i5t(e,t,n,i,r,s){let o=e.textDirection==cs.RTL,l=o,c=!1,u="top",d,f,h=t.left-r.left,m=r.right-t.right,g=i.right-i.left,b=i.bottom-i.top;if(l&&h=b||w>t.top?d=n.bottom-t.top:(u="bottom",d=t.bottom-n.top)}let v=(t.bottom-t.top)/s.offsetHeight,y=(t.right-t.left)/s.offsetWidth;return{style:`${u}: ${d/v}px; max-width: ${f/y}px`,class:"cm-completionInfo-"+(c?o?"left-narrow":"right-narrow":l?"left":"right")}}const dW=hi.define();function r5t(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(n){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),n.type&&i.classList.add(...n.type.split(/\s+/g).map(r=>"cm-completionIcon-"+r)),i.setAttribute("aria-hidden","true"),i},position:20}),t.push({render(n,i,r,s){let o=document.createElement("span");o.className="cm-completionLabel";let l=n.displayLabel||n.label,c=0;for(let u=0;uc&&o.appendChild(document.createTextNode(l.slice(c,d)));let h=o.appendChild(document.createElement("span"));h.appendChild(document.createTextNode(l.slice(d,f))),h.className="cm-completionMatchedText",c=f}return cn.position-i.position).map(n=>n.render)}function b$(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let r=Math.floor(t/n);return{from:r*n,to:(r+1)*n}}let i=Math.ceil((e-t)/n);return{from:e-i*n,to:e-(i-1)*n}}class s5t{constructor(t,n,i){this.view=t,this.stateField=n,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:c=>this.placeInfo(c),key:this},this.space=null,this.currentClass="";let r=t.state.field(n),{options:s,selected:o}=r.open,l=t.state.facet(Do);this.optionContent=r5t(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=b$(s.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",c=>{let{options:u}=t.state.field(n).open;for(let d=c.target,f;d&&d!=this.dom;d=d.parentNode)if(d.nodeName=="LI"&&(f=/-(\d+)$/.exec(d.id))&&+f[1]this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;d!=null&&(t.dispatch({effects:dW.of(d)}),c.preventDefault())}}),this.dom.addEventListener("focusout",c=>{let u=t.state.field(this.stateField,!1);u&&u.tooltip&&t.state.facet(Do).closeOnBlur&&c.relatedTarget!=t.contentDOM&&t.dispatch({effects:WC.of(null)})}),this.showOptions(s,r.id)}mount(){this.updateSel()}showOptions(t,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(t){var n;let i=t.state.field(this.stateField),r=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),i!=r){let{options:s,selected:o,disabled:l}=i.open;(!r.open||r.open.options!=s)&&(this.range=b$(s.length,o,t.state.facet(Do).maxRenderedOptions),this.showOptions(s,i.id)),this.updateSel(),l!=((n=r.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(t){let n=this.tooltipClass(t);if(n!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of n.split(" "))i&&this.dom.classList.add(i);this.currentClass=n}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),n=t.open;(n.selected>-1&&n.selected=this.range.to)&&(this.range=b$(n.options.length,n.selected,this.view.state.facet(Do).maxRenderedOptions),this.showOptions(n.options,t.id));let i=this.updateSelectedOption(n.selected);if(i){this.destroyInfo();let{completion:r}=n.options[n.selected],{info:s}=r;if(!s)return;let o=typeof s=="string"?document.createTextNode(s):s(r);if(!o)return;"then"in o?o.then(l=>{l&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(l,r)}).catch(l=>Rc(this.view.state,l,"completion info")):(this.addInfoPane(o,r),i.setAttribute("aria-describedby",this.info.id))}}addInfoPane(t,n){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",i.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),t.nodeType!=null)i.appendChild(t),this.infoDestroy=null;else{let{dom:r,destroy:s}=t;i.appendChild(r),this.infoDestroy=s||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let n=null;for(let i=this.list.firstChild,r=this.range.from;i;i=i.nextSibling,r++)i.nodeName!="LI"||!i.id?r--:r==t?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),n=i):i.hasAttribute("aria-selected")&&(i.removeAttribute("aria-selected"),i.removeAttribute("aria-describedby"));return n&&o5t(this.list,n),n}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let n=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),r=t.getBoundingClientRect(),s=this.space;if(!s){let o=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return r.top>Math.min(s.bottom,n.bottom)-10||r.bottom{o.target==r&&o.preventDefault()});let s=null;for(let o=i.from;oi.from||i.from==0))if(s=h,typeof u!="string"&&u.header)r.appendChild(u.header(u));else{let m=r.appendChild(document.createElement("completion-section"));m.textContent=h}}const d=r.appendChild(document.createElement("li"));d.id=n+"-"+o,d.setAttribute("role","option");let f=this.optionClass(l);f&&(d.className=f);for(let h of this.optionContent){let m=h(l,this.view.state,this.view,c);m&&d.appendChild(m)}}return i.from&&r.classList.add("cm-completionListIncompleteTop"),i.tonew s5t(n,e,t)}function o5t(e,t){let n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),r=n.height/e.offsetHeight;i.topn.bottom&&(e.scrollTop+=(i.bottom-n.bottom)/r)}function Qre(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}function l5t(e,t){let n=[],i=null,r=null,s=d=>{n.push(d);let{section:f}=d.completion;if(f){i||(i=[]);let h=typeof f=="string"?f:f.name;i.some(m=>m.name==h)||i.push(typeof f=="string"?{name:h}:f)}},o=t.facet(Do);for(let d of e)if(d.hasResult()){let f=d.result.getMatch;if(d.result.filter===!1)for(let h of d.result.options)s(new Fre(h,d.source,f?f(h):[],1e9-n.length));else{let h=t.sliceDoc(d.from,d.to),m,g=o.filterStrict?new n5t(h):new t5t(h);for(let b of d.result.options)if(m=g.match(b.label)){let v=b.displayLabel?f?f(b,m.matched):[]:m.matched,y=m.score+(b.boost||0);if(s(new Fre(b,d.source,v,y)),typeof b.section=="object"&&b.section.rank==="dynamic"){let{name:w}=b.section;r||(r=Object.create(null)),r[w]=Math.max(y,r[w]||-1e9)}}}}if(i){let d=Object.create(null),f=0,h=(m,g)=>(m.rank==="dynamic"&&g.rank==="dynamic"?r[g.name]-r[m.name]:0)||(typeof m.rank=="number"?m.rank:1e9)-(typeof g.rank=="number"?g.rank:1e9)||(m.nameh.score-f.score||u(f.completion,h.completion))){let f=d.completion;!c||c.label!=f.label||c.detail!=f.detail||c.type!=null&&f.type!=null&&c.type!=f.type||c.apply!=f.apply||c.boost!=f.boost?l.push(d):Qre(d.completion)>Qre(c)&&(l[l.length-1]=d),c=d.completion}return l}class zx{constructor(t,n,i,r,s,o){this.options=t,this.attrs=n,this.tooltip=i,this.timestamp=r,this.selected=s,this.disabled=o}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new zx(this.options,zre(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,i,r,s,o){if(r&&!o&&t.some(u=>u.isPending))return r.setDisabled();let l=l5t(t,n);if(!l.length)return r&&t.some(u=>u.isPending)?r.setDisabled():null;let c=n.facet(Do).selectOnOpen?0:-1;if(r&&r.selected!=c&&r.selected!=-1){let u=r.options[r.selected].completion;for(let d=0;dd.hasResult()?Math.min(u,d.from):u,1e8),create:p5t,above:s.aboveCursor},r?r.timestamp:Date.now(),c,!1)}map(t){return new zx(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new zx(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class rP{constructor(t,n,i){this.active=t,this.id=n,this.open=i}static start(){return new rP(f5t,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,i=n.facet(Do),s=(i.override||n.languageDataAt("autocomplete",Gy(n)).map(e5t)).map(c=>(this.active.find(d=>d.source==c)||new yd(c,this.active.some(d=>d.state!=0)?1:0)).update(t,i));s.length==this.active.length&&s.every((c,u)=>c==this.active[u])&&(s=this.active);let o=this.open,l=t.effects.some(c=>c.is(fW));o&&t.docChanged&&(o=o.map(t.changes)),t.selection||s.some(c=>c.hasResult()&&t.changes.touchesRange(c.from,c.to))||!c5t(s,this.active)||l?o=zx.build(s,n,this.id,o,i,l):o&&o.disabled&&!s.some(c=>c.isPending)&&(o=null),!o&&s.every(c=>!c.isPending)&&s.some(c=>c.hasResult())&&(s=s.map(c=>c.hasResult()?new yd(c.source,0):c));for(let c of t.effects)c.is(dW)&&(o=o&&o.setSelected(c.value,this.id));return s==this.active&&o==this.open?this:new rP(s,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?u5t:d5t}}function c5t(e,t){if(e==t)return!0;for(let n=0,i=0;;){for(;n-1&&(n["aria-activedescendant"]=e+"-"+t),n}const f5t=[];function K4e(e,t){if(e.isUserEvent("input.complete")){let i=e.annotation(uW);if(i&&t.activateOnCompletion(i))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:e.docChanged?16:0}class yd{constructor(t,n,i=!1){this.source=t,this.state=n,this.explicit=i}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let i=K4e(t,n),r=this;(i&8||i&16&&this.touches(t))&&(r=new yd(r.source,0)),i&4&&r.state==0&&(r=new yd(this.source,1)),r=r.updateFor(t,i);for(let s of t.effects)if(s.is(iP))r=new yd(r.source,1,s.value);else if(s.is(WC))r=new yd(r.source,0);else if(s.is(fW))for(let o of s.value)o.source==r.source&&(r=o);return r}updateFor(t,n){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(Gy(t.state))}}class Ew extends yd{constructor(t,n,i,r,s,o){super(t,3,n),this.limit=i,this.result=r,this.from=s,this.to=o}hasResult(){return!0}updateFor(t,n){var i;if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let s=t.changes.mapPos(this.from),o=t.changes.mapPos(this.to,1),l=Gy(t.state);if(l>o||!r||n&2&&(Gy(t.startState)==this.from||ln.map(t))}}),Tc=pl.define({create(){return rP.start()},update(e,t){return e.update(t)},provide:e=>[eW.from(e,t=>t.tooltip),Jt.contentAttributes.from(e,t=>t.attrs)]});function hW(e,t){const n=t.completion.apply||t.completion.label;let i=e.state.field(Tc).active.find(r=>r.source==t.source);return i instanceof Ew?(typeof n=="string"?e.dispatch({...JLt(e.state,n,i.from,i.to),annotations:uW.of(t.completion)}):n(e,t.completion,i.from,i.to),!0):!1}const p5t=a5t(Tc,hW);function ij(e,t="option"){return n=>{let i=n.state.field(Tc,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+r*(e?1:-1):e?0:o-1;return l<0?l=t=="page"?0:o-1:l>=o&&(l=t=="page"?o-1:0),n.dispatch({effects:dW.of(l)}),!0}}const m5t=e=>{let t=e.state.field(Tc,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestampe.state.field(Tc,!1)?(e.dispatch({effects:iP.of(!0)}),!0):!1,g5t=e=>{let t=e.state.field(Tc,!1);return!t||!t.active.some(n=>n.state!=0)?!1:(e.dispatch({effects:WC.of(null)}),!0)};class b5t{constructor(t,n){this.active=t,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const y5t=50,v5t=1e3,x5t=ba.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(Tc).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(Tc),n=e.state.facet(Do);if(!e.selectionSet&&!e.docChanged&&e.startState.field(Tc)==t)return;let i=e.transactions.some(s=>{let o=K4e(s,n);return o&8||(s.selection||s.docChanged)&&!(o&3)});for(let s=0;sy5t&&Date.now()-o.time>v5t){for(let l of o.context.abortListeners)try{l()}catch(c){Rc(this.view.state,c)}o.context.abortListeners=null,this.running.splice(s--,1)}else o.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(s=>s.effects.some(o=>o.is(iP)))&&(this.pendingStart=!0);let r=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(s=>s.isPending&&!this.running.some(o=>o.active.source==s.source))?setTimeout(()=>this.startUpdate(),r):-1,this.composing!=0)for(let s of e.transactions)s.isUserEvent("input.type")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(Tc);for(let n of t.active)n.isPending&&!this.running.some(i=>i.active.source==n.source)&&this.startQuery(n);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Do).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=Gy(t),i=new lW(t,n,e.explicit,this.view),r=new b5t(e,i);this.running.push(r),Promise.resolve(e.source(i)).then(s=>{r.context.aborted||(r.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:WC.of(null)}),Rc(this.view.state,s)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Do).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(Do),i=this.view.state.field(Tc);for(let r=0;rl.source==s.active.source);if(o&&o.isPending)if(s.done==null){let l=new yd(s.active.source,0);for(let c of s.updates)l=l.update(c,n);l.isPending||t.push(l)}else this.startQuery(o)}(t.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:fW.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(Tc,!1);if(t&&t.tooltip&&this.view.state.facet(Do).closeOnBlur){let n=t.open&&f4e(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:WC.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:iP.of(!1)}),20),this.composing=0}}}),w5t=typeof navigator=="object"&&/Win/.test(navigator.platform),k5t=ym.highest(Jt.domEventHandlers({keydown(e,t){let n=t.state.field(Tc,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(w5t&&e.altKey)||e.metaKey)return!1;let i=n.open.options[n.open.selected],r=n.active.find(o=>o.source==i.source),s=i.completion.commitCharacters||r.result.commitCharacters;return s&&s.indexOf(e.key)>-1&&hW(t,i),!1}})),G4e=Jt.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class O5t{constructor(t,n,i,r){this.field=t,this.line=n,this.from=i,this.to=r}}class pW{constructor(t,n,i){this.field=t,this.from=n,this.to=i}map(t){let n=t.mapPos(this.from,-1,al.TrackDel),i=t.mapPos(this.to,1,al.TrackDel);return n==null||i==null?null:new pW(this.field,n,i)}}class mW{constructor(t,n){this.lines=t,this.fieldPositions=n}instantiate(t,n){let i=[],r=[n],s=t.doc.lineAt(n),o=/^\s*/.exec(s.text)[0];for(let c of this.lines){if(i.length){let u=o,d=/^\t*/.exec(c)[0].length;for(let f=0;fnew pW(c.field,r[c.line]+c.from,r[c.line]+c.to));return{text:i,ranges:l}}static parse(t){let n=[],i=[],r=[],s;for(let o of t.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let l=s[1]?+s[1]:null,c=s[2]||s[3]||"",u=-1;l===0&&(l=1e9);let d=c.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f=u&&h.field++}for(let f of r)if(f.line==i.length&&f.from>s.index){let h=s[2]?3+(s[1]||"").length:2;f.from-=h,f.to-=h}r.push(new O5t(u,i.length,s.index,s.index+d.length)),o=o.slice(0,s.index)+c+o.slice(s.index+s[0].length)}o=o.replace(/\\([{}])/g,(l,c,u)=>{for(let d of r)d.line==i.length&&d.from>u&&(d.from--,d.to--);return c}),i.push(o)}return new mW(i,r)}}let S5t=$n.widget({widget:new class extends Tf{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),E5t=$n.mark({class:"cm-snippetField"});class yk{constructor(t,n){this.ranges=t,this.active=n,this.deco=$n.set(t.map(i=>(i.from==i.to?S5t:E5t).range(i.from,i.to)),!0)}map(t){let n=[];for(let i of this.ranges){let r=i.map(t);if(!r)return null;n.push(r)}return new yk(n,this.active)}selectionInsideField(t){return t.ranges.every(n=>this.ranges.some(i=>i.field==this.active&&i.from<=n.from&&i.to>=n.to))}}const LT=hi.define({map(e,t){return e&&e.map(t)}}),C5t=hi.define(),KC=pl.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(LT))return n.value;if(n.is(C5t)&&e)return new yk(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>Jt.decorations.from(e,t=>t?t.deco:$n.none)});function gW(e,t){return pt.create(e.filter(n=>n.field==t).map(n=>pt.range(n.from,n.to)))}function A5t(e){let t=mW.parse(e);return(n,i,r,s)=>{let{text:o,ranges:l}=t.instantiate(n.state,r),{main:c}=n.state.selection,u={changes:{from:r,to:s==c.from?c.to:s,insert:Or.of(o)},scrollIntoView:!0,annotations:i?[uW.of(i),Ya.userEvent.of("input.complete")]:void 0};if(l.length&&(u.selection=gW(l,0)),l.some(d=>d.field>0)){let d=new yk(l,0),f=u.effects=[LT.of(d)];n.state.field(KC,!1)===void 0&&f.push(hi.appendConfig.of([KC,R5t,I5t,G4e]))}n.dispatch(n.state.update(u))}}function X4e(e){return({state:t,dispatch:n})=>{let i=t.field(KC,!1);if(!i||e<0&&i.active==0)return!1;let r=i.active+e,s=e>0&&!i.ranges.some(o=>o.field==r+e);return n(t.update({selection:gW(i.ranges,r),effects:LT.of(s?null:new yk(i.ranges,r)),scrollIntoView:!0})),!0}}const T5t=({state:e,dispatch:t})=>e.field(KC,!1)?(t(e.update({effects:LT.of(null)})),!0):!1,_5t=X4e(1),j5t=X4e(-1),N5t=[{key:"Tab",run:_5t,shift:j5t},{key:"Escape",run:T5t}],Vre=pn.define({combine(e){return e.length?e[0]:N5t}}),R5t=ym.highest(gk.compute([Vre],e=>e.facet(Vre)));function Xs(e,t){return{...t,apply:A5t(e)}}const I5t=Jt.domEventHandlers({mousedown(e,t){let n=t.state.field(KC,!1),i;if(!n||(i=t.posAtCoords({x:e.clientX,y:e.clientY}))==null)return!1;let r=n.ranges.find(s=>s.from<=i&&s.to>=i);return!r||r.field==n.active?!1:(t.dispatch({selection:gW(n.ranges,r.field),effects:LT.of(n.ranges.some(s=>s.field>r.field)?new yk(n.ranges,r.field):null),scrollIntoView:!0}),!0)}}),GC={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Ny=hi.define({map(e,t){let n=t.mapPos(e,-1,al.TrackAfter);return n??void 0}}),bW=new class extends ub{};bW.startSide=1;bW.endSide=-1;const Y4e=pl.define({create(){return Yi.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:i=>i>=n.from&&i<=n.to})}for(let n of t.effects)n.is(Ny)&&(e=e.update({add:[bW.range(n.value,n.value+1)]}));return e}});function P5t(){return[M5t,Y4e]}const v$="()[]{}<>«»»«[]{}";function Z4e(e){for(let t=0;t{if((D5t?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let r=e.state.selection.main;if(i.length>2||i.length==2&&nh(Ac(i,0))==1||t!=r.from||n!=r.to)return!1;let s=F5t(e.state,i);return s?(e.dispatch(s),!0):!1}),L5t=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=J4e(e,e.selection.main.head).brackets||GC.brackets,r=null,s=e.changeByRange(o=>{if(o.empty){let l=B5t(e.doc,o.head);for(let c of i)if(c==l&&iL(e.doc,o.head)==Z4e(Ac(c,0)))return{changes:{from:o.head-c.length,to:o.head+c.length},range:pt.cursor(o.head-c.length)}}return{range:r=o}});return r||t(e.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},$5t=[{key:"Backspace",run:L5t}];function F5t(e,t){let n=J4e(e,e.selection.main.head),i=n.brackets||GC.brackets;for(let r of i){let s=Z4e(Ac(r,0));if(t==r)return s==r?z5t(e,r,i.indexOf(r+r+r)>-1,n):U5t(e,r,s,n.before||GC.before);if(t==s&&e$e(e,e.selection.main.from))return Q5t(e,r,s)}return null}function e$e(e,t){let n=!1;return e.field(Y4e).between(0,e.doc.length,i=>{i==t&&(n=!0)}),n}function iL(e,t){let n=e.sliceString(t,t+2);return n.slice(0,nh(Ac(n,0)))}function B5t(e,t){let n=e.sliceString(t-2,t);return nh(Ac(n,0))==n.length?n:n.slice(1)}function U5t(e,t,n,i){let r=null,s=e.changeByRange(o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:n,from:o.to}],effects:Ny.of(o.to+t.length),range:pt.range(o.anchor+t.length,o.head+t.length)};let l=iL(e.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:t+n,from:o.head},effects:Ny.of(o.head+t.length),range:pt.cursor(o.head+t.length)}:{range:r=o}});return r?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Q5t(e,t,n){let i=null,r=e.changeByRange(s=>s.empty&&iL(e.doc,s.head)==n?{changes:{from:s.head,to:s.head+n.length,insert:n},range:pt.cursor(s.head+n.length)}:i={range:s});return i?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function z5t(e,t,n,i){let r=i.stringPrefixes||GC.stringPrefixes,s=null,o=e.changeByRange(l=>{if(!l.empty)return{changes:[{insert:t,from:l.from},{insert:t,from:l.to}],effects:Ny.of(l.to+t.length),range:pt.range(l.anchor+t.length,l.head+t.length)};let c=l.head,u=iL(e.doc,c),d;if(u==t){if(Hre(e,c))return{changes:{insert:t+t,from:c},effects:Ny.of(c+t.length),range:pt.cursor(c+t.length)};if(e$e(e,c)){let h=n&&e.sliceDoc(c,c+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:c,to:c+h.length,insert:h},range:pt.cursor(c+h.length)}}}else{if(n&&e.sliceDoc(c-2*t.length,c)==t+t&&(d=qre(e,c-2*t.length,r))>-1&&Hre(e,d))return{changes:{insert:t+t+t+t,from:c},effects:Ny.of(c+t.length),range:pt.cursor(c+t.length)};if(e.charCategorizer(c)(u)!=Qs.Word&&qre(e,c,r)>-1&&!V5t(e,c,t,r))return{changes:{insert:t+t,from:c},effects:Ny.of(c+t.length),range:pt.cursor(c+t.length)}}return{range:s=l}});return s?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function Hre(e,t){let n=es(e).resolveInner(t+1);return n.parent&&n.from==t}function V5t(e,t,n,i){let r=es(e).resolveInner(t,-1),s=i.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=e.sliceDoc(r.from,Math.min(r.to,r.from+n.length+s)),c=l.indexOf(n);if(!c||c>-1&&i.indexOf(l.slice(0,c))>-1){let d=r.firstChild;for(;d&&d.from==r.from&&d.to-d.from>n.length+c;){if(e.sliceDoc(d.to-n.length,d.to)==n)return!1;d=d.firstChild}return!0}let u=r.to==t&&r.parent;if(!u)break;r=u}return!1}function qre(e,t,n){let i=e.charCategorizer(t);if(i(e.sliceDoc(t-1,t))!=Qs.Word)return t;for(let r of n){let s=t-r.length;if(e.sliceDoc(s,t)==r&&i(e.sliceDoc(s-1,s))!=Qs.Word)return s}return-1}function H5t(e={}){return[k5t,Tc,Do.of(e),x5t,q5t,G4e]}const t$e=[{key:"Ctrl-Space",run:y$},{mac:"Alt-`",run:y$},{mac:"Alt-i",run:y$},{key:"Escape",run:g5t},{key:"ArrowDown",run:ij(!0)},{key:"ArrowUp",run:ij(!1)},{key:"PageDown",run:ij(!0,"page")},{key:"PageUp",run:ij(!1,"page")},{key:"Enter",run:m5t}],q5t=ym.highest(gk.computeN([Do],e=>e.facet(Do).defaultKeymap?[t$e]:[])),n$e=[Xs("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Xs("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Xs("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Xs("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Xs("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Xs(`try { \${} } catch (\${error}) { \${} @@ -754,33 +754,33 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus constructor(\${params}) { \${} } -}`,{label:"class",detail:"definition",type:"keyword"}),Xs('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Xs('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],q5t=t$e.concat([Xs("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Xs("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Xs("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Wre=new Mq,n$e=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function _O(e){return(t,n)=>{let i=t.node.getChild("VariableDefinition");return i&&n(i,e),!0}}const W5t=["FunctionDeclaration"],K5t={FunctionDeclaration:_O("function"),ClassDeclaration:_O("class"),ClassExpression:()=>!0,EnumDeclaration:_O("constant"),TypeAliasDeclaration:_O("type"),NamespaceDeclaration:_O("namespace"),VariableDefinition(e,t){e.matchContext(W5t)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function i$e(e,t){let n=Wre.get(t);if(n)return n;let i=[],r=!0;function s(o,l){let c=e.sliceString(o.from,o.to);i.push({label:c,type:l})}return t.cursor(Ar.IncludeAnonymous).iterate(o=>{if(r)r=!1;else if(o.name){let l=K5t[o.name];if(l&&l(o,s)||n$e.has(o.name))return!1}else if(o.to-o.from>8192){for(let l of i$e(e,o.node))i.push(l);return!1}}),Wre.set(t,i),i}const Kre=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,r$e=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function G5t(e){let t=es(e.state).resolveInner(e.pos,-1);if(r$e.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&Kre.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let i=[];for(let r=t;r;r=r.parent)n$e.has(r.name)&&(i=i.concat(i$e(e.state.doc,r)));return{options:i,from:n?t.from:e.pos,validFor:Kre}}const wh=am.define({name:"javascript",parser:XLt.configure({props:[xm.add({IfStatement:Ow({except:/^\s*({|else\b)/}),TryStatement:Ow({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:NMt,SwitchBody:e=>{let t=e.textAfter,n=/^\s*\}/.test(t),i=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:i?1:2)*e.unit},Block:kw({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":Ow({except:/^\s*{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),wm.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":PT,BlockComment(e){return{from:e.from+2,to:e.to-2}},JSXElement(e){let t=e.firstChild;if(!t||t.name=="JSXSelfClosingTag")return null;let n=e.lastChild;return{from:t.to,to:n.type.isError?e.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(e){var t;let n=(t=e.firstChild)===null||t===void 0?void 0:t.nextSibling,i=e.lastChild;return!n||n.type.isError?null:{from:n.to,to:i.type.isError?e.to:i.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),s$e={test:e=>/^JSX/.test(e.name),facet:JM({commentTokens:{block:{open:"{/*",close:"*/}"}}})},a$e=wh.configure({dialect:"ts"},"typescript"),o$e=wh.configure({dialect:"jsx",props:[nW.add(e=>e.isTop?[s$e]:void 0)]}),l$e=wh.configure({dialect:"jsx ts",props:[nW.add(e=>e.isTop?[s$e]:void 0)]},"typescript");let c$e=e=>({label:e,type:"keyword"});const u$e="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(c$e),X5t=u$e.concat(["declare","implements","private","protected","public"].map(c$e));function o7(e={}){let t=e.jsx?e.typescript?l$e:o$e:e.typescript?a$e:wh,n=e.typescript?q5t.concat(X5t):t$e.concat(u$e);return new mb(t,[wh.data.of({autocomplete:H4e(r$e,cW(n))}),wh.data.of({autocomplete:G5t}),e.jsx?J5t:[]])}function Y5t(e){for(;;){if(e.name=="JSXOpenTag"||e.name=="JSXSelfClosingTag"||e.name=="JSXFragmentTag")return e;if(e.name=="JSXEscape"||!e.parent)return null;e=e.parent}}function Gre(e,t,n=e.length){for(let i=t==null?void 0:t.firstChild;i;i=i.nextSibling)if(i.name=="JSXIdentifier"||i.name=="JSXBuiltin"||i.name=="JSXNamespacedName"||i.name=="JSXMemberExpression")return e.sliceString(i.from,Math.min(i.to,n));return""}const Z5t=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),J5t=Jt.inputHandler.of((e,t,n,i,r)=>{if((Z5t?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||i!=">"&&i!="/"||!wh.isActiveAt(e.state,t,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(c=>{var u;let{head:d}=c,f=es(o).resolveInner(d-1,-1),h;if(f.name=="JSXStartTag"&&(f=f.parent),!(o.doc.sliceString(d-1,d)!=i||f.name=="JSXAttributeValue"&&f.to>d)){if(i==">"&&f.name=="JSXFragmentTag")return{range:c,changes:{from:d,insert:""}};if(i=="/"&&f.name=="JSXStartCloseTag"){let m=f.parent,g=m.parent;if(g&&m.from==d-2&&((h=Gre(o.doc,g.firstChild,d))||((u=g.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let b=`${h}>`;return{range:pt.cursor(d+b.length,-1),changes:{from:d,insert:b}}}}else if(i==">"){let m=Y5t(f);if(m&&m.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(d,d+2))&&(h=Gre(o.doc,m,d)))return{range:c,changes:{from:d,insert:``}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),e3t=vm({String:me.string,Number:me.number,"True False":me.bool,PropertyName:me.propertyName,Null:me.null,", :":me.separator,"[ ]":me.squareBracket,"{ }":me.brace}),t3t=om.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[e3t],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),n3t=am.define({name:"json",parser:t3t.configure({props:[xm.add({Object:Ow({except:/^\s*\}/}),Array:Ow({except:/^\s*\]/})}),wm.add({"Object Array":PT})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function i3t(){return new mb(n3t)}class sP{static create(t,n,i,r,s){let o=r+(r<<8)+t+(n<<4)|0;return new sP(t,n,i,o,s,[],[])}constructor(t,n,i,r,s,o,l){this.type=t,this.value=n,this.from=i,this.hash=r,this.end=s,this.children=o,this.positions=l,this.hashProp=[[li.contextHash,r]]}addChild(t,n){t.prop(li.contextHash)!=this.hash&&(t=new Hi(t.type,t.children,t.positions,t.length,this.hashProp)),this.children.push(t),this.positions.push(n)}toTree(t,n=this.end){let i=this.children.length-1;return i>=0&&(n=Math.max(n,this.positions[i]+this.children[i].length+this.from)),new Hi(t.types[this.type],this.children,this.positions,n-this.from).balance({makeTree:(r,s,o)=>new Hi(Ja.none,r,s,o,this.hashProp)})}}var Kt;(function(e){e[e.Document=1]="Document",e[e.CodeBlock=2]="CodeBlock",e[e.FencedCode=3]="FencedCode",e[e.Blockquote=4]="Blockquote",e[e.HorizontalRule=5]="HorizontalRule",e[e.BulletList=6]="BulletList",e[e.OrderedList=7]="OrderedList",e[e.ListItem=8]="ListItem",e[e.ATXHeading1=9]="ATXHeading1",e[e.ATXHeading2=10]="ATXHeading2",e[e.ATXHeading3=11]="ATXHeading3",e[e.ATXHeading4=12]="ATXHeading4",e[e.ATXHeading5=13]="ATXHeading5",e[e.ATXHeading6=14]="ATXHeading6",e[e.SetextHeading1=15]="SetextHeading1",e[e.SetextHeading2=16]="SetextHeading2",e[e.HTMLBlock=17]="HTMLBlock",e[e.LinkReference=18]="LinkReference",e[e.Paragraph=19]="Paragraph",e[e.CommentBlock=20]="CommentBlock",e[e.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",e[e.Escape=22]="Escape",e[e.Entity=23]="Entity",e[e.HardBreak=24]="HardBreak",e[e.Emphasis=25]="Emphasis",e[e.StrongEmphasis=26]="StrongEmphasis",e[e.Link=27]="Link",e[e.Image=28]="Image",e[e.InlineCode=29]="InlineCode",e[e.HTMLTag=30]="HTMLTag",e[e.Comment=31]="Comment",e[e.ProcessingInstruction=32]="ProcessingInstruction",e[e.Autolink=33]="Autolink",e[e.HeaderMark=34]="HeaderMark",e[e.QuoteMark=35]="QuoteMark",e[e.ListMark=36]="ListMark",e[e.LinkMark=37]="LinkMark",e[e.EmphasisMark=38]="EmphasisMark",e[e.CodeMark=39]="CodeMark",e[e.CodeText=40]="CodeText",e[e.CodeInfo=41]="CodeInfo",e[e.LinkTitle=42]="LinkTitle",e[e.LinkLabel=43]="LinkLabel",e[e.URL=44]="URL"})(Kt||(Kt={}));class r3t{constructor(t,n){this.start=t,this.content=n,this.marks=[],this.parsers=[]}}class s3t{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let t=this.skipSpace(this.basePos);this.indent=this.countIndent(t,this.pos,this.indent),this.pos=t,this.next=t==this.text.length?-1:this.text.charCodeAt(t)}skipSpace(t){return TE(this.text,t)}reset(t){for(this.text=t,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(t){this.basePos=t,this.baseIndent=this.countIndent(t,this.pos,this.indent)}moveBaseColumn(t){this.baseIndent=t,this.basePos=this.findColumn(t)}addMarker(t){this.markers.push(t)}countIndent(t,n=0,i=0){for(let r=n;r=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let i=(e.type==Kt.OrderedList?xW:vW)(n,t,!1);return i>0&&(e.type!=Kt.BulletList||yW(n,t,!1)<0)&&n.text.charCodeAt(n.pos+i-1)==e.value}const d$e={[Kt.Blockquote](e,t,n){return n.next!=62?!1:(n.markers.push(mr(Kt.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(Dd(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0)},[Kt.ListItem](e,t,n){return n.indent-1?!1:(n.moveBaseColumn(n.baseIndent+e.value),!0)},[Kt.OrderedList]:Xre,[Kt.BulletList]:Xre,[Kt.Document](){return!0}};function Dd(e){return e==32||e==9||e==10||e==13}function TE(e,t=0){for(;tn&&Dd(e.charCodeAt(t-1));)t--;return t}function f$e(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(x$e.SetextHeading)>-1||i<3?-1:1}function p$e(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function vW(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||Dd(e.text.charCodeAt(e.pos+1)))&&(!n||p$e(t,Kt.BulletList)||e.skipSpace(e.pos+2)=48&&r<=57;){i++;if(i==e.text.length)return-1;r=e.text.charCodeAt(i)}return i==e.pos||i>e.pos+9||r!=46&&r!=41||ie.pos+1||e.next!=49)?-1:i+1-e.pos}function m$e(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t6?-1:n}function g$e(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t/,y$e=/\?>/,c7=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/,v$e=/\?>/,c7=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/i.exec(i);if(s)return e.append(mr(Kt.Comment,n,n+1+s[0].length));let o=/^\?[^]*?\?>/.exec(i);if(o)return e.append(mr(Kt.ProcessingInstruction,n,n+1+o[0].length));let l=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(i);return l?e.append(mr(Kt.HTMLTag,n,n+1+l[0].length)):-1},Emphasis(e,t,n){if(t!=95&&t!=42)return-1;let i=n+1;for(;e.char(i)==t;)i++;let r=e.slice(n-1,n),s=e.slice(i,i+1),o=YC.test(r),l=YC.test(s),c=/\s|^$/.test(r),u=/\s|^$/.test(s),d=!u&&(!l||c||o),f=!c&&(!o||u||l),h=d&&(t==42||!f||o),m=f&&(t==42||!d||l);return e.append(new gu(t==95?E$e:C$e,n,i,(h?1:0)|(m?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(mr(Kt.HardBreak,n,n+2));if(t==32){let i=n+1;for(;e.char(i)==32;)i++;if(e.char(i)==10&&i>=n+2)return e.append(mr(Kt.HardBreak,n,i+1))}return-1},Link(e,t,n){return t==91?e.append(new gu(yy,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new gu(aP,n,n+2,1)):-1},LinkEnd(e,t,n){if(t!=93)return-1;for(let i=e.parts.length-1;i>=0;i--){let r=e.parts[i];if(r instanceof gu&&(r.type==yy||r.type==aP)){if(!r.side||e.skipSpace(r.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[i]=null,-1;let s=e.takeContent(i),o=e.parts[i]=d3t(e,s,r.type==yy?Kt.Link:Kt.Image,r.from,n+1);if(r.type==yy)for(let l=0;lt?mr(Kt.URL,t+n,s+n):s==e.length?null:!1}}function T$e(e,t,n){let i=e.charCodeAt(t);if(i!=39&&i!=34&&i!=40)return!1;let r=i==40?41:i;for(let s=t+1,o=!1;s=this.end?-1:this.text.charCodeAt(t-this.offset)}get end(){return this.offset+this.text.length}slice(t,n){return this.text.slice(t-this.offset,n-this.offset)}append(t){return this.parts.push(t),t.to}addDelimiter(t,n,i,r,s){return this.append(new gu(t,n,i,(r?1:0)|(s?2:0)))}get hasOpenLink(){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof gu&&(n.type==yy||n.type==aP))return!0}return!1}addElement(t){return this.append(t)}resolveMarkers(t){for(let i=t;i=t;c--){let b=this.parts[c];if(b instanceof gu&&b.side&1&&b.type==r.type&&!(s&&(r.side&1||b.side&2)&&(b.to-b.from+o)%3==0&&((b.to-b.from)%3||o%3))){l=b;break}}if(!l)continue;let u=r.type.resolve,d=[],f=l.from,h=r.to;if(s){let b=Math.min(2,l.to-l.from,o);f=l.to-b,h=r.from+b,u=b==1?"Emphasis":"StrongEmphasis"}l.type.mark&&d.push(this.elt(l.type.mark,f,l.to));for(let b=c+1;b=0;n--){let i=this.parts[n];if(i instanceof gu&&i.type==t&&i.side&1)return n}return null}takeContent(t){let n=this.resolveMarkers(t);return this.parts.length=t,n}getDelimiterAt(t){let n=this.parts[t];return n instanceof gu?n:null}skipSpace(t){return TE(this.text,t-this.offset)+this.offset}elt(t,n,i,r){return typeof t=="string"?mr(this.parser.getNodeType(t),n,i,r):new S$e(t,n)}}wW.linkStart=yy;wW.imageStart=aP;function d7(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),i=0;for(let r of t){for(;i(t?t-1:0))return!1;if(this.fragmentEnd<0){let s=this.fragment.to;for(;s>0&&this.input.read(s-1,s)!=` -`;)s--;this.fragmentEnd=s?s-1:0}let i=this.cursor;i||(i=this.cursor=this.fragment.tree.cursor(),i.firstChild());let r=t+this.fragment.offset;for(;i.to<=r;)if(!i.parent())return!1;for(;;){if(i.from>=r)return this.fragment.from<=n;if(!i.childAfter(r))return!1}}matches(t){let n=this.cursor.tree;return n&&n.prop(li.contextHash)==t}takeNodes(t){let n=this.cursor,i=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),s=t.absoluteLineStart,o=s,l=t.block.children.length,c=o,u=l;for(;;){if(n.to-i>r){if(n.type.isAnonymous&&n.firstChild())continue;break}let d=j$e(n.from-i,t.ranges);if(n.to-i<=t.ranges[t.rangeI].to)t.addNode(n.tree,d);else{let f=new Hi(t.parser.nodeSet.types[Kt.Paragraph],[],[],0,t.block.hashProp);t.reusePlaceholders.set(f,n.tree),t.addNode(f,d)}if(n.type.is("Block")&&(f3t.indexOf(n.type.id)<0?(o=n.to-i,l=t.block.children.length):(o=c,l=u),c=n.to-i,u=t.block.children.length),!n.nextSibling())break}for(;t.block.children.length>l;)t.block.children.pop(),t.block.positions.pop();return o-s}}function j$e(e,t){let n=e;for(let i=1;irj[e]),Object.keys(rj).map(e=>x$e[e]),Object.keys(rj),l3t,d$e,Object.keys(w$).map(e=>w$[e]),Object.keys(w$),[]);function g3t(e,t,n){let i=[];for(let r=e.firstChild,s=t;;r=r.nextSibling){let o=r?r.from:n;if(o>s&&i.push({from:s,to:o}),!r)break;s=r.to}return i}function b3t(e){let{codeParser:t,htmlParser:n}=e;return{wrap:H5e((r,s)=>{let o=r.type.id;if(t&&(o==Kt.CodeBlock||o==Kt.FencedCode)){let l="";if(o==Kt.FencedCode){let u=r.node.getChild(Kt.CodeInfo);u&&(l=s.read(u.from,u.to))}let c=t(l);if(c)return{parser:c,overlay:u=>u.type.id==Kt.CodeText,bracketed:o==Kt.FencedCode}}else if(n&&(o==Kt.HTMLBlock||o==Kt.HTMLTag||o==Kt.CommentBlock))return{parser:n,overlay:g3t(r.node,r.from,r.to)};return null})}}const y3t={resolve:"Strikethrough",mark:"StrikethroughMark"},v3t={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":me.strikethrough}},{name:"StrikethroughMark",style:me.processingInstruction}],parseInline:[{name:"Strikethrough",parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let i=e.slice(n-1,n),r=e.slice(n+2,n+3),s=/\s|^$/.test(i),o=/\s|^$/.test(r),l=YC.test(i),c=YC.test(r);return e.addDelimiter(y3t,n,n+2,!o&&(!c||s||l),!s&&(!l||o||c))},after:"Emphasis"}]};function _E(e,t,n=0,i,r=0){let s=0,o=!0,l=-1,c=-1,u=!1,d=()=>{i.push(e.elt("TableCell",r+l,r+c,e.parser.parseInline(t.slice(l,c),r+l)))};for(let f=n;f-1)&&s++,o=!1,i&&(l>-1&&d(),i.push(e.elt("TableDelimiter",f+r,f+r+1))),l=c=-1):(u||h!=32&&h!=9)&&(l<0&&(l=f),c=f+1),u=!u&&h==92}return l>-1&&(s++,i&&d()),s}function ese(e,t){for(let n=t;n\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class tse{constructor(){this.rows=null}nextLine(t,n,i){if(this.rows==null){this.rows=!1;let r;if((n.next==45||n.next==58||n.next==124)&&N$e.test(r=n.text.slice(n.pos))){let s=[];_E(t,i.content,0,s,i.start)==_E(t,r,0)&&(this.rows=[t.elt("TableHeader",i.start,i.start+i.content.length,s),t.elt("TableDelimiter",t.lineStart+n.pos,t.lineStart+n.text.length)])}}else if(this.rows){let r=[];_E(t,n.text,n.pos,r,t.lineStart),this.rows.push(t.elt("TableRow",t.lineStart+n.pos,t.lineStart+n.text.length,r))}return!1}finish(t,n){return this.rows?(t.addLeafElement(n,t.elt("Table",n.start,n.start+n.content.length,this.rows)),!0):!1}}const x3t={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":me.heading}},"TableRow",{name:"TableCell",style:me.content},{name:"TableDelimiter",style:me.processingInstruction}],parseBlock:[{name:"Table",leaf(e,t){return ese(t.content,0)?new tse:null},endLeaf(e,t,n){if(n.parsers.some(r=>r instanceof tse)||!ese(t.text,t.basePos))return!1;let i=e.peekLine();return N$e.test(i)&&_E(e,t.text,t.basePos)==_E(e,i,t.basePos)},before:"SetextHeading"}]};class w3t{nextLine(){return!1}finish(t,n){return t.addLeafElement(n,t.elt("Task",n.start,n.start+n.content.length,[t.elt("TaskMarker",n.start,n.start+3),...t.parser.parseInline(n.content.slice(3),n.start+3)])),!0}}const k3t={defineNodes:[{name:"Task",block:!0,style:me.list},{name:"TaskMarker",style:me.atom}],parseBlock:[{name:"TaskList",leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name=="ListItem"?new w3t:null},after:"SetextHeading"}]},nse=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,ise=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,O3t=/[\w-]+\.[\w-]+($|[/:])/,rse=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,sse=/\/[a-zA-Z\d@.]+/gy;function ase(e,t,n,i){let r=0;for(let s=t;s-1)return-1;let i=t+n[0].length;for(;;){let r=e[i-1],s;if(/[?!.,:*_~]/.test(r)||r==")"&&ase(e,t,i,")")>ase(e,t,i,"("))i--;else if(r==";"&&(s=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,i))))i=t+s.index;else break}return i}function ose(e,t){rse.lastIndex=t;let n=rse.exec(e);if(!n)return-1;let i=n[0][n[0].length-1];return i=="_"||i=="-"?-1:t+n[0].length-(i=="."?1:0)}const E3t={parseInline:[{name:"Autolink",parse(e,t,n){let i=n-e.offset;if(i&&/\w/.test(e.text[i-1]))return-1;nse.lastIndex=i;let r=nse.exec(e.text),s=-1;if(!r)return-1;if(r[1]||r[2]){if(s=S3t(e.text,i+r[0].length),s>-1&&e.hasOpenLink){let o=/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(i,s));s=i+o[0].length}}else r[3]?s=ose(e.text,i):(s=ose(e.text,i+r[0].length),s>-1&&r[0]=="xmpp:"&&(sse.lastIndex=s,r=sse.exec(e.text),r&&(s=r.index+r[0].length)));return s<0?-1:(e.addElement(e.elt("URL",n,s+e.offset)),s+e.offset)}}]},C3t=[x3t,k3t,v3t,E3t];function R$e(e,t,n){return(i,r,s)=>{if(r!=e||i.char(s+1)==e)return-1;let o=[i.elt(n,s,s+1)];for(let l=s+1;l=65&&e<=90||e==95||e>=97&&e<=122||e>=161}let dse=null,fse=null,hse=0;function h7(e,t){let n=e.pos+t;if(hse==n&&fse==e)return dse;let i=e.peek(t),r="";for(;J3t(i);)r+=String.fromCharCode(i),i=e.peek(++t);return fse=e,hse=n,dse=r?r.toLowerCase():i==e4t||i==t4t?void 0:null}const B$e=60,oP=62,OW=47,e4t=63,t4t=33,n4t=45;function pse(e,t){this.name=e,this.parent=t}const i4t=[kW,M$e,I$e,P$e,D$e],r4t=new nL({start:null,shift(e,t,n,i){return i4t.indexOf(t)>-1?new pse(h7(i,1)||"",e):e},reduce(e,t){return t==L$e&&e?e.parent:e},reuse(e,t,n,i){let r=t.type.id;return r==kW||r==W3t?new pse(h7(i,1)||"",e):e},strict:!1}),s4t=new Ma((e,t)=>{if(e.next!=B$e){e.next<0&&t.context&&e.acceptToken(k$);return}e.advance();let n=e.next==OW;n&&e.advance();let i=h7(e,0);if(i===void 0)return;if(!i)return e.acceptToken(n?U3t:B3t);let r=t.context?t.context.name:null;if(n){if(i==r)return e.acceptToken(L3t);if(r&&Z3t[r])return e.acceptToken(k$,-2);if(t.dialectEnabled(G3t))return e.acceptToken($3t);for(let s=t.context;s;s=s.parent)if(s.name==i)return;e.acceptToken(F3t)}else{if(i=="script")return e.acceptToken(I$e);if(i=="style")return e.acceptToken(P$e);if(i=="textarea")return e.acceptToken(D$e);if(Y3t.hasOwnProperty(i))return e.acceptToken(M$e);r&&use[r]&&use[r][i]?e.acceptToken(k$,-1):e.acceptToken(kW)}},{contextual:!0}),a4t=new Ma(e=>{for(let t=0,n=0;;n++){if(e.next<0){n&&e.acceptToken(cse);break}if(e.next==n4t)t++;else if(e.next==oP&&t>=2){n>=3&&e.acceptToken(cse,-2);break}else t=0;e.advance()}});function o4t(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const l4t=new Ma((e,t)=>{if(e.next==OW&&e.peek(1)==oP){let n=t.dialectEnabled(X3t)||o4t(t.context);e.acceptToken(n?M3t:lse,2)}else e.next==oP&&e.acceptToken(lse,1)});function SW(e,t,n){let i=2+e.length;return new Ma(r=>{for(let s=0,o=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(t);break}if(s==0&&r.next==B$e||s==1&&r.next==OW||s>=2&&so?r.acceptToken(t,-o):r.acceptToken(n,-(o-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(t,1);break}else s=o=0;r.advance()}})}const c4t=SW("script",j3t,N3t),u4t=SW("style",R3t,I3t),d4t=SW("textarea",P3t,D3t),f4t=vm({"Text RawText IncompleteTag IncompleteCloseTag":me.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":me.angleBracket,TagName:me.tagName,"MismatchedCloseTag/TagName":[me.tagName,me.invalid],AttributeName:me.attributeName,"AttributeValue UnquotedAttributeValue":me.attributeValue,Is:me.definitionOperator,"EntityReference CharacterReference":me.character,Comment:me.blockComment,ProcessingInst:me.processingInstruction,DoctypeDecl:me.documentMeta}),h4t=om.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:",c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:r4t,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[f4t],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let u=l.type.id;if(u==V3t)return O$(l,c,n);if(u==H3t)return O$(l,c,i);if(u==q3t)return O$(l,c,r);if(u==L$e&&s.length){let d=l.node,f=d.firstChild,h=f&&mse(f,c),m;if(h){for(let g of s)if(g.tag==h&&(!g.attrs||g.attrs(m||(m=U$e(f,c))))){let b=d.lastChild,v=b.type.id==K3t?b.from:d.to;if(v>f.to)return{parser:g.parser,overlay:[{from:f.to,to:v}]}}}}if(o&&u==$$e){let d=l.node,f;if(f=d.firstChild){let h=o[c.read(f.from,f.to)];if(h)for(let m of h){if(m.tagName&&m.tagName!=mse(d.parent,c))continue;let g=d.lastChild;if(g.type.id==f7){let b=g.from+1,v=g.lastChild,y=g.to-(v&&v.isError?0:1);if(y>b)return{parser:m.parser,overlay:[{from:b,to:y}],bracketed:!0}}else if(g.type.id==F$e)return{parser:m.parser,overlay:[{from:g.from,to:g.to}]}}}}return null})}const p4t=145,gse=1,m4t=146,g4t=147,z$e=2,b4t=148,y4t=3,v4t=4,V$e=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],x4t=58,w4t=40,H$e=95,k4t=91,HN=45,O4t=46,S4t=35,E4t=37,C4t=38,A4t=92,T4t=10,_4t=42;function ZC(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function EW(e){return e>=48&&e<=57}function bse(e){return EW(e)||e>=97&&e<=102||e>=65&&e<=70}const q$e=(e,t,n)=>(i,r)=>{for(let s=!1,o=0,l=0;;l++){let{next:c}=i;if(ZC(c)||c==HN||c==H$e||s&&EW(c))!s&&(c!=HN||l>0)&&(s=!0),o===l&&c==HN&&o++,i.advance();else if(c==A4t&&i.peek(1)!=T4t){if(i.advance(),bse(i.next)){do i.advance();while(bse(i.next));i.next==32&&i.advance()}else i.next>-1&&i.advance();s=!0}else{s&&i.acceptToken(o==2&&r.canShift(z$e)?t:c==w4t?n:e);break}}},j4t=new Ma(q$e(m4t,z$e,g4t),{contextual:!0}),N4t=new Ma(q$e(b4t,y4t,v4t),{contextual:!0}),R4t=new Ma(e=>{if(V$e.includes(e.peek(-1))){let{next:t}=e;(ZC(t)||t==H$e||t==S4t||t==O4t||t==_4t||t==k4t||t==x4t&&ZC(e.peek(1))||t==HN||t==C4t)&&e.acceptToken(p4t)}}),I4t=new Ma(e=>{if(!V$e.includes(e.peek(-1))){let{next:t}=e;if(t==E4t&&(e.advance(),e.acceptToken(gse)),ZC(t)){do e.advance();while(ZC(e.next)||EW(e.next));e.acceptToken(gse)}}}),P4t=vm({"AtKeyword import charset namespace keyframes media supports font-feature-values":me.definitionKeyword,"from to selector scope MatchFlag":me.keyword,NamespaceName:me.namespace,KeyframeName:me.labelName,KeyframeRangeName:me.operatorKeyword,TagName:me.tagName,ClassName:me.className,PseudoClassName:me.constant(me.className),IdName:me.labelName,"FeatureName PropertyName":me.propertyName,AttributeName:me.attributeName,NumberLiteral:me.number,KeywordQuery:me.keyword,UnaryQueryOp:me.operatorKeyword,"CallTag ValueName FontName":me.atom,VariableName:me.variableName,Callee:me.operatorKeyword,Unit:me.unit,"UniversalSelector NestingSelector":me.definitionOperator,"MatchOp CompareOp":me.compareOperator,"ChildOp SiblingOp, LogicOp":me.logicOperator,BinOp:me.arithmeticOperator,Important:me.modifier,Comment:me.blockComment,ColorLiteral:me.color,"ParenthesizedContent StringLiteral":me.string,":":me.punctuation,"PseudoOp #":me.derefOperator,"; , |":me.separator,"( )":me.paren,"[ ]":me.squareBracket,"{ }":me.brace}),D4t={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:152,"url-prefix":152,domain:152,regexp:152},M4t={__proto__:null,or:104,and:104,not:112,only:112,layer:206},L4t={__proto__:null,selector:118,style:124,layer:202},$4t={__proto__:null,"@import":198,"@media":210,"@charset":214,"@namespace":218,"@keyframes":224,"@supports":236,"@scope":240,"@font-feature-values":246},F4t={__proto__:null,to:243},B4t=om.deserialize({version:14,states:"MlQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FnO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#EOO'dQdO'#EQO'oQdO'#EXO'oQdO'#E[OOQP'#Fn'#FnO)RQhO'#E}OOQS'#Fm'#FmOOQS'#FQ'#FQQYQdOOO)YQdO'#EbO*iQhO'#EhO)YQdO'#EjO*pQdO'#ElO*{QdO'#EoO)}QhO'#EuO+TQdO'#EwO+`QdO'#EzO+eQaO'#CfO+lQ`O'#E_O+qQ`O'#F{O+|QdO'#F{QOQ`OOP,WO&jO'#CaPOOO)CA])CA]OOQP'#Ci'#CiOOQP,59R,59RO%VQdO,59ROOQP'#Cm'#CmOOQP,59V,59VO&XQdO,59VO,cQdO,59YO'_QdO,5:jO'dQdO,5:lO'oQdO,5:sO'oQdO,5:uO'oQdO,5:vO'oQdO'#FXO,nQ`O,58}O,vQdO'#E^OOQS,58},58}OOQP'#Cq'#CqOOQO'#D|'#D|OOQP,59Y,59YO,}Q`O,59YO-SQ`O,59YOOQP'#EP'#EPOOQP,5:j,5:jO-XQpO'#ERO-dQdO'#ESO-iQ`O'#ESO-nQpO,5:lO.XQaO,5:sO.oQaO,5:vOOQW'#D^'#D^O/nQhO'#DgO0RQhO,5;iO)}QhO'#DeO0`Q`O'#DnO0eQhO'#DxOOQW'#Ft'#FtOOQS,5;i,5;iO0jQ`O'#DhO0oQ`O'#DkOOQS-E9O-E9OOOQ['#Cv'#CvO0tQdO'#CwO1[QdO'#C}O1rQdO'#DQO2YQ!pO'#DSO4fQ!jO,5:|OOQO'#DX'#DXO-SQ`O'#DWO4vQ!nO'#FqO6|Q`O'#DYO7RQ`O'#DyOOQ['#Fq'#FqO7WQhO'#GOO7fQ`O,5;SO7kQ!bO,5;UOOQS'#En'#EnO7sQ`O,5;WO7xQdO,5;WOOQO'#Eq'#EqO8QQ`O,5;ZO8VQhO,5;aO'oQdO'#DjOOQS,5;c,5;cO0jQ`O,5;cO8_QdO,5;cOOQS'#F`'#F`O8gQdO'#E|O7fQ`O,5;fO8oQdO,5:yO9PQdO'#FZO9^Q`O,5lQhO'#DoOOQW,5:Y,5:YOOQW,5:d,5:dOOQW,5:S,5:SO>vQhO,5:VO?bQ!fO'#FrOOQS'#Fr'#FrOOQS'#FS'#FSO@rQdO,59cOOQ[,59c,59cOAYQdO,59iOOQ[,59i,59iOApQdO,59lOOQ[,59l,59lOOQ[,59n,59nO)YQdO,59pOBWQhO'#EdOOQW'#Ed'#EdOBuQ`O1G0hO4oQhO1G0hOOQ[,59r,59rO)}QhO'#D[OOQ[,59t,59tOBzQ#tO,5:eOCVQhO'#F]OCdQ`O,5vQhO'#DmOI_QhO'#DqOIgQhO'#DsOIlQhO'#FwOOQO'#Fw'#FwOItQ!bO'#DwOOQO'#Fy'#FyOOQO'#Fv'#FvOIyQ`O1G/qOOQS-E9Q-E9QOOQ[1G.}1G.}OOQ[1G/T1G/TOOQ[1G/W1G/WOOQ[1G/[1G/[OJOQdO,5;OOOQS7+&S7+&SOJTQ`O7+&SOJYQhO'#D]OJbQ`O,59vO)}QhO,59vOOQ[1G0P1G0POJjQ`O1G0POJoQhO,5;wOOQO-E9Z-E9ZOOQS7+&^7+&^OJ}QbO'#DSOOQO'#Et'#EtOK]Q`O'#EsOOQO'#Es'#EsOKhQ`O'#F^OKpQdO,5;^OOQS,5;^,5;^OOQ[1G/p1G/pOOQS7+&i7+&iO7fQ`O7+&iOK{Q!fO'#FYO)YQdO'#FYOMSQdO7+&POOQO7+&P7+&POOQO,5:{,5:{OOQO1G1a1G1aOMgQ!bO<vQhO'#DrOOQO,5:],5:]O! hQhO,5:_OGUQhO,5:cOOQW7+%]7+%]OOQO'#Ef'#EfO! pQ`O1G0jOOQS<xAN>xO!#zQ`OAN>xO!$PQaO,5;rOOQO-E9U-E9UO!$ZQdO,5;qOOQO-E9T-E9TOOQW<vQhO'#DuOOQO1G/y1G/yO!%vQ!bO1G/}OJOQdO'#F[O!&OQ`O7+&UOOQW7+&U7+&UO!&WQ!bO1G/cOOQ[7+$|7+$|O!&cQhO7+$|P!&jQ`O'#FTOOQO,5;y,5;yOOQO-E9]-E9]OOQS1G1d1G1dOOQPG24dG24dO!&oQ`OAN>ZO)YQdO1G1[O!&tQ`O7+'jOOQO1G/x1G/xO!&|Q`O,5:aO!$eQhO7+%iOOQO,5;v,5;vOOQO-E9Y-E9YOOQW<Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`KY<%lO%Z`%^SOy%jz;'S%j;'S;=`%{<%lO%j`%oS!o`Oy%jz;'S%j;'S;=`%{<%lO%j`&OP;=`<%l%j~&Wh$[~OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%j~'yh$[~!o`OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%jj)jS$qYOy%jz;'S%j;'S;=`%{<%lO%j~)yWOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d<%lO)v~*hOw~~*kRO;'S)v;'S;=`*t;=`O)v~*wXOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d;=`<%l)v<%lO)v~+gP;=`<%l)vj+oYmYOy%jz!Q%j!Q![,_![!c%j!c!i,_!i#T%j#T#Z,_#Z;'S%j;'S;=`%{<%lO%jj,dY!o`Oy%jz!Q%j!Q![-S![!c%j!c!i-S!i#T%j#T#Z-S#Z;'S%j;'S;=`%{<%lO%jj-XY!o`Oy%jz!Q%j!Q![-w![!c%j!c!i-w!i#T%j#T#Z-w#Z;'S%j;'S;=`%{<%lO%jj.OYuY!o`Oy%jz!Q%j!Q![.n![!c%j!c!i.n!i#T%j#T#Z.n#Z;'S%j;'S;=`%{<%lO%jj.uYuY!o`Oy%jz!Q%j!Q![/e![!c%j!c!i/e!i#T%j#T#Z/e#Z;'S%j;'S;=`%{<%lO%jj/jY!o`Oy%jz!Q%j!Q![0Y![!c%j!c!i0Y!i#T%j#T#Z0Y#Z;'S%j;'S;=`%{<%lO%jj0aYuY!o`Oy%jz!Q%j!Q![1P![!c%j!c!i1P!i#T%j#T#Z1P#Z;'S%j;'S;=`%{<%lO%jj1UY!o`Oy%jz!Q%j!Q![1t![!c%j!c!i1t!i#T%j#T#Z1t#Z;'S%j;'S;=`%{<%lO%jj1{SuY!o`Oy%jz;'S%j;'S;=`%{<%lO%jd2[UOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jd2uS!yS!o`Oy%jz;'S%j;'S;=`%{<%lO%jb3WS^QOy%jz;'S%j;'S;=`%{<%lO%j~3gWOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{<%lO3d~4SRO;'S3d;'S;=`4];=`O3d~4`XOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{;=`<%l3d<%lO3d~5OP;=`<%l3dj5WShYOy%jz;'S%j;'S;=`%{<%lO%j~5iOg~n5pUWQyWOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jj6ZWyW#PQOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj6xU!o`Oy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%jj7cY!o`$gYOy%jz!Q%j!Q![7[![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj8WY!o`Oy%jz{%j{|8v|}%j}!O8v!O!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj8{U!o`Oy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj9fU!o`$gYOy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj:P[!o`$gYOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj:zS!dYOy%jz;'S%j;'S;=`%{<%lO%jj;]WyWOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj;zU`YOy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%j~VUcYOy%jz![%j![!]>i!];'S%j;'S;=`%{<%lO%jj>pSdY!o`Oy%jz;'S%j;'S;=`%{<%lO%jj?RSnYOy%jz;'S%j;'S;=`%{<%lO%jh?dU!WWOy%jz!_%j!_!`?v!`;'S%j;'S;=`%{<%lO%jh?}S!WW!o`Oy%jz;'S%j;'S;=`%{<%lO%jl@bS!WW!ySOy%jz;'S%j;'S;=`%{<%lO%jj@uV!|Q!WWOy%jz!_%j!_!`?v!`!aA[!a;'S%j;'S;=`%{<%lO%jbAcS!|Q!o`Oy%jz;'S%j;'S;=`%{<%lO%jjArYOy%jz}%j}!OBb!O!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjBgW!o`Oy%jz!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjCW[lY!o`Oy%jz}%j}!OCP!O!Q%j!Q![CP![!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jhDRS!zWOy%jz;'S%j;'S;=`%{<%lO%jjDdSpYOy%jz;'S%j;'S;=`%{<%lO%jnDuSo^Oy%jz;'S%j;'S;=`%{<%lO%jjEWU!zWOy%jz#a%j#a#bEj#b;'S%j;'S;=`%{<%lO%jbEoU!o`Oy%jz#d%j#d#eFR#e;'S%j;'S;=`%{<%lO%jbFWU!o`Oy%jz#c%j#c#dFj#d;'S%j;'S;=`%{<%lO%jbFoU!o`Oy%jz#f%j#f#gGR#g;'S%j;'S;=`%{<%lO%jbGWU!o`Oy%jz#h%j#h#iGj#i;'S%j;'S;=`%{<%lO%jbGoU!o`Oy%jz#T%j#T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!o`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!o`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$pQ!o`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$cUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU#PQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[R4t,I4t,j4t,N4t,1,2,3,4,new nP("m~RRYZ[z{a~~g~aO$_~~dP!P!Qg~lO$`~~",28,152)],topRules:{StyleSheet:[0,6],Styles:[1,126]},dynamicPrecedences:{94:1},specialized:[{term:147,get:e=>D4t[e]||-1},{term:148,get:e=>M4t[e]||-1},{term:4,get:e=>L4t[e]||-1},{term:28,get:e=>$4t[e]||-1},{term:146,get:e=>F4t[e]||-1}],tokenPrec:2405});let S$=null;function E$(){if(!S$&&typeof document=="object"&&document.body){let{style:e}=document.body,t=[],n=new Set;for(let i in e)i!="cssText"&&i!="cssFloat"&&typeof e[i]=="string"&&(/[A-Z]/.test(i)&&(i=i.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),n.has(i)||(t.push(i),n.add(i)));S$=t.sort().map(i=>({type:"property",label:i,apply:i+": "}))}return S$||[]}const yse=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),vse=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),U4t=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),Q4t=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(e=>({type:"keyword",label:e})),tp=/^(\w[\w-]*|-\w[\w-]*|)$/,z4t=/^-(-[\w-]*)?$/;function V4t(e,t){var n;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let i=(n=e.parent)===null||n===void 0?void 0:n.firstChild;return(i==null?void 0:i.name)!="Callee"?!1:t.sliceString(i.from,i.to)=="var"}const xse=new Mq,H4t=["Declaration"];function q4t(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function W$e(e,t,n){if(t.to-t.from>4096){let i=xse.get(t);if(i)return i;let r=[],s=new Set,o=t.cursor(Ar.IncludeAnonymous);if(o.firstChild())do for(let l of W$e(e,o.node,n))s.has(l.label)||(s.add(l.label),r.push(l));while(o.nextSibling());return xse.set(t,r),r}else{let i=[],r=new Set;return t.cursor().iterate(s=>{var o;if(n(s)&&s.matchContext(H4t)&&((o=s.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let l=e.sliceString(s.from,s.to);r.has(l)||(r.add(l),i.push({label:l,type:"variable"}))}}),i}}const W4t=e=>t=>{let{state:n,pos:i}=t,r=es(n).resolveInner(i,-1),s=r.type.isError&&r.from==r.to-1&&n.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:E$(),validFor:tp};if(r.name=="ValueName")return{from:r.from,options:vse,validFor:tp};if(r.name=="PseudoClassName")return{from:r.from,options:yse,validFor:tp};if(e(r)||(t.explicit||s)&&V4t(r,n.doc))return{from:e(r)||s?r.from:i,options:W$e(n.doc,q4t(r),e),validFor:z4t};if(r.name=="TagName"){for(let{parent:c}=r;c;c=c.parent)if(c.name=="Block")return{from:r.from,options:E$(),validFor:tp};return{from:r.from,options:U4t,validFor:tp}}if(r.name=="AtKeyword")return{from:r.from,options:Q4t,validFor:tp};if(!t.explicit)return null;let o=r.resolve(i),l=o.childBefore(i);return l&&l.name==":"&&o.name=="PseudoClassSelector"?{from:i,options:yse,validFor:tp}:l&&l.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:i,options:vse,validFor:tp}:o.name=="Block"||o.name=="Styles"?{from:i,options:E$(),validFor:tp}:null},K4t=W4t(e=>e.name=="VariableName"),lP=am.define({name:"css",parser:B4t.configure({props:[xm.add({Declaration:Ow()}),wm.add({"Block KeyframeList":PT})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function G4t(){return new mb(lP,lP.data.of({autocomplete:K4t}))}const NO=["_blank","_self","_top","_parent"],C$=["ascii","utf-8","utf-16","latin1","latin1"],A$=["get","post","put","delete"],T$=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],ou=["true","false"],In={},X4t={a:{attrs:{href:null,ping:null,type:null,media:null,target:NO,hreflang:null}},abbr:In,address:In,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:In,aside:In,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:In,base:{attrs:{href:null,target:NO}},bdi:In,bdo:In,blockquote:{attrs:{cite:null}},body:In,br:In,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:T$,formmethod:A$,formnovalidate:["novalidate"],formtarget:NO,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:In,center:In,cite:In,code:In,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:In,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:In,div:In,dl:In,dt:In,em:In,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:In,figure:In,footer:In,form:{attrs:{action:null,name:null,"accept-charset":C$,autocomplete:["on","off"],enctype:T$,method:A$,novalidate:["novalidate"],target:NO}},h1:In,h2:In,h3:In,h4:In,h5:In,h6:In,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:In,hgroup:In,hr:In,html:{attrs:{manifest:null}},i:In,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:T$,formmethod:A$,formnovalidate:["novalidate"],formtarget:NO,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:In,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:In,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:In,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:C$,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:In,noscript:In,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:In,param:{attrs:{name:null,value:null}},pre:In,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:In,rt:In,ruby:In,samp:In,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:C$}},section:In,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:In,source:{attrs:{src:null,type:null,media:null}},span:In,strong:In,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:In,summary:In,sup:In,table:In,tbody:In,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:In,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:In,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:In,time:{attrs:{datetime:null}},title:In,tr:In,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:In,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:In},K$e={accesskey:null,class:null,contenteditable:ou,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:ou,autocorrect:ou,autocapitalize:ou,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":ou,"aria-autocomplete":["inline","list","both","none"],"aria-busy":ou,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":ou,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":ou,"aria-hidden":ou,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":ou,"aria-multiselectable":ou,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":ou,"aria-relevant":null,"aria-required":ou,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},G$e="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of G$e)K$e[e]=null;class JC{constructor(t,n){this.tags={...X4t,...t},this.globalAttrs={...K$e,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}JC.default=new JC;function v1(e,t,n=e.length){if(!t)return"";let i=t.firstChild,r=i&&i.getChild("TagName");return r?e.sliceString(r.from,Math.min(r.to,n)):""}function x1(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function X$e(e,t,n){let i=n.tags[v1(e,x1(t))];return(i==null?void 0:i.children)||n.allTags}function CW(e,t){let n=[];for(let i=x1(t);i&&!i.type.isTop;i=x1(i.parent)){let r=v1(e,i);if(r&&i.lastChild.name=="CloseTag")break;r&&n.indexOf(r)<0&&(t.name=="EndTag"||t.from>=i.firstChild.to)&&n.push(r)}return n}const Y$e=/^[:\-\.\w\u00b7-\uffff]*$/;function wse(e,t,n,i,r){let s=/\s*>/.test(e.sliceDoc(r,r+5))?"":">",o=x1(n,n.name=="StartTag"||n.name=="TagName");return{from:i,to:r,options:X$e(e.doc,o,t).map(l=>({label:l,type:"type"})).concat(CW(e.doc,n).map((l,c)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function kse(e,t,n,i){let r=/\s*>/.test(e.sliceDoc(i,i+5))?"":">";return{from:n,to:i,options:CW(e.doc,t).map((s,o)=>({label:s,apply:s+r,type:"type",boost:99-o})),validFor:Y$e}}function Y4t(e,t,n,i){let r=[],s=0;for(let o of X$e(e.doc,n,t))r.push({label:"<"+o,type:"type"});for(let o of CW(e.doc,n))r.push({label:"",type:"type",boost:99-s++});return{from:i,to:i,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Z4t(e,t,n,i,r){let s=x1(n),o=s?t.tags[v1(e.doc,s)]:null,l=o&&o.attrs?Object.keys(o.attrs):[],c=o&&o.globalAttrs===!1?l:l.length?l.concat(t.globalAttrNames):t.globalAttrNames;return{from:i,to:r,options:c.map(u=>({label:u,type:"property"})),validFor:Y$e}}function J4t(e,t,n,i,r){var s;let o=(s=n.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),l=[],c;if(o){let u=e.sliceDoc(o.from,o.to),d=t.globalAttrs[u];if(!d){let f=x1(n),h=f?t.tags[v1(e.doc,f)]:null;d=(h==null?void 0:h.attrs)&&h.attrs[u]}if(d){let f=e.sliceDoc(i,r).toLowerCase(),h='"',m='"';/^['"]/.test(f)?(c=f[0]=='"'?/^[^"]*$/:/^[^']*$/,h="",m=e.sliceDoc(r,r+1)==f[0]?"":f[0],f=f.slice(1),i++):c=/^[^\s<>='"]*$/;for(let g of d)l.push({label:g,apply:h+g+m,type:"constant"})}}return{from:i,to:r,options:l,validFor:c}}function Z$e(e,t){let{state:n,pos:i}=t,r=es(n).resolveInner(i,-1),s=r.resolve(i);for(let o=i,l;s==r&&(l=r.childBefore(o));){let c=l.lastChild;if(!c||!c.type.isError||c.fromZ$e(i,r)}const n$t=wh.parser.configure({top:"SingleExpression"}),J$e=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:a$e.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:o$e.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:l$e.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:n$t},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:wh.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:lP.parser}],e6e=[{name:"style",parser:lP.parser.configure({top:"Styles"})}].concat(G$e.map(e=>({name:e,parser:wh.parser}))),t6e=am.define({name:"html",parser:h4t.configure({props:[xm.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].lengthe.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),qN=t6e.configure({wrap:Q$e(J$e,e6e)});function i$t(e={}){let t="",n;e.matchClosingTags===!1&&(t="noMatch"),e.selfClosingTags===!0&&(t=(t?t+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(n=Q$e((e.nestedLanguages||[]).concat(J$e),(e.nestedAttributes||[]).concat(e6e)));let i=n?t6e.configure({wrap:n,dialect:t}):t?qN.configure({dialect:t}):qN;return new mb(i,[qN.data.of({autocomplete:t$t(e)}),e.autoCloseTags!==!1?r$t:[],o7().support,G4t().support])}const Ose=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),r$t=Jt.inputHandler.of((e,t,n,i,r)=>{if(e.composing||e.state.readOnly||t!=n||i!=">"&&i!="/"||!qN.isActiveAt(e.state,t,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(c=>{var u,d,f;let h=o.doc.sliceString(c.from-1,c.to)==i,{head:m}=c,g=es(o).resolveInner(m,-1),b;if(h&&i==">"&&g.name=="EndTag"){let v=g.parent;if(((d=(u=v.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(b=v1(o.doc,v.parent,m))&&!Ose.has(b)){let y=m+(o.doc.sliceString(m,m+1)===">"?1:0),w=``;return{range:c,changes:{from:m,to:y,insert:w}}}}else if(h&&i=="/"&&g.name=="IncompleteCloseTag"){let v=g.parent;if(g.from==m-2&&((f=v.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(b=v1(o.doc,v,m))&&!Ose.has(b)){let y=m+(o.doc.sliceString(m,m+1)===">"?1:0),w=`${b}>`;return{range:pt.cursor(m+w.length,-1),changes:{from:m,to:y,insert:w}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),n6e=JM({commentTokens:{block:{open:""}}}),i6e=new li,r6e=m3t.configure({props:[wm.add(e=>!e.is("Block")||e.is("Document")||p7(e)!=null||s$t(e)?void 0:(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})),i6e.add(p7),xm.add({Document:()=>null}),xg.add({Document:n6e})]});function p7(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function s$t(e){return e.name=="OrderedList"||e.name=="BulletList"}function a$t(e,t){let n=e;for(;;){let i=n.nextSibling,r;if(!i||(r=p7(i.type))!=null&&r<=t)break;n=i}return n.to}const o$t=O4e.of((e,t,n)=>{for(let i=es(e).resolveInner(n,-1);i&&!(i.fromn)return{from:n,to:s}}return null});function AW(e){return new Au(n6e,e,[],"markdown")}const l$t=AW(r6e),c$t=r6e.configure([C3t,T3t,A3t,_3t,{props:[wm.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),cP=AW(c$t);function u$t(e,t){return n=>{if(n&&e){let i=null;if(n=/\S*/.exec(n)[0],typeof e=="function"?i=e(n):i=YI.matchLanguageName(e,n,!0),i instanceof YI)return i.support?i.support.language.parser:vv.getSkippingParser(i.load());if(i)return i.parser}return t?t.parser:null}}let _$=class{constructor(t,n,i,r,s,o,l){this.node=t,this.from=n,this.to=i,this.spaceBefore=r,this.spaceAfter=s,this.type=o,this.item=l}blank(t,n=!0){let i=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(t!=null){for(;i.length0;r--)i+=" ";return i+(n?this.spaceAfter:"")}}marker(t,n){let i=this.node.name=="OrderedList"?String(+a6e(this.item,t)[2]+n):"";return this.spaceBefore+i+this.type+this.spaceAfter}};function s6e(e,t){let n=[],i=[];for(let r=e;r;r=r.parent){if(r.name=="FencedCode")return i;(r.name=="ListItem"||r.name=="Blockquote")&&n.push(r)}for(let r=n.length-1;r>=0;r--){let s=n[r],o,l=t.lineAt(s.from),c=s.from-l.from;if(s.name=="Blockquote"&&(o=/^ *>( ?)/.exec(l.text.slice(c))))i.push(new _$(s,c,c+o[0].length,"",o[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(l.text.slice(c)))){let u=o[3],d=o[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),i.push(new _$(s.parent,c,c+d,o[1],u,o[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(l.text.slice(c)))){let u=o[4],d=o[0].length;u.length>4&&(u=u.slice(0,u.length-4),d-=4);let f=o[2];o[3]&&(f+=o[3].replace(/[xX]/," ")),i.push(new _$(s.parent,c,c+d,o[1],u,f,s))}}return i}function a6e(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function j$(e,t,n,i=0){for(let r=-1,s=e;;){if(s.name=="ListItem"){let l=a6e(s,t),c=+l[2];if(r>=0){if(c!=r+1)return;n.push({from:s.from+l[1].length,to:s.from+l[0].length,insert:String(r+2+i)})}r=c}let o=s.nextSibling;if(!o)break;s=o}}function TW(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(bk)!=" ")return e;let i=vf(e,4,n),r="";for(let s=i;s>0;)s>=4?(r+=" ",s-=4):(r+=" ",s--);return r+e.slice(n)}const d$t=(e={})=>({state:t,dispatch:n})=>{let i=es(t),{doc:r}=t,s=null,o=t.changeByRange(l=>{if(!l.empty||!cP.isActiveAt(t,l.from,-1)&&!cP.isActiveAt(t,l.from,1))return s={range:l};let c=l.from,u=r.lineAt(c),d=s6e(i.resolveInner(c,-1),r);for(;d.length&&d[d.length-1].from>c-u.from;)d.pop();if(!d.length)return s={range:l};let f=d[d.length-1];if(f.to-f.spaceAfter.length>c-u.from)return s={range:l};let h=c>=f.to-f.spaceAfter.length&&!/\S/.test(u.text.slice(f.to));if(f.item&&h){let y=f.node.firstChild,w=f.node.getChild("ListItem","ListItem");if(y.to>=c||w&&w.to0&&!/[^\s>]/.test(r.lineAt(u.from-1).text)||e.nonTightLists===!1){let x=d.length>1?d[d.length-2]:null,k,S="";x&&x.item?(k=u.from+x.from,S=x.marker(r,1)):k=u.from+(x?x.to:0);let O=[{from:k,to:c,insert:S}];return f.node.name=="OrderedList"&&j$(f.item,r,O,-2),x&&x.node.name=="OrderedList"&&j$(x.item,r,O),{range:pt.cursor(k+S.length),changes:O}}else{let x=Ese(d,t,u);return{range:pt.cursor(c+x.length+1),changes:{from:u.from,insert:x+t.lineBreak}}}}if(f.node.name=="Blockquote"&&h&&u.from){let y=r.lineAt(u.from-1),w=/>\s*$/.exec(y.text);if(w&&w.index==f.from){let x=t.changes([{from:y.from+w.index,to:y.to},{from:u.from+f.from,to:u.to}]);return{range:l.map(x),changes:x}}}let m=[];f.node.name=="OrderedList"&&j$(f.item,r,m);let g=f.item&&f.item.from]*/.exec(u.text)[0].length>=f.to)for(let y=0,w=d.length-1;y<=w;y++)b+=y==w&&!g?d[y].marker(r,1):d[y].blank(yu.from&&/\s/.test(u.text.charAt(v-u.from-1));)v--;return b=TW(b,t),h$t(f.node,t.doc)&&(b=Ese(d,t,u)+t.lineBreak+b),m.push({from:v,to:c,insert:t.lineBreak+b}),{range:pt.cursor(v+b.length+1),changes:m}});return s?!1:(n(t.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},f$t=d$t();function Sse(e){return e.name=="QuoteMark"||e.name=="ListMark"}function h$t(e,t){if(e.name!="OrderedList"&&e.name!="BulletList")return!1;let n=e.firstChild,i=e.getChild("ListItem","ListItem");if(!i)return!1;let r=t.lineAt(n.to),s=t.lineAt(i.from),o=/^[\s>]*$/.test(r.text);return r.number+(o?0:1){let n=es(e),i=null,r=e.changeByRange(s=>{let o=s.from,{doc:l}=e;if(s.empty&&cP.isActiveAt(e,s.from)){let c=l.lineAt(o),u=s6e(p$t(n,o),l);if(u.length){let d=u[u.length-1],f=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(o-c.from>f&&!/\S/.test(c.text.slice(f,o-c.from)))return{range:pt.cursor(c.from+f),changes:{from:c.from+f,to:o}};if(o-c.from==f&&(d.item&&c.from<=d.item.from||/^[\s>]*$/.test(c.text.slice(0,d.to)))){let h=c.from+d.from;if(d.item&&d.node.from{var n;let{main:i}=t.state.selection;if(i.empty)return!1;let r=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r="https://"+r),!cP.isActiveAt(t.state,i.from,1)))return!1;let s=es(t.state),o=!1;return s.iterate({from:i.from,to:i.to,enter:l=>{(l.from>i.from||x$t.test(l.name))&&(o=!0)},leave:l=>{l.to=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}const w6t=new Ma((e,t)=>{let n;if(e.next<0)e.acceptToken(E$t);else if(t.context.flags&WN)R$(e.next)&&e.acceptToken(S$t,1);else if(((n=e.peek(-1))<0||R$(n))&&t.canShift(Cse)){let i=0;for(;e.next==_W||e.next==sL;)e.advance(),i++;(e.next==kv||e.next==eA||e.next==jW)&&e.acceptToken(Cse,-i)}else R$(e.next)&&e.acceptToken(O$t,1)},{contextual:!0}),k6t=new Ma((e,t)=>{let n=t.context;if(n.flags)return;let i=e.peek(-1);if(i==kv||i==eA){let r=0,s=0;for(;;){if(e.next==_W)r++;else if(e.next==sL)r+=8-r%8;else break;e.advance(),s++}r!=n.indent&&e.next!=kv&&e.next!=eA&&e.next!=jW&&(r[e,t|p6e])),E6t=new nL({start:O6t,reduce(e,t,n,i){return e.flags&WN&&x6t.has(t)||(t==Q$t||t==d6e)&&e.flags&p6e?e.parent:e},shift(e,t,n,i){return t==l6e?new KN(e,S6t(i.read(i.pos,n.pos)),0):t==c6e?e.parent:t==T$t||t==R$t||t==D$t||t==u6e?new KN(e,0,WN):jse.has(t)?new KN(e,0,jse.get(t)|e.flags&WN):e},hash(e){return e.hash}}),C6t=new Ma(e=>{for(let t=0;t<5;t++){if(e.next!="print".charCodeAt(t))return;e.advance()}if(!/\w/.test(String.fromCharCode(e.next)))for(let t=0;;t++){let n=e.peek(t);if(!(n==_W||n==sL)){n!=h6t&&n!=p6t&&n!=kv&&n!=eA&&n!=jW&&e.acceptToken(k$t);return}}}),A6t=new Ma((e,t)=>{let{flags:n}=t.context,i=n&cp?h6e:f6e,r=(n&up)>0,s=!(n&dp),o=(n&fp)>0,l=e.pos;for(;!(e.next<0);)if(o&&e.next==m7)if(e.peek(1)==m7)e.advance(2);else{if(e.pos==l){e.acceptToken(u6e,1);return}break}else if(s&&e.next==_se){if(e.pos==l){e.advance();let c=e.next;c>=0&&(e.advance(),T6t(e,c)),e.acceptToken(A$t);return}break}else if(e.next==_se&&!s&&e.peek(1)>-1)e.advance(2);else if(e.next==i&&(!r||e.peek(1)==i&&e.peek(2)==i)){if(e.pos==l){e.acceptToken(Ase,r?3:1);return}break}else if(e.next==kv){if(r)e.advance();else if(e.pos==l){e.acceptToken(Ase);return}break}else e.advance();e.pos>l&&e.acceptToken(C$t)});function T6t(e,t){if(t==m6t)for(let n=0;n<2&&e.next>=48&&e.next<=55;n++)e.advance();else if(t==g6t)for(let n=0;n<2&&I$(e.next);n++)e.advance();else if(t==y6t)for(let n=0;n<4&&I$(e.next);n++)e.advance();else if(t==v6t)for(let n=0;n<8&&I$(e.next);n++)e.advance();else if(t==b6t&&e.next==m7){for(e.advance();e.next>=0&&e.next!=Tse&&e.next!=f6e&&e.next!=h6e&&e.next!=kv;)e.advance();e.next==Tse&&e.advance()}}const _6t=vm({'async "*" "**" FormatConversion FormatSpec':me.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":me.controlKeyword,"in not and or is del":me.operatorKeyword,"from def class global nonlocal lambda":me.definitionKeyword,import:me.moduleKeyword,"with as print":me.keyword,Boolean:me.bool,None:me.null,VariableName:me.variableName,"CallExpression/VariableName":me.function(me.variableName),"FunctionDefinition/VariableName":me.function(me.definition(me.variableName)),"ClassDefinition/VariableName":me.definition(me.className),PropertyName:me.propertyName,"CallExpression/MemberExpression/PropertyName":me.function(me.propertyName),Comment:me.lineComment,Number:me.number,String:me.string,FormatString:me.special(me.string),Escape:me.escape,UpdateOp:me.updateOperator,"ArithOp!":me.arithmeticOperator,BitOp:me.bitwiseOperator,CompareOp:me.compareOperator,AssignOp:me.definitionOperator,Ellipsis:me.punctuation,At:me.meta,"( )":me.paren,"[ ]":me.squareBracket,"{ }":me.brace,".":me.derefOperator,", ;":me.separator}),j6t={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},N6t=om.deserialize({version:14,states:"##jQ`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5TQdO'#DoOOQS,5:Y,5:YO5hQdO'#HdOOQS,5:],5:]O5uQ!fO,5:]O5zQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8jQdO,59bO8oQdO,59bO8vQdO,59jO8}QdO'#HTO:TQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:lQdO,59aO'vQdO,59aO:zQdO,59aOOQS,59y,59yO;PQdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;_QdO,5:QO;dQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;uQdO,5:UO;zQdO,5:WOOOW'#Fy'#FyOOOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!/[QtO1G.|O!/cQtO1G.|O1lQdO1G.|O!0OQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!0VQdO1G/eO!0gQdO1G/eO!0oQdO1G/fO'vQdO'#H[O!0tQdO'#H[O!0yQtO1G.{O!1ZQdO,59iO!2aQdO,5=zO!2qQdO,5=zO!2yQdO1G/mO!3OQtO1G/mOOQS1G/l1G/lO!3`QdO,5=uO!4VQdO,5=uO0rQdO1G/qO!4tQdO1G/sO!4yQtO1G/sO!5ZQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!5kQdO'#HxO0rQdO'#HxO!5|QdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!6[Q#xO1G2zO!6{QtO1G2zO'vQdO,5kOOQS1G1`1G1`O!8RQdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!8WQdO'#FrO!8cQdO,59oO!8kQdO1G/XO!8uQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!9fQdO'#GtOOQS,5jO!;ZQdO,5>jO1XQdO,5>jO!;lQdO,5>iOOQS-E:R-E:RO!;qQdO1G0lO!;|QdO1G0lO!lO!lO!hO!=VQdO,5>hO!=hQdO'#EpO0rQdO1G0tO!=sQdO1G0tO!=xQgO1G0zO!AvQgO1G0}O!EqQdO,5>oO!E{QdO,5>oO!FTQtO,5>oO0rQdO1G1PO!F_QdO1G1PO4iQdO1G1UO!!vQdO1G1WOOQV,5;a,5;aO!FdQfO,5;aO!FiQgO1G1QO!JjQdO'#GZO4iQdO1G1QO4iQdO1G1QO!JzQdO,5>pO!KXQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!KaQdO'#FSO!KrQ!fO1G1WO!KzQdO1G1WOOQV1G1]1G1]O4iQdO1G1]O!LPQdO1G1]O!LXQdO'#F^OOQV1G1b1G1bO!#ZQtO1G1bPOOO1G2v1G2vP!L^OSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!LfQdO,5=|O!LyQdO,5=|OOQS1G/u1G/uO!MRQdO,5>PO!McQdO,5>PO!MkQdO,5>PO!NOQdO,5>PO!N`QdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!8kQdO7+$pO#!RQdO1G.|O#!YQdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO#!aQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO#!qQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO#!vQdO7+%PO##OQdO7+%QO##TQdO1G3fOOQS7+%X7+%XO##eQdO1G3fO##mQdO7+%XOOQS,5<_,5<_O'vQdO,5<_O##rQdO1G3aOOQS-E9q-E9qO#$iQdO7+%]OOQS7+%_7+%_O#$wQdO1G3aO#%fQdO7+%_O#%kQdO1G3gO#%{QdO1G3gO#&TQdO7+%]O#&YQdO,5>dO#&sQdO,5>dO#&sQdO,5>dOOQS'#Dx'#DxO#'UO&jO'#DzO#'aO`O'#HyOOOW1G3}1G3}O#'fQdO1G3}O#'nQdO1G3}O#'yQ#xO7+(fO#(jQtO1G2UP#)TQdO'#GOOOQS,5nQdO,5sQdO1G4OOOQS-E9y-E9yO#?^QdO1G4OO<[QdO'#H{OOOO'#D{'#D{OOOO'#F|'#F|O#?oO&jO,5:fOOOW,5>e,5>eOOOW7+)i7+)iO#?zQdO7+)iO#@SQdO1G2zO#@mQdO1G2zP'vQdO'#FuO0rQdO<mO#BQQdO,5>mOOQS1G0v1G0vOOQS<rO#KgQdO,5>rO#KrQdO,5>rO#K}QdO,5>qO#L`QdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<VAN>VO$ oQdO<cAN>cO0rQdO1G1|O$!PQtO1G1|P$!ZQdO'#FvOOQS1G2R1G2RP$!hQdO'#F{O$!uQdO7+)jO$#`QdO,5>gOOOO-E9z-E9zOOOW<tO$4{QdO,5>tO1XQdO,5vO$)nQdO,5>vOOQS1G1p1G1pOOQS,5<[,5<[OOQU7+'P7+'PO$+zQdO1G/iO$)nQdO,5wO$8zQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$)nQdO'#GdO$9SQdO1G4bO$9^QdO1G4bO$9fQdO1G4bOOQS7+%T7+%TO$9tQdO1G1tO$:SQtO'#FaO$:ZQdO,5<}OOQS,5<},5<}O$:iQdO1G4cOOQS-E:a-E:aO$)nQdO,5<|O$:pQdO,5<|O$:uQdO7+)|OOQS-E:`-E:`O$;PQdO7+)|O$)nQdO,5S~O%cOS%^OSSOS%]PQ~OPdOVaOfoOhYOopOs!POvqO!PrO!Q{O!T!SO!U!RO!XZO!][O!h`O!r`O!s`O!t`O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#l!QO#o!TO#s!UO#u!VO#z!WO#}hO$P!XO%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~O%]!YO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%j![O%k!]O%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aO~Ok%xXl%xXm%xXn%xXo%xXp%xXs%xXz%xX{%xX!x%xX#g%xX%[%xX%_%xX%z%xXg%xX!T%xX!U%xX%{%xX!W%xX![%xX!Q%xX#[%xXt%xX!m%xX~P%SOfoOhYO!XZO!][O!h`O!r`O!s`O!t`O%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~Oz%wX{%wX#g%wX%[%wX%_%wX%z%wX~Ok!pOl!qOm!oOn!oOo!rOp!sOs!tO!x%wX~P)pOV!zOg!|Oo0cOv0qO!PrO~P'vOV#OOo0cOv0qO!W#PO~P'vOV#SOa#TOo0cOv0qO![#UO~P'vOQ#XO%`#XO%a#ZO~OQ#^OR#[O%`#^O%a#`O~OV%iX_%iXa%iXh%iXk%iXl%iXm%iXn%iXo%iXp%iXs%iXz%iX!X%iX!f%iX%j%iX%k%iX%l%iX%m%iX%n%iX%o%iX%p%iX%q%iX%r%iX%s%iXg%iX!T%iX!U%iX~O&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O{%iX!x%iX#g%iX%[%iX%_%iX%z%iX%{%iX!W%iX![%iX!Q%iX#[%iXt%iX!m%iX~P,eOz#dO{%hX!x%hX#g%hX%[%hX%_%hX%z%hX~Oo0cOv0qO~P'vO#g#gO%[#iO%_#iO~O%uWO~O!T#nO#u!VO#z!WO#}hO~OopO~P'vOV#sOa#tO%uWO{wP~OV#xOo0cOv0qO!Q#yO~P'vO{#{O!x$QO%z#|O#g!yX%[!yX%_!yX~OV#xOo0cOv0qO#g#SX%[#SX%_#SX~P'vOo0cOv0qO#g#WX%[#WX%_#WX~P'vOh$WO%uWO~O!f$YO!r$YO%uWO~OV$eO~P'vO!U$gO#s$hO#u$iO~O{$jO~OV$qO~P'vOS$sO%[$rO%_$rO%c$tO~OV$}Oa$}Og%POo0cOv0qO~P'vOo0cOv0qO{%SO~P'vO&Y%UO~Oa!bOh!iO!X!kO!f!mOVba_bakbalbambanbaobapbasbazba{ba!xba#gba%[ba%_ba%jba%kba%lba%mba%nba%oba%pba%qba%rba%sba%zbagba!Tba!Uba%{ba!Wba![ba!Qba#[batba!mba~On%ZO~Oo%ZO~P'vOo0cO~P'vOk0eOl0fOm0dOn0dOo0mOp0nOs0rOg%wX!T%wX!U%wX%{%wX!W%wX![%wX!Q%wX#[%wX!m%wX~P)pO%{%]Og%vXz%vX!T%vX!U%vX!W%vX{%vX~Og%_Oz%`O!T%dO!U%cO~Og%_O~Oz%gO!T%dO!U%cO!W&SX~O!W%kO~Oz%lO{%nO!T%dO!U%cO![%}X~O![%rO~O![%sO~OQ#XO%`#XO%a%uO~OV%wOo0cOv0qO!PrO~P'vOQ#^OR#[O%`#^O%a%zO~OV!qa_!qaa!qah!qak!qal!qam!qan!qao!qap!qas!qaz!qa{!qa!X!qa!f!qa!x!qa#g!qa%[!qa%_!qa%j!qa%k!qa%l!qa%m!qa%n!qa%o!qa%p!qa%q!qa%r!qa%s!qa%z!qag!qa!T!qa!U!qa%{!qa!W!qa![!qa!Q!qa#[!qat!qa!m!qa~P#yOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P%SOV&OOopOvqO{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P'vOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#g$zX%[$zX%_$zX~P'vO#g#gO%[&TO%_&TO~O!f&UOh&sX%[&sXz&sX#[&sX#g&sX%_&sX#Z&sXg&sX~Oh!iO%[&WO~Okealeameaneaoeapeaseazea{ea!xea#gea%[ea%_ea%zeagea!Tea!Uea%{ea!Wea![ea!Qea#[eatea!mea~P%SOsqazqa{qa#gqa%[qa%_qa%zqa~Ok!pOl!qOm!oOn!oOo!rOp!sO!xqa~PEcO%z&YOz%yX{%yX~O%uWOz%yX{%yX~Oz&]O{wX~O{&_O~Oz%lO#g%}X%[%}X%_%}Xg%}X{%}X![%}X!m%}X%z%}X~OV0lOo0cOv0qO!PrO~P'vO%z#|O#gUa%[Ua%_Ua~Oz&hO#g&PX%[&PX%_&PXn&PX~P%SOz&kO!Q&jO#g#Wa%[#Wa%_#Wa~Oz&lO#[&nO#g&rX%[&rX%_&rXg&rX~O!f$YO!r$YO#Z&qO%uWO~O#Z&qO~Oz&sO#g&tX%[&tX%_&tX~Oz&uO#g&pX%[&pX%_&pX{&pX~O!X&wO%z&xO~Oz&|On&wX~P%SOn'PO~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO%['UO~P'vOt'YO#p'WO#q'XOP#naV#naf#nah#nao#nas#nav#na!P#na!Q#na!T#na!U#na!X#na!]#na!h#na!r#na!s#na!t#na!{#na!}#na#P#na#R#na#T#na#X#na#Z#na#^#na#_#na#a#na#c#na#l#na#o#na#s#na#u#na#z#na#}#na$P#na%X#na%o#na%p#na%t#na%u#na&Z#na&[#na&]#na&^#na&_#na&`#na&a#na&b#na&c#na&d#na&e#na&f#na&g#na&h#na&i#na&j#na%Z#na%_#na~Oz'ZO#[']O{&xX~Oh'_O!X&wO~Oh!iO{$jO!X&wO~O{'eO~P%SO%['hO%_'hO~OS'iO%['hO%_'hO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%k!]O~P!#uO%kWi~P!#uOV!aO_!aOa!bOh!iO!X!kO!f!mO%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%m!_O%n!_O~P!&pO%mWi%nWi~P!&pOa!bOh!iO!X!kO!f!mOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%mWi%nWi%oWi%pWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~OV!aO_!aO%q!aO%r!aO%s!aO~P!)nOVWi_Wi%qWi%rWi%sWi~P!)nO!T%dO!U%cOg&VXz&VX~O%z'kO%{'kO~P,eOz'mOg&UX~Og'oO~Oz'pO{'rO!W&XX~Oo0cOv0qOz'pO{'sO!W&XX~P'vO!W'uO~Om!oOn!oOo!rOp!sOkjisjizji{ji!xji#gji%[ji%_ji%zji~Ol!qO~P!.aOlji~P!.aOk0eOl0fOm0dOn0dOo0mOp0nO~Ot'wO~P!/jOV'|Og'}Oo0cOv0qO~P'vOg'}Oz(OO~Og(QO~O!U(SO~Og(TOz(OO!T%dO!U%cO~P%SOk0eOl0fOm0dOn0dOo0mOp0nOgqa!Tqa!Uqa%{qa!Wqa![qa!Qqa#[qatqa!mqa~PEcOV'|Oo0cOv0qO!W&Sa~P'vOz(WO!W&Sa~O!W(XO~Oz(WO!T%dO!U%cO!W&Sa~P%SOV(]Oo0cOv0qO![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~P'vOz(^O![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~O![(aO~Oz(^O!T%dO!U%cO![%}a~P%SOz(dO!T%dO!U%cO![&Ta~P%SOz(gO{&lX![&lX!m&lX%z&lX~O{(kO![(mO!m(nO%z(jO~OV&OOopOvqO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~P'vOz(pO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~O!f&UOh&sa%[&saz&sa#[&sa#g&sa%_&sa#Z&sag&sa~O%[(uO~OV#sOa#tO%uWO~Oz&]O{wa~OopOvqO~P'vOz(^O#g%}a%[%}a%_%}ag%}a{%}a![%}a!m%}a%z%}a~P%SOz(zO#g%hX%[%hX%_%hX%z%hX~O%z#|O#gUi%[Ui%_Ui~O#g&Pa%[&Pa%_&Pan&Pa~P'vOz(}O#g&Pa%[&Pa%_&Pan&Pa~O%uWO#g&ra%[&ra%_&rag&ra~Oz)SO#g&ra%[&ra%_&rag&ra~Og)VO~OV)WOh$WO%uWO~O#Z)XO~O%uWO#g&ta%[&ta%_&ta~Oz)ZO#g&ta%[&ta%_&ta~Oo0cOv0qO#g&pa%[&pa%_&pa{&pa~P'vOz)^O#g&pa%[&pa%_&pa{&pa~OV)`Oa)`O%uWO~O%z)eO~Ot)hO#j)gOP#hiV#hif#hih#hio#his#hiv#hi!P#hi!Q#hi!T#hi!U#hi!X#hi!]#hi!h#hi!r#hi!s#hi!t#hi!{#hi!}#hi#P#hi#R#hi#T#hi#X#hi#Z#hi#^#hi#_#hi#a#hi#c#hi#l#hi#o#hi#s#hi#u#hi#z#hi#}#hi$P#hi%X#hi%o#hi%p#hi%t#hi%u#hi&Z#hi&[#hi&]#hi&^#hi&_#hi&`#hi&a#hi&b#hi&c#hi&d#hi&e#hi&f#hi&g#hi&h#hi&i#hi&j#hi%Z#hi%_#hi~Ot)iOP#kiV#kif#kih#kio#kis#kiv#ki!P#ki!Q#ki!T#ki!U#ki!X#ki!]#ki!h#ki!r#ki!s#ki!t#ki!{#ki!}#ki#P#ki#R#ki#T#ki#X#ki#Z#ki#^#ki#_#ki#a#ki#c#ki#l#ki#o#ki#s#ki#u#ki#z#ki#}#ki$P#ki%X#ki%o#ki%p#ki%t#ki%u#ki&Z#ki&[#ki&]#ki&^#ki&_#ki&`#ki&a#ki&b#ki&c#ki&d#ki&e#ki&f#ki&g#ki&h#ki&i#ki&j#ki%Z#ki%_#ki~OV)kOn&wa~P'vOz)lOn&wa~Oz)lOn&wa~P%SOn)pO~O%Y)tO~Ot)wO#p'WO#q)vOP#niV#nif#nih#nio#nis#niv#ni!P#ni!Q#ni!T#ni!U#ni!X#ni!]#ni!h#ni!r#ni!s#ni!t#ni!{#ni!}#ni#P#ni#R#ni#T#ni#X#ni#Z#ni#^#ni#_#ni#a#ni#c#ni#l#ni#o#ni#s#ni#u#ni#z#ni#}#ni$P#ni%X#ni%o#ni%p#ni%t#ni%u#ni&Z#ni&[#ni&]#ni&^#ni&_#ni&`#ni&a#ni&b#ni&c#ni&d#ni&e#ni&f#ni&g#ni&h#ni&i#ni&j#ni%Z#ni%_#ni~OV)zOo0cOv0qO{$jO~P'vOo0cOv0qO{&xa~P'vOz*OO{&xa~OV*SOa*TOg*WO%q*UO%uWO~O{$jO&{*YO~Oh'_O~Oh!iO{$jO~O%[*_O~O%[*aO%_*aO~OV$}Oa$}Oo0cOv0qOg&Ua~P'vOz*dOg&Ua~Oo0cOv0qO{*gO!W&Xa~P'vOz*hO!W&Xa~Oo0cOv0qOz*hO{*kO!W&Xa~P'vOo0cOv0qOz*hO!W&Xa~P'vOz*hO{*kO!W&Xa~Om0dOn0dOo0mOp0nOgjikjisjizji!Tji!Uji%{ji!Wji{ji![ji#gji%[ji%_ji!Qji#[jitji!mji%zji~Ol0fO~P!NkOlji~P!NkOV'|Og*pOo0cOv0qO~P'vOn*rO~Og*pOz*tO~Og*uO~OV'|Oo0cOv0qO!W&Si~P'vOz*vO!W&Si~O!W*wO~OV(]Oo0cOv0qO![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~P'vOz*zO!T%dO!U%cO![&Ti~Oz*}O![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~O![+OO~Oa+QOo0cOv0qO![&Ti~P'vOz*zO![&Ti~O![+SO~OV+UOo0cOv0qO{&la![&la!m&la%z&la~P'vOz+VO{&la![&la!m&la%z&la~O!]+YO&n+[O![!nX~O![+^O~O{(kO![+_O~O{(kO![+_O!m+`O~OV&OOopOvqO{%hq!x%hq#g%hq%[%hq%_%hq%z%hq~P'vOz$ri{$ri!x$ri#g$ri%[$ri%_$ri%z$ri~P%SOV&OOopOvqO~P'vOV&OOo0cOv0qO#g%ha%[%ha%_%ha%z%ha~P'vOz+aO#g%ha%[%ha%_%ha%z%ha~Oz$ia#g$ia%[$ia%_$ian$ia~P%SO#g&Pi%[&Pi%_&Pin&Pi~P'vOz+dO#g#Wq%[#Wq%_#Wq~O#[+eOz$va#g$va%[$va%_$vag$va~O%uWO#g&ri%[&ri%_&rig&ri~Oz+gO#g&ri%[&ri%_&rig&ri~OV+iOh$WO%uWO~O%uWO#g&ti%[&ti%_&ti~Oo0cOv0qO#g&pi%[&pi%_&pi{&pi~P'vO{#{Oz#eX!W#eX~Oz+mO!W&uX~O!W+oO~Ot+rO#j)gOP#hqV#hqf#hqh#hqo#hqs#hqv#hq!P#hq!Q#hq!T#hq!U#hq!X#hq!]#hq!h#hq!r#hq!s#hq!t#hq!{#hq!}#hq#P#hq#R#hq#T#hq#X#hq#Z#hq#^#hq#_#hq#a#hq#c#hq#l#hq#o#hq#s#hq#u#hq#z#hq#}#hq$P#hq%X#hq%o#hq%p#hq%t#hq%u#hq&Z#hq&[#hq&]#hq&^#hq&_#hq&`#hq&a#hq&b#hq&c#hq&d#hq&e#hq&f#hq&g#hq&h#hq&i#hq&j#hq%Z#hq%_#hq~On$|az$|a~P%SOV)kOn&wi~P'vOz+yOn&wi~Oz,TO{$jO#[,TO~O#q,VOP#nqV#nqf#nqh#nqo#nqs#nqv#nq!P#nq!Q#nq!T#nq!U#nq!X#nq!]#nq!h#nq!r#nq!s#nq!t#nq!{#nq!}#nq#P#nq#R#nq#T#nq#X#nq#Z#nq#^#nq#_#nq#a#nq#c#nq#l#nq#o#nq#s#nq#u#nq#z#nq#}#nq$P#nq%X#nq%o#nq%p#nq%t#nq%u#nq&Z#nq&[#nq&]#nq&^#nq&_#nq&`#nq&a#nq&b#nq&c#nq&d#nq&e#nq&f#nq&g#nq&h#nq&i#nq&j#nq%Z#nq%_#nq~O#[,WOz%Oa{%Oa~Oo0cOv0qO{&xi~P'vOz,YO{&xi~O{#{O%z,[Og&zXz&zX~O%uWOg&zXz&zX~Oz,`Og&yX~Og,bO~O%Y,eO~O!T%dO!U%cOg&Viz&Vi~OV$}Oa$}Oo0cOv0qOg&Ui~P'vO{,hOz$la!W$la~Oo0cOv0qO{,iOz$la!W$la~P'vOo0cOv0qO{*gO!W&Xi~P'vOz,lO!W&Xi~Oo0cOv0qOz,lO!W&Xi~P'vOz,lO{,oO!W&Xi~Og$hiz$hi!W$hi~P%SOV'|Oo0cOv0qO~P'vOn,qO~OV'|Og,rOo0cOv0qO~P'vOV'|Oo0cOv0qO!W&Sq~P'vOz$gi![$gi#g$gi%[$gi%_$gig$gi{$gi!m$gi%z$gi~P%SOV(]Oo0cOv0qO~P'vOa+QOo0cOv0qO![&Tq~P'vOz,sO![&Tq~O![,tO~OV(]Oo0cOv0qO![%}q#g%}q%[%}q%_%}qg%}q{%}q!m%}q%z%}q~P'vO{,uO~OV+UOo0cOv0qO{&li![&li!m&li%z&li~P'vOz,zO{&li![&li!m&li%z&li~O!]+YO&n+[O![!na~O{(kO![,}O~OV&OOo0cOv0qO#g%hi%[%hi%_%hi%z%hi~P'vOz-OO#g%hi%[%hi%_%hi%z%hi~O%uWO#g&rq%[&rq%_&rqg&rq~Oz-RO#g&rq%[&rq%_&rqg&rq~OV)`Oa)`O%uWO!W&ua~Oz-TO!W&ua~On$|iz$|i~P%SOV)kO~P'vOV)kOn&wq~P'vOt-XOP#myV#myf#myh#myo#mys#myv#my!P#my!Q#my!T#my!U#my!X#my!]#my!h#my!r#my!s#my!t#my!{#my!}#my#P#my#R#my#T#my#X#my#Z#my#^#my#_#my#a#my#c#my#l#my#o#my#s#my#u#my#z#my#}#my$P#my%X#my%o#my%p#my%t#my%u#my&Z#my&[#my&]#my&^#my&_#my&`#my&a#my&b#my&c#my&d#my&e#my&f#my&g#my&h#my&i#my&j#my%Z#my%_#my~O%Z-]O%_-]O~P`O#q-^OP#nyV#nyf#nyh#nyo#nys#nyv#ny!P#ny!Q#ny!T#ny!U#ny!X#ny!]#ny!h#ny!r#ny!s#ny!t#ny!{#ny!}#ny#P#ny#R#ny#T#ny#X#ny#Z#ny#^#ny#_#ny#a#ny#c#ny#l#ny#o#ny#s#ny#u#ny#z#ny#}#ny$P#ny%X#ny%o#ny%p#ny%t#ny%u#ny&Z#ny&[#ny&]#ny&^#ny&_#ny&`#ny&a#ny&b#ny&c#ny&d#ny&e#ny&f#ny&g#ny&h#ny&i#ny&j#ny%Z#ny%_#ny~Oz-aO{$jO#[-aO~Oo0cOv0qO{&xq~P'vOz-dO{&xq~O%z,[Og&zaz&za~O{#{Og&zaz&za~OV*SOa*TO%q*UO%uWOg&ya~Oz-hOg&ya~O$S-lO~OV$}Oa$}Oo0cOv0qO~P'vOo0cOv0qO{-mOz$li!W$li~P'vOo0cOv0qOz$li!W$li~P'vO{-mOz$li!W$li~Oo0cOv0qO{*gO~P'vOo0cOv0qO{*gO!W&Xq~P'vOz-pO!W&Xq~Oo0cOv0qOz-pO!W&Xq~P'vOs-sO!T%dO!U%cOg&Oq!W&Oq![&Oqz&Oq~P!/jOa+QOo0cOv0qO![&Ty~P'vOz$ji![$ji~P%SOa+QOo0cOv0qO~P'vOV+UOo0cOv0qO~P'vOV+UOo0cOv0qO{&lq![&lq!m&lq%z&lq~P'vO{(kO![-xO!m-yO%z-wO~OV&OOo0cOv0qO#g%hq%[%hq%_%hq%z%hq~P'vO%uWO#g&ry%[&ry%_&ryg&ry~OV)`Oa)`O%uWO!W&ui~Ot-}OP#m!RV#m!Rf#m!Rh#m!Ro#m!Rs#m!Rv#m!R!P#m!R!Q#m!R!T#m!R!U#m!R!X#m!R!]#m!R!h#m!R!r#m!R!s#m!R!t#m!R!{#m!R!}#m!R#P#m!R#R#m!R#T#m!R#X#m!R#Z#m!R#^#m!R#_#m!R#a#m!R#c#m!R#l#m!R#o#m!R#s#m!R#u#m!R#z#m!R#}#m!R$P#m!R%X#m!R%o#m!R%p#m!R%t#m!R%u#m!R&Z#m!R&[#m!R&]#m!R&^#m!R&_#m!R&`#m!R&a#m!R&b#m!R&c#m!R&d#m!R&e#m!R&f#m!R&g#m!R&h#m!R&i#m!R&j#m!R%Z#m!R%_#m!R~Oo0cOv0qO{&xy~P'vOV*SOa*TO%q*UO%uWOg&yi~O$S-lO%Z.VO%_.VO~OV.aOh._O!X.^O!].`O!h.YO!s.[O!t.[O%p.XO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O~Oo0cOv0qOz$lq!W$lq~P'vO{.fOz$lq!W$lq~Oo0cOv0qO{*gO!W&Xy~P'vOz.gO!W&Xy~Oo0cOv.kO~P'vOs-sO!T%dO!U%cOg&Oy!W&Oy![&Oyz&Oy~P!/jO{(kO![.nO~O{(kO![.nO!m.oO~OV*SOa*TO%q*UO%uWO~Oh.tO!f.rOz$TX#[$TX%j$TXg$TX~Os$TX{$TX!W$TX![$TX~P$-bO%o.vO%p.vOs$UXz$UX{$UX#[$UX%j$UX!W$UXg$UX![$UX~O!h.xO~Oz.|O#[/OO%j.yOs&|X{&|X!W&|Xg&|X~Oa/RO~P$)zOh.tOs&}Xz&}X{&}X#[&}X%j&}X!W&}Xg&}X![&}X~Os/VO{$jO~Oo0cOv0qOz$ly!W$ly~P'vOo0cOv0qO{*gO!W&X!R~P'vOz/ZO!W&X!R~Og&RXs&RX!T&RX!U&RX!W&RX![&RXz&RX~P!/jOs-sO!T%dO!U%cOg&Qa!W&Qa![&Qaz&Qa~O{(kO![/^O~O!f.rOh$[as$[az$[a{$[a#[$[a%j$[a!W$[ag$[a![$[a~O!h/eO~O%o.vO%p.vOs$Uaz$Ua{$Ua#[$Ua%j$Ua!W$Uag$Ua![$Ua~O%j.yOs$Yaz$Ya{$Ya#[$Ya!W$Yag$Ya![$Ya~Os&|a{&|a!W&|ag&|a~P$)nOz/jOs&|a{&|a!W&|ag&|a~O!W/mO~Og/mO~O{/oO~O![/pO~Oo0cOv0qO{*gO!W&X!Z~P'vO{/sO~O%z/tO~P$-bOz/uO#[/OO%j.yOg'PX~Oz/uOg'PX~Og/wO~O!h/xO~O#[/OOs%Saz%Sa{%Sa%j%Sa!W%Sag%Sa![%Sa~O#[/OO%j.yOs%Waz%Wa{%Wa!W%Wag%Wa~Os&|i{&|i!W&|ig&|i~P$)nOz/zO#[/OO%j.yO!['Oa~Og'Pa~P$)nOz0SOg'Pa~Oa0UO!['Oi~P$)zOz0WO!['Oi~Oz0WO#[/OO%j.yO!['Oi~O#[/OO%j.yOg$biz$bi~O%z0ZO~P$-bO#[/OO%j.yOg%Vaz%Va~Og'Pi~P$)nO{0^O~Oa0UO!['Oq~P$)zOz0`O!['Oq~O#[/OO%j.yOz%Ui![%Ui~Oa0UO~P$)zOa0UO!['Oy~P$)zO#[/OO%j.yOg$ciz$ci~O#[/OO%j.yOz%Uq![%Uq~Oz+aO#g%ha%[%ha%_%ha%z%ha~P%SOV&OOo0cOv0qO~P'vOn0hO~Oo0hO~P'vO{0iO~Ot0jO~P!/jO&]&Z&j&h&i&g&f&d&e&c&b&`&a&_&^&[%u~",goto:"!=j'QPPPPPP'RP'Z*s+[+t,_,y-fP.SP'Z.r.r'ZPPP'Z2[PPPPPP2[5PPP5PP7b7k=sPP=v>h>kPP'Z'ZPP>zPP'Z'ZPP'Z'Z'Z'Z'Z?O?w'ZP?zP@QDXGuGyPG|HWH['ZPPPH_Hk'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPHqH}IVPI^IdPI^PI^I^PPPI^PKrPK{LVL]KrPI^LfPI^PLmLsPLwM]MzNeLwLwNkNxLwLwLwLw! ^! d! g! l! o! y!!P!!]!!o!!u!#P!#V!#s!#y!$P!$Z!$a!$g!$y!%T!%Z!%a!%k!%q!%w!%}!&T!&Z!&e!&k!&u!&{!'U!'[!'k!'s!'}!(UPPPPPPPPPPP!([!(_!(e!(n!(x!)TPPPPPPPPPPPP!-u!/Z!3^!6oPP!6w!7W!7a!8Y!8P!8c!8i!8l!8o!8r!8z!9jPPPPPPPPPPPPPPPPP!9m!9q!9wP!:]!:a!:m!:v!;S!;j!;m!;p!;v!;|!_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To+PZS_&n`OY*xYZ%TZ]*x]^%T^#o*x#o#p+r#p#q*x#q#r+r#r;'S*x;'S;=`,^<%lO*x_+wTS_OY+rZ]+r^;'S+r;'S;=`,W<%lO+r_,ZP;=`<%l+ro,aP;=`<%l*xj,kV%rQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-XT!xY&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-oV%lQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.]V&n`&ZZOw%Twx.rx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.wV&n`Ow%Twx/^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/eT&n`&]ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/{ThZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc0cTgR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk0yXVZ&n`Oz%Tz{1f{!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk1mVaR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk2ZV%oZ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc2wTzR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To3_W%pZ&n`O!_%T!_!`-Q!`!a3w!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Td4OT&{S&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk4fX!fQ&n`O!O%T!O!P5R!P!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5WV&n`O!O%T!O!P5m!P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5tT!rZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti6[a!hX&n`O!Q%T!Q![6T![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S6T#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti7fZ&n`O{%T{|8X|}%T}!O8X!O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8^V&n`O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8z]!hX&n`O!Q%T!Q![8s![!l%T!l!m9s!m#R%T#R#S8s#S#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti9zT!hX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk:bX%qR&n`O!P%T!P!Q:}!Q!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj;UV%sQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti;ro!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!d%T!d!e?q!e!g%T!g!h7a!h!l%T!l!m9s!m!q%T!q!rA]!r!z%T!z!{Bq!{#R%T#R#S>_#S#U%T#U#V?q#V#X%T#X#Y7a#Y#^%T#^#_9s#_#c%T#c#dA]#d#l%T#l#mBq#m#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti=xV&n`O!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti>fc!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S>_#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti?vY&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti@mY!hX&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiAbX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBUX!hX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBv]&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiCv]!hX&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToDvV{_&n`O!_%T!_!`E]!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TcEdT%{R&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkEzT#gZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkFbXmR&n`O!^%T!^!_F}!_!`([!`!a([!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjGUV%mQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkGrV%zZ&n`O!_%T!_!`([!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkH`WmR&n`O!_%T!_!`([!`!aHx!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjIPV%nQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkIoV_Q#}P&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToJ_]&n`&YS%uZO!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoKZP;=`<%lJUoKge&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!tJU!t!uLx!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#gLx#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoMRa&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUkN_V&n`&`ZOr%TrsNts#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkNyV&n`Or%Trs! `s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! gT&n`&bZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! }V&n`&_ZOw%Twx!!dx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!!iV&n`Ow%Twx!#Ox#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!#VT&n`&aZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!#oe&n`&YS%uZOr%Trs!%Qsw%Twx!&px!Q%T!Q![JU![!c%T!c!tJU!t!u!(`!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#g!(`#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!%XV&n`&dZOr%Trs!%ns#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!%sV&n`Or%Trs!&Ys#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&aT&n`&fZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&wV&n`&cZOw%Twx!'^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!'cV&n`Ow%Twx!'xx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!(PT&n`&eZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!(ia&n`&YS%uZOr%Trs!)nsw%Twx!+^x!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!)uV&n`&hZOr%Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[C6t,k6t,w6t,A6t,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:e=>j6t[e]||-1}],tokenPrec:7668}),Nse=new Mq,m6e=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function aj(e){return(t,n,i)=>{if(i)return!1;let r=t.node.getChild("VariableName");return r&&n(r,e),!0}}const R6t={FunctionDefinition:aj("function"),ClassDefinition:aj("class"),ForStatement(e,t,n){if(n){for(let i=e.node.firstChild;i;i=i.nextSibling)if(i.name=="VariableName")t(i,"variable");else if(i.name=="in")break}},ImportStatement(e,t){var n,i;let{node:r}=e,s=((n=r.firstChild)===null||n===void 0?void 0:n.name)=="from";for(let o=r.getChild("import");o;o=o.nextSibling)o.name=="VariableName"&&((i=o.nextSibling)===null||i===void 0?void 0:i.name)!="as"&&t(o,s?"variable":"namespace")},AssignStatement(e,t){for(let n=e.node.firstChild;n;n=n.nextSibling)if(n.name=="VariableName")t(n,"variable");else if(n.name==":"||n.name=="AssignOp")break},ParamList(e,t){for(let n=null,i=e.node.firstChild;i;i=i.nextSibling)i.name=="VariableName"&&(!n||!/\*|AssignOp/.test(n.name))&&t(i,"variable"),n=i},CapturePattern:aj("variable"),AsPattern:aj("variable"),__proto__:null};function g6e(e,t){let n=Nse.get(t);if(n)return n;let i=[],r=!0;function s(o,l){let c=e.sliceString(o.from,o.to);i.push({label:c,type:l})}return t.cursor(Ar.IncludeAnonymous).iterate(o=>{if(o.name){let l=R6t[o.name];if(l&&l(o,s,r)||!r&&m6e.has(o.name))return!1;r=!1}else if(o.to-o.from>8192){for(let l of g6e(e,o.node))i.push(l);return!1}}),Nse.set(t,i),i}const Rse=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,b6e=["String","FormatString","Comment","PropertyName"];function I6t(e){let t=es(e.state).resolveInner(e.pos,-1);if(b6e.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&Rse.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let i=[];for(let r=t;r;r=r.parent)m6e.has(r.name)&&(i=i.concat(g6e(e.state.doc,r)));return{options:i,from:n?t.from:e.pos,validFor:Rse}}const P6t=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(e=>({label:e,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(e=>({label:e,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(e=>({label:e,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(e=>({label:e,type:"function"}))),D6t=[Xs("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),Xs("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),Xs("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),Xs("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),Xs(`if \${}: +`);i=r<0?n:n.slice(0,r)}return t+i.length>this.to?i.slice(0,this.to-t):i}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(t,n,i=0){this.block=sP.create(t,i,this.lineStart+n,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(t,n,i=0){this.startContext(this.parser.getNodeType(t),n,i)}addNode(t,n,i){typeof t=="number"&&(t=new Hi(this.parser.nodeSet.types[t],y1,y1,(i??this.prevLineEnd())-n)),this.block.addChild(t,n-this.block.from)}addElement(t){this.block.addChild(t.toTree(this.parser.nodeSet),t.from-this.block.from)}addLeafElement(t,n){this.addNode(this.buffer.writeElements(d7(n.children,t.marks),-n.from).finish(n.type,n.to-n.from),n.from)}finishContext(){let t=this.stack.pop(),n=this.stack[this.stack.length-1];n.addChild(t.toTree(this.parser.nodeSet),t.from-n.from),this.block=n}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(t){return this.ranges.length>1?k$e(this.ranges,0,t.topNode,this.ranges[0].from,this.reusePlaceholders):t}finishLeaf(t){for(let i of t.parsers)if(i.finish(this,t))return;let n=d7(this.parser.parseInline(t.content,t.start),t.marks);this.addNode(this.buffer.writeElements(n,-t.start).finish(Gt.Paragraph,t.content.length),t.start)}elt(t,n,i,r){return typeof t=="string"?mr(this.parser.getNodeType(t),n,i,r):new E$e(t,n)}get buffer(){return new S$e(this.parser.nodeSet)}}function k$e(e,t,n,i,r){let s=e[t].to,o=[],l=[],c=n.from+i;function u(d,f){for(;f?d>=s:d>s;){let h=e[t+1].from-s;i+=h,d+=h,t++,s=e[t].to}}for(let d=n.firstChild;d;d=d.nextSibling){u(d.from+i,!0);let f=d.from+i,h,m=r.get(d.tree);m?h=m:d.to+i>s?(h=k$e(e,t,d,i,r),u(d.to+i,!1)):h=d.toTree(),o.push(h),l.push(f-c)}return u(n.to+i,!1),new Hi(n.type,o,l,n.to+i-c,n.tree?n.tree.propValues:void 0)}class rL extends HM{constructor(t,n,i,r,s,o,l,c,u){super(),this.nodeSet=t,this.blockParsers=n,this.leafBlockParsers=i,this.blockNames=r,this.endLeafBlock=s,this.skipContextMarkup=o,this.inlineParsers=l,this.inlineNames=c,this.wrappers=u,this.nodeTypes=Object.create(null);for(let d of t.types)this.nodeTypes[d.name]=d.id}createParse(t,n,i){let r=new d3t(this,t,n,i);for(let s of this.wrappers)r=s(r,t,n,i);return r}configure(t){let n=u7(t);if(!n)return this;let{nodeSet:i,skipContextMarkup:r}=this,s=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),l=this.blockNames.slice(),c=this.inlineParsers.slice(),u=this.inlineNames.slice(),d=this.endLeafBlock.slice(),f=this.wrappers;if(jO(n.defineNodes)){r=Object.assign({},r);let h=i.types.slice(),m;for(let g of n.defineNodes){let{name:b,block:v,composite:y,style:w}=typeof g=="string"?{name:g}:g;if(h.some(S=>S.name==b))continue;y&&(r[h.length]=(S,O,A)=>y(O,A,S.value));let x=h.length,k=y?["Block","BlockContext"]:v?x>=Gt.ATXHeading1&&x<=Gt.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;h.push(Ja.define({id:x,name:b,props:k&&[[li.group,k]]})),w&&(m||(m={}),Array.isArray(w)||w instanceof Xf?m[b]=w:Object.assign(m,w))}i=new mk(h),m&&(i=i.extend(vm(m)))}if(jO(n.props)&&(i=i.extend(...n.props)),jO(n.remove))for(let h of n.remove){let m=this.blockNames.indexOf(h),g=this.inlineNames.indexOf(h);m>-1&&(s[m]=o[m]=void 0),g>-1&&(c[g]=void 0)}if(jO(n.parseBlock))for(let h of n.parseBlock){let m=l.indexOf(h.name);if(m>-1)s[m]=h.parse,o[m]=h.leaf;else{let g=h.before?sj(l,h.before):h.after?sj(l,h.after)+1:l.length-1;s.splice(g,0,h.parse),o.splice(g,0,h.leaf),l.splice(g,0,h.name)}h.endLeaf&&d.push(h.endLeaf)}if(jO(n.parseInline))for(let h of n.parseInline){let m=u.indexOf(h.name);if(m>-1)c[m]=h.parse;else{let g=h.before?sj(u,h.before):h.after?sj(u,h.after)+1:u.length-1;c.splice(g,0,h.parse),u.splice(g,0,h.name)}}return n.wrap&&(f=f.concat(n.wrap)),new rL(i,s,o,l,d,r,c,u,f)}getNodeType(t){let n=this.nodeTypes[t];if(n==null)throw new RangeError(`Unknown node type '${t}'`);return n}parseInline(t,n){let i=new wW(this,t,n);e:for(let r=n;r=0){r=l;continue e}}r++}return i.resolveMarkers(0)}}function jO(e){return e!=null&&e.length>0}function u7(e){if(!Array.isArray(e))return e;if(e.length==0)return null;let t=u7(e[0]);if(e.length==1)return t;let n=u7(e.slice(1));if(!n||!t)return t||n;let i=(o,l)=>(o||y1).concat(l||y1),r=t.wrap,s=n.wrap;return{props:i(t.props,n.props),defineNodes:i(t.defineNodes,n.defineNodes),parseBlock:i(t.parseBlock,n.parseBlock),parseInline:i(t.parseInline,n.parseInline),remove:i(t.remove,n.remove),wrap:r?s?(o,l,c,u)=>r(s(o,l,c,u),l,c,u):r:s}}function sj(e,t){let n=e.indexOf(t);if(n<0)throw new RangeError(`Position specified relative to unknown parser ${t}`);return n}let O$e=[Ja.none];for(let e=1,t;t=Gt[e];e++)O$e[e]=Ja.define({id:e,name:t,props:e>=Gt.Escape?[]:[[li.group,e in f$e?["Block","BlockContext"]:["Block","LeafBlock"]]],top:t=="Document"});const y1=[];class S$e{constructor(t){this.nodeSet=t,this.content=[],this.nodes=[]}write(t,n,i,r=0){return this.content.push(t,n,i,4+r*4),this}writeElements(t,n=0){for(let i of t)i.writeTo(this,n);return this}finish(t,n){return Hi.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:t,length:n})}}let XC=class{constructor(t,n,i,r=y1){this.type=t,this.from=n,this.to=i,this.children=r}writeTo(t,n){let i=t.content.length;t.writeElements(this.children,n),t.content.push(this.type,this.from+n,this.to+n,t.content.length+4-i)}toTree(t){return new S$e(t).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class E$e{constructor(t,n){this.tree=t,this.from=n}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return y1}writeTo(t,n){t.nodes.push(this.tree),t.content.push(t.nodes.length-1,this.from+n,this.to+n,-1)}toTree(){return this.tree}}function mr(e,t,n,i){return new XC(e,t,n,i)}const C$e={resolve:"Emphasis",mark:"EmphasisMark"},A$e={resolve:"Emphasis",mark:"EmphasisMark"},yy={},aP={};class gu{constructor(t,n,i,r){this.type=t,this.from=n,this.to=i,this.side=r}}const Jre="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let YC=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{YC=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const w$={Escape(e,t,n){if(t!=92||n==e.end-1)return-1;let i=e.char(n+1);for(let r=0;r]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(i);if(r)return e.append(mr(Gt.Autolink,n,n+1+r[0].length,[mr(Gt.LinkMark,n,n+1),mr(Gt.URL,n+1,n+r[0].length),mr(Gt.LinkMark,n+r[0].length,n+1+r[0].length)]));let s=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(i);if(s)return e.append(mr(Gt.Comment,n,n+1+s[0].length));let o=/^\?[^]*?\?>/.exec(i);if(o)return e.append(mr(Gt.ProcessingInstruction,n,n+1+o[0].length));let l=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(i);return l?e.append(mr(Gt.HTMLTag,n,n+1+l[0].length)):-1},Emphasis(e,t,n){if(t!=95&&t!=42)return-1;let i=n+1;for(;e.char(i)==t;)i++;let r=e.slice(n-1,n),s=e.slice(i,i+1),o=YC.test(r),l=YC.test(s),c=/\s|^$/.test(r),u=/\s|^$/.test(s),d=!u&&(!l||c||o),f=!c&&(!o||u||l),h=d&&(t==42||!f||o),m=f&&(t==42||!d||l);return e.append(new gu(t==95?C$e:A$e,n,i,(h?1:0)|(m?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(mr(Gt.HardBreak,n,n+2));if(t==32){let i=n+1;for(;e.char(i)==32;)i++;if(e.char(i)==10&&i>=n+2)return e.append(mr(Gt.HardBreak,n,i+1))}return-1},Link(e,t,n){return t==91?e.append(new gu(yy,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new gu(aP,n,n+2,1)):-1},LinkEnd(e,t,n){if(t!=93)return-1;for(let i=e.parts.length-1;i>=0;i--){let r=e.parts[i];if(r instanceof gu&&(r.type==yy||r.type==aP)){if(!r.side||e.skipSpace(r.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[i]=null,-1;let s=e.takeContent(i),o=e.parts[i]=f3t(e,s,r.type==yy?Gt.Link:Gt.Image,r.from,n+1);if(r.type==yy)for(let l=0;lt?mr(Gt.URL,t+n,s+n):s==e.length?null:!1}}function _$e(e,t,n){let i=e.charCodeAt(t);if(i!=39&&i!=34&&i!=40)return!1;let r=i==40?41:i;for(let s=t+1,o=!1;s=this.end?-1:this.text.charCodeAt(t-this.offset)}get end(){return this.offset+this.text.length}slice(t,n){return this.text.slice(t-this.offset,n-this.offset)}append(t){return this.parts.push(t),t.to}addDelimiter(t,n,i,r,s){return this.append(new gu(t,n,i,(r?1:0)|(s?2:0)))}get hasOpenLink(){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof gu&&(n.type==yy||n.type==aP))return!0}return!1}addElement(t){return this.append(t)}resolveMarkers(t){for(let i=t;i=t;c--){let b=this.parts[c];if(b instanceof gu&&b.side&1&&b.type==r.type&&!(s&&(r.side&1||b.side&2)&&(b.to-b.from+o)%3==0&&((b.to-b.from)%3||o%3))){l=b;break}}if(!l)continue;let u=r.type.resolve,d=[],f=l.from,h=r.to;if(s){let b=Math.min(2,l.to-l.from,o);f=l.to-b,h=r.from+b,u=b==1?"Emphasis":"StrongEmphasis"}l.type.mark&&d.push(this.elt(l.type.mark,f,l.to));for(let b=c+1;b=0;n--){let i=this.parts[n];if(i instanceof gu&&i.type==t&&i.side&1)return n}return null}takeContent(t){let n=this.resolveMarkers(t);return this.parts.length=t,n}getDelimiterAt(t){let n=this.parts[t];return n instanceof gu?n:null}skipSpace(t){return TE(this.text,t-this.offset)+this.offset}elt(t,n,i,r){return typeof t=="string"?mr(this.parser.getNodeType(t),n,i,r):new E$e(t,n)}}wW.linkStart=yy;wW.imageStart=aP;function d7(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),i=0;for(let r of t){for(;i(t?t-1:0))return!1;if(this.fragmentEnd<0){let s=this.fragment.to;for(;s>0&&this.input.read(s-1,s)!=` +`;)s--;this.fragmentEnd=s?s-1:0}let i=this.cursor;i||(i=this.cursor=this.fragment.tree.cursor(),i.firstChild());let r=t+this.fragment.offset;for(;i.to<=r;)if(!i.parent())return!1;for(;;){if(i.from>=r)return this.fragment.from<=n;if(!i.childAfter(r))return!1}}matches(t){let n=this.cursor.tree;return n&&n.prop(li.contextHash)==t}takeNodes(t){let n=this.cursor,i=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),s=t.absoluteLineStart,o=s,l=t.block.children.length,c=o,u=l;for(;;){if(n.to-i>r){if(n.type.isAnonymous&&n.firstChild())continue;break}let d=N$e(n.from-i,t.ranges);if(n.to-i<=t.ranges[t.rangeI].to)t.addNode(n.tree,d);else{let f=new Hi(t.parser.nodeSet.types[Gt.Paragraph],[],[],0,t.block.hashProp);t.reusePlaceholders.set(f,n.tree),t.addNode(f,d)}if(n.type.is("Block")&&(h3t.indexOf(n.type.id)<0?(o=n.to-i,l=t.block.children.length):(o=c,l=u),c=n.to-i,u=t.block.children.length),!n.nextSibling())break}for(;t.block.children.length>l;)t.block.children.pop(),t.block.positions.pop();return o-s}}function N$e(e,t){let n=e;for(let i=1;irj[e]),Object.keys(rj).map(e=>w$e[e]),Object.keys(rj),c3t,f$e,Object.keys(w$).map(e=>w$[e]),Object.keys(w$),[]);function b3t(e,t,n){let i=[];for(let r=e.firstChild,s=t;;r=r.nextSibling){let o=r?r.from:n;if(o>s&&i.push({from:s,to:o}),!r)break;s=r.to}return i}function y3t(e){let{codeParser:t,htmlParser:n}=e;return{wrap:q5e((r,s)=>{let o=r.type.id;if(t&&(o==Gt.CodeBlock||o==Gt.FencedCode)){let l="";if(o==Gt.FencedCode){let u=r.node.getChild(Gt.CodeInfo);u&&(l=s.read(u.from,u.to))}let c=t(l);if(c)return{parser:c,overlay:u=>u.type.id==Gt.CodeText,bracketed:o==Gt.FencedCode}}else if(n&&(o==Gt.HTMLBlock||o==Gt.HTMLTag||o==Gt.CommentBlock))return{parser:n,overlay:b3t(r.node,r.from,r.to)};return null})}}const v3t={resolve:"Strikethrough",mark:"StrikethroughMark"},x3t={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":pe.strikethrough}},{name:"StrikethroughMark",style:pe.processingInstruction}],parseInline:[{name:"Strikethrough",parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let i=e.slice(n-1,n),r=e.slice(n+2,n+3),s=/\s|^$/.test(i),o=/\s|^$/.test(r),l=YC.test(i),c=YC.test(r);return e.addDelimiter(v3t,n,n+2,!o&&(!c||s||l),!s&&(!l||o||c))},after:"Emphasis"}]};function _E(e,t,n=0,i,r=0){let s=0,o=!0,l=-1,c=-1,u=!1,d=()=>{i.push(e.elt("TableCell",r+l,r+c,e.parser.parseInline(t.slice(l,c),r+l)))};for(let f=n;f-1)&&s++,o=!1,i&&(l>-1&&d(),i.push(e.elt("TableDelimiter",f+r,f+r+1))),l=c=-1):(u||h!=32&&h!=9)&&(l<0&&(l=f),c=f+1),u=!u&&h==92}return l>-1&&(s++,i&&d()),s}function ese(e,t){for(let n=t;n\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class tse{constructor(){this.rows=null}nextLine(t,n,i){if(this.rows==null){this.rows=!1;let r;if((n.next==45||n.next==58||n.next==124)&&R$e.test(r=n.text.slice(n.pos))){let s=[];_E(t,i.content,0,s,i.start)==_E(t,r,0)&&(this.rows=[t.elt("TableHeader",i.start,i.start+i.content.length,s),t.elt("TableDelimiter",t.lineStart+n.pos,t.lineStart+n.text.length)])}}else if(this.rows){let r=[];_E(t,n.text,n.pos,r,t.lineStart),this.rows.push(t.elt("TableRow",t.lineStart+n.pos,t.lineStart+n.text.length,r))}return!1}finish(t,n){return this.rows?(t.addLeafElement(n,t.elt("Table",n.start,n.start+n.content.length,this.rows)),!0):!1}}const w3t={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":pe.heading}},"TableRow",{name:"TableCell",style:pe.content},{name:"TableDelimiter",style:pe.processingInstruction}],parseBlock:[{name:"Table",leaf(e,t){return ese(t.content,0)?new tse:null},endLeaf(e,t,n){if(n.parsers.some(r=>r instanceof tse)||!ese(t.text,t.basePos))return!1;let i=e.peekLine();return R$e.test(i)&&_E(e,t.text,t.basePos)==_E(e,i,t.basePos)},before:"SetextHeading"}]};class k3t{nextLine(){return!1}finish(t,n){return t.addLeafElement(n,t.elt("Task",n.start,n.start+n.content.length,[t.elt("TaskMarker",n.start,n.start+3),...t.parser.parseInline(n.content.slice(3),n.start+3)])),!0}}const O3t={defineNodes:[{name:"Task",block:!0,style:pe.list},{name:"TaskMarker",style:pe.atom}],parseBlock:[{name:"TaskList",leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name=="ListItem"?new k3t:null},after:"SetextHeading"}]},nse=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,ise=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,S3t=/[\w-]+\.[\w-]+($|[/:])/,rse=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,sse=/\/[a-zA-Z\d@.]+/gy;function ase(e,t,n,i){let r=0;for(let s=t;s-1)return-1;let i=t+n[0].length;for(;;){let r=e[i-1],s;if(/[?!.,:*_~]/.test(r)||r==")"&&ase(e,t,i,")")>ase(e,t,i,"("))i--;else if(r==";"&&(s=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,i))))i=t+s.index;else break}return i}function ose(e,t){rse.lastIndex=t;let n=rse.exec(e);if(!n)return-1;let i=n[0][n[0].length-1];return i=="_"||i=="-"?-1:t+n[0].length-(i=="."?1:0)}const C3t={parseInline:[{name:"Autolink",parse(e,t,n){let i=n-e.offset;if(i&&/\w/.test(e.text[i-1]))return-1;nse.lastIndex=i;let r=nse.exec(e.text),s=-1;if(!r)return-1;if(r[1]||r[2]){if(s=E3t(e.text,i+r[0].length),s>-1&&e.hasOpenLink){let o=/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(i,s));s=i+o[0].length}}else r[3]?s=ose(e.text,i):(s=ose(e.text,i+r[0].length),s>-1&&r[0]=="xmpp:"&&(sse.lastIndex=s,r=sse.exec(e.text),r&&(s=r.index+r[0].length)));return s<0?-1:(e.addElement(e.elt("URL",n,s+e.offset)),s+e.offset)}}]},A3t=[w3t,O3t,x3t,C3t];function I$e(e,t,n){return(i,r,s)=>{if(r!=e||i.char(s+1)==e)return-1;let o=[i.elt(n,s,s+1)];for(let l=s+1;l=65&&e<=90||e==95||e>=97&&e<=122||e>=161}let dse=null,fse=null,hse=0;function h7(e,t){let n=e.pos+t;if(hse==n&&fse==e)return dse;let i=e.peek(t),r="";for(;e4t(i);)r+=String.fromCharCode(i),i=e.peek(++t);return fse=e,hse=n,dse=r?r.toLowerCase():i==t4t||i==n4t?void 0:null}const U$e=60,oP=62,OW=47,t4t=63,n4t=33,i4t=45;function pse(e,t){this.name=e,this.parent=t}const r4t=[kW,L$e,P$e,D$e,M$e],s4t=new nL({start:null,shift(e,t,n,i){return r4t.indexOf(t)>-1?new pse(h7(i,1)||"",e):e},reduce(e,t){return t==$$e&&e?e.parent:e},reuse(e,t,n,i){let r=t.type.id;return r==kW||r==K3t?new pse(h7(i,1)||"",e):e},strict:!1}),a4t=new Ma((e,t)=>{if(e.next!=U$e){e.next<0&&t.context&&e.acceptToken(k$);return}e.advance();let n=e.next==OW;n&&e.advance();let i=h7(e,0);if(i===void 0)return;if(!i)return e.acceptToken(n?Q3t:U3t);let r=t.context?t.context.name:null;if(n){if(i==r)return e.acceptToken($3t);if(r&&J3t[r])return e.acceptToken(k$,-2);if(t.dialectEnabled(X3t))return e.acceptToken(F3t);for(let s=t.context;s;s=s.parent)if(s.name==i)return;e.acceptToken(B3t)}else{if(i=="script")return e.acceptToken(P$e);if(i=="style")return e.acceptToken(D$e);if(i=="textarea")return e.acceptToken(M$e);if(Z3t.hasOwnProperty(i))return e.acceptToken(L$e);r&&use[r]&&use[r][i]?e.acceptToken(k$,-1):e.acceptToken(kW)}},{contextual:!0}),o4t=new Ma(e=>{for(let t=0,n=0;;n++){if(e.next<0){n&&e.acceptToken(cse);break}if(e.next==i4t)t++;else if(e.next==oP&&t>=2){n>=3&&e.acceptToken(cse,-2);break}else t=0;e.advance()}});function l4t(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const c4t=new Ma((e,t)=>{if(e.next==OW&&e.peek(1)==oP){let n=t.dialectEnabled(Y3t)||l4t(t.context);e.acceptToken(n?L3t:lse,2)}else e.next==oP&&e.acceptToken(lse,1)});function SW(e,t,n){let i=2+e.length;return new Ma(r=>{for(let s=0,o=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(t);break}if(s==0&&r.next==U$e||s==1&&r.next==OW||s>=2&&so?r.acceptToken(t,-o):r.acceptToken(n,-(o-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(t,1);break}else s=o=0;r.advance()}})}const u4t=SW("script",N3t,R3t),d4t=SW("style",I3t,P3t),f4t=SW("textarea",D3t,M3t),h4t=vm({"Text RawText IncompleteTag IncompleteCloseTag":pe.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":pe.angleBracket,TagName:pe.tagName,"MismatchedCloseTag/TagName":[pe.tagName,pe.invalid],AttributeName:pe.attributeName,"AttributeValue UnquotedAttributeValue":pe.attributeValue,Is:pe.definitionOperator,"EntityReference CharacterReference":pe.character,Comment:pe.blockComment,ProcessingInst:pe.processingInstruction,DoctypeDecl:pe.documentMeta}),p4t=om.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:",c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:s4t,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[h4t],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let u=l.type.id;if(u==H3t)return O$(l,c,n);if(u==q3t)return O$(l,c,i);if(u==W3t)return O$(l,c,r);if(u==$$e&&s.length){let d=l.node,f=d.firstChild,h=f&&mse(f,c),m;if(h){for(let g of s)if(g.tag==h&&(!g.attrs||g.attrs(m||(m=Q$e(f,c))))){let b=d.lastChild,v=b.type.id==G3t?b.from:d.to;if(v>f.to)return{parser:g.parser,overlay:[{from:f.to,to:v}]}}}}if(o&&u==F$e){let d=l.node,f;if(f=d.firstChild){let h=o[c.read(f.from,f.to)];if(h)for(let m of h){if(m.tagName&&m.tagName!=mse(d.parent,c))continue;let g=d.lastChild;if(g.type.id==f7){let b=g.from+1,v=g.lastChild,y=g.to-(v&&v.isError?0:1);if(y>b)return{parser:m.parser,overlay:[{from:b,to:y}],bracketed:!0}}else if(g.type.id==B$e)return{parser:m.parser,overlay:[{from:g.from,to:g.to}]}}}}return null})}const m4t=145,gse=1,g4t=146,b4t=147,V$e=2,y4t=148,v4t=3,x4t=4,H$e=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],w4t=58,k4t=40,q$e=95,O4t=91,HN=45,S4t=46,E4t=35,C4t=37,A4t=38,T4t=92,_4t=10,j4t=42;function ZC(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function EW(e){return e>=48&&e<=57}function bse(e){return EW(e)||e>=97&&e<=102||e>=65&&e<=70}const W$e=(e,t,n)=>(i,r)=>{for(let s=!1,o=0,l=0;;l++){let{next:c}=i;if(ZC(c)||c==HN||c==q$e||s&&EW(c))!s&&(c!=HN||l>0)&&(s=!0),o===l&&c==HN&&o++,i.advance();else if(c==T4t&&i.peek(1)!=_4t){if(i.advance(),bse(i.next)){do i.advance();while(bse(i.next));i.next==32&&i.advance()}else i.next>-1&&i.advance();s=!0}else{s&&i.acceptToken(o==2&&r.canShift(V$e)?t:c==k4t?n:e);break}}},N4t=new Ma(W$e(g4t,V$e,b4t),{contextual:!0}),R4t=new Ma(W$e(y4t,v4t,x4t),{contextual:!0}),I4t=new Ma(e=>{if(H$e.includes(e.peek(-1))){let{next:t}=e;(ZC(t)||t==q$e||t==E4t||t==S4t||t==j4t||t==O4t||t==w4t&&ZC(e.peek(1))||t==HN||t==A4t)&&e.acceptToken(m4t)}}),P4t=new Ma(e=>{if(!H$e.includes(e.peek(-1))){let{next:t}=e;if(t==C4t&&(e.advance(),e.acceptToken(gse)),ZC(t)){do e.advance();while(ZC(e.next)||EW(e.next));e.acceptToken(gse)}}}),D4t=vm({"AtKeyword import charset namespace keyframes media supports font-feature-values":pe.definitionKeyword,"from to selector scope MatchFlag":pe.keyword,NamespaceName:pe.namespace,KeyframeName:pe.labelName,KeyframeRangeName:pe.operatorKeyword,TagName:pe.tagName,ClassName:pe.className,PseudoClassName:pe.constant(pe.className),IdName:pe.labelName,"FeatureName PropertyName":pe.propertyName,AttributeName:pe.attributeName,NumberLiteral:pe.number,KeywordQuery:pe.keyword,UnaryQueryOp:pe.operatorKeyword,"CallTag ValueName FontName":pe.atom,VariableName:pe.variableName,Callee:pe.operatorKeyword,Unit:pe.unit,"UniversalSelector NestingSelector":pe.definitionOperator,"MatchOp CompareOp":pe.compareOperator,"ChildOp SiblingOp, LogicOp":pe.logicOperator,BinOp:pe.arithmeticOperator,Important:pe.modifier,Comment:pe.blockComment,ColorLiteral:pe.color,"ParenthesizedContent StringLiteral":pe.string,":":pe.punctuation,"PseudoOp #":pe.derefOperator,"; , |":pe.separator,"( )":pe.paren,"[ ]":pe.squareBracket,"{ }":pe.brace}),M4t={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:152,"url-prefix":152,domain:152,regexp:152},L4t={__proto__:null,or:104,and:104,not:112,only:112,layer:206},$4t={__proto__:null,selector:118,style:124,layer:202},F4t={__proto__:null,"@import":198,"@media":210,"@charset":214,"@namespace":218,"@keyframes":224,"@supports":236,"@scope":240,"@font-feature-values":246},B4t={__proto__:null,to:243},U4t=om.deserialize({version:14,states:"MlQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FnO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#EOO'dQdO'#EQO'oQdO'#EXO'oQdO'#E[OOQP'#Fn'#FnO)RQhO'#E}OOQS'#Fm'#FmOOQS'#FQ'#FQQYQdOOO)YQdO'#EbO*iQhO'#EhO)YQdO'#EjO*pQdO'#ElO*{QdO'#EoO)}QhO'#EuO+TQdO'#EwO+`QdO'#EzO+eQaO'#CfO+lQ`O'#E_O+qQ`O'#F{O+|QdO'#F{QOQ`OOP,WO&jO'#CaPOOO)CA])CA]OOQP'#Ci'#CiOOQP,59R,59RO%VQdO,59ROOQP'#Cm'#CmOOQP,59V,59VO&XQdO,59VO,cQdO,59YO'_QdO,5:jO'dQdO,5:lO'oQdO,5:sO'oQdO,5:uO'oQdO,5:vO'oQdO'#FXO,nQ`O,58}O,vQdO'#E^OOQS,58},58}OOQP'#Cq'#CqOOQO'#D|'#D|OOQP,59Y,59YO,}Q`O,59YO-SQ`O,59YOOQP'#EP'#EPOOQP,5:j,5:jO-XQpO'#ERO-dQdO'#ESO-iQ`O'#ESO-nQpO,5:lO.XQaO,5:sO.oQaO,5:vOOQW'#D^'#D^O/nQhO'#DgO0RQhO,5;iO)}QhO'#DeO0`Q`O'#DnO0eQhO'#DxOOQW'#Ft'#FtOOQS,5;i,5;iO0jQ`O'#DhO0oQ`O'#DkOOQS-E9O-E9OOOQ['#Cv'#CvO0tQdO'#CwO1[QdO'#C}O1rQdO'#DQO2YQ!pO'#DSO4fQ!jO,5:|OOQO'#DX'#DXO-SQ`O'#DWO4vQ!nO'#FqO6|Q`O'#DYO7RQ`O'#DyOOQ['#Fq'#FqO7WQhO'#GOO7fQ`O,5;SO7kQ!bO,5;UOOQS'#En'#EnO7sQ`O,5;WO7xQdO,5;WOOQO'#Eq'#EqO8QQ`O,5;ZO8VQhO,5;aO'oQdO'#DjOOQS,5;c,5;cO0jQ`O,5;cO8_QdO,5;cOOQS'#F`'#F`O8gQdO'#E|O7fQ`O,5;fO8oQdO,5:yO9PQdO'#FZO9^Q`O,5lQhO'#DoOOQW,5:Y,5:YOOQW,5:d,5:dOOQW,5:S,5:SO>vQhO,5:VO?bQ!fO'#FrOOQS'#Fr'#FrOOQS'#FS'#FSO@rQdO,59cOOQ[,59c,59cOAYQdO,59iOOQ[,59i,59iOApQdO,59lOOQ[,59l,59lOOQ[,59n,59nO)YQdO,59pOBWQhO'#EdOOQW'#Ed'#EdOBuQ`O1G0hO4oQhO1G0hOOQ[,59r,59rO)}QhO'#D[OOQ[,59t,59tOBzQ#tO,5:eOCVQhO'#F]OCdQ`O,5vQhO'#DmOI_QhO'#DqOIgQhO'#DsOIlQhO'#FwOOQO'#Fw'#FwOItQ!bO'#DwOOQO'#Fy'#FyOOQO'#Fv'#FvOIyQ`O1G/qOOQS-E9Q-E9QOOQ[1G.}1G.}OOQ[1G/T1G/TOOQ[1G/W1G/WOOQ[1G/[1G/[OJOQdO,5;OOOQS7+&S7+&SOJTQ`O7+&SOJYQhO'#D]OJbQ`O,59vO)}QhO,59vOOQ[1G0P1G0POJjQ`O1G0POJoQhO,5;wOOQO-E9Z-E9ZOOQS7+&^7+&^OJ}QbO'#DSOOQO'#Et'#EtOK]Q`O'#EsOOQO'#Es'#EsOKhQ`O'#F^OKpQdO,5;^OOQS,5;^,5;^OOQ[1G/p1G/pOOQS7+&i7+&iO7fQ`O7+&iOK{Q!fO'#FYO)YQdO'#FYOMSQdO7+&POOQO7+&P7+&POOQO,5:{,5:{OOQO1G1a1G1aOMgQ!bO<vQhO'#DrOOQO,5:],5:]O! hQhO,5:_OGUQhO,5:cOOQW7+%]7+%]OOQO'#Ef'#EfO! pQ`O1G0jOOQS<xAN>xO!#zQ`OAN>xO!$PQaO,5;rOOQO-E9U-E9UO!$ZQdO,5;qOOQO-E9T-E9TOOQW<vQhO'#DuOOQO1G/y1G/yO!%vQ!bO1G/}OJOQdO'#F[O!&OQ`O7+&UOOQW7+&U7+&UO!&WQ!bO1G/cOOQ[7+$|7+$|O!&cQhO7+$|P!&jQ`O'#FTOOQO,5;y,5;yOOQO-E9]-E9]OOQS1G1d1G1dOOQPG24dG24dO!&oQ`OAN>ZO)YQdO1G1[O!&tQ`O7+'jOOQO1G/x1G/xO!&|Q`O,5:aO!$eQhO7+%iOOQO,5;v,5;vOOQO-E9Y-E9YOOQW<Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`KY<%lO%Z`%^SOy%jz;'S%j;'S;=`%{<%lO%j`%oS!o`Oy%jz;'S%j;'S;=`%{<%lO%j`&OP;=`<%l%j~&Wh$[~OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%j~'yh$[~!o`OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%jj)jS$qYOy%jz;'S%j;'S;=`%{<%lO%j~)yWOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d<%lO)v~*hOw~~*kRO;'S)v;'S;=`*t;=`O)v~*wXOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d;=`<%l)v<%lO)v~+gP;=`<%l)vj+oYmYOy%jz!Q%j!Q![,_![!c%j!c!i,_!i#T%j#T#Z,_#Z;'S%j;'S;=`%{<%lO%jj,dY!o`Oy%jz!Q%j!Q![-S![!c%j!c!i-S!i#T%j#T#Z-S#Z;'S%j;'S;=`%{<%lO%jj-XY!o`Oy%jz!Q%j!Q![-w![!c%j!c!i-w!i#T%j#T#Z-w#Z;'S%j;'S;=`%{<%lO%jj.OYuY!o`Oy%jz!Q%j!Q![.n![!c%j!c!i.n!i#T%j#T#Z.n#Z;'S%j;'S;=`%{<%lO%jj.uYuY!o`Oy%jz!Q%j!Q![/e![!c%j!c!i/e!i#T%j#T#Z/e#Z;'S%j;'S;=`%{<%lO%jj/jY!o`Oy%jz!Q%j!Q![0Y![!c%j!c!i0Y!i#T%j#T#Z0Y#Z;'S%j;'S;=`%{<%lO%jj0aYuY!o`Oy%jz!Q%j!Q![1P![!c%j!c!i1P!i#T%j#T#Z1P#Z;'S%j;'S;=`%{<%lO%jj1UY!o`Oy%jz!Q%j!Q![1t![!c%j!c!i1t!i#T%j#T#Z1t#Z;'S%j;'S;=`%{<%lO%jj1{SuY!o`Oy%jz;'S%j;'S;=`%{<%lO%jd2[UOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jd2uS!yS!o`Oy%jz;'S%j;'S;=`%{<%lO%jb3WS^QOy%jz;'S%j;'S;=`%{<%lO%j~3gWOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{<%lO3d~4SRO;'S3d;'S;=`4];=`O3d~4`XOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{;=`<%l3d<%lO3d~5OP;=`<%l3dj5WShYOy%jz;'S%j;'S;=`%{<%lO%j~5iOg~n5pUWQyWOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jj6ZWyW#PQOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj6xU!o`Oy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%jj7cY!o`$gYOy%jz!Q%j!Q![7[![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj8WY!o`Oy%jz{%j{|8v|}%j}!O8v!O!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj8{U!o`Oy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj9fU!o`$gYOy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj:P[!o`$gYOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj:zS!dYOy%jz;'S%j;'S;=`%{<%lO%jj;]WyWOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj;zU`YOy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%j~VUcYOy%jz![%j![!]>i!];'S%j;'S;=`%{<%lO%jj>pSdY!o`Oy%jz;'S%j;'S;=`%{<%lO%jj?RSnYOy%jz;'S%j;'S;=`%{<%lO%jh?dU!WWOy%jz!_%j!_!`?v!`;'S%j;'S;=`%{<%lO%jh?}S!WW!o`Oy%jz;'S%j;'S;=`%{<%lO%jl@bS!WW!ySOy%jz;'S%j;'S;=`%{<%lO%jj@uV!|Q!WWOy%jz!_%j!_!`?v!`!aA[!a;'S%j;'S;=`%{<%lO%jbAcS!|Q!o`Oy%jz;'S%j;'S;=`%{<%lO%jjArYOy%jz}%j}!OBb!O!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjBgW!o`Oy%jz!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjCW[lY!o`Oy%jz}%j}!OCP!O!Q%j!Q![CP![!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jhDRS!zWOy%jz;'S%j;'S;=`%{<%lO%jjDdSpYOy%jz;'S%j;'S;=`%{<%lO%jnDuSo^Oy%jz;'S%j;'S;=`%{<%lO%jjEWU!zWOy%jz#a%j#a#bEj#b;'S%j;'S;=`%{<%lO%jbEoU!o`Oy%jz#d%j#d#eFR#e;'S%j;'S;=`%{<%lO%jbFWU!o`Oy%jz#c%j#c#dFj#d;'S%j;'S;=`%{<%lO%jbFoU!o`Oy%jz#f%j#f#gGR#g;'S%j;'S;=`%{<%lO%jbGWU!o`Oy%jz#h%j#h#iGj#i;'S%j;'S;=`%{<%lO%jbGoU!o`Oy%jz#T%j#T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!o`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!o`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$pQ!o`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$cUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU#PQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[I4t,P4t,N4t,R4t,1,2,3,4,new nP("m~RRYZ[z{a~~g~aO$_~~dP!P!Qg~lO$`~~",28,152)],topRules:{StyleSheet:[0,6],Styles:[1,126]},dynamicPrecedences:{94:1},specialized:[{term:147,get:e=>M4t[e]||-1},{term:148,get:e=>L4t[e]||-1},{term:4,get:e=>$4t[e]||-1},{term:28,get:e=>F4t[e]||-1},{term:146,get:e=>B4t[e]||-1}],tokenPrec:2405});let S$=null;function E$(){if(!S$&&typeof document=="object"&&document.body){let{style:e}=document.body,t=[],n=new Set;for(let i in e)i!="cssText"&&i!="cssFloat"&&typeof e[i]=="string"&&(/[A-Z]/.test(i)&&(i=i.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),n.has(i)||(t.push(i),n.add(i)));S$=t.sort().map(i=>({type:"property",label:i,apply:i+": "}))}return S$||[]}const yse=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),vse=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),Q4t=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),z4t=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(e=>({type:"keyword",label:e})),tp=/^(\w[\w-]*|-\w[\w-]*|)$/,V4t=/^-(-[\w-]*)?$/;function H4t(e,t){var n;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let i=(n=e.parent)===null||n===void 0?void 0:n.firstChild;return(i==null?void 0:i.name)!="Callee"?!1:t.sliceString(i.from,i.to)=="var"}const xse=new Mq,q4t=["Declaration"];function W4t(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function K$e(e,t,n){if(t.to-t.from>4096){let i=xse.get(t);if(i)return i;let r=[],s=new Set,o=t.cursor(Ar.IncludeAnonymous);if(o.firstChild())do for(let l of K$e(e,o.node,n))s.has(l.label)||(s.add(l.label),r.push(l));while(o.nextSibling());return xse.set(t,r),r}else{let i=[],r=new Set;return t.cursor().iterate(s=>{var o;if(n(s)&&s.matchContext(q4t)&&((o=s.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let l=e.sliceString(s.from,s.to);r.has(l)||(r.add(l),i.push({label:l,type:"variable"}))}}),i}}const K4t=e=>t=>{let{state:n,pos:i}=t,r=es(n).resolveInner(i,-1),s=r.type.isError&&r.from==r.to-1&&n.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:E$(),validFor:tp};if(r.name=="ValueName")return{from:r.from,options:vse,validFor:tp};if(r.name=="PseudoClassName")return{from:r.from,options:yse,validFor:tp};if(e(r)||(t.explicit||s)&&H4t(r,n.doc))return{from:e(r)||s?r.from:i,options:K$e(n.doc,W4t(r),e),validFor:V4t};if(r.name=="TagName"){for(let{parent:c}=r;c;c=c.parent)if(c.name=="Block")return{from:r.from,options:E$(),validFor:tp};return{from:r.from,options:Q4t,validFor:tp}}if(r.name=="AtKeyword")return{from:r.from,options:z4t,validFor:tp};if(!t.explicit)return null;let o=r.resolve(i),l=o.childBefore(i);return l&&l.name==":"&&o.name=="PseudoClassSelector"?{from:i,options:yse,validFor:tp}:l&&l.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:i,options:vse,validFor:tp}:o.name=="Block"||o.name=="Styles"?{from:i,options:E$(),validFor:tp}:null},G4t=K4t(e=>e.name=="VariableName"),lP=am.define({name:"css",parser:U4t.configure({props:[xm.add({Declaration:Ow()}),wm.add({"Block KeyframeList":PT})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function X4t(){return new mb(lP,lP.data.of({autocomplete:G4t}))}const NO=["_blank","_self","_top","_parent"],C$=["ascii","utf-8","utf-16","latin1","latin1"],A$=["get","post","put","delete"],T$=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],ou=["true","false"],In={},Y4t={a:{attrs:{href:null,ping:null,type:null,media:null,target:NO,hreflang:null}},abbr:In,address:In,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:In,aside:In,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:In,base:{attrs:{href:null,target:NO}},bdi:In,bdo:In,blockquote:{attrs:{cite:null}},body:In,br:In,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:T$,formmethod:A$,formnovalidate:["novalidate"],formtarget:NO,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:In,center:In,cite:In,code:In,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:In,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:In,div:In,dl:In,dt:In,em:In,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:In,figure:In,footer:In,form:{attrs:{action:null,name:null,"accept-charset":C$,autocomplete:["on","off"],enctype:T$,method:A$,novalidate:["novalidate"],target:NO}},h1:In,h2:In,h3:In,h4:In,h5:In,h6:In,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:In,hgroup:In,hr:In,html:{attrs:{manifest:null}},i:In,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:T$,formmethod:A$,formnovalidate:["novalidate"],formtarget:NO,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:In,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:In,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:In,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:C$,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:In,noscript:In,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:In,param:{attrs:{name:null,value:null}},pre:In,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:In,rt:In,ruby:In,samp:In,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:C$}},section:In,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:In,source:{attrs:{src:null,type:null,media:null}},span:In,strong:In,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:In,summary:In,sup:In,table:In,tbody:In,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:In,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:In,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:In,time:{attrs:{datetime:null}},title:In,tr:In,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:In,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:In},G$e={accesskey:null,class:null,contenteditable:ou,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:ou,autocorrect:ou,autocapitalize:ou,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":ou,"aria-autocomplete":["inline","list","both","none"],"aria-busy":ou,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":ou,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":ou,"aria-hidden":ou,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":ou,"aria-multiselectable":ou,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":ou,"aria-relevant":null,"aria-required":ou,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},X$e="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of X$e)G$e[e]=null;class JC{constructor(t,n){this.tags={...Y4t,...t},this.globalAttrs={...G$e,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}JC.default=new JC;function v1(e,t,n=e.length){if(!t)return"";let i=t.firstChild,r=i&&i.getChild("TagName");return r?e.sliceString(r.from,Math.min(r.to,n)):""}function x1(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function Y$e(e,t,n){let i=n.tags[v1(e,x1(t))];return(i==null?void 0:i.children)||n.allTags}function CW(e,t){let n=[];for(let i=x1(t);i&&!i.type.isTop;i=x1(i.parent)){let r=v1(e,i);if(r&&i.lastChild.name=="CloseTag")break;r&&n.indexOf(r)<0&&(t.name=="EndTag"||t.from>=i.firstChild.to)&&n.push(r)}return n}const Z$e=/^[:\-\.\w\u00b7-\uffff]*$/;function wse(e,t,n,i,r){let s=/\s*>/.test(e.sliceDoc(r,r+5))?"":">",o=x1(n,n.name=="StartTag"||n.name=="TagName");return{from:i,to:r,options:Y$e(e.doc,o,t).map(l=>({label:l,type:"type"})).concat(CW(e.doc,n).map((l,c)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function kse(e,t,n,i){let r=/\s*>/.test(e.sliceDoc(i,i+5))?"":">";return{from:n,to:i,options:CW(e.doc,t).map((s,o)=>({label:s,apply:s+r,type:"type",boost:99-o})),validFor:Z$e}}function Z4t(e,t,n,i){let r=[],s=0;for(let o of Y$e(e.doc,n,t))r.push({label:"<"+o,type:"type"});for(let o of CW(e.doc,n))r.push({label:"",type:"type",boost:99-s++});return{from:i,to:i,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function J4t(e,t,n,i,r){let s=x1(n),o=s?t.tags[v1(e.doc,s)]:null,l=o&&o.attrs?Object.keys(o.attrs):[],c=o&&o.globalAttrs===!1?l:l.length?l.concat(t.globalAttrNames):t.globalAttrNames;return{from:i,to:r,options:c.map(u=>({label:u,type:"property"})),validFor:Z$e}}function e$t(e,t,n,i,r){var s;let o=(s=n.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),l=[],c;if(o){let u=e.sliceDoc(o.from,o.to),d=t.globalAttrs[u];if(!d){let f=x1(n),h=f?t.tags[v1(e.doc,f)]:null;d=(h==null?void 0:h.attrs)&&h.attrs[u]}if(d){let f=e.sliceDoc(i,r).toLowerCase(),h='"',m='"';/^['"]/.test(f)?(c=f[0]=='"'?/^[^"]*$/:/^[^']*$/,h="",m=e.sliceDoc(r,r+1)==f[0]?"":f[0],f=f.slice(1),i++):c=/^[^\s<>='"]*$/;for(let g of d)l.push({label:g,apply:h+g+m,type:"constant"})}}return{from:i,to:r,options:l,validFor:c}}function J$e(e,t){let{state:n,pos:i}=t,r=es(n).resolveInner(i,-1),s=r.resolve(i);for(let o=i,l;s==r&&(l=r.childBefore(o));){let c=l.lastChild;if(!c||!c.type.isError||c.fromJ$e(i,r)}const i$t=wh.parser.configure({top:"SingleExpression"}),e6e=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:o$e.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:l$e.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:c$e.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:i$t},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:wh.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:lP.parser}],t6e=[{name:"style",parser:lP.parser.configure({top:"Styles"})}].concat(X$e.map(e=>({name:e,parser:wh.parser}))),n6e=am.define({name:"html",parser:p4t.configure({props:[xm.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].lengthe.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),qN=n6e.configure({wrap:z$e(e6e,t6e)});function r$t(e={}){let t="",n;e.matchClosingTags===!1&&(t="noMatch"),e.selfClosingTags===!0&&(t=(t?t+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(n=z$e((e.nestedLanguages||[]).concat(e6e),(e.nestedAttributes||[]).concat(t6e)));let i=n?n6e.configure({wrap:n,dialect:t}):t?qN.configure({dialect:t}):qN;return new mb(i,[qN.data.of({autocomplete:n$t(e)}),e.autoCloseTags!==!1?s$t:[],o7().support,X4t().support])}const Ose=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),s$t=Jt.inputHandler.of((e,t,n,i,r)=>{if(e.composing||e.state.readOnly||t!=n||i!=">"&&i!="/"||!qN.isActiveAt(e.state,t,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(c=>{var u,d,f;let h=o.doc.sliceString(c.from-1,c.to)==i,{head:m}=c,g=es(o).resolveInner(m,-1),b;if(h&&i==">"&&g.name=="EndTag"){let v=g.parent;if(((d=(u=v.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(b=v1(o.doc,v.parent,m))&&!Ose.has(b)){let y=m+(o.doc.sliceString(m,m+1)===">"?1:0),w=``;return{range:c,changes:{from:m,to:y,insert:w}}}}else if(h&&i=="/"&&g.name=="IncompleteCloseTag"){let v=g.parent;if(g.from==m-2&&((f=v.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(b=v1(o.doc,v,m))&&!Ose.has(b)){let y=m+(o.doc.sliceString(m,m+1)===">"?1:0),w=`${b}>`;return{range:pt.cursor(m+w.length,-1),changes:{from:m,to:y,insert:w}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),i6e=JM({commentTokens:{block:{open:""}}}),r6e=new li,s6e=g3t.configure({props:[wm.add(e=>!e.is("Block")||e.is("Document")||p7(e)!=null||a$t(e)?void 0:(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})),r6e.add(p7),xm.add({Document:()=>null}),xg.add({Document:i6e})]});function p7(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function a$t(e){return e.name=="OrderedList"||e.name=="BulletList"}function o$t(e,t){let n=e;for(;;){let i=n.nextSibling,r;if(!i||(r=p7(i.type))!=null&&r<=t)break;n=i}return n.to}const l$t=S4e.of((e,t,n)=>{for(let i=es(e).resolveInner(n,-1);i&&!(i.fromn)return{from:n,to:s}}return null});function AW(e){return new Au(i6e,e,[],"markdown")}const c$t=AW(s6e),u$t=s6e.configure([A3t,_3t,T3t,j3t,{props:[wm.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),cP=AW(u$t);function d$t(e,t){return n=>{if(n&&e){let i=null;if(n=/\S*/.exec(n)[0],typeof e=="function"?i=e(n):i=YI.matchLanguageName(e,n,!0),i instanceof YI)return i.support?i.support.language.parser:vv.getSkippingParser(i.load());if(i)return i.parser}return t?t.parser:null}}let _$=class{constructor(t,n,i,r,s,o,l){this.node=t,this.from=n,this.to=i,this.spaceBefore=r,this.spaceAfter=s,this.type=o,this.item=l}blank(t,n=!0){let i=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(t!=null){for(;i.length0;r--)i+=" ";return i+(n?this.spaceAfter:"")}}marker(t,n){let i=this.node.name=="OrderedList"?String(+o6e(this.item,t)[2]+n):"";return this.spaceBefore+i+this.type+this.spaceAfter}};function a6e(e,t){let n=[],i=[];for(let r=e;r;r=r.parent){if(r.name=="FencedCode")return i;(r.name=="ListItem"||r.name=="Blockquote")&&n.push(r)}for(let r=n.length-1;r>=0;r--){let s=n[r],o,l=t.lineAt(s.from),c=s.from-l.from;if(s.name=="Blockquote"&&(o=/^ *>( ?)/.exec(l.text.slice(c))))i.push(new _$(s,c,c+o[0].length,"",o[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(l.text.slice(c)))){let u=o[3],d=o[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),i.push(new _$(s.parent,c,c+d,o[1],u,o[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(l.text.slice(c)))){let u=o[4],d=o[0].length;u.length>4&&(u=u.slice(0,u.length-4),d-=4);let f=o[2];o[3]&&(f+=o[3].replace(/[xX]/," ")),i.push(new _$(s.parent,c,c+d,o[1],u,f,s))}}return i}function o6e(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function j$(e,t,n,i=0){for(let r=-1,s=e;;){if(s.name=="ListItem"){let l=o6e(s,t),c=+l[2];if(r>=0){if(c!=r+1)return;n.push({from:s.from+l[1].length,to:s.from+l[0].length,insert:String(r+2+i)})}r=c}let o=s.nextSibling;if(!o)break;s=o}}function TW(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(bk)!=" ")return e;let i=vf(e,4,n),r="";for(let s=i;s>0;)s>=4?(r+=" ",s-=4):(r+=" ",s--);return r+e.slice(n)}const f$t=(e={})=>({state:t,dispatch:n})=>{let i=es(t),{doc:r}=t,s=null,o=t.changeByRange(l=>{if(!l.empty||!cP.isActiveAt(t,l.from,-1)&&!cP.isActiveAt(t,l.from,1))return s={range:l};let c=l.from,u=r.lineAt(c),d=a6e(i.resolveInner(c,-1),r);for(;d.length&&d[d.length-1].from>c-u.from;)d.pop();if(!d.length)return s={range:l};let f=d[d.length-1];if(f.to-f.spaceAfter.length>c-u.from)return s={range:l};let h=c>=f.to-f.spaceAfter.length&&!/\S/.test(u.text.slice(f.to));if(f.item&&h){let y=f.node.firstChild,w=f.node.getChild("ListItem","ListItem");if(y.to>=c||w&&w.to0&&!/[^\s>]/.test(r.lineAt(u.from-1).text)||e.nonTightLists===!1){let x=d.length>1?d[d.length-2]:null,k,S="";x&&x.item?(k=u.from+x.from,S=x.marker(r,1)):k=u.from+(x?x.to:0);let O=[{from:k,to:c,insert:S}];return f.node.name=="OrderedList"&&j$(f.item,r,O,-2),x&&x.node.name=="OrderedList"&&j$(x.item,r,O),{range:pt.cursor(k+S.length),changes:O}}else{let x=Ese(d,t,u);return{range:pt.cursor(c+x.length+1),changes:{from:u.from,insert:x+t.lineBreak}}}}if(f.node.name=="Blockquote"&&h&&u.from){let y=r.lineAt(u.from-1),w=/>\s*$/.exec(y.text);if(w&&w.index==f.from){let x=t.changes([{from:y.from+w.index,to:y.to},{from:u.from+f.from,to:u.to}]);return{range:l.map(x),changes:x}}}let m=[];f.node.name=="OrderedList"&&j$(f.item,r,m);let g=f.item&&f.item.from]*/.exec(u.text)[0].length>=f.to)for(let y=0,w=d.length-1;y<=w;y++)b+=y==w&&!g?d[y].marker(r,1):d[y].blank(yu.from&&/\s/.test(u.text.charAt(v-u.from-1));)v--;return b=TW(b,t),p$t(f.node,t.doc)&&(b=Ese(d,t,u)+t.lineBreak+b),m.push({from:v,to:c,insert:t.lineBreak+b}),{range:pt.cursor(v+b.length+1),changes:m}});return s?!1:(n(t.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},h$t=f$t();function Sse(e){return e.name=="QuoteMark"||e.name=="ListMark"}function p$t(e,t){if(e.name!="OrderedList"&&e.name!="BulletList")return!1;let n=e.firstChild,i=e.getChild("ListItem","ListItem");if(!i)return!1;let r=t.lineAt(n.to),s=t.lineAt(i.from),o=/^[\s>]*$/.test(r.text);return r.number+(o?0:1){let n=es(e),i=null,r=e.changeByRange(s=>{let o=s.from,{doc:l}=e;if(s.empty&&cP.isActiveAt(e,s.from)){let c=l.lineAt(o),u=a6e(m$t(n,o),l);if(u.length){let d=u[u.length-1],f=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(o-c.from>f&&!/\S/.test(c.text.slice(f,o-c.from)))return{range:pt.cursor(c.from+f),changes:{from:c.from+f,to:o}};if(o-c.from==f&&(d.item&&c.from<=d.item.from||/^[\s>]*$/.test(c.text.slice(0,d.to)))){let h=c.from+d.from;if(d.item&&d.node.from{var n;let{main:i}=t.state.selection;if(i.empty)return!1;let r=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r="https://"+r),!cP.isActiveAt(t.state,i.from,1)))return!1;let s=es(t.state),o=!1;return s.iterate({from:i.from,to:i.to,enter:l=>{(l.from>i.from||w$t.test(l.name))&&(o=!0)},leave:l=>{l.to=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}const k6t=new Ma((e,t)=>{let n;if(e.next<0)e.acceptToken(C$t);else if(t.context.flags&WN)R$(e.next)&&e.acceptToken(E$t,1);else if(((n=e.peek(-1))<0||R$(n))&&t.canShift(Cse)){let i=0;for(;e.next==_W||e.next==sL;)e.advance(),i++;(e.next==kv||e.next==eA||e.next==jW)&&e.acceptToken(Cse,-i)}else R$(e.next)&&e.acceptToken(S$t,1)},{contextual:!0}),O6t=new Ma((e,t)=>{let n=t.context;if(n.flags)return;let i=e.peek(-1);if(i==kv||i==eA){let r=0,s=0;for(;;){if(e.next==_W)r++;else if(e.next==sL)r+=8-r%8;else break;e.advance(),s++}r!=n.indent&&e.next!=kv&&e.next!=eA&&e.next!=jW&&(r[e,t|m6e])),C6t=new nL({start:S6t,reduce(e,t,n,i){return e.flags&WN&&w6t.has(t)||(t==z$t||t==f6e)&&e.flags&m6e?e.parent:e},shift(e,t,n,i){return t==c6e?new KN(e,E6t(i.read(i.pos,n.pos)),0):t==u6e?e.parent:t==_$t||t==I$t||t==M$t||t==d6e?new KN(e,0,WN):jse.has(t)?new KN(e,0,jse.get(t)|e.flags&WN):e},hash(e){return e.hash}}),A6t=new Ma(e=>{for(let t=0;t<5;t++){if(e.next!="print".charCodeAt(t))return;e.advance()}if(!/\w/.test(String.fromCharCode(e.next)))for(let t=0;;t++){let n=e.peek(t);if(!(n==_W||n==sL)){n!=p6t&&n!=m6t&&n!=kv&&n!=eA&&n!=jW&&e.acceptToken(O$t);return}}}),T6t=new Ma((e,t)=>{let{flags:n}=t.context,i=n&cp?p6e:h6e,r=(n&up)>0,s=!(n&dp),o=(n&fp)>0,l=e.pos;for(;!(e.next<0);)if(o&&e.next==m7)if(e.peek(1)==m7)e.advance(2);else{if(e.pos==l){e.acceptToken(d6e,1);return}break}else if(s&&e.next==_se){if(e.pos==l){e.advance();let c=e.next;c>=0&&(e.advance(),_6t(e,c)),e.acceptToken(T$t);return}break}else if(e.next==_se&&!s&&e.peek(1)>-1)e.advance(2);else if(e.next==i&&(!r||e.peek(1)==i&&e.peek(2)==i)){if(e.pos==l){e.acceptToken(Ase,r?3:1);return}break}else if(e.next==kv){if(r)e.advance();else if(e.pos==l){e.acceptToken(Ase);return}break}else e.advance();e.pos>l&&e.acceptToken(A$t)});function _6t(e,t){if(t==g6t)for(let n=0;n<2&&e.next>=48&&e.next<=55;n++)e.advance();else if(t==b6t)for(let n=0;n<2&&I$(e.next);n++)e.advance();else if(t==v6t)for(let n=0;n<4&&I$(e.next);n++)e.advance();else if(t==x6t)for(let n=0;n<8&&I$(e.next);n++)e.advance();else if(t==y6t&&e.next==m7){for(e.advance();e.next>=0&&e.next!=Tse&&e.next!=h6e&&e.next!=p6e&&e.next!=kv;)e.advance();e.next==Tse&&e.advance()}}const j6t=vm({'async "*" "**" FormatConversion FormatSpec':pe.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":pe.controlKeyword,"in not and or is del":pe.operatorKeyword,"from def class global nonlocal lambda":pe.definitionKeyword,import:pe.moduleKeyword,"with as print":pe.keyword,Boolean:pe.bool,None:pe.null,VariableName:pe.variableName,"CallExpression/VariableName":pe.function(pe.variableName),"FunctionDefinition/VariableName":pe.function(pe.definition(pe.variableName)),"ClassDefinition/VariableName":pe.definition(pe.className),PropertyName:pe.propertyName,"CallExpression/MemberExpression/PropertyName":pe.function(pe.propertyName),Comment:pe.lineComment,Number:pe.number,String:pe.string,FormatString:pe.special(pe.string),Escape:pe.escape,UpdateOp:pe.updateOperator,"ArithOp!":pe.arithmeticOperator,BitOp:pe.bitwiseOperator,CompareOp:pe.compareOperator,AssignOp:pe.definitionOperator,Ellipsis:pe.punctuation,At:pe.meta,"( )":pe.paren,"[ ]":pe.squareBracket,"{ }":pe.brace,".":pe.derefOperator,", ;":pe.separator}),N6t={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},R6t=om.deserialize({version:14,states:"##jQ`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5TQdO'#DoOOQS,5:Y,5:YO5hQdO'#HdOOQS,5:],5:]O5uQ!fO,5:]O5zQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8jQdO,59bO8oQdO,59bO8vQdO,59jO8}QdO'#HTO:TQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:lQdO,59aO'vQdO,59aO:zQdO,59aOOQS,59y,59yO;PQdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;_QdO,5:QO;dQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;uQdO,5:UO;zQdO,5:WOOOW'#Fy'#FyOOOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!/[QtO1G.|O!/cQtO1G.|O1lQdO1G.|O!0OQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!0VQdO1G/eO!0gQdO1G/eO!0oQdO1G/fO'vQdO'#H[O!0tQdO'#H[O!0yQtO1G.{O!1ZQdO,59iO!2aQdO,5=zO!2qQdO,5=zO!2yQdO1G/mO!3OQtO1G/mOOQS1G/l1G/lO!3`QdO,5=uO!4VQdO,5=uO0rQdO1G/qO!4tQdO1G/sO!4yQtO1G/sO!5ZQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!5kQdO'#HxO0rQdO'#HxO!5|QdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!6[Q#xO1G2zO!6{QtO1G2zO'vQdO,5kOOQS1G1`1G1`O!8RQdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!8WQdO'#FrO!8cQdO,59oO!8kQdO1G/XO!8uQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!9fQdO'#GtOOQS,5jO!;ZQdO,5>jO1XQdO,5>jO!;lQdO,5>iOOQS-E:R-E:RO!;qQdO1G0lO!;|QdO1G0lO!lO!lO!hO!=VQdO,5>hO!=hQdO'#EpO0rQdO1G0tO!=sQdO1G0tO!=xQgO1G0zO!AvQgO1G0}O!EqQdO,5>oO!E{QdO,5>oO!FTQtO,5>oO0rQdO1G1PO!F_QdO1G1PO4iQdO1G1UO!!vQdO1G1WOOQV,5;a,5;aO!FdQfO,5;aO!FiQgO1G1QO!JjQdO'#GZO4iQdO1G1QO4iQdO1G1QO!JzQdO,5>pO!KXQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!KaQdO'#FSO!KrQ!fO1G1WO!KzQdO1G1WOOQV1G1]1G1]O4iQdO1G1]O!LPQdO1G1]O!LXQdO'#F^OOQV1G1b1G1bO!#ZQtO1G1bPOOO1G2v1G2vP!L^OSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!LfQdO,5=|O!LyQdO,5=|OOQS1G/u1G/uO!MRQdO,5>PO!McQdO,5>PO!MkQdO,5>PO!NOQdO,5>PO!N`QdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!8kQdO7+$pO#!RQdO1G.|O#!YQdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO#!aQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO#!qQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO#!vQdO7+%PO##OQdO7+%QO##TQdO1G3fOOQS7+%X7+%XO##eQdO1G3fO##mQdO7+%XOOQS,5<_,5<_O'vQdO,5<_O##rQdO1G3aOOQS-E9q-E9qO#$iQdO7+%]OOQS7+%_7+%_O#$wQdO1G3aO#%fQdO7+%_O#%kQdO1G3gO#%{QdO1G3gO#&TQdO7+%]O#&YQdO,5>dO#&sQdO,5>dO#&sQdO,5>dOOQS'#Dx'#DxO#'UO&jO'#DzO#'aO`O'#HyOOOW1G3}1G3}O#'fQdO1G3}O#'nQdO1G3}O#'yQ#xO7+(fO#(jQtO1G2UP#)TQdO'#GOOOQS,5nQdO,5sQdO1G4OOOQS-E9y-E9yO#?^QdO1G4OO<[QdO'#H{OOOO'#D{'#D{OOOO'#F|'#F|O#?oO&jO,5:fOOOW,5>e,5>eOOOW7+)i7+)iO#?zQdO7+)iO#@SQdO1G2zO#@mQdO1G2zP'vQdO'#FuO0rQdO<mO#BQQdO,5>mOOQS1G0v1G0vOOQS<rO#KgQdO,5>rO#KrQdO,5>rO#K}QdO,5>qO#L`QdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<VAN>VO$ oQdO<cAN>cO0rQdO1G1|O$!PQtO1G1|P$!ZQdO'#FvOOQS1G2R1G2RP$!hQdO'#F{O$!uQdO7+)jO$#`QdO,5>gOOOO-E9z-E9zOOOW<tO$4{QdO,5>tO1XQdO,5vO$)nQdO,5>vOOQS1G1p1G1pOOQS,5<[,5<[OOQU7+'P7+'PO$+zQdO1G/iO$)nQdO,5wO$8zQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$)nQdO'#GdO$9SQdO1G4bO$9^QdO1G4bO$9fQdO1G4bOOQS7+%T7+%TO$9tQdO1G1tO$:SQtO'#FaO$:ZQdO,5<}OOQS,5<},5<}O$:iQdO1G4cOOQS-E:a-E:aO$)nQdO,5<|O$:pQdO,5<|O$:uQdO7+)|OOQS-E:`-E:`O$;PQdO7+)|O$)nQdO,5S~O%cOS%^OSSOS%]PQ~OPdOVaOfoOhYOopOs!POvqO!PrO!Q{O!T!SO!U!RO!XZO!][O!h`O!r`O!s`O!t`O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#l!QO#o!TO#s!UO#u!VO#z!WO#}hO$P!XO%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~O%]!YO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%j![O%k!]O%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aO~Ok%xXl%xXm%xXn%xXo%xXp%xXs%xXz%xX{%xX!x%xX#g%xX%[%xX%_%xX%z%xXg%xX!T%xX!U%xX%{%xX!W%xX![%xX!Q%xX#[%xXt%xX!m%xX~P%SOfoOhYO!XZO!][O!h`O!r`O!s`O!t`O%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~Oz%wX{%wX#g%wX%[%wX%_%wX%z%wX~Ok!pOl!qOm!oOn!oOo!rOp!sOs!tO!x%wX~P)pOV!zOg!|Oo0cOv0qO!PrO~P'vOV#OOo0cOv0qO!W#PO~P'vOV#SOa#TOo0cOv0qO![#UO~P'vOQ#XO%`#XO%a#ZO~OQ#^OR#[O%`#^O%a#`O~OV%iX_%iXa%iXh%iXk%iXl%iXm%iXn%iXo%iXp%iXs%iXz%iX!X%iX!f%iX%j%iX%k%iX%l%iX%m%iX%n%iX%o%iX%p%iX%q%iX%r%iX%s%iXg%iX!T%iX!U%iX~O&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O{%iX!x%iX#g%iX%[%iX%_%iX%z%iX%{%iX!W%iX![%iX!Q%iX#[%iXt%iX!m%iX~P,eOz#dO{%hX!x%hX#g%hX%[%hX%_%hX%z%hX~Oo0cOv0qO~P'vO#g#gO%[#iO%_#iO~O%uWO~O!T#nO#u!VO#z!WO#}hO~OopO~P'vOV#sOa#tO%uWO{wP~OV#xOo0cOv0qO!Q#yO~P'vO{#{O!x$QO%z#|O#g!yX%[!yX%_!yX~OV#xOo0cOv0qO#g#SX%[#SX%_#SX~P'vOo0cOv0qO#g#WX%[#WX%_#WX~P'vOh$WO%uWO~O!f$YO!r$YO%uWO~OV$eO~P'vO!U$gO#s$hO#u$iO~O{$jO~OV$qO~P'vOS$sO%[$rO%_$rO%c$tO~OV$}Oa$}Og%POo0cOv0qO~P'vOo0cOv0qO{%SO~P'vO&Y%UO~Oa!bOh!iO!X!kO!f!mOVba_bakbalbambanbaobapbasbazba{ba!xba#gba%[ba%_ba%jba%kba%lba%mba%nba%oba%pba%qba%rba%sba%zbagba!Tba!Uba%{ba!Wba![ba!Qba#[batba!mba~On%ZO~Oo%ZO~P'vOo0cO~P'vOk0eOl0fOm0dOn0dOo0mOp0nOs0rOg%wX!T%wX!U%wX%{%wX!W%wX![%wX!Q%wX#[%wX!m%wX~P)pO%{%]Og%vXz%vX!T%vX!U%vX!W%vX{%vX~Og%_Oz%`O!T%dO!U%cO~Og%_O~Oz%gO!T%dO!U%cO!W&SX~O!W%kO~Oz%lO{%nO!T%dO!U%cO![%}X~O![%rO~O![%sO~OQ#XO%`#XO%a%uO~OV%wOo0cOv0qO!PrO~P'vOQ#^OR#[O%`#^O%a%zO~OV!qa_!qaa!qah!qak!qal!qam!qan!qao!qap!qas!qaz!qa{!qa!X!qa!f!qa!x!qa#g!qa%[!qa%_!qa%j!qa%k!qa%l!qa%m!qa%n!qa%o!qa%p!qa%q!qa%r!qa%s!qa%z!qag!qa!T!qa!U!qa%{!qa!W!qa![!qa!Q!qa#[!qat!qa!m!qa~P#yOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P%SOV&OOopOvqO{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P'vOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#g$zX%[$zX%_$zX~P'vO#g#gO%[&TO%_&TO~O!f&UOh&sX%[&sXz&sX#[&sX#g&sX%_&sX#Z&sXg&sX~Oh!iO%[&WO~Okealeameaneaoeapeaseazea{ea!xea#gea%[ea%_ea%zeagea!Tea!Uea%{ea!Wea![ea!Qea#[eatea!mea~P%SOsqazqa{qa#gqa%[qa%_qa%zqa~Ok!pOl!qOm!oOn!oOo!rOp!sO!xqa~PEcO%z&YOz%yX{%yX~O%uWOz%yX{%yX~Oz&]O{wX~O{&_O~Oz%lO#g%}X%[%}X%_%}Xg%}X{%}X![%}X!m%}X%z%}X~OV0lOo0cOv0qO!PrO~P'vO%z#|O#gUa%[Ua%_Ua~Oz&hO#g&PX%[&PX%_&PXn&PX~P%SOz&kO!Q&jO#g#Wa%[#Wa%_#Wa~Oz&lO#[&nO#g&rX%[&rX%_&rXg&rX~O!f$YO!r$YO#Z&qO%uWO~O#Z&qO~Oz&sO#g&tX%[&tX%_&tX~Oz&uO#g&pX%[&pX%_&pX{&pX~O!X&wO%z&xO~Oz&|On&wX~P%SOn'PO~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO%['UO~P'vOt'YO#p'WO#q'XOP#naV#naf#nah#nao#nas#nav#na!P#na!Q#na!T#na!U#na!X#na!]#na!h#na!r#na!s#na!t#na!{#na!}#na#P#na#R#na#T#na#X#na#Z#na#^#na#_#na#a#na#c#na#l#na#o#na#s#na#u#na#z#na#}#na$P#na%X#na%o#na%p#na%t#na%u#na&Z#na&[#na&]#na&^#na&_#na&`#na&a#na&b#na&c#na&d#na&e#na&f#na&g#na&h#na&i#na&j#na%Z#na%_#na~Oz'ZO#[']O{&xX~Oh'_O!X&wO~Oh!iO{$jO!X&wO~O{'eO~P%SO%['hO%_'hO~OS'iO%['hO%_'hO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%k!]O~P!#uO%kWi~P!#uOV!aO_!aOa!bOh!iO!X!kO!f!mO%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%m!_O%n!_O~P!&pO%mWi%nWi~P!&pOa!bOh!iO!X!kO!f!mOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%mWi%nWi%oWi%pWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~OV!aO_!aO%q!aO%r!aO%s!aO~P!)nOVWi_Wi%qWi%rWi%sWi~P!)nO!T%dO!U%cOg&VXz&VX~O%z'kO%{'kO~P,eOz'mOg&UX~Og'oO~Oz'pO{'rO!W&XX~Oo0cOv0qOz'pO{'sO!W&XX~P'vO!W'uO~Om!oOn!oOo!rOp!sOkjisjizji{ji!xji#gji%[ji%_ji%zji~Ol!qO~P!.aOlji~P!.aOk0eOl0fOm0dOn0dOo0mOp0nO~Ot'wO~P!/jOV'|Og'}Oo0cOv0qO~P'vOg'}Oz(OO~Og(QO~O!U(SO~Og(TOz(OO!T%dO!U%cO~P%SOk0eOl0fOm0dOn0dOo0mOp0nOgqa!Tqa!Uqa%{qa!Wqa![qa!Qqa#[qatqa!mqa~PEcOV'|Oo0cOv0qO!W&Sa~P'vOz(WO!W&Sa~O!W(XO~Oz(WO!T%dO!U%cO!W&Sa~P%SOV(]Oo0cOv0qO![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~P'vOz(^O![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~O![(aO~Oz(^O!T%dO!U%cO![%}a~P%SOz(dO!T%dO!U%cO![&Ta~P%SOz(gO{&lX![&lX!m&lX%z&lX~O{(kO![(mO!m(nO%z(jO~OV&OOopOvqO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~P'vOz(pO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~O!f&UOh&sa%[&saz&sa#[&sa#g&sa%_&sa#Z&sag&sa~O%[(uO~OV#sOa#tO%uWO~Oz&]O{wa~OopOvqO~P'vOz(^O#g%}a%[%}a%_%}ag%}a{%}a![%}a!m%}a%z%}a~P%SOz(zO#g%hX%[%hX%_%hX%z%hX~O%z#|O#gUi%[Ui%_Ui~O#g&Pa%[&Pa%_&Pan&Pa~P'vOz(}O#g&Pa%[&Pa%_&Pan&Pa~O%uWO#g&ra%[&ra%_&rag&ra~Oz)SO#g&ra%[&ra%_&rag&ra~Og)VO~OV)WOh$WO%uWO~O#Z)XO~O%uWO#g&ta%[&ta%_&ta~Oz)ZO#g&ta%[&ta%_&ta~Oo0cOv0qO#g&pa%[&pa%_&pa{&pa~P'vOz)^O#g&pa%[&pa%_&pa{&pa~OV)`Oa)`O%uWO~O%z)eO~Ot)hO#j)gOP#hiV#hif#hih#hio#his#hiv#hi!P#hi!Q#hi!T#hi!U#hi!X#hi!]#hi!h#hi!r#hi!s#hi!t#hi!{#hi!}#hi#P#hi#R#hi#T#hi#X#hi#Z#hi#^#hi#_#hi#a#hi#c#hi#l#hi#o#hi#s#hi#u#hi#z#hi#}#hi$P#hi%X#hi%o#hi%p#hi%t#hi%u#hi&Z#hi&[#hi&]#hi&^#hi&_#hi&`#hi&a#hi&b#hi&c#hi&d#hi&e#hi&f#hi&g#hi&h#hi&i#hi&j#hi%Z#hi%_#hi~Ot)iOP#kiV#kif#kih#kio#kis#kiv#ki!P#ki!Q#ki!T#ki!U#ki!X#ki!]#ki!h#ki!r#ki!s#ki!t#ki!{#ki!}#ki#P#ki#R#ki#T#ki#X#ki#Z#ki#^#ki#_#ki#a#ki#c#ki#l#ki#o#ki#s#ki#u#ki#z#ki#}#ki$P#ki%X#ki%o#ki%p#ki%t#ki%u#ki&Z#ki&[#ki&]#ki&^#ki&_#ki&`#ki&a#ki&b#ki&c#ki&d#ki&e#ki&f#ki&g#ki&h#ki&i#ki&j#ki%Z#ki%_#ki~OV)kOn&wa~P'vOz)lOn&wa~Oz)lOn&wa~P%SOn)pO~O%Y)tO~Ot)wO#p'WO#q)vOP#niV#nif#nih#nio#nis#niv#ni!P#ni!Q#ni!T#ni!U#ni!X#ni!]#ni!h#ni!r#ni!s#ni!t#ni!{#ni!}#ni#P#ni#R#ni#T#ni#X#ni#Z#ni#^#ni#_#ni#a#ni#c#ni#l#ni#o#ni#s#ni#u#ni#z#ni#}#ni$P#ni%X#ni%o#ni%p#ni%t#ni%u#ni&Z#ni&[#ni&]#ni&^#ni&_#ni&`#ni&a#ni&b#ni&c#ni&d#ni&e#ni&f#ni&g#ni&h#ni&i#ni&j#ni%Z#ni%_#ni~OV)zOo0cOv0qO{$jO~P'vOo0cOv0qO{&xa~P'vOz*OO{&xa~OV*SOa*TOg*WO%q*UO%uWO~O{$jO&{*YO~Oh'_O~Oh!iO{$jO~O%[*_O~O%[*aO%_*aO~OV$}Oa$}Oo0cOv0qOg&Ua~P'vOz*dOg&Ua~Oo0cOv0qO{*gO!W&Xa~P'vOz*hO!W&Xa~Oo0cOv0qOz*hO{*kO!W&Xa~P'vOo0cOv0qOz*hO!W&Xa~P'vOz*hO{*kO!W&Xa~Om0dOn0dOo0mOp0nOgjikjisjizji!Tji!Uji%{ji!Wji{ji![ji#gji%[ji%_ji!Qji#[jitji!mji%zji~Ol0fO~P!NkOlji~P!NkOV'|Og*pOo0cOv0qO~P'vOn*rO~Og*pOz*tO~Og*uO~OV'|Oo0cOv0qO!W&Si~P'vOz*vO!W&Si~O!W*wO~OV(]Oo0cOv0qO![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~P'vOz*zO!T%dO!U%cO![&Ti~Oz*}O![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~O![+OO~Oa+QOo0cOv0qO![&Ti~P'vOz*zO![&Ti~O![+SO~OV+UOo0cOv0qO{&la![&la!m&la%z&la~P'vOz+VO{&la![&la!m&la%z&la~O!]+YO&n+[O![!nX~O![+^O~O{(kO![+_O~O{(kO![+_O!m+`O~OV&OOopOvqO{%hq!x%hq#g%hq%[%hq%_%hq%z%hq~P'vOz$ri{$ri!x$ri#g$ri%[$ri%_$ri%z$ri~P%SOV&OOopOvqO~P'vOV&OOo0cOv0qO#g%ha%[%ha%_%ha%z%ha~P'vOz+aO#g%ha%[%ha%_%ha%z%ha~Oz$ia#g$ia%[$ia%_$ian$ia~P%SO#g&Pi%[&Pi%_&Pin&Pi~P'vOz+dO#g#Wq%[#Wq%_#Wq~O#[+eOz$va#g$va%[$va%_$vag$va~O%uWO#g&ri%[&ri%_&rig&ri~Oz+gO#g&ri%[&ri%_&rig&ri~OV+iOh$WO%uWO~O%uWO#g&ti%[&ti%_&ti~Oo0cOv0qO#g&pi%[&pi%_&pi{&pi~P'vO{#{Oz#eX!W#eX~Oz+mO!W&uX~O!W+oO~Ot+rO#j)gOP#hqV#hqf#hqh#hqo#hqs#hqv#hq!P#hq!Q#hq!T#hq!U#hq!X#hq!]#hq!h#hq!r#hq!s#hq!t#hq!{#hq!}#hq#P#hq#R#hq#T#hq#X#hq#Z#hq#^#hq#_#hq#a#hq#c#hq#l#hq#o#hq#s#hq#u#hq#z#hq#}#hq$P#hq%X#hq%o#hq%p#hq%t#hq%u#hq&Z#hq&[#hq&]#hq&^#hq&_#hq&`#hq&a#hq&b#hq&c#hq&d#hq&e#hq&f#hq&g#hq&h#hq&i#hq&j#hq%Z#hq%_#hq~On$|az$|a~P%SOV)kOn&wi~P'vOz+yOn&wi~Oz,TO{$jO#[,TO~O#q,VOP#nqV#nqf#nqh#nqo#nqs#nqv#nq!P#nq!Q#nq!T#nq!U#nq!X#nq!]#nq!h#nq!r#nq!s#nq!t#nq!{#nq!}#nq#P#nq#R#nq#T#nq#X#nq#Z#nq#^#nq#_#nq#a#nq#c#nq#l#nq#o#nq#s#nq#u#nq#z#nq#}#nq$P#nq%X#nq%o#nq%p#nq%t#nq%u#nq&Z#nq&[#nq&]#nq&^#nq&_#nq&`#nq&a#nq&b#nq&c#nq&d#nq&e#nq&f#nq&g#nq&h#nq&i#nq&j#nq%Z#nq%_#nq~O#[,WOz%Oa{%Oa~Oo0cOv0qO{&xi~P'vOz,YO{&xi~O{#{O%z,[Og&zXz&zX~O%uWOg&zXz&zX~Oz,`Og&yX~Og,bO~O%Y,eO~O!T%dO!U%cOg&Viz&Vi~OV$}Oa$}Oo0cOv0qOg&Ui~P'vO{,hOz$la!W$la~Oo0cOv0qO{,iOz$la!W$la~P'vOo0cOv0qO{*gO!W&Xi~P'vOz,lO!W&Xi~Oo0cOv0qOz,lO!W&Xi~P'vOz,lO{,oO!W&Xi~Og$hiz$hi!W$hi~P%SOV'|Oo0cOv0qO~P'vOn,qO~OV'|Og,rOo0cOv0qO~P'vOV'|Oo0cOv0qO!W&Sq~P'vOz$gi![$gi#g$gi%[$gi%_$gig$gi{$gi!m$gi%z$gi~P%SOV(]Oo0cOv0qO~P'vOa+QOo0cOv0qO![&Tq~P'vOz,sO![&Tq~O![,tO~OV(]Oo0cOv0qO![%}q#g%}q%[%}q%_%}qg%}q{%}q!m%}q%z%}q~P'vO{,uO~OV+UOo0cOv0qO{&li![&li!m&li%z&li~P'vOz,zO{&li![&li!m&li%z&li~O!]+YO&n+[O![!na~O{(kO![,}O~OV&OOo0cOv0qO#g%hi%[%hi%_%hi%z%hi~P'vOz-OO#g%hi%[%hi%_%hi%z%hi~O%uWO#g&rq%[&rq%_&rqg&rq~Oz-RO#g&rq%[&rq%_&rqg&rq~OV)`Oa)`O%uWO!W&ua~Oz-TO!W&ua~On$|iz$|i~P%SOV)kO~P'vOV)kOn&wq~P'vOt-XOP#myV#myf#myh#myo#mys#myv#my!P#my!Q#my!T#my!U#my!X#my!]#my!h#my!r#my!s#my!t#my!{#my!}#my#P#my#R#my#T#my#X#my#Z#my#^#my#_#my#a#my#c#my#l#my#o#my#s#my#u#my#z#my#}#my$P#my%X#my%o#my%p#my%t#my%u#my&Z#my&[#my&]#my&^#my&_#my&`#my&a#my&b#my&c#my&d#my&e#my&f#my&g#my&h#my&i#my&j#my%Z#my%_#my~O%Z-]O%_-]O~P`O#q-^OP#nyV#nyf#nyh#nyo#nys#nyv#ny!P#ny!Q#ny!T#ny!U#ny!X#ny!]#ny!h#ny!r#ny!s#ny!t#ny!{#ny!}#ny#P#ny#R#ny#T#ny#X#ny#Z#ny#^#ny#_#ny#a#ny#c#ny#l#ny#o#ny#s#ny#u#ny#z#ny#}#ny$P#ny%X#ny%o#ny%p#ny%t#ny%u#ny&Z#ny&[#ny&]#ny&^#ny&_#ny&`#ny&a#ny&b#ny&c#ny&d#ny&e#ny&f#ny&g#ny&h#ny&i#ny&j#ny%Z#ny%_#ny~Oz-aO{$jO#[-aO~Oo0cOv0qO{&xq~P'vOz-dO{&xq~O%z,[Og&zaz&za~O{#{Og&zaz&za~OV*SOa*TO%q*UO%uWOg&ya~Oz-hOg&ya~O$S-lO~OV$}Oa$}Oo0cOv0qO~P'vOo0cOv0qO{-mOz$li!W$li~P'vOo0cOv0qOz$li!W$li~P'vO{-mOz$li!W$li~Oo0cOv0qO{*gO~P'vOo0cOv0qO{*gO!W&Xq~P'vOz-pO!W&Xq~Oo0cOv0qOz-pO!W&Xq~P'vOs-sO!T%dO!U%cOg&Oq!W&Oq![&Oqz&Oq~P!/jOa+QOo0cOv0qO![&Ty~P'vOz$ji![$ji~P%SOa+QOo0cOv0qO~P'vOV+UOo0cOv0qO~P'vOV+UOo0cOv0qO{&lq![&lq!m&lq%z&lq~P'vO{(kO![-xO!m-yO%z-wO~OV&OOo0cOv0qO#g%hq%[%hq%_%hq%z%hq~P'vO%uWO#g&ry%[&ry%_&ryg&ry~OV)`Oa)`O%uWO!W&ui~Ot-}OP#m!RV#m!Rf#m!Rh#m!Ro#m!Rs#m!Rv#m!R!P#m!R!Q#m!R!T#m!R!U#m!R!X#m!R!]#m!R!h#m!R!r#m!R!s#m!R!t#m!R!{#m!R!}#m!R#P#m!R#R#m!R#T#m!R#X#m!R#Z#m!R#^#m!R#_#m!R#a#m!R#c#m!R#l#m!R#o#m!R#s#m!R#u#m!R#z#m!R#}#m!R$P#m!R%X#m!R%o#m!R%p#m!R%t#m!R%u#m!R&Z#m!R&[#m!R&]#m!R&^#m!R&_#m!R&`#m!R&a#m!R&b#m!R&c#m!R&d#m!R&e#m!R&f#m!R&g#m!R&h#m!R&i#m!R&j#m!R%Z#m!R%_#m!R~Oo0cOv0qO{&xy~P'vOV*SOa*TO%q*UO%uWOg&yi~O$S-lO%Z.VO%_.VO~OV.aOh._O!X.^O!].`O!h.YO!s.[O!t.[O%p.XO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O~Oo0cOv0qOz$lq!W$lq~P'vO{.fOz$lq!W$lq~Oo0cOv0qO{*gO!W&Xy~P'vOz.gO!W&Xy~Oo0cOv.kO~P'vOs-sO!T%dO!U%cOg&Oy!W&Oy![&Oyz&Oy~P!/jO{(kO![.nO~O{(kO![.nO!m.oO~OV*SOa*TO%q*UO%uWO~Oh.tO!f.rOz$TX#[$TX%j$TXg$TX~Os$TX{$TX!W$TX![$TX~P$-bO%o.vO%p.vOs$UXz$UX{$UX#[$UX%j$UX!W$UXg$UX![$UX~O!h.xO~Oz.|O#[/OO%j.yOs&|X{&|X!W&|Xg&|X~Oa/RO~P$)zOh.tOs&}Xz&}X{&}X#[&}X%j&}X!W&}Xg&}X![&}X~Os/VO{$jO~Oo0cOv0qOz$ly!W$ly~P'vOo0cOv0qO{*gO!W&X!R~P'vOz/ZO!W&X!R~Og&RXs&RX!T&RX!U&RX!W&RX![&RXz&RX~P!/jOs-sO!T%dO!U%cOg&Qa!W&Qa![&Qaz&Qa~O{(kO![/^O~O!f.rOh$[as$[az$[a{$[a#[$[a%j$[a!W$[ag$[a![$[a~O!h/eO~O%o.vO%p.vOs$Uaz$Ua{$Ua#[$Ua%j$Ua!W$Uag$Ua![$Ua~O%j.yOs$Yaz$Ya{$Ya#[$Ya!W$Yag$Ya![$Ya~Os&|a{&|a!W&|ag&|a~P$)nOz/jOs&|a{&|a!W&|ag&|a~O!W/mO~Og/mO~O{/oO~O![/pO~Oo0cOv0qO{*gO!W&X!Z~P'vO{/sO~O%z/tO~P$-bOz/uO#[/OO%j.yOg'PX~Oz/uOg'PX~Og/wO~O!h/xO~O#[/OOs%Saz%Sa{%Sa%j%Sa!W%Sag%Sa![%Sa~O#[/OO%j.yOs%Waz%Wa{%Wa!W%Wag%Wa~Os&|i{&|i!W&|ig&|i~P$)nOz/zO#[/OO%j.yO!['Oa~Og'Pa~P$)nOz0SOg'Pa~Oa0UO!['Oi~P$)zOz0WO!['Oi~Oz0WO#[/OO%j.yO!['Oi~O#[/OO%j.yOg$biz$bi~O%z0ZO~P$-bO#[/OO%j.yOg%Vaz%Va~Og'Pi~P$)nO{0^O~Oa0UO!['Oq~P$)zOz0`O!['Oq~O#[/OO%j.yOz%Ui![%Ui~Oa0UO~P$)zOa0UO!['Oy~P$)zO#[/OO%j.yOg$ciz$ci~O#[/OO%j.yOz%Uq![%Uq~Oz+aO#g%ha%[%ha%_%ha%z%ha~P%SOV&OOo0cOv0qO~P'vOn0hO~Oo0hO~P'vO{0iO~Ot0jO~P!/jO&]&Z&j&h&i&g&f&d&e&c&b&`&a&_&^&[%u~",goto:"!=j'QPPPPPP'RP'Z*s+[+t,_,y-fP.SP'Z.r.r'ZPPP'Z2[PPPPPP2[5PPP5PP7b7k=sPP=v>h>kPP'Z'ZPP>zPP'Z'ZPP'Z'Z'Z'Z'Z?O?w'ZP?zP@QDXGuGyPG|HWH['ZPPPH_Hk'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPHqH}IVPI^IdPI^PI^I^PPPI^PKrPK{LVL]KrPI^LfPI^PLmLsPLwM]MzNeLwLwNkNxLwLwLwLw! ^! d! g! l! o! y!!P!!]!!o!!u!#P!#V!#s!#y!$P!$Z!$a!$g!$y!%T!%Z!%a!%k!%q!%w!%}!&T!&Z!&e!&k!&u!&{!'U!'[!'k!'s!'}!(UPPPPPPPPPPP!([!(_!(e!(n!(x!)TPPPPPPPPPPPP!-u!/Z!3^!6oPP!6w!7W!7a!8Y!8P!8c!8i!8l!8o!8r!8z!9jPPPPPPPPPPPPPPPPP!9m!9q!9wP!:]!:a!:m!:v!;S!;j!;m!;p!;v!;|!_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To+PZS_&n`OY*xYZ%TZ]*x]^%T^#o*x#o#p+r#p#q*x#q#r+r#r;'S*x;'S;=`,^<%lO*x_+wTS_OY+rZ]+r^;'S+r;'S;=`,W<%lO+r_,ZP;=`<%l+ro,aP;=`<%l*xj,kV%rQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-XT!xY&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-oV%lQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.]V&n`&ZZOw%Twx.rx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.wV&n`Ow%Twx/^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/eT&n`&]ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/{ThZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc0cTgR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk0yXVZ&n`Oz%Tz{1f{!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk1mVaR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk2ZV%oZ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc2wTzR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To3_W%pZ&n`O!_%T!_!`-Q!`!a3w!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Td4OT&{S&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk4fX!fQ&n`O!O%T!O!P5R!P!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5WV&n`O!O%T!O!P5m!P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5tT!rZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti6[a!hX&n`O!Q%T!Q![6T![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S6T#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti7fZ&n`O{%T{|8X|}%T}!O8X!O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8^V&n`O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8z]!hX&n`O!Q%T!Q![8s![!l%T!l!m9s!m#R%T#R#S8s#S#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti9zT!hX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk:bX%qR&n`O!P%T!P!Q:}!Q!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj;UV%sQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti;ro!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!d%T!d!e?q!e!g%T!g!h7a!h!l%T!l!m9s!m!q%T!q!rA]!r!z%T!z!{Bq!{#R%T#R#S>_#S#U%T#U#V?q#V#X%T#X#Y7a#Y#^%T#^#_9s#_#c%T#c#dA]#d#l%T#l#mBq#m#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti=xV&n`O!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti>fc!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S>_#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti?vY&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti@mY!hX&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiAbX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBUX!hX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBv]&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiCv]!hX&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToDvV{_&n`O!_%T!_!`E]!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TcEdT%{R&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkEzT#gZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkFbXmR&n`O!^%T!^!_F}!_!`([!`!a([!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjGUV%mQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkGrV%zZ&n`O!_%T!_!`([!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkH`WmR&n`O!_%T!_!`([!`!aHx!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjIPV%nQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkIoV_Q#}P&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToJ_]&n`&YS%uZO!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoKZP;=`<%lJUoKge&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!tJU!t!uLx!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#gLx#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoMRa&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUkN_V&n`&`ZOr%TrsNts#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkNyV&n`Or%Trs! `s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! gT&n`&bZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! }V&n`&_ZOw%Twx!!dx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!!iV&n`Ow%Twx!#Ox#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!#VT&n`&aZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!#oe&n`&YS%uZOr%Trs!%Qsw%Twx!&px!Q%T!Q![JU![!c%T!c!tJU!t!u!(`!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#g!(`#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!%XV&n`&dZOr%Trs!%ns#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!%sV&n`Or%Trs!&Ys#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&aT&n`&fZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&wV&n`&cZOw%Twx!'^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!'cV&n`Ow%Twx!'xx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!(PT&n`&eZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!(ia&n`&YS%uZOr%Trs!)nsw%Twx!+^x!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!)uV&n`&hZOr%Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[A6t,O6t,k6t,T6t,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:e=>N6t[e]||-1}],tokenPrec:7668}),Nse=new Mq,g6e=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function aj(e){return(t,n,i)=>{if(i)return!1;let r=t.node.getChild("VariableName");return r&&n(r,e),!0}}const I6t={FunctionDefinition:aj("function"),ClassDefinition:aj("class"),ForStatement(e,t,n){if(n){for(let i=e.node.firstChild;i;i=i.nextSibling)if(i.name=="VariableName")t(i,"variable");else if(i.name=="in")break}},ImportStatement(e,t){var n,i;let{node:r}=e,s=((n=r.firstChild)===null||n===void 0?void 0:n.name)=="from";for(let o=r.getChild("import");o;o=o.nextSibling)o.name=="VariableName"&&((i=o.nextSibling)===null||i===void 0?void 0:i.name)!="as"&&t(o,s?"variable":"namespace")},AssignStatement(e,t){for(let n=e.node.firstChild;n;n=n.nextSibling)if(n.name=="VariableName")t(n,"variable");else if(n.name==":"||n.name=="AssignOp")break},ParamList(e,t){for(let n=null,i=e.node.firstChild;i;i=i.nextSibling)i.name=="VariableName"&&(!n||!/\*|AssignOp/.test(n.name))&&t(i,"variable"),n=i},CapturePattern:aj("variable"),AsPattern:aj("variable"),__proto__:null};function b6e(e,t){let n=Nse.get(t);if(n)return n;let i=[],r=!0;function s(o,l){let c=e.sliceString(o.from,o.to);i.push({label:c,type:l})}return t.cursor(Ar.IncludeAnonymous).iterate(o=>{if(o.name){let l=I6t[o.name];if(l&&l(o,s,r)||!r&&g6e.has(o.name))return!1;r=!1}else if(o.to-o.from>8192){for(let l of b6e(e,o.node))i.push(l);return!1}}),Nse.set(t,i),i}const Rse=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,y6e=["String","FormatString","Comment","PropertyName"];function P6t(e){let t=es(e.state).resolveInner(e.pos,-1);if(y6e.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&Rse.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let i=[];for(let r=t;r;r=r.parent)g6e.has(r.name)&&(i=i.concat(b6e(e.state.doc,r)));return{options:i,from:n?t.from:e.pos,validFor:Rse}}const D6t=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(e=>({label:e,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(e=>({label:e,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(e=>({label:e,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(e=>({label:e,type:"function"}))),M6t=[Xs("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),Xs("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),Xs("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),Xs("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),Xs(`if \${}: -`,{label:"if",detail:"block",type:"keyword"}),Xs("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),Xs("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),Xs("import ${module}",{label:"import",detail:"statement",type:"keyword"}),Xs("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],M6t=H4e(b6e,cW(P6t.concat(D6t)));function P$(e){let{node:t,pos:n}=e,i=e.lineIndent(n,-1),r=null;for(;;){let s=t.childBefore(n);if(s)if(s.name=="Comment")n=s.from;else if(s.name=="Body"||s.name=="MatchBody")e.baseIndentFor(s)+e.unit<=i&&(r=s),t=s;else if(s.name=="MatchClause")t=s;else if(s.type.is("Statement"))t=s;else break;else break}return r}function D$(e,t){let n=e.baseIndentFor(t),i=e.lineAt(e.pos,-1),r=i.from+i.text.length;return/^\s*($|#)/.test(i.text)&&e.node.ton?null:n+e.unit}const M$=am.define({name:"python",parser:N6t.configure({props:[xm.add({Body:e=>{var t;let n=/^\s*(#|$)/.test(e.textAfter)&&P$(e)||e.node;return(t=D$(e,n))!==null&&t!==void 0?t:e.continue()},MatchBody:e=>{var t;let n=P$(e);return(t=D$(e,n||e.node))!==null&&t!==void 0?t:e.continue()},IfStatement:e=>/^\s*(else:|elif )/.test(e.textAfter)?e.baseIndent:e.continue(),"ForStatement WhileStatement":e=>/^\s*else:/.test(e.textAfter)?e.baseIndent:e.continue(),TryStatement:e=>/^\s*(except[ :]|finally:|else:)/.test(e.textAfter)?e.baseIndent:e.continue(),MatchStatement:e=>/^\s*case /.test(e.textAfter)?e.baseIndent+e.unit:e.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":kw({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":kw({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":kw({closing:"]"}),MemberExpression:e=>e.baseIndent+e.unit,"String FormatString":()=>null,Script:e=>{var t;let n=P$(e);return(t=n&&D$(e,n))!==null&&t!==void 0?t:e.continue()}}),wm.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":PT,Body:(e,t)=>({from:e.from+1,to:e.to-(e.to==t.doc.length?0:1)}),"String FormatString":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function L6t(){return new mb(M$,[M$.data.of({autocomplete:I6t}),M$.data.of({autocomplete:M6t})])}const fx=63,Ise=64,$6t=1,F6t=2,y6e=3,B6t=4,v6e=5,U6t=6,Q6t=7,x6e=65,z6t=66,V6t=8,H6t=9,q6t=10,W6t=11,K6t=12,w6e=13,G6t=19,X6t=20,Y6t=29,Z6t=33,J6t=34,eFt=47,tFt=0,NW=1,g7=2,tA=3,b7=4;class vy{constructor(t,n,i){this.parent=t,this.depth=n,this.type=i,this.hash=(t?t.hash+t.hash<<8:0)+n+(n<<4)+i}}vy.top=new vy(null,-1,tFt);function jE(e,t){for(let n=0,i=t-e.pos-1;;i--,n++){let r=e.peek(i);if(lm(r)||r==-1)return n}}function y7(e){return e==32||e==9}function lm(e){return e==10||e==13}function k6e(e){return y7(e)||lm(e)}function Ry(e){return e<0||k6e(e)}const nFt=new nL({start:vy.top,reduce(e,t){return e.type==tA&&(t==X6t||t==J6t)?e.parent:e},shift(e,t,n,i){if(t==y6e)return new vy(e,jE(i,i.pos),NW);if(t==x6e||t==v6e)return new vy(e,jE(i,i.pos),g7);if(t==fx)return e.parent;if(t==G6t||t==Z6t)return new vy(e,0,tA);if(t==w6e&&e.type==b7)return e.parent;if(t==eFt){let r=/[1-9]/.exec(i.read(i.pos,n.pos));if(r)return new vy(e,e.depth+ +r[0],b7)}return e},hash(e){return e.hash}});function w1(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&Ry(e.peek(n+3))}const iFt=new Ma((e,t)=>{if(e.next==-1&&t.canShift(Ise))return e.acceptToken(Ise);let n=e.peek(-1);if((lm(n)||n<0)&&t.context.type!=tA){if(w1(e,45))if(t.canShift(fx))e.acceptToken(fx);else return e.acceptToken($6t,3);if(w1(e,46))if(t.canShift(fx))e.acceptToken(fx);else return e.acceptToken(F6t,3);let i=0;for(;e.next==32;)i++,e.advance();(i{if(t.context.type==tA){e.next==63&&(e.advance(),Ry(e.next)&&e.acceptToken(Q6t));return}if(e.next==45)e.advance(),Ry(e.next)&&e.acceptToken(t.context.type==NW&&t.context.depth==jE(e,e.pos-1)?B6t:y6e);else if(e.next==63)e.advance(),Ry(e.next)&&e.acceptToken(t.context.type==g7&&t.context.depth==jE(e,e.pos-1)?U6t:v6e);else{let n=e.pos;for(;;)if(y7(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)O6e(e);else if(e.next==38)v7(e);else if(e.next==42){v7(e);break}else if(e.next==39||e.next==34){if(RW(e,!0))break;return}else if(e.next==91||e.next==123){if(!aFt(e))return;break}else{S6e(e,!0,!1,0);break}for(;y7(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(Y6t))return;let i=e.peek(1);Ry(i)&&e.acceptTokenTo(t.context.type==g7&&t.context.depth==jE(e,n)?z6t:x6e,n)}}},{contextual:!0});function sFt(e){return e>32&&e<127&&e!=34&&e!=37&&e!=44&&e!=60&&e!=62&&e!=92&&e!=94&&e!=96&&e!=123&&e!=124&&e!=125}function Pse(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function Dse(e,t){return e.next==37?(e.advance(),Pse(e.next)&&e.advance(),Pse(e.next)&&e.advance(),!0):sFt(e.next)||t&&e.next==44?(e.advance(),!0):!1}function O6e(e){if(e.advance(),e.next==60){for(e.advance();;)if(!Dse(e,!0)){e.next==62&&e.advance();break}}else for(;Dse(e,!1););}function v7(e){for(e.advance();!Ry(e.next)&&uP(e.next)!="f";)e.advance()}function RW(e,t){let n=e.next,i=!1,r=e.pos;for(e.advance();;){let s=e.next;if(s<0)break;if(e.advance(),s==n)if(s==39)if(e.next==39)e.advance();else break;else break;else if(s==92&&n==34)e.next>=0&&e.advance();else if(lm(s)){if(t)return!1;i=!0}else if(t&&e.pos>=r+1024)return!1}return!i}function aFt(e){for(let t=[],n=e.pos+1024;;)if(e.next==91||e.next==123)t.push(e.next),e.advance();else if(e.next==39||e.next==34){if(!RW(e,!0))return!1}else if(e.next==93||e.next==125){if(t[t.length-1]!=e.next-2)return!1;if(t.pop(),e.advance(),!t.length)return!0}else{if(e.next<0||e.pos>n||lm(e.next))return!1;e.advance()}}const oFt="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function uP(e){return e<33?"u":e>125?"s":oFt[e-33]}function L$(e,t){let n=uP(e);return n!="u"&&!(t&&n=="f")}function S6e(e,t,n,i){if(uP(e.next)=="s"||(e.next==63||e.next==58||e.next==45)&&L$(e.peek(1),n))e.advance();else return!1;let r=e.pos;for(;;){let s=e.next,o=0,l=i+1;for(;k6e(s);){if(lm(s)){if(t)return!1;l=0}else l++;s=e.peek(++o)}if(!(s>=0&&(s==58?L$(e.peek(o+1),n):s==35?e.peek(o-1)!=32:L$(s,n)))||!n&&l<=i||l==0&&!n&&(w1(e,45,o)||w1(e,46,o)))break;if(t&&uP(s)=="f")return!1;for(let u=o;u>=0;u--)e.advance();if(t&&e.pos>r+1024)return!1}return!0}const lFt=new Ma((e,t)=>{if(e.next==33)O6e(e),e.acceptToken(K6t);else if(e.next==38||e.next==42){let n=e.next==38?q6t:W6t;v7(e),e.acceptToken(n)}else e.next==39||e.next==34?(RW(e,!1),e.acceptToken(H6t)):S6e(e,!1,t.context.type==tA,t.context.depth)&&e.acceptToken(V6t)}),cFt=new Ma((e,t)=>{let n=t.context.type==b7?t.context.depth:-1,i=e.pos;e:for(;;){let r=0,s=e.next;for(;s==32;)s=e.peek(++r);if(!r&&(w1(e,45,r)||w1(e,46,r))||!lm(s)&&(n<0&&(n=Math.max(t.context.depth+1,r)),rYAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:nFt,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[uFt],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[iFt,rFt,lFt,cFt,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),fFt=am.define({name:"yaml",parser:dFt.configure({props:[xm.add({Stream:e=>{for(let t=e.node.resolve(e.pos,-1);t&&t.to>=e.pos;t=t.parent){if(t.name=="BlockLiteralContent"&&t.frome.pos)return null}}return null},FlowMapping:kw({closing:"}"}),FlowSequence:kw({closing:"]"})}),wm.add({"FlowMapping FlowSequence":PT,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function hFt(){return new mb(fFt)}function pFt(e){E6e(e,"start");var t={},n=e.languageData||{},i=!1;for(var r in e)if(r!=n&&e.hasOwnProperty(r))for(var s=t[r]=[],o=e[r],l=0;l2&&o.token&&typeof o.token!="string"){n.pending=[];for(var u=2;u-1)return null;var r=n.indent.length-1,s=e[n.state];e:for(;;){for(var o=0;o{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),i=PW(e.state,n.from);return i.line?jFt(e):i.block?RFt(e):!1};function IW(e,t){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let r=e(t,n);return r?(i(n.update(r)),!0):!1}}const jFt=IW(DFt,0),NFt=IW(j6e,0),RFt=IW((e,t)=>j6e(e,t,PFt(t)),0);function PW(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const RO=50;function IFt(e,{open:t,close:n},i,r){let s=e.sliceDoc(i-RO,i),o=e.sliceDoc(r,r+RO),l=/\s*$/.exec(s)[0].length,c=/^\s*/.exec(o)[0].length,u=s.length-l;if(s.slice(u-t.length,u)==t&&o.slice(c,c+n.length)==n)return{open:{pos:i-l,margin:l&&1},close:{pos:r+c,margin:c&&1}};let d,f;r-i<=2*RO?d=f=e.sliceDoc(i,r):(d=e.sliceDoc(i,i+RO),f=e.sliceDoc(r-RO,r));let h=/^\s*/.exec(d)[0].length,m=/\s*$/.exec(f)[0].length,g=f.length-m-n.length;return d.slice(h,h+t.length)==t&&f.slice(g,g+n.length)==n?{open:{pos:i+h+t.length,margin:/\s/.test(d.charAt(h+t.length))?1:0},close:{pos:r-m-n.length,margin:/\s/.test(f.charAt(g-1))?1:0}}:null}function PFt(e){let t=[];for(let n of e.selection.ranges){let i=e.doc.lineAt(n.from),r=n.to<=i.to?i:e.doc.lineAt(n.to);r.from>i.from&&r.from==n.to&&(r=n.to==i.to+1?i:e.doc.lineAt(n.to-1));let s=t.length-1;s>=0&&t[s].to>i.from?t[s].to=r.to:t.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return t}function j6e(e,t,n=t.selection.ranges){let i=n.map(s=>PW(t,s.from).block);if(!i.every(s=>s))return null;let r=n.map((s,o)=>IFt(t,i[o],s.from,s.to));if(e!=2&&!r.every(s=>s))return{changes:t.changes(n.map((s,o)=>r[o]?[]:[{from:s.from,insert:i[o].open+" "},{from:s.to,insert:" "+i[o].close}]))};if(e!=1&&r.some(s=>s)){let s=[];for(let o=0,l;or&&(s==o||o>f.from)){r=f.from;let h=/^\s*/.exec(f.text)[0].length,m=h==f.length,g=f.text.slice(h,h+u.length)==u?h:-1;hs.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:l,token:c,indent:u,empty:d,single:f}of i)(f||!d)&&s.push({from:l.from+u,insert:c+" "});let o=t.changes(s);return{changes:o,selection:t.selection.map(o,1)}}else if(e!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:l,token:c}of i)if(l>=0){let u=o.from+l,d=u+c.length;o.text[d-o.from]==" "&&d++,s.push({from:u,to:d})}return{changes:s}}return null}const w7=Dh.define(),MFt=Dh.define(),LFt=pn.define(),N6e=pn.define({combine(e){return Mh(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(i,r)=>t(i,r)||n(i,r)})}}),R6e=pl.define({create(){return fh.empty},update(e,t){let n=t.state.facet(N6e),i=t.annotation(w7);if(i){let c=Ic.fromTransaction(t,i.selection),u=i.side,d=u==0?e.undone:e.done;return c?d=dP(d,d.length,n.minDepth,c):d=D6e(d,t.startState.selection),new fh(u==0?i.rest:d,u==0?d:i.rest)}let r=t.annotation(MFt);if((r=="full"||r=="before")&&(e=e.isolate()),t.annotation(Ya.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let s=Ic.fromTransaction(t),o=t.annotation(Ya.time),l=t.annotation(Ya.userEvent);return s?e=e.addChanges(s,o,l,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,l,n.newGroupDelay)),(r=="full"||r=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new fh(e.done.map(Ic.fromJSON),e.undone.map(Ic.fromJSON))}});function $Ft(e={}){return[R6e,N6e.of(e),Jt.domEventHandlers({beforeinput(t,n){let i=t.inputType=="historyUndo"?I6e:t.inputType=="historyRedo"?k7:null;return i?(t.preventDefault(),i(n)):!1}})]}function aL(e,t){return function({state:n,dispatch:i}){if(!t&&n.readOnly)return!1;let r=n.field(R6e,!1);if(!r)return!1;let s=r.pop(e,n,t);return s?(i(s),!0):!1}}const I6e=aL(0,!1),k7=aL(1,!1),FFt=aL(0,!0),BFt=aL(1,!0);class Ic{constructor(t,n,i,r,s){this.changes=t,this.effects=n,this.mapped=i,this.startSelection=r,this.selectionsAfter=s}setSelAfter(t){return new Ic(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,i;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(t){return new Ic(t.changes&&co.fromJSON(t.changes),[],t.mapped&&xh.fromJSON(t.mapped),t.startSelection&&pt.fromJSON(t.startSelection),t.selectionsAfter.map(pt.fromJSON))}static fromTransaction(t,n){let i=vd;for(let r of t.startState.facet(LFt)){let s=r(t);s.length&&(i=i.concat(s))}return!i.length&&t.changes.empty?null:new Ic(t.changes.invert(t.startState.doc),i,void 0,n||t.startState.selection,vd)}static selection(t){return new Ic(void 0,vd,void 0,void 0,t)}}function dP(e,t,n,i){let r=t+1>n+20?t-n-1:0,s=e.slice(r,t);return s.push(i),s}function UFt(e,t){let n=[],i=!1;return e.iterChangedRanges((r,s)=>n.push(r,s)),t.iterChangedRanges((r,s,o,l)=>{for(let c=0;c=u&&o<=d&&(i=!0)}}),i}function QFt(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,i)=>n.empty!=t.ranges[i].empty).length===0}function P6e(e,t){return e.length?t.length?e.concat(t):e:t}const vd=[],zFt=200;function D6e(e,t){if(e.length){let n=e[e.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-zFt));return i.length&&i[i.length-1].eq(t)?e:(i.push(t),dP(e,e.length-1,1e9,n.setSelAfter(i)))}else return[Ic.selection([t])]}function VFt(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function $$(e,t){if(!e.length)return e;let n=e.length,i=vd;for(;n;){let r=HFt(e[n-1],t,i);if(r.changes&&!r.changes.empty||r.effects.length){let s=e.slice(0,n);return s[n-1]=r,s}else t=r.mapped,n--,i=r.selectionsAfter}return i.length?[Ic.selection(i)]:vd}function HFt(e,t,n){let i=P6e(e.selectionsAfter.length?e.selectionsAfter.map(l=>l.map(t)):vd,n);if(!e.changes)return Ic.selection(i);let r=e.changes.map(t),s=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(s):s;return new Ic(r,hi.mapEffects(e.effects,t),o,e.startSelection.map(s),i)}const qFt=/^(input\.type|delete)($|\.)/;class fh{constructor(t,n,i=0,r=void 0){this.done=t,this.undone=n,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new fh(this.done,this.undone):this}addChanges(t,n,i,r,s){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&t.changes&&(!i||qFt.test(i))&&(!l.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?e.moveByChar(n,t):oL(n,t))}function Rl(e){return e.textDirectionAt(e.state.selection.main.head)==cs.LTR}const L6e=e=>M6e(e,!Rl(e)),$6e=e=>M6e(e,Rl(e));function F6e(e,t){return jf(e,n=>n.empty?e.moveByGroup(n,t):oL(n,t))}const KFt=e=>F6e(e,!Rl(e)),GFt=e=>F6e(e,Rl(e));function XFt(e,t,n){if(t.type.prop(n))return!0;let i=t.to-t.from;return i&&(i>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function lL(e,t,n){let i=es(e).resolveInner(t.head),r=n?li.closedBy:li.openedBy;for(let c=t.head;;){let u=n?i.childAfter(c):i.childBefore(c);if(!u)break;XFt(e,u,r)?i=u:c=n?u.to:u.from}let s=i.type.prop(r),o,l;return s&&(o=n?dh(e,i.from,1):dh(e,i.to,-1))&&o.matched?l=n?o.end.to:o.end.from:l=n?i.to:i.from,pt.cursor(l,n?-1:1)}const YFt=e=>jf(e,t=>lL(e.state,t,!Rl(e))),ZFt=e=>jf(e,t=>lL(e.state,t,Rl(e)));function B6e(e,t){return jf(e,n=>{if(!n.empty)return oL(n,t);let i=e.moveVertically(n,t);return i.head!=n.head?i:e.moveToLineBoundary(n,t)})}const U6e=e=>B6e(e,!1),Q6e=e=>B6e(e,!0);function z6e(e){let t=e.scrollDOM.clientHeighto.empty?e.moveVertically(o,t,n.height):oL(o,t));if(r.eq(i.selection))return!1;let s;if(n.selfScroll){let o=e.coordsAtPos(i.selection.main.head),l=e.scrollDOM.getBoundingClientRect(),c=l.top+n.marginTop,u=l.bottom-n.marginBottom;o&&o.top>c&&o.bottomV6e(e,!1),O7=e=>V6e(e,!0);function jb(e,t,n){let i=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,n);if(r.head==t.head&&r.head!=(n?i.to:i.from)&&(r=e.moveToLineBoundary(t,n,!1)),!n&&r.head==i.from&&i.length){let s=/^\s*/.exec(e.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&t.head!=i.from+s&&(r=pt.cursor(i.from+s))}return r}const JFt=e=>jf(e,t=>jb(e,t,!0)),e8t=e=>jf(e,t=>jb(e,t,!1)),t8t=e=>jf(e,t=>jb(e,t,!Rl(e))),n8t=e=>jf(e,t=>jb(e,t,Rl(e))),i8t=e=>jf(e,t=>pt.cursor(e.lineBlockAt(t.head).from,1)),r8t=e=>jf(e,t=>pt.cursor(e.lineBlockAt(t.head).to,-1));function s8t(e,t,n){let i=!1,r=vk(e.selection,s=>{let o=dh(e,s.head,-1)||dh(e,s.head,1)||s.head>0&&dh(e,s.head-1,1)||s.heads8t(e,t);function Md(e,t,n){let i=vk(e.state.selection,r=>{r.undirectional&&r.head>=r.anchor!=t&&(r=pt.range(r.head,r.anchor));let s=n(r);return pt.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return i.eq(e.state.selection)?!1:(e.dispatch(_f(e.state,i)),!0)}function H6e(e,t){return Md(e,t,n=>e.moveByChar(n,t))}const q6e=e=>H6e(e,!Rl(e)),W6e=e=>H6e(e,Rl(e));function K6e(e,t){return Md(e,t,n=>e.moveByGroup(n,t))}const o8t=e=>K6e(e,!Rl(e)),l8t=e=>K6e(e,Rl(e)),c8t=e=>{let t=!Rl(e);return Md(e,t,n=>lL(e.state,n,t))},u8t=e=>{let t=Rl(e);return Md(e,t,n=>lL(e.state,n,t))};function G6e(e,t){return Md(e,t,n=>e.moveVertically(n,t))}const X6e=e=>G6e(e,!1),Y6e=e=>G6e(e,!0);function Z6e(e,t){return Md(e,t,n=>e.moveVertically(n,t,z6e(e).height))}const Lse=e=>Z6e(e,!1),$se=e=>Z6e(e,!0),d8t=e=>Md(e,!0,t=>jb(e,t,!0)),f8t=e=>Md(e,!1,t=>jb(e,t,!1)),h8t=e=>{let t=!Rl(e);return Md(e,t,n=>jb(e,n,t))},p8t=e=>{let t=Rl(e);return Md(e,t,n=>jb(e,n,t))},m8t=e=>Md(e,!1,t=>pt.cursor(e.lineBlockAt(t.head).from)),g8t=e=>Md(e,!0,t=>pt.cursor(e.lineBlockAt(t.head).to)),Fse=({state:e,dispatch:t})=>(t(_f(e,{anchor:0})),!0),Bse=({state:e,dispatch:t})=>(t(_f(e,{anchor:e.doc.length})),!0),Use=({state:e,dispatch:t})=>(t(_f(e,{anchor:e.selection.main.anchor,head:0})),!0),Qse=({state:e,dispatch:t})=>(t(_f(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),b8t=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),y8t=({state:e,dispatch:t})=>{let n=cL(e).map(({from:i,to:r})=>pt.range(i,Math.min(r+1,e.doc.length)));return t(e.update({selection:pt.create(n),userEvent:"select"})),!0},v8t=({state:e,dispatch:t})=>{let n=vk(e.selection,i=>{let r=es(e),s=r.resolveStack(i.from,1);if(i.empty){let o=r.resolveStack(i.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:l}=o;if((l.from=i.to||l.to>i.to&&l.from<=i.from)&&o.next)return pt.range(l.to,l.from)}return i});return n.eq(e.selection)?!1:(t(_f(e,n)),!0)};function J6e(e,t){let{state:n}=e,i=n.selection,r=n.selection.ranges.slice();for(let s of n.selection.ranges){let o=n.doc.lineAt(s.head);if(t?o.to0)for(let l=s;;){let c=e.moveVertically(l,t);if(c.heado.to){r.some(u=>u.head==c.head)||r.push(c);break}else{if(c.head==l.head)break;l=c}}}return r.length==i.ranges.length?!1:(e.dispatch(_f(n,pt.create(r,r.length-1))),!0)}const x8t=e=>J6e(e,!1),w8t=e=>J6e(e,!0),k8t=({state:e,dispatch:t})=>{let n=e.selection,i=null;return n.ranges.length>1?i=pt.create([n.main]):n.main.empty||(i=pt.create([pt.cursor(n.main.head)])),i?(t(_f(e,i)),!0):!1};function $T(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:i}=e,r=i.changeByRange(s=>{let{from:o,to:l}=s;if(o==l){let c=t(s);co&&(n="delete.forward",c=oj(e,c,!0)),o=Math.min(o,c),l=Math.max(l,c)}else o=oj(e,o,!1),l=oj(e,l,!0);return o==l?{range:s}:{changes:{from:o,to:l},range:pt.cursor(o,or(e)))i.between(t,t,(r,s)=>{rt&&(t=n?s:r)});return t}const eFe=(e,t,n)=>$T(e,i=>{let r=i.from,{state:s}=e,o=s.doc.lineAt(r),l,c;if(n&&!t&&r>o.from&&reFe(e,!1,!0),tFe=e=>eFe(e,!0,!1),nFe=(e,t)=>$T(e,n=>{let i=n.head,{state:r}=e,s=r.doc.lineAt(i),o=r.charCategorizer(i);for(let l=null;;){if(i==(t?s.to:s.from)){i==n.head&&s.number!=(t?r.doc.lines:1)&&(i+=t?1:-1);break}let c=Lo(s.text,i-s.from,t)+s.from,u=s.text.slice(Math.min(i,c)-s.from,Math.max(i,c)-s.from),d=o(u);if(l!=null&&d!=l)break;(u!=" "||i!=n.head)&&(l=d),i=c}return i}),iFe=e=>nFe(e,!1),O8t=e=>nFe(e,!0),S8t=e=>$T(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head$T(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),C8t=e=>$T(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head{if(e.readOnly)return!1;let n=e.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:Or.of(["",""])},range:pt.cursor(i.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},T8t=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(i=>{if(!i.empty||i.from==0||i.from==e.doc.length)return{range:i};let r=i.from,s=e.doc.lineAt(r),o=r==s.from?r-1:Lo(s.text,r-s.from,!1)+s.from,l=r==s.to?r+1:Lo(s.text,r-s.from,!0)+s.from;return{changes:{from:o,to:l,insert:e.doc.slice(r,l).append(e.doc.slice(o,r))},range:pt.cursor(l)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function cL(e){let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.from),s=e.doc.lineAt(i.to);if(!i.empty&&i.to==s.from&&(s=e.doc.lineAt(i.to-1)),n>=r.number){let o=t[t.length-1];o.to=s.to,o.ranges.push(i)}else t.push({from:r.from,to:s.to,ranges:[i]});n=s.number+1}return t}function rFe(e,t,n){if(e.readOnly)return!1;let i=[],r=[];for(let s of cL(e)){if(n?s.to==e.doc.length:s.from==0)continue;let o=e.doc.lineAt(n?s.to+1:s.from-1),l=o.length+1;if(n){i.push({from:s.to,to:o.to},{from:s.from,insert:o.text+e.lineBreak});for(let c of s.ranges)r.push(pt.range(Math.min(e.doc.length,c.anchor+l),Math.min(e.doc.length,c.head+l)))}else{i.push({from:o.from,to:s.from},{from:s.to,insert:e.lineBreak+o.text});for(let c of s.ranges)r.push(pt.range(c.anchor-l,c.head-l))}}return i.length?(t(e.update({changes:i,scrollIntoView:!0,selection:pt.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const _8t=({state:e,dispatch:t})=>rFe(e,t,!1),j8t=({state:e,dispatch:t})=>rFe(e,t,!0);function sFe(e,t,n){if(e.readOnly)return!1;let i=[];for(let s of cL(e))n?i.push({from:s.from,insert:e.doc.slice(s.from,s.to)+e.lineBreak}):i.push({from:s.to,insert:e.lineBreak+e.doc.slice(s.from,s.to)});let r=e.changes(i);return t(e.update({changes:r,selection:e.selection.map(r,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const N8t=({state:e,dispatch:t})=>sFe(e,t,!1),R8t=({state:e,dispatch:t})=>sFe(e,t,!0),I8t=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(cL(t).map(({from:r,to:s})=>(r>0?r--:s{let s;if(e.lineWrapping){let o=e.lineBlockAt(r.head),l=e.coordsAtPos(r.head,r.assoc||1);l&&(s=o.bottom+e.documentTop-l.bottom+e.defaultLineHeight/2)}return e.moveVertically(r,!0,s)}).map(n);return e.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function P8t(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=es(e).resolveInner(t),i=n.childBefore(t),r=n.childAfter(t),s;return i&&r&&i.to<=t&&r.from>=t&&(s=i.type.prop(li.closedBy))&&s.indexOf(r.name)>-1&&e.doc.lineAt(i.to).from==e.doc.lineAt(r.from).from&&!/\S/.test(e.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}const zse=aFe(!1),D8t=aFe(!0);function aFe(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=t.changeByRange(r=>{let{from:s,to:o}=r,l=t.doc.lineAt(s),c=!e&&s==o&&P8t(t,s);e&&(s=o=(o<=l.to?l:t.doc.lineAt(o)).to);let u=new eL(t,{simulateBreak:s,simulateDoubleBreak:!!c}),d=iW(u,s);for(d==null&&(d=vf(/^\s*/.exec(t.doc.lineAt(s).text)[0],t.tabSize));ol.from&&s{let r=[];for(let o=i.from;o<=i.to;){let l=e.doc.lineAt(o);l.number>n&&(i.empty||i.to>l.from)&&(t(l,r,i),n=l.number),o=l.to+1}let s=e.changes(r);return{changes:r,range:pt.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}const M8t=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),i=new eL(e,{overrideIndentation:s=>{let o=n[s];return o??-1}}),r=DW(e,(s,o,l)=>{let c=iW(i,s.from);if(c==null)return;/\S/.test(s.text)||(c=0);let u=/^\s*/.exec(s.text)[0],d=HC(e,c);(u!=d||l.frome.readOnly?!1:(t(e.update(DW(e,(n,i)=>{i.push({from:n.from,insert:e.facet(bk)})}),{userEvent:"input.indent"})),!0),lFe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(DW(e,(n,i)=>{let r=/^\s*/.exec(n.text)[0];if(!r)return;let s=vf(r,e.tabSize),o=0,l=HC(e,Math.max(0,s-xv(e)));for(;o(e.setTabFocusMode(),!0),$8t=[{key:"Ctrl-b",run:L6e,shift:q6e,preventDefault:!0},{key:"Ctrl-f",run:$6e,shift:W6e},{key:"Ctrl-p",run:U6e,shift:X6e},{key:"Ctrl-n",run:Q6e,shift:Y6e},{key:"Ctrl-a",run:i8t,shift:m8t},{key:"Ctrl-e",run:r8t,shift:g8t},{key:"Ctrl-d",run:tFe},{key:"Ctrl-h",run:S7},{key:"Ctrl-k",run:S8t},{key:"Ctrl-Alt-h",run:iFe},{key:"Ctrl-o",run:A8t},{key:"Ctrl-t",run:T8t},{key:"Ctrl-v",run:O7}],F8t=[{key:"ArrowLeft",run:L6e,shift:q6e,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:KFt,shift:o8t,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:t8t,shift:h8t,preventDefault:!0},{key:"ArrowRight",run:$6e,shift:W6e,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:GFt,shift:l8t,preventDefault:!0},{mac:"Cmd-ArrowRight",run:n8t,shift:p8t,preventDefault:!0},{key:"ArrowUp",run:U6e,shift:X6e,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Fse,shift:Use},{mac:"Ctrl-ArrowUp",run:Mse,shift:Lse},{key:"ArrowDown",run:Q6e,shift:Y6e,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Bse,shift:Qse},{mac:"Ctrl-ArrowDown",run:O7,shift:$se},{key:"PageUp",run:Mse,shift:Lse},{key:"PageDown",run:O7,shift:$se},{key:"Home",run:e8t,shift:f8t,preventDefault:!0},{key:"Mod-Home",run:Fse,shift:Use},{key:"End",run:JFt,shift:d8t,preventDefault:!0},{key:"Mod-End",run:Bse,shift:Qse},{key:"Enter",run:zse,shift:zse},{key:"Mod-a",run:b8t},{key:"Backspace",run:S7,shift:S7,preventDefault:!0},{key:"Delete",run:tFe,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:iFe,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:O8t,preventDefault:!0},{mac:"Mod-Backspace",run:E8t,preventDefault:!0},{mac:"Mod-Delete",run:C8t,preventDefault:!0}].concat($8t.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),B8t=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:YFt,shift:c8t},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:ZFt,shift:u8t},{key:"Alt-ArrowUp",run:_8t},{key:"Shift-Alt-ArrowUp",run:N8t},{key:"Alt-ArrowDown",run:j8t},{key:"Shift-Alt-ArrowDown",run:R8t},{key:"Mod-Alt-ArrowUp",run:x8t},{key:"Mod-Alt-ArrowDown",run:w8t},{key:"Escape",run:k8t},{key:"Mod-Enter",run:D8t},{key:"Alt-l",mac:"Ctrl-l",run:y8t},{key:"Mod-i",run:v8t,preventDefault:!0},{key:"Mod-[",run:lFe},{key:"Mod-]",run:oFe},{key:"Mod-Alt-\\",run:M8t},{key:"Shift-Mod-k",run:I8t},{key:"Shift-Mod-\\",run:a8t},{key:"Mod-/",run:_Ft},{key:"Alt-A",run:NFt},{key:"Ctrl-m",mac:"Shift-Alt-m",run:L8t}].concat(F8t),U8t={key:"Tab",run:oFe,shift:lFe},Vse=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class k1{constructor(t,n,i=0,r=t.length,s,o){this.test=o,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(i,r),this.bufferStart=i,this.normalize=s?l=>s(Vse(l)):Vse,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Ac(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let n=Lq(t),i=this.bufferStart+this.bufferPos;this.bufferPos+=nh(t);let r=this.normalize(n);if(r.length)for(let s=0,o=i,l=!0;;s++){let c=r.charCodeAt(s),u=this.match(c,o,l,this.bufferPos+this.bufferStart,s==r.length-1);if(u)return this.value=u,this;if(s==r.length-1)break;l&&sthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let i=this.curLineStart+n.index,r=i+n[0].length;if(this.matchPos=fP(this.text,r+(i==r?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,r,n)))return this.value={from:i,to:r,precise:!0,match:n},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||r.to<=n){let l=new Cw(n,t.sliceString(n,i));return F$.set(t,l),l}if(r.from==n&&r.to==i)return r;let{text:s,from:o}=r;return o>n&&(s=t.sliceString(n,o)+s,o=n),r.to=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==t&&(this.re.lastIndex=t+1,n=this.re.exec(this.flat.text)),n){let i=this.flat.from+n.index,r=i+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,r,n)))return this.value={from:i,to:r,precise:!0,match:n},this.matchPos=fP(this.text,r+(i==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Cw.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(uFe.prototype[Symbol.iterator]=dFe.prototype[Symbol.iterator]=function(){return this});function Q8t(e){try{return new RegExp(e,MW),!0}catch{return!1}}function fP(e,t){if(t>=e.length)return t;let n=e.lineAt(t),i;for(;t=56320&&i<57344;)t++;return t}const z8t=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:i,result:r}=eMt(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:n},focus:!0,submitLabel:t.phrase("go")});return r.then(s=>{let o=s&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(s.elements.line.value);if(!o){e.dispatch({effects:i});return}let l=t.doc.lineAt(t.selection.main.head),[,c,u,d,f]=o,h=d?+d.slice(1):0,m=u?+u:l.number;if(u&&f){let v=m/100;c&&(v=v*(c=="-"?-1:1)+l.number/t.doc.lines),m=Math.round(t.doc.lines*v)}else u&&c&&(m=m*(c=="-"?-1:1)+l.number);let g=t.doc.line(Math.max(1,Math.min(t.doc.lines,m))),b=pt.cursor(g.from+Math.max(0,Math.min(h,g.length)));e.dispatch({effects:[i,Jt.scrollIntoView(b.from,{y:"center"})],selection:b})}),!0},V8t={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},H8t=pn.define({combine(e){return Mh(e,V8t,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function q8t(e){return[Y8t,X8t]}const W8t=$n.mark({class:"cm-selectionMatch"}),K8t=$n.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Hse(e,t,n,i){return(n==0||e(t.sliceDoc(n-1,n))!=Qs.Word)&&(i==t.doc.length||e(t.sliceDoc(i,i+1))!=Qs.Word)}function G8t(e,t,n,i){return e(t.sliceDoc(n,n+1))==Qs.Word&&e(t.sliceDoc(i-1,i))==Qs.Word}const X8t=ba.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(H8t),{state:n}=e,i=n.selection;if(i.ranges.length>1)return $n.none;let r=i.main,s,o=null;if(r.empty){if(!t.highlightWordAroundCursor)return $n.none;let c=n.wordAt(r.head);if(!c)return $n.none;o=n.charCategorizer(r.head),s=n.sliceDoc(c.from,c.to)}else{let c=r.to-r.from;if(c200)return $n.none;if(t.wholeWords){if(s=n.sliceDoc(r.from,r.to),o=n.charCategorizer(r.head),!(Hse(o,n,r.from,r.to)&&G8t(o,n,r.from,r.to)))return $n.none}else if(s=n.sliceDoc(r.from,r.to),!s)return $n.none}let l=[];for(let c of e.visibleRanges){let u=new k1(n.doc,s,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!o||Hse(o,n,d,f))&&(r.empty&&d<=r.from&&f>=r.to?l.push(K8t.range(d,f)):(d>=r.to||f<=r.from)&&l.push(W8t.range(d,f)),l.length>t.maxMatches))return $n.none}}return $n.set(l)}},{decorations:e=>e.decorations}),Y8t=Jt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Z8t=({state:e,dispatch:t})=>{let{selection:n}=e,i=pt.create(n.ranges.map(r=>e.wordAt(r.head)||pt.cursor(r.head)),n.mainIndex);return i.eq(n)?!1:(t(e.update({selection:i})),!0)};function J8t(e,t){let{main:n,ranges:i}=e.selection,r=e.wordAt(n.head),s=r&&r.from==n.from&&r.to==n.to;for(let o=!1,l=new k1(e.doc,t,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new k1(e.doc,t,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(c=>c.from==l.value.from))continue;if(s){let c=e.wordAt(l.value.from);if(!c||c.from!=l.value.from||c.to!=l.value.to)continue}return l.value}}const eBt=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(s=>s.from===s.to))return Z8t({state:e,dispatch:t});let i=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(s=>e.sliceDoc(s.from,s.to)!=i))return!1;let r=J8t(e,i);return r?(t(e.update({selection:e.selection.addRange(pt.range(r.from,r.to),!1),effects:Jt.scrollIntoView(r.to)})),!0):!1},xk=pn.define({combine(e){return Mh(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new pBt(t),scrollToMatch:t=>Jt.scrollIntoView(t)})}});class fFe{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||Q8t(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord,this.test=t.test}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(n,i)=>i=="n"?` -`:i=="r"?"\r":i=="t"?" ":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord&&this.test==t.test}create(){return this.regexp?new aBt(this):new iBt(this)}getCursor(t,n=0,i){let r=t.doc?t:sr.create({doc:t});return i==null&&(i=r.doc.length),this.regexp?px(this,r,n,i):hx(this,r,n,i)}}class hFe{constructor(t){this.spec=t}}function tBt(e,t,n){return(i,r,s,o)=>{if(n&&!n(i,r,s,o))return!1;let l=i>=o&&r<=o+s.length?s.slice(i-o,r-o):t.doc.sliceString(i,r);return e(l,t,i,r)}}function hx(e,t,n,i){let r;return e.wholeWord&&(r=nBt(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(r=tBt(e.test,t,r)),new k1(t.doc,e.unquoted,n,i,e.caseSensitive?void 0:s=>s.toLowerCase(),r)}function nBt(e,t){return(n,i,r,s)=>((s>n||s+r.length=n)return null;r.push(i.value)}return r}highlight(t,n,i,r){let s=hx(this.spec,t,Math.max(0,n-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,t.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}function rBt(e,t,n){return(i,r,s)=>(!n||n(i,r,s))&&e(s[0],t,i,r)}function px(e,t,n,i){let r;return e.wholeWord&&(r=sBt(t.charCategorizer(t.selection.main.head))),e.test&&(r=rBt(e.test,t,r)),new uFe(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:r},n,i)}function hP(e,t){return e.slice(Lo(e,t,!1),t)}function pP(e,t){return e.slice(t,Lo(e,t))}function sBt(e){return(t,n,i)=>!i[0].length||(e(hP(i.input,i.index))!=Qs.Word||e(pP(i.input,i.index))!=Qs.Word)&&(e(pP(i.input,i.index+i[0].length))!=Qs.Word||e(hP(i.input,i.index+i[0].length))!=Qs.Word)}class aBt extends hFe{nextMatch(t,n,i){let r=px(this.spec,t,i,t.doc.length).next();return r.done&&(r=px(this.spec,t,0,n).next()),r.done?null:r.value}prevMatchInRange(t,n,i){for(let r=1;;r++){let s=Math.max(n,i-r*1e4),o=px(this.spec,t,s,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(s==n||l.from>s+10))return l;if(s==n)return null}}prevMatch(t,n,i){return this.prevMatchInRange(t,0,n)||this.prevMatchInRange(t,i,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,i)=>{if(i=="&")return t.match[0];if(i=="$")return"$";for(let r=i.length;r>0;r--){let s=+i.slice(0,r);if(s>0&&s=n)return null;r.push(i.value)}return r}highlight(t,n,i,r){let s=px(this.spec,t,Math.max(0,n-250),Math.min(i+250,t.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}const nA=hi.define(),LW=hi.define(),Lg=pl.define({create(e){return new B$(E7(e).create(),null)},update(e,t){for(let n of t.effects)n.is(nA)?e=new B$(n.value.create(),e.panel):n.is(LW)&&(e=new B$(e.query,n.value?$W:null));return e},provide:e=>zC.from(e,t=>t.panel)});class B${constructor(t,n){this.query=t,this.panel=n}}const oBt=$n.mark({class:"cm-searchMatch"}),lBt=$n.mark({class:"cm-searchMatch cm-searchMatch-selected"}),cBt=ba.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Lg))}update(e){let t=e.state.field(Lg);(t!=e.startState.field(Lg)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return $n.none;let{view:n}=this,i=new im;for(let r=0,s=n.visibleRanges,o=s.length;rs[r+1].from-2*250;)c=s[++r].to;e.highlight(n.state,l,c,(u,d)=>{let f=n.state.selection.ranges.some(h=>h.from==u&&h.to==d);i.add(u,d,f?lBt:oBt)})}return i.finish()}},{decorations:e=>e.decorations});function FT(e){return t=>{let n=t.state.field(Lg,!1);return n&&n.query.spec.valid?e(t,n):gFe(t)}}const mP=FT((e,{query:t})=>{let{to:n}=e.state.selection.main,i=t.nextMatch(e.state,n,n);if(!i)return!1;let r=pt.single(i.from,i.to),s=e.state.facet(xk);return e.dispatch({selection:r,effects:[FW(e,i),s.scrollToMatch(r.main,e)],userEvent:"select.search"}),mFe(e),!0}),gP=FT((e,{query:t})=>{let{state:n}=e,{from:i}=n.selection.main,r=t.prevMatch(n,i,i);if(!r)return!1;let s=pt.single(r.from,r.to),o=e.state.facet(xk);return e.dispatch({selection:s,effects:[FW(e,r),o.scrollToMatch(s.main,e)],userEvent:"select.search"}),mFe(e),!0}),uBt=FT((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:pt.create(n.map(i=>pt.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),dBt=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:i,to:r}=n.main,s=[],o=0;for(let l=new k1(e.doc,e.sliceDoc(i,r));!l.next().done;){if(s.length>1e3)return!1;l.value.from==i&&(o=s.length),s.push(pt.range(l.value.from,l.value.to))}return t(e.update({selection:pt.create(s,o),userEvent:"select.search.matches"})),!0},qse=FT((e,{query:t})=>{let{state:n}=e,{from:i,to:r}=n.selection.main;if(n.readOnly)return!1;let s=t.nextMatch(n,i,i);if(!s)return!1;let o=s,l=[],c,u,d=[];o.precise?o.from==i&&o.to==r&&(u=n.toText(t.getReplacement(o)),l.push({from:o.from,to:o.to,insert:u}),o=t.nextMatch(n,o.from,o.to),d.push(Jt.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(i).number)+"."))):o=t.nextMatch(n,o.from,o.to);let f=e.state.changes(l);return o&&(c=pt.single(o.from,o.to).map(f),d.push(FW(e,o)),d.push(n.facet(xk).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:"input.replace"}),!0}),fBt=FT((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:s,to:o,precise:l}=r;l&&n.push({from:s,to:o,insert:t.getReplacement(r)})}if(!n.length)return!1;let i=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:Jt.announce.of(i),userEvent:"input.replace.all"}),!0});function $W(e){return e.state.facet(xk).createPanel(e)}function E7(e,t){var n,i,r,s,o;let l=e.selection.main,c=l.empty||l.to>l.from+100?"":e.sliceDoc(l.from,l.to);if(t&&!c)return t;let u=e.facet(xk);return new fFe({search:((n=t==null?void 0:t.literal)!==null&&n!==void 0?n:u.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(i=t==null?void 0:t.caseSensitive)!==null&&i!==void 0?i:u.caseSensitive,literal:(r=t==null?void 0:t.literal)!==null&&r!==void 0?r:u.literal,regexp:(s=t==null?void 0:t.regexp)!==null&&s!==void 0?s:u.regexp,wholeWord:(o=t==null?void 0:t.wholeWord)!==null&&o!==void 0?o:u.wholeWord})}function pFe(e){let t=tW(e,$W);return t&&t.dom.querySelector("[main-field]")}function mFe(e){let t=pFe(e);t&&t==e.root.activeElement&&t.select()}const gFe=e=>{let t=e.state.field(Lg,!1);if(t&&t.panel){let n=pFe(e);if(n&&n!=e.root.activeElement){let i=E7(e.state,t.query.spec);i.valid&&e.dispatch({effects:nA.of(i)}),n.focus(),n.select()}}else e.dispatch({effects:[LW.of(!0),t?nA.of(E7(e.state,t.query.spec)):hi.appendConfig.of(gBt)]});return!0},bFe=e=>{let t=e.state.field(Lg,!1);if(!t||!t.panel)return!1;let n=tW(e,$W);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:LW.of(!1)}),!0},hBt=[{key:"Mod-f",run:gFe,scope:"editor search-panel"},{key:"F3",run:mP,shift:gP,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:mP,shift:gP,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:bFe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:dBt},{key:"Mod-Alt-g",run:z8t},{key:"Mod-d",run:eBt,preventDefault:!0}];class pBt{constructor(t){this.view=t;let n=this.query=t.state.field(Lg).query.spec;this.commit=this.commit.bind(this),this.searchField=Yr("input",{value:n.search,placeholder:lu(t,"Find"),"aria-label":lu(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Yr("input",{value:n.replace,placeholder:lu(t,"Replace"),"aria-label":lu(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Yr("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=Yr("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=Yr("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function i(r,s,o){return Yr("button",{class:"cm-button",name:r,onclick:s,type:"button"},o)}this.dom=Yr("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,i("next",()=>mP(t),[lu(t,"next")]),i("prev",()=>gP(t),[lu(t,"previous")]),i("select",()=>uBt(t),[lu(t,"all")]),Yr("label",null,[this.caseField,lu(t,"match case")]),Yr("label",null,[this.reField,lu(t,"regexp")]),Yr("label",null,[this.wordField,lu(t,"by word")]),...t.state.readOnly?[]:[Yr("br"),this.replaceField,i("replace",()=>qse(t),[lu(t,"replace")]),i("replaceAll",()=>fBt(t),[lu(t,"replace all")])],Yr("button",{name:"close",onclick:()=>bFe(t),"aria-label":lu(t,"close"),type:"button"},["×"])])}commit(){let t=new fFe({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:nA.of(t)}))}keydown(t){cDt(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?gP:mP)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),qse(this.view))}update(t){for(let n of t.transactions)for(let i of n.effects)i.is(nA)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(xk).top}}function lu(e,t){return e.state.phrase(t)}const lj=30,cj=/[\s\.,:;?!]/;function FW(e,{from:t,to:n}){let i=e.state.doc.lineAt(t),r=e.state.doc.lineAt(n).to,s=Math.max(i.from,t-lj),o=Math.min(r,n+lj),l=e.state.sliceDoc(s,o);if(s!=i.from){for(let c=0;cl.length-lj;c--)if(!cj.test(l[c-1])&&cj.test(l[c])){l=l.slice(0,c);break}}return Jt.announce.of(`${e.state.phrase("current match")}. ${l} ${e.state.phrase("on line")} ${i.number}.`)}const mBt=Jt.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),gBt=[Lg,ym.low(cBt),mBt];class Wse{constructor(t,n,i){this.from=t,this.to=n,this.diagnostic=i}}class xy{constructor(t,n,i){this.diagnostics=t,this.panel=n,this.selected=i}static init(t,n,i){let r=i.facet(iA).markerFilter;r&&(t=r(t,i));let s=t.slice().sort((m,g)=>m.from-g.from||m.to-g.to),o=new im,l=[],c=0,u=i.doc.iter(),d=0,f=i.doc.length;for(let m=0;;){let g=m==s.length?null:s[m];if(!g&&!l.length)break;let b,v;if(l.length)b=c,v=l.reduce((x,k)=>Math.min(x,k.to),g&&g.from>b?g.from:1e8);else{if(b=g.from,b>f)break;v=g.to,l.push(g),m++}for(;mx.from||x.to==b))l.push(x),m++,v=Math.min(x.to,v);else{v=Math.min(x.from,v);break}}v=Math.min(v,f);let y=!1;if(l.some(x=>x.from==b&&(x.to==v||v==f))&&(y=b==v,!y&&v-b<10)){let x=b-(d+u.value.length);x>0&&(u.next(x),d=b);for(let k=b;;){if(k>=v){y=!0;break}if(!u.lineBreak&&d+u.value.length>k)break;k=d+u.value.length,d+=u.value.length,u.next()}}let w=_Bt(l);if(y)o.add(b,b,$n.widget({widget:new EBt(w),diagnostics:l.slice()}));else{let x=l.reduce((k,S)=>S.markClass?k+" "+S.markClass:k,"");o.add(b,v,$n.mark({class:"cm-lintRange cm-lintRange-"+w+x,diagnostics:l.slice(),inclusiveEnd:l.some(k=>k.to>v)}))}if(c=v,c==f)break;for(let x=0;x{if(!(t&&o.diagnostics.indexOf(t)<0))if(!i)i=new Wse(r,s,t||o.diagnostics[0]);else{if(o.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new Wse(i.from,s,i.diagnostic)}}),i}function bBt(e,t){let n=t.pos,i=t.end||n,r=e.state.facet(iA).hideOn(e,n,i);if(r!=null)return r;let s=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(o=>o.is(yFe))||e.changes.touchesRange(s.from,Math.max(s.to,i)))}function yBt(e,t){return e.field(Tu,!1)?t:t.concat(hi.appendConfig.of(jBt))}const yFe=hi.define(),BW=hi.define(),vFe=hi.define(),Tu=pl.define({create(){return new xy($n.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),i=null,r=e.panel;if(e.selected){let s=t.changes.mapPos(e.selected.from,1);i=gb(n,e.selected.diagnostic,s)||gb(n,null,s)}!n.size&&r&&t.state.facet(iA).autoPanel&&(r=null),e=new xy(n,r,i)}for(let n of t.effects)if(n.is(yFe)){let i=t.state.facet(iA).autoPanel?n.value.length?rA.open:null:e.panel;e=xy.init(n.value,i,t.state)}else n.is(BW)?e=new xy(e.diagnostics,n.value?rA.open:null,e.selected):n.is(vFe)&&(e=new xy(e.diagnostics,e.panel,n.value));return e},provide:e=>[zC.from(e,t=>t.panel),Jt.decorations.from(e,t=>t.diagnostics)]}),vBt=$n.mark({class:"cm-lintRange cm-lintRange-active"});function xBt(e,t,n){let{diagnostics:i}=e.state.field(Tu),r,s=-1,o=-1;i.between(t-(n<0?1:0),t+(n>0?1:0),(c,u,{spec:d})=>{if(t>=c&&t<=u&&(c==u||(t>c||n>0)&&(twFe(e,n,!1)))}const kBt=e=>{let t=e.state.field(Tu,!1);(!t||!t.panel)&&e.dispatch({effects:yBt(e.state,[BW.of(!0)])});let n=tW(e,rA.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},Kse=e=>{let t=e.state.field(Tu,!1);return!t||!t.panel?!1:(e.dispatch({effects:BW.of(!1)}),!0)},OBt=e=>{let t=e.state.field(Tu,!1);if(!t)return!1;let n=e.state.selection.main,i=gb(t.diagnostics,null,n.to+1);return!i&&(i=gb(t.diagnostics,null,0),!i||i.from==n.from&&i.to==n.to)?!1:(e.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),ZDt(e,i.from,1,{tooltip:kFe,until:r=>r.docChanged||r.newSelection.main.headi.to}),!0)},SBt=[{key:"Mod-Shift-m",run:kBt,preventDefault:!0},{key:"F8",run:OBt}],iA=pn.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...Mh(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:Gse,tooltipFilter:Gse,needsRefresh:(t,n)=>t?n?i=>t(i)||n(i):t:n,hideOn:(t,n)=>t?n?(i,r,s)=>t(i,r,s)||n(i,r,s):t:n,autoPanel:(t,n)=>t||n})}}});function Gse(e,t){return e?t?(n,i)=>t(e(n,i),i):e:t}function xFe(e){let t=[];if(e)e:for(let{name:n}of e){for(let i=0;is.toLowerCase()==r.toLowerCase())){t.push(r);continue e}}t.push("")}return t}function wFe(e,t,n){var i;let r=n?xFe(t.actions):[];return Yr("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Yr("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),(i=t.actions)===null||i===void 0?void 0:i.map((s,o)=>{let l=!1,c=m=>{if(m.preventDefault(),l)return;l=!0;let g=gb(e.state.field(Tu).diagnostics,t);g&&s.apply(e,g.from,g.to)},{name:u}=s,d=r[o]?u.indexOf(r[o]):-1,f=d<0?u:[u.slice(0,d),Yr("u",u.slice(d,d+1)),u.slice(d+1)],h=s.markClass?" "+s.markClass:"";return Yr("button",{type:"button",class:"cm-diagnosticAction"+h,onclick:c,onmousedown:c,"aria-label":` Action: ${u}${d<0?"":` (access key "${r[o]})"`}.`},f)}),t.source&&Yr("div",{class:"cm-diagnosticSource"},t.source))}class EBt extends Tf{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return Yr("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class Xse{constructor(t,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=wFe(t,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class rA{constructor(t){this.view=t,this.items=[];let n=r=>{if(!(r.ctrlKey||r.altKey||r.metaKey)){if(r.keyCode==27)Kse(this.view),this.view.focus();else if(r.keyCode==38||r.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(r.keyCode==40||r.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(r.keyCode==36)this.moveSelection(0);else if(r.keyCode==35)this.moveSelection(this.items.length-1);else if(r.keyCode==13)this.view.focus();else if(r.keyCode>=65&&r.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=xFe(s.actions);for(let l=0;l{for(let s=0;sKse(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(Tu).selected;if(!t)return-1;for(let n=0;n{for(let d of u.diagnostics){if(o.has(d))continue;o.add(d);let f=-1,h;for(let m=i;mi&&(this.items.splice(i,f-i),r=!0)),n&&h.diagnostic==n.diagnostic?h.dom.hasAttribute("aria-selected")||(h.dom.setAttribute("aria-selected","true"),s=h):h.dom.hasAttribute("aria-selected")&&h.dom.removeAttribute("aria-selected"),i++}});i({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:c})=>{let u=c.height/this.list.offsetHeight;l.topc.bottom&&(this.list.scrollTop+=(l.bottom-c.bottom)/u)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let t=this.list.firstChild;function n(){let i=t;t=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;t!=i.dom;)n();t=i.dom.nextSibling}else this.list.insertBefore(i.dom,t);for(;t;)n()}moveSelection(t){if(this.selectedIndex<0)return;let n=this.view.state.field(Tu),i=gb(n.diagnostics,this.items[t].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:vFe.of(i)})}static open(t){return new rA(t)}}function CBt(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(e)}')`}function uj(e){return CBt(``,'width="6" height="3"')}const ABt=Jt.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:uj("#f11")},".cm-lintRange-warning":{backgroundImage:uj("orange")},".cm-lintRange-info":{backgroundImage:uj("#999")},".cm-lintRange-hint":{backgroundImage:uj("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function TBt(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function _Bt(e){let t="hint",n=1;for(let i of e){let r=TBt(i.severity);r>n&&(n=r,t=i.severity)}return t}const kFe=YDt(xBt,{hideOn:bBt}),jBt=[Tu,Jt.decorations.compute([Tu],e=>{let{selected:t,panel:n}=e.field(Tu);return!t||!n||t.from==t.to?$n.none:$n.set([vBt.range(t.from,t.to)])}),kFe,ABt];var Yse=function(t){t===void 0&&(t={});var n=t,i=n.crosshairCursor,r=i===void 0?!1:i,s=[];t.closeBracketsKeymap!==!1&&(s=s.concat(L5t)),t.defaultKeymap!==!1&&(s=s.concat(B8t)),t.searchKeymap!==!1&&(s=s.concat(hBt)),t.historyKeymap!==!1&&(s=s.concat(WFt)),t.foldKeymap!==!1&&(s=s.concat(UMt)),t.completionKeymap!==!1&&(s=s.concat(e$e)),t.lintKeymap!==!1&&(s=s.concat(SBt));var o=[];return t.lineNumbers!==!1&&o.push(b4e()),t.highlightActiveLineGutter!==!1&&o.push(hMt()),t.highlightSpecialChars!==!1&&o.push(CDt()),t.history!==!1&&o.push($Ft()),t.foldGutter!==!1&&o.push(HMt()),t.drawSelection!==!1&&o.push(mDt()),t.dropCursor!==!1&&o.push(xDt()),t.allowMultipleSelections!==!1&&o.push(sr.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&o.push(IMt()),t.syntaxHighlighting!==!1&&o.push(R4e(GMt,{fallback:!0})),t.bracketMatching!==!1&&o.push(nLt()),t.closeBrackets!==!1&&o.push(I5t()),t.autocompletion!==!1&&o.push(V5t()),t.rectangularSelection!==!1&&o.push(BDt()),r!==!1&&o.push(zDt()),t.highlightActiveLine!==!1&&o.push(RDt()),t.highlightSelectionMatches!==!1&&o.push(q8t()),t.tabSize&&typeof t.tabSize=="number"&&o.push(bk.of(" ".repeat(t.tabSize))),o.concat([gk.of(s.flat())]).filter(Boolean)};const NBt="#e5c07b",Zse="#e06c75",RBt="#56b6c2",IBt="#ffffff",GN="#abb2bf",C7="#7d8799",PBt="#61afef",DBt="#98c379",Jse="#d19a66",MBt="#c678dd",LBt="#21252b",eae="#2c313a",tae="#282c34",U$="#353a42",$Bt="#3E4451",nae="#528bff",FBt=Jt.theme({"&":{color:GN,backgroundColor:tae},".cm-content":{caretColor:nae},".cm-cursor, .cm-dropCursor":{borderLeftColor:nae},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:$Bt},".cm-panels":{backgroundColor:LBt,color:GN},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:tae,color:C7,border:"none"},".cm-activeLineGutter":{backgroundColor:eae},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:U$},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:U$,borderBottomColor:U$},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:eae,color:GN}}},{dark:!0}),BBt=MT.define([{tag:me.keyword,color:MBt},{tag:[me.name,me.deleted,me.character,me.propertyName,me.macroName],color:Zse},{tag:[me.function(me.variableName),me.labelName],color:PBt},{tag:[me.color,me.constant(me.name),me.standard(me.name)],color:Jse},{tag:[me.definition(me.name),me.separator],color:GN},{tag:[me.typeName,me.className,me.number,me.changed,me.annotation,me.modifier,me.self,me.namespace],color:NBt},{tag:[me.operator,me.operatorKeyword,me.url,me.escape,me.regexp,me.link,me.special(me.string)],color:RBt},{tag:[me.meta,me.comment],color:C7},{tag:me.strong,fontWeight:"bold"},{tag:me.emphasis,fontStyle:"italic"},{tag:me.strikethrough,textDecoration:"line-through"},{tag:me.link,color:C7,textDecoration:"underline"},{tag:me.heading,fontWeight:"bold",color:Zse},{tag:[me.atom,me.bool,me.special(me.variableName)],color:Jse},{tag:[me.processingInstruction,me.string,me.inserted],color:DBt},{tag:me.invalid,color:IBt}]),UBt=[FBt,R4e(BBt)];var QBt=Jt.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),zBt=function(t){t===void 0&&(t={});var n=t,i=n.indentWithTab,r=i===void 0?!0:i,s=n.editable,o=s===void 0?!0:s,l=n.readOnly,c=l===void 0?!1:l,u=n.theme,d=u===void 0?"light":u,f=n.placeholder,h=f===void 0?"":f,m=n.basicSetup,g=m===void 0?!0:m,b=[];switch(r&&b.unshift(gk.of([U8t])),g&&(typeof g=="boolean"?b.unshift(Yse()):b.unshift(Yse(g))),h&&b.unshift(MDt(h)),d){case"light":b.push(QBt);break;case"dark":b.push(UBt);break;case"none":break;default:b.push(d);break}return o===!1&&b.push(Jt.editable.of(!1)),c&&b.push(sr.readOnly.of(!0)),[...b]},VBt=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(t=>!t.empty)});class HBt{constructor(t,n){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=n,this.timeoutMS=n,this.callbacks.push(t)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var t=this.callbacks.slice();this.callbacks.length=0,t.forEach(n=>{try{n()}catch(i){console.error("TimeoutLatch callback error:",i)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class iae{constructor(){this.interval=null,this.latches=new Set}add(t){this.latches.add(t),this.start()}remove(t){this.latches.delete(t),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(t=>{t.tick(),t.isDone&&this.remove(t)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var Q$=null,qBt=()=>typeof window>"u"?new iae:(Q$||(Q$=new iae),Q$),WBt=Jt.theme({"& .cm-scroller":{height:"100% !important"}}),rae=null,z$=null;function KBt(e,t,n,i,r,s){if(!e&&!t&&!n&&!i&&!r&&!s)return null;var o=JSON.stringify({height:e,minHeight:t,maxHeight:n,width:i,minWidth:r,maxWidth:s});return o===rae||(rae=o,z$=Jt.theme({"&":{height:e,minHeight:t,maxHeight:n,width:i,minWidth:r,maxWidth:s}})),z$}var sae=Dh.define(),GBt=200,XBt=[];function YBt(e){var t=e.value,n=e.selection,i=e.onChange,r=e.onStatistics,s=e.onCreateEditor,o=e.onUpdate,l=e.extensions,c=l===void 0?XBt:l,u=e.autoFocus,d=e.theme,f=d===void 0?"light":d,h=e.height,m=h===void 0?null:h,g=e.minHeight,b=g===void 0?null:g,v=e.maxHeight,y=v===void 0?null:v,w=e.width,x=w===void 0?null:w,k=e.minWidth,S=k===void 0?null:k,O=e.maxWidth,A=O===void 0?null:O,E=e.placeholder,j=E===void 0?"":E,T=e.editable,R=T===void 0?!0:T,C=e.readOnly,N=C===void 0?!1:C,P=e.indentWithTab,I=P===void 0?!0:P,D=e.basicSetup,_=D===void 0?!0:D,L=e.root,F=e.initialState,M=p.useState(),H=M[0],q=M[1],U=p.useState(),Z=U[0],z=U[1],J=p.useState(),ne=J[0],W=J[1],X=p.useState(()=>({current:null}))[0],le=p.useState(()=>({current:null}))[0],V=KBt(m,b,y,x,S,A),Y=Jt.updateListener.of(te=>{if(te.docChanged&&typeof i=="function"&&!te.transactions.some(pe=>pe.annotation(sae))){X.current?X.current.reset():(X.current=new HBt(()=>{if(le.current){var pe=le.current;le.current=null,pe()}X.current=null},GBt),qBt().add(X.current));var Oe=te.state.doc,fe=Oe.toString();i(fe,te)}r&&r(VBt(te))}),K=zBt({theme:f,editable:R,readOnly:N,placeholder:j,indentWithTab:I,basicSetup:_}),ue=[Y,...V?[V]:[],WBt,...K];return o&&typeof o=="function"&&ue.push(Jt.updateListener.of(o)),ue=ue.concat(c),p.useLayoutEffect(()=>{if(H&&!ne){var te={doc:t,selection:n,extensions:ue},Oe=F?sr.fromJSON(F.json,te,F.fields):sr.create(te);if(W(Oe),!Z){var fe=new Jt({state:Oe,parent:H,root:L});z(fe),s&&s(fe,Oe)}}return()=>{Z&&(W(void 0),z(void 0))}},[H,ne]),p.useEffect(()=>{e.container&&q(e.container)},[e.container]),p.useEffect(()=>()=>{Z&&(Z.destroy(),z(void 0)),X.current&&(X.current.cancel(),X.current=null)},[Z]),p.useEffect(()=>{u&&Z&&Z.focus()},[u,Z]),p.useEffect(()=>{Z&&Z.dispatch({effects:hi.reconfigure.of(ue)})},[f,c,m,b,y,x,S,A,j,R,N,I,_,i,o]),p.useEffect(()=>{if(t!==void 0){var te=Z?Z.state.doc.toString():"";if(Z&&t!==te){var Oe=X.current&&!X.current.isDone,fe=()=>{Z&&t!==Z.state.doc.toString()&&Z.dispatch({changes:{from:0,to:Z.state.doc.toString().length,insert:t||""},annotations:[sae.of(!0)]})};Oe?le.current=fe:fe()}}},[t,Z]),{state:ne,setState:W,view:Z,setView:z,container:H,setContainer:q}}var ZBt=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],OFe=p.forwardRef((e,t)=>{var n=e.className,i=e.value,r=i===void 0?"":i,s=e.selection,o=e.extensions,l=o===void 0?[]:o,c=e.onChange,u=e.onStatistics,d=e.onCreateEditor,f=e.onUpdate,h=e.autoFocus,m=e.theme,g=m===void 0?"light":m,b=e.height,v=e.minHeight,y=e.maxHeight,w=e.width,x=e.minWidth,k=e.maxWidth,S=e.basicSetup,O=e.placeholder,A=e.indentWithTab,E=e.editable,j=e.readOnly,T=e.root,R=e.initialState,C=TFt(e,ZBt),N=p.useRef(null),P=YBt({root:T,value:r,autoFocus:h,theme:g,height:b,minHeight:v,maxHeight:y,width:w,minWidth:x,maxWidth:k,basicSetup:S,placeholder:O,indentWithTab:A,editable:E,readOnly:j,selection:s,onChange:c,onStatistics:u,onCreateEditor:d,onUpdate:f,extensions:l,initialState:R}),I=P.state,D=P.view,_=P.container,L=P.setContainer;p.useImperativeHandle(t,()=>({editor:N.current,state:I,view:D}),[N,_,I,D]);var F=p.useCallback(H=>{N.current=H,L(H)},[L]);if(typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var M=typeof g=="string"?"cm-theme-"+g:"cm-theme";return a.jsx("div",x7({ref:F,className:""+M+(n?" "+n:"")},C))});OFe.displayName="CodeMirror";function SFe(e){const t=e.toLowerCase(),n=t.split("/").pop()??t,i=n.includes(".")?n.split(".").pop():"";return n==="dockerfile"||n.startsWith("dockerfile.")||n.endsWith(".dockerfile")?[sW.define(AFt)]:i==="py"||i==="pyi"?[L6t()]:["ts","tsx","mts","cts"].includes(i??"")?[o7({typescript:!0,jsx:i==="tsx"})]:["js","jsx","mjs","cjs"].includes(i??"")?[o7({jsx:i==="jsx"})]:i==="json"||i==="jsonc"?[i3t()]:i==="yaml"||i==="yml"?[hFt()]:["md","markdown"].includes(i??"")?[b$t()]:[]}function BT({value:e,path:t,onChange:n,readOnly:i=!1,theme:r="light",lineNumberStart:s=1,height:o="100%",minHeight:l,maxHeight:c,extensions:u}){const d=p.useMemo(()=>[...SFe(t),...s===1?[]:[b4e({formatNumber:f=>String(f+s-1)})],...u??[]],[s,t,u]);return a.jsx(OFe,{value:e,height:o,minHeight:l,maxHeight:c,theme:r,extensions:d,editable:!i,onChange:n,basicSetup:{lineNumbers:s===1,foldGutter:!0,highlightActiveLine:!0,highlightActiveLineGutter:!0,autocompletion:!1}})}const EFe=Object.freeze(Object.defineProperty({__proto__:null,default:BT,languageFor:SFe},Symbol.toStringTag,{value:"Module"}));function JBt(e){var s;const t=e.split(/\r?\n/);if(((s=t[0])==null?void 0:s.trim())!=="---")return{body:e,frontmatter:[]};const n=t.findIndex((o,l)=>l>0&&o.trim()==="---");if(n<0)return{body:e,frontmatter:[]};const i=B5e(t.slice(1,n).join(` +`,{label:"if",detail:"block",type:"keyword"}),Xs("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),Xs("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),Xs("import ${module}",{label:"import",detail:"statement",type:"keyword"}),Xs("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],L6t=q4e(y6e,cW(D6t.concat(M6t)));function P$(e){let{node:t,pos:n}=e,i=e.lineIndent(n,-1),r=null;for(;;){let s=t.childBefore(n);if(s)if(s.name=="Comment")n=s.from;else if(s.name=="Body"||s.name=="MatchBody")e.baseIndentFor(s)+e.unit<=i&&(r=s),t=s;else if(s.name=="MatchClause")t=s;else if(s.type.is("Statement"))t=s;else break;else break}return r}function D$(e,t){let n=e.baseIndentFor(t),i=e.lineAt(e.pos,-1),r=i.from+i.text.length;return/^\s*($|#)/.test(i.text)&&e.node.ton?null:n+e.unit}const M$=am.define({name:"python",parser:R6t.configure({props:[xm.add({Body:e=>{var t;let n=/^\s*(#|$)/.test(e.textAfter)&&P$(e)||e.node;return(t=D$(e,n))!==null&&t!==void 0?t:e.continue()},MatchBody:e=>{var t;let n=P$(e);return(t=D$(e,n||e.node))!==null&&t!==void 0?t:e.continue()},IfStatement:e=>/^\s*(else:|elif )/.test(e.textAfter)?e.baseIndent:e.continue(),"ForStatement WhileStatement":e=>/^\s*else:/.test(e.textAfter)?e.baseIndent:e.continue(),TryStatement:e=>/^\s*(except[ :]|finally:|else:)/.test(e.textAfter)?e.baseIndent:e.continue(),MatchStatement:e=>/^\s*case /.test(e.textAfter)?e.baseIndent+e.unit:e.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":kw({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":kw({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":kw({closing:"]"}),MemberExpression:e=>e.baseIndent+e.unit,"String FormatString":()=>null,Script:e=>{var t;let n=P$(e);return(t=n&&D$(e,n))!==null&&t!==void 0?t:e.continue()}}),wm.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":PT,Body:(e,t)=>({from:e.from+1,to:e.to-(e.to==t.doc.length?0:1)}),"String FormatString":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function $6t(){return new mb(M$,[M$.data.of({autocomplete:P6t}),M$.data.of({autocomplete:L6t})])}const fx=63,Ise=64,F6t=1,B6t=2,v6e=3,U6t=4,x6e=5,Q6t=6,z6t=7,w6e=65,V6t=66,H6t=8,q6t=9,W6t=10,K6t=11,G6t=12,k6e=13,X6t=19,Y6t=20,Z6t=29,J6t=33,eFt=34,tFt=47,nFt=0,NW=1,g7=2,tA=3,b7=4;class vy{constructor(t,n,i){this.parent=t,this.depth=n,this.type=i,this.hash=(t?t.hash+t.hash<<8:0)+n+(n<<4)+i}}vy.top=new vy(null,-1,nFt);function jE(e,t){for(let n=0,i=t-e.pos-1;;i--,n++){let r=e.peek(i);if(lm(r)||r==-1)return n}}function y7(e){return e==32||e==9}function lm(e){return e==10||e==13}function O6e(e){return y7(e)||lm(e)}function Ry(e){return e<0||O6e(e)}const iFt=new nL({start:vy.top,reduce(e,t){return e.type==tA&&(t==Y6t||t==eFt)?e.parent:e},shift(e,t,n,i){if(t==v6e)return new vy(e,jE(i,i.pos),NW);if(t==w6e||t==x6e)return new vy(e,jE(i,i.pos),g7);if(t==fx)return e.parent;if(t==X6t||t==J6t)return new vy(e,0,tA);if(t==k6e&&e.type==b7)return e.parent;if(t==tFt){let r=/[1-9]/.exec(i.read(i.pos,n.pos));if(r)return new vy(e,e.depth+ +r[0],b7)}return e},hash(e){return e.hash}});function w1(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&Ry(e.peek(n+3))}const rFt=new Ma((e,t)=>{if(e.next==-1&&t.canShift(Ise))return e.acceptToken(Ise);let n=e.peek(-1);if((lm(n)||n<0)&&t.context.type!=tA){if(w1(e,45))if(t.canShift(fx))e.acceptToken(fx);else return e.acceptToken(F6t,3);if(w1(e,46))if(t.canShift(fx))e.acceptToken(fx);else return e.acceptToken(B6t,3);let i=0;for(;e.next==32;)i++,e.advance();(i{if(t.context.type==tA){e.next==63&&(e.advance(),Ry(e.next)&&e.acceptToken(z6t));return}if(e.next==45)e.advance(),Ry(e.next)&&e.acceptToken(t.context.type==NW&&t.context.depth==jE(e,e.pos-1)?U6t:v6e);else if(e.next==63)e.advance(),Ry(e.next)&&e.acceptToken(t.context.type==g7&&t.context.depth==jE(e,e.pos-1)?Q6t:x6e);else{let n=e.pos;for(;;)if(y7(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)S6e(e);else if(e.next==38)v7(e);else if(e.next==42){v7(e);break}else if(e.next==39||e.next==34){if(RW(e,!0))break;return}else if(e.next==91||e.next==123){if(!oFt(e))return;break}else{E6e(e,!0,!1,0);break}for(;y7(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(Z6t))return;let i=e.peek(1);Ry(i)&&e.acceptTokenTo(t.context.type==g7&&t.context.depth==jE(e,n)?V6t:w6e,n)}}},{contextual:!0});function aFt(e){return e>32&&e<127&&e!=34&&e!=37&&e!=44&&e!=60&&e!=62&&e!=92&&e!=94&&e!=96&&e!=123&&e!=124&&e!=125}function Pse(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function Dse(e,t){return e.next==37?(e.advance(),Pse(e.next)&&e.advance(),Pse(e.next)&&e.advance(),!0):aFt(e.next)||t&&e.next==44?(e.advance(),!0):!1}function S6e(e){if(e.advance(),e.next==60){for(e.advance();;)if(!Dse(e,!0)){e.next==62&&e.advance();break}}else for(;Dse(e,!1););}function v7(e){for(e.advance();!Ry(e.next)&&uP(e.next)!="f";)e.advance()}function RW(e,t){let n=e.next,i=!1,r=e.pos;for(e.advance();;){let s=e.next;if(s<0)break;if(e.advance(),s==n)if(s==39)if(e.next==39)e.advance();else break;else break;else if(s==92&&n==34)e.next>=0&&e.advance();else if(lm(s)){if(t)return!1;i=!0}else if(t&&e.pos>=r+1024)return!1}return!i}function oFt(e){for(let t=[],n=e.pos+1024;;)if(e.next==91||e.next==123)t.push(e.next),e.advance();else if(e.next==39||e.next==34){if(!RW(e,!0))return!1}else if(e.next==93||e.next==125){if(t[t.length-1]!=e.next-2)return!1;if(t.pop(),e.advance(),!t.length)return!0}else{if(e.next<0||e.pos>n||lm(e.next))return!1;e.advance()}}const lFt="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function uP(e){return e<33?"u":e>125?"s":lFt[e-33]}function L$(e,t){let n=uP(e);return n!="u"&&!(t&&n=="f")}function E6e(e,t,n,i){if(uP(e.next)=="s"||(e.next==63||e.next==58||e.next==45)&&L$(e.peek(1),n))e.advance();else return!1;let r=e.pos;for(;;){let s=e.next,o=0,l=i+1;for(;O6e(s);){if(lm(s)){if(t)return!1;l=0}else l++;s=e.peek(++o)}if(!(s>=0&&(s==58?L$(e.peek(o+1),n):s==35?e.peek(o-1)!=32:L$(s,n)))||!n&&l<=i||l==0&&!n&&(w1(e,45,o)||w1(e,46,o)))break;if(t&&uP(s)=="f")return!1;for(let u=o;u>=0;u--)e.advance();if(t&&e.pos>r+1024)return!1}return!0}const cFt=new Ma((e,t)=>{if(e.next==33)S6e(e),e.acceptToken(G6t);else if(e.next==38||e.next==42){let n=e.next==38?W6t:K6t;v7(e),e.acceptToken(n)}else e.next==39||e.next==34?(RW(e,!1),e.acceptToken(q6t)):E6e(e,!1,t.context.type==tA,t.context.depth)&&e.acceptToken(H6t)}),uFt=new Ma((e,t)=>{let n=t.context.type==b7?t.context.depth:-1,i=e.pos;e:for(;;){let r=0,s=e.next;for(;s==32;)s=e.peek(++r);if(!r&&(w1(e,45,r)||w1(e,46,r))||!lm(s)&&(n<0&&(n=Math.max(t.context.depth+1,r)),rYAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:iFt,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[dFt],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[rFt,sFt,cFt,uFt,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),hFt=am.define({name:"yaml",parser:fFt.configure({props:[xm.add({Stream:e=>{for(let t=e.node.resolve(e.pos,-1);t&&t.to>=e.pos;t=t.parent){if(t.name=="BlockLiteralContent"&&t.frome.pos)return null}}return null},FlowMapping:kw({closing:"}"}),FlowSequence:kw({closing:"]"})}),wm.add({"FlowMapping FlowSequence":PT,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function pFt(){return new mb(hFt)}function mFt(e){C6e(e,"start");var t={},n=e.languageData||{},i=!1;for(var r in e)if(r!=n&&e.hasOwnProperty(r))for(var s=t[r]=[],o=e[r],l=0;l2&&o.token&&typeof o.token!="string"){n.pending=[];for(var u=2;u-1)return null;var r=n.indent.length-1,s=e[n.state];e:for(;;){for(var o=0;o{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),i=PW(e.state,n.from);return i.line?NFt(e):i.block?IFt(e):!1};function IW(e,t){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let r=e(t,n);return r?(i(n.update(r)),!0):!1}}const NFt=IW(MFt,0),RFt=IW(N6e,0),IFt=IW((e,t)=>N6e(e,t,DFt(t)),0);function PW(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const RO=50;function PFt(e,{open:t,close:n},i,r){let s=e.sliceDoc(i-RO,i),o=e.sliceDoc(r,r+RO),l=/\s*$/.exec(s)[0].length,c=/^\s*/.exec(o)[0].length,u=s.length-l;if(s.slice(u-t.length,u)==t&&o.slice(c,c+n.length)==n)return{open:{pos:i-l,margin:l&&1},close:{pos:r+c,margin:c&&1}};let d,f;r-i<=2*RO?d=f=e.sliceDoc(i,r):(d=e.sliceDoc(i,i+RO),f=e.sliceDoc(r-RO,r));let h=/^\s*/.exec(d)[0].length,m=/\s*$/.exec(f)[0].length,g=f.length-m-n.length;return d.slice(h,h+t.length)==t&&f.slice(g,g+n.length)==n?{open:{pos:i+h+t.length,margin:/\s/.test(d.charAt(h+t.length))?1:0},close:{pos:r-m-n.length,margin:/\s/.test(f.charAt(g-1))?1:0}}:null}function DFt(e){let t=[];for(let n of e.selection.ranges){let i=e.doc.lineAt(n.from),r=n.to<=i.to?i:e.doc.lineAt(n.to);r.from>i.from&&r.from==n.to&&(r=n.to==i.to+1?i:e.doc.lineAt(n.to-1));let s=t.length-1;s>=0&&t[s].to>i.from?t[s].to=r.to:t.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return t}function N6e(e,t,n=t.selection.ranges){let i=n.map(s=>PW(t,s.from).block);if(!i.every(s=>s))return null;let r=n.map((s,o)=>PFt(t,i[o],s.from,s.to));if(e!=2&&!r.every(s=>s))return{changes:t.changes(n.map((s,o)=>r[o]?[]:[{from:s.from,insert:i[o].open+" "},{from:s.to,insert:" "+i[o].close}]))};if(e!=1&&r.some(s=>s)){let s=[];for(let o=0,l;or&&(s==o||o>f.from)){r=f.from;let h=/^\s*/.exec(f.text)[0].length,m=h==f.length,g=f.text.slice(h,h+u.length)==u?h:-1;hs.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:l,token:c,indent:u,empty:d,single:f}of i)(f||!d)&&s.push({from:l.from+u,insert:c+" "});let o=t.changes(s);return{changes:o,selection:t.selection.map(o,1)}}else if(e!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:l,token:c}of i)if(l>=0){let u=o.from+l,d=u+c.length;o.text[d-o.from]==" "&&d++,s.push({from:u,to:d})}return{changes:s}}return null}const w7=Dh.define(),LFt=Dh.define(),$Ft=pn.define(),R6e=pn.define({combine(e){return Mh(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(i,r)=>t(i,r)||n(i,r)})}}),I6e=pl.define({create(){return fh.empty},update(e,t){let n=t.state.facet(R6e),i=t.annotation(w7);if(i){let c=Ic.fromTransaction(t,i.selection),u=i.side,d=u==0?e.undone:e.done;return c?d=dP(d,d.length,n.minDepth,c):d=M6e(d,t.startState.selection),new fh(u==0?i.rest:d,u==0?d:i.rest)}let r=t.annotation(LFt);if((r=="full"||r=="before")&&(e=e.isolate()),t.annotation(Ya.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let s=Ic.fromTransaction(t),o=t.annotation(Ya.time),l=t.annotation(Ya.userEvent);return s?e=e.addChanges(s,o,l,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,l,n.newGroupDelay)),(r=="full"||r=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new fh(e.done.map(Ic.fromJSON),e.undone.map(Ic.fromJSON))}});function FFt(e={}){return[I6e,R6e.of(e),Jt.domEventHandlers({beforeinput(t,n){let i=t.inputType=="historyUndo"?P6e:t.inputType=="historyRedo"?k7:null;return i?(t.preventDefault(),i(n)):!1}})]}function aL(e,t){return function({state:n,dispatch:i}){if(!t&&n.readOnly)return!1;let r=n.field(I6e,!1);if(!r)return!1;let s=r.pop(e,n,t);return s?(i(s),!0):!1}}const P6e=aL(0,!1),k7=aL(1,!1),BFt=aL(0,!0),UFt=aL(1,!0);class Ic{constructor(t,n,i,r,s){this.changes=t,this.effects=n,this.mapped=i,this.startSelection=r,this.selectionsAfter=s}setSelAfter(t){return new Ic(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,i;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(t){return new Ic(t.changes&&co.fromJSON(t.changes),[],t.mapped&&xh.fromJSON(t.mapped),t.startSelection&&pt.fromJSON(t.startSelection),t.selectionsAfter.map(pt.fromJSON))}static fromTransaction(t,n){let i=vd;for(let r of t.startState.facet($Ft)){let s=r(t);s.length&&(i=i.concat(s))}return!i.length&&t.changes.empty?null:new Ic(t.changes.invert(t.startState.doc),i,void 0,n||t.startState.selection,vd)}static selection(t){return new Ic(void 0,vd,void 0,void 0,t)}}function dP(e,t,n,i){let r=t+1>n+20?t-n-1:0,s=e.slice(r,t);return s.push(i),s}function QFt(e,t){let n=[],i=!1;return e.iterChangedRanges((r,s)=>n.push(r,s)),t.iterChangedRanges((r,s,o,l)=>{for(let c=0;c=u&&o<=d&&(i=!0)}}),i}function zFt(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,i)=>n.empty!=t.ranges[i].empty).length===0}function D6e(e,t){return e.length?t.length?e.concat(t):e:t}const vd=[],VFt=200;function M6e(e,t){if(e.length){let n=e[e.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-VFt));return i.length&&i[i.length-1].eq(t)?e:(i.push(t),dP(e,e.length-1,1e9,n.setSelAfter(i)))}else return[Ic.selection([t])]}function HFt(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function $$(e,t){if(!e.length)return e;let n=e.length,i=vd;for(;n;){let r=qFt(e[n-1],t,i);if(r.changes&&!r.changes.empty||r.effects.length){let s=e.slice(0,n);return s[n-1]=r,s}else t=r.mapped,n--,i=r.selectionsAfter}return i.length?[Ic.selection(i)]:vd}function qFt(e,t,n){let i=D6e(e.selectionsAfter.length?e.selectionsAfter.map(l=>l.map(t)):vd,n);if(!e.changes)return Ic.selection(i);let r=e.changes.map(t),s=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(s):s;return new Ic(r,hi.mapEffects(e.effects,t),o,e.startSelection.map(s),i)}const WFt=/^(input\.type|delete)($|\.)/;class fh{constructor(t,n,i=0,r=void 0){this.done=t,this.undone=n,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new fh(this.done,this.undone):this}addChanges(t,n,i,r,s){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&t.changes&&(!i||WFt.test(i))&&(!l.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?e.moveByChar(n,t):oL(n,t))}function Rl(e){return e.textDirectionAt(e.state.selection.main.head)==cs.LTR}const $6e=e=>L6e(e,!Rl(e)),F6e=e=>L6e(e,Rl(e));function B6e(e,t){return jf(e,n=>n.empty?e.moveByGroup(n,t):oL(n,t))}const GFt=e=>B6e(e,!Rl(e)),XFt=e=>B6e(e,Rl(e));function YFt(e,t,n){if(t.type.prop(n))return!0;let i=t.to-t.from;return i&&(i>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function lL(e,t,n){let i=es(e).resolveInner(t.head),r=n?li.closedBy:li.openedBy;for(let c=t.head;;){let u=n?i.childAfter(c):i.childBefore(c);if(!u)break;YFt(e,u,r)?i=u:c=n?u.to:u.from}let s=i.type.prop(r),o,l;return s&&(o=n?dh(e,i.from,1):dh(e,i.to,-1))&&o.matched?l=n?o.end.to:o.end.from:l=n?i.to:i.from,pt.cursor(l,n?-1:1)}const ZFt=e=>jf(e,t=>lL(e.state,t,!Rl(e))),JFt=e=>jf(e,t=>lL(e.state,t,Rl(e)));function U6e(e,t){return jf(e,n=>{if(!n.empty)return oL(n,t);let i=e.moveVertically(n,t);return i.head!=n.head?i:e.moveToLineBoundary(n,t)})}const Q6e=e=>U6e(e,!1),z6e=e=>U6e(e,!0);function V6e(e){let t=e.scrollDOM.clientHeighto.empty?e.moveVertically(o,t,n.height):oL(o,t));if(r.eq(i.selection))return!1;let s;if(n.selfScroll){let o=e.coordsAtPos(i.selection.main.head),l=e.scrollDOM.getBoundingClientRect(),c=l.top+n.marginTop,u=l.bottom-n.marginBottom;o&&o.top>c&&o.bottomH6e(e,!1),O7=e=>H6e(e,!0);function jb(e,t,n){let i=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,n);if(r.head==t.head&&r.head!=(n?i.to:i.from)&&(r=e.moveToLineBoundary(t,n,!1)),!n&&r.head==i.from&&i.length){let s=/^\s*/.exec(e.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&t.head!=i.from+s&&(r=pt.cursor(i.from+s))}return r}const e8t=e=>jf(e,t=>jb(e,t,!0)),t8t=e=>jf(e,t=>jb(e,t,!1)),n8t=e=>jf(e,t=>jb(e,t,!Rl(e))),i8t=e=>jf(e,t=>jb(e,t,Rl(e))),r8t=e=>jf(e,t=>pt.cursor(e.lineBlockAt(t.head).from,1)),s8t=e=>jf(e,t=>pt.cursor(e.lineBlockAt(t.head).to,-1));function a8t(e,t,n){let i=!1,r=vk(e.selection,s=>{let o=dh(e,s.head,-1)||dh(e,s.head,1)||s.head>0&&dh(e,s.head-1,1)||s.heada8t(e,t);function Md(e,t,n){let i=vk(e.state.selection,r=>{r.undirectional&&r.head>=r.anchor!=t&&(r=pt.range(r.head,r.anchor));let s=n(r);return pt.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return i.eq(e.state.selection)?!1:(e.dispatch(_f(e.state,i)),!0)}function q6e(e,t){return Md(e,t,n=>e.moveByChar(n,t))}const W6e=e=>q6e(e,!Rl(e)),K6e=e=>q6e(e,Rl(e));function G6e(e,t){return Md(e,t,n=>e.moveByGroup(n,t))}const l8t=e=>G6e(e,!Rl(e)),c8t=e=>G6e(e,Rl(e)),u8t=e=>{let t=!Rl(e);return Md(e,t,n=>lL(e.state,n,t))},d8t=e=>{let t=Rl(e);return Md(e,t,n=>lL(e.state,n,t))};function X6e(e,t){return Md(e,t,n=>e.moveVertically(n,t))}const Y6e=e=>X6e(e,!1),Z6e=e=>X6e(e,!0);function J6e(e,t){return Md(e,t,n=>e.moveVertically(n,t,V6e(e).height))}const Lse=e=>J6e(e,!1),$se=e=>J6e(e,!0),f8t=e=>Md(e,!0,t=>jb(e,t,!0)),h8t=e=>Md(e,!1,t=>jb(e,t,!1)),p8t=e=>{let t=!Rl(e);return Md(e,t,n=>jb(e,n,t))},m8t=e=>{let t=Rl(e);return Md(e,t,n=>jb(e,n,t))},g8t=e=>Md(e,!1,t=>pt.cursor(e.lineBlockAt(t.head).from)),b8t=e=>Md(e,!0,t=>pt.cursor(e.lineBlockAt(t.head).to)),Fse=({state:e,dispatch:t})=>(t(_f(e,{anchor:0})),!0),Bse=({state:e,dispatch:t})=>(t(_f(e,{anchor:e.doc.length})),!0),Use=({state:e,dispatch:t})=>(t(_f(e,{anchor:e.selection.main.anchor,head:0})),!0),Qse=({state:e,dispatch:t})=>(t(_f(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),y8t=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),v8t=({state:e,dispatch:t})=>{let n=cL(e).map(({from:i,to:r})=>pt.range(i,Math.min(r+1,e.doc.length)));return t(e.update({selection:pt.create(n),userEvent:"select"})),!0},x8t=({state:e,dispatch:t})=>{let n=vk(e.selection,i=>{let r=es(e),s=r.resolveStack(i.from,1);if(i.empty){let o=r.resolveStack(i.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:l}=o;if((l.from=i.to||l.to>i.to&&l.from<=i.from)&&o.next)return pt.range(l.to,l.from)}return i});return n.eq(e.selection)?!1:(t(_f(e,n)),!0)};function eFe(e,t){let{state:n}=e,i=n.selection,r=n.selection.ranges.slice();for(let s of n.selection.ranges){let o=n.doc.lineAt(s.head);if(t?o.to0)for(let l=s;;){let c=e.moveVertically(l,t);if(c.heado.to){r.some(u=>u.head==c.head)||r.push(c);break}else{if(c.head==l.head)break;l=c}}}return r.length==i.ranges.length?!1:(e.dispatch(_f(n,pt.create(r,r.length-1))),!0)}const w8t=e=>eFe(e,!1),k8t=e=>eFe(e,!0),O8t=({state:e,dispatch:t})=>{let n=e.selection,i=null;return n.ranges.length>1?i=pt.create([n.main]):n.main.empty||(i=pt.create([pt.cursor(n.main.head)])),i?(t(_f(e,i)),!0):!1};function $T(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:i}=e,r=i.changeByRange(s=>{let{from:o,to:l}=s;if(o==l){let c=t(s);co&&(n="delete.forward",c=oj(e,c,!0)),o=Math.min(o,c),l=Math.max(l,c)}else o=oj(e,o,!1),l=oj(e,l,!0);return o==l?{range:s}:{changes:{from:o,to:l},range:pt.cursor(o,or(e)))i.between(t,t,(r,s)=>{rt&&(t=n?s:r)});return t}const tFe=(e,t,n)=>$T(e,i=>{let r=i.from,{state:s}=e,o=s.doc.lineAt(r),l,c;if(n&&!t&&r>o.from&&rtFe(e,!1,!0),nFe=e=>tFe(e,!0,!1),iFe=(e,t)=>$T(e,n=>{let i=n.head,{state:r}=e,s=r.doc.lineAt(i),o=r.charCategorizer(i);for(let l=null;;){if(i==(t?s.to:s.from)){i==n.head&&s.number!=(t?r.doc.lines:1)&&(i+=t?1:-1);break}let c=Lo(s.text,i-s.from,t)+s.from,u=s.text.slice(Math.min(i,c)-s.from,Math.max(i,c)-s.from),d=o(u);if(l!=null&&d!=l)break;(u!=" "||i!=n.head)&&(l=d),i=c}return i}),rFe=e=>iFe(e,!1),S8t=e=>iFe(e,!0),E8t=e=>$T(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head$T(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),A8t=e=>$T(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head{if(e.readOnly)return!1;let n=e.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:Or.of(["",""])},range:pt.cursor(i.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},_8t=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(i=>{if(!i.empty||i.from==0||i.from==e.doc.length)return{range:i};let r=i.from,s=e.doc.lineAt(r),o=r==s.from?r-1:Lo(s.text,r-s.from,!1)+s.from,l=r==s.to?r+1:Lo(s.text,r-s.from,!0)+s.from;return{changes:{from:o,to:l,insert:e.doc.slice(r,l).append(e.doc.slice(o,r))},range:pt.cursor(l)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function cL(e){let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.from),s=e.doc.lineAt(i.to);if(!i.empty&&i.to==s.from&&(s=e.doc.lineAt(i.to-1)),n>=r.number){let o=t[t.length-1];o.to=s.to,o.ranges.push(i)}else t.push({from:r.from,to:s.to,ranges:[i]});n=s.number+1}return t}function sFe(e,t,n){if(e.readOnly)return!1;let i=[],r=[];for(let s of cL(e)){if(n?s.to==e.doc.length:s.from==0)continue;let o=e.doc.lineAt(n?s.to+1:s.from-1),l=o.length+1;if(n){i.push({from:s.to,to:o.to},{from:s.from,insert:o.text+e.lineBreak});for(let c of s.ranges)r.push(pt.range(Math.min(e.doc.length,c.anchor+l),Math.min(e.doc.length,c.head+l)))}else{i.push({from:o.from,to:s.from},{from:s.to,insert:e.lineBreak+o.text});for(let c of s.ranges)r.push(pt.range(c.anchor-l,c.head-l))}}return i.length?(t(e.update({changes:i,scrollIntoView:!0,selection:pt.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const j8t=({state:e,dispatch:t})=>sFe(e,t,!1),N8t=({state:e,dispatch:t})=>sFe(e,t,!0);function aFe(e,t,n){if(e.readOnly)return!1;let i=[];for(let s of cL(e))n?i.push({from:s.from,insert:e.doc.slice(s.from,s.to)+e.lineBreak}):i.push({from:s.to,insert:e.lineBreak+e.doc.slice(s.from,s.to)});let r=e.changes(i);return t(e.update({changes:r,selection:e.selection.map(r,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const R8t=({state:e,dispatch:t})=>aFe(e,t,!1),I8t=({state:e,dispatch:t})=>aFe(e,t,!0),P8t=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(cL(t).map(({from:r,to:s})=>(r>0?r--:s{let s;if(e.lineWrapping){let o=e.lineBlockAt(r.head),l=e.coordsAtPos(r.head,r.assoc||1);l&&(s=o.bottom+e.documentTop-l.bottom+e.defaultLineHeight/2)}return e.moveVertically(r,!0,s)}).map(n);return e.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function D8t(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=es(e).resolveInner(t),i=n.childBefore(t),r=n.childAfter(t),s;return i&&r&&i.to<=t&&r.from>=t&&(s=i.type.prop(li.closedBy))&&s.indexOf(r.name)>-1&&e.doc.lineAt(i.to).from==e.doc.lineAt(r.from).from&&!/\S/.test(e.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}const zse=oFe(!1),M8t=oFe(!0);function oFe(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=t.changeByRange(r=>{let{from:s,to:o}=r,l=t.doc.lineAt(s),c=!e&&s==o&&D8t(t,s);e&&(s=o=(o<=l.to?l:t.doc.lineAt(o)).to);let u=new eL(t,{simulateBreak:s,simulateDoubleBreak:!!c}),d=iW(u,s);for(d==null&&(d=vf(/^\s*/.exec(t.doc.lineAt(s).text)[0],t.tabSize));ol.from&&s{let r=[];for(let o=i.from;o<=i.to;){let l=e.doc.lineAt(o);l.number>n&&(i.empty||i.to>l.from)&&(t(l,r,i),n=l.number),o=l.to+1}let s=e.changes(r);return{changes:r,range:pt.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}const L8t=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),i=new eL(e,{overrideIndentation:s=>{let o=n[s];return o??-1}}),r=DW(e,(s,o,l)=>{let c=iW(i,s.from);if(c==null)return;/\S/.test(s.text)||(c=0);let u=/^\s*/.exec(s.text)[0],d=HC(e,c);(u!=d||l.frome.readOnly?!1:(t(e.update(DW(e,(n,i)=>{i.push({from:n.from,insert:e.facet(bk)})}),{userEvent:"input.indent"})),!0),cFe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(DW(e,(n,i)=>{let r=/^\s*/.exec(n.text)[0];if(!r)return;let s=vf(r,e.tabSize),o=0,l=HC(e,Math.max(0,s-xv(e)));for(;o(e.setTabFocusMode(),!0),F8t=[{key:"Ctrl-b",run:$6e,shift:W6e,preventDefault:!0},{key:"Ctrl-f",run:F6e,shift:K6e},{key:"Ctrl-p",run:Q6e,shift:Y6e},{key:"Ctrl-n",run:z6e,shift:Z6e},{key:"Ctrl-a",run:r8t,shift:g8t},{key:"Ctrl-e",run:s8t,shift:b8t},{key:"Ctrl-d",run:nFe},{key:"Ctrl-h",run:S7},{key:"Ctrl-k",run:E8t},{key:"Ctrl-Alt-h",run:rFe},{key:"Ctrl-o",run:T8t},{key:"Ctrl-t",run:_8t},{key:"Ctrl-v",run:O7}],B8t=[{key:"ArrowLeft",run:$6e,shift:W6e,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:GFt,shift:l8t,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:n8t,shift:p8t,preventDefault:!0},{key:"ArrowRight",run:F6e,shift:K6e,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:XFt,shift:c8t,preventDefault:!0},{mac:"Cmd-ArrowRight",run:i8t,shift:m8t,preventDefault:!0},{key:"ArrowUp",run:Q6e,shift:Y6e,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Fse,shift:Use},{mac:"Ctrl-ArrowUp",run:Mse,shift:Lse},{key:"ArrowDown",run:z6e,shift:Z6e,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Bse,shift:Qse},{mac:"Ctrl-ArrowDown",run:O7,shift:$se},{key:"PageUp",run:Mse,shift:Lse},{key:"PageDown",run:O7,shift:$se},{key:"Home",run:t8t,shift:h8t,preventDefault:!0},{key:"Mod-Home",run:Fse,shift:Use},{key:"End",run:e8t,shift:f8t,preventDefault:!0},{key:"Mod-End",run:Bse,shift:Qse},{key:"Enter",run:zse,shift:zse},{key:"Mod-a",run:y8t},{key:"Backspace",run:S7,shift:S7,preventDefault:!0},{key:"Delete",run:nFe,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:rFe,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:S8t,preventDefault:!0},{mac:"Mod-Backspace",run:C8t,preventDefault:!0},{mac:"Mod-Delete",run:A8t,preventDefault:!0}].concat(F8t.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),U8t=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:ZFt,shift:u8t},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:JFt,shift:d8t},{key:"Alt-ArrowUp",run:j8t},{key:"Shift-Alt-ArrowUp",run:R8t},{key:"Alt-ArrowDown",run:N8t},{key:"Shift-Alt-ArrowDown",run:I8t},{key:"Mod-Alt-ArrowUp",run:w8t},{key:"Mod-Alt-ArrowDown",run:k8t},{key:"Escape",run:O8t},{key:"Mod-Enter",run:M8t},{key:"Alt-l",mac:"Ctrl-l",run:v8t},{key:"Mod-i",run:x8t,preventDefault:!0},{key:"Mod-[",run:cFe},{key:"Mod-]",run:lFe},{key:"Mod-Alt-\\",run:L8t},{key:"Shift-Mod-k",run:P8t},{key:"Shift-Mod-\\",run:o8t},{key:"Mod-/",run:jFt},{key:"Alt-A",run:RFt},{key:"Ctrl-m",mac:"Shift-Alt-m",run:$8t}].concat(B8t),Q8t={key:"Tab",run:lFe,shift:cFe},Vse=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class k1{constructor(t,n,i=0,r=t.length,s,o){this.test=o,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(i,r),this.bufferStart=i,this.normalize=s?l=>s(Vse(l)):Vse,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Ac(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let n=Lq(t),i=this.bufferStart+this.bufferPos;this.bufferPos+=nh(t);let r=this.normalize(n);if(r.length)for(let s=0,o=i,l=!0;;s++){let c=r.charCodeAt(s),u=this.match(c,o,l,this.bufferPos+this.bufferStart,s==r.length-1);if(u)return this.value=u,this;if(s==r.length-1)break;l&&sthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let i=this.curLineStart+n.index,r=i+n[0].length;if(this.matchPos=fP(this.text,r+(i==r?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,r,n)))return this.value={from:i,to:r,precise:!0,match:n},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||r.to<=n){let l=new Cw(n,t.sliceString(n,i));return F$.set(t,l),l}if(r.from==n&&r.to==i)return r;let{text:s,from:o}=r;return o>n&&(s=t.sliceString(n,o)+s,o=n),r.to=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==t&&(this.re.lastIndex=t+1,n=this.re.exec(this.flat.text)),n){let i=this.flat.from+n.index,r=i+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,r,n)))return this.value={from:i,to:r,precise:!0,match:n},this.matchPos=fP(this.text,r+(i==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Cw.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(dFe.prototype[Symbol.iterator]=fFe.prototype[Symbol.iterator]=function(){return this});function z8t(e){try{return new RegExp(e,MW),!0}catch{return!1}}function fP(e,t){if(t>=e.length)return t;let n=e.lineAt(t),i;for(;t=56320&&i<57344;)t++;return t}const V8t=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:i,result:r}=tMt(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:n},focus:!0,submitLabel:t.phrase("go")});return r.then(s=>{let o=s&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(s.elements.line.value);if(!o){e.dispatch({effects:i});return}let l=t.doc.lineAt(t.selection.main.head),[,c,u,d,f]=o,h=d?+d.slice(1):0,m=u?+u:l.number;if(u&&f){let v=m/100;c&&(v=v*(c=="-"?-1:1)+l.number/t.doc.lines),m=Math.round(t.doc.lines*v)}else u&&c&&(m=m*(c=="-"?-1:1)+l.number);let g=t.doc.line(Math.max(1,Math.min(t.doc.lines,m))),b=pt.cursor(g.from+Math.max(0,Math.min(h,g.length)));e.dispatch({effects:[i,Jt.scrollIntoView(b.from,{y:"center"})],selection:b})}),!0},H8t={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},q8t=pn.define({combine(e){return Mh(e,H8t,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function W8t(e){return[Z8t,Y8t]}const K8t=$n.mark({class:"cm-selectionMatch"}),G8t=$n.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Hse(e,t,n,i){return(n==0||e(t.sliceDoc(n-1,n))!=Qs.Word)&&(i==t.doc.length||e(t.sliceDoc(i,i+1))!=Qs.Word)}function X8t(e,t,n,i){return e(t.sliceDoc(n,n+1))==Qs.Word&&e(t.sliceDoc(i-1,i))==Qs.Word}const Y8t=ba.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(q8t),{state:n}=e,i=n.selection;if(i.ranges.length>1)return $n.none;let r=i.main,s,o=null;if(r.empty){if(!t.highlightWordAroundCursor)return $n.none;let c=n.wordAt(r.head);if(!c)return $n.none;o=n.charCategorizer(r.head),s=n.sliceDoc(c.from,c.to)}else{let c=r.to-r.from;if(c200)return $n.none;if(t.wholeWords){if(s=n.sliceDoc(r.from,r.to),o=n.charCategorizer(r.head),!(Hse(o,n,r.from,r.to)&&X8t(o,n,r.from,r.to)))return $n.none}else if(s=n.sliceDoc(r.from,r.to),!s)return $n.none}let l=[];for(let c of e.visibleRanges){let u=new k1(n.doc,s,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!o||Hse(o,n,d,f))&&(r.empty&&d<=r.from&&f>=r.to?l.push(G8t.range(d,f)):(d>=r.to||f<=r.from)&&l.push(K8t.range(d,f)),l.length>t.maxMatches))return $n.none}}return $n.set(l)}},{decorations:e=>e.decorations}),Z8t=Jt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),J8t=({state:e,dispatch:t})=>{let{selection:n}=e,i=pt.create(n.ranges.map(r=>e.wordAt(r.head)||pt.cursor(r.head)),n.mainIndex);return i.eq(n)?!1:(t(e.update({selection:i})),!0)};function eBt(e,t){let{main:n,ranges:i}=e.selection,r=e.wordAt(n.head),s=r&&r.from==n.from&&r.to==n.to;for(let o=!1,l=new k1(e.doc,t,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new k1(e.doc,t,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(c=>c.from==l.value.from))continue;if(s){let c=e.wordAt(l.value.from);if(!c||c.from!=l.value.from||c.to!=l.value.to)continue}return l.value}}const tBt=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(s=>s.from===s.to))return J8t({state:e,dispatch:t});let i=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(s=>e.sliceDoc(s.from,s.to)!=i))return!1;let r=eBt(e,i);return r?(t(e.update({selection:e.selection.addRange(pt.range(r.from,r.to),!1),effects:Jt.scrollIntoView(r.to)})),!0):!1},xk=pn.define({combine(e){return Mh(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new mBt(t),scrollToMatch:t=>Jt.scrollIntoView(t)})}});class hFe{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||z8t(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord,this.test=t.test}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(n,i)=>i=="n"?` +`:i=="r"?"\r":i=="t"?" ":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord&&this.test==t.test}create(){return this.regexp?new oBt(this):new rBt(this)}getCursor(t,n=0,i){let r=t.doc?t:sr.create({doc:t});return i==null&&(i=r.doc.length),this.regexp?px(this,r,n,i):hx(this,r,n,i)}}class pFe{constructor(t){this.spec=t}}function nBt(e,t,n){return(i,r,s,o)=>{if(n&&!n(i,r,s,o))return!1;let l=i>=o&&r<=o+s.length?s.slice(i-o,r-o):t.doc.sliceString(i,r);return e(l,t,i,r)}}function hx(e,t,n,i){let r;return e.wholeWord&&(r=iBt(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(r=nBt(e.test,t,r)),new k1(t.doc,e.unquoted,n,i,e.caseSensitive?void 0:s=>s.toLowerCase(),r)}function iBt(e,t){return(n,i,r,s)=>((s>n||s+r.length=n)return null;r.push(i.value)}return r}highlight(t,n,i,r){let s=hx(this.spec,t,Math.max(0,n-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,t.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}function sBt(e,t,n){return(i,r,s)=>(!n||n(i,r,s))&&e(s[0],t,i,r)}function px(e,t,n,i){let r;return e.wholeWord&&(r=aBt(t.charCategorizer(t.selection.main.head))),e.test&&(r=sBt(e.test,t,r)),new dFe(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:r},n,i)}function hP(e,t){return e.slice(Lo(e,t,!1),t)}function pP(e,t){return e.slice(t,Lo(e,t))}function aBt(e){return(t,n,i)=>!i[0].length||(e(hP(i.input,i.index))!=Qs.Word||e(pP(i.input,i.index))!=Qs.Word)&&(e(pP(i.input,i.index+i[0].length))!=Qs.Word||e(hP(i.input,i.index+i[0].length))!=Qs.Word)}class oBt extends pFe{nextMatch(t,n,i){let r=px(this.spec,t,i,t.doc.length).next();return r.done&&(r=px(this.spec,t,0,n).next()),r.done?null:r.value}prevMatchInRange(t,n,i){for(let r=1;;r++){let s=Math.max(n,i-r*1e4),o=px(this.spec,t,s,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(s==n||l.from>s+10))return l;if(s==n)return null}}prevMatch(t,n,i){return this.prevMatchInRange(t,0,n)||this.prevMatchInRange(t,i,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,i)=>{if(i=="&")return t.match[0];if(i=="$")return"$";for(let r=i.length;r>0;r--){let s=+i.slice(0,r);if(s>0&&s=n)return null;r.push(i.value)}return r}highlight(t,n,i,r){let s=px(this.spec,t,Math.max(0,n-250),Math.min(i+250,t.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}const nA=hi.define(),LW=hi.define(),Lg=pl.define({create(e){return new B$(E7(e).create(),null)},update(e,t){for(let n of t.effects)n.is(nA)?e=new B$(n.value.create(),e.panel):n.is(LW)&&(e=new B$(e.query,n.value?$W:null));return e},provide:e=>zC.from(e,t=>t.panel)});class B${constructor(t,n){this.query=t,this.panel=n}}const lBt=$n.mark({class:"cm-searchMatch"}),cBt=$n.mark({class:"cm-searchMatch cm-searchMatch-selected"}),uBt=ba.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Lg))}update(e){let t=e.state.field(Lg);(t!=e.startState.field(Lg)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return $n.none;let{view:n}=this,i=new im;for(let r=0,s=n.visibleRanges,o=s.length;rs[r+1].from-2*250;)c=s[++r].to;e.highlight(n.state,l,c,(u,d)=>{let f=n.state.selection.ranges.some(h=>h.from==u&&h.to==d);i.add(u,d,f?cBt:lBt)})}return i.finish()}},{decorations:e=>e.decorations});function FT(e){return t=>{let n=t.state.field(Lg,!1);return n&&n.query.spec.valid?e(t,n):bFe(t)}}const mP=FT((e,{query:t})=>{let{to:n}=e.state.selection.main,i=t.nextMatch(e.state,n,n);if(!i)return!1;let r=pt.single(i.from,i.to),s=e.state.facet(xk);return e.dispatch({selection:r,effects:[FW(e,i),s.scrollToMatch(r.main,e)],userEvent:"select.search"}),gFe(e),!0}),gP=FT((e,{query:t})=>{let{state:n}=e,{from:i}=n.selection.main,r=t.prevMatch(n,i,i);if(!r)return!1;let s=pt.single(r.from,r.to),o=e.state.facet(xk);return e.dispatch({selection:s,effects:[FW(e,r),o.scrollToMatch(s.main,e)],userEvent:"select.search"}),gFe(e),!0}),dBt=FT((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:pt.create(n.map(i=>pt.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),fBt=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:i,to:r}=n.main,s=[],o=0;for(let l=new k1(e.doc,e.sliceDoc(i,r));!l.next().done;){if(s.length>1e3)return!1;l.value.from==i&&(o=s.length),s.push(pt.range(l.value.from,l.value.to))}return t(e.update({selection:pt.create(s,o),userEvent:"select.search.matches"})),!0},qse=FT((e,{query:t})=>{let{state:n}=e,{from:i,to:r}=n.selection.main;if(n.readOnly)return!1;let s=t.nextMatch(n,i,i);if(!s)return!1;let o=s,l=[],c,u,d=[];o.precise?o.from==i&&o.to==r&&(u=n.toText(t.getReplacement(o)),l.push({from:o.from,to:o.to,insert:u}),o=t.nextMatch(n,o.from,o.to),d.push(Jt.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(i).number)+"."))):o=t.nextMatch(n,o.from,o.to);let f=e.state.changes(l);return o&&(c=pt.single(o.from,o.to).map(f),d.push(FW(e,o)),d.push(n.facet(xk).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:"input.replace"}),!0}),hBt=FT((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:s,to:o,precise:l}=r;l&&n.push({from:s,to:o,insert:t.getReplacement(r)})}if(!n.length)return!1;let i=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:Jt.announce.of(i),userEvent:"input.replace.all"}),!0});function $W(e){return e.state.facet(xk).createPanel(e)}function E7(e,t){var n,i,r,s,o;let l=e.selection.main,c=l.empty||l.to>l.from+100?"":e.sliceDoc(l.from,l.to);if(t&&!c)return t;let u=e.facet(xk);return new hFe({search:((n=t==null?void 0:t.literal)!==null&&n!==void 0?n:u.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(i=t==null?void 0:t.caseSensitive)!==null&&i!==void 0?i:u.caseSensitive,literal:(r=t==null?void 0:t.literal)!==null&&r!==void 0?r:u.literal,regexp:(s=t==null?void 0:t.regexp)!==null&&s!==void 0?s:u.regexp,wholeWord:(o=t==null?void 0:t.wholeWord)!==null&&o!==void 0?o:u.wholeWord})}function mFe(e){let t=tW(e,$W);return t&&t.dom.querySelector("[main-field]")}function gFe(e){let t=mFe(e);t&&t==e.root.activeElement&&t.select()}const bFe=e=>{let t=e.state.field(Lg,!1);if(t&&t.panel){let n=mFe(e);if(n&&n!=e.root.activeElement){let i=E7(e.state,t.query.spec);i.valid&&e.dispatch({effects:nA.of(i)}),n.focus(),n.select()}}else e.dispatch({effects:[LW.of(!0),t?nA.of(E7(e.state,t.query.spec)):hi.appendConfig.of(bBt)]});return!0},yFe=e=>{let t=e.state.field(Lg,!1);if(!t||!t.panel)return!1;let n=tW(e,$W);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:LW.of(!1)}),!0},pBt=[{key:"Mod-f",run:bFe,scope:"editor search-panel"},{key:"F3",run:mP,shift:gP,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:mP,shift:gP,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:yFe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:fBt},{key:"Mod-Alt-g",run:V8t},{key:"Mod-d",run:tBt,preventDefault:!0}];class mBt{constructor(t){this.view=t;let n=this.query=t.state.field(Lg).query.spec;this.commit=this.commit.bind(this),this.searchField=Yr("input",{value:n.search,placeholder:lu(t,"Find"),"aria-label":lu(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Yr("input",{value:n.replace,placeholder:lu(t,"Replace"),"aria-label":lu(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Yr("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=Yr("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=Yr("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function i(r,s,o){return Yr("button",{class:"cm-button",name:r,onclick:s,type:"button"},o)}this.dom=Yr("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,i("next",()=>mP(t),[lu(t,"next")]),i("prev",()=>gP(t),[lu(t,"previous")]),i("select",()=>dBt(t),[lu(t,"all")]),Yr("label",null,[this.caseField,lu(t,"match case")]),Yr("label",null,[this.reField,lu(t,"regexp")]),Yr("label",null,[this.wordField,lu(t,"by word")]),...t.state.readOnly?[]:[Yr("br"),this.replaceField,i("replace",()=>qse(t),[lu(t,"replace")]),i("replaceAll",()=>hBt(t),[lu(t,"replace all")])],Yr("button",{name:"close",onclick:()=>yFe(t),"aria-label":lu(t,"close"),type:"button"},["×"])])}commit(){let t=new hFe({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:nA.of(t)}))}keydown(t){uDt(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?gP:mP)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),qse(this.view))}update(t){for(let n of t.transactions)for(let i of n.effects)i.is(nA)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(xk).top}}function lu(e,t){return e.state.phrase(t)}const lj=30,cj=/[\s\.,:;?!]/;function FW(e,{from:t,to:n}){let i=e.state.doc.lineAt(t),r=e.state.doc.lineAt(n).to,s=Math.max(i.from,t-lj),o=Math.min(r,n+lj),l=e.state.sliceDoc(s,o);if(s!=i.from){for(let c=0;cl.length-lj;c--)if(!cj.test(l[c-1])&&cj.test(l[c])){l=l.slice(0,c);break}}return Jt.announce.of(`${e.state.phrase("current match")}. ${l} ${e.state.phrase("on line")} ${i.number}.`)}const gBt=Jt.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),bBt=[Lg,ym.low(uBt),gBt];class Wse{constructor(t,n,i){this.from=t,this.to=n,this.diagnostic=i}}class xy{constructor(t,n,i){this.diagnostics=t,this.panel=n,this.selected=i}static init(t,n,i){let r=i.facet(iA).markerFilter;r&&(t=r(t,i));let s=t.slice().sort((m,g)=>m.from-g.from||m.to-g.to),o=new im,l=[],c=0,u=i.doc.iter(),d=0,f=i.doc.length;for(let m=0;;){let g=m==s.length?null:s[m];if(!g&&!l.length)break;let b,v;if(l.length)b=c,v=l.reduce((x,k)=>Math.min(x,k.to),g&&g.from>b?g.from:1e8);else{if(b=g.from,b>f)break;v=g.to,l.push(g),m++}for(;mx.from||x.to==b))l.push(x),m++,v=Math.min(x.to,v);else{v=Math.min(x.from,v);break}}v=Math.min(v,f);let y=!1;if(l.some(x=>x.from==b&&(x.to==v||v==f))&&(y=b==v,!y&&v-b<10)){let x=b-(d+u.value.length);x>0&&(u.next(x),d=b);for(let k=b;;){if(k>=v){y=!0;break}if(!u.lineBreak&&d+u.value.length>k)break;k=d+u.value.length,d+=u.value.length,u.next()}}let w=jBt(l);if(y)o.add(b,b,$n.widget({widget:new CBt(w),diagnostics:l.slice()}));else{let x=l.reduce((k,S)=>S.markClass?k+" "+S.markClass:k,"");o.add(b,v,$n.mark({class:"cm-lintRange cm-lintRange-"+w+x,diagnostics:l.slice(),inclusiveEnd:l.some(k=>k.to>v)}))}if(c=v,c==f)break;for(let x=0;x{if(!(t&&o.diagnostics.indexOf(t)<0))if(!i)i=new Wse(r,s,t||o.diagnostics[0]);else{if(o.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new Wse(i.from,s,i.diagnostic)}}),i}function yBt(e,t){let n=t.pos,i=t.end||n,r=e.state.facet(iA).hideOn(e,n,i);if(r!=null)return r;let s=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(o=>o.is(vFe))||e.changes.touchesRange(s.from,Math.max(s.to,i)))}function vBt(e,t){return e.field(Tu,!1)?t:t.concat(hi.appendConfig.of(NBt))}const vFe=hi.define(),BW=hi.define(),xFe=hi.define(),Tu=pl.define({create(){return new xy($n.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),i=null,r=e.panel;if(e.selected){let s=t.changes.mapPos(e.selected.from,1);i=gb(n,e.selected.diagnostic,s)||gb(n,null,s)}!n.size&&r&&t.state.facet(iA).autoPanel&&(r=null),e=new xy(n,r,i)}for(let n of t.effects)if(n.is(vFe)){let i=t.state.facet(iA).autoPanel?n.value.length?rA.open:null:e.panel;e=xy.init(n.value,i,t.state)}else n.is(BW)?e=new xy(e.diagnostics,n.value?rA.open:null,e.selected):n.is(xFe)&&(e=new xy(e.diagnostics,e.panel,n.value));return e},provide:e=>[zC.from(e,t=>t.panel),Jt.decorations.from(e,t=>t.diagnostics)]}),xBt=$n.mark({class:"cm-lintRange cm-lintRange-active"});function wBt(e,t,n){let{diagnostics:i}=e.state.field(Tu),r,s=-1,o=-1;i.between(t-(n<0?1:0),t+(n>0?1:0),(c,u,{spec:d})=>{if(t>=c&&t<=u&&(c==u||(t>c||n>0)&&(tkFe(e,n,!1)))}const OBt=e=>{let t=e.state.field(Tu,!1);(!t||!t.panel)&&e.dispatch({effects:vBt(e.state,[BW.of(!0)])});let n=tW(e,rA.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},Kse=e=>{let t=e.state.field(Tu,!1);return!t||!t.panel?!1:(e.dispatch({effects:BW.of(!1)}),!0)},SBt=e=>{let t=e.state.field(Tu,!1);if(!t)return!1;let n=e.state.selection.main,i=gb(t.diagnostics,null,n.to+1);return!i&&(i=gb(t.diagnostics,null,0),!i||i.from==n.from&&i.to==n.to)?!1:(e.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),JDt(e,i.from,1,{tooltip:OFe,until:r=>r.docChanged||r.newSelection.main.headi.to}),!0)},EBt=[{key:"Mod-Shift-m",run:OBt,preventDefault:!0},{key:"F8",run:SBt}],iA=pn.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...Mh(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:Gse,tooltipFilter:Gse,needsRefresh:(t,n)=>t?n?i=>t(i)||n(i):t:n,hideOn:(t,n)=>t?n?(i,r,s)=>t(i,r,s)||n(i,r,s):t:n,autoPanel:(t,n)=>t||n})}}});function Gse(e,t){return e?t?(n,i)=>t(e(n,i),i):e:t}function wFe(e){let t=[];if(e)e:for(let{name:n}of e){for(let i=0;is.toLowerCase()==r.toLowerCase())){t.push(r);continue e}}t.push("")}return t}function kFe(e,t,n){var i;let r=n?wFe(t.actions):[];return Yr("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Yr("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),(i=t.actions)===null||i===void 0?void 0:i.map((s,o)=>{let l=!1,c=m=>{if(m.preventDefault(),l)return;l=!0;let g=gb(e.state.field(Tu).diagnostics,t);g&&s.apply(e,g.from,g.to)},{name:u}=s,d=r[o]?u.indexOf(r[o]):-1,f=d<0?u:[u.slice(0,d),Yr("u",u.slice(d,d+1)),u.slice(d+1)],h=s.markClass?" "+s.markClass:"";return Yr("button",{type:"button",class:"cm-diagnosticAction"+h,onclick:c,onmousedown:c,"aria-label":` Action: ${u}${d<0?"":` (access key "${r[o]})"`}.`},f)}),t.source&&Yr("div",{class:"cm-diagnosticSource"},t.source))}class CBt extends Tf{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return Yr("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class Xse{constructor(t,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=kFe(t,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class rA{constructor(t){this.view=t,this.items=[];let n=r=>{if(!(r.ctrlKey||r.altKey||r.metaKey)){if(r.keyCode==27)Kse(this.view),this.view.focus();else if(r.keyCode==38||r.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(r.keyCode==40||r.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(r.keyCode==36)this.moveSelection(0);else if(r.keyCode==35)this.moveSelection(this.items.length-1);else if(r.keyCode==13)this.view.focus();else if(r.keyCode>=65&&r.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=wFe(s.actions);for(let l=0;l{for(let s=0;sKse(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(Tu).selected;if(!t)return-1;for(let n=0;n{for(let d of u.diagnostics){if(o.has(d))continue;o.add(d);let f=-1,h;for(let m=i;mi&&(this.items.splice(i,f-i),r=!0)),n&&h.diagnostic==n.diagnostic?h.dom.hasAttribute("aria-selected")||(h.dom.setAttribute("aria-selected","true"),s=h):h.dom.hasAttribute("aria-selected")&&h.dom.removeAttribute("aria-selected"),i++}});i({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:c})=>{let u=c.height/this.list.offsetHeight;l.topc.bottom&&(this.list.scrollTop+=(l.bottom-c.bottom)/u)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let t=this.list.firstChild;function n(){let i=t;t=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;t!=i.dom;)n();t=i.dom.nextSibling}else this.list.insertBefore(i.dom,t);for(;t;)n()}moveSelection(t){if(this.selectedIndex<0)return;let n=this.view.state.field(Tu),i=gb(n.diagnostics,this.items[t].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:xFe.of(i)})}static open(t){return new rA(t)}}function ABt(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(e)}')`}function uj(e){return ABt(``,'width="6" height="3"')}const TBt=Jt.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:uj("#f11")},".cm-lintRange-warning":{backgroundImage:uj("orange")},".cm-lintRange-info":{backgroundImage:uj("#999")},".cm-lintRange-hint":{backgroundImage:uj("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function _Bt(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function jBt(e){let t="hint",n=1;for(let i of e){let r=_Bt(i.severity);r>n&&(n=r,t=i.severity)}return t}const OFe=ZDt(wBt,{hideOn:yBt}),NBt=[Tu,Jt.decorations.compute([Tu],e=>{let{selected:t,panel:n}=e.field(Tu);return!t||!n||t.from==t.to?$n.none:$n.set([xBt.range(t.from,t.to)])}),OFe,TBt];var Yse=function(t){t===void 0&&(t={});var n=t,i=n.crosshairCursor,r=i===void 0?!1:i,s=[];t.closeBracketsKeymap!==!1&&(s=s.concat($5t)),t.defaultKeymap!==!1&&(s=s.concat(U8t)),t.searchKeymap!==!1&&(s=s.concat(pBt)),t.historyKeymap!==!1&&(s=s.concat(KFt)),t.foldKeymap!==!1&&(s=s.concat(QMt)),t.completionKeymap!==!1&&(s=s.concat(t$e)),t.lintKeymap!==!1&&(s=s.concat(EBt));var o=[];return t.lineNumbers!==!1&&o.push(y4e()),t.highlightActiveLineGutter!==!1&&o.push(pMt()),t.highlightSpecialChars!==!1&&o.push(ADt()),t.history!==!1&&o.push(FFt()),t.foldGutter!==!1&&o.push(qMt()),t.drawSelection!==!1&&o.push(gDt()),t.dropCursor!==!1&&o.push(wDt()),t.allowMultipleSelections!==!1&&o.push(sr.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&o.push(PMt()),t.syntaxHighlighting!==!1&&o.push(I4e(XMt,{fallback:!0})),t.bracketMatching!==!1&&o.push(iLt()),t.closeBrackets!==!1&&o.push(P5t()),t.autocompletion!==!1&&o.push(H5t()),t.rectangularSelection!==!1&&o.push(UDt()),r!==!1&&o.push(VDt()),t.highlightActiveLine!==!1&&o.push(IDt()),t.highlightSelectionMatches!==!1&&o.push(W8t()),t.tabSize&&typeof t.tabSize=="number"&&o.push(bk.of(" ".repeat(t.tabSize))),o.concat([gk.of(s.flat())]).filter(Boolean)};const RBt="#e5c07b",Zse="#e06c75",IBt="#56b6c2",PBt="#ffffff",GN="#abb2bf",C7="#7d8799",DBt="#61afef",MBt="#98c379",Jse="#d19a66",LBt="#c678dd",$Bt="#21252b",eae="#2c313a",tae="#282c34",U$="#353a42",FBt="#3E4451",nae="#528bff",BBt=Jt.theme({"&":{color:GN,backgroundColor:tae},".cm-content":{caretColor:nae},".cm-cursor, .cm-dropCursor":{borderLeftColor:nae},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:FBt},".cm-panels":{backgroundColor:$Bt,color:GN},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:tae,color:C7,border:"none"},".cm-activeLineGutter":{backgroundColor:eae},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:U$},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:U$,borderBottomColor:U$},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:eae,color:GN}}},{dark:!0}),UBt=MT.define([{tag:pe.keyword,color:LBt},{tag:[pe.name,pe.deleted,pe.character,pe.propertyName,pe.macroName],color:Zse},{tag:[pe.function(pe.variableName),pe.labelName],color:DBt},{tag:[pe.color,pe.constant(pe.name),pe.standard(pe.name)],color:Jse},{tag:[pe.definition(pe.name),pe.separator],color:GN},{tag:[pe.typeName,pe.className,pe.number,pe.changed,pe.annotation,pe.modifier,pe.self,pe.namespace],color:RBt},{tag:[pe.operator,pe.operatorKeyword,pe.url,pe.escape,pe.regexp,pe.link,pe.special(pe.string)],color:IBt},{tag:[pe.meta,pe.comment],color:C7},{tag:pe.strong,fontWeight:"bold"},{tag:pe.emphasis,fontStyle:"italic"},{tag:pe.strikethrough,textDecoration:"line-through"},{tag:pe.link,color:C7,textDecoration:"underline"},{tag:pe.heading,fontWeight:"bold",color:Zse},{tag:[pe.atom,pe.bool,pe.special(pe.variableName)],color:Jse},{tag:[pe.processingInstruction,pe.string,pe.inserted],color:MBt},{tag:pe.invalid,color:PBt}]),QBt=[BBt,I4e(UBt)];var zBt=Jt.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),VBt=function(t){t===void 0&&(t={});var n=t,i=n.indentWithTab,r=i===void 0?!0:i,s=n.editable,o=s===void 0?!0:s,l=n.readOnly,c=l===void 0?!1:l,u=n.theme,d=u===void 0?"light":u,f=n.placeholder,h=f===void 0?"":f,m=n.basicSetup,g=m===void 0?!0:m,b=[];switch(r&&b.unshift(gk.of([Q8t])),g&&(typeof g=="boolean"?b.unshift(Yse()):b.unshift(Yse(g))),h&&b.unshift(LDt(h)),d){case"light":b.push(zBt);break;case"dark":b.push(QBt);break;case"none":break;default:b.push(d);break}return o===!1&&b.push(Jt.editable.of(!1)),c&&b.push(sr.readOnly.of(!0)),[...b]},HBt=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(t=>!t.empty)});class qBt{constructor(t,n){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=n,this.timeoutMS=n,this.callbacks.push(t)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var t=this.callbacks.slice();this.callbacks.length=0,t.forEach(n=>{try{n()}catch(i){console.error("TimeoutLatch callback error:",i)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class iae{constructor(){this.interval=null,this.latches=new Set}add(t){this.latches.add(t),this.start()}remove(t){this.latches.delete(t),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(t=>{t.tick(),t.isDone&&this.remove(t)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var Q$=null,WBt=()=>typeof window>"u"?new iae:(Q$||(Q$=new iae),Q$),KBt=Jt.theme({"& .cm-scroller":{height:"100% !important"}}),rae=null,z$=null;function GBt(e,t,n,i,r,s){if(!e&&!t&&!n&&!i&&!r&&!s)return null;var o=JSON.stringify({height:e,minHeight:t,maxHeight:n,width:i,minWidth:r,maxWidth:s});return o===rae||(rae=o,z$=Jt.theme({"&":{height:e,minHeight:t,maxHeight:n,width:i,minWidth:r,maxWidth:s}})),z$}var sae=Dh.define(),XBt=200,YBt=[];function ZBt(e){var t=e.value,n=e.selection,i=e.onChange,r=e.onStatistics,s=e.onCreateEditor,o=e.onUpdate,l=e.extensions,c=l===void 0?YBt:l,u=e.autoFocus,d=e.theme,f=d===void 0?"light":d,h=e.height,m=h===void 0?null:h,g=e.minHeight,b=g===void 0?null:g,v=e.maxHeight,y=v===void 0?null:v,w=e.width,x=w===void 0?null:w,k=e.minWidth,S=k===void 0?null:k,O=e.maxWidth,A=O===void 0?null:O,E=e.placeholder,j=E===void 0?"":E,T=e.editable,R=T===void 0?!0:T,C=e.readOnly,N=C===void 0?!1:C,P=e.indentWithTab,I=P===void 0?!0:P,D=e.basicSetup,_=D===void 0?!0:D,L=e.root,F=e.initialState,M=p.useState(),H=M[0],q=M[1],U=p.useState(),Z=U[0],z=U[1],J=p.useState(),ne=J[0],W=J[1],X=p.useState(()=>({current:null}))[0],ce=p.useState(()=>({current:null}))[0],V=GBt(m,b,y,x,S,A),Y=Jt.updateListener.of(ee=>{if(ee.docChanged&&typeof i=="function"&&!ee.transactions.some(ge=>ge.annotation(sae))){X.current?X.current.reset():(X.current=new qBt(()=>{if(ce.current){var ge=ce.current;ce.current=null,ge()}X.current=null},XBt),WBt().add(X.current));var Oe=ee.state.doc,he=Oe.toString();i(he,ee)}r&&r(HBt(ee))}),K=VBt({theme:f,editable:R,readOnly:N,placeholder:j,indentWithTab:I,basicSetup:_}),de=[Y,...V?[V]:[],KBt,...K];return o&&typeof o=="function"&&de.push(Jt.updateListener.of(o)),de=de.concat(c),p.useLayoutEffect(()=>{if(H&&!ne){var ee={doc:t,selection:n,extensions:de},Oe=F?sr.fromJSON(F.json,ee,F.fields):sr.create(ee);if(W(Oe),!Z){var he=new Jt({state:Oe,parent:H,root:L});z(he),s&&s(he,Oe)}}return()=>{Z&&(W(void 0),z(void 0))}},[H,ne]),p.useEffect(()=>{e.container&&q(e.container)},[e.container]),p.useEffect(()=>()=>{Z&&(Z.destroy(),z(void 0)),X.current&&(X.current.cancel(),X.current=null)},[Z]),p.useEffect(()=>{u&&Z&&Z.focus()},[u,Z]),p.useEffect(()=>{Z&&Z.dispatch({effects:hi.reconfigure.of(de)})},[f,c,m,b,y,x,S,A,j,R,N,I,_,i,o]),p.useEffect(()=>{if(t!==void 0){var ee=Z?Z.state.doc.toString():"";if(Z&&t!==ee){var Oe=X.current&&!X.current.isDone,he=()=>{Z&&t!==Z.state.doc.toString()&&Z.dispatch({changes:{from:0,to:Z.state.doc.toString().length,insert:t||""},annotations:[sae.of(!0)]})};Oe?ce.current=he:he()}}},[t,Z]),{state:ne,setState:W,view:Z,setView:z,container:H,setContainer:q}}var JBt=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],SFe=p.forwardRef((e,t)=>{var n=e.className,i=e.value,r=i===void 0?"":i,s=e.selection,o=e.extensions,l=o===void 0?[]:o,c=e.onChange,u=e.onStatistics,d=e.onCreateEditor,f=e.onUpdate,h=e.autoFocus,m=e.theme,g=m===void 0?"light":m,b=e.height,v=e.minHeight,y=e.maxHeight,w=e.width,x=e.minWidth,k=e.maxWidth,S=e.basicSetup,O=e.placeholder,A=e.indentWithTab,E=e.editable,j=e.readOnly,T=e.root,R=e.initialState,C=_Ft(e,JBt),N=p.useRef(null),P=ZBt({root:T,value:r,autoFocus:h,theme:g,height:b,minHeight:v,maxHeight:y,width:w,minWidth:x,maxWidth:k,basicSetup:S,placeholder:O,indentWithTab:A,editable:E,readOnly:j,selection:s,onChange:c,onStatistics:u,onCreateEditor:d,onUpdate:f,extensions:l,initialState:R}),I=P.state,D=P.view,_=P.container,L=P.setContainer;p.useImperativeHandle(t,()=>({editor:N.current,state:I,view:D}),[N,_,I,D]);var F=p.useCallback(H=>{N.current=H,L(H)},[L]);if(typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var M=typeof g=="string"?"cm-theme-"+g:"cm-theme";return a.jsx("div",x7({ref:F,className:""+M+(n?" "+n:"")},C))});SFe.displayName="CodeMirror";function EFe(e){const t=e.toLowerCase(),n=t.split("/").pop()??t,i=n.includes(".")?n.split(".").pop():"";return n==="dockerfile"||n.startsWith("dockerfile.")||n.endsWith(".dockerfile")?[sW.define(TFt)]:i==="py"||i==="pyi"?[$6t()]:["ts","tsx","mts","cts"].includes(i??"")?[o7({typescript:!0,jsx:i==="tsx"})]:["js","jsx","mjs","cjs"].includes(i??"")?[o7({jsx:i==="jsx"})]:i==="json"||i==="jsonc"?[r3t()]:i==="yaml"||i==="yml"?[pFt()]:["md","markdown"].includes(i??"")?[y$t()]:[]}function BT({value:e,path:t,onChange:n,readOnly:i=!1,theme:r="light",lineNumberStart:s=1,height:o="100%",minHeight:l,maxHeight:c,extensions:u}){const d=p.useMemo(()=>[...EFe(t),...s===1?[]:[y4e({formatNumber:f=>String(f+s-1)})],...u??[]],[s,t,u]);return a.jsx(SFe,{value:e,height:o,minHeight:l,maxHeight:c,theme:r,extensions:d,editable:!i,onChange:n,basicSetup:{lineNumbers:s===1,foldGutter:!0,highlightActiveLine:!0,highlightActiveLineGutter:!0,autocompletion:!1}})}const CFe=Object.freeze(Object.defineProperty({__proto__:null,default:BT,languageFor:EFe},Symbol.toStringTag,{value:"Module"}));function e9t(e){var s;const t=e.split(/\r?\n/);if(((s=t[0])==null?void 0:s.trim())!=="---")return{body:e,frontmatter:[]};const n=t.findIndex((o,l)=>l>0&&o.trim()==="---");if(n<0)return{body:e,frontmatter:[]};const i=U5e(t.slice(1,n).join(` `));if(i.errors.length>0)return{body:e,frontmatter:[]};const r=i.toJS();return!r||typeof r!="object"||Array.isArray(r)?{body:e,frontmatter:[]}:{body:t.slice(n+1).join(` -`).replace(/^\s*\n/,""),frontmatter:Object.entries(r).map(([o,l])=>({key:o,value:typeof l=="string"?l:VM(l).trim()}))}}function e9t(){return a.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M2.75 5.5h5l1.5 1.75h8v7.25a1.75 1.75 0 0 1-1.75 1.75h-11a1.75 1.75 0 0 1-1.75-1.75v-9Z"})})}function t9t(){return a.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[a.jsx("path",{d:"M5 2.75h6l4 4v10.5H5z"}),a.jsx("path",{d:"M11 2.75v4h4"})]})}function n9t(e){const t={children:[]};for(const i of e){let r=t;const s=i.path.split("/").filter(Boolean);s.forEach((o,l)=>{let c=r.children.find(u=>u.name===o);if(!c){const u=s.slice(0,l+1).join("/");c={name:o,path:u,children:[]},r.children.push(c)}l===s.length-1&&(c.file=i),r=c})}const n=i=>{i.sort((r,s)=>+!!r.file-+!!s.file||r.name.localeCompare(s.name)),i.forEach(r=>n(r.children))};return n(t.children),t.children}function CFe({nodes:e,depth:t,activePath:n,onSelect:i}){return e.map(r=>a.jsxs("div",{children:[r.file?a.jsxs("button",{type:"button",className:`skill-file-tree__row${r.path===n?" is-active":""}`,style:{paddingLeft:`${12+t*16}px`},onClick:()=>i(r.file),title:r.path,children:[a.jsx(t9t,{}),a.jsx("span",{children:r.name}),a.jsxs("small",{children:[r.file.size.toLocaleString()," B"]})]}):a.jsxs("div",{className:"skill-file-tree__row is-folder",style:{paddingLeft:`${12+t*16}px`},title:r.path,children:[a.jsx(e9t,{}),a.jsx("span",{children:r.name})]}),r.children.length>0?a.jsx(CFe,{nodes:r.children,depth:t+1,activePath:n,onSelect:i}):null]},r.path))}function i9t(e){if(e.content===void 0)return;if(e.content.startsWith("data:")){const i=document.createElement("a");i.href=e.content,i.download=e.path.split("/").pop()||"skill-file",i.click();return}const t=URL.createObjectURL(new Blob([e.content])),n=document.createElement("a");n.href=t,n.download=e.path.split("/").pop()||"skill-file",n.click(),URL.revokeObjectURL(t)}function uL({files:e}){var m;const{t,i18n:n}=_e("skills"),i=p.useMemo(()=>n9t(e),[e]),[r,s]=p.useState(((m=e[0])==null?void 0:m.path)||""),[o,l]=p.useState("preview"),c=e.find(g=>g.path===r)||e[0],u=(c==null?void 0:c.path.toLowerCase())||"",d=u.endsWith(".md")||u.endsWith(".markdown"),f=/\.(png|jpe?g|gif|webp|svg)$/.test(u),h=p.useMemo(()=>JBt(d&&(c==null?void 0:c.content)!==void 0?c.content:""),[c==null?void 0:c.content,d]);return a.jsxs("div",{className:"skill-file-browser",children:[a.jsx("aside",{className:"skill-file-tree","aria-label":t("fileTree.ariaLabel"),children:a.jsx(CFe,{nodes:i,depth:0,activePath:(c==null?void 0:c.path)||"",onSelect:g=>s(g.path)})}),a.jsx("section",{className:"skill-file-preview",children:c?a.jsxs(a.Fragment,{children:[a.jsxs("header",{children:[a.jsx("span",{title:c.path,children:c.path}),a.jsxs("div",{children:[d?a.jsx("button",{type:"button",onClick:()=>l(g=>g==="preview"?"source":"preview"),children:t(o==="preview"?"fileTree.viewSource":"fileTree.viewPreview")}):null,a.jsx("button",{type:"button",disabled:c.content===void 0,onClick:()=>i9t(c),children:t("fileTree.download")})]})]}),a.jsx("div",{className:"skill-file-preview__body",children:c.kind==="binary"||c.content===void 0?a.jsxs("div",{className:"skill-file-preview__binary",children:[a.jsx("strong",{children:t("fileTree.binaryFile")}),a.jsx("span",{children:t("fileTree.bytes",{value:new Intl.NumberFormat(n.resolvedLanguage).format(c.size)})}),a.jsx("span",{children:t("fileTree.binaryDescription")})]}):f?a.jsx("img",{src:c.content.startsWith("data:")?c.content:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(c.content)}`,alt:c.path}):d&&o==="preview"?a.jsxs("div",{className:"skill-file-preview__markdown",children:[h.frontmatter.length>0?a.jsx("dl",{className:"skill-file-preview__frontmatter","aria-label":t("fileTree.metadata"),children:h.frontmatter.map(g=>a.jsxs("div",{children:[a.jsx("dt",{children:g.key}),a.jsx("dd",{children:g.value})]},g.key))}):null,a.jsx(Nd,{text:h.body,allowRawHtml:!1,className:"skill-file-preview__markdown-body"})]}):a.jsx(BT,{value:c.content,path:c.path,readOnly:!0,onChange:()=>{}})})]}):a.jsx("div",{className:"skill-file-preview__binary",children:t("fileTree.noFiles")})})]})}const r9t=Object.freeze(Object.defineProperty({__proto__:null,SkillFileTree:uL},Symbol.toStringTag,{value:"Module"})),s9t=1200,a9t=3,AFe=2,o9t=/SKILL\.md|frontmatter|Skill name|description|根目录|目录名|UTF-8|文本文件|文件数|符号链接|敏感凭证/i,aae={concise:"generation.styles.concise",strict:"generation.styles.strict",tutorial:"generation.styles.tutorial",automation:"generation.styles.automation"};function oae(e,t){var n;return{id:`group-${Date.now()}-${e}`,model:((n=t.models[e%Math.max(1,t.models.length)])==null?void 0:n.id)||"",style:"concise",customStyle:""}}function l9t(e){return e?e.state==="ready"?en("generation.stages.ready"):e.state==="failed"?en("generation.stages.failed"):e.state==="cancelled"?en("generation.stages.cancelled"):e.stage==="validating"?en("generation.stages.validating"):e.stage==="packaging"?en("generation.stages.packaging"):en("generation.stages.generating"):en("generation.stages.preparing")}function V$(e){var t;return e.state==="failed"&&((t=e.validation)==null?void 0:t.valid)===!1&&e.validation.errors.some(n=>o9t.test(n))}function lae(e){var n;const t=((n=e.validation)==null?void 0:n.errors.join(` +`).replace(/^\s*\n/,""),frontmatter:Object.entries(r).map(([o,l])=>({key:o,value:typeof l=="string"?l:VM(l).trim()}))}}function t9t(){return a.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M2.75 5.5h5l1.5 1.75h8v7.25a1.75 1.75 0 0 1-1.75 1.75h-11a1.75 1.75 0 0 1-1.75-1.75v-9Z"})})}function n9t(){return a.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[a.jsx("path",{d:"M5 2.75h6l4 4v10.5H5z"}),a.jsx("path",{d:"M11 2.75v4h4"})]})}function i9t(e){const t={children:[]};for(const i of e){let r=t;const s=i.path.split("/").filter(Boolean);s.forEach((o,l)=>{let c=r.children.find(u=>u.name===o);if(!c){const u=s.slice(0,l+1).join("/");c={name:o,path:u,children:[]},r.children.push(c)}l===s.length-1&&(c.file=i),r=c})}const n=i=>{i.sort((r,s)=>+!!r.file-+!!s.file||r.name.localeCompare(s.name)),i.forEach(r=>n(r.children))};return n(t.children),t.children}function AFe({nodes:e,depth:t,activePath:n,onSelect:i}){return e.map(r=>a.jsxs("div",{children:[r.file?a.jsxs("button",{type:"button",className:`skill-file-tree__row${r.path===n?" is-active":""}`,style:{paddingLeft:`${12+t*16}px`},onClick:()=>i(r.file),title:r.path,children:[a.jsx(n9t,{}),a.jsx("span",{children:r.name}),a.jsxs("small",{children:[r.file.size.toLocaleString()," B"]})]}):a.jsxs("div",{className:"skill-file-tree__row is-folder",style:{paddingLeft:`${12+t*16}px`},title:r.path,children:[a.jsx(t9t,{}),a.jsx("span",{children:r.name})]}),r.children.length>0?a.jsx(AFe,{nodes:r.children,depth:t+1,activePath:n,onSelect:i}):null]},r.path))}function r9t(e){if(e.content===void 0)return;if(e.content.startsWith("data:")){const i=document.createElement("a");i.href=e.content,i.download=e.path.split("/").pop()||"skill-file",i.click();return}const t=URL.createObjectURL(new Blob([e.content])),n=document.createElement("a");n.href=t,n.download=e.path.split("/").pop()||"skill-file",n.click(),URL.revokeObjectURL(t)}function uL({files:e}){var m;const{t,i18n:n}=_e("skills"),i=p.useMemo(()=>i9t(e),[e]),[r,s]=p.useState(((m=e[0])==null?void 0:m.path)||""),[o,l]=p.useState("preview"),c=e.find(g=>g.path===r)||e[0],u=(c==null?void 0:c.path.toLowerCase())||"",d=u.endsWith(".md")||u.endsWith(".markdown"),f=/\.(png|jpe?g|gif|webp|svg)$/.test(u),h=p.useMemo(()=>e9t(d&&(c==null?void 0:c.content)!==void 0?c.content:""),[c==null?void 0:c.content,d]);return a.jsxs("div",{className:"skill-file-browser",children:[a.jsx("aside",{className:"skill-file-tree","aria-label":t("fileTree.ariaLabel"),children:a.jsx(AFe,{nodes:i,depth:0,activePath:(c==null?void 0:c.path)||"",onSelect:g=>s(g.path)})}),a.jsx("section",{className:"skill-file-preview",children:c?a.jsxs(a.Fragment,{children:[a.jsxs("header",{children:[a.jsx("span",{title:c.path,children:c.path}),a.jsxs("div",{children:[d?a.jsx("button",{type:"button",onClick:()=>l(g=>g==="preview"?"source":"preview"),children:t(o==="preview"?"fileTree.viewSource":"fileTree.viewPreview")}):null,a.jsx("button",{type:"button",disabled:c.content===void 0,onClick:()=>r9t(c),children:t("fileTree.download")})]})]}),a.jsx("div",{className:"skill-file-preview__body",children:c.kind==="binary"||c.content===void 0?a.jsxs("div",{className:"skill-file-preview__binary",children:[a.jsx("strong",{children:t("fileTree.binaryFile")}),a.jsx("span",{children:t("fileTree.bytes",{value:new Intl.NumberFormat(n.resolvedLanguage).format(c.size)})}),a.jsx("span",{children:t("fileTree.binaryDescription")})]}):f?a.jsx("img",{src:c.content.startsWith("data:")?c.content:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(c.content)}`,alt:c.path}):d&&o==="preview"?a.jsxs("div",{className:"skill-file-preview__markdown",children:[h.frontmatter.length>0?a.jsx("dl",{className:"skill-file-preview__frontmatter","aria-label":t("fileTree.metadata"),children:h.frontmatter.map(g=>a.jsxs("div",{children:[a.jsx("dt",{children:g.key}),a.jsx("dd",{children:g.value})]},g.key))}):null,a.jsx(Nd,{text:h.body,allowRawHtml:!1,className:"skill-file-preview__markdown-body"})]}):a.jsx(BT,{value:c.content,path:c.path,readOnly:!0,onChange:()=>{}})})]}):a.jsx("div",{className:"skill-file-preview__binary",children:t("fileTree.noFiles")})})]})}const s9t=Object.freeze(Object.defineProperty({__proto__:null,SkillFileTree:uL},Symbol.toStringTag,{value:"Module"})),a9t=1200,o9t=3,TFe=2,l9t=/SKILL\.md|frontmatter|Skill name|description|根目录|目录名|UTF-8|文本文件|文件数|符号链接|敏感凭证/i,aae={concise:"generation.styles.concise",strict:"generation.styles.strict",tutorial:"generation.styles.tutorial",automation:"generation.styles.automation"};function oae(e,t){var n;return{id:`group-${Date.now()}-${e}`,model:((n=t.models[e%Math.max(1,t.models.length)])==null?void 0:n.id)||"",style:"concise",customStyle:""}}function c9t(e){return e?e.state==="ready"?en("generation.stages.ready"):e.state==="failed"?en("generation.stages.failed"):e.state==="cancelled"?en("generation.stages.cancelled"):e.stage==="validating"?en("generation.stages.validating"):e.stage==="packaging"?en("generation.stages.packaging"):en("generation.stages.generating"):en("generation.stages.preparing")}function V$(e){var t;return e.state==="failed"&&((t=e.validation)==null?void 0:t.valid)===!1&&e.validation.errors.some(n=>l9t.test(n))}function lae(e){var n;const t=((n=e.validation)==null?void 0:n.errors.join(` `))||e.error||en("generation.validation.fallback");return[en("generation.validation.repairInstruction"),en("generation.validation.recheckInstruction"),t.slice(0,2e3)].join(` -`)}function c9t(e){var t;if(e.repairing||((t=e.task)==null?void 0:t.state)==="running"&&e.repairMode){if(e.repairMode==="manual")return en("generation.stages.repairingAgain");const n=Math.max(1,e.repairAttempts||1);return en("generation.stages.autoRepairing",{attempt:n,max:AFe})}return l9t(e.task)}function cae(){return a.jsxs("svg",{className:"skill-generation__spinner",viewBox:"0 0 20 20","aria-hidden":"true",children:[a.jsx("circle",{cx:"10",cy:"10",r:"7"}),a.jsx("path",{d:"M10 3a7 7 0 0 1 7 7"})]})}function u9t(e,t=Date.now()){if(!(e!=null&&e.expiresAt))return en("generation.sessionMax");const n=Math.max(0,new Date(e.expiresAt).getTime()-t),i=Math.floor(n/6e4),r=Math.floor(n%6e4/1e3);return en("generation.remaining",{minutes:i,seconds:String(r).padStart(2,"0")})}function d9t(e){return e?e.length>64?en("generation.validation.nameTooLong"):/^[a-z0-9-]+$/.test(e)?"":en("generation.validation.invalidName"):""}function uae(e){return e?e.length>128?en("generation.validation.modelTooLong"):/^[A-Za-z0-9][A-Za-z0-9._:/-]*$/.test(e)?"":en("generation.validation.invalidModel"):""}function H$(e){return`${e.region||""}:${e.id}`}function f9t(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m14.5 6-6 6 6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}function h9t({operation:e,cloudProvider:t,space:n,availableSpaces:i=[],spacesLoading:r=!1,initialIntent:s="",source:o,onBack:l,onPublished:c}){var Ae,Ee,Ce,Be;const{t:u}=_e("skills"),[d,f]=p.useState(null),[h,m]=p.useState(null),[g,b]=p.useState(s),[v,y]=p.useState(""),[w,x]=p.useState([]),[k,S]=p.useState([]),[O,A]=p.useState(""),[E,j]=p.useState(!1),[T,R]=p.useState(""),[C,N]=p.useState(""),[P,I]=p.useState(null),[D,_]=p.useState(""),[L,F]=p.useState(""),[M,H]=p.useState(n?H$(n):""),[q,U]=p.useState(Date.now()),Z=p.useRef([]);p.useEffect(()=>{const he=new AbortController;return _M(he.signal).then(ie=>{f(ie),x([oae(0,ie)])}).catch(ie=>{he.signal.aborted||m(Lr(ie,en("generation.errors.loadCapability")))}),()=>he.abort()},[]),p.useEffect(()=>{Z.current=k},[k]),p.useEffect(()=>{const he=window.setInterval(()=>U(Date.now()),1e3);return()=>window.clearInterval(he)},[]),p.useEffect(()=>{const he=ie=>{Z.current.some(we=>{var Re;return((Re=we.task)==null?void 0:Re.state)==="running"||we.repairing})&&ie.preventDefault()};return window.addEventListener("beforeunload",he),()=>{var ie;window.removeEventListener("beforeunload",he);for(const we of Z.current)(ie=we.task)!=null&&ie.jobId&&_2t(we.task.jobId).catch(()=>{})}},[]),p.useEffect(()=>{if(!k.some(Re=>{var Ue;return((Ue=Re.task)==null?void 0:Ue.state)==="running"||Re.repairing}))return;let he=!1,ie;const we=async()=>{const Re=Z.current,Ue=await Promise.all(Re.map(async _t=>{var Pt;if(((Pt=_t.task)==null?void 0:Pt.state)!=="running")return _t;try{const Gt=await C2t(_t.task.jobId);if(V$(Gt)&&(_t.repairAttempts||0)qe.map(yt=>yt.id===_t.id?{...yt,task:Gt,repairing:!0,repairMode:"auto",repairAttempts:Lt,repairError:void 0}:yt));try{const qe=await M4({jobId:Gt.jobId,intent:lae(Gt),expectedRevision:Gt.revision});return{..._t,task:qe,artifact:void 0,repairing:!1,repairMode:"auto",repairAttempts:Lt,repairError:void 0,error:void 0,pollError:void 0}}catch(qe){return{..._t,task:Gt,repairing:!1,repairMode:void 0,repairAttempts:Lt,repairError:Lr(qe,en("generation.errors.autoRepair")),pollError:void 0}}}let St=_t.artifact;return Gt.state==="ready"&&(St=await D4(Gt.jobId,Gt.revision)),{..._t,task:Gt,artifact:St,repairing:!1,repairMode:Gt.state==="running"?_t.repairMode:void 0,repairError:void 0,error:void 0,pollError:void 0}}catch(Gt){return{..._t,pollError:Lr(Gt,en("generation.errors.pollCandidate"))}}}));he||(S(Ue),ie=window.setTimeout(()=>void we(),s9t))};return we(),()=>{he=!0,ie!==void 0&&window.clearTimeout(ie)}},[k.some(he=>{var ie;return((ie=he.task)==null?void 0:ie.state)==="running"||he.repairing})]);const z=k.find(he=>he.id===O)||k[0],J=e==="create"&&!n,ne=i.find(he=>H$(he)===M)??null,W=n??ne,X=i.map(he=>({value:H$(he),label:`${Nc(he)||u("generation.unnamedSpace")} · ${Sh(he.region||"cn-beijing",t)}`})),le=d9t(v),V=!!(d!=null&&d.enabled&&g.trim()&&!le&&w.length>0&&w.every(he=>he.model.trim()&&!uae(he.model.trim()))),Y=(he,ie)=>{x(we=>we.map(Re=>Re.id===he?{...Re,...ie}:Re))},K=async he=>{const ie={...he,model:he.model.trim()},we=he.style==="custom"?he.customStyle.trim():he.style;try{const Re=await E2t({operation:e,intent:g.trim(),model:ie.model,style:we,name:v.trim()||void 0,source:o});return{id:he.id,config:ie,task:Re}}catch(Re){return{id:he.id,config:ie,error:Lr(Re,en("generation.errors.createCandidate"))}}},ue=async()=>{if(!V)return;j(!0),I(null);const he=w.map(we=>({id:we.id,config:we}));S(he),A(w[0].id);const ie=await Promise.all(w.map(K));S(ie)},te=async he=>{S(we=>we.map(Re=>Re.id===he.id?{...Re,error:void 0}:Re));const ie=await K(he.config);S(we=>we.map(Re=>Re.id===he.id?ie:Re))},Oe=async()=>{if(!(!(z!=null&&z.task)||!T.trim()||z.task.state!=="ready")){N("refine"),I(null);try{const he=await M4({jobId:z.task.jobId,intent:T.trim(),expectedRevision:z.task.revision});S(ie=>ie.map(we=>we.id===z.id?{...we,task:he,artifact:void 0}:we)),R("")}catch(he){I(Lr(he,en("generation.errors.refine")))}finally{N("")}}},fe=async()=>{if(!(!(z!=null&&z.task)||!V$(z.task))){N("refine"),I(null),S(he=>he.map(ie=>ie.id===z.id?{...ie,repairing:!0,repairMode:"manual",repairError:void 0}:ie));try{const he=await M4({jobId:z.task.jobId,intent:lae(z.task),expectedRevision:z.task.revision});S(ie=>ie.map(we=>we.id===z.id?{...we,task:he,artifact:void 0,repairing:!1,repairMode:"manual",repairError:void 0}:we))}catch(he){S(ie=>ie.map(we=>we.id===z.id?{...we,repairing:!1,repairMode:void 0,repairError:Lr(he,en("generation.errors.repairAgain"))}:we))}finally{N("")}}},pe=async()=>{if(!(!(z!=null&&z.task)||z.task.state!=="ready"||L)){N("publish"),I(null);try{if(!W)throw new Error(en("generation.errors.selectSpace"));const he=z.artifact||await D4(z.task.jobId,z.task.revision),ie=(o==null?void 0:o.region)||W.region||"";if(!ED(ie))throw new Error(en("generation.errors.unsupportedRegion"));await T2t({jobId:z.task.jobId,expectedRevision:z.task.revision,expectedArtifactSha256:he.sha256,disposition:e==="optimize"?"update-source":"create-new",skillSpaceIds:[W.id],projectName:(o==null?void 0:o.projectName)||W.projectName,region:ie,onProgress:we=>_(we.message)}),F(z.id),c()}catch(he){I(Lr(he,en("generation.errors.upload")))}finally{N(""),_("")}}},Se=async()=>{if(!(!(z!=null&&z.task)||z.task.state!=="ready")){N("download");try{const he=z.artifact||await D4(z.task.jobId,z.task.revision);await j2t(z.task.jobId,z.task.revision,he.sha256)}catch(he){I(Lr(he,en("generation.errors.download")))}finally{N("")}}},ve=async()=>{k.some(he=>{var ie;return((ie=he.task)==null?void 0:ie.state)==="running"})&&!window.confirm(en("generation.leaveConfirmation"))||(await Promise.allSettled(k.flatMap(he=>{var ie;return((ie=he.task)==null?void 0:ie.state)==="running"?[A2t({jobId:he.task.jobId,expectedRevision:he.task.revision})]:[]})),l())},Le=e==="create"?u("generation.createTitle"):u("generation.optimizeTitle",{name:(o==null?void 0:o.name)||u("generation.skillFallback")}),He=he=>{var ie;return((ie=d==null?void 0:d.models.find(we=>we.id===he))==null?void 0:ie.label)||he},Ge=he=>he.config.style==="custom"?he.config.customStyle.trim()||u("generation.styles.customFallback"):u(aae[he.config.style]),De=[...Object.entries(aae).map(([he,ie])=>({value:he,label:u(ie)})),{value:"custom",label:u("generation.styles.custom")}],se=he=>he.error||he.repairError?u("generation.stages.failed"):c9t(he),ce=he=>!he.error&&!he.repairError&&(he.repairing||!he.task||he.task.state==="running"),ye=k.some(he=>{var ie;return((ie=he.task)==null?void 0:ie.state)==="ready"});return a.jsxs("section",{className:"skill-generation",children:[a.jsxs("header",{className:"skill-generation__header",children:[a.jsx("button",{type:"button",className:"skillcenter-back",onClick:()=>void ve(),"aria-label":u("generation.back"),children:a.jsx(f9t,{})}),a.jsxs("div",{children:[a.jsx("h1",{children:Le}),a.jsx("p",{children:Nc(n)||u("generation.home")})]}),k.length>0?a.jsx("span",{className:"skill-generation__ttl",children:u9t(z==null?void 0:z.task,q)}):null]}),E?a.jsxs("div",{className:"skill-generation__workspace",children:[a.jsx("div",{className:"skill-generation__candidate-tabs",role:"tablist","aria-label":u("generation.candidates"),children:k.map(he=>a.jsxs("button",{type:"button",role:"tab","aria-selected":(z==null?void 0:z.id)===he.id,className:(z==null?void 0:z.id)===he.id?"is-active":"",onClick:()=>A(he.id),children:[a.jsxs("span",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.style")}),a.jsx("strong",{children:Ge(he)})]}),a.jsxs("span",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.model")}),a.jsx("strong",{children:He(he.config.model)})]}),a.jsxs("span",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.progress")}),a.jsxs("strong",{children:[ce(he)?a.jsx(cae,{}):null,se(he)]})]})]},he.id))}),z?a.jsxs("div",{className:"skill-generation__candidate",children:[a.jsxs("section",{className:"skill-generation__activity",children:[a.jsx("header",{children:a.jsxs("div",{className:"skill-generation__candidate-summary",children:[a.jsxs("div",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.style")}),a.jsx("strong",{children:Ge(z)})]}),a.jsxs("div",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.model")}),a.jsx("strong",{children:He(z.config.model)})]}),a.jsxs("div",{className:"skill-generation__summary-row","aria-live":"polite",children:[a.jsx("span",{children:u("generation.progress")}),a.jsxs("strong",{children:[ce(z)?a.jsx(cae,{}):null,ce(z)?a.jsx(on,{children:se(z)}):se(z)]})]})]})}),z.task?a.jsx(INt,{activities:z.task.activities}):null,z.pollError?a.jsx("div",{className:"skill-inline-notice",children:a.jsx(Rs,{error:z.pollError})}):null,z.repairError?a.jsx("div",{className:"skill-inline-notice",children:a.jsx(Rs,{error:z.repairError})}):null,z.error?a.jsxs("div",{className:"skill-inline-error",children:[a.jsx(Rs,{error:z.error}),a.jsx("button",{type:"button",onClick:()=>void te(z),children:u("generation.retryCandidate")})]}):null,(Ae=z.task)!=null&&Ae.validation&&!z.task.validation.valid&&!z.repairing&&z.task.state==="failed"?a.jsxs("div",{className:"skill-validation-errors",children:[a.jsx("strong",{children:u("generation.formatValidationFailed")}),z.task.validation.errors.map(he=>a.jsx("p",{children:he},he)),V$(z.task)?a.jsx("button",{type:"button",disabled:!!C,onClick:()=>void fe(),children:u("generation.repairAgain")}):null]}):null]}),a.jsxs("section",{className:"skill-generation__files",children:[a.jsxs("header",{children:[a.jsx("h2",{children:u("generation.files")}),((Ee=z.task)==null?void 0:Ee.state)==="ready"?a.jsx("button",{type:"button",onClick:()=>void Se(),disabled:!!C,children:u("generation.downloadZip")}):null]}),z.artifact?a.jsx(uL,{files:z.artifact.files}):a.jsx("div",{className:"skill-generation__files-empty",children:((Ce=z.task)==null?void 0:Ce.state)==="ready"?u("generation.loadingFiles"):u("generation.filesPending")})]}),((Be=z.task)==null?void 0:Be.state)==="ready"?a.jsxs("div",{className:"skill-generation__ready-actions",children:[J?a.jsx("div",{className:"skill-generation__publish-target",children:a.jsx(RN,{label:u("generation.uploadToSpace"),value:M,options:X,onChange:H,disabled:r,placeholder:u(r?"generation.loadingSpaces":"generation.selectSpace")})}):null,a.jsxs("footer",{className:"skill-generation__followup",children:[a.jsx("textarea",{value:T,onChange:he=>R(he.target.value),placeholder:u("generation.continuePlaceholder")}),a.jsx("button",{type:"button",className:"skill-button",disabled:!T.trim()||!!C,onClick:()=>void Oe(),children:u("generation.continue")}),a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!!C||!!L||!W,onClick:()=>void pe(),children:C==="publish"?D||u("generation.uploading"):u(e==="optimize"?"generation.overwrite":J?"generation.uploadToSelectedSpace":"generation.uploadToCurrentSpace")})]})]}):null,P?a.jsx("div",{className:"skill-inline-error skill-generation__action-error",children:a.jsx(Rs,{error:P})}):null]}):null,!ye&&k.every(he=>he.error)?a.jsx("div",{className:"skill-inline-error",children:u("generation.allCandidatesFailed")}):null]}):a.jsxs("div",{className:"skill-generation__setup",children:[a.jsx("div",{className:"skill-generation__section-head is-basic",children:a.jsx("div",{children:a.jsx("strong",{children:u("generation.basicInfo")})})}),a.jsxs("label",{children:[a.jsxs("span",{children:[u("generation.goal"),a.jsx("span",{className:"skill-required-mark","aria-hidden":"true",children:"*"})]}),a.jsx("textarea",{required:!0,value:g,onChange:he=>b(he.target.value),placeholder:u(e==="create"?"generation.createIntentPlaceholder":"generation.optimizeIntentPlaceholder")})]}),a.jsxs("label",{children:[a.jsx("span",{children:u("generation.skillName")}),a.jsx("input",{value:v,onChange:he=>y(he.target.value),placeholder:u("generation.autoNamePlaceholder"),"aria-invalid":!!le,"aria-describedby":"skill-name-help"}),le?a.jsx("span",{id:"skill-name-help",className:"skill-generation__field-error",role:"alert",children:le}):a.jsx("span",{id:"skill-name-help",className:"skill-generation__field-help",children:u("generation.nameHelp")})]}),a.jsx("div",{className:"skill-generation__section-head",children:a.jsxs("div",{children:[a.jsx("strong",{children:u(e==="create"?"generation.createPlans":"generation.optimizePlans")}),a.jsx("span",{children:u(e==="create"?"generation.createPlansDescription":"generation.optimizePlansDescription")})]})}),a.jsxs("div",{className:"skill-generation__groups",children:[w.map((he,ie)=>a.jsxs("article",{className:"skill-generation__group",children:[a.jsxs("header",{children:[a.jsx("strong",{children:u("generation.plan",{count:ie+1})}),w.length>1?a.jsx("button",{type:"button",onClick:()=>x(we=>we.filter(Re=>Re.id!==he.id)),children:u("generation.remove")}):null]}),a.jsx(RN,{label:u("generation.model"),required:!0,value:he.model,options:(d==null?void 0:d.models.map(we=>({value:we.id,label:we.label})))||[],onChange:we=>Y(he.id,{model:we}),allowCustom:!0,placeholder:u("generation.modelPlaceholder"),error:uae(he.model.trim())}),a.jsx(RN,{label:u("generation.style"),required:!0,value:he.style,options:De,onChange:we=>Y(he.id,{style:we})}),he.style==="custom"?a.jsxs("label",{children:[a.jsx("span",{children:u("generation.customStyle")}),a.jsx("textarea",{value:he.customStyle,onChange:we=>Y(he.id,{customStyle:we.target.value}),placeholder:u("generation.customStylePlaceholder")})]}):null]},he.id)),d&&w.lengthx(he=>[...he,oae(he.length,d)]),children:u("generation.addConfiguration")}):null]}),h?a.jsx("div",{className:"skill-inline-error",children:a.jsx(Rs,{error:h})}):null,d&&!d.enabled?a.jsx("div",{className:"skill-inline-notice",children:u("generation.notConfigured")}):null,a.jsx("div",{className:"skill-generation__setup-actions",children:a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!V,onClick:()=>void ue(),children:u("generation.generate")})})]})]})}async function TFe(e,t,n,i){const r=new URLSearchParams({region:e.region}),s=await fetch(Na(`/web/skill-management/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/versions?${r}`),{...t,headers:hl(oc(t.headers)),signal:po(e.signal,i)});if(!s.ok)throw await aT(s,n);return s.json()}function p9t(e){return TFe(e,{},Q("skills.listVersionsFailed"),eo)}function m9t(e){return TFe(e,{method:"POST",headers:{"Content-Type":"application/zip"},body:e.file},Q("skills.uploadVersionFailed"),yr)}function _Fe(e){const t=new Map;for(const n of e){const i=`${n.sourceSkillId}:${n.version}`,r=t.get(i);(!r||n.submittedAt>r.submittedAt)&&t.set(i,n)}return t}function g9t(e,t,n,i){const r=i.trim().toLocaleLowerCase();return e.filter(s=>s.kind===t&&(n==="all"||s.status===n)&&`${s.name} ${s.description} ${s.author} ${s.version}`.toLocaleLowerCase().includes(r))}const jFe=p.createContext(void 0);function Nb(e){const t=p.useContext(jFe);if(!e&&t===void 0)throw new Error(Uc(27));return t}const Zv=p.forwardRef(function(t,n){const{render:i,className:r,style:s,forceRender:o=!1,...l}=t,c=Nb(),u=c.useState("open"),d=c.useState("nested"),f=c.useState("mounted"),h=c.useState("transitionStatus");return Da("div",t,{state:{open:u,transitionStatus:h},ref:[c.context.backdropRef,n],stateAttributesMapping:Eje,props:[{role:"presentation",hidden:!f,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:o||!d})}),dL=p.forwardRef(function(t,n){const{render:i,className:r,style:s,disabled:o=!1,nativeButton:l=!0,...c}=t,u=Nb(),d=u.useState("open"),{getButtonProps:f,buttonRef:h}=WD({disabled:o,native:l}),m={disabled:o};function g(b){d&&u.setOpen(!1,pa(N_e,b.nativeEvent))}return Da("button",t,{state:m,ref:[n,h],props:[{onClick:g},c,f]})}),UT=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:o,...l}=t,c=Nb(),u=nm(o);return c.useSyncedValueWithCleanup("descriptionElementId",u),Da("p",t,{ref:n,props:[{id:u},l]})}),NFe=p.createContext(void 0);function b9t(){const e=p.useContext(NFe);if(e===void 0)throw new Error(Uc(26));return e}const y9t={...hV,...qD,nestedDialogOpen(e){return e?{"data-nested-dialog-open":""}:null}},Jv=p.forwardRef(function(t,n){const{render:i,className:r,style:s,finalFocus:o,initialFocus:l,...c}=t,u=Nb(),d=u.useState("descriptionElementId"),f=u.useState("disablePointerDismissal"),h=u.useState("floatingRootContext"),m=u.useState("popupProps"),g=u.useState("modal"),b=u.useState("mounted"),v=u.useState("nested"),y=u.useState("nestedOpenDialogCount"),w=u.useState("open"),x=u.useState("openMethod"),k=u.useState("titleElementId"),S=u.useState("transitionStatus"),O=u.useState("role"),A=h.useState("floatingId");b9t(),WA({open:w,ref:u.context.popupRef,onComplete(){var N,P;w&&((P=(N=u.context).onOpenChangeComplete)==null||P.call(N,!0))}});const E=l===void 0?oje(u.context.popupRef):l,j=y>0,T=u.useStateSetter("popupElement"),C=Da("div",t,{state:{open:w,nested:v,transitionStatus:S,nestedDialogOpen:j},props:[m,{id:A,"aria-labelledby":k,"aria-describedby":d,role:O,...aje,hidden:!b,onKeyDown(N){hLe.has(N.key)&&N.stopPropagation()},style:{"--nested-dialogs":y}},c],ref:[n,u.context.popupRef,T],stateAttributesMapping:y9t});return a.jsx(z_e,{context:h,openInteractionType:x,disabled:!b,closeOnFocusOut:!f,initialFocus:E,returnFocus:o,modal:g!==!1,restoreFocus:"popup",children:C})}),e0=p.forwardRef(function(t,n){const{keepMounted:i=!1,...r}=t,s=Nb(),o=s.useState("mounted"),l=s.useState("modal"),c=s.useState("open");return o||i?a.jsx(NFe.Provider,{value:i,children:a.jsxs(L_e,{ref:n,...r,children:[o&&l===!0&&a.jsx(dLe,{ref:s.context.internalBackdropRef,inert:rV(!c)}),t.children]})}):null});function v9t({store:e,parentContext:t,isDrawer:n}){const i=e.useState("open"),r=e.useState("disablePointerDismissal"),s=e.useState("modal"),o=e.useState("popupElement"),l=e.useState("floatingRootContext"),[c,u]=p.useState(0),[d,f]=p.useState(0),h=c===0,m=H_e(l,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:s==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(g){if(!e.context.outsidePressEnabledRef.current||"button"in g&&g.button!==0)return!1;if("touches"in g){if(g.type==="touchend"){if(g.changedTouches.length!==1||g.touches.length!==0)return!1}else if(g.touches.length!==1)return!1}const b=fo(g);if(h&&!r){if(s){const v=e.context.internalBackdropRef.current,y=e.context.backdropRef.current;return v||y?v===b||y===b||ii(b,o)&&!(b!=null&&b.hasAttribute("data-base-ui-portal")):!0}return!0}return!1},escapeKey:h});return fLe(i&&s===!0,o),e.useContextCallback("onNestedDialogOpen",(g,b)=>{u(g),f(b)}),ti(()=>(t!=null&&t.onNestedDialogOpen&&(i?t.onNestedDialogOpen(c+1,d+(n?1:0)):t.onNestedDialogOpen(0,0)),()=>{t!=null&&t.onNestedDialogOpen&&i&&t.onNestedDialogOpen(0,0)}),[n,i,c,d,t]),pje(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:d}),null}const x9t={...vje,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role};class w9t extends $D{constructor(n,i,r){const s=new uV,o=k9t(n,s,i,r);super(o,O9t(s),x9t);Zt(this,"setOpen",(n,i)=>{var s,o;if(i.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&i.trigger==null&&this.state.activeTriggerId!=null&&(i.trigger=this.state.activeTriggerElement??void 0),(o=(s=this.context).onOpenChange)==null||o.call(s,n,i),i.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,i);const r={open:n};uje(r,n,i.trigger),this.update(r)})}}function k9t(e,t,n,i=!1){const r={...gje(),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e};return r.floatingRootContext=bje(t,n,i),r}function O9t(e){return{popupRef:p.createRef(),backdropRef:p.createRef(),internalBackdropRef:p.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function S9t(e,t){const{children:n,open:i,defaultOpen:r=!1,onOpenChange:s,onOpenChangeComplete:o,disablePointerDismissal:l=!1,modal:c=!0,actionsRef:u,handle:d,triggerId:f,defaultTriggerId:h=null}=t,m=e==="drawer",g=c,b=l,v="dialog",y=Nb(!0),w=y!=null,x={modal:g,disablePointerDismissal:b,nested:w,role:v},k=lje((T,R)=>new w9t({open:r,openProp:i,activeTriggerId:h,triggerIdProp:f,...x},T,R),!0);k.useControlledProp("openProp",i),k.useControlledProp("triggerIdProp",f),k.useSyncedValues(x),k.useContextCallback("onOpenChange",s),k.useContextCallback("onOpenChangeComplete",o);const S=k.useState("open"),O=k.useState("mounted"),A=k.useState("payload");mje(k,S),fje(k);const{forceUnmount:E}=hje(S,k);p.useImperativeHandle(u,()=>({unmount:E,close:()=>k.setOpen(!1,pa(I_e))}),[E,k]);const j=S||O;return a.jsxs(jFe.Provider,{value:k,children:[d&&a.jsx(cje,{handle:d,store:k}),j&&a.jsx(v9t,{store:k,parentContext:y==null?void 0:y.context,isDrawer:m}),typeof n=="function"?n({payload:A}):n]})}function t0(e){return S9t("dialog",e)}const wk=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:o,...l}=t,c=Nb(),u=nm(o);return c.useSyncedValueWithCleanup("titleElementId",u),Da("h2",t,{ref:n,props:[{id:u},l]})}),RFe=p.forwardRef(function(t,n){const{render:i,className:r,style:s,disabled:o=!1,nativeButton:l=!0,id:c,payload:u,handle:d,...f}=t,h=Nb(!0),g=xje(d)??h;if(!g)throw new Error(Uc(79));const b=nm(c),v=g.useState("floatingRootContext"),y=g.useState("isOpenedByTrigger",b),w=g.useState("triggerPopupId",b),x=p.useRef(null),{registerTrigger:k,isMountedByThisTrigger:S}=dje(b,x,g,{payload:u}),{getButtonProps:O,buttonRef:A}=WD({disabled:o,native:l}),E=V_e(v),j=lLe(()=>g.select("open"),C=>{g.set("openMethod",C)}),T={disabled:o,open:y},R=g.useState("triggerProps",S);return Da("button",t,{state:T,ref:[A,n,k,x],props:[E.reference,R,j,{[aV]:"",id:b,"aria-haspopup":"dialog","aria-expanded":y,"aria-controls":w},f,O],stateAttributesMapping:Sje})});async function IFe(e,t){const n=new URLSearchParams({region:e.region}),i=t?"/retry":`?${n}`,r=await fetch(Na(`/web/skill-management/reviews/${encodeURIComponent(e.id)}/score${i}`),{method:t?"POST":"GET",headers:hl(oc(t?{"Content-Type":"application/json"}:void 0)),...t?{body:JSON.stringify({region:e.region})}:{},signal:po(e.signal,eo)});if(!r.ok)throw await aT(r,bn.t(t?"score.retryFailed":"score.loadFailed",{ns:"reviews"}));return r.json()}const E9t=e=>IFe(e,!1),C9t=e=>IFe(e,!0),A9t=["safety","usability","completeness","reliability","maintainability"];function PFe(e){return(e==null?void 0:e.status)==="queued"||(e==null?void 0:e.status)==="running"}function T9t(e){if(e.status!=="not_requested")return{status:e.status,overallScore:e.overallScore,scoredAt:e.scoredAt,modelName:e.modelName,rubricVersion:e.rubricVersion,error:e.error}}function UW({score:e}){const{t}=_e("reviews");return a.jsx("span",{className:`review-score-label is-${(e==null?void 0:e.status)||"unscored"}`,children:(e==null?void 0:e.status)==="completed"?typeof e.overallScore=="number"?t("score.points",{score:e.overallScore}):t("score.insufficient"):t(`score.status.${(e==null?void 0:e.status)||"unscored"}`)})}function DFe({application:e,canRetry:t=!1,onScoreChanged:n}){const{t:i,i18n:r}=_e("reviews"),[s,o]=p.useState(e.aiReview),[l,c]=p.useState(!!e.aiReview),[u,d]=p.useState(null),[f,h]=p.useState({revision:0,retry:!1}),[m,g]=p.useState(""),b=p.useRef(-1),v=p.useRef(n);v.current=n;const{id:y,region:w}=e,x=!!e.aiReview;p.useEffect(()=>{if(!x&&f.revision===0)return;const O=new AbortController;let A,E=!1,j=!0;const T=async(N,P=!1)=>{var I;if(!(E||O.signal.aborted)&&!(!P&&document.visibilityState==="hidden")){E=!0,P&&c(!0),d(null);try{const D=await(N?C9t:E9t)({id:y,region:w,signal:O.signal});if(O.signal.aborted)return;o(D),(I=v.current)==null||I.call(v,D,N),j=PFe(D),j&&document.visibilityState!=="hidden"&&(A=setTimeout(()=>void T(!1),5e3))}catch(D){O.signal.aborted||(j=!1,d(Lr(D,i(N?"score.retryFailed":"score.loadFailed"))))}finally{E=!1,O.signal.aborted||c(!1)}}},R=()=>{clearTimeout(A),j&&document.visibilityState!=="hidden"&&T(!1)},C=f.retry&&b.current!==f.revision;return C&&(b.current=f.revision),T(C,!0),document.addEventListener("visibilitychange",R),()=>{O.abort(),clearTimeout(A),document.removeEventListener("visibilitychange",R)}},[y,w,x,f,i]);const k=(s==null?void 0:s.status)==="completed"?s.result:void 0;p.useEffect(()=>{if(!k){g("");return}const O=URL.createObjectURL(new Blob([JSON.stringify(k,null,2)],{type:"application/json"}));return g(O),()=>URL.revokeObjectURL(O)},[k]);const S=O=>h(A=>({revision:A.revision+1,retry:O}));return a.jsxs("section",{className:"review-score","aria-label":i("score.title"),children:[a.jsxs("div",{className:"review-score__header",children:[a.jsx("div",{"aria-live":"polite",children:l?a.jsx(on,{children:i(f.retry?"score.starting":"score.loading")}):a.jsx(UW,{score:s})}),a.jsxs("div",{className:"review-score__actions",children:[m?a.jsx("a",{className:"cw-btn cw-btn-ghost",href:m,download:`${y}-score.json`,children:i("score.download")}):null,t&&(!s||s.status==="failed"||s.status==="not_requested")?a.jsx("button",{type:"button",className:"cw-btn cw-btn-ghost",disabled:l,onClick:()=>S(!0),children:i((s==null?void 0:s.status)==="failed"?"score.retry":"score.start")}):null]})]}),a.jsx("p",{className:"review-score__hint",children:i("score.hint")}),u?a.jsxs("div",{className:"review-score__error",role:"alert",children:[a.jsx(Rs,{error:u}),a.jsx("button",{type:"button",className:"cw-btn cw-btn-ghost",disabled:l,onClick:()=>S(!1),children:i("score.reload")})]}):null,s!=null&&s.error?a.jsx("div",{role:"alert",className:"review-score__error",children:a.jsxs("details",{className:"review-score__raw-error",open:!0,children:[a.jsx("summary",{children:i("score.originalError")}),a.jsx("pre",{children:s.error})]})}):(s==null?void 0:s.status)==="failed"?a.jsx("p",{role:"alert",className:"review-score__error",children:i("score.failed")}):null,k?a.jsxs(a.Fragment,{children:[k.riskFlags.length?a.jsxs("div",{className:"review-score__risks",children:[a.jsx("h3",{children:i("score.risks")}),a.jsx("ul",{children:k.riskFlags.map((O,A)=>a.jsxs("li",{children:[a.jsx("strong",{children:i(`score.severity.${O.severity}`)})," · ",O.reason]},`${A}:${O.reason}`))})]}):null,k.coverage&&!k.coverage.complete?a.jsxs("div",{className:"review-score__coverage",children:[a.jsx("h3",{children:i("score.coverage")}),a.jsx("p",{children:i("score.coverageIncomplete")}),a.jsx("p",{children:i("score.coverageCount",{included:k.coverage.includedFiles,total:k.coverage.totalFiles})}),a.jsxs("ul",{children:[k.coverage.omittedFiles.map(O=>a.jsx("li",{children:i("score.omittedFile",O)},`omitted:${O.path}`)),k.coverage.truncatedFiles.map(O=>a.jsx("li",{children:i("score.truncatedFile",O)},`truncated:${O.path}`))]})]}):null,a.jsx("dl",{className:"review-score__dimensions",children:A9t.map(O=>{const A=k.dimensions[O];return a.jsxs("div",{className:O==="safety"&&A.score!==null&&A.score<60?"is-risk":void 0,children:[a.jsxs("dt",{children:[a.jsx("span",{children:i(`score.dimensions.${O}`)}),a.jsx("strong",{children:A.score===null?i("score.insufficient"):i("score.points",{score:A.score})})]}),a.jsx("dd",{children:A.reason})]},O)})}),k.suggestions.length?a.jsxs("div",{className:"review-score__suggestions",children:[a.jsx("h3",{children:i("score.suggestions")}),a.jsx("ul",{children:k.suggestions.map((O,A)=>a.jsx("li",{children:O},`${A}:${O}`))})]}):null,a.jsxs("dl",{className:"review-score__metadata",children:[a.jsxs("div",{children:[a.jsx("dt",{children:i("score.model")}),a.jsx("dd",{children:k.modelName})]}),a.jsxs("div",{children:[a.jsx("dt",{children:i("score.rubric")}),a.jsx("dd",{children:k.rubricVersion})]}),a.jsxs("div",{children:[a.jsx("dt",{children:i("score.time")}),a.jsx("dd",{children:a.jsx("time",{dateTime:k.scoredAt,children:new Date(k.scoredAt).toLocaleString(r.language,{hour12:!1})})})]})]})]}):null]})}function _9t({application:e}){const{t}=_e("reviews"),[n,i]=p.useState(!1),[r,s]=p.useState(e.aiReview),o=p.useId();return p.useEffect(()=>s(e.aiReview),[e.aiReview]),a.jsxs("div",{className:"review-score-history",children:[a.jsxs("button",{type:"button",className:"review-score-history__toggle","aria-expanded":n,"aria-controls":o,onClick:()=>i(l=>!l),children:[a.jsx("span",{children:t("score.title")}),a.jsx(UW,{score:r}),a.jsx("span",{children:t(n?"score.collapse":"score.expand")})]}),n?a.jsx("div",{id:o,children:a.jsx(DFe,{application:e,onScoreChanged:s},`${e.region}:${e.id}`)}):null]})}function QT({status:e}){const{t}=_e("reviews");return a.jsxs("span",{className:`review-status is-${e}`,children:[a.jsx("span",{"aria-hidden":"true"}),t(`status.${e}`)]})}function QW({person:e,fallback:t,compact:n=!1}){const{t:i}=_e("reviews"),[r,s]=p.useState(""),o=(e==null?void 0:e.name)||t||i("detail.unknownReviewer"),l=e==null?void 0:e.avatarUrl;return a.jsxs("span",{className:`review-person${n?" is-compact":""}`,children:[l&&l!==r?a.jsx("img",{className:"review-person__avatar",src:l,alt:"",referrerPolicy:"no-referrer",onError:()=>s(l)}):a.jsx("span",{className:"review-person__avatar is-fallback","aria-hidden":"true",children:Array.from(o)[0]}),a.jsxs("span",{className:"review-person__text",children:[a.jsx("span",{children:o}),!n&&(e!=null&&e.email)?a.jsx("span",{className:"review-person__email",children:e.email}):null]})]})}function zW({application:e}){const{t,i18n:n}=_e("reviews");return a.jsxs("div",{className:"review-outcome",children:[a.jsx(QT,{status:e.status}),e.reviewer||e.reviewedBy||e.reviewedAt?a.jsxs("dl",{className:"review-outcome__facts",children:[e.reviewer||e.reviewedBy?a.jsxs("div",{children:[a.jsx("dt",{children:t(`detail.${e.status==="returned"?"returnedBy":e.status==="approved"?"approvedBy":"reviewer"}`)}),a.jsx("dd",{children:a.jsx(QW,{person:e.reviewer,fallback:e.reviewedBy})})]}):null,e.reviewedAt?a.jsxs("div",{children:[a.jsx("dt",{children:t("detail.reviewedAt")}),a.jsx("dd",{children:a.jsx("time",{dateTime:e.reviewedAt,children:new Date(e.reviewedAt).toLocaleString(n.language,{hour12:!1})})})]}):null]}):null,e.reason?a.jsxs("div",{className:"review-outcome__message is-returned",children:[a.jsx("strong",{children:t("decision.reason")}),a.jsx("p",{children:e.reason})]}):null,e.comment?a.jsxs("div",{className:"review-outcome__message",children:[a.jsx("strong",{children:t("detail.comment")}),a.jsx("p",{children:e.comment})]}):null,e.status==="pending"?a.jsx("p",{className:"review-outcome__hint",children:t("detail.pendingHint")}):null,e.status==="approving"?a.jsx("p",{className:"review-outcome__hint",children:t("detail.approvingHint")}):null]})}function VW({applications:e}){const{t,i18n:n}=_e("reviews");return e.length?a.jsx("ol",{className:"review-source-history",children:[...e].sort((i,r)=>r.submittedAt.localeCompare(i.submittedAt)).map(i=>a.jsxs("li",{children:[a.jsxs("div",{className:"review-source-history__submission",children:[a.jsx("strong",{children:i.version}),a.jsx("span",{children:t("detail.submitted",{name:i.author})}),a.jsx("time",{dateTime:i.submittedAt,children:new Date(i.submittedAt).toLocaleString(n.language,{hour12:!1})})]}),a.jsx(zW,{application:i}),a.jsx(_9t,{application:i})]},i.id))}):a.jsx("p",{className:"review-outcome__hint",children:t("detail.noHistory")})}function j9t({name:e,applications:t,onClose:n}){const{t:i}=_e("reviews"),r=p.useRef(document.activeElement instanceof HTMLElement?document.activeElement:null);return a.jsx(t0,{open:!0,onOpenChange:s=>{s||n()},children:a.jsxs(e0,{children:[a.jsx(Zv,{className:"review-backdrop"}),a.jsxs(Jv,{className:"review-drawer",finalFocus:()=>{var s;return(s=r.current)!=null&&s.isConnected?r.current:null},children:[a.jsxs("header",{className:"review-drawer__header",children:[a.jsxs("div",{children:[a.jsx(wk,{children:i("detail.history")}),a.jsx(UT,{children:e})]}),a.jsx(dL,{className:"review-icon-button","aria-label":i("actions.close"),children:a.jsx(ST,{})})]}),a.jsx("div",{className:"review-drawer__body",children:a.jsx(VW,{applications:t})})]})]})})}function N9t({skill:e,space:t,region:n,reviews:i,onClose:r,onChanged:s,onSubmitReview:o}){const{t:l,i18n:c}=_e("ui"),[u,d]=p.useState(null),[f,h]=p.useState(e.version),[m,g]=p.useState(!0),[b,v]=p.useState(null),[y,w]=p.useState(null),[x,k]=p.useState([]),[S,O]=p.useState(!1),[A,E]=p.useState(null),[j,T]=p.useState(0),[R,C]=p.useState(0),[N,P]=p.useState(null),I=p.useRef(null),D=p.useRef(null),_=p.useRef(null),L=p.useRef(!1),F=p.useRef(!0),M=p.useRef({onClose:r,busy:N});M.current={onClose:r,busy:N};const H=u==null?void 0:u.items.find(X=>X.version===f),q=p.useMemo(()=>_Fe(i),[i]),U=q.get(`${e.skillId}:${f}`),Z=i.filter(X=>X.sourceSkillId===e.skillId&&X.version===f&&X.id!==(U==null?void 0:U.id)),z=!!(o&&(u!=null&&u.canUpdate)&&H&&["running","ready"].includes(H.status.toLowerCase())&&(!U||U.status==="returned"));p.useEffect(()=>{var V;F.current=!0;const X=document.activeElement instanceof HTMLElement?document.activeElement:null;(V=_.current)==null||V.focus();const le=Y=>{var Oe;if(Y.key==="Escape"&&(Y.preventDefault(),M.current.busy||M.current.onClose()),Y.key!=="Tab")return;const K=Array.from(((Oe=I.current)==null?void 0:Oe.querySelectorAll('button:not([disabled]), input:not([disabled]):not([type="file"]), a[href], summary, [tabindex="0"]'))||[]),ue=K[0],te=K[K.length-1];Y.shiftKey&&document.activeElement===ue&&(Y.preventDefault(),te==null||te.focus()),!Y.shiftKey&&document.activeElement===te&&(Y.preventDefault(),ue==null||ue.focus())};return document.addEventListener("keydown",le),()=>{F.current=!1,document.removeEventListener("keydown",le),X!=null&&X.isConnected&&X.focus()}},[]),p.useEffect(()=>{const X=new AbortController;return g(!0),v(null),p9t({spaceId:t.id,skillId:e.skillId,region:n,signal:X.signal}).then(le=>{X.signal.aborted||(d(le),h(V=>{var Y;return le.items.some(K=>K.version===V)?V:((Y=le.items[0])==null?void 0:Y.version)||""}))}).catch(le=>{X.signal.aborted||v(Lr(le,l("skillCenter.versions.loadFailed")))}).finally(()=>{X.signal.aborted||g(!1)}),()=>X.abort()},[t.id,e.skillId,n,j,l]),p.useEffect(()=>{if(!f||!H)return;let X=!0;return O(!0),E(null),k([]),EIe({spaceId:t.id,skillId:e.skillId,region:n,version:f}).then(le=>{X&&k(le)}).catch(le=>{X&&E(Lr(le,l("skillCenter.versions.filesFailed")))}).finally(()=>{X&&O(!1)}),()=>{X=!1}},[t.id,e.skillId,n,f,!!H,R,l]);async function J(X){if(!L.current){L.current=!0,P("upload"),w(null);try{const le=await m9t({spaceId:t.id,skillId:e.skillId,region:n,file:X});if(!F.current)return;h(le.version),T(V=>V+1),s()}catch(le){F.current&&w(Lr(le,l("skillCenter.versions.uploadFailed")))}finally{L.current=!1,F.current&&P(null)}}}async function ne(){if(!(!z||!o||L.current)){L.current=!0,P("submit"),w(null);try{await o(f)}catch(X){F.current&&w(Lr(X,l("skillCenter.versions.submitFailed")))}finally{L.current=!1,F.current&&P(null)}}}function W(X){if(!X)return"—";const le=new Date(X);return Number.isNaN(le.getTime())?X:le.toLocaleString(c.resolvedLanguage||c.language)}return a.jsx("div",{className:"skill-detail-backdrop",onMouseDown:X=>{X.target===X.currentTarget&&!N&&r()},children:a.jsxs("section",{className:"skill-detail-dialog skill-versions",role:"dialog","aria-modal":"true","aria-labelledby":"skill-versions-title",ref:I,children:[a.jsxs("header",{className:"skill-detail-head",children:[a.jsx("div",{className:"skill-detail-heading",children:a.jsxs("div",{children:[a.jsx("h2",{id:"skill-versions-title",children:l("skillCenter.versions.title")}),a.jsx("p",{title:e.skillName,children:e.skillName})]})}),a.jsxs("div",{className:"skill-detail-actions",children:[a.jsx("button",{type:"button",disabled:m||!!N,onClick:()=>T(X=>X+1),children:l("skillCenter.versions.refresh")}),u!=null&&u.canUpdate?a.jsx("button",{type:"button",disabled:!!N,onClick:()=>{var X;return(X=D.current)==null?void 0:X.click()},children:l(N==="upload"?"skillCenter.versions.uploading":"skillCenter.versions.upload")}):null,a.jsx("button",{type:"button",ref:_,disabled:!!N,onClick:r,children:l("skillCenter.versions.close")})]}),a.jsx("input",{className:"skill-versions__file-input",ref:D,type:"file",accept:".zip,application/zip","aria-label":l("skillCenter.versions.upload"),onChange:X=>{var V;const le=(V=X.target.files)==null?void 0:V[0];X.target.value="",le&&J(le)}})]}),y?a.jsx("div",{className:"skill-versions__notice",role:"alert",children:a.jsx(Rs,{error:y})}):null,u!=null&&u.canUpdate?a.jsx("p",{className:"skill-versions__hint",children:l("skillCenter.versions.hint")}):null,a.jsxs("div",{className:"skill-versions__body",children:[a.jsxs("div",{className:"skill-versions__history","aria-busy":m,children:[m&&!u?a.jsx("p",{role:"status",children:l("skillCenter.versions.loading")}):null,b?a.jsxs("div",{role:"alert",children:[a.jsx(Rs,{error:b}),a.jsx("button",{className:"cw-btn cw-btn-ghost",type:"button",onClick:()=>T(X=>X+1),children:l("skillCenter.versions.retry")})]}):null,!m&&!b&&!(u!=null&&u.items.length)?a.jsx("p",{children:l("skillCenter.versions.empty")}):null,a.jsx("div",{className:"skill-versions__list",role:"list","aria-label":l("skillCenter.versions.title"),children:u==null?void 0:u.items.map(X=>a.jsx("div",{role:"listitem",children:a.jsxs("button",{type:"button",className:`skill-versions__version${f===X.version?" is-active":""}`,"aria-pressed":f===X.version,onClick:()=>h(X.version),children:[a.jsxs("span",{className:"skill-versions__version-title",children:[a.jsx("strong",{children:X.sourceVersion||X.version}),X.isCurrent?a.jsx("span",{children:l("skillCenter.versions.current")}):null]}),a.jsx("time",{dateTime:X.createdAt,children:W(X.createdAt)}),q.get(`${e.skillId}:${X.version}`)?a.jsx(QT,{status:q.get(`${e.skillId}:${X.version}`).status}):a.jsx("span",{children:l(t.isShared?"skillCenter.versions.shared":"skillCenter.versions.notSubmitted")})]})},X.version))})]}),a.jsx("div",{className:"skill-versions__detail",children:H?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"skill-versions__summary",children:[a.jsxs("div",{children:[a.jsx("h3",{children:H.sourceVersion||H.version}),a.jsx("p",{title:H.description,children:H.description}),H.author||e.author?a.jsx("p",{className:"skill-versions__author",children:l("skillCenter.authorName",{name:H.author||e.author})}):null]}),o&&(u!=null&&u.canUpdate)?a.jsx("button",{type:"button",className:"cw-btn cw-btn-primary",disabled:!z||!!N,onClick:()=>void ne(),children:l(N==="submit"?"skillCenter.versions.submitting":"skillCenter.versions.submit")}):null]}),H.error?a.jsx("p",{className:"skill-versions__notice",role:"alert",children:H.error}):null,["running","ready"].includes(H.status.toLowerCase())?null:a.jsx("p",{role:"status",children:l("skillCenter.versions.processing",{status:H.status})}),U?a.jsx(zW,{application:U}):null,Z.length?a.jsxs("details",{className:"skill-versions__review-history",children:[a.jsx("summary",{children:l("skillCenter.versions.history")}),a.jsx(VW,{applications:Z})]}):null,a.jsx("div",{className:"skill-versions__files",children:S?a.jsx("p",{role:"status",children:l("skillCenter.versions.filesLoading")}):A?a.jsxs("div",{role:"alert",children:[a.jsx(Rs,{error:A}),a.jsx("button",{className:"cw-btn cw-btn-ghost",type:"button",onClick:()=>C(X=>X+1),children:l("skillCenter.versions.retry")})]}):x.length?a.jsx(uL,{files:x},f):a.jsx("p",{children:l("skillCenter.versions.filesEmpty")})})]}):null})]})]})})}function R9t({region:e,active:t,revision:n,onOpen:i}){const{t:r}=_e("ui"),[s,o]=p.useState(null),[l,c]=p.useState(null),[u,d]=p.useState(0);return p.useEffect(()=>{if(!t)return;const f=new AbortController;return c(null),Ipt({region:e,signal:f.signal}).then(h=>{f.signal.aborted||o(h)}).catch(h=>{f.signal.aborted||c(Lr(h,r("skillCenter.sharedLoadFailed")))}),()=>f.abort()},[t,e,u,n,r]),a.jsxs("div",{className:"skillcenter-shared-space",children:[a.jsx(Hv,{className:"skillcenter-space-card",title:r("skillCenter.sharedSpace"),description:r("skillCenter.sharedDescription"),status:a.jsx("span",{className:"skillcenter-shared-badge",children:r("skillCenter.sharedVisibility")}),metadata:[{label:r("skillCenter.skillCount"),value:s?r("skillCenter.skillCountValue",{count:s.skillCount??0}):r(l?"skillCenter.sharedLoadFailed":"skillCenter.sharedPreparing")}],detailAction:{label:r("common.viewDetails"),disabled:!s||!!l,onClick:()=>{s&&i(s)}},action:l?{label:r("common.reload"),onClick:()=>d(f=>f+1)}:void 0}),l?a.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:a.jsx(Rs,{error:l})}):null]})}function HW({title:e,children:t,onClose:n,className:i=""}){const{t:r}=_e("skills"),s=p.useRef(null);return p.useEffect(()=>{var l;(l=s.current)==null||l.focus();const o=c=>c.key==="Escape"&&n();return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[n]),a.jsx("div",{className:"skill-dialog-backdrop",onMouseDown:n,children:a.jsxs("section",{className:`skill-dialog${i?` ${i}`:""}`,role:"dialog","aria-modal":"true","aria-label":e,onMouseDown:o=>o.stopPropagation(),children:[a.jsxs("header",{children:[a.jsx("h2",{children:e}),a.jsx("button",{ref:s,type:"button",onClick:n,"aria-label":r("management.close"),children:r("management.close")})]}),t]})})}function I9t({region:e,regionOptions:t,onClose:n,onCreated:i}){const{t:r}=_e("skills"),[s,o]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(e),[f,h]=p.useState(!1),[m,g]=p.useState(null),b=async()=>{if(s.trim()){h(!0),g(null);try{const v=await Rpt({name:s.trim(),description:l.trim()||void 0,region:u});i({...v,region:v.region||u})}catch(v){g(Lr(v,r("management.createSpaceFailed")))}finally{h(!1)}}};return a.jsxs(HW,{title:r("management.createSpaceTitle"),onClose:n,children:[a.jsxs("div",{className:"skill-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("management.name")}),a.jsx("input",{autoFocus:!0,value:s,maxLength:128,onChange:v=>o(v.target.value)})]}),a.jsx(RN,{label:r("management.region"),value:u,options:t,onChange:d,required:!0}),a.jsxs("label",{children:[a.jsx("span",{children:r("management.optionalDescription")}),a.jsx("textarea",{value:l,maxLength:1024,onChange:v=>c(v.target.value)})]}),m?a.jsx("div",{className:"skill-inline-error",children:a.jsx(Rs,{error:m})}):null]}),a.jsxs("footer",{children:[a.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!s.trim()||f,onClick:()=>void b(),children:r(f?"management.creating":"management.create")})]})]})}function P9t({space:e,region:t,onClose:n,onUpdated:i}){const{t:r}=_e("skills"),[s,o]=p.useState(e.name),[l,c]=p.useState(e.description||""),[u,d]=p.useState(!1),[f,h]=p.useState(null),m=async()=>{if(s.trim()){d(!0),h(null);try{const g=await Fpt({spaceId:e.id,name:s.trim(),description:l.trim()||void 0,region:t});i({...e,...g,skillCount:e.skillCount})}catch(g){h(Lr(g,r("management.updateSpaceFailed")))}finally{d(!1)}}};return a.jsxs(HW,{title:r("management.editSpaceTitle"),onClose:n,children:[a.jsxs("div",{className:"skill-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("management.name")}),a.jsx("input",{autoFocus:!0,value:s,maxLength:128,onChange:g=>o(g.target.value)})]}),a.jsxs("label",{children:[a.jsx("span",{children:r("management.optionalDescription")}),a.jsx("textarea",{value:l,maxLength:1024,onChange:g=>c(g.target.value)})]}),f?a.jsx("div",{className:"skill-inline-error",children:a.jsx(Rs,{error:f})}):null]}),a.jsxs("footer",{children:[a.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!s.trim()||u,onClick:()=>void m(),children:r(u?"management.saving":"management.save")})]})]})}function D9t({space:e,region:t,onClose:n,onUploaded:i}){const{t:r,i18n:s}=_e("skills"),[o,l]=p.useState(null),[c,u]=p.useState(null),[d,f]=p.useState(!1),[h,m]=p.useState(!1),[g,b]=p.useState(null),[v,y]=p.useState(!1),w=p.useRef(0),x=p.useRef(null),k=async O=>{const A=w.current+1;if(w.current=A,l(O),u(null),b(null),f(!!O),!!O)try{const E=await Qpt(O);w.current===A&&u({name:E.name,fileCount:E.files.length})}catch(E){w.current===A&&b(Lr(E,r("management.archiveValidationFailed")))}finally{w.current===A&&f(!1)}},S=async()=>{if(!(!o||!c)){m(!0),b(null);try{await Upt({spaceId:e.id,region:t,project:e.projectName,file:o}),i()}catch(O){b(Lr(O,r("management.uploadFailed")))}finally{m(!1)}}};return a.jsxs(HW,{title:r("management.uploadTitle",{name:Nc(e)}),className:"skill-upload-dialog",onClose:n,children:[a.jsxs("div",{className:"skill-dialog__body",children:[a.jsx("input",{ref:x,className:"skill-upload-dialog__input",type:"file",accept:".zip,application/zip",onChange:O=>{var A;return void k(((A=O.target.files)==null?void 0:A[0])||null)}}),a.jsxs("button",{type:"button",className:`skill-upload-dropzone${v?" is-dragging":""}`,onClick:()=>{var O;return(O=x.current)==null?void 0:O.click()},onDragEnter:O=>{O.preventDefault(),y(!0)},onDragOver:O=>{O.preventDefault(),O.dataTransfer.dropEffect="copy",y(!0)},onDragLeave:O=>{O.currentTarget.contains(O.relatedTarget)||y(!1)},onDrop:O=>{var A;O.preventDefault(),y(!1),k(((A=O.dataTransfer.files)==null?void 0:A[0])||null)},children:[a.jsx("strong",{children:o?o.name:r("management.dropzone")}),a.jsx("span",{children:o?r("fileTree.bytes",{value:new Intl.NumberFormat(s.resolvedLanguage).format(o.size)}):r("management.chooseLocalFile")})]}),a.jsx("p",{children:r("management.archiveHelp")}),d?a.jsx("div",{className:"skill-inline-notice",children:r("management.validating")}):null,c?a.jsx("div",{className:"skill-inline-notice",children:r("management.validationPassed",{name:c.name,count:c.fileCount})}):null,g?a.jsx("div",{className:"skill-inline-error",children:a.jsx(Rs,{error:g})}):null]}),a.jsxs("footer",{children:[a.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!o||!c||d||h,onClick:()=>void S(),children:r(h?"management.uploading":"management.upload")})]})]})}function M9t(e){if(typeof e=="number")return e<1e12?e*1e3:e;const t=e.trim(),n=Number(t);return/^\d+(?:\.\d+)?$/.test(t)?n<1e12?n*1e3:n:Date.parse(t)}function zT(e,t=Date.now(),n="zh-CN"){if(e===void 0||e==="")return"—";const i=M9t(e);if(!Number.isFinite(i))return"—";const r=Math.floor(Math.max(0,t-i)/1e3),s=new Intl.RelativeTimeFormat(n,{numeric:"always"}),o=(f,h,m)=>n.toLowerCase().startsWith("zh")?`${f} ${m}前`:s.format(-f,h);if(r<60)return o(r,"second","秒");const l=Math.floor(r/60);if(l<60)return o(l,"minute","分钟");const c=Math.floor(l/60);if(c<24)return o(c,"hour","小时");const u=Math.floor(c/24);if(u<30)return o(u,"day","天");const d=Math.floor(u/30);return d<12?o(d,"month","个月"):o(Math.floor(d/12),"year","年")}const L9t=12,dae=12;function bP({disabled:e,placement:t="top",children:n}){const{t:i}=_e("ui"),r=p.useId();return a.jsxs("span",{className:`skillcenter-disabled-action${e?" is-disabled":""} is-${t}`,tabIndex:e?0:void 0,"aria-describedby":e?r:void 0,children:[n,e?a.jsx("span",{id:r,className:"skillcenter-disabled-tooltip",role:"tooltip",children:i("skillCenter.sandboxNotConfigured")}):null]})}const $9t=new Set(["active","available","creating","disabled","enabled","failed","inactive","pending","published","ready","released","running","success","unavailable","unreleased","updating"]);function MFe(e,t){const n=(e||"").trim().toLowerCase();return $9t.has(n)?t(`skillCenter.status.${n}`):t("skillCenter.status.unknown")}function F9t(e){const t=(e||"").toLowerCase();return["active","available","enabled","published","ready","released","success"].includes(t)||t==="running"?"is-positive":["creating","pending","updating"].includes(t)?"is-progress":["failed","unavailable"].includes(t)?"is-danger":"is-muted"}function B9t(e,t){if(!e)return"";const n=e.trim(),i=Number(n),r=/^\d+(?:\.\d+)?$/.test(n)?new Date(i<1e12?i*1e3:i):new Date(n);return Number.isNaN(r.getTime())?e:new Intl.DateTimeFormat(t,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(r)}function fae(e){if(!e)return 0;const t=e.trim(),n=Number(t),i=/^\d+(?:\.\d+)?$/.test(t)?new Date(n<1e12?n*1e3:n):new Date(t);return Number.isNaN(i.getTime())?0:i.getTime()}function hu(e){return`${e.region||"default"}:${e.projectName||"default"}:${e.id}`}function U9t(e,t){const n=new Map(e.map(i=>[hu(i),i]));for(const i of t)n.set(hu(i),i);return[...n.values()].sort((i,r)=>fae(r.updatedAt)-fae(i.updatedAt))}function Q9t(e){const t=e.replace(/\r\n/g,` +`)}function u9t(e){var t;if(e.repairing||((t=e.task)==null?void 0:t.state)==="running"&&e.repairMode){if(e.repairMode==="manual")return en("generation.stages.repairingAgain");const n=Math.max(1,e.repairAttempts||1);return en("generation.stages.autoRepairing",{attempt:n,max:TFe})}return c9t(e.task)}function cae(){return a.jsxs("svg",{className:"skill-generation__spinner",viewBox:"0 0 20 20","aria-hidden":"true",children:[a.jsx("circle",{cx:"10",cy:"10",r:"7"}),a.jsx("path",{d:"M10 3a7 7 0 0 1 7 7"})]})}function d9t(e,t=Date.now()){if(!(e!=null&&e.expiresAt))return en("generation.sessionMax");const n=Math.max(0,new Date(e.expiresAt).getTime()-t),i=Math.floor(n/6e4),r=Math.floor(n%6e4/1e3);return en("generation.remaining",{minutes:i,seconds:String(r).padStart(2,"0")})}function f9t(e){return e?e.length>64?en("generation.validation.nameTooLong"):/^[a-z0-9-]+$/.test(e)?"":en("generation.validation.invalidName"):""}function uae(e){return e?e.length>128?en("generation.validation.modelTooLong"):/^[A-Za-z0-9][A-Za-z0-9._:/-]*$/.test(e)?"":en("generation.validation.invalidModel"):""}function H$(e){return`${e.region||""}:${e.id}`}function h9t(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m14.5 6-6 6 6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}function p9t({operation:e,cloudProvider:t,space:n,availableSpaces:i=[],spacesLoading:r=!1,initialIntent:s="",source:o,onBack:l,onPublished:c}){var Ce,Ee,Ve,Ge;const{t:u}=_e("skills"),[d,f]=p.useState(null),[h,m]=p.useState(null),[g,b]=p.useState(s),[v,y]=p.useState(""),[w,x]=p.useState([]),[k,S]=p.useState([]),[O,A]=p.useState(""),[E,j]=p.useState(!1),[T,R]=p.useState(""),[C,N]=p.useState(""),[P,I]=p.useState(null),[D,_]=p.useState(""),[L,F]=p.useState(""),[M,H]=p.useState(n?H$(n):""),[q,U]=p.useState(Date.now()),Z=p.useRef([]);p.useEffect(()=>{const ye=new AbortController;return _M(ye.signal).then(oe=>{f(oe),x([oae(0,oe)])}).catch(oe=>{ye.signal.aborted||m(Lr(oe,en("generation.errors.loadCapability")))}),()=>ye.abort()},[]),p.useEffect(()=>{Z.current=k},[k]),p.useEffect(()=>{const ye=window.setInterval(()=>U(Date.now()),1e3);return()=>window.clearInterval(ye)},[]),p.useEffect(()=>{const ye=oe=>{Z.current.some(ie=>{var Ae;return((Ae=ie.task)==null?void 0:Ae.state)==="running"||ie.repairing})&&oe.preventDefault()};return window.addEventListener("beforeunload",ye),()=>{var oe;window.removeEventListener("beforeunload",ye);for(const ie of Z.current)(oe=ie.task)!=null&&oe.jobId&&j2t(ie.task.jobId).catch(()=>{})}},[]),p.useEffect(()=>{if(!k.some(Ae=>{var Re;return((Re=Ae.task)==null?void 0:Re.state)==="running"||Ae.repairing}))return;let ye=!1,oe;const ie=async()=>{const Ae=Z.current,Re=await Promise.all(Ae.map(async St=>{var Nt;if(((Nt=St.task)==null?void 0:Nt.state)!=="running")return St;try{const Dt=await A2t(St.task.jobId);if(V$(Dt)&&(St.repairAttempts||0)He.map(yt=>yt.id===St.id?{...yt,task:Dt,repairing:!0,repairMode:"auto",repairAttempts:$t,repairError:void 0}:yt));try{const He=await M4({jobId:Dt.jobId,intent:lae(Dt),expectedRevision:Dt.revision});return{...St,task:He,artifact:void 0,repairing:!1,repairMode:"auto",repairAttempts:$t,repairError:void 0,error:void 0,pollError:void 0}}catch(He){return{...St,task:Dt,repairing:!1,repairMode:void 0,repairAttempts:$t,repairError:Lr(He,en("generation.errors.autoRepair")),pollError:void 0}}}let Et=St.artifact;return Dt.state==="ready"&&(Et=await D4(Dt.jobId,Dt.revision)),{...St,task:Dt,artifact:Et,repairing:!1,repairMode:Dt.state==="running"?St.repairMode:void 0,repairError:void 0,error:void 0,pollError:void 0}}catch(Dt){return{...St,pollError:Lr(Dt,en("generation.errors.pollCandidate"))}}}));ye||(S(Re),oe=window.setTimeout(()=>void ie(),a9t))};return ie(),()=>{ye=!0,oe!==void 0&&window.clearTimeout(oe)}},[k.some(ye=>{var oe;return((oe=ye.task)==null?void 0:oe.state)==="running"||ye.repairing})]);const z=k.find(ye=>ye.id===O)||k[0],J=e==="create"&&!n,ne=i.find(ye=>H$(ye)===M)??null,W=n??ne,X=i.map(ye=>({value:H$(ye),label:`${Nc(ye)||u("generation.unnamedSpace")} · ${Sh(ye.region||"cn-beijing",t)}`})),ce=f9t(v),V=!!(d!=null&&d.enabled&&g.trim()&&!ce&&w.length>0&&w.every(ye=>ye.model.trim()&&!uae(ye.model.trim()))),Y=(ye,oe)=>{x(ie=>ie.map(Ae=>Ae.id===ye?{...Ae,...oe}:Ae))},K=async ye=>{const oe={...ye,model:ye.model.trim()},ie=ye.style==="custom"?ye.customStyle.trim():ye.style;try{const Ae=await C2t({operation:e,intent:g.trim(),model:oe.model,style:ie,name:v.trim()||void 0,source:o});return{id:ye.id,config:oe,task:Ae}}catch(Ae){return{id:ye.id,config:oe,error:Lr(Ae,en("generation.errors.createCandidate"))}}},de=async()=>{if(!V)return;j(!0),I(null);const ye=w.map(ie=>({id:ie.id,config:ie}));S(ye),A(w[0].id);const oe=await Promise.all(w.map(K));S(oe)},ee=async ye=>{S(ie=>ie.map(Ae=>Ae.id===ye.id?{...Ae,error:void 0}:Ae));const oe=await K(ye.config);S(ie=>ie.map(Ae=>Ae.id===ye.id?oe:Ae))},Oe=async()=>{if(!(!(z!=null&&z.task)||!T.trim()||z.task.state!=="ready")){N("refine"),I(null);try{const ye=await M4({jobId:z.task.jobId,intent:T.trim(),expectedRevision:z.task.revision});S(oe=>oe.map(ie=>ie.id===z.id?{...ie,task:ye,artifact:void 0}:ie)),R("")}catch(ye){I(Lr(ye,en("generation.errors.refine")))}finally{N("")}}},he=async()=>{if(!(!(z!=null&&z.task)||!V$(z.task))){N("refine"),I(null),S(ye=>ye.map(oe=>oe.id===z.id?{...oe,repairing:!0,repairMode:"manual",repairError:void 0}:oe));try{const ye=await M4({jobId:z.task.jobId,intent:lae(z.task),expectedRevision:z.task.revision});S(oe=>oe.map(ie=>ie.id===z.id?{...ie,task:ye,artifact:void 0,repairing:!1,repairMode:"manual",repairError:void 0}:ie))}catch(ye){S(oe=>oe.map(ie=>ie.id===z.id?{...ie,repairing:!1,repairMode:void 0,repairError:Lr(ye,en("generation.errors.repairAgain"))}:ie))}finally{N("")}}},ge=async()=>{if(!(!(z!=null&&z.task)||z.task.state!=="ready"||L)){N("publish"),I(null);try{if(!W)throw new Error(en("generation.errors.selectSpace"));const ye=z.artifact||await D4(z.task.jobId,z.task.revision),oe=(o==null?void 0:o.region)||W.region||"";if(!ED(oe))throw new Error(en("generation.errors.unsupportedRegion"));await _2t({jobId:z.task.jobId,expectedRevision:z.task.revision,expectedArtifactSha256:ye.sha256,disposition:e==="optimize"?"update-source":"create-new",skillSpaceIds:[W.id],projectName:(o==null?void 0:o.projectName)||W.projectName,region:oe,onProgress:ie=>_(ie.message)}),F(z.id),c()}catch(ye){I(Lr(ye,en("generation.errors.upload")))}finally{N(""),_("")}}},Se=async()=>{if(!(!(z!=null&&z.task)||z.task.state!=="ready")){N("download");try{const ye=z.artifact||await D4(z.task.jobId,z.task.revision);await N2t(z.task.jobId,z.task.revision,ye.sha256)}catch(ye){I(Lr(ye,en("generation.errors.download")))}finally{N("")}}},xe=async()=>{k.some(ye=>{var oe;return((oe=ye.task)==null?void 0:oe.state)==="running"})&&!window.confirm(en("generation.leaveConfirmation"))||(await Promise.allSettled(k.flatMap(ye=>{var oe;return((oe=ye.task)==null?void 0:oe.state)==="running"?[T2t({jobId:ye.task.jobId,expectedRevision:ye.task.revision})]:[]})),l())},Pe=e==="create"?u("generation.createTitle"):u("generation.optimizeTitle",{name:(o==null?void 0:o.name)||u("generation.skillFallback")}),Ue=ye=>{var oe;return((oe=d==null?void 0:d.models.find(ie=>ie.id===ye))==null?void 0:oe.label)||ye},Ke=ye=>ye.config.style==="custom"?ye.config.customStyle.trim()||u("generation.styles.customFallback"):u(aae[ye.config.style]),Me=[...Object.entries(aae).map(([ye,oe])=>({value:ye,label:u(oe)})),{value:"custom",label:u("generation.styles.custom")}],re=ye=>ye.error||ye.repairError?u("generation.stages.failed"):u9t(ye),ue=ye=>!ye.error&&!ye.repairError&&(ye.repairing||!ye.task||ye.task.state==="running"),be=k.some(ye=>{var oe;return((oe=ye.task)==null?void 0:oe.state)==="ready"});return a.jsxs("section",{className:"skill-generation",children:[a.jsxs("header",{className:"skill-generation__header",children:[a.jsx("button",{type:"button",className:"skillcenter-back",onClick:()=>void xe(),"aria-label":u("generation.back"),children:a.jsx(h9t,{})}),a.jsxs("div",{children:[a.jsx("h1",{children:Pe}),a.jsx("p",{children:Nc(n)||u("generation.home")})]}),k.length>0?a.jsx("span",{className:"skill-generation__ttl",children:d9t(z==null?void 0:z.task,q)}):null]}),E?a.jsxs("div",{className:"skill-generation__workspace",children:[a.jsx("div",{className:"skill-generation__candidate-tabs",role:"tablist","aria-label":u("generation.candidates"),children:k.map(ye=>a.jsxs("button",{type:"button",role:"tab","aria-selected":(z==null?void 0:z.id)===ye.id,className:(z==null?void 0:z.id)===ye.id?"is-active":"",onClick:()=>A(ye.id),children:[a.jsxs("span",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.style")}),a.jsx("strong",{children:Ke(ye)})]}),a.jsxs("span",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.model")}),a.jsx("strong",{children:Ue(ye.config.model)})]}),a.jsxs("span",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.progress")}),a.jsxs("strong",{children:[ue(ye)?a.jsx(cae,{}):null,re(ye)]})]})]},ye.id))}),z?a.jsxs("div",{className:"skill-generation__candidate",children:[a.jsxs("section",{className:"skill-generation__activity",children:[a.jsx("header",{children:a.jsxs("div",{className:"skill-generation__candidate-summary",children:[a.jsxs("div",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.style")}),a.jsx("strong",{children:Ke(z)})]}),a.jsxs("div",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.model")}),a.jsx("strong",{children:Ue(z.config.model)})]}),a.jsxs("div",{className:"skill-generation__summary-row","aria-live":"polite",children:[a.jsx("span",{children:u("generation.progress")}),a.jsxs("strong",{children:[ue(z)?a.jsx(cae,{}):null,ue(z)?a.jsx(on,{children:re(z)}):re(z)]})]})]})}),z.task?a.jsx(PNt,{activities:z.task.activities}):null,z.pollError?a.jsx("div",{className:"skill-inline-notice",children:a.jsx(Rs,{error:z.pollError})}):null,z.repairError?a.jsx("div",{className:"skill-inline-notice",children:a.jsx(Rs,{error:z.repairError})}):null,z.error?a.jsxs("div",{className:"skill-inline-error",children:[a.jsx(Rs,{error:z.error}),a.jsx("button",{type:"button",onClick:()=>void ee(z),children:u("generation.retryCandidate")})]}):null,(Ce=z.task)!=null&&Ce.validation&&!z.task.validation.valid&&!z.repairing&&z.task.state==="failed"?a.jsxs("div",{className:"skill-validation-errors",children:[a.jsx("strong",{children:u("generation.formatValidationFailed")}),z.task.validation.errors.map(ye=>a.jsx("p",{children:ye},ye)),V$(z.task)?a.jsx("button",{type:"button",disabled:!!C,onClick:()=>void he(),children:u("generation.repairAgain")}):null]}):null]}),a.jsxs("section",{className:"skill-generation__files",children:[a.jsxs("header",{children:[a.jsx("h2",{children:u("generation.files")}),((Ee=z.task)==null?void 0:Ee.state)==="ready"?a.jsx("button",{type:"button",onClick:()=>void Se(),disabled:!!C,children:u("generation.downloadZip")}):null]}),z.artifact?a.jsx(uL,{files:z.artifact.files}):a.jsx("div",{className:"skill-generation__files-empty",children:((Ve=z.task)==null?void 0:Ve.state)==="ready"?u("generation.loadingFiles"):u("generation.filesPending")})]}),((Ge=z.task)==null?void 0:Ge.state)==="ready"?a.jsxs("div",{className:"skill-generation__ready-actions",children:[J?a.jsx("div",{className:"skill-generation__publish-target",children:a.jsx(RN,{label:u("generation.uploadToSpace"),value:M,options:X,onChange:H,disabled:r,placeholder:u(r?"generation.loadingSpaces":"generation.selectSpace")})}):null,a.jsxs("footer",{className:"skill-generation__followup",children:[a.jsx("textarea",{value:T,onChange:ye=>R(ye.target.value),placeholder:u("generation.continuePlaceholder")}),a.jsx("button",{type:"button",className:"skill-button",disabled:!T.trim()||!!C,onClick:()=>void Oe(),children:u("generation.continue")}),a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!!C||!!L||!W,onClick:()=>void ge(),children:C==="publish"?D||u("generation.uploading"):u(e==="optimize"?"generation.overwrite":J?"generation.uploadToSelectedSpace":"generation.uploadToCurrentSpace")})]})]}):null,P?a.jsx("div",{className:"skill-inline-error skill-generation__action-error",children:a.jsx(Rs,{error:P})}):null]}):null,!be&&k.every(ye=>ye.error)?a.jsx("div",{className:"skill-inline-error",children:u("generation.allCandidatesFailed")}):null]}):a.jsxs("div",{className:"skill-generation__setup",children:[a.jsx("div",{className:"skill-generation__section-head is-basic",children:a.jsx("div",{children:a.jsx("strong",{children:u("generation.basicInfo")})})}),a.jsxs("label",{children:[a.jsxs("span",{children:[u("generation.goal"),a.jsx("span",{className:"skill-required-mark","aria-hidden":"true",children:"*"})]}),a.jsx("textarea",{required:!0,value:g,onChange:ye=>b(ye.target.value),placeholder:u(e==="create"?"generation.createIntentPlaceholder":"generation.optimizeIntentPlaceholder")})]}),a.jsxs("label",{children:[a.jsx("span",{children:u("generation.skillName")}),a.jsx("input",{value:v,onChange:ye=>y(ye.target.value),placeholder:u("generation.autoNamePlaceholder"),"aria-invalid":!!ce,"aria-describedby":"skill-name-help"}),ce?a.jsx("span",{id:"skill-name-help",className:"skill-generation__field-error",role:"alert",children:ce}):a.jsx("span",{id:"skill-name-help",className:"skill-generation__field-help",children:u("generation.nameHelp")})]}),a.jsx("div",{className:"skill-generation__section-head",children:a.jsxs("div",{children:[a.jsx("strong",{children:u(e==="create"?"generation.createPlans":"generation.optimizePlans")}),a.jsx("span",{children:u(e==="create"?"generation.createPlansDescription":"generation.optimizePlansDescription")})]})}),a.jsxs("div",{className:"skill-generation__groups",children:[w.map((ye,oe)=>a.jsxs("article",{className:"skill-generation__group",children:[a.jsxs("header",{children:[a.jsx("strong",{children:u("generation.plan",{count:oe+1})}),w.length>1?a.jsx("button",{type:"button",onClick:()=>x(ie=>ie.filter(Ae=>Ae.id!==ye.id)),children:u("generation.remove")}):null]}),a.jsx(RN,{label:u("generation.model"),required:!0,value:ye.model,options:(d==null?void 0:d.models.map(ie=>({value:ie.id,label:ie.label})))||[],onChange:ie=>Y(ye.id,{model:ie}),allowCustom:!0,placeholder:u("generation.modelPlaceholder"),error:uae(ye.model.trim())}),a.jsx(RN,{label:u("generation.style"),required:!0,value:ye.style,options:Me,onChange:ie=>Y(ye.id,{style:ie})}),ye.style==="custom"?a.jsxs("label",{children:[a.jsx("span",{children:u("generation.customStyle")}),a.jsx("textarea",{value:ye.customStyle,onChange:ie=>Y(ye.id,{customStyle:ie.target.value}),placeholder:u("generation.customStylePlaceholder")})]}):null]},ye.id)),d&&w.lengthx(ye=>[...ye,oae(ye.length,d)]),children:u("generation.addConfiguration")}):null]}),h?a.jsx("div",{className:"skill-inline-error",children:a.jsx(Rs,{error:h})}):null,d&&!d.enabled?a.jsx("div",{className:"skill-inline-notice",children:u("generation.notConfigured")}):null,a.jsx("div",{className:"skill-generation__setup-actions",children:a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!V,onClick:()=>void de(),children:u("generation.generate")})})]})]})}async function _Fe(e,t,n,i){const r=new URLSearchParams({region:e.region}),s=await fetch(Na(`/web/skill-management/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/versions?${r}`),{...t,headers:hl(oc(t.headers)),signal:po(e.signal,i)});if(!s.ok)throw await aT(s,n);return s.json()}function m9t(e){return _Fe(e,{},Q("skills.listVersionsFailed"),eo)}function g9t(e){return _Fe(e,{method:"POST",headers:{"Content-Type":"application/zip"},body:e.file},Q("skills.uploadVersionFailed"),yr)}function jFe(e){const t=new Map;for(const n of e){const i=`${n.sourceSkillId}:${n.version}`,r=t.get(i);(!r||n.submittedAt>r.submittedAt)&&t.set(i,n)}return t}function b9t(e,t,n,i){const r=i.trim().toLocaleLowerCase();return e.filter(s=>s.kind===t&&(n==="all"||s.status===n)&&`${s.name} ${s.description} ${s.author} ${s.version}`.toLocaleLowerCase().includes(r))}const NFe=p.createContext(void 0);function Nb(e){const t=p.useContext(NFe);if(!e&&t===void 0)throw new Error(Uc(27));return t}const Zv=p.forwardRef(function(t,n){const{render:i,className:r,style:s,forceRender:o=!1,...l}=t,c=Nb(),u=c.useState("open"),d=c.useState("nested"),f=c.useState("mounted"),h=c.useState("transitionStatus");return Da("div",t,{state:{open:u,transitionStatus:h},ref:[c.context.backdropRef,n],stateAttributesMapping:Cje,props:[{role:"presentation",hidden:!f,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:o||!d})}),dL=p.forwardRef(function(t,n){const{render:i,className:r,style:s,disabled:o=!1,nativeButton:l=!0,...c}=t,u=Nb(),d=u.useState("open"),{getButtonProps:f,buttonRef:h}=WD({disabled:o,native:l}),m={disabled:o};function g(b){d&&u.setOpen(!1,pa(R_e,b.nativeEvent))}return Da("button",t,{state:m,ref:[n,h],props:[{onClick:g},c,f]})}),UT=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:o,...l}=t,c=Nb(),u=nm(o);return c.useSyncedValueWithCleanup("descriptionElementId",u),Da("p",t,{ref:n,props:[{id:u},l]})}),RFe=p.createContext(void 0);function y9t(){const e=p.useContext(RFe);if(e===void 0)throw new Error(Uc(26));return e}const v9t={...hV,...qD,nestedDialogOpen(e){return e?{"data-nested-dialog-open":""}:null}},Jv=p.forwardRef(function(t,n){const{render:i,className:r,style:s,finalFocus:o,initialFocus:l,...c}=t,u=Nb(),d=u.useState("descriptionElementId"),f=u.useState("disablePointerDismissal"),h=u.useState("floatingRootContext"),m=u.useState("popupProps"),g=u.useState("modal"),b=u.useState("mounted"),v=u.useState("nested"),y=u.useState("nestedOpenDialogCount"),w=u.useState("open"),x=u.useState("openMethod"),k=u.useState("titleElementId"),S=u.useState("transitionStatus"),O=u.useState("role"),A=h.useState("floatingId");y9t(),WA({open:w,ref:u.context.popupRef,onComplete(){var N,P;w&&((P=(N=u.context).onOpenChangeComplete)==null||P.call(N,!0))}});const E=l===void 0?lje(u.context.popupRef):l,j=y>0,T=u.useStateSetter("popupElement"),C=Da("div",t,{state:{open:w,nested:v,transitionStatus:S,nestedDialogOpen:j},props:[m,{id:A,"aria-labelledby":k,"aria-describedby":d,role:O,...oje,hidden:!b,onKeyDown(N){pLe.has(N.key)&&N.stopPropagation()},style:{"--nested-dialogs":y}},c],ref:[n,u.context.popupRef,T],stateAttributesMapping:v9t});return a.jsx(V_e,{context:h,openInteractionType:x,disabled:!b,closeOnFocusOut:!f,initialFocus:E,returnFocus:o,modal:g!==!1,restoreFocus:"popup",children:C})}),e0=p.forwardRef(function(t,n){const{keepMounted:i=!1,...r}=t,s=Nb(),o=s.useState("mounted"),l=s.useState("modal"),c=s.useState("open");return o||i?a.jsx(RFe.Provider,{value:i,children:a.jsxs($_e,{ref:n,...r,children:[o&&l===!0&&a.jsx(fLe,{ref:s.context.internalBackdropRef,inert:rV(!c)}),t.children]})}):null});function x9t({store:e,parentContext:t,isDrawer:n}){const i=e.useState("open"),r=e.useState("disablePointerDismissal"),s=e.useState("modal"),o=e.useState("popupElement"),l=e.useState("floatingRootContext"),[c,u]=p.useState(0),[d,f]=p.useState(0),h=c===0,m=q_e(l,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:s==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(g){if(!e.context.outsidePressEnabledRef.current||"button"in g&&g.button!==0)return!1;if("touches"in g){if(g.type==="touchend"){if(g.changedTouches.length!==1||g.touches.length!==0)return!1}else if(g.touches.length!==1)return!1}const b=fo(g);if(h&&!r){if(s){const v=e.context.internalBackdropRef.current,y=e.context.backdropRef.current;return v||y?v===b||y===b||ii(b,o)&&!(b!=null&&b.hasAttribute("data-base-ui-portal")):!0}return!0}return!1},escapeKey:h});return hLe(i&&s===!0,o),e.useContextCallback("onNestedDialogOpen",(g,b)=>{u(g),f(b)}),ti(()=>(t!=null&&t.onNestedDialogOpen&&(i?t.onNestedDialogOpen(c+1,d+(n?1:0)):t.onNestedDialogOpen(0,0)),()=>{t!=null&&t.onNestedDialogOpen&&i&&t.onNestedDialogOpen(0,0)}),[n,i,c,d,t]),mje(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:d}),null}const w9t={...xje,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role};class k9t extends $D{constructor(n,i,r){const s=new uV,o=O9t(n,s,i,r);super(o,S9t(s),w9t);Zt(this,"setOpen",(n,i)=>{var s,o;if(i.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&i.trigger==null&&this.state.activeTriggerId!=null&&(i.trigger=this.state.activeTriggerElement??void 0),(o=(s=this.context).onOpenChange)==null||o.call(s,n,i),i.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,i);const r={open:n};dje(r,n,i.trigger),this.update(r)})}}function O9t(e,t,n,i=!1){const r={...bje(),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e};return r.floatingRootContext=yje(t,n,i),r}function S9t(e){return{popupRef:p.createRef(),backdropRef:p.createRef(),internalBackdropRef:p.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function E9t(e,t){const{children:n,open:i,defaultOpen:r=!1,onOpenChange:s,onOpenChangeComplete:o,disablePointerDismissal:l=!1,modal:c=!0,actionsRef:u,handle:d,triggerId:f,defaultTriggerId:h=null}=t,m=e==="drawer",g=c,b=l,v="dialog",y=Nb(!0),w=y!=null,x={modal:g,disablePointerDismissal:b,nested:w,role:v},k=cje((T,R)=>new k9t({open:r,openProp:i,activeTriggerId:h,triggerIdProp:f,...x},T,R),!0);k.useControlledProp("openProp",i),k.useControlledProp("triggerIdProp",f),k.useSyncedValues(x),k.useContextCallback("onOpenChange",s),k.useContextCallback("onOpenChangeComplete",o);const S=k.useState("open"),O=k.useState("mounted"),A=k.useState("payload");gje(k,S),hje(k);const{forceUnmount:E}=pje(S,k);p.useImperativeHandle(u,()=>({unmount:E,close:()=>k.setOpen(!1,pa(P_e))}),[E,k]);const j=S||O;return a.jsxs(NFe.Provider,{value:k,children:[d&&a.jsx(uje,{handle:d,store:k}),j&&a.jsx(x9t,{store:k,parentContext:y==null?void 0:y.context,isDrawer:m}),typeof n=="function"?n({payload:A}):n]})}function t0(e){return E9t("dialog",e)}const wk=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:o,...l}=t,c=Nb(),u=nm(o);return c.useSyncedValueWithCleanup("titleElementId",u),Da("h2",t,{ref:n,props:[{id:u},l]})}),IFe=p.forwardRef(function(t,n){const{render:i,className:r,style:s,disabled:o=!1,nativeButton:l=!0,id:c,payload:u,handle:d,...f}=t,h=Nb(!0),g=wje(d)??h;if(!g)throw new Error(Uc(79));const b=nm(c),v=g.useState("floatingRootContext"),y=g.useState("isOpenedByTrigger",b),w=g.useState("triggerPopupId",b),x=p.useRef(null),{registerTrigger:k,isMountedByThisTrigger:S}=fje(b,x,g,{payload:u}),{getButtonProps:O,buttonRef:A}=WD({disabled:o,native:l}),E=H_e(v),j=cLe(()=>g.select("open"),C=>{g.set("openMethod",C)}),T={disabled:o,open:y},R=g.useState("triggerProps",S);return Da("button",t,{state:T,ref:[A,n,k,x],props:[E.reference,R,j,{[aV]:"",id:b,"aria-haspopup":"dialog","aria-expanded":y,"aria-controls":w},f,O],stateAttributesMapping:Eje})});async function PFe(e,t){const n=new URLSearchParams({region:e.region}),i=t?"/retry":`?${n}`,r=await fetch(Na(`/web/skill-management/reviews/${encodeURIComponent(e.id)}/score${i}`),{method:t?"POST":"GET",headers:hl(oc(t?{"Content-Type":"application/json"}:void 0)),...t?{body:JSON.stringify({region:e.region})}:{},signal:po(e.signal,eo)});if(!r.ok)throw await aT(r,bn.t(t?"score.retryFailed":"score.loadFailed",{ns:"reviews"}));return r.json()}const C9t=e=>PFe(e,!1),A9t=e=>PFe(e,!0),T9t=["safety","usability","completeness","reliability","maintainability"];function DFe(e){return(e==null?void 0:e.status)==="queued"||(e==null?void 0:e.status)==="running"}function _9t(e){if(e.status!=="not_requested")return{status:e.status,overallScore:e.overallScore,scoredAt:e.scoredAt,modelName:e.modelName,rubricVersion:e.rubricVersion,error:e.error}}function UW({score:e}){const{t}=_e("reviews");return a.jsx("span",{className:`review-score-label is-${(e==null?void 0:e.status)||"unscored"}`,children:(e==null?void 0:e.status)==="completed"?typeof e.overallScore=="number"?t("score.points",{score:e.overallScore}):t("score.insufficient"):t(`score.status.${(e==null?void 0:e.status)||"unscored"}`)})}function MFe({application:e,canRetry:t=!1,onScoreChanged:n}){const{t:i,i18n:r}=_e("reviews"),[s,o]=p.useState(e.aiReview),[l,c]=p.useState(!!e.aiReview),[u,d]=p.useState(null),[f,h]=p.useState({revision:0,retry:!1}),[m,g]=p.useState(""),b=p.useRef(-1),v=p.useRef(n);v.current=n;const{id:y,region:w}=e,x=!!e.aiReview;p.useEffect(()=>{if(!x&&f.revision===0)return;const O=new AbortController;let A,E=!1,j=!0;const T=async(N,P=!1)=>{var I;if(!(E||O.signal.aborted)&&!(!P&&document.visibilityState==="hidden")){E=!0,P&&c(!0),d(null);try{const D=await(N?A9t:C9t)({id:y,region:w,signal:O.signal});if(O.signal.aborted)return;o(D),(I=v.current)==null||I.call(v,D,N),j=DFe(D),j&&document.visibilityState!=="hidden"&&(A=setTimeout(()=>void T(!1),5e3))}catch(D){O.signal.aborted||(j=!1,d(Lr(D,i(N?"score.retryFailed":"score.loadFailed"))))}finally{E=!1,O.signal.aborted||c(!1)}}},R=()=>{clearTimeout(A),j&&document.visibilityState!=="hidden"&&T(!1)},C=f.retry&&b.current!==f.revision;return C&&(b.current=f.revision),T(C,!0),document.addEventListener("visibilitychange",R),()=>{O.abort(),clearTimeout(A),document.removeEventListener("visibilitychange",R)}},[y,w,x,f,i]);const k=(s==null?void 0:s.status)==="completed"?s.result:void 0;p.useEffect(()=>{if(!k){g("");return}const O=URL.createObjectURL(new Blob([JSON.stringify(k,null,2)],{type:"application/json"}));return g(O),()=>URL.revokeObjectURL(O)},[k]);const S=O=>h(A=>({revision:A.revision+1,retry:O}));return a.jsxs("section",{className:"review-score","aria-label":i("score.title"),children:[a.jsxs("div",{className:"review-score__header",children:[a.jsx("div",{"aria-live":"polite",children:l?a.jsx(on,{children:i(f.retry?"score.starting":"score.loading")}):a.jsx(UW,{score:s})}),a.jsxs("div",{className:"review-score__actions",children:[m?a.jsx("a",{className:"cw-btn cw-btn-ghost",href:m,download:`${y}-score.json`,children:i("score.download")}):null,t&&(!s||s.status==="failed"||s.status==="not_requested")?a.jsx("button",{type:"button",className:"cw-btn cw-btn-ghost",disabled:l,onClick:()=>S(!0),children:i((s==null?void 0:s.status)==="failed"?"score.retry":"score.start")}):null]})]}),a.jsx("p",{className:"review-score__hint",children:i("score.hint")}),u?a.jsxs("div",{className:"review-score__error",role:"alert",children:[a.jsx(Rs,{error:u}),a.jsx("button",{type:"button",className:"cw-btn cw-btn-ghost",disabled:l,onClick:()=>S(!1),children:i("score.reload")})]}):null,s!=null&&s.error?a.jsx("div",{role:"alert",className:"review-score__error",children:a.jsxs("details",{className:"review-score__raw-error",open:!0,children:[a.jsx("summary",{children:i("score.originalError")}),a.jsx("pre",{children:s.error})]})}):(s==null?void 0:s.status)==="failed"?a.jsx("p",{role:"alert",className:"review-score__error",children:i("score.failed")}):null,k?a.jsxs(a.Fragment,{children:[k.riskFlags.length?a.jsxs("div",{className:"review-score__risks",children:[a.jsx("h3",{children:i("score.risks")}),a.jsx("ul",{children:k.riskFlags.map((O,A)=>a.jsxs("li",{children:[a.jsx("strong",{children:i(`score.severity.${O.severity}`)})," · ",O.reason]},`${A}:${O.reason}`))})]}):null,k.coverage&&!k.coverage.complete?a.jsxs("div",{className:"review-score__coverage",children:[a.jsx("h3",{children:i("score.coverage")}),a.jsx("p",{children:i("score.coverageIncomplete")}),a.jsx("p",{children:i("score.coverageCount",{included:k.coverage.includedFiles,total:k.coverage.totalFiles})}),a.jsxs("ul",{children:[k.coverage.omittedFiles.map(O=>a.jsx("li",{children:i("score.omittedFile",O)},`omitted:${O.path}`)),k.coverage.truncatedFiles.map(O=>a.jsx("li",{children:i("score.truncatedFile",O)},`truncated:${O.path}`))]})]}):null,a.jsx("dl",{className:"review-score__dimensions",children:T9t.map(O=>{const A=k.dimensions[O];return a.jsxs("div",{className:O==="safety"&&A.score!==null&&A.score<60?"is-risk":void 0,children:[a.jsxs("dt",{children:[a.jsx("span",{children:i(`score.dimensions.${O}`)}),a.jsx("strong",{children:A.score===null?i("score.insufficient"):i("score.points",{score:A.score})})]}),a.jsx("dd",{children:A.reason})]},O)})}),k.suggestions.length?a.jsxs("div",{className:"review-score__suggestions",children:[a.jsx("h3",{children:i("score.suggestions")}),a.jsx("ul",{children:k.suggestions.map((O,A)=>a.jsx("li",{children:O},`${A}:${O}`))})]}):null,a.jsxs("dl",{className:"review-score__metadata",children:[a.jsxs("div",{children:[a.jsx("dt",{children:i("score.model")}),a.jsx("dd",{children:k.modelName})]}),a.jsxs("div",{children:[a.jsx("dt",{children:i("score.rubric")}),a.jsx("dd",{children:k.rubricVersion})]}),a.jsxs("div",{children:[a.jsx("dt",{children:i("score.time")}),a.jsx("dd",{children:a.jsx("time",{dateTime:k.scoredAt,children:new Date(k.scoredAt).toLocaleString(r.language,{hour12:!1})})})]})]})]}):null]})}function j9t({application:e}){const{t}=_e("reviews"),[n,i]=p.useState(!1),[r,s]=p.useState(e.aiReview),o=p.useId();return p.useEffect(()=>s(e.aiReview),[e.aiReview]),a.jsxs("div",{className:"review-score-history",children:[a.jsxs("button",{type:"button",className:"review-score-history__toggle","aria-expanded":n,"aria-controls":o,onClick:()=>i(l=>!l),children:[a.jsx("span",{children:t("score.title")}),a.jsx(UW,{score:r}),a.jsx("span",{children:t(n?"score.collapse":"score.expand")})]}),n?a.jsx("div",{id:o,children:a.jsx(MFe,{application:e,onScoreChanged:s},`${e.region}:${e.id}`)}):null]})}function QT({status:e}){const{t}=_e("reviews");return a.jsxs("span",{className:`review-status is-${e}`,children:[a.jsx("span",{"aria-hidden":"true"}),t(`status.${e}`)]})}function QW({person:e,fallback:t,compact:n=!1}){const{t:i}=_e("reviews"),[r,s]=p.useState(""),o=(e==null?void 0:e.name)||t||i("detail.unknownReviewer"),l=e==null?void 0:e.avatarUrl;return a.jsxs("span",{className:`review-person${n?" is-compact":""}`,children:[l&&l!==r?a.jsx("img",{className:"review-person__avatar",src:l,alt:"",referrerPolicy:"no-referrer",onError:()=>s(l)}):a.jsx("span",{className:"review-person__avatar is-fallback","aria-hidden":"true",children:Array.from(o)[0]}),a.jsxs("span",{className:"review-person__text",children:[a.jsx("span",{children:o}),!n&&(e!=null&&e.email)?a.jsx("span",{className:"review-person__email",children:e.email}):null]})]})}function zW({application:e}){const{t,i18n:n}=_e("reviews");return a.jsxs("div",{className:"review-outcome",children:[a.jsx(QT,{status:e.status}),e.reviewer||e.reviewedBy||e.reviewedAt?a.jsxs("dl",{className:"review-outcome__facts",children:[e.reviewer||e.reviewedBy?a.jsxs("div",{children:[a.jsx("dt",{children:t(`detail.${e.status==="returned"?"returnedBy":e.status==="approved"?"approvedBy":"reviewer"}`)}),a.jsx("dd",{children:a.jsx(QW,{person:e.reviewer,fallback:e.reviewedBy})})]}):null,e.reviewedAt?a.jsxs("div",{children:[a.jsx("dt",{children:t("detail.reviewedAt")}),a.jsx("dd",{children:a.jsx("time",{dateTime:e.reviewedAt,children:new Date(e.reviewedAt).toLocaleString(n.language,{hour12:!1})})})]}):null]}):null,e.reason?a.jsxs("div",{className:"review-outcome__message is-returned",children:[a.jsx("strong",{children:t("decision.reason")}),a.jsx("p",{children:e.reason})]}):null,e.comment?a.jsxs("div",{className:"review-outcome__message",children:[a.jsx("strong",{children:t("detail.comment")}),a.jsx("p",{children:e.comment})]}):null,e.status==="pending"?a.jsx("p",{className:"review-outcome__hint",children:t("detail.pendingHint")}):null,e.status==="approving"?a.jsx("p",{className:"review-outcome__hint",children:t("detail.approvingHint")}):null]})}function VW({applications:e}){const{t,i18n:n}=_e("reviews");return e.length?a.jsx("ol",{className:"review-source-history",children:[...e].sort((i,r)=>r.submittedAt.localeCompare(i.submittedAt)).map(i=>a.jsxs("li",{children:[a.jsxs("div",{className:"review-source-history__submission",children:[a.jsx("strong",{children:i.version}),a.jsx("span",{children:t("detail.submitted",{name:i.author})}),a.jsx("time",{dateTime:i.submittedAt,children:new Date(i.submittedAt).toLocaleString(n.language,{hour12:!1})})]}),a.jsx(zW,{application:i}),a.jsx(j9t,{application:i})]},i.id))}):a.jsx("p",{className:"review-outcome__hint",children:t("detail.noHistory")})}function N9t({name:e,applications:t,onClose:n}){const{t:i}=_e("reviews"),r=p.useRef(document.activeElement instanceof HTMLElement?document.activeElement:null);return a.jsx(t0,{open:!0,onOpenChange:s=>{s||n()},children:a.jsxs(e0,{children:[a.jsx(Zv,{className:"review-backdrop"}),a.jsxs(Jv,{className:"review-drawer",finalFocus:()=>{var s;return(s=r.current)!=null&&s.isConnected?r.current:null},children:[a.jsxs("header",{className:"review-drawer__header",children:[a.jsxs("div",{children:[a.jsx(wk,{children:i("detail.history")}),a.jsx(UT,{children:e})]}),a.jsx(dL,{className:"review-icon-button","aria-label":i("actions.close"),children:a.jsx(ST,{})})]}),a.jsx("div",{className:"review-drawer__body",children:a.jsx(VW,{applications:t})})]})]})})}function R9t({skill:e,space:t,region:n,reviews:i,onClose:r,onChanged:s,onSubmitReview:o}){const{t:l,i18n:c}=_e("ui"),[u,d]=p.useState(null),[f,h]=p.useState(e.version),[m,g]=p.useState(!0),[b,v]=p.useState(null),[y,w]=p.useState(null),[x,k]=p.useState([]),[S,O]=p.useState(!1),[A,E]=p.useState(null),[j,T]=p.useState(0),[R,C]=p.useState(0),[N,P]=p.useState(null),I=p.useRef(null),D=p.useRef(null),_=p.useRef(null),L=p.useRef(!1),F=p.useRef(!0),M=p.useRef({onClose:r,busy:N});M.current={onClose:r,busy:N};const H=u==null?void 0:u.items.find(X=>X.version===f),q=p.useMemo(()=>jFe(i),[i]),U=q.get(`${e.skillId}:${f}`),Z=i.filter(X=>X.sourceSkillId===e.skillId&&X.version===f&&X.id!==(U==null?void 0:U.id)),z=!!(o&&(u!=null&&u.canUpdate)&&H&&["running","ready"].includes(H.status.toLowerCase())&&(!U||U.status==="returned"));p.useEffect(()=>{var V;F.current=!0;const X=document.activeElement instanceof HTMLElement?document.activeElement:null;(V=_.current)==null||V.focus();const ce=Y=>{var Oe;if(Y.key==="Escape"&&(Y.preventDefault(),M.current.busy||M.current.onClose()),Y.key!=="Tab")return;const K=Array.from(((Oe=I.current)==null?void 0:Oe.querySelectorAll('button:not([disabled]), input:not([disabled]):not([type="file"]), a[href], summary, [tabindex="0"]'))||[]),de=K[0],ee=K[K.length-1];Y.shiftKey&&document.activeElement===de&&(Y.preventDefault(),ee==null||ee.focus()),!Y.shiftKey&&document.activeElement===ee&&(Y.preventDefault(),de==null||de.focus())};return document.addEventListener("keydown",ce),()=>{F.current=!1,document.removeEventListener("keydown",ce),X!=null&&X.isConnected&&X.focus()}},[]),p.useEffect(()=>{const X=new AbortController;return g(!0),v(null),m9t({spaceId:t.id,skillId:e.skillId,region:n,signal:X.signal}).then(ce=>{X.signal.aborted||(d(ce),h(V=>{var Y;return ce.items.some(K=>K.version===V)?V:((Y=ce.items[0])==null?void 0:Y.version)||""}))}).catch(ce=>{X.signal.aborted||v(Lr(ce,l("skillCenter.versions.loadFailed")))}).finally(()=>{X.signal.aborted||g(!1)}),()=>X.abort()},[t.id,e.skillId,n,j,l]),p.useEffect(()=>{if(!f||!H)return;let X=!0;return O(!0),E(null),k([]),CIe({spaceId:t.id,skillId:e.skillId,region:n,version:f}).then(ce=>{X&&k(ce)}).catch(ce=>{X&&E(Lr(ce,l("skillCenter.versions.filesFailed")))}).finally(()=>{X&&O(!1)}),()=>{X=!1}},[t.id,e.skillId,n,f,!!H,R,l]);async function J(X){if(!L.current){L.current=!0,P("upload"),w(null);try{const ce=await g9t({spaceId:t.id,skillId:e.skillId,region:n,file:X});if(!F.current)return;h(ce.version),T(V=>V+1),s()}catch(ce){F.current&&w(Lr(ce,l("skillCenter.versions.uploadFailed")))}finally{L.current=!1,F.current&&P(null)}}}async function ne(){if(!(!z||!o||L.current)){L.current=!0,P("submit"),w(null);try{await o(f)}catch(X){F.current&&w(Lr(X,l("skillCenter.versions.submitFailed")))}finally{L.current=!1,F.current&&P(null)}}}function W(X){if(!X)return"—";const ce=new Date(X);return Number.isNaN(ce.getTime())?X:ce.toLocaleString(c.resolvedLanguage||c.language)}return a.jsx("div",{className:"skill-detail-backdrop",onMouseDown:X=>{X.target===X.currentTarget&&!N&&r()},children:a.jsxs("section",{className:"skill-detail-dialog skill-versions",role:"dialog","aria-modal":"true","aria-labelledby":"skill-versions-title",ref:I,children:[a.jsxs("header",{className:"skill-detail-head",children:[a.jsx("div",{className:"skill-detail-heading",children:a.jsxs("div",{children:[a.jsx("h2",{id:"skill-versions-title",children:l("skillCenter.versions.title")}),a.jsx("p",{title:e.skillName,children:e.skillName})]})}),a.jsxs("div",{className:"skill-detail-actions",children:[a.jsx("button",{type:"button",disabled:m||!!N,onClick:()=>T(X=>X+1),children:l("skillCenter.versions.refresh")}),u!=null&&u.canUpdate?a.jsx("button",{type:"button",disabled:!!N,onClick:()=>{var X;return(X=D.current)==null?void 0:X.click()},children:l(N==="upload"?"skillCenter.versions.uploading":"skillCenter.versions.upload")}):null,a.jsx("button",{type:"button",ref:_,disabled:!!N,onClick:r,children:l("skillCenter.versions.close")})]}),a.jsx("input",{className:"skill-versions__file-input",ref:D,type:"file",accept:".zip,application/zip","aria-label":l("skillCenter.versions.upload"),onChange:X=>{var V;const ce=(V=X.target.files)==null?void 0:V[0];X.target.value="",ce&&J(ce)}})]}),y?a.jsx("div",{className:"skill-versions__notice",role:"alert",children:a.jsx(Rs,{error:y})}):null,u!=null&&u.canUpdate?a.jsx("p",{className:"skill-versions__hint",children:l("skillCenter.versions.hint")}):null,a.jsxs("div",{className:"skill-versions__body",children:[a.jsxs("div",{className:"skill-versions__history","aria-busy":m,children:[m&&!u?a.jsx("p",{role:"status",children:l("skillCenter.versions.loading")}):null,b?a.jsxs("div",{role:"alert",children:[a.jsx(Rs,{error:b}),a.jsx("button",{className:"cw-btn cw-btn-ghost",type:"button",onClick:()=>T(X=>X+1),children:l("skillCenter.versions.retry")})]}):null,!m&&!b&&!(u!=null&&u.items.length)?a.jsx("p",{children:l("skillCenter.versions.empty")}):null,a.jsx("div",{className:"skill-versions__list",role:"list","aria-label":l("skillCenter.versions.title"),children:u==null?void 0:u.items.map(X=>a.jsx("div",{role:"listitem",children:a.jsxs("button",{type:"button",className:`skill-versions__version${f===X.version?" is-active":""}`,"aria-pressed":f===X.version,onClick:()=>h(X.version),children:[a.jsxs("span",{className:"skill-versions__version-title",children:[a.jsx("strong",{children:X.sourceVersion||X.version}),X.isCurrent?a.jsx("span",{children:l("skillCenter.versions.current")}):null]}),a.jsx("time",{dateTime:X.createdAt,children:W(X.createdAt)}),q.get(`${e.skillId}:${X.version}`)?a.jsx(QT,{status:q.get(`${e.skillId}:${X.version}`).status}):a.jsx("span",{children:l(t.isShared?"skillCenter.versions.shared":"skillCenter.versions.notSubmitted")})]})},X.version))})]}),a.jsx("div",{className:"skill-versions__detail",children:H?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"skill-versions__summary",children:[a.jsxs("div",{children:[a.jsx("h3",{children:H.sourceVersion||H.version}),a.jsx("p",{title:H.description,children:H.description}),H.author||e.author?a.jsx("p",{className:"skill-versions__author",children:l("skillCenter.authorName",{name:H.author||e.author})}):null]}),o&&(u!=null&&u.canUpdate)?a.jsx("button",{type:"button",className:"cw-btn cw-btn-primary",disabled:!z||!!N,onClick:()=>void ne(),children:l(N==="submit"?"skillCenter.versions.submitting":"skillCenter.versions.submit")}):null]}),H.error?a.jsx("p",{className:"skill-versions__notice",role:"alert",children:H.error}):null,["running","ready"].includes(H.status.toLowerCase())?null:a.jsx("p",{role:"status",children:l("skillCenter.versions.processing",{status:H.status})}),U?a.jsx(zW,{application:U}):null,Z.length?a.jsxs("details",{className:"skill-versions__review-history",children:[a.jsx("summary",{children:l("skillCenter.versions.history")}),a.jsx(VW,{applications:Z})]}):null,a.jsx("div",{className:"skill-versions__files",children:S?a.jsx("p",{role:"status",children:l("skillCenter.versions.filesLoading")}):A?a.jsxs("div",{role:"alert",children:[a.jsx(Rs,{error:A}),a.jsx("button",{className:"cw-btn cw-btn-ghost",type:"button",onClick:()=>C(X=>X+1),children:l("skillCenter.versions.retry")})]}):x.length?a.jsx(uL,{files:x},f):a.jsx("p",{children:l("skillCenter.versions.filesEmpty")})})]}):null})]})]})})}function I9t({region:e,active:t,revision:n,onOpen:i}){const{t:r}=_e("ui"),[s,o]=p.useState(null),[l,c]=p.useState(null),[u,d]=p.useState(0);return p.useEffect(()=>{if(!t)return;const f=new AbortController;return c(null),Ppt({region:e,signal:f.signal}).then(h=>{f.signal.aborted||o(h)}).catch(h=>{f.signal.aborted||c(Lr(h,r("skillCenter.sharedLoadFailed")))}),()=>f.abort()},[t,e,u,n,r]),a.jsxs("div",{className:"skillcenter-shared-space",children:[a.jsx(Hv,{className:"skillcenter-space-card",title:r("skillCenter.sharedSpace"),description:r("skillCenter.sharedDescription"),status:a.jsx("span",{className:"skillcenter-shared-badge",children:r("skillCenter.sharedVisibility")}),metadata:[{label:r("skillCenter.skillCount"),value:s?r("skillCenter.skillCountValue",{count:s.skillCount??0}):r(l?"skillCenter.sharedLoadFailed":"skillCenter.sharedPreparing")}],detailAction:{label:r("common.viewDetails"),disabled:!s||!!l,onClick:()=>{s&&i(s)}},action:l?{label:r("common.reload"),onClick:()=>d(f=>f+1)}:void 0}),l?a.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:a.jsx(Rs,{error:l})}):null]})}function HW({title:e,children:t,onClose:n,className:i=""}){const{t:r}=_e("skills"),s=p.useRef(null);return p.useEffect(()=>{var l;(l=s.current)==null||l.focus();const o=c=>c.key==="Escape"&&n();return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[n]),a.jsx("div",{className:"skill-dialog-backdrop",onMouseDown:n,children:a.jsxs("section",{className:`skill-dialog${i?` ${i}`:""}`,role:"dialog","aria-modal":"true","aria-label":e,onMouseDown:o=>o.stopPropagation(),children:[a.jsxs("header",{children:[a.jsx("h2",{children:e}),a.jsx("button",{ref:s,type:"button",onClick:n,"aria-label":r("management.close"),children:r("management.close")})]}),t]})})}function P9t({region:e,regionOptions:t,onClose:n,onCreated:i}){const{t:r}=_e("skills"),[s,o]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(e),[f,h]=p.useState(!1),[m,g]=p.useState(null),b=async()=>{if(s.trim()){h(!0),g(null);try{const v=await Ipt({name:s.trim(),description:l.trim()||void 0,region:u});i({...v,region:v.region||u})}catch(v){g(Lr(v,r("management.createSpaceFailed")))}finally{h(!1)}}};return a.jsxs(HW,{title:r("management.createSpaceTitle"),onClose:n,children:[a.jsxs("div",{className:"skill-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("management.name")}),a.jsx("input",{autoFocus:!0,value:s,maxLength:128,onChange:v=>o(v.target.value)})]}),a.jsx(RN,{label:r("management.region"),value:u,options:t,onChange:d,required:!0}),a.jsxs("label",{children:[a.jsx("span",{children:r("management.optionalDescription")}),a.jsx("textarea",{value:l,maxLength:1024,onChange:v=>c(v.target.value)})]}),m?a.jsx("div",{className:"skill-inline-error",children:a.jsx(Rs,{error:m})}):null]}),a.jsxs("footer",{children:[a.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!s.trim()||f,onClick:()=>void b(),children:r(f?"management.creating":"management.create")})]})]})}function D9t({space:e,region:t,onClose:n,onUpdated:i}){const{t:r}=_e("skills"),[s,o]=p.useState(e.name),[l,c]=p.useState(e.description||""),[u,d]=p.useState(!1),[f,h]=p.useState(null),m=async()=>{if(s.trim()){d(!0),h(null);try{const g=await Bpt({spaceId:e.id,name:s.trim(),description:l.trim()||void 0,region:t});i({...e,...g,skillCount:e.skillCount})}catch(g){h(Lr(g,r("management.updateSpaceFailed")))}finally{d(!1)}}};return a.jsxs(HW,{title:r("management.editSpaceTitle"),onClose:n,children:[a.jsxs("div",{className:"skill-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("management.name")}),a.jsx("input",{autoFocus:!0,value:s,maxLength:128,onChange:g=>o(g.target.value)})]}),a.jsxs("label",{children:[a.jsx("span",{children:r("management.optionalDescription")}),a.jsx("textarea",{value:l,maxLength:1024,onChange:g=>c(g.target.value)})]}),f?a.jsx("div",{className:"skill-inline-error",children:a.jsx(Rs,{error:f})}):null]}),a.jsxs("footer",{children:[a.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!s.trim()||u,onClick:()=>void m(),children:r(u?"management.saving":"management.save")})]})]})}function M9t({space:e,region:t,onClose:n,onUploaded:i}){const{t:r,i18n:s}=_e("skills"),[o,l]=p.useState(null),[c,u]=p.useState(null),[d,f]=p.useState(!1),[h,m]=p.useState(!1),[g,b]=p.useState(null),[v,y]=p.useState(!1),w=p.useRef(0),x=p.useRef(null),k=async O=>{const A=w.current+1;if(w.current=A,l(O),u(null),b(null),f(!!O),!!O)try{const E=await zpt(O);w.current===A&&u({name:E.name,fileCount:E.files.length})}catch(E){w.current===A&&b(Lr(E,r("management.archiveValidationFailed")))}finally{w.current===A&&f(!1)}},S=async()=>{if(!(!o||!c)){m(!0),b(null);try{await Qpt({spaceId:e.id,region:t,project:e.projectName,file:o}),i()}catch(O){b(Lr(O,r("management.uploadFailed")))}finally{m(!1)}}};return a.jsxs(HW,{title:r("management.uploadTitle",{name:Nc(e)}),className:"skill-upload-dialog",onClose:n,children:[a.jsxs("div",{className:"skill-dialog__body",children:[a.jsx("input",{ref:x,className:"skill-upload-dialog__input",type:"file",accept:".zip,application/zip",onChange:O=>{var A;return void k(((A=O.target.files)==null?void 0:A[0])||null)}}),a.jsxs("button",{type:"button",className:`skill-upload-dropzone${v?" is-dragging":""}`,onClick:()=>{var O;return(O=x.current)==null?void 0:O.click()},onDragEnter:O=>{O.preventDefault(),y(!0)},onDragOver:O=>{O.preventDefault(),O.dataTransfer.dropEffect="copy",y(!0)},onDragLeave:O=>{O.currentTarget.contains(O.relatedTarget)||y(!1)},onDrop:O=>{var A;O.preventDefault(),y(!1),k(((A=O.dataTransfer.files)==null?void 0:A[0])||null)},children:[a.jsx("strong",{children:o?o.name:r("management.dropzone")}),a.jsx("span",{children:o?r("fileTree.bytes",{value:new Intl.NumberFormat(s.resolvedLanguage).format(o.size)}):r("management.chooseLocalFile")})]}),a.jsx("p",{children:r("management.archiveHelp")}),d?a.jsx("div",{className:"skill-inline-notice",children:r("management.validating")}):null,c?a.jsx("div",{className:"skill-inline-notice",children:r("management.validationPassed",{name:c.name,count:c.fileCount})}):null,g?a.jsx("div",{className:"skill-inline-error",children:a.jsx(Rs,{error:g})}):null]}),a.jsxs("footer",{children:[a.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!o||!c||d||h,onClick:()=>void S(),children:r(h?"management.uploading":"management.upload")})]})]})}function L9t(e){if(typeof e=="number")return e<1e12?e*1e3:e;const t=e.trim(),n=Number(t);return/^\d+(?:\.\d+)?$/.test(t)?n<1e12?n*1e3:n:Date.parse(t)}function zT(e,t=Date.now(),n="zh-CN"){if(e===void 0||e==="")return"—";const i=L9t(e);if(!Number.isFinite(i))return"—";const r=Math.floor(Math.max(0,t-i)/1e3),s=new Intl.RelativeTimeFormat(n,{numeric:"always"}),o=(f,h,m)=>n.toLowerCase().startsWith("zh")?`${f} ${m}前`:s.format(-f,h);if(r<60)return o(r,"second","秒");const l=Math.floor(r/60);if(l<60)return o(l,"minute","分钟");const c=Math.floor(l/60);if(c<24)return o(c,"hour","小时");const u=Math.floor(c/24);if(u<30)return o(u,"day","天");const d=Math.floor(u/30);return d<12?o(d,"month","个月"):o(Math.floor(d/12),"year","年")}const $9t=12,dae=12;function bP({disabled:e,placement:t="top",children:n}){const{t:i}=_e("ui"),r=p.useId();return a.jsxs("span",{className:`skillcenter-disabled-action${e?" is-disabled":""} is-${t}`,tabIndex:e?0:void 0,"aria-describedby":e?r:void 0,children:[n,e?a.jsx("span",{id:r,className:"skillcenter-disabled-tooltip",role:"tooltip",children:i("skillCenter.sandboxNotConfigured")}):null]})}const F9t=new Set(["active","available","creating","disabled","enabled","failed","inactive","pending","published","ready","released","running","success","unavailable","unreleased","updating"]);function LFe(e,t){const n=(e||"").trim().toLowerCase();return F9t.has(n)?t(`skillCenter.status.${n}`):t("skillCenter.status.unknown")}function B9t(e){const t=(e||"").toLowerCase();return["active","available","enabled","published","ready","released","success"].includes(t)||t==="running"?"is-positive":["creating","pending","updating"].includes(t)?"is-progress":["failed","unavailable"].includes(t)?"is-danger":"is-muted"}function U9t(e,t){if(!e)return"";const n=e.trim(),i=Number(n),r=/^\d+(?:\.\d+)?$/.test(n)?new Date(i<1e12?i*1e3:i):new Date(n);return Number.isNaN(r.getTime())?e:new Intl.DateTimeFormat(t,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(r)}function fae(e){if(!e)return 0;const t=e.trim(),n=Number(t),i=/^\d+(?:\.\d+)?$/.test(t)?new Date(n<1e12?n*1e3:n):new Date(t);return Number.isNaN(i.getTime())?0:i.getTime()}function hu(e){return`${e.region||"default"}:${e.projectName||"default"}:${e.id}`}function Q9t(e,t){const n=new Map(e.map(i=>[hu(i),i]));for(const i of t)n.set(hu(i),i);return[...n.values()].sort((i,r)=>fae(r.updatedAt)-fae(i.updatedAt))}function z9t(e){const t=e.replace(/\r\n/g,` `);if(!t.startsWith(`--- `))return e;const n=t.indexOf(` --- -`,4);return n>=0?t.slice(n+5).trimStart():e}function LFe(e,t){const n=(e||"").trim();return!n||[">",">-","|","|-"].includes(n)?t("common.noDescription"):n}function z9t(){return a.jsx("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:a.jsx("path",{d:"m7.5 7.5 9 9m0-9-9 9",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function V9t(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 5.5v13M5.5 12h13",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}function hae({direction:e}){return a.jsx("svg",{className:"icon",viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,children:a.jsx("path",{d:e==="left"?"m11.7 5.5-4.2 4.5 4.2 4.5":"m8.3 5.5 4.2 4.5-4.2 4.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function H9t(){return a.jsx("span",{className:"skillcenter-loading-mark","aria-hidden":!0})}function q9t({page:e,total:t,pageSize:n,onPage:i}){const{t:r}=_e("ui"),s=Math.max(1,Math.ceil(t/n));return a.jsxs("footer",{className:"skillcenter-pager",children:[a.jsx("span",{children:r("skillCenter.totalItems",{count:t})}),a.jsxs("div",{className:"skillcenter-pager-actions",children:[a.jsx("button",{type:"button",onClick:()=>i(e-1),disabled:e<=1,"aria-label":r("common.previousPage"),children:a.jsx(hae,{direction:"left"})}),a.jsxs("span",{children:[e," / ",s]}),a.jsx("button",{type:"button",onClick:()=>i(e+1),disabled:e>=s,"aria-label":r("common.nextPage"),children:a.jsx(hae,{direction:"right"})})]})]})}function W9t({children:e}){return a.jsx("div",{className:"skillcenter-empty",children:e})}function q$({kind:e,title:t,description:n,error:i,action:r}){return a.jsx("div",{className:`skillcenter-page-state is-${e}`,role:e==="error"?"alert":"status",children:a.jsxs(qn,{fill:"none",children:[a.jsx(qn.Title,{children:t}),n?a.jsx(qn.Description,{children:n}):null,i?a.jsx(Rs,{error:i}):null,r?a.jsx(qn.ActionRow,{children:a.jsx(At,{color:"secondary",size:"lg",onClick:r.onClick,children:r.label})}):null]})})}function pae({errors:e,cloudProvider:t,fullPage:n=!1,onRetry:i}){const{t:r}=_e("ui");return a.jsxs("div",{className:`skillcenter-space-errors${n?" is-full-page":""}`,role:"alert",children:[a.jsxs("div",{className:"skillcenter-space-errors__content",children:[a.jsx("strong",{children:r(n?"skillCenter.cannotLoadSpaces":"skillCenter.someSpacesFailed")}),e.map(({region:s,error:o})=>a.jsxs("section",{children:[a.jsx("span",{children:Sh(s,t)}),a.jsx(Rs,{error:o})]},s))]}),a.jsx("button",{type:"button",onClick:i,children:r("common.reload")})]})}function K9t({skill:e,space:t,region:n,cloudProvider:i,detail:r,files:s,loading:o,error:l,canOptimize:c,reviews:u,reviewsLoading:d,reviewsError:f,onOptimize:h,onDownload:m,onClose:g}){const{t:b}=_e("ui"),[v,y]=p.useState("files");return p.useEffect(()=>{const w=x=>{x.key==="Escape"&&g()};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[g]),a.jsx("div",{className:"skill-detail-backdrop",role:"presentation",onMouseDown:g,children:a.jsxs("section",{className:"skill-detail-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-detail-title",onMouseDown:w=>w.stopPropagation(),children:[a.jsxs("header",{className:"skill-detail-head",children:[a.jsx("div",{className:"skill-detail-heading",children:a.jsxs("div",{children:[a.jsx("h2",{id:"skill-detail-title",children:(r==null?void 0:r.name)||e.skillName}),a.jsx("p",{children:LFe((r==null?void 0:r.description)||e.skillDescription,b)})]})}),a.jsxs("div",{className:"skill-detail-actions",children:[a.jsx("button",{type:"button",onClick:m,disabled:s.length===0,children:b("skillCenter.downloadZip")}),t.isShared?null:a.jsx(bP,{disabled:!c,placement:"bottom",children:a.jsx("button",{type:"button",onClick:h,disabled:!c,children:b("skillCenter.optimize")})}),a.jsx("button",{type:"button",className:"skill-detail-close",onClick:g,"aria-label":b("skillCenter.closeSkillDetails"),children:a.jsx(z9t,{})})]})]}),a.jsxs("dl",{className:"skill-detail-meta",children:[a.jsxs("div",{children:[a.jsx("dt",{children:b("skillCenter.skillId")}),a.jsx("dd",{title:e.skillId,children:e.skillId})]}),a.jsxs("div",{children:[a.jsx("dt",{children:b("agentSelector.version")}),a.jsx("dd",{children:e.sourceVersion||(r==null?void 0:r.version)||e.version||"—"})]}),e.author?a.jsxs("div",{children:[a.jsx("dt",{children:b("skillCenter.author")}),a.jsx("dd",{children:e.author})]}):null,a.jsxs("div",{children:[a.jsx("dt",{children:b("agentSelector.status")}),a.jsx("dd",{children:MFe(e.skillStatus,b)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:b("skillCenter.skillSpace")}),a.jsx("dd",{title:Nc(t),children:t.isShared?b("skillCenter.sharedSpace"):Nc(t)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:b("myAgents.region")}),a.jsx("dd",{children:Sh(n,i)})]})]}),a.jsx(rb,{className:"skill-detail-tabs",idPrefix:"skill-detail",ariaLabel:b("skillCenter.skillDetailSections"),value:v,items:[{id:"files",label:b("skillCenter.allFiles"),panelId:"skill-detail-panel"},{id:"reviews",label:b("skillCenter.reviewHistory"),panelId:"skill-detail-panel"}],onChange:y}),a.jsx("div",{className:`skill-detail-content${v==="files"?" skill-detail-content--files":" skill-detail-content--reviews"}`,id:"skill-detail-panel",role:"tabpanel","aria-labelledby":`skill-detail-${v}-tab`,children:v==="reviews"?d?a.jsx(fl,{}):f?a.jsx("div",{role:"alert",children:a.jsx(Rs,{error:f})}):a.jsx(VW,{applications:u}):o?a.jsxs("div",{className:"skillcenter-loading",children:[a.jsx(H9t,{}),b("skillCenter.loadingSkillContent")]}):l?a.jsx("div",{className:"skillcenter-error",children:a.jsx(Rs,{error:l})}):s.length>0?a.jsx(uL,{files:s.map(w=>w.path.endsWith("SKILL.md")&&w.content?{...w,content:Q9t(w.content)}:w)}):a.jsx(W9t,{children:b("skillCenter.noSkillContent")})})]})})}function G9t({space:e,canUseSandbox:t,onUpload:n,onSandbox:i,onClose:r}){const{t:s}=_e("ui");return p.useEffect(()=>{const o=l=>{l.key==="Escape"&&r()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[r]),a.jsx("div",{className:"skill-dialog-backdrop",role:"presentation",onMouseDown:r,children:a.jsxs("section",{className:"skill-dialog skill-add-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-add-dialog-title",onMouseDown:o=>o.stopPropagation(),children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("h2",{id:"skill-add-dialog-title",children:s("skillCenter.addSkill")}),a.jsx("p",{title:Nc(e),children:Nc(e)})]}),a.jsx("button",{type:"button",onClick:r,children:s("common.cancel")})]}),a.jsxs("div",{className:"skill-add-dialog__options",children:[a.jsxs("button",{type:"button",onClick:n,children:[a.jsx("strong",{children:s("skillCenter.localUpload")}),a.jsx("span",{children:s("skillCenter.localUploadDescription")})]}),a.jsx(bP,{disabled:!t,placement:"inside",children:a.jsxs("button",{type:"button",disabled:!t,onClick:i,children:[a.jsx("strong",{children:s("skillCenter.autoCreate")}),a.jsx("span",{children:s("skillCenter.autoCreateDescription")})]})})]})]})})}function X9t({cloudProvider:e="volcengine",region:t,active:n=!0,activationRevision:i=0,initialWorkspace:r=null,onInitialWorkspaceConsumed:s,onPageTitleChange:o,toolbarLeading:l,toolbarFilters:c}){var Ut;const{t:u,i18n:d}=_e("ui"),f=p.useMemo(()=>[t],[t]),[h,m]=p.useState([]),[g,b]=p.useState(null),[v,y]=p.useState([]),w=p.useMemo(()=>_Fe(v),[v]),[x,k]=p.useState(null),[S,O]=p.useState(null),[A,E]=p.useState(!1),j=p.useRef(""),T=p.useRef(!1),[R,C]=p.useState({}),[N,P]=p.useState(!1),[I,D]=p.useState(""),[_,L]=p.useState((r==null?void 0:r.space)??null),F=p.useRef(_);F.current=_;const[M,H]=p.useState([]),[q,U]=p.useState(1),[Z,z]=p.useState(0),[J,ne]=p.useState(!1),[W,X]=p.useState(null),[le,V]=p.useState(!1),[Y,K]=p.useState(""),[ue,te]=p.useState("overview"),[Oe,fe]=p.useState(null),[pe,Se]=p.useState(null),[ve,Le]=p.useState(null),[He,Ge]=p.useState([]),[De,se]=p.useState(!1),[ce,ye]=p.useState(null),[Ae,Ee]=p.useState(null),[Ce,Be]=p.useState(!1),[he,ie]=p.useState(null),[we,Re]=p.useState(null),[Ue,_t]=p.useState(null),[Pt,Gt]=p.useState(0),[St,Lt]=p.useState(0),[qe,yt]=p.useState(""),[je,kt]=p.useState(""),[Tt,fn]=p.useState(null),[tn,We]=p.useState(r),vt=p.useRef(0),Ke=p.useRef(0),ot=p.useRef(!1),it=p.useRef(null),tt=p.useRef(null),Ct=p.useRef(null),Ot=p.useDeferredValue(I),Bt=p.useDeferredValue(Y),Dt=tn&&(_||tn.selectPublishSpace)?tn.operation==="create"?u("skillCenter.createSkill"):u("skillCenter.optimizeNamed",{name:((Ut=tn.source)==null?void 0:Ut.name)||u("skillCenter.skill")}):"",Ze=_!=null&&_.isShared?u("skillCenter.sharedSpace"):Nc(_),bt=!(_!=null&&_.isShared)||_.canWrite===!0,gt=Dt||Ze||u("skillCenter.library");p.useEffect(()=>{n&&(o==null||o(gt))},[n,o,gt]),p.useEffect(()=>{r&&(s==null||s())},[r,s]);const an=p.useMemo(()=>{const Qe=Ot.trim().toLocaleLowerCase(),xt=h.filter(Qt=>!Qt.isShared);return Qe?xt.filter(Qt=>`${Nc(Qt)} ${Qt.name} ${Qt.description||""} ${Qt.projectName||""}`.toLocaleLowerCase().includes(Qe)):xt},[Ot,h]),Ft=p.useMemo(()=>{const Qe=Bt.trim().toLocaleLowerCase();return Qe?M.filter(xt=>`${xt.skillName} ${xt.skillDescription||""}`.toLocaleLowerCase().includes(Qe)):M},[Bt,M]),cn=(_==null?void 0:_.region)||nr(e);p.useEffect(()=>{if(!n||!_)return;const Qe=()=>Lt(Qt=>Qt+1),xt=()=>{document.visibilityState==="visible"&&Qe()};return window.addEventListener("focus",Qe),document.addEventListener("visibilitychange",xt),()=>{window.removeEventListener("focus",Qe),document.removeEventListener("visibilitychange",xt)}},[n,_==null?void 0:_.id]),p.useEffect(()=>{const Qe=_?`${cn}:${_.id}`:"";if(j.current!==Qe&&(j.current=Qe,y([]),k(null),Se(null)),O(null),E(!1),!n||!_||_.isShared)return;const xt=new AbortController;return E(!0),$pt({spaceId:_.id,region:cn,signal:xt.signal}).then(Qt=>{xt.signal.aborted||y(Qt.items)}).catch(Qt=>{xt.signal.aborted||O(Lr(Qt,u("skillCenter.reviewStatusFailed")))}).finally(()=>{xt.signal.aborted||E(!1)}),()=>xt.abort()},[_==null?void 0:_.id,_==null?void 0:_.isShared,cn,St,n,i,u]);const Je=p.useMemo(()=>f.flatMap(Qe=>{var Qt;const xt=(Qt=R[Qe])==null?void 0:Qt.error;return xt?[{region:Qe,error:xt}]:[]}),[R,f]),lt=f.some(Qe=>{const xt=R[Qe];return!!(xt&&!xt.done&&!xt.error)}),hn=Je.length===f.length;p.useEffect(()=>{const Qe=new AbortController;return _M(Qe.signal).then(Ee).catch(()=>Ee({enabled:!1,reason:u("skillCenter.adminNotConfigured"),operations:["create","optimize"],models:[],styles:{}})),()=>Qe.abort()},[u]);const Sn=p.useCallback(async(Qe,xt)=>{var ts;if(ot.current||Qe.length===0)return;ot.current=!0,P(!0),xt&&((ts=it.current)==null||ts.abort(),m([]),C(Object.fromEntries(Qe.map(({region:ci})=>[ci,{nextPage:1,loadedCount:0,done:!1,error:null}]))));const Qt=new AbortController;it.current=Qt;const jn=++Ke.current,lr=await Promise.allSettled(Qe.map(async({region:ci,page:Ei})=>({region:ci,page:Ei,result:await Npt({region:ci,page:Ei,pageSize:L9t,signal:Qt.signal})})));if(Ke.current!==jn)return;const ta=lr.map((ci,Ei)=>{const $r=Qe[Ei];return ci.status==="rejected"?{request:$r,error:Lr(ci.reason,u("skillCenter.errors.loadSpaces")),items:[],totalCount:0,scannedCount:0}:{request:$r,error:null,items:(ci.value.result.items||[]).map(na=>({...na,region:na.region||ci.value.region})),totalCount:ci.value.result.totalCount||0,scannedCount:ci.value.result.scannedCount??ci.value.result.items.length}}),Ms=ta.flatMap(ci=>ci.items);C(ci=>{const Ei={...ci};return ta.forEach(({request:$r,error:na,scannedCount:ns,totalCount:Il})=>{const fs=Ei[$r.region]||{nextPage:$r.page,loadedCount:0,done:!1,error:null};if(na){Ei[$r.region]={...fs,error:na};return}const ge=fs.loadedCount+ns;Ei[$r.region]={nextPage:$r.page+1,loadedCount:ge,done:ns===0||ge>=Il,error:null}}),Ei}),m(ci=>U9t(xt?[]:ci,Ms)),L(ci=>ci&&(Ms.find(Ei=>hu(Ei)===hu(ci))||ci)),ot.current=!1,P(!1)},[]),Ji=p.useCallback(()=>{if(ot.current)return;const Qe=f.flatMap(xt=>{const Qt=R[xt];return Qt&&!Qt.done&&!Qt.error?[{region:xt,page:Qt.nextPage}]:[]});Sn(Qe,!1)},[Sn,R,f]);p.useEffect(()=>{Nn(),L(null),H([]),U(1)},[e]),p.useEffect(()=>{if(n)return Sn(f.map(Qe=>({region:Qe,page:1})),!0),()=>{var Qe;Ke.current+=1,(Qe=it.current)==null||Qe.abort(),ot.current=!1}},[n,i,Sn,f,Pt]),p.useEffect(()=>{const Qe=Ct.current,xt=tt.current;if(!Qe||!xt||!lt||N)return;const Qt=new IntersectionObserver(([jn])=>{jn.isIntersecting&&Ji()},{root:xt,rootMargin:"240px 0px",threshold:.01});return Qt.observe(Qe),()=>Qt.disconnect()},[lt,Ji,N]);const Qn=()=>{const Qe=tt.current;!Qe||!lt||N||Qe.scrollHeight-Qe.scrollTop-Qe.clientHeight<=240&&Ji()};p.useEffect(()=>{if(!_){H([]),z(0),V(!1);return}let Qe=!0;return ne(!0),X(null),TIe(_.id,{region:cn,page:q,pageSize:dae,project:_.projectName}).then(xt=>{Qe&&(H(xt.items||[]),z(xt.totalCount||0),V(xt.degraded===!0))}).catch(xt=>{Qe&&(H([]),z(0),V(!1),X(Lr(xt,u("skillCenter.errors.loadSkills"))))}).finally(()=>{Qe&&ne(!1)}),()=>{Qe=!1}},[cn,_,q,St,u]);const _n=Qe=>{Nn(),L(Qe),te("overview"),U(1),K("")},pi=()=>{Nn(),L(null),H([]),z(0),V(!1),te("overview"),U(1),K(""),fn(null)},Nn=()=>{vt.current+=1,fe(null),Le(null),Ge([]),ye(null),se(!1)},Dn=async Qe=>{if(!_)return;const xt=Ey(Qe),Qt=vt.current+1;vt.current=Qt,fe(Qe),Le(null),ye(null),se(!0);try{const[jn,lr]=await Promise.all([Hpt(_.id,xt,Qe.version,cn,_.projectName,Qe.skillName,_.name),EIe({spaceId:_.id,skillId:xt,version:Qe.version,region:cn,skillSpaceName:_.name,skillName:Qe.skillName})]);vt.current===Qt&&(Le(jn),Ge(lr))}catch(jn){vt.current===Qt&&ye(Lr(jn,u("skillCenter.errors.loadSkillDetails")))}finally{vt.current===Qt&&se(!1)}},_i=Qe=>{if(_)return{kind:"skill-center",skillId:Ey(Qe),version:Qe.version,region:cn,projectName:_.projectName,skillSpaceId:_.id,skillSpaceName:_.name,name:Qe.skillName,description:Qe.skillDescription}},Fn=Qe=>{const xt=_i(Qe);!xt||!(Ae!=null&&Ae.enabled)||(Nn(),We({operation:"optimize",source:xt}))},Kn=async Qe=>{if(!(!_||!window.confirm(u("skillCenter.deleteSkillConfirm",{name:Qe.skillName})))){yt(Qe.skillId),fn(null);try{await zpt({spaceId:_.id,skillId:Qe.skillId,region:cn}),Lt(xt=>xt+1),Gt(xt=>xt+1)}catch(xt){fn(Lr(xt,u("skillCenter.errors.deleteSkill")))}finally{yt("")}}},Rn=async Qe=>{if(!window.confirm(u("skillCenter.deleteSpaceConfirm",{name:Nc(Qe)})))return;const xt=hu(Qe);kt(xt),fn(null);try{await Bpt({spaceId:Qe.id,region:Qe.region||nr(e)}),_&&hu(_)===xt&&pi(),Gt(Qt=>Qt+1)}catch(Qt){fn(Lr(Qt,u("skillCenter.errors.deleteSpace")))}finally{kt("")}},nt=async(Qe,xt=Qe.version,Qt=!1)=>{var ta,Ms,ts,ci;if(!_||T.current)return;const jn=_,lr=`${jn.region}:${jn.id}:${Qe.skillId}:${xt}`;T.current=!0,b(lr),fn(null);try{const Ei=await Ppt({spaceId:jn.id,skillId:Qe.skillId,version:xt,region:jn.region||cn});((ta=F.current)==null?void 0:ta.id)===jn.id&&((Ms=F.current)==null?void 0:Ms.region)===jn.region&&y($r=>[...$r.filter(na=>na.id!==Ei.id),Ei])}catch(Ei){if(Qt)throw Lr(Ei,u("skillCenter.reviewFailed"));((ts=F.current)==null?void 0:ts.id)===jn.id&&((ci=F.current)==null?void 0:ci.region)===jn.region&&fn(Lr(Ei,u("skillCenter.reviewFailed")))}finally{T.current=!1,b(null)}};return tn&&(_||tn.selectPublishSpace)?a.jsx(h9t,{operation:tn.operation,cloudProvider:e,space:_??void 0,availableSpaces:h.filter(Qe=>!Qe.isShared),spacesLoading:N,initialIntent:tn.initialIntent,source:tn.source,onBack:()=>We(null),onPublished:()=>{Lt(Qe=>Qe+1),Gt(Qe=>Qe+1)}}):a.jsxs("section",{className:`skillcenter${_?" is-space":" resource-collection"}`,children:[_?a.jsx(dT,{className:"skillcenter-detail",title:Ze||_.name,description:_.isShared?u("skillCenter.sharedDescription"):_.description||u("skillCenter.manageSpaceDescription"),identitySeed:_.name,backLabel:u("skillCenter.backToSpaces"),onBack:pi,sections:[{key:"overview",label:u("skillCenter.overview"),content:a.jsxs(a.Fragment,{children:[Tt?a.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:a.jsx(Rs,{error:Tt})}):null,S?a.jsxs("div",{className:"skillcenter-inline-error",role:"alert",children:[a.jsx(Rs,{error:S}),a.jsx("button",{type:"button",onClick:()=>Lt(Qe=>Qe+1),children:u("common.reload")})]}):null,a.jsx("section",{className:"skillcenter-overview",children:a.jsxs(yH,{className:"skillcenter-detail-facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:u("skillCenter.skillCount")}),a.jsx("dd",{children:Z})]}),a.jsxs("div",{children:[a.jsx("dt",{children:u("skillCenter.updatedAt")}),a.jsx("dd",{children:_.updatedAt?B9t(_.updatedAt,d.resolvedLanguage??d.language):"—"})]})]})})]})},{key:"skills",label:u("skillCenter.skills"),content:a.jsxs(a.Fragment,{children:[Tt?a.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:a.jsx(Rs,{error:Tt})}):null,S?a.jsxs("div",{className:"skillcenter-inline-error",role:"alert",children:[a.jsx(Rs,{error:S}),a.jsx("button",{type:"button",onClick:()=>Lt(Qe=>Qe+1),children:u("common.reload")})]}):null,a.jsxs("section",{className:"skillcenter-results","aria-label":u("skillCenter.skillsInSpace",{name:Ze||_.name}),children:[a.jsx(ePe,{title:u("skillCenter.skills"),description:u("skillCenter.totalItems",{count:Z}),actions:a.jsxs(a.Fragment,{children:[a.jsx(em,{"aria-label":u("skillCenter.searchSkills"),value:Y,onChange:Qe=>K(Qe.target.value),placeholder:u("skillCenter.searchSkills")}),a.jsx(At,{color:"secondary",variant:"outline",size:"sm",pill:!1,disabled:J||A,onClick:()=>Lt(Qe=>Qe+1),children:u("common.refresh")})]})}),le?a.jsx("div",{className:"skillcenter-inline-warning",role:"status",children:u("skillCenter.degradedRelationWarning")}):null,J&&M.length===0?a.jsx(fl,{}):W&&M.length===0?a.jsx(q$,{kind:"error",title:u("skillCenter.cannotLoadSkills"),error:W,action:{label:u("common.reload"),onClick:()=>Lt(Qe=>Qe+1)}}):Ft.length===0?a.jsx(q$,{kind:"empty",title:Y.trim()?u("skillCenter.noMatchingSkills"):u("skillCenter.noSkills"),description:Y.trim()?u("skillCenter.tryAnotherName"):u(_.isShared?"skillCenter.sharedEmpty":"skillCenter.emptySkillsDescription"),action:!Y.trim()&&bt?{label:u("skillCenter.localUpload"),onClick:()=>_t(_)}:void 0}):a.jsx("div",{className:"skillcenter-table-wrap",children:a.jsxs("table",{className:"skillcenter-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:u("skillCenter.skills")}),a.jsx("th",{scope:"col",children:u("agentSelector.status")}),a.jsx("th",{scope:"col",className:"skillcenter-table__actions-heading",children:u("skillCenter.actions")})]})}),a.jsx("tbody",{children:Ft.map(Qe=>{const xt=w.get(`${Qe.skillId}:${Qe.version}`);return a.jsxs("tr",{children:[a.jsx("td",{className:"skillcenter-table__skill",children:a.jsxs("button",{type:"button",onClick:()=>void Dn(Qe),children:[a.jsxs("span",{className:"skillcenter-table__title-row",children:[a.jsx("strong",{title:Qe.skillName,children:Qe.skillName}),Qe.version?a.jsx("span",{className:"skillcenter-table__version-badge",children:Qe.sourceVersion||Qe.version}):null]}),a.jsx("span",{className:"skillcenter-table__description",children:LFe(Qe.skillDescription,u)}),_.isShared&&Qe.author?a.jsx("span",{className:"skillcenter-table__author",children:u("skillCenter.authorName",{name:Qe.author})}):null]})}),a.jsx("td",{children:a.jsxs("div",{className:"skillcenter-review-status",children:[a.jsx("span",{className:`skillcenter-status ${F9t(Qe.skillStatus)}`,children:MFe(Qe.skillStatus,u)}),xt?a.jsx(QT,{status:xt.status}):null,xt!=null&&xt.reviewer||xt!=null&&xt.reviewedBy?a.jsx(QW,{compact:!0,person:xt.reviewer,fallback:xt.reviewedBy}):null]})}),a.jsx("td",{children:a.jsxs("div",{className:"skillcenter-table__actions",children:[a.jsx("button",{type:"button",onClick:()=>void Dn(Qe),children:u("common.view")}),!Qe.lookupByName&&Qe.skillId?a.jsx("button",{type:"button",onClick:()=>Se(Qe),children:u("skillCenter.versions.title")}):null,!_.isShared&&!Qe.lookupByName&&Qe.skillId?a.jsx("button",{type:"button",disabled:A||S!==null||g!==null||xt!==void 0&&xt.status!=="returned",onClick:()=>void nt(Qe),children:g===`${_.region}:${_.id}:${Qe.skillId}:${Qe.version}`?u("skillCenter.reviewSubmitting"):u(xt?{pending:"skillCenter.reviewPending",approving:"skillCenter.reviewApproving",approved:"skillCenter.reviewApproved",returned:"skillCenter.reviewRetry"}[xt.status]:"skillCenter.requestPublication")}):null,v.some(Qt=>Qt.sourceSkillId===Qe.skillId)?a.jsx("button",{type:"button",onClick:()=>k(Qe),children:u("skillCenter.reviewHistory")}):null,_.isShared?null:a.jsx(bP,{disabled:!(Ae!=null&&Ae.enabled),children:a.jsx("button",{type:"button",disabled:!(Ae!=null&&Ae.enabled),onClick:()=>Fn(Qe),children:u("skillCenter.optimize")})}),!Qe.lookupByName&&bt?a.jsx("button",{type:"button",className:"is-danger",disabled:qe===Qe.skillId,onClick:()=>void Kn(Qe),children:qe===Qe.skillId?u("common.deleting"):u("common.delete")}):null]})})]},`${Ey(Qe)}:${Qe.version}`)})})]})}),!Y.trim()&&!J&&!W&&Z>0?a.jsx(q9t,{page:q,total:Z,pageSize:dae,onPage:U}):null]})]})}],activeSectionKey:ue,navigationLabel:u("skillCenter.spaceDetails"),onSectionChange:Qe=>te(Qe),actionsClassName:"skillcenter-toolbar-actions",actions:a.jsxs(a.Fragment,{children:[_.isShared?null:a.jsxs(a.Fragment,{children:[a.jsx(At,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>ie(_),children:u("skillCenter.editSpace")}),a.jsx(At,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,disabled:je===hu(_),onClick:()=>void Rn(_),children:je===hu(_)?u("common.deleting"):u("skillCenter.deleteSpace")})]}),bt?a.jsx(At,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>_t(_),children:u("skillCenter.localUpload")}):null,_.isShared?null:a.jsx(bP,{disabled:!(Ae!=null&&Ae.enabled),children:a.jsxs(At,{type:"button",color:"primary",size:"lg",pill:!1,disabled:!(Ae!=null&&Ae.enabled),onClick:()=>We({operation:"create"}),children:[a.jsx(Mje,{"aria-hidden":"true"}),a.jsx("span",{children:u("skillCenter.createSkill")})]})})]})}):a.jsxs(a.Fragment,{children:[a.jsxs(ib,{className:"skillcenter-list-toolbar library-resource-toolbar",children:[l,a.jsxs("div",{className:"resource-toolbar__actions",children:[c,a.jsx(em,{"aria-label":u("skillCenter.searchSpaces"),value:I,onChange:Qe=>D(Qe.target.value),placeholder:u("skillCenter.searchSpaces")})]})]}),Tt?a.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:a.jsx(Rs,{error:Tt})}):null,a.jsxs(tm,{className:"skillcenter-list-results",ref:tt,"aria-label":u("skillCenter.spaceList"),onScroll:Qn,children:[Je.length>0&&!hn?a.jsx(pae,{errors:Je,cloudProvider:e,onRetry:()=>Gt(Qe=>Qe+1)}):null,a.jsxs(zv,{children:[a.jsx(R9t,{region:t,active:n,revision:Pt+i,onOpen:_n},`${e}:${t}`),I.trim()?null:a.jsx(ab,{"aria-label":u("skillCenter.createSpace"),icon:a.jsx(V9t,{}),onClick:()=>Be(!0),children:u("skillCenter.newSpace")}),an.map(Qe=>{const xt=hu(Qe);return a.jsx(Hv,{className:"skillcenter-space-card",title:Nc(Qe),description:Qe.description||u("common.noDescription"),metadata:[{label:u("skillCenter.skillCount"),value:u("skillCenter.skillCountValue",{count:Qe.skillCount??0})},{label:u("skillCenter.updatedAt"),value:zT(Qe.updatedAt,Date.now(),d.resolvedLanguage??d.language)}],action:{label:u("skillCenter.addSkill"),icon:"plus",onClick:()=>Re(Qe)},detailAction:{label:u("common.viewDetails"),onClick:()=>_n(Qe)}},xt)})]}),N&&h.length===0?a.jsx(fl,{}):hn&&h.length===0?a.jsx(pae,{errors:Je,cloudProvider:e,fullPage:!0,onRetry:()=>Gt(Qe=>Qe+1)}):an.length===0&&I.trim()?a.jsx(q$,{kind:"empty",title:u("skillCenter.noMatchingSpaces"),description:u("skillCenter.tryAnotherName")}):null,!hn&&h.length>0?a.jsx("div",{className:"my-agent-load-more",ref:Ct,"aria-live":"polite",children:N?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:u("skillCenter.loadingMoreSpaces")})]}):lt?a.jsx("span",{children:u("skillCenter.scrollForMore")}):Je.length>0?a.jsx("span",{children:u("skillCenter.someSpacesFailed")}):a.jsx("span",{children:u("skillCenter.allSpacesLoaded")})}):null]})]}),pe&&_?a.jsx(N9t,{skill:pe,space:_,region:cn,reviews:v.filter(Qe=>Qe.sourceSkillId===pe.skillId),onClose:()=>Se(null),onChanged:()=>Lt(Qe=>Qe+1),onSubmitReview:!_.isShared&&!A&&!S?Qe=>nt(pe,Qe,!0):void 0},`${cn}:${_.id}:${pe.skillId}`):null,x?a.jsx(j9t,{name:x.skillName,applications:v.filter(Qe=>Qe.sourceSkillId===x.skillId),onClose:()=>k(null)}):null,Oe&&_&&a.jsx(K9t,{skill:Oe,space:_,region:cn,cloudProvider:e,detail:ve,files:He,loading:De,error:ce,reviews:v.filter(Qe=>Qe.sourceSkillId===Oe.skillId),reviewsLoading:A,reviewsError:S,canOptimize:!_.isShared&&(Ae==null?void 0:Ae.enabled)===!0,onOptimize:()=>Fn(Oe),onDownload:()=>void Vpt({spaceId:_.id,skillId:Ey(Oe),version:Oe.version,region:cn,fallbackName:Oe.skillName,skillSpaceName:_.name,skillName:Oe.skillName}).catch(Qe=>ye(Lr(Qe,u("skillCenter.errors.downloadSkill")))),onClose:Nn}),Ce?a.jsx(I9t,{region:t,regionOptions:Pu(e),onClose:()=>Be(!1),onCreated:Qe=>{Be(!1),Gt(xt=>xt+1),L({...Qe,region:Qe.region||t})}}):null,he?a.jsx(P9t,{space:he,region:he.region||nr(e),onClose:()=>ie(null),onUpdated:Qe=>{const xt={...Qe,region:Qe.region||he.region||nr(e)};ie(null),L(Qt=>Qt&&hu(Qt)===hu(xt)?xt:Qt),m(Qt=>Qt.map(jn=>hu(jn)===hu(xt)?xt:jn)),Gt(Qt=>Qt+1)}}):null,we?a.jsx(G9t,{space:we,canUseSandbox:(Ae==null?void 0:Ae.enabled)===!0,onClose:()=>Re(null),onUpload:()=>{_t(we),Re(null)},onSandbox:()=>{const Qe=we;Re(null),_n(Qe),We({operation:"create"})}}):null,Ue?a.jsx(D9t,{space:Ue,region:Ue.region||nr(e),onClose:()=>_t(null),onUploaded:()=>{_t(null),Lt(Qe=>Qe+1),Gt(Qe=>Qe+1)}}):null]})}function Y9t(e){return[{id:"skills",label:e("library.tabs.skills"),panelId:"library-skills-panel"},{id:"knowledge",label:e("library.tabs.knowledge"),panelId:"library-knowledge-panel"},{id:"artifacts",label:e("library.tabs.artifacts"),panelId:"library-artifacts-panel"}]}function Z9t({cloudProvider:e,studioRegion:t="",activeTab:n,onTabChange:i,onPageTitleChange:r,skillInitialWorkspace:s=null,onSkillInitialWorkspaceConsumed:o,artifactSources:l=[],artifactUserId:c="",onArtifactActivate:u,onArtifactSourceOpen:d}){const{t:f,i18n:h}=_e("workspaceTools"),m=p.useMemo(()=>Y9t(f),[f]),g=f("library.tabs.skills"),b=ED(t)?t:nr(e),[v,y]=p.useState(b),[w,x]=p.useState(g),k=p.useRef(g),[S,O]=p.useState(!1),[A,E]=p.useState(()=>new Set(["skills",n])),[j,T]=p.useState({skills:0,knowledge:0,artifacts:0}),R=p.useRef(u),[C,N]=p.useState([]),[P,I]=p.useState(!1),[D,_]=p.useState(""),L=p.useMemo(()=>{const ne=cbt(l,f("library.untitledSession"));return{key:JSON.stringify(ne),candidates:ne}},[l,f]),F=p.useRef(L);F.current.key!==L.key&&(F.current=L);const M=F.current.candidates,H=p.useMemo(()=>Pu(e),[e]);p.useEffect(()=>{y(b)},[b]),p.useEffect(()=>{const ne=k.current;x(W=>W===ne?g:W),k.current=g},[g]),p.useEffect(()=>{R.current=u},[u]),p.useEffect(()=>{E(ne=>{if(ne.has(n))return ne;const W=new Set(ne);return W.add(n),W})},[n]),p.useEffect(()=>{var W;const ne=n==="skills"?w:((W=m.find(X=>X.id===n))==null?void 0:W.label)||f("library.title");r==null||r(ne)},[n,r,w,f,m]),p.useEffect(()=>{var ne;n==="artifacts"&&((ne=R.current)==null||ne.call(R))},[n,j.artifacts]);const q=p.useCallback(async()=>{I(!0),_("");try{N(await ybt(M))}catch(ne){_(ne instanceof Error?ne.message:String(ne))}finally{I(!1)}},[M]);p.useEffect(()=>{n==="artifacts"&&q()},[n,j.artifacts,q]);const U=ne=>{E(W=>{if(W.has(ne))return W;const X=new Set(W);return X.add(ne),X}),T(W=>({...W,[ne]:W[ne]+1})),i(ne)},Z=a.jsx(rb,{idPrefix:"library",ariaLabel:f("library.categoryAria"),value:n,items:m,onChange:U}),z=ne=>a.jsx(sb,{id:ne,ariaLabel:f("library.regionAria"),value:v,options:H,onChange:y}),J=n==="skills"?w!==g:n==="knowledge"&&S;return a.jsxs(Ch,{className:`library-view${J?" is-detail":""}`,"aria-label":f("library.title"),children:[J?null:a.jsx(Qv,{className:"library-view__header",title:f("library.title")}),a.jsxs("div",{className:"library-panels",children:[A.has("skills")?a.jsx("div",{id:"library-skills-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-skills-tab",hidden:n!=="skills",children:a.jsx(X9t,{cloudProvider:e,region:v,active:n==="skills",activationRevision:j.skills,onPageTitleChange:x,initialWorkspace:s,onInitialWorkspaceConsumed:o,toolbarLeading:Z,toolbarFilters:z("library-skills-region-filter")})}):null,A.has("knowledge")?a.jsx("div",{id:"library-knowledge-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-knowledge-tab",hidden:n!=="knowledge",children:a.jsx(d2t,{cloudProvider:e,region:v,active:n==="knowledge",activationRevision:j.knowledge,onDetailChange:O,toolbarLeading:Z,toolbarFilters:z("library-knowledge-region-filter")})}):null,A.has("artifacts")?a.jsx("div",{id:"library-artifacts-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-artifacts-tab",hidden:n!=="artifacts",children:a.jsx(mbt,{items:C,region:v,userId:c,active:n==="artifacts",activationRevision:j.artifacts,loading:P,error:D?_o(D,h.resolvedLanguage||h.language)||f("artifactLibrary.loadDetailFallback"):"",onRetry:()=>void q(),onEdit:vbt,onDelete:xbt,onDownload:wbt,onOpenSource:d?ne=>d(ne.appName,ne.sessionId):void 0,toolbarLeading:Z,toolbarFilters:z("library-artifacts-region-filter")})}):null]})]})}const $Fe="veadk_agentkit_connections",J9t=3e3,mae=6e4;function nf(){try{const e=localStorage.getItem($Fe);return(e?JSON.parse(e):[]).filter(n=>!n.runtimeId||!!n.region)}catch{return[]}}function fL(e){try{localStorage.setItem($Fe,JSON.stringify(e))}catch{}}function pf(e,t){return`agentkit:${e}:${t}`}function FFe(e){try{return new URL(e).host}catch{return e}}function kk(e){YAe();for(const t of e)if(!(t.runtimeId&&!t.region))for(const n of t.apps)XAe(pf(t.id,n),t.runtimeId?{app:n,runtimeId:t.runtimeId,mpaInstanceId:t.mpaInstanceId,region:t.region,agentCategory:t.agentCategory}:{app:n,base:t.base,apiKey:t.apiKey})}function BFe(e,t,n,i,r,s,o,l){const c=nf(),u=c.findIndex(h=>h.runtimeId===e),d=u===-1?void 0:c[u],f={id:`rt_${e}`,name:t||e,runtimeId:e,region:n,apps:i,appLabels:r,currentVersion:s,agentCategory:o??(d==null?void 0:d.agentCategory),mpaInstanceId:(l==null?void 0:l.trim())||(d==null?void 0:d.mpaInstanceId)};return u===-1?c.push(f):c[u]=f,fL(c),kk(c),f}async function e7t(e,t,n,i,r,s,o){let l=null,c=n||"cn-beijing",u=null;for(const m of UA(n))try{const g=await Xw(e,m,{retryProbe:!0,preferCached:!0,currentVersion:i});if(g&&g.length>0){await E2e(e,m),l=g,c=m;break}}catch(g){if(g instanceof V1)throw yP(e),g;if(g instanceof Ea&&g.unsupported){u=g;continue}throw g}if(!l||l.length===0)throw yP(e),u||new Ea(Q("connections.runtimeUnsupported"),!0,!0);const d=(r==null?void 0:r.trim())||l[0],f=Object.fromEntries(l.map(m=>[m,m===l[0]?d:m])),h=BFe(e,t,c,l,f,i,s,o);return pf(h.id,l[0])}function t7t(e){return new Promise(t=>window.setTimeout(t,e))}async function XN(e,t,n,i,r={}){const s=Date.now();for(;;)try{return await e7t(e,t,n,i,r.agentName,r.agentCategory,r.mpaInstanceId)}catch(o){const l=Date.now()-s;if(!r.waitForReady||!(o instanceof Ea)||!o.retryable||l>=mae)throw o;const c=Math.min(J9t,mae-l);await t7t(c)}}async function UFe(e,t,n,i){const r=t.trim().replace(/\/+$/,""),s=await QA(r,n.trim()),o={id:Date.now().toString(36),name:e.trim()||FFe(r),base:r,apiKey:n.trim(),apps:s,appLabels:i&&s.length>0?{[s[0]]:i}:void 0},l=[...nf().filter(c=>c.base!==r),o];return fL(l),kk(l),o}function n7t(e){const t=nf().filter(n=>n.id!==e);return fL(t),kk(t),t}function yP(e){const t=nf().filter(n=>n.runtimeId!==e);return fL(t),kk(t),t}function QFe(e,t){const n=e.map(r=>({id:r,label:r,app:r,remote:!1})),i=t.flatMap(r=>r.apps.map(s=>{var l;const o=((l=r.appLabels)==null?void 0:l[s])??s;return{id:pf(r.id,s),label:o,app:s,remote:!0,host:r.runtimeId?r.name:FFe(r.base??""),runtimeId:r.runtimeId,region:r.region,currentVersion:r.currentVersion,agentCategory:r.agentCategory,mpaInstanceId:r.mpaInstanceId}}));return[...n,...i]}const gae=Object.freeze(Object.defineProperty({__proto__:null,addConnection:UFe,addRuntimeConnection:BFe,buildAgentEntries:QFe,connectRuntime:XN,loadConnections:nf,registerConnections:kk,remoteAppId:pf,removeConnection:n7t,removeRuntimeConnection:yP},Symbol.toStringTag,{value:"Module"}));function i7t({onAdded:e,onCancel:t}){const{t:n}=_e("conversation"),[i,r]=p.useState(""),[s,o]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(!1),[f,h]=p.useState(""),m=i.trim().length>0&&s.trim().length>0&&!u;async function g(){if(m){d(!0),h("");try{const b=await UFe(l,i,s,l);if(b.apps.length===0){h(n("addAgentKit.noAgents")),d(!1);return}e(pf(b.id,b.apps[0]))}catch(b){h(n("addAgentKit.connectionFailed",{error:String(b)})),d(!1)}}}return a.jsx("div",{className:"addagent",children:a.jsxs("div",{className:"addagent-card",children:[a.jsx("h2",{className:"addagent-title",children:n("addAgentKit.title")}),a.jsx("p",{className:"addagent-sub",children:n("addAgentKit.description")}),a.jsxs("label",{className:"addagent-field",children:[a.jsx("span",{className:"addagent-label",children:n("addAgentKit.url")}),a.jsx("input",{className:"addagent-input",value:i,onChange:b=>r(b.target.value),placeholder:"https://xxxxx.apigateway-cn-beijing.volceapi.com",autoFocus:!0})]}),a.jsxs("label",{className:"addagent-field",children:[a.jsx("span",{className:"addagent-label",children:"API Key"}),a.jsx("input",{className:"addagent-input",type:"password",value:s,onChange:b=>o(b.target.value),placeholder:n("addAgentKit.apiKeyHint")})]}),a.jsxs("label",{className:"addagent-field",children:[a.jsx("span",{className:"addagent-label",children:n("addAgentKit.displayName")}),a.jsx("input",{className:"addagent-input",value:l,onChange:b=>c(b.target.value),placeholder:n("addAgentKit.displayNameHint")})]}),f&&a.jsx("div",{className:"addagent-error",children:f}),a.jsxs("div",{className:"addagent-actions",children:[a.jsx("button",{className:"addagent-btn addagent-btn--ghost",onClick:t,disabled:u,children:n("addAgentKit.cancel")}),a.jsxs("button",{className:"addagent-btn addagent-btn--primary",onClick:g,disabled:!m,children:[u?a.jsx(Vi,{className:"icon spin"}):null,n(u?"addAgentKit.connecting":"addAgentKit.connect")]})]})]})})}const r7t=/[\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff]/u,s7t={"deploy.build.logs_syncing":"client.deploymentProgress.buildLogsSyncing","deploy.build.logs_complete":"client.deploymentProgress.buildLogsComplete","deploy.build.failed_logs_synced":"client.deploymentProgress.buildFailedLogsSynced","deploy.build.logs_unavailable":"client.deploymentProgress.buildLogsUnavailable","deploy.build.final_logs_unavailable":"client.deploymentProgress.finalBuildLogsUnavailable"},a7t={prepare:"client.deploymentProgress.preparing",upload:"client.deploymentProgress.uploading",build:"client.deploymentProgress.building",deploy:"client.deploymentProgress.deploying",publish:"client.deploymentProgress.publishing",evaluation:"client.deploymentProgress.evaluating",update:"client.deploymentProgress.updating",profile_applying:"client.deploymentProgress.applyingMpaProfile",smoke_running:"client.deploymentProgress.runningMpaSmoke",runnable:"client.deploymentProgress.mpaReady",complete:"client.deploymentProgress.completing",github:"client.deploymentProgress.github"};function hL(e){var r,s;const t=((r=e.message)==null?void 0:r.trim())??"",n=e.messageCode?s7t[e.messageCode]:void 0;if(n)return Q(n);if(t&&(j8().toLowerCase()==="zh-cn"||!r7t.test(t)))return t;if(e.phase==="build"&&((s=e.buildLog)!=null&&s.status)){const o={running:"client.deploymentProgress.buildLogsSyncing",complete:"client.deploymentProgress.buildLogsComplete",error:"client.deploymentProgress.buildLogsUnavailable"}[e.buildLog.status];if(o)return Q(o)}const i=e.phase?a7t[e.phase]:void 0;return i?Q(i):t||Q("client.deploymentProgress.inProgress")}function no(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,i;n{}};function pL(){for(var e=0,t=arguments.length,n={},i;e=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}YN.prototype=pL.prototype={constructor:YN,on:function(e,t){var n=this._,i=l7t(e+"",n),r,s=-1,o=i.length;if(arguments.length<2){for(;++s0)for(var n=new Array(r),i=0,r,s;i=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),yae.hasOwnProperty(t)?{space:yae[t],local:e}:e}function u7t(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===A7&&t.documentElement.namespaceURI===A7?t.createElement(e):t.createElementNS(n,e)}}function d7t(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function zFe(e){var t=mL(e);return(t.local?d7t:u7t)(t)}function f7t(){}function qW(e){return e==null?f7t:function(){return this.querySelector(e)}}function h7t(e){typeof e!="function"&&(e=qW(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r=x&&(x=w+1);!(S=v[x])&&++x=0;)(o=i[r])&&(s&&o.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(o,s),s=o);return this}function $7t(e){e||(e=F7t);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,i=n.length,r=new Array(i),s=0;st?1:e>=t?0:NaN}function B7t(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function U7t(){return Array.from(this)}function Q7t(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?J7t:typeof t=="function"?tUt:eUt)(e,t,n??"")):O1(this.node(),e)}function O1(e,t){return e.style.getPropertyValue(t)||KFe(e).getComputedStyle(e,null).getPropertyValue(t)}function iUt(e){return function(){delete this[e]}}function rUt(e,t){return function(){this[e]=t}}function sUt(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function aUt(e,t){return arguments.length>1?this.each((t==null?iUt:typeof t=="function"?sUt:rUt)(e,t)):this.node()[e]}function GFe(e){return e.trim().split(/^|\s+/)}function WW(e){return e.classList||new XFe(e)}function XFe(e){this._node=e,this._names=GFe(e.getAttribute("class")||"")}XFe.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 YFe(e,t){for(var n=WW(e),i=-1,r=t.length;++i=0&&(n=t.slice(i+1),t=t.slice(0,i)),{type:t,name:n}})}function PUt(e){return function(){var t=this.__on;if(t){for(var n=0,i=-1,r=t.length,s;n()=>e;function T7(e,{sourceEvent:t,subject:n,target:i,identifier:r,active:s,x:o,y:l,dx:c,dy:u,dispatch:d}){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:i,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}T7.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function VUt(e){return!e.ctrlKey&&!e.button}function HUt(){return this.parentNode}function qUt(e,t){return t??{x:e.x,y:e.y}}function WUt(){return navigator.maxTouchPoints||"ontouchstart"in this}function i8e(){var e=VUt,t=HUt,n=qUt,i=WUt,r={},s=pL("start","drag","end"),o=0,l,c,u,d,f=0;function h(k){k.on("mousedown.drag",m).filter(i).on("touchstart.drag",v).on("touchmove.drag",y,zUt).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(k,S){if(!(d||!e.call(this,k,S))){var O=x(this,t.call(this,k,S),k,S,"mouse");O&&(Su(k.view).on("mousemove.drag",g,sA).on("mouseup.drag",b,sA),t8e(k.view),W$(k),u=!1,l=k.clientX,c=k.clientY,O("start",k))}}function g(k){if(Aw(k),!u){var S=k.clientX-l,O=k.clientY-c;u=S*S+O*O>f}r.mouse("drag",k)}function b(k){Su(k.view).on("mousemove.drag mouseup.drag",null),n8e(k.view,u),Aw(k),r.mouse("end",k)}function v(k,S){if(e.call(this,k,S)){var O=k.changedTouches,A=t.call(this,k,S),E=O.length,j,T;for(j=0;j>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?fj(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?fj(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=GUt.exec(e))?new Pc(t[1],t[2],t[3],1):(t=XUt.exec(e))?new Pc(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=YUt.exec(e))?fj(t[1],t[2],t[3],t[4]):(t=ZUt.exec(e))?fj(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=JUt.exec(e))?Eae(t[1],t[2]/100,t[3]/100,1):(t=eQt.exec(e))?Eae(t[1],t[2]/100,t[3]/100,t[4]):vae.hasOwnProperty(e)?kae(vae[e]):e==="transparent"?new Pc(NaN,NaN,NaN,0):null}function kae(e){return new Pc(e>>16&255,e>>8&255,e&255,1)}function fj(e,t,n,i){return i<=0&&(e=t=n=NaN),new Pc(e,t,n,i)}function iQt(e){return e instanceof HT||(e=Ov(e)),e?(e=e.rgb(),new Pc(e.r,e.g,e.b,e.opacity)):new Pc}function _7(e,t,n,i){return arguments.length===1?iQt(e):new Pc(e,t,n,i??1)}function Pc(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}KW(Pc,_7,r8e(HT,{brighter(e){return e=e==null?xP:Math.pow(xP,e),new Pc(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?aA:Math.pow(aA,e),new Pc(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Pc(Xy(this.r),Xy(this.g),Xy(this.b),wP(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:Oae,formatHex:Oae,formatHex8:rQt,formatRgb:Sae,toString:Sae}));function Oae(){return`#${Iy(this.r)}${Iy(this.g)}${Iy(this.b)}`}function rQt(){return`#${Iy(this.r)}${Iy(this.g)}${Iy(this.b)}${Iy((isNaN(this.opacity)?1:this.opacity)*255)}`}function Sae(){const e=wP(this.opacity);return`${e===1?"rgb(":"rgba("}${Xy(this.r)}, ${Xy(this.g)}, ${Xy(this.b)}${e===1?")":`, ${e})`}`}function wP(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Xy(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Iy(e){return e=Xy(e),(e<16?"0":"")+e.toString(16)}function Eae(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new af(e,t,n,i)}function s8e(e){if(e instanceof af)return new af(e.h,e.s,e.l,e.opacity);if(e instanceof HT||(e=Ov(e)),!e)return new af;if(e instanceof af)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),s=Math.max(t,n,i),o=NaN,l=s-r,c=(s+r)/2;return l?(t===s?o=(n-i)/l+(n0&&c<1?0:o,new af(o,l,c,e.opacity)}function sQt(e,t,n,i){return arguments.length===1?s8e(e):new af(e,t,n,i??1)}function af(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}KW(af,sQt,r8e(HT,{brighter(e){return e=e==null?xP:Math.pow(xP,e),new af(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?aA:Math.pow(aA,e),new af(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,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new Pc(K$(e>=240?e-240:e+120,r,i),K$(e,r,i),K$(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new af(Cae(this.h),hj(this.s),hj(this.l),wP(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=wP(this.opacity);return`${e===1?"hsl(":"hsla("}${Cae(this.h)}, ${hj(this.s)*100}%, ${hj(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Cae(e){return e=(e||0)%360,e<0?e+360:e}function hj(e){return Math.max(0,Math.min(1,e||0))}function K$(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 gL=e=>()=>e;function a8e(e,t){return function(n){return e+n*t}}function aQt(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function Yhn(e,t){var n=t-e;return n?a8e(e,n>180||n<-180?n-360*Math.round(n/360):n):gL(isNaN(e)?t:e)}function oQt(e){return(e=+e)==1?o8e:function(t,n){return n-t?aQt(t,n,e):gL(isNaN(t)?n:t)}}function o8e(e,t){var n=t-e;return n?a8e(e,n):gL(isNaN(e)?t:e)}const kP=function e(t){var n=oQt(t);function i(r,s){var o=n((r=_7(r)).r,(s=_7(s)).r),l=n(r.g,s.g),c=n(r.b,s.b),u=o8e(r.opacity,s.opacity);return function(d){return r.r=o(d),r.g=l(d),r.b=c(d),r.opacity=u(d),r+""}}return i.gamma=e,i}(1);function lQt(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,i=t.slice(),r;return function(s){for(r=0;rn&&(s=t.slice(n,s),l[o]?l[o]+=s:l[++o]=s),(i=i[0])===(r=r[0])?l[o]?l[o]+=r:l[++o]=r:(l[++o]=null,c.push({i:o,x:Yf(i,r)})),n=G$.lastIndex;return n180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(r(f)+"rotate(",null,i)-2,x:Yf(u,d)})):d&&f.push(r(f)+"rotate("+d+i)}function l(u,d,f,h){u!==d?h.push({i:f.push(r(f)+"skewX(",null,i)-2,x:Yf(u,d)}):d&&f.push(r(f)+"skewX("+d+i)}function c(u,d,f,h,m,g){if(u!==f||d!==h){var b=m.push(r(m)+"scale(",null,",",null,")");g.push({i:b-4,x:Yf(u,f)},{i:b-2,x:Yf(d,h)})}else(f!==1||h!==1)&&m.push(r(m)+"scale("+f+","+h+")")}return function(u,d){var f=[],h=[];return u=e(u),d=e(d),s(u.translateX,u.translateY,d.translateX,d.translateY,f,h),o(u.rotate,d.rotate,f,h),l(u.skewX,d.skewX,f,h),c(u.scaleX,u.scaleY,d.scaleX,d.scaleY,f,h),u=d=null,function(m){for(var g=-1,b=h.length,v;++g=0&&e._call.call(void 0,t),e=e._next;--S1}function _ae(){Sv=(SP=lA.now())+bL,S1=SS=0;try{OQt()}finally{S1=0,EQt(),Sv=0}}function SQt(){var e=lA.now(),t=e-SP;t>d8e&&(bL-=t,SP=e)}function EQt(){for(var e,t=OP,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:OP=n);ES=e,R7(i)}function R7(e){if(!S1){SS&&(SS=clearTimeout(SS));var t=e-Sv;t>24?(e<1/0&&(SS=setTimeout(_ae,e-lA.now()-bL)),IO&&(IO=clearInterval(IO))):(IO||(SP=lA.now(),IO=setInterval(SQt,d8e)),S1=1,f8e(_ae))}}function jae(e,t,n){var i=new EP;return t=t==null?0:+t,i.restart(r=>{i.stop(),e(r+t)},t,n),i}var CQt=pL("start","end","cancel","interrupt"),AQt=[],p8e=0,Nae=1,I7=2,JN=3,Rae=4,P7=5,eR=6;function yL(e,t,n,i,r,s){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;TQt(e,n,{name:t,index:i,group:r,on:CQt,tween:AQt,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:p8e})}function XW(e,t){var n=Nf(e,t);if(n.state>p8e)throw new Error("too late; already scheduled");return n}function Lh(e,t){var n=Nf(e,t);if(n.state>JN)throw new Error("too late; already running");return n}function Nf(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function TQt(e,t,n){var i=e.__transition,r;i[t]=n,n.timer=h8e(s,0,n.time);function s(u){n.state=Nae,n.timer.restart(o,n.delay,n.time),n.delay<=u&&o(u-n.delay)}function o(u){var d,f,h,m;if(n.state!==Nae)return c();for(d in i)if(m=i[d],m.name===n.name){if(m.state===JN)return jae(o);m.state===Rae?(m.state=eR,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete i[d]):+dI7&&i.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function rzt(e,t,n){var i,r,s=izt(t)?XW:Lh;return function(){var o=s(this,e),l=o.on;l!==i&&(r=(i=l).copy()).on(t,n),o.on=r}}function szt(e,t){var n=this._id;return arguments.length<2?Nf(this.node(),n).on.on(e):this.each(rzt(n,e,t))}function azt(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function ozt(){return this.on("end.remove",azt(this._id))}function lzt(e){var t=this._name,n=this._id;typeof e!="function"&&(e=qW(e));for(var i=this._groups,r=i.length,s=new Array(r),o=0;o()=>e;function Izt(e,{sourceEvent:t,target:n,transform:i,dispatch:r}){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:i,enumerable:!0,configurable:!0},_:{value:r}})}function Tp(e,t,n){this.k=e,this.x=t,this.y=n}Tp.prototype={constructor:Tp,scale:function(e){return e===1?this:new Tp(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Tp(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 vL=new Tp(1,0,0);y8e.prototype=Tp.prototype;function y8e(e){for(;!e.__zoom;)if(!(e=e.parentNode))return vL;return e.__zoom}function X$(e){e.stopImmediatePropagation()}function PO(e){e.preventDefault(),e.stopImmediatePropagation()}function Pzt(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Dzt(){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 Iae(){return this.__zoom||vL}function Mzt(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Lzt(){return navigator.maxTouchPoints||"ontouchstart"in this}function $zt(e,t,n){var i=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r),o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o))}function v8e(){var e=Pzt,t=Dzt,n=$zt,i=Mzt,r=Lzt,s=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,c=ZN,u=pL("start","zoom","end"),d,f,h,m=500,g=150,b=0,v=10;function y(P){P.property("__zoom",Iae).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",j).on("dblclick.zoom",T).filter(r).on("touchstart.zoom",R).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(P,I,D,_){var L=P.selection?P.selection():P;L.property("__zoom",Iae),P!==L?S(P,I,D,_):L.interrupt().each(function(){O(this,arguments).event(_).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},y.scaleBy=function(P,I,D,_){y.scaleTo(P,function(){var L=this.__zoom.k,F=typeof I=="function"?I.apply(this,arguments):I;return L*F},D,_)},y.scaleTo=function(P,I,D,_){y.transform(P,function(){var L=t.apply(this,arguments),F=this.__zoom,M=D==null?k(L):typeof D=="function"?D.apply(this,arguments):D,H=F.invert(M),q=typeof I=="function"?I.apply(this,arguments):I;return n(x(w(F,q),M,H),L,o)},D,_)},y.translateBy=function(P,I,D,_){y.transform(P,function(){return n(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),o)},null,_)},y.translateTo=function(P,I,D,_,L){y.transform(P,function(){var F=t.apply(this,arguments),M=this.__zoom,H=_==null?k(F):typeof _=="function"?_.apply(this,arguments):_;return n(vL.translate(H[0],H[1]).scale(M.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof D=="function"?-D.apply(this,arguments):-D),F,o)},_,L)};function w(P,I){return I=Math.max(s[0],Math.min(s[1],I)),I===P.k?P:new Tp(I,P.x,P.y)}function x(P,I,D){var _=I[0]-D[0]*P.k,L=I[1]-D[1]*P.k;return _===P.x&&L===P.y?P:new Tp(P.k,_,L)}function k(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function S(P,I,D,_){P.on("start.zoom",function(){O(this,arguments).event(_).start()}).on("interrupt.zoom end.zoom",function(){O(this,arguments).event(_).end()}).tween("zoom",function(){var L=this,F=arguments,M=O(L,F).event(_),H=t.apply(L,F),q=D==null?k(H):typeof D=="function"?D.apply(L,F):D,U=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),Z=L.__zoom,z=typeof I=="function"?I.apply(L,F):I,J=c(Z.invert(q).concat(U/Z.k),z.invert(q).concat(U/z.k));return function(ne){if(ne===1)ne=z;else{var W=J(ne),X=U/W[2];ne=new Tp(X,q[0]-W[0]*X,q[1]-W[1]*X)}M.zoom(null,ne)}})}function O(P,I,D){return!D&&P.__zooming||new A(P,I)}function A(P,I){this.that=P,this.args=I,this.active=0,this.sourceEvent=null,this.extent=t.apply(P,I),this.taps=0}A.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,I){return this.mouse&&P!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&P!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(P){var I=Su(this.that).datum();u.call(P,this.that,new Izt(P,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:u}),I)}};function E(P,...I){if(!e.apply(this,arguments))return;var D=O(this,I).event(P),_=this.__zoom,L=Math.max(s[0],Math.min(s[1],_.k*Math.pow(2,i.apply(this,arguments)))),F=Jd(P);if(D.wheel)(D.mouse[0][0]!==F[0]||D.mouse[0][1]!==F[1])&&(D.mouse[1]=_.invert(D.mouse[0]=F)),clearTimeout(D.wheel);else{if(_.k===L)return;D.mouse=[F,_.invert(F)],tR(this),D.start()}PO(P),D.wheel=setTimeout(M,g),D.zoom("mouse",n(x(w(_,L),D.mouse[0],D.mouse[1]),D.extent,o));function M(){D.wheel=null,D.end()}}function j(P,...I){if(h||!e.apply(this,arguments))return;var D=P.currentTarget,_=O(this,I,!0).event(P),L=Su(P.view).on("mousemove.zoom",q,!0).on("mouseup.zoom",U,!0),F=Jd(P,D),M=P.clientX,H=P.clientY;t8e(P.view),X$(P),_.mouse=[F,this.__zoom.invert(F)],tR(this),_.start();function q(Z){if(PO(Z),!_.moved){var z=Z.clientX-M,J=Z.clientY-H;_.moved=z*z+J*J>b}_.event(Z).zoom("mouse",n(x(_.that.__zoom,_.mouse[0]=Jd(Z,D),_.mouse[1]),_.extent,o))}function U(Z){L.on("mousemove.zoom mouseup.zoom",null),n8e(Z.view,_.moved),PO(Z),_.event(Z).end()}}function T(P,...I){if(e.apply(this,arguments)){var D=this.__zoom,_=Jd(P.changedTouches?P.changedTouches[0]:P,this),L=D.invert(_),F=D.k*(P.shiftKey?.5:2),M=n(x(w(D,F),_,L),t.apply(this,I),o);PO(P),l>0?Su(this).transition().duration(l).call(S,M,_,P):Su(this).call(y.transform,M,_,P)}}function R(P,...I){if(e.apply(this,arguments)){var D=P.touches,_=D.length,L=O(this,I,P.changedTouches.length===_).event(P),F,M,H,q;for(X$(P),M=0;M<_;++M)H=D[M],q=Jd(H,this),q=[q,this.__zoom.invert(q),H.identifier],L.touch0?!L.touch1&&L.touch0[2]!==q[2]&&(L.touch1=q,L.taps=0):(L.touch0=q,F=!0,L.taps=1+!!d);d&&(d=clearTimeout(d)),F&&(L.taps<2&&(f=q[0],d=setTimeout(function(){d=null},m)),tR(this),L.start())}}function C(P,...I){if(this.__zooming){var D=O(this,I).event(P),_=P.changedTouches,L=_.length,F,M,H,q;for(PO(P),F=0;F`Seems like you have not used zustand provider 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:i})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:i}", 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.`},cA=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],x8e=["Enter"," ","Escape"],w8e={"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 E1;(function(e){e.Strict="strict",e.Loose="loose"})(E1||(E1={}));var Yy;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Yy||(Yy={}));var uA;(function(e){e.Partial="partial",e.Full="full"})(uA||(uA={}));const k8e={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var og;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(og||(og={}));var dA;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(dA||(dA={}));var vn;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(vn||(vn={}));const Pae={[vn.Left]:vn.Right,[vn.Right]:vn.Left,[vn.Top]:vn.Bottom,[vn.Bottom]:vn.Top};function O8e(e){return e===null?null:e?"valid":"invalid"}const S8e=e=>"id"in e&&"source"in e&&"target"in e,Fzt=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),ZW=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),qT=(e,t=[0,0])=>{const{width:n,height:i}=km(e),r=e.origin??t,s=n*r[0],o=i*r[1];return{x:e.position.x-s,y:e.position.y-o}},Bzt=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((i,r)=>{const s=typeof r=="string";let o=!t.nodeLookup&&!s?r:void 0;t.nodeLookup&&(o=s?t.nodeLookup.get(r):ZW(r)?r:t.nodeLookup.get(r.id));const l=o?CP(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return xL(i,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return wL(n)},WT=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},i=!1;return e.forEach(r=>{(t.filter===void 0||t.filter(r))&&(n=xL(n,CP(r)),i=!0)}),i?wL(n):{x:0,y:0,width:0,height:0}},JW=(e,t,[n,i,r]=[0,0,1],s=!1,o=!1)=>{const l={...Ok(t,[n,i,r]),width:t.width/r,height:t.height/r},c=[];for(const u of e.values()){const{measured:d,selectable:f=!0,hidden:h=!1}=u;if(o&&!f||h)continue;const m=d.width??u.width??u.initialWidth??null,g=d.height??u.height??u.initialHeight??null,b=fA(l,A1(u)),v=(m??0)*(g??0),y=s&&b>0;(!u.internals.handleBounds||y||b>=v||u.dragging)&&c.push(u)}return c},Uzt=(e,t)=>{const n=new Set;return e.forEach(i=>{n.add(i.id)}),t.filter(i=>n.has(i.source)||n.has(i.target))};function Qzt(e,t){const n=new Map,i=t!=null&&t.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{r.measured.width&&r.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!r.hidden)&&(!i||i.has(r.id))&&n.set(r.id,r)}),n}async function zzt({nodes:e,width:t,height:n,panZoom:i,minZoom:r,maxZoom:s},o){if(e.size===0)return!0;const l=Qzt(e,o),c=WT(l),u=tK(c,t,n,(o==null?void 0:o.minZoom)??r,(o==null?void 0:o.maxZoom)??s,(o==null?void 0:o.padding)??.1);return await i.setViewport(u,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),!0}function E8e({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:i=[0,0],nodeExtent:r,onError:s}){const o=n.get(e),l=o.parentId?n.get(o.parentId):void 0,{x:c,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},d=o.origin??i;let f=o.extent||r;if(o.extent==="parent"&&!o.expandParent)if(!l)s==null||s("005",wf.error005());else{const m=l.measured.width,g=l.measured.height;m&&g&&(f=[[c,u],[c+m,u+g]])}else l&&Cv(o.extent)&&(f=[[o.extent[0][0]+c,o.extent[0][1]+u],[o.extent[1][0]+c,o.extent[1][1]+u]]);const h=Cv(f)?Ev(t,f,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(s==null||s("015",wf.error015())),{position:{x:h.x-c+(o.measured.width??0)*d[0],y:h.y-u+(o.measured.height??0)*d[1]},positionAbsolute:h}}async function Vzt({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:i,onBeforeDelete:r}){const s=new Set(e.map(h=>h.id)),o=[];for(const h of n){if(h.deletable===!1)continue;const m=s.has(h.id),g=!m&&h.parentId&&o.find(b=>b.id===h.parentId);(m||g)&&o.push(h)}const l=new Set(t.map(h=>h.id)),c=i.filter(h=>h.deletable!==!1),d=Uzt(o,c);for(const h of c)l.has(h.id)&&!d.find(g=>g.id===h.id)&&d.push(h);if(!r)return{edges:d,nodes:o};const f=await r({nodes:o,edges:d});return typeof f=="boolean"?f?{edges:d,nodes:o}:{edges:[],nodes:[]}:f}const C1=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ev=(e={x:0,y:0},t,n)=>({x:C1(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:C1(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function C8e(e,t,n){const{width:i,height:r}=km(n),{x:s,y:o}=n.internals.positionAbsolute;return Ev(e,[[s,o],[s+i,o+r]],t)}const Dae=(e,t,n)=>en?-C1(Math.abs(e-n),1,t)/t:0,eK=(e,t,n=15,i=40)=>{const r=Dae(e.x,i,t.width-i)*n,s=Dae(e.y,i,t.height-i)*n;return[r,s]},xL=(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)}),D7=({x:e,y:t,width:n,height:i})=>({x:e,y:t,x2:e+n,y2:t+i}),wL=({x:e,y:t,x2:n,y2:i})=>({x:e,y:t,width:n-e,height:i-t}),A1=(e,t=[0,0])=>{var r,s;const{x:n,y:i}=ZW(e)?e.internals.positionAbsolute:qT(e,t);return{x:n,y:i,width:((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0,height:((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0}},CP=(e,t=[0,0])=>{var r,s;const{x:n,y:i}=ZW(e)?e.internals.positionAbsolute:qT(e,t);return{x:n,y:i,x2:n+(((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0),y2:i+(((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0)}},A8e=(e,t)=>wL(xL(D7(e),D7(t))),fA=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),i=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*i)},Mae=e=>lf(e.width)&&lf(e.height)&&lf(e.x)&&lf(e.y),lf=e=>!isNaN(e)&&isFinite(e),T8e=(e,t)=>(n,i)=>{},KT=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Ok=({x:e,y:t},[n,i,r],s=!1,o=[1,1])=>{const l={x:(e-n)/r,y:(t-i)/r};return s?KT(l,o):l},T1=({x:e,y:t},[n,i,r])=>({x:e*r+n,y:t*r+i});function W0(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 Hzt(e,t,n){if(typeof e=="string"||typeof e=="number"){const i=W0(e,n),r=W0(e,t);return{top:i,right:r,bottom:i,left:r,x:r*2,y:i*2}}if(typeof e=="object"){const i=W0(e.top??e.y??0,n),r=W0(e.bottom??e.y??0,n),s=W0(e.left??e.x??0,t),o=W0(e.right??e.x??0,t);return{top:i,right:o,bottom:r,left:s,x:s+o,y:i+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function qzt(e,t,n,i,r,s){const{x:o,y:l}=T1(e,[t,n,i]),{x:c,y:u}=T1({x:e.x+e.width,y:e.y+e.height},[t,n,i]),d=r-c,f=s-u;return{left:Math.floor(o),top:Math.floor(l),right:Math.floor(d),bottom:Math.floor(f)}}const tK=(e,t,n,i,r,s)=>{const o=Hzt(s,t,n),l=(t-o.x)/e.width,c=(n-o.y)/e.height,u=Math.min(l,c),d=C1(u,i,r),f=e.x+e.width/2,h=e.y+e.height/2,m=t/2-f*d,g=n/2-h*d,b=qzt(e,m,g,d,t,n),v={left:Math.min(b.left-o.left,0),top:Math.min(b.top-o.top,0),right:Math.min(b.right-o.right,0),bottom:Math.min(b.bottom-o.bottom,0)};return{x:m-v.left+v.right,y:g-v.top+v.bottom,zoom:d}},hA=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Cv(e){return e!=null&&e!=="parent"}function km(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 nK(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 _8e(e,t={width:0,height:0},n,i,r){const s={...e},o=i.get(n);if(o){const l=o.origin||r;s.x+=o.internals.positionAbsolute.x-(t.width??0)*l[0],s.y+=o.internals.positionAbsolute.y-(t.height??0)*l[1]}return s}function Lae(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Wzt(){let e,t;return{promise:new Promise((i,r)=>{e=i,t=r}),resolve:e,reject:t}}function Kzt(e){return{...w8e,...e||{}}}function RE(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:i,containerBounds:r}){const{x:s,y:o}=cf(e),l=Ok({x:s-((r==null?void 0:r.left)??0),y:o-((r==null?void 0:r.top)??0)},i),{x:c,y:u}=n?KT(l,t):l;return{xSnapped:c,ySnapped:u,...l}}const iK=e=>({width:e.offsetWidth,height:e.offsetHeight}),j8e=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Gzt=["INPUT","SELECT","TEXTAREA"];function N8e(e){var i,r;const t=((r=(i=e.composedPath)==null?void 0:i.call(e))==null?void 0:r[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:Gzt.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const R8e=e=>"clientX"in e,cf=(e,t)=>{var s,o;const n=R8e(e),i=n?e.clientX:(s=e.touches)==null?void 0:s[0].clientX,r=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:i-((t==null?void 0:t.left)??0),y:r-((t==null?void 0:t.top)??0)}},$ae=(e,t,n,i,r)=>{const s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(o=>{const l=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:r,position:o.getAttribute("data-handlepos"),x:(l.left-n.left)/i,y:(l.top-n.top)/i,...iK(o)}})};function I8e({sourceX:e,sourceY:t,targetX:n,targetY:i,sourceControlX:r,sourceControlY:s,targetControlX:o,targetControlY:l}){const c=e*.125+r*.375+o*.375+n*.125,u=t*.125+s*.375+l*.375+i*.125,d=Math.abs(c-e),f=Math.abs(u-t);return[c,u,d,f]}function gj(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Fae({pos:e,x1:t,y1:n,x2:i,y2:r,c:s}){switch(e){case vn.Left:return[t-gj(t-i,s),n];case vn.Right:return[t+gj(i-t,s),n];case vn.Top:return[t,n-gj(n-r,s)];case vn.Bottom:return[t,n+gj(r-n,s)]}}function P8e({sourceX:e,sourceY:t,sourcePosition:n=vn.Bottom,targetX:i,targetY:r,targetPosition:s=vn.Top,curvature:o=.25}){const[l,c]=Fae({pos:n,x1:e,y1:t,x2:i,y2:r,c:o}),[u,d]=Fae({pos:s,x1:i,y1:r,x2:e,y2:t,c:o}),[f,h,m,g]=I8e({sourceX:e,sourceY:t,targetX:i,targetY:r,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${l},${c} ${u},${d} ${i},${r}`,f,h,m,g]}function D8e({sourceX:e,sourceY:t,targetX:n,targetY:i}){const r=Math.abs(n-e)/2,s=n0}const Zzt=({source:e,sourceHandle:t,target:n,targetHandle:i})=>`xy-edge__${e}${t||""}-${n}${i||""}`,Jzt=(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)),eVt=(e,t,n={})=>{var s;if(!e.source||!e.target)return(s=n.onError)==null||s.call(n,"006",wf.error006()),t;const i=n.getEdgeId||Zzt;let r;return S8e(e)?r={...e}:r={...e,id:i(e)},Jzt(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function M8e({sourceX:e,sourceY:t,targetX:n,targetY:i}){const[r,s,o,l]=D8e({sourceX:e,sourceY:t,targetX:n,targetY:i});return[`M ${e},${t}L ${n},${i}`,r,s,o,l]}const Bae={[vn.Left]:{x:-1,y:0},[vn.Right]:{x:1,y:0},[vn.Top]:{x:0,y:-1},[vn.Bottom]:{x:0,y:1}},tVt=({source:e,sourcePosition:t=vn.Bottom,target:n})=>t===vn.Left||t===vn.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function nVt({source:e,sourcePosition:t=vn.Bottom,target:n,targetPosition:i=vn.Top,center:r,offset:s,stepPosition:o}){const l=Bae[t],c=Bae[i],u={x:e.x+l.x*s,y:e.y+l.y*s},d={x:n.x+c.x*s,y:n.y+c.y*s},f=tVt({source:u,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",m=f[h];let g=[],b,v;const y={x:0,y:0},w={x:0,y:0},[,,x,k]=D8e({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[h]*c[h]===-1){h==="x"?(b=r.x??u.x+(d.x-u.x)*o,v=r.y??(u.y+d.y)/2):(b=r.x??(u.x+d.x)/2,v=r.y??u.y+(d.y-u.y)*o);const E=[{x:b,y:u.y},{x:b,y:d.y}],j=[{x:u.x,y:v},{x:d.x,y:v}];l[h]===m?g=h==="x"?E:j:g=h==="x"?j:E}else{const E=[{x:u.x,y:d.y}],j=[{x:d.x,y:u.y}];if(h==="x"?g=l.x===m?j:E:g=l.y===m?E:j,t===i){const P=Math.abs(e[h]-n[h]);if(P<=s){const I=Math.min(s-1,s-P);l[h]===m?y[h]=(u[h]>e[h]?-1:1)*I:w[h]=(d[h]>n[h]?-1:1)*I}}if(t!==i){const P=h==="x"?"y":"x",I=l[h]===c[P],D=u[P]>d[P],_=u[P]=N?(b=(T.x+R.x)/2,v=g[0].y):(b=g[0].x,v=(T.y+R.y)/2)}const S={x:u.x+y.x,y:u.y+y.y},O={x:d.x+w.x,y:d.y+w.y};return[[e,...S.x!==g[0].x||S.y!==g[0].y?[S]:[],...g,...O.x!==g[g.length-1].x||O.y!==g[g.length-1].y?[O]:[],n],b,v,x,k]}function iVt(e,t,n,i){const r=Math.min(Uae(e,t)/2,Uae(t,n)/2,i),{x:s,y:o}=t;if(e.x===s&&s===n.x||e.y===o&&o===n.y)return`L${s} ${o}`;if(e.y===o){const u=e.xn.id===t):e[0])||null}function M7(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function sVt(e,{id:t,defaultColor:n,defaultMarkerStart:i,defaultMarkerEnd:r}){const s=new Set;return e.reduce((o,l)=>([l.markerStart||i,l.markerEnd||r].forEach(c=>{if(c&&typeof c=="object"){const u=M7(c,t);s.has(u)||(o.push({id:u,color:c.color||n,...c}),s.add(u))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))}const L8e=1e3,aVt=10,rK={nodeOrigin:[0,0],nodeExtent:cA,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},oVt={...rK,checkEquality:!0};function sK(e,t){const n={...e};for(const i in t)t[i]!==void 0&&(n[i]=t[i]);return n}function lVt(e,t,n){const i=sK(rK,n);for(const r of e.values())if(r.parentId)oK(r,e,t,i);else{const s=qT(r,i.nodeOrigin),o=Cv(r.extent)?r.extent:i.nodeExtent,l=Ev(s,o,km(r));r.internals.positionAbsolute=l}}function cVt(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],i=[];for(const r of e.handles){const s={id:r.id,width:r.width??1,height:r.height??1,nodeId:e.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?n.push(s):r.type==="target"&&i.push(s)}return{source:n,target:i}}function aK(e){return e==="manual"}function L7(e,t,n,i={}){var d,f;const r=sK(oVt,i),s={i:0},o=new Map(t),l=r!=null&&r.elevateNodesOnSelect&&!aK(r.zIndexMode)?L8e:0;let c=e.length>0,u=!1;t.clear(),n.clear();for(const h of e){let m=o.get(h.id);if(r.checkEquality&&h===(m==null?void 0:m.internals.userNode))t.set(h.id,m);else{const g=qT(h,r.nodeOrigin),b=Cv(h.extent)?h.extent:r.nodeExtent,v=Ev(g,b,km(h));m={...r.defaults,...h,measured:{width:(d=h.measured)==null?void 0:d.width,height:(f=h.measured)==null?void 0:f.height},internals:{positionAbsolute:v,handleBounds:cVt(h,m),z:$8e(h,l,r.zIndexMode),userNode:h}},t.set(h.id,m)}(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(c=!1),h.parentId&&oK(m,t,n,i,s),u||(u=h.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function uVt(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 oK(e,t,n,i,r){const{elevateNodesOnSelect:s,nodeOrigin:o,nodeExtent:l,zIndexMode:c}=sK(rK,i),u=e.parentId,d=t.get(u);if(!d){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}uVt(e,n),r&&!d.parentId&&d.internals.rootParentIndex===void 0&&c==="auto"&&(d.internals.rootParentIndex=++r.i,d.internals.z=d.internals.z+r.i*aVt),r&&d.internals.rootParentIndex!==void 0&&(r.i=d.internals.rootParentIndex);const f=s&&!aK(c)?L8e:0,{x:h,y:m,z:g}=dVt(e,d,o,l,f,c),{positionAbsolute:b}=e.internals,v=h!==b.x||m!==b.y;(v||g!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:h,y:m}:b,z:g}})}function $8e(e,t,n){const i=lf(e.zIndex)?e.zIndex:0;return aK(n)?i:i+(e.selected?t:0)}function dVt(e,t,n,i,r,s){const{x:o,y:l}=t.internals.positionAbsolute,c=km(e),u=qT(e,n),d=Cv(e.extent)?Ev(u,e.extent,c):u;let f=Ev({x:o+d.x,y:l+d.y},i,c);e.extent==="parent"&&(f=C8e(f,c,t));const h=$8e(e,r,s),m=t.internals.z??0;return{x:f.x,y:f.y,z:m>=h?m+1:h}}function lK(e,t,n,i=[0,0]){var o;const r=[],s=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const u=((o=s.get(l.parentId))==null?void 0:o.expandedRect)??A1(c),d=A8e(u,l.rect);s.set(l.parentId,{expandedRect:d,parent:c})}return s.size>0&&s.forEach(({expandedRect:l,parent:c},u)=>{var x;const d=c.internals.positionAbsolute,f=km(c),h=c.origin??i,m=l.x0||g>0||y||w)&&(r.push({id:u,type:"position",position:{x:c.position.x-m+y,y:c.position.y-g+w}}),(x=n.get(u))==null||x.forEach(k=>{e.some(S=>S.id===k.id)||r.push({id:k.id,type:"position",position:{x:k.position.x+m,y:k.position.y+g}})})),(f.width0){const m=lK(h,t,n,r);u.push(...m)}return{changes:u,updatedInternals:c}}async function hVt({delta:e,panZoom:t,transform:n,translateExtent:i,width:r,height:s}){if(!t||!e.x&&!e.y)return!1;const o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,s]],i);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function Hae(e,t,n,i,r,s){let o=r;const l=i.get(o)||new Map;i.set(o,l.set(n,t)),o=`${r}-${e}`;const c=i.get(o)||new Map;if(i.set(o,c.set(n,t)),s){o=`${r}-${e}-${s}`;const u=i.get(o)||new Map;i.set(o,u.set(n,t))}}function F8e(e,t,n){e.clear(),t.clear();for(const i of n){const{source:r,target:s,sourceHandle:o=null,targetHandle:l=null}=i,c={edgeId:i.id,source:r,target:s,sourceHandle:o,targetHandle:l},u=`${r}-${o}--${s}-${l}`,d=`${s}-${l}--${r}-${o}`;Hae("source",c,d,e,r,o),Hae("target",c,u,e,s,l),t.set(i.id,i)}}function B8e(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:B8e(n,t):!1}function qae(e,t,n){var r;let i=e;do{if((r=i==null?void 0:i.matches)!=null&&r.call(i,t))return!0;if(i===n)return!1;i=i==null?void 0:i.parentElement}while(i);return!1}function pVt(e,t,n,i){const r=new Map;for(const[s,o]of e)if((o.selected||o.id===i)&&(!o.parentId||!B8e(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const l=e.get(s);l&&r.set(s,{id:s,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return r}function Y$({nodeId:e,dragItems:t,nodeLookup:n,dragging:i=!0}){var o,l,c;const r=[];for(const[u,d]of t){const f=(o=n.get(u))==null?void 0:o.internals.userNode;f&&r.push({...f,position:d.position,dragging:i})}if(!e)return[r[0],r];const s=(l=n.get(e))==null?void 0:l.internals.userNode;return[s?{...s,position:((c=t.get(e))==null?void 0:c.position)||s.position,dragging:i}:r[0],r]}function mVt({dragItems:e,snapGrid:t,x:n,y:i}){const r=e.values().next().value;if(!r)return null;const s={x:n-r.distance.x,y:i-r.distance.y},o=KT(s,t);return{x:o.x-s.x,y:o.y-s.y}}function gVt({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:i,onDragStop:r}){let s={x:null,y:null},o=0,l=new Map,c=!1,u={x:0,y:0},d=null,f=!1,h=null,m=!1,g=!1,b=null;function v({noDragClassName:w,handleSelector:x,domNode:k,isSelectable:S,nodeId:O,nodeClickDistance:A=0}){h=Su(k);function E({x:C,y:N}){const{nodeLookup:P,nodeExtent:I,snapGrid:D,snapToGrid:_,nodeOrigin:L,onNodeDrag:F,onSelectionDrag:M,onError:H,updateNodePositions:q}=t();s={x:C,y:N};let U=!1;const Z=l.size>1,z=Z&&I?D7(WT(l)):null,J=Z&&_?mVt({dragItems:l,snapGrid:D,x:C,y:N}):null;for(const[ne,W]of l){if(!P.has(ne))continue;let X={x:C-W.distance.x,y:N-W.distance.y};_&&(X=J?{x:Math.round(X.x+J.x),y:Math.round(X.y+J.y)}:KT(X,D));let le=null;if(Z&&I&&!W.extent&&z){const{positionAbsolute:K}=W.internals,ue=K.x-z.x+I[0][0],te=K.x+W.measured.width-z.x2+I[1][0],Oe=K.y-z.y+I[0][1],fe=K.y+W.measured.height-z.y2+I[1][1];le=[[ue,Oe],[te,fe]]}const{position:V,positionAbsolute:Y}=E8e({nodeId:ne,nextPosition:X,nodeLookup:P,nodeExtent:le||I,nodeOrigin:L,onError:H});U=U||W.position.x!==V.x||W.position.y!==V.y,W.position=V,W.internals.positionAbsolute=Y}if(g=g||U,!!U&&(q(l,!0),b&&(i||F||!O&&M))){const[ne,W]=Y$({nodeId:O,dragItems:l,nodeLookup:P});i==null||i(b,l,ne,W),F==null||F(b,ne,W),O||M==null||M(b,W)}}async function j(){if(!d)return;const{transform:C,panBy:N,autoPanSpeed:P,autoPanOnNodeDrag:I}=t();if(!I){c=!1,cancelAnimationFrame(o);return}const[D,_]=eK(u,d,P);(D!==0||_!==0)&&(s.x=(s.x??0)-D/C[2],s.y=(s.y??0)-_/C[2],await N({x:D,y:_})&&E(s)),o=requestAnimationFrame(j)}function T(C){var Z;const{nodeLookup:N,multiSelectionActive:P,nodesDraggable:I,transform:D,snapGrid:_,snapToGrid:L,selectNodesOnDrag:F,onNodeDragStart:M,onSelectionDragStart:H,unselectNodesAndEdges:q}=t();f=!0,(!F||!S)&&!P&&O&&((Z=N.get(O))!=null&&Z.selected||q()),S&&F&&O&&(e==null||e(O));const U=RE(C.sourceEvent,{transform:D,snapGrid:_,snapToGrid:L,containerBounds:d});if(s=U,l=pVt(N,I,U,O),l.size>0&&(n||M||!O&&H)){const[z,J]=Y$({nodeId:O,dragItems:l,nodeLookup:N});n==null||n(C.sourceEvent,l,z,J),M==null||M(C.sourceEvent,z,J),O||H==null||H(C.sourceEvent,J)}}const R=i8e().clickDistance(A).on("start",C=>{const{domNode:N,nodeDragThreshold:P,transform:I,snapGrid:D,snapToGrid:_}=t();d=(N==null?void 0:N.getBoundingClientRect())||null,m=!1,g=!1,b=C.sourceEvent,P===0&&T(C),s=RE(C.sourceEvent,{transform:I,snapGrid:D,snapToGrid:_,containerBounds:d}),u=cf(C.sourceEvent,d)}).on("drag",C=>{const{autoPanOnNodeDrag:N,transform:P,snapGrid:I,snapToGrid:D,nodeDragThreshold:_,nodeLookup:L}=t(),F=RE(C.sourceEvent,{transform:P,snapGrid:I,snapToGrid:D,containerBounds:d});if(b=C.sourceEvent,(C.sourceEvent.type==="touchmove"&&C.sourceEvent.touches.length>1||O&&!L.has(O))&&(m=!0),!m){if(!c&&N&&f&&(c=!0,j()),!f){const M=cf(C.sourceEvent,d),H=M.x-u.x,q=M.y-u.y;Math.sqrt(H*H+q*q)>_&&T(C)}(s.x!==F.xSnapped||s.y!==F.ySnapped)&&l&&f&&(u=cf(C.sourceEvent,d),E(F))}}).on("end",C=>{if(!f||m){m&&l.size>0&&t().updateNodePositions(l,!1);return}if(c=!1,f=!1,cancelAnimationFrame(o),l.size>0){const{nodeLookup:N,updateNodePositions:P,onNodeDragStop:I,onSelectionDragStop:D}=t();if(g&&(P(l,!1),g=!1),r||I||!O&&D){const[_,L]=Y$({nodeId:O,dragItems:l,nodeLookup:N,dragging:!1});r==null||r(C.sourceEvent,l,_,L),I==null||I(C.sourceEvent,_,L),O||D==null||D(C.sourceEvent,L)}}}).filter(C=>{const N=C.target;return!C.button&&(!w||!qae(N,`.${w}`,k))&&(!x||qae(N,x,k))});h.call(R)}function y(){h==null||h.on(".drag",null)}return{update:v,destroy:y}}function bVt(e,t,n){const i=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const s of t.values())fA(r,A1(s))>0&&i.push(s);return i}const yVt=250;function vVt(e,t,n,i){var l,c;let r=[],s=1/0;const o=bVt(e,n,t+yVt);for(const u of o){const d=[...((l=u.internals.handleBounds)==null?void 0:l.source)??[],...((c=u.internals.handleBounds)==null?void 0:c.target)??[]];for(const f of d){if(i.nodeId===f.nodeId&&i.type===f.type&&i.id===f.id)continue;const{x:h,y:m}=Av(u,f,f.position,!0),g=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(m-e.y,2));g>t||(g1){const u=i.type==="source"?"target":"source";return r.find(d=>d.type===u)??r[0]}return r[0]}function U8e(e,t,n,i,r,s=!1){var u,d,f;const o=i.get(e);if(!o)return null;const l=r==="strict"?(u=o.internals.handleBounds)==null?void 0:u[t]:[...((d=o.internals.handleBounds)==null?void 0:d.source)??[],...((f=o.internals.handleBounds)==null?void 0:f.target)??[]],c=(n?l==null?void 0:l.find(h=>h.id===n):l==null?void 0:l[0])??null;return c&&s?{...c,...Av(o,c,c.position,!0)}:c}function Q8e(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function xVt(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const z8e=()=>!0;function wVt(e,{connectionMode:t,connectionRadius:n,handleId:i,nodeId:r,edgeUpdaterType:s,isTarget:o,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:m,onConnectStart:g,onConnect:b,onConnectEnd:v,isValidConnection:y=z8e,onReconnectEnd:w,updateConnection:x,getTransform:k,getFromHandle:S,autoPanSpeed:O,dragThreshold:A=1,handleDomNode:E}){const j=j8e(e.target);let T=0,R;const{x:C,y:N}=cf(e),P=Q8e(s,E),I=l==null?void 0:l.getBoundingClientRect();let D=!1;if(!I||!P)return;const _=U8e(r,P,i,c,t);if(!_)return;let L=cf(e,I),F=!1,M=null,H=!1,q=null;function U(){if(!d||!I)return;const[V,Y]=eK(L,I,O);h({x:V,y:Y}),T=requestAnimationFrame(U)}const Z={..._,nodeId:r,type:P,position:_.position},z=c.get(r);let ne={inProgress:!0,isValid:null,from:Av(z,Z,vn.Left,!0),fromHandle:Z,fromPosition:Z.position,fromNode:z,to:L,toHandle:null,toPosition:Pae[Z.position],toNode:null,pointer:L};function W(){D=!0,x(ne),g==null||g(e,{nodeId:r,handleId:i,handleType:P})}A===0&&W();function X(V){if(!D){const{x:fe,y:pe}=cf(V),Se=fe-C,ve=pe-N;if(!(Se*Se+ve*ve>A*A))return;W()}if(!S()||!Z){le(V);return}const Y=k();L=cf(V,I),R=vVt(Ok(L,Y,!1,[1,1]),n,c,Z),F||(U(),F=!0);const K=V8e(V,{handle:R,connectionMode:t,fromNodeId:r,fromHandleId:i,fromType:o?"target":"source",isValidConnection:y,doc:j,lib:u,flowId:f,nodeLookup:c});q=K.handleDomNode,M=K.connection,H=xVt(!!R,K.isValid);const ue=c.get(r),te=ue?Av(ue,Z,vn.Left,!0):ne.from,Oe={...ne,from:te,isValid:H,to:K.toHandle&&H?T1({x:K.toHandle.x,y:K.toHandle.y},Y):L,toHandle:K.toHandle,toPosition:H&&K.toHandle?K.toHandle.position:Pae[Z.position],toNode:K.toHandle?c.get(K.toHandle.nodeId):null,pointer:L};x(Oe),ne=Oe}function le(V){if(!("touches"in V&&V.touches.length>0)){if(D){(R||q)&&M&&H&&(b==null||b(M));const{inProgress:Y,...K}=ne,ue={...K,toPosition:ne.toHandle?ne.toPosition:null};v==null||v(V,ue),s&&(w==null||w(V,ue))}m(),cancelAnimationFrame(T),F=!1,H=!1,M=null,q=null,j.removeEventListener("mousemove",X),j.removeEventListener("mouseup",le),j.removeEventListener("touchmove",X),j.removeEventListener("touchend",le)}}j.addEventListener("mousemove",X),j.addEventListener("mouseup",le),j.addEventListener("touchmove",X),j.addEventListener("touchend",le)}function V8e(e,{handle:t,connectionMode:n,fromNodeId:i,fromHandleId:r,fromType:s,doc:o,lib:l,flowId:c,isValidConnection:u=z8e,nodeLookup:d}){const f=s==="target",h=t?o.querySelector(`.${l}-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:m,y:g}=cf(e),b=o.elementFromPoint(m,g),v=b!=null&&b.classList.contains(`${l}-flow__handle`)?b:h,y={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const w=Q8e(void 0,v),x=v.getAttribute("data-nodeid"),k=v.getAttribute("data-handleid"),S=v.classList.contains("connectable"),O=v.classList.contains("connectableend");if(!x||!w)return y;const A={source:f?x:i,sourceHandle:f?k:r,target:f?i:x,targetHandle:f?r:k};y.connection=A;const j=S&&O&&(n===E1.Strict?f&&w==="source"||!f&&w==="target":x!==i||k!==r);y.isValid=j&&u(A),y.toHandle=U8e(x,w,k,d,n,!0)}return y}const $7={onPointerDown:wVt,isValid:V8e};function kVt({domNode:e,panZoom:t,getTransform:n,getViewScale:i}){const r=Su(e);function s({translateExtent:l,width:c,height:u,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:m=!1}){const g=x=>{if(x.sourceEvent.type!=="wheel"||!t)return;const k=n(),S=x.sourceEvent.ctrlKey&&hA()?10:1,O=-x.sourceEvent.deltaY*(x.sourceEvent.deltaMode===1?.05:x.sourceEvent.deltaMode?1:.002)*d,A=k[2]*Math.pow(2,O*S);t.scaleTo(A)};let b=[0,0];const v=x=>{(x.sourceEvent.type==="mousedown"||x.sourceEvent.type==="touchstart")&&(b=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY])},y=x=>{const k=n();if(x.sourceEvent.type!=="mousemove"&&x.sourceEvent.type!=="touchmove"||!t)return;const S=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY],O=[S[0]-b[0],S[1]-b[1]];b=S;const A=i()*Math.max(k[2],Math.log(k[2]))*(m?-1:1),E={x:k[0]-O[0]*A,y:k[1]-O[1]*A},j=[[0,0],[c,u]];t.setViewportConstrained({x:E.x,y:E.y,zoom:k[2]},j,l)},w=v8e().on("start",v).on("zoom",f?y:null).on("zoom.wheel",h?g:null);r.call(w,{})}function o(){r.on("zoom",null)}return{update:s,destroy:o,pointer:Jd}}const kL=e=>({x:e.x,y:e.y,zoom:e.k}),Z$=({x:e,y:t,zoom:n})=>vL.translate(e,t).scale(n),Vx=(e,t)=>e.target.closest(`.${t}`),H8e=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),OVt=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,J$=(e,t=0,n=OVt,i=()=>{})=>{const r=typeof t=="number"&&t>0;return r||i(),r?e.transition().duration(t).ease(n).on("end",i):e},q8e=e=>{const t=e.ctrlKey&&hA()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function SVt({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:i,panOnScrollMode:r,panOnScrollSpeed:s,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(Vx(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(d.ctrlKey&&o){const v=Jd(d),y=q8e(d),w=f*Math.pow(2,y);i.scaleTo(n,w,v,d);return}const h=d.deltaMode===1?20:1;let m=r===Yy.Vertical?0:d.deltaX*h,g=r===Yy.Horizontal?0:d.deltaY*h;!hA()&&d.shiftKey&&r!==Yy.Vertical&&(m=d.deltaY*h,g=0),i.translateBy(n,-(m/f)*s,-(g/f)*s,{internal:!0});const b=kL(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(d,b),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,b),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(d,b))}}function EVt({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(i,r){const s=i.type==="wheel",o=!t&&s&&!i.ctrlKey,l=Vx(i,e);if(i.ctrlKey&&s&&l&&i.preventDefault(),o||l)return null;i.preventDefault(),n.call(this,i,r)}}function CVt({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return i=>{var s,o,l;if((s=i.sourceEvent)!=null&&s.internal)return;const r=kL(i.transform);e.mouseButton=((o=i.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=r,((l=i.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(i.sourceEvent,r))}}function AVt({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:i,onPanZoom:r}){return s=>{var o,l;e.usedRightMouseButton=!!(n&&H8e(t,e.mouseButton??0)),(o=s.sourceEvent)!=null&&o.sync||i([s.transform.x,s.transform.y,s.transform.k]),r&&!((l=s.sourceEvent)!=null&&l.internal)&&(r==null||r(s.sourceEvent,kL(s.transform)))}}function TVt({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:i,onPanZoomEnd:r,onPaneContextMenu:s}){return o=>{var l;if(!((l=o.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,s&&H8e(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&s(o.sourceEvent),e.usedRightMouseButton=!1,i(!1),r)){const c=kL(o.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r==null||r(o.sourceEvent,c)},n?150:0)}}}function _Vt({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:i,panOnScroll:r,zoomOnDoubleClick:s,userSelectionActive:o,noWheelClassName:l,noPanClassName:c,lib:u,connectionInProgress:d}){return f=>{var v;const h=e||t,m=n&&f.ctrlKey,g=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(Vx(f,`${u}-flow__node`)||Vx(f,`${u}-flow__edge`)))return!0;if(!i&&!h&&!r&&!s&&!n||o||d&&!g||Vx(f,l)&&g||Vx(f,c)&&(!g||r&&g&&!e)||!n&&f.ctrlKey&&g)return!1;if(!n&&f.type==="touchstart"&&((v=f.touches)==null?void 0:v.length)>1)return f.preventDefault(),!1;if(!h&&!r&&!m&&g||!i&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(i)&&!i.includes(f.button)&&f.type==="mousedown")return!1;const b=Array.isArray(i)&&i.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||g)&&b}}function jVt({domNode:e,minZoom:t,maxZoom:n,translateExtent:i,viewport:r,onPanZoom:s,onPanZoomStart:o,onPanZoomEnd:l,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=v8e().scaleExtent([t,n]).translateExtent(i),h=Su(e).call(f);w({x:r.x,y:r.y,zoom:C1(r.zoom,t,n)},[[0,0],[d.width,d.height]],i);const m=h.on("wheel.zoom"),g=h.on("dblclick.zoom");f.wheelDelta(q8e);async function b(R,C){return h?new Promise(N=>{f==null||f.interpolate((C==null?void 0:C.interpolate)==="linear"?NE:ZN).transform(J$(h,C==null?void 0:C.duration,C==null?void 0:C.ease,()=>N(!0)),R)}):!1}function v({noWheelClassName:R,noPanClassName:C,onPaneContextMenu:N,userSelectionActive:P,panOnScroll:I,panOnDrag:D,panOnScrollMode:_,panOnScrollSpeed:L,preventScrolling:F,zoomOnPinch:M,zoomOnScroll:H,zoomOnDoubleClick:q,zoomActivationKeyPressed:U,lib:Z,onTransformChange:z,connectionInProgress:J,paneClickDistance:ne,selectionOnDrag:W}){P&&!u.isZoomingOrPanning&&y();const X=I&&!U&&!P;f.clickDistance(W?1/0:!lf(ne)||ne<0?0:ne);const le=X?SVt({zoomPanValues:u,noWheelClassName:R,d3Selection:h,d3Zoom:f,panOnScrollMode:_,panOnScrollSpeed:L,zoomOnPinch:M,onPanZoomStart:o,onPanZoom:s,onPanZoomEnd:l}):EVt({noWheelClassName:R,preventScrolling:F,d3ZoomHandler:m});h.on("wheel.zoom",le,{passive:!1});const V=CVt({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:o});f.on("start",V);const Y=AVt({zoomPanValues:u,panOnDrag:D,onPaneContextMenu:!!N,onPanZoom:s,onTransformChange:z});f.on("zoom",Y);const K=TVt({zoomPanValues:u,panOnDrag:D,panOnScroll:I,onPaneContextMenu:N,onPanZoomEnd:l,onDraggingChange:c});f.on("end",K);const ue=_Vt({zoomActivationKeyPressed:U,panOnDrag:D,zoomOnScroll:H,panOnScroll:I,zoomOnDoubleClick:q,zoomOnPinch:M,userSelectionActive:P,noPanClassName:C,noWheelClassName:R,lib:Z,connectionInProgress:J});f.filter(ue),q?h.on("dblclick.zoom",g):h.on("dblclick.zoom",null)}function y(){f.on("zoom",null)}async function w(R,C,N){const P=Z$(R),I=f==null?void 0:f.constrain()(P,C,N);return I&&await b(I),I}async function x(R,C){const N=Z$(R);return await b(N,C),N}function k(R){if(h){const C=Z$(R),N=h.property("__zoom");(N.k!==R.zoom||N.x!==R.x||N.y!==R.y)&&(f==null||f.transform(h,C,null,{sync:!0}))}}function S(){const R=h?y8e(h.node()):{x:0,y:0,k:1};return{x:R.x,y:R.y,zoom:R.k}}async function O(R,C){return h?new Promise(N=>{f==null||f.interpolate((C==null?void 0:C.interpolate)==="linear"?NE:ZN).scaleTo(J$(h,C==null?void 0:C.duration,C==null?void 0:C.ease,()=>N(!0)),R)}):!1}async function A(R,C){return h?new Promise(N=>{f==null||f.interpolate((C==null?void 0:C.interpolate)==="linear"?NE:ZN).scaleBy(J$(h,C==null?void 0:C.duration,C==null?void 0:C.ease,()=>N(!0)),R)}):!1}function E(R){f==null||f.scaleExtent(R)}function j(R){f==null||f.translateExtent(R)}function T(R){const C=!lf(R)||R<0?0:R;f==null||f.clickDistance(C)}return{update:v,destroy:y,setViewport:x,setViewportConstrained:w,getViewport:S,scaleTo:O,scaleBy:A,setScaleExtent:E,setTranslateExtent:j,syncViewport:k,setClickDistance:T}}var _1;(function(e){e.Line="line",e.Handle="handle"})(_1||(_1={}));function NVt({width:e,prevWidth:t,height:n,prevHeight:i,affectsX:r,affectsY:s}){const o=e-t,l=n-i,c=[o>0?1:o<0?-1:0,l>0?1:l<0?-1:0];return o&&r&&(c[0]=c[0]*-1),l&&s&&(c[1]=c[1]*-1),c}function Wae(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),i=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:i,affectsY:r}}function Lm(e,t){return Math.max(0,t-e)}function $m(e,t){return Math.max(0,e-t)}function bj(e,t,n){return Math.max(0,t-e,e-n)}function Kae(e,t){return e?!t:t}function RVt(e,t,n,i,r,s,o,l){let{affectsX:c,affectsY:u}=t;const{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:m,ySnapped:g}=n,{minWidth:b,maxWidth:v,minHeight:y,maxHeight:w}=i,{x,y:k,width:S,height:O,aspectRatio:A}=e;let E=Math.floor(d?m-e.pointerX:0),j=Math.floor(f?g-e.pointerY:0);const T=S+(c?-E:E),R=O+(u?-j:j),C=-s[0]*S,N=-s[1]*O;let P=bj(T,b,v),I=bj(R,y,w);if(o){let L=0,F=0;c&&E<0?L=Lm(x+E+C,o[0][0]):!c&&E>0&&(L=$m(x+T+C,o[1][0])),u&&j<0?F=Lm(k+j+N,o[0][1]):!u&&j>0&&(F=$m(k+R+N,o[1][1])),P=Math.max(P,L),I=Math.max(I,F)}if(l){let L=0,F=0;c&&E>0?L=$m(x+E,l[0][0]):!c&&E<0&&(L=Lm(x+T,l[1][0])),u&&j>0?F=$m(k+j,l[0][1]):!u&&j<0&&(F=Lm(k+R,l[1][1])),P=Math.max(P,L),I=Math.max(I,F)}if(r){if(d){const L=bj(T/A,y,w)*A;if(P=Math.max(P,L),o){let F=0;!c&&!u||c&&!u&&h?F=$m(k+N+T/A,o[1][1])*A:F=Lm(k+N+(c?E:-E)/A,o[0][1])*A,P=Math.max(P,F)}if(l){let F=0;!c&&!u||c&&!u&&h?F=Lm(k+T/A,l[1][1])*A:F=$m(k+(c?E:-E)/A,l[0][1])*A,P=Math.max(P,F)}}if(f){const L=bj(R*A,b,v)/A;if(I=Math.max(I,L),o){let F=0;!c&&!u||u&&!c&&h?F=$m(x+R*A+C,o[1][0])/A:F=Lm(x+(u?j:-j)*A+C,o[0][0])/A,I=Math.max(I,F)}if(l){let F=0;!c&&!u||u&&!c&&h?F=Lm(x+R*A,l[1][0])/A:F=$m(x+(u?j:-j)*A,l[0][0])/A,I=Math.max(I,F)}}}j=j+(j<0?I:-I),E=E+(E<0?P:-P),r&&(h?T>R*A?j=(Kae(c,u)?-E:E)/A:E=(Kae(c,u)?-j:j)*A:d?(j=E/A,u=c):(E=j*A,c=u));const D=c?x+E:x,_=u?k+j:k;return{width:S+(c?-E:E),height:O+(u?-j:j),x:s[0]*E*(c?-1:1)+D,y:s[1]*j*(u?-1:1)+_}}const W8e={width:0,height:0,x:0,y:0},IVt={...W8e,pointerX:0,pointerY:0,aspectRatio:1};function PVt(e,t,n){const i=t.position.x+e.position.x,r=t.position.y+e.position.y,s=e.measured.width??0,o=e.measured.height??0,l=n[0]*s,c=n[1]*o;return[[i-l,r-c],[i+s-l,r+o-c]]}function DVt({domNode:e,nodeId:t,getStoreItems:n,onChange:i,onEnd:r}){const s=Su(e);let o={controlDirection:Wae("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:d,keepAspectRatio:f,resizeDirection:h,onResizeStart:m,onResize:g,onResizeEnd:b,shouldResize:v}){let y={...W8e},w={...IVt};o={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:Wae(u)};let x,k=null,S=[],O,A,E,j=!1;const T=i8e().on("start",R=>{const{nodeLookup:C,transform:N,snapGrid:P,snapToGrid:I,nodeOrigin:D,paneDomNode:_}=n();if(x=C.get(t),!x)return;k=(_==null?void 0:_.getBoundingClientRect())??null;const{xSnapped:L,ySnapped:F}=RE(R.sourceEvent,{transform:N,snapGrid:P,snapToGrid:I,containerBounds:k});y={width:x.measured.width??0,height:x.measured.height??0,x:x.position.x??0,y:x.position.y??0},w={...y,pointerX:L,pointerY:F,aspectRatio:y.width/y.height},O=void 0,A=Cv(x.extent)?x.extent:void 0,x.parentId&&(x.extent==="parent"||x.expandParent)&&(O=C.get(x.parentId)),O&&x.extent==="parent"&&(A=[[0,0],[O.measured.width,O.measured.height]]),S=[],E=void 0;for(const[M,H]of C)if(H.parentId===t&&(S.push({id:M,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const q=PVt(H,x,H.origin??D);E?E=[[Math.min(q[0][0],E[0][0]),Math.min(q[0][1],E[0][1])],[Math.max(q[1][0],E[1][0]),Math.max(q[1][1],E[1][1])]]:E=q}m==null||m(R,{...y})}).on("drag",R=>{const{transform:C,snapGrid:N,snapToGrid:P,nodeOrigin:I}=n(),D=RE(R.sourceEvent,{transform:C,snapGrid:N,snapToGrid:P,containerBounds:k}),_=[];if(!x)return;const{x:L,y:F,width:M,height:H}=y,q={},U=x.origin??I,{width:Z,height:z,x:J,y:ne}=RVt(w,o.controlDirection,D,o.boundaries,o.keepAspectRatio,U,A,E),W=Z!==M,X=z!==H,le=J!==L&&W,V=ne!==F&&X;if(!le&&!V&&!W&&!X)return;if((le||V||U[0]===1||U[1]===1)&&(q.x=le?J:y.x,q.y=V?ne:y.y,y.x=q.x,y.y=q.y,S.length>0)){const te=J-L,Oe=ne-F;for(const fe of S)fe.position={x:fe.position.x-te+U[0]*(Z-M),y:fe.position.y-Oe+U[1]*(z-H)},_.push(fe)}if((W||X)&&(q.width=W&&(!o.resizeDirection||o.resizeDirection==="horizontal")?Z:y.width,q.height=X&&(!o.resizeDirection||o.resizeDirection==="vertical")?z:y.height,y.width=q.width,y.height=q.height),O&&x.expandParent){const te=U[0]*(q.width??0);q.x&&q.x{j&&(b==null||b(R,{...y}),r==null||r({...y}),j=!1)});s.call(T)}function c(){s.on(".drag",null)}return{update:l,destroy:c}}const MVt={},Gae=e=>{let t;const n=new Set,i=(d,f)=>{const h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){const m=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(g=>g(t,m))}},r=()=>t,c={setState:i,getState:r,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(MVt?"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()}},u=t=e(i,r,c);return c},LVt=e=>e?Gae(e):Gae,{useDebugValue:$Vt}=Pi,{useSyncExternalStoreWithSelector:FVt}=xnt,BVt=e=>e;function K8e(e,t=BVt,n){const i=FVt(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return $Vt(i),i}const Xae=(e,t)=>{const n=LVt(e),i=(r,s=t)=>K8e(n,r,s);return Object.assign(i,n),i},UVt=(e,t)=>e?Xae(e,t):Xae;function zs(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[i,r]of e)if(!Object.is(r,t.get(i)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const i of n)if(!Object.prototype.hasOwnProperty.call(t,i)||!Object.is(e[i],t[i]))return!1;return!0}const OL=p.createContext(null),QVt=OL.Provider,G8e=wf.error001("react");function or(e,t){const n=p.useContext(OL);if(n===null)throw new Error(G8e);return K8e(n,e,t)}function Vs(){const e=p.useContext(OL);if(e===null)throw new Error(G8e);return p.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Yae={display:"none"},zVt={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},X8e="react-flow__node-desc",Y8e="react-flow__edge-desc",VVt="react-flow__aria-live",HVt=e=>e.ariaLiveMessage,qVt=e=>e.ariaLabelConfig;function WVt({rfId:e}){const t=or(HVt);return a.jsx("div",{id:`${VVt}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:zVt,children:t})}function KVt({rfId:e,disableKeyboardA11y:t}){const n=or(qVt);return a.jsxs(a.Fragment,{children:[a.jsx("div",{id:`${X8e}-${e}`,style:Yae,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),a.jsx("div",{id:`${Y8e}-${e}`,style:Yae,children:n["edge.a11yDescription.default"]}),!t&&a.jsx(WVt,{rfId:e})]})}const SL=p.forwardRef(({position:e="top-left",children:t,className:n,style:i,...r},s)=>{const o=`${e}`.split("-");return a.jsx("div",{className:no(["react-flow__panel",n,...o]),style:i,ref:s,...r,children:t})});SL.displayName="Panel";function GVt({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:a.jsx(SL,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:a.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const XVt=e=>{const t=[],n=[];for(const[,i]of e.nodeLookup)i.selected&&t.push(i.internals.userNode);for(const[,i]of e.edgeLookup)i.selected&&n.push(i);return{selectedNodes:t,selectedEdges:n}},yj=e=>e.id;function YVt(e,t){return zs(e.selectedNodes.map(yj),t.selectedNodes.map(yj))&&zs(e.selectedEdges.map(yj),t.selectedEdges.map(yj))}function ZVt({onSelectionChange:e}){const t=Vs(),{selectedNodes:n,selectedEdges:i}=or(XVt,YVt);return p.useEffect(()=>{const r={nodes:n,edges:i};e==null||e(r),t.getState().onSelectionChangeHandlers.forEach(s=>s(r))},[n,i,e]),null}const JVt=e=>!!e.onSelectionChangeHandlers;function eHt({onSelectionChange:e}){const t=or(JVt);return e||t?a.jsx(ZVt,{onSelectionChange:e}):null}const Z8e=[0,0],tHt={x:0,y:0,zoom:1},nHt=["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"],Zae=[...nHt,"rfId"],iHt=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}),Jae={translateExtent:cA,nodeOrigin:Z8e,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function rHt(e){const{setNodes:t,setEdges:n,setMinZoom:i,setMaxZoom:r,setTranslateExtent:s,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:c}=or(iHt,zs),u=Vs();p.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=Jae,l()}),[]);const d=p.useRef(Jae);return p.useEffect(()=>{for(const f of Zae){const h=e[f],m=d.current[f];h!==m&&(typeof e[f]>"u"||(f==="nodes"?t(h):f==="edges"?n(h):f==="minZoom"?i(h):f==="maxZoom"?r(h):f==="translateExtent"?s(h):f==="nodeExtent"?o(h):f==="ariaLabelConfig"?u.setState({ariaLabelConfig:Kzt(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},Zae.map(f=>e[f])),null}function eoe(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function sHt(e){var i;const[t,n]=p.useState(e==="system"?null:e);return p.useEffect(()=>{if(e!=="system"){n(e);return}const r=eoe(),s=()=>n(r!=null&&r.matches?"dark":"light");return s(),r==null||r.addEventListener("change",s),()=>{r==null||r.removeEventListener("change",s)}},[e]),t!==null?t:(i=eoe())!=null&&i.matches?"dark":"light"}const toe=typeof document<"u"?document:null;function pA(e=null,t={target:toe,actInsideInputWithModifier:!0}){const[n,i]=p.useState(!1),r=p.useRef(!1),s=p.useRef(new Set([])),[o,l]=p.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",` +`,4);return n>=0?t.slice(n+5).trimStart():e}function $Fe(e,t){const n=(e||"").trim();return!n||[">",">-","|","|-"].includes(n)?t("common.noDescription"):n}function V9t(){return a.jsx("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:a.jsx("path",{d:"m7.5 7.5 9 9m0-9-9 9",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function H9t(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 5.5v13M5.5 12h13",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}function hae({direction:e}){return a.jsx("svg",{className:"icon",viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,children:a.jsx("path",{d:e==="left"?"m11.7 5.5-4.2 4.5 4.2 4.5":"m8.3 5.5 4.2 4.5-4.2 4.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function q9t(){return a.jsx("span",{className:"skillcenter-loading-mark","aria-hidden":!0})}function W9t({page:e,total:t,pageSize:n,onPage:i}){const{t:r}=_e("ui"),s=Math.max(1,Math.ceil(t/n));return a.jsxs("footer",{className:"skillcenter-pager",children:[a.jsx("span",{children:r("skillCenter.totalItems",{count:t})}),a.jsxs("div",{className:"skillcenter-pager-actions",children:[a.jsx("button",{type:"button",onClick:()=>i(e-1),disabled:e<=1,"aria-label":r("common.previousPage"),children:a.jsx(hae,{direction:"left"})}),a.jsxs("span",{children:[e," / ",s]}),a.jsx("button",{type:"button",onClick:()=>i(e+1),disabled:e>=s,"aria-label":r("common.nextPage"),children:a.jsx(hae,{direction:"right"})})]})]})}function K9t({children:e}){return a.jsx("div",{className:"skillcenter-empty",children:e})}function q$({kind:e,title:t,description:n,error:i,action:r}){return a.jsx("div",{className:`skillcenter-page-state is-${e}`,role:e==="error"?"alert":"status",children:a.jsxs(qn,{fill:"none",children:[a.jsx(qn.Title,{children:t}),n?a.jsx(qn.Description,{children:n}):null,i?a.jsx(Rs,{error:i}):null,r?a.jsx(qn.ActionRow,{children:a.jsx(Tt,{color:"secondary",size:"lg",onClick:r.onClick,children:r.label})}):null]})})}function pae({errors:e,cloudProvider:t,fullPage:n=!1,onRetry:i}){const{t:r}=_e("ui");return a.jsxs("div",{className:`skillcenter-space-errors${n?" is-full-page":""}`,role:"alert",children:[a.jsxs("div",{className:"skillcenter-space-errors__content",children:[a.jsx("strong",{children:r(n?"skillCenter.cannotLoadSpaces":"skillCenter.someSpacesFailed")}),e.map(({region:s,error:o})=>a.jsxs("section",{children:[a.jsx("span",{children:Sh(s,t)}),a.jsx(Rs,{error:o})]},s))]}),a.jsx("button",{type:"button",onClick:i,children:r("common.reload")})]})}function G9t({skill:e,space:t,region:n,cloudProvider:i,detail:r,files:s,loading:o,error:l,canOptimize:c,reviews:u,reviewsLoading:d,reviewsError:f,onOptimize:h,onDownload:m,onClose:g}){const{t:b}=_e("ui"),[v,y]=p.useState("files");return p.useEffect(()=>{const w=x=>{x.key==="Escape"&&g()};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[g]),a.jsx("div",{className:"skill-detail-backdrop",role:"presentation",onMouseDown:g,children:a.jsxs("section",{className:"skill-detail-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-detail-title",onMouseDown:w=>w.stopPropagation(),children:[a.jsxs("header",{className:"skill-detail-head",children:[a.jsx("div",{className:"skill-detail-heading",children:a.jsxs("div",{children:[a.jsx("h2",{id:"skill-detail-title",children:(r==null?void 0:r.name)||e.skillName}),a.jsx("p",{children:$Fe((r==null?void 0:r.description)||e.skillDescription,b)})]})}),a.jsxs("div",{className:"skill-detail-actions",children:[a.jsx("button",{type:"button",onClick:m,disabled:s.length===0,children:b("skillCenter.downloadZip")}),t.isShared?null:a.jsx(bP,{disabled:!c,placement:"bottom",children:a.jsx("button",{type:"button",onClick:h,disabled:!c,children:b("skillCenter.optimize")})}),a.jsx("button",{type:"button",className:"skill-detail-close",onClick:g,"aria-label":b("skillCenter.closeSkillDetails"),children:a.jsx(V9t,{})})]})]}),a.jsxs("dl",{className:"skill-detail-meta",children:[a.jsxs("div",{children:[a.jsx("dt",{children:b("skillCenter.skillId")}),a.jsx("dd",{title:e.skillId,children:e.skillId})]}),a.jsxs("div",{children:[a.jsx("dt",{children:b("agentSelector.version")}),a.jsx("dd",{children:e.sourceVersion||(r==null?void 0:r.version)||e.version||"—"})]}),e.author?a.jsxs("div",{children:[a.jsx("dt",{children:b("skillCenter.author")}),a.jsx("dd",{children:e.author})]}):null,a.jsxs("div",{children:[a.jsx("dt",{children:b("agentSelector.status")}),a.jsx("dd",{children:LFe(e.skillStatus,b)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:b("skillCenter.skillSpace")}),a.jsx("dd",{title:Nc(t),children:t.isShared?b("skillCenter.sharedSpace"):Nc(t)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:b("myAgents.region")}),a.jsx("dd",{children:Sh(n,i)})]})]}),a.jsx(rb,{className:"skill-detail-tabs",idPrefix:"skill-detail",ariaLabel:b("skillCenter.skillDetailSections"),value:v,items:[{id:"files",label:b("skillCenter.allFiles"),panelId:"skill-detail-panel"},{id:"reviews",label:b("skillCenter.reviewHistory"),panelId:"skill-detail-panel"}],onChange:y}),a.jsx("div",{className:`skill-detail-content${v==="files"?" skill-detail-content--files":" skill-detail-content--reviews"}`,id:"skill-detail-panel",role:"tabpanel","aria-labelledby":`skill-detail-${v}-tab`,children:v==="reviews"?d?a.jsx(fl,{}):f?a.jsx("div",{role:"alert",children:a.jsx(Rs,{error:f})}):a.jsx(VW,{applications:u}):o?a.jsxs("div",{className:"skillcenter-loading",children:[a.jsx(q9t,{}),b("skillCenter.loadingSkillContent")]}):l?a.jsx("div",{className:"skillcenter-error",children:a.jsx(Rs,{error:l})}):s.length>0?a.jsx(uL,{files:s.map(w=>w.path.endsWith("SKILL.md")&&w.content?{...w,content:z9t(w.content)}:w)}):a.jsx(K9t,{children:b("skillCenter.noSkillContent")})})]})})}function X9t({space:e,canUseSandbox:t,onUpload:n,onSandbox:i,onClose:r}){const{t:s}=_e("ui");return p.useEffect(()=>{const o=l=>{l.key==="Escape"&&r()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[r]),a.jsx("div",{className:"skill-dialog-backdrop",role:"presentation",onMouseDown:r,children:a.jsxs("section",{className:"skill-dialog skill-add-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-add-dialog-title",onMouseDown:o=>o.stopPropagation(),children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("h2",{id:"skill-add-dialog-title",children:s("skillCenter.addSkill")}),a.jsx("p",{title:Nc(e),children:Nc(e)})]}),a.jsx("button",{type:"button",onClick:r,children:s("common.cancel")})]}),a.jsxs("div",{className:"skill-add-dialog__options",children:[a.jsxs("button",{type:"button",onClick:n,children:[a.jsx("strong",{children:s("skillCenter.localUpload")}),a.jsx("span",{children:s("skillCenter.localUploadDescription")})]}),a.jsx(bP,{disabled:!t,placement:"inside",children:a.jsxs("button",{type:"button",disabled:!t,onClick:i,children:[a.jsx("strong",{children:s("skillCenter.autoCreate")}),a.jsx("span",{children:s("skillCenter.autoCreateDescription")})]})})]})]})})}function Y9t({cloudProvider:e="volcengine",region:t,active:n=!0,activationRevision:i=0,initialWorkspace:r=null,onInitialWorkspaceConsumed:s,onPageTitleChange:o,toolbarLeading:l,toolbarFilters:c}){var Qt;const{t:u,i18n:d}=_e("ui"),f=p.useMemo(()=>[t],[t]),[h,m]=p.useState([]),[g,b]=p.useState(null),[v,y]=p.useState([]),w=p.useMemo(()=>jFe(v),[v]),[x,k]=p.useState(null),[S,O]=p.useState(null),[A,E]=p.useState(!1),j=p.useRef(""),T=p.useRef(!1),[R,C]=p.useState({}),[N,P]=p.useState(!1),[I,D]=p.useState(""),[_,L]=p.useState((r==null?void 0:r.space)??null),F=p.useRef(_);F.current=_;const[M,H]=p.useState([]),[q,U]=p.useState(1),[Z,z]=p.useState(0),[J,ne]=p.useState(!1),[W,X]=p.useState(null),[ce,V]=p.useState(!1),[Y,K]=p.useState(""),[de,ee]=p.useState("overview"),[Oe,he]=p.useState(null),[ge,Se]=p.useState(null),[xe,Pe]=p.useState(null),[Ue,Ke]=p.useState([]),[Me,re]=p.useState(!1),[ue,be]=p.useState(null),[Ce,Ee]=p.useState(null),[Ve,Ge]=p.useState(!1),[ye,oe]=p.useState(null),[ie,Ae]=p.useState(null),[Re,St]=p.useState(null),[Nt,Dt]=p.useState(0),[Et,$t]=p.useState(0),[He,yt]=p.useState(""),[je,kt]=p.useState(""),[_t,fn]=p.useState(null),[tn,qe]=p.useState(r),vt=p.useRef(0),We=p.useRef(0),ot=p.useRef(!1),it=p.useRef(null),tt=p.useRef(null),At=p.useRef(null),Ot=p.useDeferredValue(I),Ut=p.useDeferredValue(Y),Mt=tn&&(_||tn.selectPublishSpace)?tn.operation==="create"?u("skillCenter.createSkill"):u("skillCenter.optimizeNamed",{name:((Qt=tn.source)==null?void 0:Qt.name)||u("skillCenter.skill")}):"",Ze=_!=null&&_.isShared?u("skillCenter.sharedSpace"):Nc(_),bt=!(_!=null&&_.isShared)||_.canWrite===!0,gt=Mt||Ze||u("skillCenter.library");p.useEffect(()=>{n&&(o==null||o(gt))},[n,o,gt]),p.useEffect(()=>{r&&(s==null||s())},[r,s]);const an=p.useMemo(()=>{const Be=Ot.trim().toLocaleLowerCase(),xt=h.filter(zt=>!zt.isShared);return Be?xt.filter(zt=>`${Nc(zt)} ${zt.name} ${zt.description||""} ${zt.projectName||""}`.toLocaleLowerCase().includes(Be)):xt},[Ot,h]),Bt=p.useMemo(()=>{const Be=Ut.trim().toLocaleLowerCase();return Be?M.filter(xt=>`${xt.skillName} ${xt.skillDescription||""}`.toLocaleLowerCase().includes(Be)):M},[Ut,M]),cn=(_==null?void 0:_.region)||nr(e);p.useEffect(()=>{if(!n||!_)return;const Be=()=>$t(zt=>zt+1),xt=()=>{document.visibilityState==="visible"&&Be()};return window.addEventListener("focus",Be),document.addEventListener("visibilitychange",xt),()=>{window.removeEventListener("focus",Be),document.removeEventListener("visibilitychange",xt)}},[n,_==null?void 0:_.id]),p.useEffect(()=>{const Be=_?`${cn}:${_.id}`:"";if(j.current!==Be&&(j.current=Be,y([]),k(null),Se(null)),O(null),E(!1),!n||!_||_.isShared)return;const xt=new AbortController;return E(!0),Fpt({spaceId:_.id,region:cn,signal:xt.signal}).then(zt=>{xt.signal.aborted||y(zt.items)}).catch(zt=>{xt.signal.aborted||O(Lr(zt,u("skillCenter.reviewStatusFailed")))}).finally(()=>{xt.signal.aborted||E(!1)}),()=>xt.abort()},[_==null?void 0:_.id,_==null?void 0:_.isShared,cn,Et,n,i,u]);const Je=p.useMemo(()=>f.flatMap(Be=>{var zt;const xt=(zt=R[Be])==null?void 0:zt.error;return xt?[{region:Be,error:xt}]:[]}),[R,f]),lt=f.some(Be=>{const xt=R[Be];return!!(xt&&!xt.done&&!xt.error)}),hn=Je.length===f.length;p.useEffect(()=>{const Be=new AbortController;return _M(Be.signal).then(Ee).catch(()=>Ee({enabled:!1,reason:u("skillCenter.adminNotConfigured"),operations:["create","optimize"],models:[],styles:{}})),()=>Be.abort()},[u]);const Sn=p.useCallback(async(Be,xt)=>{var ts;if(ot.current||Be.length===0)return;ot.current=!0,P(!0),xt&&((ts=it.current)==null||ts.abort(),m([]),C(Object.fromEntries(Be.map(({region:ci})=>[ci,{nextPage:1,loadedCount:0,done:!1,error:null}]))));const zt=new AbortController;it.current=zt;const jn=++We.current,lr=await Promise.allSettled(Be.map(async({region:ci,page:Ei})=>({region:ci,page:Ei,result:await Rpt({region:ci,page:Ei,pageSize:$9t,signal:zt.signal})})));if(We.current!==jn)return;const ta=lr.map((ci,Ei)=>{const $r=Be[Ei];return ci.status==="rejected"?{request:$r,error:Lr(ci.reason,u("skillCenter.errors.loadSpaces")),items:[],totalCount:0,scannedCount:0}:{request:$r,error:null,items:(ci.value.result.items||[]).map(na=>({...na,region:na.region||ci.value.region})),totalCount:ci.value.result.totalCount||0,scannedCount:ci.value.result.scannedCount??ci.value.result.items.length}}),Ms=ta.flatMap(ci=>ci.items);C(ci=>{const Ei={...ci};return ta.forEach(({request:$r,error:na,scannedCount:ns,totalCount:Il})=>{const fs=Ei[$r.region]||{nextPage:$r.page,loadedCount:0,done:!1,error:null};if(na){Ei[$r.region]={...fs,error:na};return}const me=fs.loadedCount+ns;Ei[$r.region]={nextPage:$r.page+1,loadedCount:me,done:ns===0||me>=Il,error:null}}),Ei}),m(ci=>Q9t(xt?[]:ci,Ms)),L(ci=>ci&&(Ms.find(Ei=>hu(Ei)===hu(ci))||ci)),ot.current=!1,P(!1)},[]),Ji=p.useCallback(()=>{if(ot.current)return;const Be=f.flatMap(xt=>{const zt=R[xt];return zt&&!zt.done&&!zt.error?[{region:xt,page:zt.nextPage}]:[]});Sn(Be,!1)},[Sn,R,f]);p.useEffect(()=>{Nn(),L(null),H([]),U(1)},[e]),p.useEffect(()=>{if(n)return Sn(f.map(Be=>({region:Be,page:1})),!0),()=>{var Be;We.current+=1,(Be=it.current)==null||Be.abort(),ot.current=!1}},[n,i,Sn,f,Nt]),p.useEffect(()=>{const Be=At.current,xt=tt.current;if(!Be||!xt||!lt||N)return;const zt=new IntersectionObserver(([jn])=>{jn.isIntersecting&&Ji()},{root:xt,rootMargin:"240px 0px",threshold:.01});return zt.observe(Be),()=>zt.disconnect()},[lt,Ji,N]);const Qn=()=>{const Be=tt.current;!Be||!lt||N||Be.scrollHeight-Be.scrollTop-Be.clientHeight<=240&&Ji()};p.useEffect(()=>{if(!_){H([]),z(0),V(!1);return}let Be=!0;return ne(!0),X(null),_Ie(_.id,{region:cn,page:q,pageSize:dae,project:_.projectName}).then(xt=>{Be&&(H(xt.items||[]),z(xt.totalCount||0),V(xt.degraded===!0))}).catch(xt=>{Be&&(H([]),z(0),V(!1),X(Lr(xt,u("skillCenter.errors.loadSkills"))))}).finally(()=>{Be&&ne(!1)}),()=>{Be=!1}},[cn,_,q,Et,u]);const _n=Be=>{Nn(),L(Be),ee("overview"),U(1),K("")},pi=()=>{Nn(),L(null),H([]),z(0),V(!1),ee("overview"),U(1),K(""),fn(null)},Nn=()=>{vt.current+=1,he(null),Pe(null),Ke([]),be(null),re(!1)},Dn=async Be=>{if(!_)return;const xt=Ey(Be),zt=vt.current+1;vt.current=zt,he(Be),Pe(null),be(null),re(!0);try{const[jn,lr]=await Promise.all([qpt(_.id,xt,Be.version,cn,_.projectName,Be.skillName,_.name),CIe({spaceId:_.id,skillId:xt,version:Be.version,region:cn,skillSpaceName:_.name,skillName:Be.skillName})]);vt.current===zt&&(Pe(jn),Ke(lr))}catch(jn){vt.current===zt&&be(Lr(jn,u("skillCenter.errors.loadSkillDetails")))}finally{vt.current===zt&&re(!1)}},_i=Be=>{if(_)return{kind:"skill-center",skillId:Ey(Be),version:Be.version,region:cn,projectName:_.projectName,skillSpaceId:_.id,skillSpaceName:_.name,name:Be.skillName,description:Be.skillDescription}},Fn=Be=>{const xt=_i(Be);!xt||!(Ce!=null&&Ce.enabled)||(Nn(),qe({operation:"optimize",source:xt}))},Kn=async Be=>{if(!(!_||!window.confirm(u("skillCenter.deleteSkillConfirm",{name:Be.skillName})))){yt(Be.skillId),fn(null);try{await Vpt({spaceId:_.id,skillId:Be.skillId,region:cn}),$t(xt=>xt+1),Dt(xt=>xt+1)}catch(xt){fn(Lr(xt,u("skillCenter.errors.deleteSkill")))}finally{yt("")}}},Rn=async Be=>{if(!window.confirm(u("skillCenter.deleteSpaceConfirm",{name:Nc(Be)})))return;const xt=hu(Be);kt(xt),fn(null);try{await Upt({spaceId:Be.id,region:Be.region||nr(e)}),_&&hu(_)===xt&&pi(),Dt(zt=>zt+1)}catch(zt){fn(Lr(zt,u("skillCenter.errors.deleteSpace")))}finally{kt("")}},nt=async(Be,xt=Be.version,zt=!1)=>{var ta,Ms,ts,ci;if(!_||T.current)return;const jn=_,lr=`${jn.region}:${jn.id}:${Be.skillId}:${xt}`;T.current=!0,b(lr),fn(null);try{const Ei=await Dpt({spaceId:jn.id,skillId:Be.skillId,version:xt,region:jn.region||cn});((ta=F.current)==null?void 0:ta.id)===jn.id&&((Ms=F.current)==null?void 0:Ms.region)===jn.region&&y($r=>[...$r.filter(na=>na.id!==Ei.id),Ei])}catch(Ei){if(zt)throw Lr(Ei,u("skillCenter.reviewFailed"));((ts=F.current)==null?void 0:ts.id)===jn.id&&((ci=F.current)==null?void 0:ci.region)===jn.region&&fn(Lr(Ei,u("skillCenter.reviewFailed")))}finally{T.current=!1,b(null)}};return tn&&(_||tn.selectPublishSpace)?a.jsx(p9t,{operation:tn.operation,cloudProvider:e,space:_??void 0,availableSpaces:h.filter(Be=>!Be.isShared),spacesLoading:N,initialIntent:tn.initialIntent,source:tn.source,onBack:()=>qe(null),onPublished:()=>{$t(Be=>Be+1),Dt(Be=>Be+1)}}):a.jsxs("section",{className:`skillcenter${_?" is-space":" resource-collection"}`,children:[_?a.jsx(dT,{className:"skillcenter-detail",title:Ze||_.name,description:_.isShared?u("skillCenter.sharedDescription"):_.description||u("skillCenter.manageSpaceDescription"),identitySeed:_.name,backLabel:u("skillCenter.backToSpaces"),onBack:pi,sections:[{key:"overview",label:u("skillCenter.overview"),content:a.jsxs(a.Fragment,{children:[_t?a.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:a.jsx(Rs,{error:_t})}):null,S?a.jsxs("div",{className:"skillcenter-inline-error",role:"alert",children:[a.jsx(Rs,{error:S}),a.jsx("button",{type:"button",onClick:()=>$t(Be=>Be+1),children:u("common.reload")})]}):null,a.jsx("section",{className:"skillcenter-overview",children:a.jsxs(yH,{className:"skillcenter-detail-facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:u("skillCenter.skillCount")}),a.jsx("dd",{children:Z})]}),a.jsxs("div",{children:[a.jsx("dt",{children:u("skillCenter.updatedAt")}),a.jsx("dd",{children:_.updatedAt?U9t(_.updatedAt,d.resolvedLanguage??d.language):"—"})]})]})})]})},{key:"skills",label:u("skillCenter.skills"),content:a.jsxs(a.Fragment,{children:[_t?a.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:a.jsx(Rs,{error:_t})}):null,S?a.jsxs("div",{className:"skillcenter-inline-error",role:"alert",children:[a.jsx(Rs,{error:S}),a.jsx("button",{type:"button",onClick:()=>$t(Be=>Be+1),children:u("common.reload")})]}):null,a.jsxs("section",{className:"skillcenter-results","aria-label":u("skillCenter.skillsInSpace",{name:Ze||_.name}),children:[a.jsx(tPe,{title:u("skillCenter.skills"),description:u("skillCenter.totalItems",{count:Z}),actions:a.jsxs(a.Fragment,{children:[a.jsx(em,{"aria-label":u("skillCenter.searchSkills"),value:Y,onChange:Be=>K(Be.target.value),placeholder:u("skillCenter.searchSkills")}),a.jsx(Tt,{color:"secondary",variant:"outline",size:"sm",pill:!1,disabled:J||A,onClick:()=>$t(Be=>Be+1),children:u("common.refresh")})]})}),ce?a.jsx("div",{className:"skillcenter-inline-warning",role:"status",children:u("skillCenter.degradedRelationWarning")}):null,J&&M.length===0?a.jsx(fl,{}):W&&M.length===0?a.jsx(q$,{kind:"error",title:u("skillCenter.cannotLoadSkills"),error:W,action:{label:u("common.reload"),onClick:()=>$t(Be=>Be+1)}}):Bt.length===0?a.jsx(q$,{kind:"empty",title:Y.trim()?u("skillCenter.noMatchingSkills"):u("skillCenter.noSkills"),description:Y.trim()?u("skillCenter.tryAnotherName"):u(_.isShared?"skillCenter.sharedEmpty":"skillCenter.emptySkillsDescription"),action:!Y.trim()&&bt?{label:u("skillCenter.localUpload"),onClick:()=>St(_)}:void 0}):a.jsx("div",{className:"skillcenter-table-wrap",children:a.jsxs("table",{className:"skillcenter-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:u("skillCenter.skills")}),a.jsx("th",{scope:"col",children:u("agentSelector.status")}),a.jsx("th",{scope:"col",className:"skillcenter-table__actions-heading",children:u("skillCenter.actions")})]})}),a.jsx("tbody",{children:Bt.map(Be=>{const xt=w.get(`${Be.skillId}:${Be.version}`);return a.jsxs("tr",{children:[a.jsx("td",{className:"skillcenter-table__skill",children:a.jsxs("button",{type:"button",onClick:()=>void Dn(Be),children:[a.jsxs("span",{className:"skillcenter-table__title-row",children:[a.jsx("strong",{title:Be.skillName,children:Be.skillName}),Be.version?a.jsx("span",{className:"skillcenter-table__version-badge",children:Be.sourceVersion||Be.version}):null]}),a.jsx("span",{className:"skillcenter-table__description",children:$Fe(Be.skillDescription,u)}),_.isShared&&Be.author?a.jsx("span",{className:"skillcenter-table__author",children:u("skillCenter.authorName",{name:Be.author})}):null]})}),a.jsx("td",{children:a.jsxs("div",{className:"skillcenter-review-status",children:[a.jsx("span",{className:`skillcenter-status ${B9t(Be.skillStatus)}`,children:LFe(Be.skillStatus,u)}),xt?a.jsx(QT,{status:xt.status}):null,xt!=null&&xt.reviewer||xt!=null&&xt.reviewedBy?a.jsx(QW,{compact:!0,person:xt.reviewer,fallback:xt.reviewedBy}):null]})}),a.jsx("td",{children:a.jsxs("div",{className:"skillcenter-table__actions",children:[a.jsx("button",{type:"button",onClick:()=>void Dn(Be),children:u("common.view")}),!Be.lookupByName&&Be.skillId?a.jsx("button",{type:"button",onClick:()=>Se(Be),children:u("skillCenter.versions.title")}):null,!_.isShared&&!Be.lookupByName&&Be.skillId?a.jsx("button",{type:"button",disabled:A||S!==null||g!==null||xt!==void 0&&xt.status!=="returned",onClick:()=>void nt(Be),children:g===`${_.region}:${_.id}:${Be.skillId}:${Be.version}`?u("skillCenter.reviewSubmitting"):u(xt?{pending:"skillCenter.reviewPending",approving:"skillCenter.reviewApproving",approved:"skillCenter.reviewApproved",returned:"skillCenter.reviewRetry"}[xt.status]:"skillCenter.requestPublication")}):null,v.some(zt=>zt.sourceSkillId===Be.skillId)?a.jsx("button",{type:"button",onClick:()=>k(Be),children:u("skillCenter.reviewHistory")}):null,_.isShared?null:a.jsx(bP,{disabled:!(Ce!=null&&Ce.enabled),children:a.jsx("button",{type:"button",disabled:!(Ce!=null&&Ce.enabled),onClick:()=>Fn(Be),children:u("skillCenter.optimize")})}),!Be.lookupByName&&bt?a.jsx("button",{type:"button",className:"is-danger",disabled:He===Be.skillId,onClick:()=>void Kn(Be),children:He===Be.skillId?u("common.deleting"):u("common.delete")}):null]})})]},`${Ey(Be)}:${Be.version}`)})})]})}),!Y.trim()&&!J&&!W&&Z>0?a.jsx(W9t,{page:q,total:Z,pageSize:dae,onPage:U}):null]})]})}],activeSectionKey:de,navigationLabel:u("skillCenter.spaceDetails"),onSectionChange:Be=>ee(Be),actionsClassName:"skillcenter-toolbar-actions",actions:a.jsxs(a.Fragment,{children:[_.isShared?null:a.jsxs(a.Fragment,{children:[a.jsx(Tt,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>oe(_),children:u("skillCenter.editSpace")}),a.jsx(Tt,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,disabled:je===hu(_),onClick:()=>void Rn(_),children:je===hu(_)?u("common.deleting"):u("skillCenter.deleteSpace")})]}),bt?a.jsx(Tt,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>St(_),children:u("skillCenter.localUpload")}):null,_.isShared?null:a.jsx(bP,{disabled:!(Ce!=null&&Ce.enabled),children:a.jsxs(Tt,{type:"button",color:"primary",size:"lg",pill:!1,disabled:!(Ce!=null&&Ce.enabled),onClick:()=>qe({operation:"create"}),children:[a.jsx(Lje,{"aria-hidden":"true"}),a.jsx("span",{children:u("skillCenter.createSkill")})]})})]})}):a.jsxs(a.Fragment,{children:[a.jsxs(ib,{className:"skillcenter-list-toolbar library-resource-toolbar",children:[l,a.jsxs("div",{className:"resource-toolbar__actions",children:[c,a.jsx(em,{"aria-label":u("skillCenter.searchSpaces"),value:I,onChange:Be=>D(Be.target.value),placeholder:u("skillCenter.searchSpaces")})]})]}),_t?a.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:a.jsx(Rs,{error:_t})}):null,a.jsxs(tm,{className:"skillcenter-list-results",ref:tt,"aria-label":u("skillCenter.spaceList"),onScroll:Qn,children:[Je.length>0&&!hn?a.jsx(pae,{errors:Je,cloudProvider:e,onRetry:()=>Dt(Be=>Be+1)}):null,a.jsxs(zv,{children:[a.jsx(I9t,{region:t,active:n,revision:Nt+i,onOpen:_n},`${e}:${t}`),I.trim()?null:a.jsx(ab,{"aria-label":u("skillCenter.createSpace"),icon:a.jsx(H9t,{}),onClick:()=>Ge(!0),children:u("skillCenter.newSpace")}),an.map(Be=>{const xt=hu(Be);return a.jsx(Hv,{className:"skillcenter-space-card",title:Nc(Be),description:Be.description||u("common.noDescription"),metadata:[{label:u("skillCenter.skillCount"),value:u("skillCenter.skillCountValue",{count:Be.skillCount??0})},{label:u("skillCenter.updatedAt"),value:zT(Be.updatedAt,Date.now(),d.resolvedLanguage??d.language)}],action:{label:u("skillCenter.addSkill"),icon:"plus",onClick:()=>Ae(Be)},detailAction:{label:u("common.viewDetails"),onClick:()=>_n(Be)}},xt)})]}),N&&h.length===0?a.jsx(fl,{}):hn&&h.length===0?a.jsx(pae,{errors:Je,cloudProvider:e,fullPage:!0,onRetry:()=>Dt(Be=>Be+1)}):an.length===0&&I.trim()?a.jsx(q$,{kind:"empty",title:u("skillCenter.noMatchingSpaces"),description:u("skillCenter.tryAnotherName")}):null,!hn&&h.length>0?a.jsx("div",{className:"my-agent-load-more",ref:At,"aria-live":"polite",children:N?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:u("skillCenter.loadingMoreSpaces")})]}):lt?a.jsx("span",{children:u("skillCenter.scrollForMore")}):Je.length>0?a.jsx("span",{children:u("skillCenter.someSpacesFailed")}):a.jsx("span",{children:u("skillCenter.allSpacesLoaded")})}):null]})]}),ge&&_?a.jsx(R9t,{skill:ge,space:_,region:cn,reviews:v.filter(Be=>Be.sourceSkillId===ge.skillId),onClose:()=>Se(null),onChanged:()=>$t(Be=>Be+1),onSubmitReview:!_.isShared&&!A&&!S?Be=>nt(ge,Be,!0):void 0},`${cn}:${_.id}:${ge.skillId}`):null,x?a.jsx(N9t,{name:x.skillName,applications:v.filter(Be=>Be.sourceSkillId===x.skillId),onClose:()=>k(null)}):null,Oe&&_&&a.jsx(G9t,{skill:Oe,space:_,region:cn,cloudProvider:e,detail:xe,files:Ue,loading:Me,error:ue,reviews:v.filter(Be=>Be.sourceSkillId===Oe.skillId),reviewsLoading:A,reviewsError:S,canOptimize:!_.isShared&&(Ce==null?void 0:Ce.enabled)===!0,onOptimize:()=>Fn(Oe),onDownload:()=>void Hpt({spaceId:_.id,skillId:Ey(Oe),version:Oe.version,region:cn,fallbackName:Oe.skillName,skillSpaceName:_.name,skillName:Oe.skillName}).catch(Be=>be(Lr(Be,u("skillCenter.errors.downloadSkill")))),onClose:Nn}),Ve?a.jsx(P9t,{region:t,regionOptions:Pu(e),onClose:()=>Ge(!1),onCreated:Be=>{Ge(!1),Dt(xt=>xt+1),L({...Be,region:Be.region||t})}}):null,ye?a.jsx(D9t,{space:ye,region:ye.region||nr(e),onClose:()=>oe(null),onUpdated:Be=>{const xt={...Be,region:Be.region||ye.region||nr(e)};oe(null),L(zt=>zt&&hu(zt)===hu(xt)?xt:zt),m(zt=>zt.map(jn=>hu(jn)===hu(xt)?xt:jn)),Dt(zt=>zt+1)}}):null,ie?a.jsx(X9t,{space:ie,canUseSandbox:(Ce==null?void 0:Ce.enabled)===!0,onClose:()=>Ae(null),onUpload:()=>{St(ie),Ae(null)},onSandbox:()=>{const Be=ie;Ae(null),_n(Be),qe({operation:"create"})}}):null,Re?a.jsx(M9t,{space:Re,region:Re.region||nr(e),onClose:()=>St(null),onUploaded:()=>{St(null),$t(Be=>Be+1),Dt(Be=>Be+1)}}):null]})}function Z9t(e){return[{id:"skills",label:e("library.tabs.skills"),panelId:"library-skills-panel"},{id:"knowledge",label:e("library.tabs.knowledge"),panelId:"library-knowledge-panel"},{id:"artifacts",label:e("library.tabs.artifacts"),panelId:"library-artifacts-panel"}]}function J9t({cloudProvider:e,studioRegion:t="",activeTab:n,onTabChange:i,onPageTitleChange:r,skillInitialWorkspace:s=null,onSkillInitialWorkspaceConsumed:o,artifactSources:l=[],artifactUserId:c="",onArtifactActivate:u,onArtifactSourceOpen:d}){const{t:f,i18n:h}=_e("workspaceTools"),m=p.useMemo(()=>Z9t(f),[f]),g=f("library.tabs.skills"),b=ED(t)?t:nr(e),[v,y]=p.useState(b),[w,x]=p.useState(g),k=p.useRef(g),[S,O]=p.useState(!1),[A,E]=p.useState(()=>new Set(["skills",n])),[j,T]=p.useState({skills:0,knowledge:0,artifacts:0}),R=p.useRef(u),[C,N]=p.useState([]),[P,I]=p.useState(!1),[D,_]=p.useState(""),L=p.useMemo(()=>{const ne=ubt(l,f("library.untitledSession"));return{key:JSON.stringify(ne),candidates:ne}},[l,f]),F=p.useRef(L);F.current.key!==L.key&&(F.current=L);const M=F.current.candidates,H=p.useMemo(()=>Pu(e),[e]);p.useEffect(()=>{y(b)},[b]),p.useEffect(()=>{const ne=k.current;x(W=>W===ne?g:W),k.current=g},[g]),p.useEffect(()=>{R.current=u},[u]),p.useEffect(()=>{E(ne=>{if(ne.has(n))return ne;const W=new Set(ne);return W.add(n),W})},[n]),p.useEffect(()=>{var W;const ne=n==="skills"?w:((W=m.find(X=>X.id===n))==null?void 0:W.label)||f("library.title");r==null||r(ne)},[n,r,w,f,m]),p.useEffect(()=>{var ne;n==="artifacts"&&((ne=R.current)==null||ne.call(R))},[n,j.artifacts]);const q=p.useCallback(async()=>{I(!0),_("");try{N(await vbt(M))}catch(ne){_(ne instanceof Error?ne.message:String(ne))}finally{I(!1)}},[M]);p.useEffect(()=>{n==="artifacts"&&q()},[n,j.artifacts,q]);const U=ne=>{E(W=>{if(W.has(ne))return W;const X=new Set(W);return X.add(ne),X}),T(W=>({...W,[ne]:W[ne]+1})),i(ne)},Z=a.jsx(rb,{idPrefix:"library",ariaLabel:f("library.categoryAria"),value:n,items:m,onChange:U}),z=ne=>a.jsx(sb,{id:ne,ariaLabel:f("library.regionAria"),value:v,options:H,onChange:y}),J=n==="skills"?w!==g:n==="knowledge"&&S;return a.jsxs(Ch,{className:`library-view${J?" is-detail":""}`,"aria-label":f("library.title"),children:[J?null:a.jsx(Qv,{className:"library-view__header",title:f("library.title")}),a.jsxs("div",{className:"library-panels",children:[A.has("skills")?a.jsx("div",{id:"library-skills-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-skills-tab",hidden:n!=="skills",children:a.jsx(Y9t,{cloudProvider:e,region:v,active:n==="skills",activationRevision:j.skills,onPageTitleChange:x,initialWorkspace:s,onInitialWorkspaceConsumed:o,toolbarLeading:Z,toolbarFilters:z("library-skills-region-filter")})}):null,A.has("knowledge")?a.jsx("div",{id:"library-knowledge-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-knowledge-tab",hidden:n!=="knowledge",children:a.jsx(f2t,{cloudProvider:e,region:v,active:n==="knowledge",activationRevision:j.knowledge,onDetailChange:O,toolbarLeading:Z,toolbarFilters:z("library-knowledge-region-filter")})}):null,A.has("artifacts")?a.jsx("div",{id:"library-artifacts-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-artifacts-tab",hidden:n!=="artifacts",children:a.jsx(gbt,{items:C,region:v,userId:c,active:n==="artifacts",activationRevision:j.artifacts,loading:P,error:D?_o(D,h.resolvedLanguage||h.language)||f("artifactLibrary.loadDetailFallback"):"",onRetry:()=>void q(),onEdit:xbt,onDelete:wbt,onDownload:kbt,onOpenSource:d?ne=>d(ne.appName,ne.sessionId):void 0,toolbarLeading:Z,toolbarFilters:z("library-artifacts-region-filter")})}):null]})]})}const FFe="veadk_agentkit_connections",e7t=3e3,mae=6e4;function nf(){try{const e=localStorage.getItem(FFe);return(e?JSON.parse(e):[]).filter(n=>!n.runtimeId||!!n.region)}catch{return[]}}function fL(e){try{localStorage.setItem(FFe,JSON.stringify(e))}catch{}}function pf(e,t){return`agentkit:${e}:${t}`}function BFe(e){try{return new URL(e).host}catch{return e}}function kk(e){ZAe();for(const t of e)if(!(t.runtimeId&&!t.region))for(const n of t.apps)YAe(pf(t.id,n),t.runtimeId?{app:n,runtimeId:t.runtimeId,mpaInstanceId:t.mpaInstanceId,region:t.region,agentCategory:t.agentCategory}:{app:n,base:t.base,apiKey:t.apiKey})}function UFe(e,t,n,i,r,s,o,l){const c=nf(),u=c.findIndex(h=>h.runtimeId===e),d=u===-1?void 0:c[u],f={id:`rt_${e}`,name:t||e,runtimeId:e,region:n,apps:i,appLabels:r,currentVersion:s,agentCategory:o??(d==null?void 0:d.agentCategory),mpaInstanceId:(l==null?void 0:l.trim())||(d==null?void 0:d.mpaInstanceId)};return u===-1?c.push(f):c[u]=f,fL(c),kk(c),f}async function t7t(e,t,n,i,r,s,o){let l=null,c=n||"cn-beijing",u=null;for(const m of UA(n))try{const g=await Xw(e,m,{retryProbe:!0,preferCached:!0,currentVersion:i});if(g&&g.length>0){await C2e(e,m),l=g,c=m;break}}catch(g){if(g instanceof V1)throw yP(e),g;if(g instanceof Ea&&g.unsupported){u=g;continue}throw g}if(!l||l.length===0)throw yP(e),u||new Ea(Q("connections.runtimeUnsupported"),!0,!0);const d=(r==null?void 0:r.trim())||l[0],f=Object.fromEntries(l.map(m=>[m,m===l[0]?d:m])),h=UFe(e,t,c,l,f,i,s,o);return pf(h.id,l[0])}function n7t(e){return new Promise(t=>window.setTimeout(t,e))}async function XN(e,t,n,i,r={}){const s=Date.now();for(;;)try{return await t7t(e,t,n,i,r.agentName,r.agentCategory,r.mpaInstanceId)}catch(o){const l=Date.now()-s;if(!r.waitForReady||!(o instanceof Ea)||!o.retryable||l>=mae)throw o;const c=Math.min(e7t,mae-l);await n7t(c)}}async function QFe(e,t,n,i){const r=t.trim().replace(/\/+$/,""),s=await QA(r,n.trim()),o={id:Date.now().toString(36),name:e.trim()||BFe(r),base:r,apiKey:n.trim(),apps:s,appLabels:i&&s.length>0?{[s[0]]:i}:void 0},l=[...nf().filter(c=>c.base!==r),o];return fL(l),kk(l),o}function i7t(e){const t=nf().filter(n=>n.id!==e);return fL(t),kk(t),t}function yP(e){const t=nf().filter(n=>n.runtimeId!==e);return fL(t),kk(t),t}function zFe(e,t){const n=e.map(r=>({id:r,label:r,app:r,remote:!1})),i=t.flatMap(r=>r.apps.map(s=>{var l;const o=((l=r.appLabels)==null?void 0:l[s])??s;return{id:pf(r.id,s),label:o,app:s,remote:!0,host:r.runtimeId?r.name:BFe(r.base??""),runtimeId:r.runtimeId,region:r.region,currentVersion:r.currentVersion,agentCategory:r.agentCategory,mpaInstanceId:r.mpaInstanceId}}));return[...n,...i]}const gae=Object.freeze(Object.defineProperty({__proto__:null,addConnection:QFe,addRuntimeConnection:UFe,buildAgentEntries:zFe,connectRuntime:XN,loadConnections:nf,registerConnections:kk,remoteAppId:pf,removeConnection:i7t,removeRuntimeConnection:yP},Symbol.toStringTag,{value:"Module"}));function r7t({onAdded:e,onCancel:t}){const{t:n}=_e("conversation"),[i,r]=p.useState(""),[s,o]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(!1),[f,h]=p.useState(""),m=i.trim().length>0&&s.trim().length>0&&!u;async function g(){if(m){d(!0),h("");try{const b=await QFe(l,i,s,l);if(b.apps.length===0){h(n("addAgentKit.noAgents")),d(!1);return}e(pf(b.id,b.apps[0]))}catch(b){h(n("addAgentKit.connectionFailed",{error:String(b)})),d(!1)}}}return a.jsx("div",{className:"addagent",children:a.jsxs("div",{className:"addagent-card",children:[a.jsx("h2",{className:"addagent-title",children:n("addAgentKit.title")}),a.jsx("p",{className:"addagent-sub",children:n("addAgentKit.description")}),a.jsxs("label",{className:"addagent-field",children:[a.jsx("span",{className:"addagent-label",children:n("addAgentKit.url")}),a.jsx("input",{className:"addagent-input",value:i,onChange:b=>r(b.target.value),placeholder:"https://xxxxx.apigateway-cn-beijing.volceapi.com",autoFocus:!0})]}),a.jsxs("label",{className:"addagent-field",children:[a.jsx("span",{className:"addagent-label",children:"API Key"}),a.jsx("input",{className:"addagent-input",type:"password",value:s,onChange:b=>o(b.target.value),placeholder:n("addAgentKit.apiKeyHint")})]}),a.jsxs("label",{className:"addagent-field",children:[a.jsx("span",{className:"addagent-label",children:n("addAgentKit.displayName")}),a.jsx("input",{className:"addagent-input",value:l,onChange:b=>c(b.target.value),placeholder:n("addAgentKit.displayNameHint")})]}),f&&a.jsx("div",{className:"addagent-error",children:f}),a.jsxs("div",{className:"addagent-actions",children:[a.jsx("button",{className:"addagent-btn addagent-btn--ghost",onClick:t,disabled:u,children:n("addAgentKit.cancel")}),a.jsxs("button",{className:"addagent-btn addagent-btn--primary",onClick:g,disabled:!m,children:[u?a.jsx(Vi,{className:"icon spin"}):null,n(u?"addAgentKit.connecting":"addAgentKit.connect")]})]})]})})}const s7t=/[\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff]/u,a7t={"deploy.build.logs_syncing":"client.deploymentProgress.buildLogsSyncing","deploy.build.logs_complete":"client.deploymentProgress.buildLogsComplete","deploy.build.failed_logs_synced":"client.deploymentProgress.buildFailedLogsSynced","deploy.build.logs_unavailable":"client.deploymentProgress.buildLogsUnavailable","deploy.build.final_logs_unavailable":"client.deploymentProgress.finalBuildLogsUnavailable"},o7t={prepare:"client.deploymentProgress.preparing",upload:"client.deploymentProgress.uploading",build:"client.deploymentProgress.building",deploy:"client.deploymentProgress.deploying",publish:"client.deploymentProgress.publishing",evaluation:"client.deploymentProgress.evaluating",update:"client.deploymentProgress.updating",profile_applying:"client.deploymentProgress.applyingMpaProfile",smoke_running:"client.deploymentProgress.runningMpaSmoke",runnable:"client.deploymentProgress.mpaReady",complete:"client.deploymentProgress.completing",github:"client.deploymentProgress.github"};function hL(e){var r,s;const t=((r=e.message)==null?void 0:r.trim())??"",n=e.messageCode?a7t[e.messageCode]:void 0;if(n)return Q(n);if(t&&(j8().toLowerCase()==="zh-cn"||!s7t.test(t)))return t;if(e.phase==="build"&&((s=e.buildLog)!=null&&s.status)){const o={running:"client.deploymentProgress.buildLogsSyncing",complete:"client.deploymentProgress.buildLogsComplete",error:"client.deploymentProgress.buildLogsUnavailable"}[e.buildLog.status];if(o)return Q(o)}const i=e.phase?o7t[e.phase]:void 0;return i?Q(i):t||Q("client.deploymentProgress.inProgress")}function no(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,i;n{}};function pL(){for(var e=0,t=arguments.length,n={},i;e=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}YN.prototype=pL.prototype={constructor:YN,on:function(e,t){var n=this._,i=c7t(e+"",n),r,s=-1,o=i.length;if(arguments.length<2){for(;++s0)for(var n=new Array(r),i=0,r,s;i=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),yae.hasOwnProperty(t)?{space:yae[t],local:e}:e}function d7t(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===A7&&t.documentElement.namespaceURI===A7?t.createElement(e):t.createElementNS(n,e)}}function f7t(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function VFe(e){var t=mL(e);return(t.local?f7t:d7t)(t)}function h7t(){}function qW(e){return e==null?h7t:function(){return this.querySelector(e)}}function p7t(e){typeof e!="function"&&(e=qW(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r=x&&(x=w+1);!(S=v[x])&&++x=0;)(o=i[r])&&(s&&o.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(o,s),s=o);return this}function F7t(e){e||(e=B7t);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,i=n.length,r=new Array(i),s=0;st?1:e>=t?0:NaN}function U7t(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Q7t(){return Array.from(this)}function z7t(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?eUt:typeof t=="function"?nUt:tUt)(e,t,n??"")):O1(this.node(),e)}function O1(e,t){return e.style.getPropertyValue(t)||GFe(e).getComputedStyle(e,null).getPropertyValue(t)}function rUt(e){return function(){delete this[e]}}function sUt(e,t){return function(){this[e]=t}}function aUt(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function oUt(e,t){return arguments.length>1?this.each((t==null?rUt:typeof t=="function"?aUt:sUt)(e,t)):this.node()[e]}function XFe(e){return e.trim().split(/^|\s+/)}function WW(e){return e.classList||new YFe(e)}function YFe(e){this._node=e,this._names=XFe(e.getAttribute("class")||"")}YFe.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 ZFe(e,t){for(var n=WW(e),i=-1,r=t.length;++i=0&&(n=t.slice(i+1),t=t.slice(0,i)),{type:t,name:n}})}function DUt(e){return function(){var t=this.__on;if(t){for(var n=0,i=-1,r=t.length,s;n()=>e;function T7(e,{sourceEvent:t,subject:n,target:i,identifier:r,active:s,x:o,y:l,dx:c,dy:u,dispatch:d}){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:i,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}T7.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function HUt(e){return!e.ctrlKey&&!e.button}function qUt(){return this.parentNode}function WUt(e,t){return t??{x:e.x,y:e.y}}function KUt(){return navigator.maxTouchPoints||"ontouchstart"in this}function r8e(){var e=HUt,t=qUt,n=WUt,i=KUt,r={},s=pL("start","drag","end"),o=0,l,c,u,d,f=0;function h(k){k.on("mousedown.drag",m).filter(i).on("touchstart.drag",v).on("touchmove.drag",y,VUt).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(k,S){if(!(d||!e.call(this,k,S))){var O=x(this,t.call(this,k,S),k,S,"mouse");O&&(Su(k.view).on("mousemove.drag",g,sA).on("mouseup.drag",b,sA),n8e(k.view),W$(k),u=!1,l=k.clientX,c=k.clientY,O("start",k))}}function g(k){if(Aw(k),!u){var S=k.clientX-l,O=k.clientY-c;u=S*S+O*O>f}r.mouse("drag",k)}function b(k){Su(k.view).on("mousemove.drag mouseup.drag",null),i8e(k.view,u),Aw(k),r.mouse("end",k)}function v(k,S){if(e.call(this,k,S)){var O=k.changedTouches,A=t.call(this,k,S),E=O.length,j,T;for(j=0;j>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?fj(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?fj(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=XUt.exec(e))?new Pc(t[1],t[2],t[3],1):(t=YUt.exec(e))?new Pc(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=ZUt.exec(e))?fj(t[1],t[2],t[3],t[4]):(t=JUt.exec(e))?fj(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=eQt.exec(e))?Eae(t[1],t[2]/100,t[3]/100,1):(t=tQt.exec(e))?Eae(t[1],t[2]/100,t[3]/100,t[4]):vae.hasOwnProperty(e)?kae(vae[e]):e==="transparent"?new Pc(NaN,NaN,NaN,0):null}function kae(e){return new Pc(e>>16&255,e>>8&255,e&255,1)}function fj(e,t,n,i){return i<=0&&(e=t=n=NaN),new Pc(e,t,n,i)}function rQt(e){return e instanceof HT||(e=Ov(e)),e?(e=e.rgb(),new Pc(e.r,e.g,e.b,e.opacity)):new Pc}function _7(e,t,n,i){return arguments.length===1?rQt(e):new Pc(e,t,n,i??1)}function Pc(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}KW(Pc,_7,s8e(HT,{brighter(e){return e=e==null?xP:Math.pow(xP,e),new Pc(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?aA:Math.pow(aA,e),new Pc(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Pc(Xy(this.r),Xy(this.g),Xy(this.b),wP(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:Oae,formatHex:Oae,formatHex8:sQt,formatRgb:Sae,toString:Sae}));function Oae(){return`#${Iy(this.r)}${Iy(this.g)}${Iy(this.b)}`}function sQt(){return`#${Iy(this.r)}${Iy(this.g)}${Iy(this.b)}${Iy((isNaN(this.opacity)?1:this.opacity)*255)}`}function Sae(){const e=wP(this.opacity);return`${e===1?"rgb(":"rgba("}${Xy(this.r)}, ${Xy(this.g)}, ${Xy(this.b)}${e===1?")":`, ${e})`}`}function wP(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Xy(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Iy(e){return e=Xy(e),(e<16?"0":"")+e.toString(16)}function Eae(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new af(e,t,n,i)}function a8e(e){if(e instanceof af)return new af(e.h,e.s,e.l,e.opacity);if(e instanceof HT||(e=Ov(e)),!e)return new af;if(e instanceof af)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),s=Math.max(t,n,i),o=NaN,l=s-r,c=(s+r)/2;return l?(t===s?o=(n-i)/l+(n0&&c<1?0:o,new af(o,l,c,e.opacity)}function aQt(e,t,n,i){return arguments.length===1?a8e(e):new af(e,t,n,i??1)}function af(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}KW(af,aQt,s8e(HT,{brighter(e){return e=e==null?xP:Math.pow(xP,e),new af(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?aA:Math.pow(aA,e),new af(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,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new Pc(K$(e>=240?e-240:e+120,r,i),K$(e,r,i),K$(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new af(Cae(this.h),hj(this.s),hj(this.l),wP(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=wP(this.opacity);return`${e===1?"hsl(":"hsla("}${Cae(this.h)}, ${hj(this.s)*100}%, ${hj(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Cae(e){return e=(e||0)%360,e<0?e+360:e}function hj(e){return Math.max(0,Math.min(1,e||0))}function K$(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 gL=e=>()=>e;function o8e(e,t){return function(n){return e+n*t}}function oQt(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function Yhn(e,t){var n=t-e;return n?o8e(e,n>180||n<-180?n-360*Math.round(n/360):n):gL(isNaN(e)?t:e)}function lQt(e){return(e=+e)==1?l8e:function(t,n){return n-t?oQt(t,n,e):gL(isNaN(t)?n:t)}}function l8e(e,t){var n=t-e;return n?o8e(e,n):gL(isNaN(e)?t:e)}const kP=function e(t){var n=lQt(t);function i(r,s){var o=n((r=_7(r)).r,(s=_7(s)).r),l=n(r.g,s.g),c=n(r.b,s.b),u=l8e(r.opacity,s.opacity);return function(d){return r.r=o(d),r.g=l(d),r.b=c(d),r.opacity=u(d),r+""}}return i.gamma=e,i}(1);function cQt(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,i=t.slice(),r;return function(s){for(r=0;rn&&(s=t.slice(n,s),l[o]?l[o]+=s:l[++o]=s),(i=i[0])===(r=r[0])?l[o]?l[o]+=r:l[++o]=r:(l[++o]=null,c.push({i:o,x:Yf(i,r)})),n=G$.lastIndex;return n180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(r(f)+"rotate(",null,i)-2,x:Yf(u,d)})):d&&f.push(r(f)+"rotate("+d+i)}function l(u,d,f,h){u!==d?h.push({i:f.push(r(f)+"skewX(",null,i)-2,x:Yf(u,d)}):d&&f.push(r(f)+"skewX("+d+i)}function c(u,d,f,h,m,g){if(u!==f||d!==h){var b=m.push(r(m)+"scale(",null,",",null,")");g.push({i:b-4,x:Yf(u,f)},{i:b-2,x:Yf(d,h)})}else(f!==1||h!==1)&&m.push(r(m)+"scale("+f+","+h+")")}return function(u,d){var f=[],h=[];return u=e(u),d=e(d),s(u.translateX,u.translateY,d.translateX,d.translateY,f,h),o(u.rotate,d.rotate,f,h),l(u.skewX,d.skewX,f,h),c(u.scaleX,u.scaleY,d.scaleX,d.scaleY,f,h),u=d=null,function(m){for(var g=-1,b=h.length,v;++g=0&&e._call.call(void 0,t),e=e._next;--S1}function _ae(){Sv=(SP=lA.now())+bL,S1=SS=0;try{SQt()}finally{S1=0,CQt(),Sv=0}}function EQt(){var e=lA.now(),t=e-SP;t>f8e&&(bL-=t,SP=e)}function CQt(){for(var e,t=OP,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:OP=n);ES=e,R7(i)}function R7(e){if(!S1){SS&&(SS=clearTimeout(SS));var t=e-Sv;t>24?(e<1/0&&(SS=setTimeout(_ae,e-lA.now()-bL)),IO&&(IO=clearInterval(IO))):(IO||(SP=lA.now(),IO=setInterval(EQt,f8e)),S1=1,h8e(_ae))}}function jae(e,t,n){var i=new EP;return t=t==null?0:+t,i.restart(r=>{i.stop(),e(r+t)},t,n),i}var AQt=pL("start","end","cancel","interrupt"),TQt=[],m8e=0,Nae=1,I7=2,JN=3,Rae=4,P7=5,eR=6;function yL(e,t,n,i,r,s){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;_Qt(e,n,{name:t,index:i,group:r,on:AQt,tween:TQt,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:m8e})}function XW(e,t){var n=Nf(e,t);if(n.state>m8e)throw new Error("too late; already scheduled");return n}function Lh(e,t){var n=Nf(e,t);if(n.state>JN)throw new Error("too late; already running");return n}function Nf(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function _Qt(e,t,n){var i=e.__transition,r;i[t]=n,n.timer=p8e(s,0,n.time);function s(u){n.state=Nae,n.timer.restart(o,n.delay,n.time),n.delay<=u&&o(u-n.delay)}function o(u){var d,f,h,m;if(n.state!==Nae)return c();for(d in i)if(m=i[d],m.name===n.name){if(m.state===JN)return jae(o);m.state===Rae?(m.state=eR,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete i[d]):+dI7&&i.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function szt(e,t,n){var i,r,s=rzt(t)?XW:Lh;return function(){var o=s(this,e),l=o.on;l!==i&&(r=(i=l).copy()).on(t,n),o.on=r}}function azt(e,t){var n=this._id;return arguments.length<2?Nf(this.node(),n).on.on(e):this.each(szt(n,e,t))}function ozt(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function lzt(){return this.on("end.remove",ozt(this._id))}function czt(e){var t=this._name,n=this._id;typeof e!="function"&&(e=qW(e));for(var i=this._groups,r=i.length,s=new Array(r),o=0;o()=>e;function Pzt(e,{sourceEvent:t,target:n,transform:i,dispatch:r}){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:i,enumerable:!0,configurable:!0},_:{value:r}})}function Tp(e,t,n){this.k=e,this.x=t,this.y=n}Tp.prototype={constructor:Tp,scale:function(e){return e===1?this:new Tp(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Tp(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 vL=new Tp(1,0,0);v8e.prototype=Tp.prototype;function v8e(e){for(;!e.__zoom;)if(!(e=e.parentNode))return vL;return e.__zoom}function X$(e){e.stopImmediatePropagation()}function PO(e){e.preventDefault(),e.stopImmediatePropagation()}function Dzt(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Mzt(){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 Iae(){return this.__zoom||vL}function Lzt(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function $zt(){return navigator.maxTouchPoints||"ontouchstart"in this}function Fzt(e,t,n){var i=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r),o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o))}function x8e(){var e=Dzt,t=Mzt,n=Fzt,i=Lzt,r=$zt,s=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,c=ZN,u=pL("start","zoom","end"),d,f,h,m=500,g=150,b=0,v=10;function y(P){P.property("__zoom",Iae).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",j).on("dblclick.zoom",T).filter(r).on("touchstart.zoom",R).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(P,I,D,_){var L=P.selection?P.selection():P;L.property("__zoom",Iae),P!==L?S(P,I,D,_):L.interrupt().each(function(){O(this,arguments).event(_).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},y.scaleBy=function(P,I,D,_){y.scaleTo(P,function(){var L=this.__zoom.k,F=typeof I=="function"?I.apply(this,arguments):I;return L*F},D,_)},y.scaleTo=function(P,I,D,_){y.transform(P,function(){var L=t.apply(this,arguments),F=this.__zoom,M=D==null?k(L):typeof D=="function"?D.apply(this,arguments):D,H=F.invert(M),q=typeof I=="function"?I.apply(this,arguments):I;return n(x(w(F,q),M,H),L,o)},D,_)},y.translateBy=function(P,I,D,_){y.transform(P,function(){return n(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),o)},null,_)},y.translateTo=function(P,I,D,_,L){y.transform(P,function(){var F=t.apply(this,arguments),M=this.__zoom,H=_==null?k(F):typeof _=="function"?_.apply(this,arguments):_;return n(vL.translate(H[0],H[1]).scale(M.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof D=="function"?-D.apply(this,arguments):-D),F,o)},_,L)};function w(P,I){return I=Math.max(s[0],Math.min(s[1],I)),I===P.k?P:new Tp(I,P.x,P.y)}function x(P,I,D){var _=I[0]-D[0]*P.k,L=I[1]-D[1]*P.k;return _===P.x&&L===P.y?P:new Tp(P.k,_,L)}function k(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function S(P,I,D,_){P.on("start.zoom",function(){O(this,arguments).event(_).start()}).on("interrupt.zoom end.zoom",function(){O(this,arguments).event(_).end()}).tween("zoom",function(){var L=this,F=arguments,M=O(L,F).event(_),H=t.apply(L,F),q=D==null?k(H):typeof D=="function"?D.apply(L,F):D,U=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),Z=L.__zoom,z=typeof I=="function"?I.apply(L,F):I,J=c(Z.invert(q).concat(U/Z.k),z.invert(q).concat(U/z.k));return function(ne){if(ne===1)ne=z;else{var W=J(ne),X=U/W[2];ne=new Tp(X,q[0]-W[0]*X,q[1]-W[1]*X)}M.zoom(null,ne)}})}function O(P,I,D){return!D&&P.__zooming||new A(P,I)}function A(P,I){this.that=P,this.args=I,this.active=0,this.sourceEvent=null,this.extent=t.apply(P,I),this.taps=0}A.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,I){return this.mouse&&P!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&P!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(P){var I=Su(this.that).datum();u.call(P,this.that,new Pzt(P,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:u}),I)}};function E(P,...I){if(!e.apply(this,arguments))return;var D=O(this,I).event(P),_=this.__zoom,L=Math.max(s[0],Math.min(s[1],_.k*Math.pow(2,i.apply(this,arguments)))),F=Jd(P);if(D.wheel)(D.mouse[0][0]!==F[0]||D.mouse[0][1]!==F[1])&&(D.mouse[1]=_.invert(D.mouse[0]=F)),clearTimeout(D.wheel);else{if(_.k===L)return;D.mouse=[F,_.invert(F)],tR(this),D.start()}PO(P),D.wheel=setTimeout(M,g),D.zoom("mouse",n(x(w(_,L),D.mouse[0],D.mouse[1]),D.extent,o));function M(){D.wheel=null,D.end()}}function j(P,...I){if(h||!e.apply(this,arguments))return;var D=P.currentTarget,_=O(this,I,!0).event(P),L=Su(P.view).on("mousemove.zoom",q,!0).on("mouseup.zoom",U,!0),F=Jd(P,D),M=P.clientX,H=P.clientY;n8e(P.view),X$(P),_.mouse=[F,this.__zoom.invert(F)],tR(this),_.start();function q(Z){if(PO(Z),!_.moved){var z=Z.clientX-M,J=Z.clientY-H;_.moved=z*z+J*J>b}_.event(Z).zoom("mouse",n(x(_.that.__zoom,_.mouse[0]=Jd(Z,D),_.mouse[1]),_.extent,o))}function U(Z){L.on("mousemove.zoom mouseup.zoom",null),i8e(Z.view,_.moved),PO(Z),_.event(Z).end()}}function T(P,...I){if(e.apply(this,arguments)){var D=this.__zoom,_=Jd(P.changedTouches?P.changedTouches[0]:P,this),L=D.invert(_),F=D.k*(P.shiftKey?.5:2),M=n(x(w(D,F),_,L),t.apply(this,I),o);PO(P),l>0?Su(this).transition().duration(l).call(S,M,_,P):Su(this).call(y.transform,M,_,P)}}function R(P,...I){if(e.apply(this,arguments)){var D=P.touches,_=D.length,L=O(this,I,P.changedTouches.length===_).event(P),F,M,H,q;for(X$(P),M=0;M<_;++M)H=D[M],q=Jd(H,this),q=[q,this.__zoom.invert(q),H.identifier],L.touch0?!L.touch1&&L.touch0[2]!==q[2]&&(L.touch1=q,L.taps=0):(L.touch0=q,F=!0,L.taps=1+!!d);d&&(d=clearTimeout(d)),F&&(L.taps<2&&(f=q[0],d=setTimeout(function(){d=null},m)),tR(this),L.start())}}function C(P,...I){if(this.__zooming){var D=O(this,I).event(P),_=P.changedTouches,L=_.length,F,M,H,q;for(PO(P),F=0;F`Seems like you have not used zustand provider 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:i})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:i}", 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.`},cA=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],w8e=["Enter"," ","Escape"],k8e={"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 E1;(function(e){e.Strict="strict",e.Loose="loose"})(E1||(E1={}));var Yy;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Yy||(Yy={}));var uA;(function(e){e.Partial="partial",e.Full="full"})(uA||(uA={}));const O8e={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var og;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(og||(og={}));var dA;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(dA||(dA={}));var vn;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(vn||(vn={}));const Pae={[vn.Left]:vn.Right,[vn.Right]:vn.Left,[vn.Top]:vn.Bottom,[vn.Bottom]:vn.Top};function S8e(e){return e===null?null:e?"valid":"invalid"}const E8e=e=>"id"in e&&"source"in e&&"target"in e,Bzt=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),ZW=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),qT=(e,t=[0,0])=>{const{width:n,height:i}=km(e),r=e.origin??t,s=n*r[0],o=i*r[1];return{x:e.position.x-s,y:e.position.y-o}},Uzt=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((i,r)=>{const s=typeof r=="string";let o=!t.nodeLookup&&!s?r:void 0;t.nodeLookup&&(o=s?t.nodeLookup.get(r):ZW(r)?r:t.nodeLookup.get(r.id));const l=o?CP(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return xL(i,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return wL(n)},WT=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},i=!1;return e.forEach(r=>{(t.filter===void 0||t.filter(r))&&(n=xL(n,CP(r)),i=!0)}),i?wL(n):{x:0,y:0,width:0,height:0}},JW=(e,t,[n,i,r]=[0,0,1],s=!1,o=!1)=>{const l={...Ok(t,[n,i,r]),width:t.width/r,height:t.height/r},c=[];for(const u of e.values()){const{measured:d,selectable:f=!0,hidden:h=!1}=u;if(o&&!f||h)continue;const m=d.width??u.width??u.initialWidth??null,g=d.height??u.height??u.initialHeight??null,b=fA(l,A1(u)),v=(m??0)*(g??0),y=s&&b>0;(!u.internals.handleBounds||y||b>=v||u.dragging)&&c.push(u)}return c},Qzt=(e,t)=>{const n=new Set;return e.forEach(i=>{n.add(i.id)}),t.filter(i=>n.has(i.source)||n.has(i.target))};function zzt(e,t){const n=new Map,i=t!=null&&t.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{r.measured.width&&r.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!r.hidden)&&(!i||i.has(r.id))&&n.set(r.id,r)}),n}async function Vzt({nodes:e,width:t,height:n,panZoom:i,minZoom:r,maxZoom:s},o){if(e.size===0)return!0;const l=zzt(e,o),c=WT(l),u=tK(c,t,n,(o==null?void 0:o.minZoom)??r,(o==null?void 0:o.maxZoom)??s,(o==null?void 0:o.padding)??.1);return await i.setViewport(u,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),!0}function C8e({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:i=[0,0],nodeExtent:r,onError:s}){const o=n.get(e),l=o.parentId?n.get(o.parentId):void 0,{x:c,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},d=o.origin??i;let f=o.extent||r;if(o.extent==="parent"&&!o.expandParent)if(!l)s==null||s("005",wf.error005());else{const m=l.measured.width,g=l.measured.height;m&&g&&(f=[[c,u],[c+m,u+g]])}else l&&Cv(o.extent)&&(f=[[o.extent[0][0]+c,o.extent[0][1]+u],[o.extent[1][0]+c,o.extent[1][1]+u]]);const h=Cv(f)?Ev(t,f,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(s==null||s("015",wf.error015())),{position:{x:h.x-c+(o.measured.width??0)*d[0],y:h.y-u+(o.measured.height??0)*d[1]},positionAbsolute:h}}async function Hzt({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:i,onBeforeDelete:r}){const s=new Set(e.map(h=>h.id)),o=[];for(const h of n){if(h.deletable===!1)continue;const m=s.has(h.id),g=!m&&h.parentId&&o.find(b=>b.id===h.parentId);(m||g)&&o.push(h)}const l=new Set(t.map(h=>h.id)),c=i.filter(h=>h.deletable!==!1),d=Qzt(o,c);for(const h of c)l.has(h.id)&&!d.find(g=>g.id===h.id)&&d.push(h);if(!r)return{edges:d,nodes:o};const f=await r({nodes:o,edges:d});return typeof f=="boolean"?f?{edges:d,nodes:o}:{edges:[],nodes:[]}:f}const C1=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ev=(e={x:0,y:0},t,n)=>({x:C1(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:C1(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function A8e(e,t,n){const{width:i,height:r}=km(n),{x:s,y:o}=n.internals.positionAbsolute;return Ev(e,[[s,o],[s+i,o+r]],t)}const Dae=(e,t,n)=>en?-C1(Math.abs(e-n),1,t)/t:0,eK=(e,t,n=15,i=40)=>{const r=Dae(e.x,i,t.width-i)*n,s=Dae(e.y,i,t.height-i)*n;return[r,s]},xL=(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)}),D7=({x:e,y:t,width:n,height:i})=>({x:e,y:t,x2:e+n,y2:t+i}),wL=({x:e,y:t,x2:n,y2:i})=>({x:e,y:t,width:n-e,height:i-t}),A1=(e,t=[0,0])=>{var r,s;const{x:n,y:i}=ZW(e)?e.internals.positionAbsolute:qT(e,t);return{x:n,y:i,width:((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0,height:((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0}},CP=(e,t=[0,0])=>{var r,s;const{x:n,y:i}=ZW(e)?e.internals.positionAbsolute:qT(e,t);return{x:n,y:i,x2:n+(((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0),y2:i+(((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0)}},T8e=(e,t)=>wL(xL(D7(e),D7(t))),fA=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),i=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*i)},Mae=e=>lf(e.width)&&lf(e.height)&&lf(e.x)&&lf(e.y),lf=e=>!isNaN(e)&&isFinite(e),_8e=(e,t)=>(n,i)=>{},KT=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Ok=({x:e,y:t},[n,i,r],s=!1,o=[1,1])=>{const l={x:(e-n)/r,y:(t-i)/r};return s?KT(l,o):l},T1=({x:e,y:t},[n,i,r])=>({x:e*r+n,y:t*r+i});function W0(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 qzt(e,t,n){if(typeof e=="string"||typeof e=="number"){const i=W0(e,n),r=W0(e,t);return{top:i,right:r,bottom:i,left:r,x:r*2,y:i*2}}if(typeof e=="object"){const i=W0(e.top??e.y??0,n),r=W0(e.bottom??e.y??0,n),s=W0(e.left??e.x??0,t),o=W0(e.right??e.x??0,t);return{top:i,right:o,bottom:r,left:s,x:s+o,y:i+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Wzt(e,t,n,i,r,s){const{x:o,y:l}=T1(e,[t,n,i]),{x:c,y:u}=T1({x:e.x+e.width,y:e.y+e.height},[t,n,i]),d=r-c,f=s-u;return{left:Math.floor(o),top:Math.floor(l),right:Math.floor(d),bottom:Math.floor(f)}}const tK=(e,t,n,i,r,s)=>{const o=qzt(s,t,n),l=(t-o.x)/e.width,c=(n-o.y)/e.height,u=Math.min(l,c),d=C1(u,i,r),f=e.x+e.width/2,h=e.y+e.height/2,m=t/2-f*d,g=n/2-h*d,b=Wzt(e,m,g,d,t,n),v={left:Math.min(b.left-o.left,0),top:Math.min(b.top-o.top,0),right:Math.min(b.right-o.right,0),bottom:Math.min(b.bottom-o.bottom,0)};return{x:m-v.left+v.right,y:g-v.top+v.bottom,zoom:d}},hA=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Cv(e){return e!=null&&e!=="parent"}function km(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 nK(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 j8e(e,t={width:0,height:0},n,i,r){const s={...e},o=i.get(n);if(o){const l=o.origin||r;s.x+=o.internals.positionAbsolute.x-(t.width??0)*l[0],s.y+=o.internals.positionAbsolute.y-(t.height??0)*l[1]}return s}function Lae(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Kzt(){let e,t;return{promise:new Promise((i,r)=>{e=i,t=r}),resolve:e,reject:t}}function Gzt(e){return{...k8e,...e||{}}}function RE(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:i,containerBounds:r}){const{x:s,y:o}=cf(e),l=Ok({x:s-((r==null?void 0:r.left)??0),y:o-((r==null?void 0:r.top)??0)},i),{x:c,y:u}=n?KT(l,t):l;return{xSnapped:c,ySnapped:u,...l}}const iK=e=>({width:e.offsetWidth,height:e.offsetHeight}),N8e=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Xzt=["INPUT","SELECT","TEXTAREA"];function R8e(e){var i,r;const t=((r=(i=e.composedPath)==null?void 0:i.call(e))==null?void 0:r[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:Xzt.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const I8e=e=>"clientX"in e,cf=(e,t)=>{var s,o;const n=I8e(e),i=n?e.clientX:(s=e.touches)==null?void 0:s[0].clientX,r=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:i-((t==null?void 0:t.left)??0),y:r-((t==null?void 0:t.top)??0)}},$ae=(e,t,n,i,r)=>{const s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(o=>{const l=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:r,position:o.getAttribute("data-handlepos"),x:(l.left-n.left)/i,y:(l.top-n.top)/i,...iK(o)}})};function P8e({sourceX:e,sourceY:t,targetX:n,targetY:i,sourceControlX:r,sourceControlY:s,targetControlX:o,targetControlY:l}){const c=e*.125+r*.375+o*.375+n*.125,u=t*.125+s*.375+l*.375+i*.125,d=Math.abs(c-e),f=Math.abs(u-t);return[c,u,d,f]}function gj(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Fae({pos:e,x1:t,y1:n,x2:i,y2:r,c:s}){switch(e){case vn.Left:return[t-gj(t-i,s),n];case vn.Right:return[t+gj(i-t,s),n];case vn.Top:return[t,n-gj(n-r,s)];case vn.Bottom:return[t,n+gj(r-n,s)]}}function D8e({sourceX:e,sourceY:t,sourcePosition:n=vn.Bottom,targetX:i,targetY:r,targetPosition:s=vn.Top,curvature:o=.25}){const[l,c]=Fae({pos:n,x1:e,y1:t,x2:i,y2:r,c:o}),[u,d]=Fae({pos:s,x1:i,y1:r,x2:e,y2:t,c:o}),[f,h,m,g]=P8e({sourceX:e,sourceY:t,targetX:i,targetY:r,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${l},${c} ${u},${d} ${i},${r}`,f,h,m,g]}function M8e({sourceX:e,sourceY:t,targetX:n,targetY:i}){const r=Math.abs(n-e)/2,s=n0}const Jzt=({source:e,sourceHandle:t,target:n,targetHandle:i})=>`xy-edge__${e}${t||""}-${n}${i||""}`,eVt=(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)),tVt=(e,t,n={})=>{var s;if(!e.source||!e.target)return(s=n.onError)==null||s.call(n,"006",wf.error006()),t;const i=n.getEdgeId||Jzt;let r;return E8e(e)?r={...e}:r={...e,id:i(e)},eVt(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function L8e({sourceX:e,sourceY:t,targetX:n,targetY:i}){const[r,s,o,l]=M8e({sourceX:e,sourceY:t,targetX:n,targetY:i});return[`M ${e},${t}L ${n},${i}`,r,s,o,l]}const Bae={[vn.Left]:{x:-1,y:0},[vn.Right]:{x:1,y:0},[vn.Top]:{x:0,y:-1},[vn.Bottom]:{x:0,y:1}},nVt=({source:e,sourcePosition:t=vn.Bottom,target:n})=>t===vn.Left||t===vn.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function iVt({source:e,sourcePosition:t=vn.Bottom,target:n,targetPosition:i=vn.Top,center:r,offset:s,stepPosition:o}){const l=Bae[t],c=Bae[i],u={x:e.x+l.x*s,y:e.y+l.y*s},d={x:n.x+c.x*s,y:n.y+c.y*s},f=nVt({source:u,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",m=f[h];let g=[],b,v;const y={x:0,y:0},w={x:0,y:0},[,,x,k]=M8e({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[h]*c[h]===-1){h==="x"?(b=r.x??u.x+(d.x-u.x)*o,v=r.y??(u.y+d.y)/2):(b=r.x??(u.x+d.x)/2,v=r.y??u.y+(d.y-u.y)*o);const E=[{x:b,y:u.y},{x:b,y:d.y}],j=[{x:u.x,y:v},{x:d.x,y:v}];l[h]===m?g=h==="x"?E:j:g=h==="x"?j:E}else{const E=[{x:u.x,y:d.y}],j=[{x:d.x,y:u.y}];if(h==="x"?g=l.x===m?j:E:g=l.y===m?E:j,t===i){const P=Math.abs(e[h]-n[h]);if(P<=s){const I=Math.min(s-1,s-P);l[h]===m?y[h]=(u[h]>e[h]?-1:1)*I:w[h]=(d[h]>n[h]?-1:1)*I}}if(t!==i){const P=h==="x"?"y":"x",I=l[h]===c[P],D=u[P]>d[P],_=u[P]=N?(b=(T.x+R.x)/2,v=g[0].y):(b=g[0].x,v=(T.y+R.y)/2)}const S={x:u.x+y.x,y:u.y+y.y},O={x:d.x+w.x,y:d.y+w.y};return[[e,...S.x!==g[0].x||S.y!==g[0].y?[S]:[],...g,...O.x!==g[g.length-1].x||O.y!==g[g.length-1].y?[O]:[],n],b,v,x,k]}function rVt(e,t,n,i){const r=Math.min(Uae(e,t)/2,Uae(t,n)/2,i),{x:s,y:o}=t;if(e.x===s&&s===n.x||e.y===o&&o===n.y)return`L${s} ${o}`;if(e.y===o){const u=e.xn.id===t):e[0])||null}function M7(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function aVt(e,{id:t,defaultColor:n,defaultMarkerStart:i,defaultMarkerEnd:r}){const s=new Set;return e.reduce((o,l)=>([l.markerStart||i,l.markerEnd||r].forEach(c=>{if(c&&typeof c=="object"){const u=M7(c,t);s.has(u)||(o.push({id:u,color:c.color||n,...c}),s.add(u))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))}const $8e=1e3,oVt=10,rK={nodeOrigin:[0,0],nodeExtent:cA,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},lVt={...rK,checkEquality:!0};function sK(e,t){const n={...e};for(const i in t)t[i]!==void 0&&(n[i]=t[i]);return n}function cVt(e,t,n){const i=sK(rK,n);for(const r of e.values())if(r.parentId)oK(r,e,t,i);else{const s=qT(r,i.nodeOrigin),o=Cv(r.extent)?r.extent:i.nodeExtent,l=Ev(s,o,km(r));r.internals.positionAbsolute=l}}function uVt(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],i=[];for(const r of e.handles){const s={id:r.id,width:r.width??1,height:r.height??1,nodeId:e.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?n.push(s):r.type==="target"&&i.push(s)}return{source:n,target:i}}function aK(e){return e==="manual"}function L7(e,t,n,i={}){var d,f;const r=sK(lVt,i),s={i:0},o=new Map(t),l=r!=null&&r.elevateNodesOnSelect&&!aK(r.zIndexMode)?$8e:0;let c=e.length>0,u=!1;t.clear(),n.clear();for(const h of e){let m=o.get(h.id);if(r.checkEquality&&h===(m==null?void 0:m.internals.userNode))t.set(h.id,m);else{const g=qT(h,r.nodeOrigin),b=Cv(h.extent)?h.extent:r.nodeExtent,v=Ev(g,b,km(h));m={...r.defaults,...h,measured:{width:(d=h.measured)==null?void 0:d.width,height:(f=h.measured)==null?void 0:f.height},internals:{positionAbsolute:v,handleBounds:uVt(h,m),z:F8e(h,l,r.zIndexMode),userNode:h}},t.set(h.id,m)}(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(c=!1),h.parentId&&oK(m,t,n,i,s),u||(u=h.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function dVt(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 oK(e,t,n,i,r){const{elevateNodesOnSelect:s,nodeOrigin:o,nodeExtent:l,zIndexMode:c}=sK(rK,i),u=e.parentId,d=t.get(u);if(!d){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}dVt(e,n),r&&!d.parentId&&d.internals.rootParentIndex===void 0&&c==="auto"&&(d.internals.rootParentIndex=++r.i,d.internals.z=d.internals.z+r.i*oVt),r&&d.internals.rootParentIndex!==void 0&&(r.i=d.internals.rootParentIndex);const f=s&&!aK(c)?$8e:0,{x:h,y:m,z:g}=fVt(e,d,o,l,f,c),{positionAbsolute:b}=e.internals,v=h!==b.x||m!==b.y;(v||g!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:h,y:m}:b,z:g}})}function F8e(e,t,n){const i=lf(e.zIndex)?e.zIndex:0;return aK(n)?i:i+(e.selected?t:0)}function fVt(e,t,n,i,r,s){const{x:o,y:l}=t.internals.positionAbsolute,c=km(e),u=qT(e,n),d=Cv(e.extent)?Ev(u,e.extent,c):u;let f=Ev({x:o+d.x,y:l+d.y},i,c);e.extent==="parent"&&(f=A8e(f,c,t));const h=F8e(e,r,s),m=t.internals.z??0;return{x:f.x,y:f.y,z:m>=h?m+1:h}}function lK(e,t,n,i=[0,0]){var o;const r=[],s=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const u=((o=s.get(l.parentId))==null?void 0:o.expandedRect)??A1(c),d=T8e(u,l.rect);s.set(l.parentId,{expandedRect:d,parent:c})}return s.size>0&&s.forEach(({expandedRect:l,parent:c},u)=>{var x;const d=c.internals.positionAbsolute,f=km(c),h=c.origin??i,m=l.x0||g>0||y||w)&&(r.push({id:u,type:"position",position:{x:c.position.x-m+y,y:c.position.y-g+w}}),(x=n.get(u))==null||x.forEach(k=>{e.some(S=>S.id===k.id)||r.push({id:k.id,type:"position",position:{x:k.position.x+m,y:k.position.y+g}})})),(f.width0){const m=lK(h,t,n,r);u.push(...m)}return{changes:u,updatedInternals:c}}async function pVt({delta:e,panZoom:t,transform:n,translateExtent:i,width:r,height:s}){if(!t||!e.x&&!e.y)return!1;const o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,s]],i);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function Hae(e,t,n,i,r,s){let o=r;const l=i.get(o)||new Map;i.set(o,l.set(n,t)),o=`${r}-${e}`;const c=i.get(o)||new Map;if(i.set(o,c.set(n,t)),s){o=`${r}-${e}-${s}`;const u=i.get(o)||new Map;i.set(o,u.set(n,t))}}function B8e(e,t,n){e.clear(),t.clear();for(const i of n){const{source:r,target:s,sourceHandle:o=null,targetHandle:l=null}=i,c={edgeId:i.id,source:r,target:s,sourceHandle:o,targetHandle:l},u=`${r}-${o}--${s}-${l}`,d=`${s}-${l}--${r}-${o}`;Hae("source",c,d,e,r,o),Hae("target",c,u,e,s,l),t.set(i.id,i)}}function U8e(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:U8e(n,t):!1}function qae(e,t,n){var r;let i=e;do{if((r=i==null?void 0:i.matches)!=null&&r.call(i,t))return!0;if(i===n)return!1;i=i==null?void 0:i.parentElement}while(i);return!1}function mVt(e,t,n,i){const r=new Map;for(const[s,o]of e)if((o.selected||o.id===i)&&(!o.parentId||!U8e(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const l=e.get(s);l&&r.set(s,{id:s,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return r}function Y$({nodeId:e,dragItems:t,nodeLookup:n,dragging:i=!0}){var o,l,c;const r=[];for(const[u,d]of t){const f=(o=n.get(u))==null?void 0:o.internals.userNode;f&&r.push({...f,position:d.position,dragging:i})}if(!e)return[r[0],r];const s=(l=n.get(e))==null?void 0:l.internals.userNode;return[s?{...s,position:((c=t.get(e))==null?void 0:c.position)||s.position,dragging:i}:r[0],r]}function gVt({dragItems:e,snapGrid:t,x:n,y:i}){const r=e.values().next().value;if(!r)return null;const s={x:n-r.distance.x,y:i-r.distance.y},o=KT(s,t);return{x:o.x-s.x,y:o.y-s.y}}function bVt({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:i,onDragStop:r}){let s={x:null,y:null},o=0,l=new Map,c=!1,u={x:0,y:0},d=null,f=!1,h=null,m=!1,g=!1,b=null;function v({noDragClassName:w,handleSelector:x,domNode:k,isSelectable:S,nodeId:O,nodeClickDistance:A=0}){h=Su(k);function E({x:C,y:N}){const{nodeLookup:P,nodeExtent:I,snapGrid:D,snapToGrid:_,nodeOrigin:L,onNodeDrag:F,onSelectionDrag:M,onError:H,updateNodePositions:q}=t();s={x:C,y:N};let U=!1;const Z=l.size>1,z=Z&&I?D7(WT(l)):null,J=Z&&_?gVt({dragItems:l,snapGrid:D,x:C,y:N}):null;for(const[ne,W]of l){if(!P.has(ne))continue;let X={x:C-W.distance.x,y:N-W.distance.y};_&&(X=J?{x:Math.round(X.x+J.x),y:Math.round(X.y+J.y)}:KT(X,D));let ce=null;if(Z&&I&&!W.extent&&z){const{positionAbsolute:K}=W.internals,de=K.x-z.x+I[0][0],ee=K.x+W.measured.width-z.x2+I[1][0],Oe=K.y-z.y+I[0][1],he=K.y+W.measured.height-z.y2+I[1][1];ce=[[de,Oe],[ee,he]]}const{position:V,positionAbsolute:Y}=C8e({nodeId:ne,nextPosition:X,nodeLookup:P,nodeExtent:ce||I,nodeOrigin:L,onError:H});U=U||W.position.x!==V.x||W.position.y!==V.y,W.position=V,W.internals.positionAbsolute=Y}if(g=g||U,!!U&&(q(l,!0),b&&(i||F||!O&&M))){const[ne,W]=Y$({nodeId:O,dragItems:l,nodeLookup:P});i==null||i(b,l,ne,W),F==null||F(b,ne,W),O||M==null||M(b,W)}}async function j(){if(!d)return;const{transform:C,panBy:N,autoPanSpeed:P,autoPanOnNodeDrag:I}=t();if(!I){c=!1,cancelAnimationFrame(o);return}const[D,_]=eK(u,d,P);(D!==0||_!==0)&&(s.x=(s.x??0)-D/C[2],s.y=(s.y??0)-_/C[2],await N({x:D,y:_})&&E(s)),o=requestAnimationFrame(j)}function T(C){var Z;const{nodeLookup:N,multiSelectionActive:P,nodesDraggable:I,transform:D,snapGrid:_,snapToGrid:L,selectNodesOnDrag:F,onNodeDragStart:M,onSelectionDragStart:H,unselectNodesAndEdges:q}=t();f=!0,(!F||!S)&&!P&&O&&((Z=N.get(O))!=null&&Z.selected||q()),S&&F&&O&&(e==null||e(O));const U=RE(C.sourceEvent,{transform:D,snapGrid:_,snapToGrid:L,containerBounds:d});if(s=U,l=mVt(N,I,U,O),l.size>0&&(n||M||!O&&H)){const[z,J]=Y$({nodeId:O,dragItems:l,nodeLookup:N});n==null||n(C.sourceEvent,l,z,J),M==null||M(C.sourceEvent,z,J),O||H==null||H(C.sourceEvent,J)}}const R=r8e().clickDistance(A).on("start",C=>{const{domNode:N,nodeDragThreshold:P,transform:I,snapGrid:D,snapToGrid:_}=t();d=(N==null?void 0:N.getBoundingClientRect())||null,m=!1,g=!1,b=C.sourceEvent,P===0&&T(C),s=RE(C.sourceEvent,{transform:I,snapGrid:D,snapToGrid:_,containerBounds:d}),u=cf(C.sourceEvent,d)}).on("drag",C=>{const{autoPanOnNodeDrag:N,transform:P,snapGrid:I,snapToGrid:D,nodeDragThreshold:_,nodeLookup:L}=t(),F=RE(C.sourceEvent,{transform:P,snapGrid:I,snapToGrid:D,containerBounds:d});if(b=C.sourceEvent,(C.sourceEvent.type==="touchmove"&&C.sourceEvent.touches.length>1||O&&!L.has(O))&&(m=!0),!m){if(!c&&N&&f&&(c=!0,j()),!f){const M=cf(C.sourceEvent,d),H=M.x-u.x,q=M.y-u.y;Math.sqrt(H*H+q*q)>_&&T(C)}(s.x!==F.xSnapped||s.y!==F.ySnapped)&&l&&f&&(u=cf(C.sourceEvent,d),E(F))}}).on("end",C=>{if(!f||m){m&&l.size>0&&t().updateNodePositions(l,!1);return}if(c=!1,f=!1,cancelAnimationFrame(o),l.size>0){const{nodeLookup:N,updateNodePositions:P,onNodeDragStop:I,onSelectionDragStop:D}=t();if(g&&(P(l,!1),g=!1),r||I||!O&&D){const[_,L]=Y$({nodeId:O,dragItems:l,nodeLookup:N,dragging:!1});r==null||r(C.sourceEvent,l,_,L),I==null||I(C.sourceEvent,_,L),O||D==null||D(C.sourceEvent,L)}}}).filter(C=>{const N=C.target;return!C.button&&(!w||!qae(N,`.${w}`,k))&&(!x||qae(N,x,k))});h.call(R)}function y(){h==null||h.on(".drag",null)}return{update:v,destroy:y}}function yVt(e,t,n){const i=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const s of t.values())fA(r,A1(s))>0&&i.push(s);return i}const vVt=250;function xVt(e,t,n,i){var l,c;let r=[],s=1/0;const o=yVt(e,n,t+vVt);for(const u of o){const d=[...((l=u.internals.handleBounds)==null?void 0:l.source)??[],...((c=u.internals.handleBounds)==null?void 0:c.target)??[]];for(const f of d){if(i.nodeId===f.nodeId&&i.type===f.type&&i.id===f.id)continue;const{x:h,y:m}=Av(u,f,f.position,!0),g=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(m-e.y,2));g>t||(g1){const u=i.type==="source"?"target":"source";return r.find(d=>d.type===u)??r[0]}return r[0]}function Q8e(e,t,n,i,r,s=!1){var u,d,f;const o=i.get(e);if(!o)return null;const l=r==="strict"?(u=o.internals.handleBounds)==null?void 0:u[t]:[...((d=o.internals.handleBounds)==null?void 0:d.source)??[],...((f=o.internals.handleBounds)==null?void 0:f.target)??[]],c=(n?l==null?void 0:l.find(h=>h.id===n):l==null?void 0:l[0])??null;return c&&s?{...c,...Av(o,c,c.position,!0)}:c}function z8e(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function wVt(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const V8e=()=>!0;function kVt(e,{connectionMode:t,connectionRadius:n,handleId:i,nodeId:r,edgeUpdaterType:s,isTarget:o,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:m,onConnectStart:g,onConnect:b,onConnectEnd:v,isValidConnection:y=V8e,onReconnectEnd:w,updateConnection:x,getTransform:k,getFromHandle:S,autoPanSpeed:O,dragThreshold:A=1,handleDomNode:E}){const j=N8e(e.target);let T=0,R;const{x:C,y:N}=cf(e),P=z8e(s,E),I=l==null?void 0:l.getBoundingClientRect();let D=!1;if(!I||!P)return;const _=Q8e(r,P,i,c,t);if(!_)return;let L=cf(e,I),F=!1,M=null,H=!1,q=null;function U(){if(!d||!I)return;const[V,Y]=eK(L,I,O);h({x:V,y:Y}),T=requestAnimationFrame(U)}const Z={..._,nodeId:r,type:P,position:_.position},z=c.get(r);let ne={inProgress:!0,isValid:null,from:Av(z,Z,vn.Left,!0),fromHandle:Z,fromPosition:Z.position,fromNode:z,to:L,toHandle:null,toPosition:Pae[Z.position],toNode:null,pointer:L};function W(){D=!0,x(ne),g==null||g(e,{nodeId:r,handleId:i,handleType:P})}A===0&&W();function X(V){if(!D){const{x:he,y:ge}=cf(V),Se=he-C,xe=ge-N;if(!(Se*Se+xe*xe>A*A))return;W()}if(!S()||!Z){ce(V);return}const Y=k();L=cf(V,I),R=xVt(Ok(L,Y,!1,[1,1]),n,c,Z),F||(U(),F=!0);const K=H8e(V,{handle:R,connectionMode:t,fromNodeId:r,fromHandleId:i,fromType:o?"target":"source",isValidConnection:y,doc:j,lib:u,flowId:f,nodeLookup:c});q=K.handleDomNode,M=K.connection,H=wVt(!!R,K.isValid);const de=c.get(r),ee=de?Av(de,Z,vn.Left,!0):ne.from,Oe={...ne,from:ee,isValid:H,to:K.toHandle&&H?T1({x:K.toHandle.x,y:K.toHandle.y},Y):L,toHandle:K.toHandle,toPosition:H&&K.toHandle?K.toHandle.position:Pae[Z.position],toNode:K.toHandle?c.get(K.toHandle.nodeId):null,pointer:L};x(Oe),ne=Oe}function ce(V){if(!("touches"in V&&V.touches.length>0)){if(D){(R||q)&&M&&H&&(b==null||b(M));const{inProgress:Y,...K}=ne,de={...K,toPosition:ne.toHandle?ne.toPosition:null};v==null||v(V,de),s&&(w==null||w(V,de))}m(),cancelAnimationFrame(T),F=!1,H=!1,M=null,q=null,j.removeEventListener("mousemove",X),j.removeEventListener("mouseup",ce),j.removeEventListener("touchmove",X),j.removeEventListener("touchend",ce)}}j.addEventListener("mousemove",X),j.addEventListener("mouseup",ce),j.addEventListener("touchmove",X),j.addEventListener("touchend",ce)}function H8e(e,{handle:t,connectionMode:n,fromNodeId:i,fromHandleId:r,fromType:s,doc:o,lib:l,flowId:c,isValidConnection:u=V8e,nodeLookup:d}){const f=s==="target",h=t?o.querySelector(`.${l}-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:m,y:g}=cf(e),b=o.elementFromPoint(m,g),v=b!=null&&b.classList.contains(`${l}-flow__handle`)?b:h,y={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const w=z8e(void 0,v),x=v.getAttribute("data-nodeid"),k=v.getAttribute("data-handleid"),S=v.classList.contains("connectable"),O=v.classList.contains("connectableend");if(!x||!w)return y;const A={source:f?x:i,sourceHandle:f?k:r,target:f?i:x,targetHandle:f?r:k};y.connection=A;const j=S&&O&&(n===E1.Strict?f&&w==="source"||!f&&w==="target":x!==i||k!==r);y.isValid=j&&u(A),y.toHandle=Q8e(x,w,k,d,n,!0)}return y}const $7={onPointerDown:kVt,isValid:H8e};function OVt({domNode:e,panZoom:t,getTransform:n,getViewScale:i}){const r=Su(e);function s({translateExtent:l,width:c,height:u,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:m=!1}){const g=x=>{if(x.sourceEvent.type!=="wheel"||!t)return;const k=n(),S=x.sourceEvent.ctrlKey&&hA()?10:1,O=-x.sourceEvent.deltaY*(x.sourceEvent.deltaMode===1?.05:x.sourceEvent.deltaMode?1:.002)*d,A=k[2]*Math.pow(2,O*S);t.scaleTo(A)};let b=[0,0];const v=x=>{(x.sourceEvent.type==="mousedown"||x.sourceEvent.type==="touchstart")&&(b=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY])},y=x=>{const k=n();if(x.sourceEvent.type!=="mousemove"&&x.sourceEvent.type!=="touchmove"||!t)return;const S=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY],O=[S[0]-b[0],S[1]-b[1]];b=S;const A=i()*Math.max(k[2],Math.log(k[2]))*(m?-1:1),E={x:k[0]-O[0]*A,y:k[1]-O[1]*A},j=[[0,0],[c,u]];t.setViewportConstrained({x:E.x,y:E.y,zoom:k[2]},j,l)},w=x8e().on("start",v).on("zoom",f?y:null).on("zoom.wheel",h?g:null);r.call(w,{})}function o(){r.on("zoom",null)}return{update:s,destroy:o,pointer:Jd}}const kL=e=>({x:e.x,y:e.y,zoom:e.k}),Z$=({x:e,y:t,zoom:n})=>vL.translate(e,t).scale(n),Vx=(e,t)=>e.target.closest(`.${t}`),q8e=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),SVt=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,J$=(e,t=0,n=SVt,i=()=>{})=>{const r=typeof t=="number"&&t>0;return r||i(),r?e.transition().duration(t).ease(n).on("end",i):e},W8e=e=>{const t=e.ctrlKey&&hA()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function EVt({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:i,panOnScrollMode:r,panOnScrollSpeed:s,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(Vx(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(d.ctrlKey&&o){const v=Jd(d),y=W8e(d),w=f*Math.pow(2,y);i.scaleTo(n,w,v,d);return}const h=d.deltaMode===1?20:1;let m=r===Yy.Vertical?0:d.deltaX*h,g=r===Yy.Horizontal?0:d.deltaY*h;!hA()&&d.shiftKey&&r!==Yy.Vertical&&(m=d.deltaY*h,g=0),i.translateBy(n,-(m/f)*s,-(g/f)*s,{internal:!0});const b=kL(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(d,b),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,b),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(d,b))}}function CVt({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(i,r){const s=i.type==="wheel",o=!t&&s&&!i.ctrlKey,l=Vx(i,e);if(i.ctrlKey&&s&&l&&i.preventDefault(),o||l)return null;i.preventDefault(),n.call(this,i,r)}}function AVt({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return i=>{var s,o,l;if((s=i.sourceEvent)!=null&&s.internal)return;const r=kL(i.transform);e.mouseButton=((o=i.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=r,((l=i.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(i.sourceEvent,r))}}function TVt({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:i,onPanZoom:r}){return s=>{var o,l;e.usedRightMouseButton=!!(n&&q8e(t,e.mouseButton??0)),(o=s.sourceEvent)!=null&&o.sync||i([s.transform.x,s.transform.y,s.transform.k]),r&&!((l=s.sourceEvent)!=null&&l.internal)&&(r==null||r(s.sourceEvent,kL(s.transform)))}}function _Vt({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:i,onPanZoomEnd:r,onPaneContextMenu:s}){return o=>{var l;if(!((l=o.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,s&&q8e(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&s(o.sourceEvent),e.usedRightMouseButton=!1,i(!1),r)){const c=kL(o.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r==null||r(o.sourceEvent,c)},n?150:0)}}}function jVt({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:i,panOnScroll:r,zoomOnDoubleClick:s,userSelectionActive:o,noWheelClassName:l,noPanClassName:c,lib:u,connectionInProgress:d}){return f=>{var v;const h=e||t,m=n&&f.ctrlKey,g=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(Vx(f,`${u}-flow__node`)||Vx(f,`${u}-flow__edge`)))return!0;if(!i&&!h&&!r&&!s&&!n||o||d&&!g||Vx(f,l)&&g||Vx(f,c)&&(!g||r&&g&&!e)||!n&&f.ctrlKey&&g)return!1;if(!n&&f.type==="touchstart"&&((v=f.touches)==null?void 0:v.length)>1)return f.preventDefault(),!1;if(!h&&!r&&!m&&g||!i&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(i)&&!i.includes(f.button)&&f.type==="mousedown")return!1;const b=Array.isArray(i)&&i.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||g)&&b}}function NVt({domNode:e,minZoom:t,maxZoom:n,translateExtent:i,viewport:r,onPanZoom:s,onPanZoomStart:o,onPanZoomEnd:l,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=x8e().scaleExtent([t,n]).translateExtent(i),h=Su(e).call(f);w({x:r.x,y:r.y,zoom:C1(r.zoom,t,n)},[[0,0],[d.width,d.height]],i);const m=h.on("wheel.zoom"),g=h.on("dblclick.zoom");f.wheelDelta(W8e);async function b(R,C){return h?new Promise(N=>{f==null||f.interpolate((C==null?void 0:C.interpolate)==="linear"?NE:ZN).transform(J$(h,C==null?void 0:C.duration,C==null?void 0:C.ease,()=>N(!0)),R)}):!1}function v({noWheelClassName:R,noPanClassName:C,onPaneContextMenu:N,userSelectionActive:P,panOnScroll:I,panOnDrag:D,panOnScrollMode:_,panOnScrollSpeed:L,preventScrolling:F,zoomOnPinch:M,zoomOnScroll:H,zoomOnDoubleClick:q,zoomActivationKeyPressed:U,lib:Z,onTransformChange:z,connectionInProgress:J,paneClickDistance:ne,selectionOnDrag:W}){P&&!u.isZoomingOrPanning&&y();const X=I&&!U&&!P;f.clickDistance(W?1/0:!lf(ne)||ne<0?0:ne);const ce=X?EVt({zoomPanValues:u,noWheelClassName:R,d3Selection:h,d3Zoom:f,panOnScrollMode:_,panOnScrollSpeed:L,zoomOnPinch:M,onPanZoomStart:o,onPanZoom:s,onPanZoomEnd:l}):CVt({noWheelClassName:R,preventScrolling:F,d3ZoomHandler:m});h.on("wheel.zoom",ce,{passive:!1});const V=AVt({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:o});f.on("start",V);const Y=TVt({zoomPanValues:u,panOnDrag:D,onPaneContextMenu:!!N,onPanZoom:s,onTransformChange:z});f.on("zoom",Y);const K=_Vt({zoomPanValues:u,panOnDrag:D,panOnScroll:I,onPaneContextMenu:N,onPanZoomEnd:l,onDraggingChange:c});f.on("end",K);const de=jVt({zoomActivationKeyPressed:U,panOnDrag:D,zoomOnScroll:H,panOnScroll:I,zoomOnDoubleClick:q,zoomOnPinch:M,userSelectionActive:P,noPanClassName:C,noWheelClassName:R,lib:Z,connectionInProgress:J});f.filter(de),q?h.on("dblclick.zoom",g):h.on("dblclick.zoom",null)}function y(){f.on("zoom",null)}async function w(R,C,N){const P=Z$(R),I=f==null?void 0:f.constrain()(P,C,N);return I&&await b(I),I}async function x(R,C){const N=Z$(R);return await b(N,C),N}function k(R){if(h){const C=Z$(R),N=h.property("__zoom");(N.k!==R.zoom||N.x!==R.x||N.y!==R.y)&&(f==null||f.transform(h,C,null,{sync:!0}))}}function S(){const R=h?v8e(h.node()):{x:0,y:0,k:1};return{x:R.x,y:R.y,zoom:R.k}}async function O(R,C){return h?new Promise(N=>{f==null||f.interpolate((C==null?void 0:C.interpolate)==="linear"?NE:ZN).scaleTo(J$(h,C==null?void 0:C.duration,C==null?void 0:C.ease,()=>N(!0)),R)}):!1}async function A(R,C){return h?new Promise(N=>{f==null||f.interpolate((C==null?void 0:C.interpolate)==="linear"?NE:ZN).scaleBy(J$(h,C==null?void 0:C.duration,C==null?void 0:C.ease,()=>N(!0)),R)}):!1}function E(R){f==null||f.scaleExtent(R)}function j(R){f==null||f.translateExtent(R)}function T(R){const C=!lf(R)||R<0?0:R;f==null||f.clickDistance(C)}return{update:v,destroy:y,setViewport:x,setViewportConstrained:w,getViewport:S,scaleTo:O,scaleBy:A,setScaleExtent:E,setTranslateExtent:j,syncViewport:k,setClickDistance:T}}var _1;(function(e){e.Line="line",e.Handle="handle"})(_1||(_1={}));function RVt({width:e,prevWidth:t,height:n,prevHeight:i,affectsX:r,affectsY:s}){const o=e-t,l=n-i,c=[o>0?1:o<0?-1:0,l>0?1:l<0?-1:0];return o&&r&&(c[0]=c[0]*-1),l&&s&&(c[1]=c[1]*-1),c}function Wae(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),i=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:i,affectsY:r}}function Lm(e,t){return Math.max(0,t-e)}function $m(e,t){return Math.max(0,e-t)}function bj(e,t,n){return Math.max(0,t-e,e-n)}function Kae(e,t){return e?!t:t}function IVt(e,t,n,i,r,s,o,l){let{affectsX:c,affectsY:u}=t;const{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:m,ySnapped:g}=n,{minWidth:b,maxWidth:v,minHeight:y,maxHeight:w}=i,{x,y:k,width:S,height:O,aspectRatio:A}=e;let E=Math.floor(d?m-e.pointerX:0),j=Math.floor(f?g-e.pointerY:0);const T=S+(c?-E:E),R=O+(u?-j:j),C=-s[0]*S,N=-s[1]*O;let P=bj(T,b,v),I=bj(R,y,w);if(o){let L=0,F=0;c&&E<0?L=Lm(x+E+C,o[0][0]):!c&&E>0&&(L=$m(x+T+C,o[1][0])),u&&j<0?F=Lm(k+j+N,o[0][1]):!u&&j>0&&(F=$m(k+R+N,o[1][1])),P=Math.max(P,L),I=Math.max(I,F)}if(l){let L=0,F=0;c&&E>0?L=$m(x+E,l[0][0]):!c&&E<0&&(L=Lm(x+T,l[1][0])),u&&j>0?F=$m(k+j,l[0][1]):!u&&j<0&&(F=Lm(k+R,l[1][1])),P=Math.max(P,L),I=Math.max(I,F)}if(r){if(d){const L=bj(T/A,y,w)*A;if(P=Math.max(P,L),o){let F=0;!c&&!u||c&&!u&&h?F=$m(k+N+T/A,o[1][1])*A:F=Lm(k+N+(c?E:-E)/A,o[0][1])*A,P=Math.max(P,F)}if(l){let F=0;!c&&!u||c&&!u&&h?F=Lm(k+T/A,l[1][1])*A:F=$m(k+(c?E:-E)/A,l[0][1])*A,P=Math.max(P,F)}}if(f){const L=bj(R*A,b,v)/A;if(I=Math.max(I,L),o){let F=0;!c&&!u||u&&!c&&h?F=$m(x+R*A+C,o[1][0])/A:F=Lm(x+(u?j:-j)*A+C,o[0][0])/A,I=Math.max(I,F)}if(l){let F=0;!c&&!u||u&&!c&&h?F=Lm(x+R*A,l[1][0])/A:F=$m(x+(u?j:-j)*A,l[0][0])/A,I=Math.max(I,F)}}}j=j+(j<0?I:-I),E=E+(E<0?P:-P),r&&(h?T>R*A?j=(Kae(c,u)?-E:E)/A:E=(Kae(c,u)?-j:j)*A:d?(j=E/A,u=c):(E=j*A,c=u));const D=c?x+E:x,_=u?k+j:k;return{width:S+(c?-E:E),height:O+(u?-j:j),x:s[0]*E*(c?-1:1)+D,y:s[1]*j*(u?-1:1)+_}}const K8e={width:0,height:0,x:0,y:0},PVt={...K8e,pointerX:0,pointerY:0,aspectRatio:1};function DVt(e,t,n){const i=t.position.x+e.position.x,r=t.position.y+e.position.y,s=e.measured.width??0,o=e.measured.height??0,l=n[0]*s,c=n[1]*o;return[[i-l,r-c],[i+s-l,r+o-c]]}function MVt({domNode:e,nodeId:t,getStoreItems:n,onChange:i,onEnd:r}){const s=Su(e);let o={controlDirection:Wae("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:d,keepAspectRatio:f,resizeDirection:h,onResizeStart:m,onResize:g,onResizeEnd:b,shouldResize:v}){let y={...K8e},w={...PVt};o={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:Wae(u)};let x,k=null,S=[],O,A,E,j=!1;const T=r8e().on("start",R=>{const{nodeLookup:C,transform:N,snapGrid:P,snapToGrid:I,nodeOrigin:D,paneDomNode:_}=n();if(x=C.get(t),!x)return;k=(_==null?void 0:_.getBoundingClientRect())??null;const{xSnapped:L,ySnapped:F}=RE(R.sourceEvent,{transform:N,snapGrid:P,snapToGrid:I,containerBounds:k});y={width:x.measured.width??0,height:x.measured.height??0,x:x.position.x??0,y:x.position.y??0},w={...y,pointerX:L,pointerY:F,aspectRatio:y.width/y.height},O=void 0,A=Cv(x.extent)?x.extent:void 0,x.parentId&&(x.extent==="parent"||x.expandParent)&&(O=C.get(x.parentId)),O&&x.extent==="parent"&&(A=[[0,0],[O.measured.width,O.measured.height]]),S=[],E=void 0;for(const[M,H]of C)if(H.parentId===t&&(S.push({id:M,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const q=DVt(H,x,H.origin??D);E?E=[[Math.min(q[0][0],E[0][0]),Math.min(q[0][1],E[0][1])],[Math.max(q[1][0],E[1][0]),Math.max(q[1][1],E[1][1])]]:E=q}m==null||m(R,{...y})}).on("drag",R=>{const{transform:C,snapGrid:N,snapToGrid:P,nodeOrigin:I}=n(),D=RE(R.sourceEvent,{transform:C,snapGrid:N,snapToGrid:P,containerBounds:k}),_=[];if(!x)return;const{x:L,y:F,width:M,height:H}=y,q={},U=x.origin??I,{width:Z,height:z,x:J,y:ne}=IVt(w,o.controlDirection,D,o.boundaries,o.keepAspectRatio,U,A,E),W=Z!==M,X=z!==H,ce=J!==L&&W,V=ne!==F&&X;if(!ce&&!V&&!W&&!X)return;if((ce||V||U[0]===1||U[1]===1)&&(q.x=ce?J:y.x,q.y=V?ne:y.y,y.x=q.x,y.y=q.y,S.length>0)){const ee=J-L,Oe=ne-F;for(const he of S)he.position={x:he.position.x-ee+U[0]*(Z-M),y:he.position.y-Oe+U[1]*(z-H)},_.push(he)}if((W||X)&&(q.width=W&&(!o.resizeDirection||o.resizeDirection==="horizontal")?Z:y.width,q.height=X&&(!o.resizeDirection||o.resizeDirection==="vertical")?z:y.height,y.width=q.width,y.height=q.height),O&&x.expandParent){const ee=U[0]*(q.width??0);q.x&&q.x{j&&(b==null||b(R,{...y}),r==null||r({...y}),j=!1)});s.call(T)}function c(){s.on(".drag",null)}return{update:l,destroy:c}}const LVt={},Gae=e=>{let t;const n=new Set,i=(d,f)=>{const h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){const m=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(g=>g(t,m))}},r=()=>t,c={setState:i,getState:r,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(LVt?"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()}},u=t=e(i,r,c);return c},$Vt=e=>e?Gae(e):Gae,{useDebugValue:FVt}=Pi,{useSyncExternalStoreWithSelector:BVt}=wnt,UVt=e=>e;function G8e(e,t=UVt,n){const i=BVt(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return FVt(i),i}const Xae=(e,t)=>{const n=$Vt(e),i=(r,s=t)=>G8e(n,r,s);return Object.assign(i,n),i},QVt=(e,t)=>e?Xae(e,t):Xae;function zs(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[i,r]of e)if(!Object.is(r,t.get(i)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const i of n)if(!Object.prototype.hasOwnProperty.call(t,i)||!Object.is(e[i],t[i]))return!1;return!0}const OL=p.createContext(null),zVt=OL.Provider,X8e=wf.error001("react");function or(e,t){const n=p.useContext(OL);if(n===null)throw new Error(X8e);return G8e(n,e,t)}function Vs(){const e=p.useContext(OL);if(e===null)throw new Error(X8e);return p.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Yae={display:"none"},VVt={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Y8e="react-flow__node-desc",Z8e="react-flow__edge-desc",HVt="react-flow__aria-live",qVt=e=>e.ariaLiveMessage,WVt=e=>e.ariaLabelConfig;function KVt({rfId:e}){const t=or(qVt);return a.jsx("div",{id:`${HVt}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:VVt,children:t})}function GVt({rfId:e,disableKeyboardA11y:t}){const n=or(WVt);return a.jsxs(a.Fragment,{children:[a.jsx("div",{id:`${Y8e}-${e}`,style:Yae,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),a.jsx("div",{id:`${Z8e}-${e}`,style:Yae,children:n["edge.a11yDescription.default"]}),!t&&a.jsx(KVt,{rfId:e})]})}const SL=p.forwardRef(({position:e="top-left",children:t,className:n,style:i,...r},s)=>{const o=`${e}`.split("-");return a.jsx("div",{className:no(["react-flow__panel",n,...o]),style:i,ref:s,...r,children:t})});SL.displayName="Panel";function XVt({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:a.jsx(SL,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:a.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const YVt=e=>{const t=[],n=[];for(const[,i]of e.nodeLookup)i.selected&&t.push(i.internals.userNode);for(const[,i]of e.edgeLookup)i.selected&&n.push(i);return{selectedNodes:t,selectedEdges:n}},yj=e=>e.id;function ZVt(e,t){return zs(e.selectedNodes.map(yj),t.selectedNodes.map(yj))&&zs(e.selectedEdges.map(yj),t.selectedEdges.map(yj))}function JVt({onSelectionChange:e}){const t=Vs(),{selectedNodes:n,selectedEdges:i}=or(YVt,ZVt);return p.useEffect(()=>{const r={nodes:n,edges:i};e==null||e(r),t.getState().onSelectionChangeHandlers.forEach(s=>s(r))},[n,i,e]),null}const eHt=e=>!!e.onSelectionChangeHandlers;function tHt({onSelectionChange:e}){const t=or(eHt);return e||t?a.jsx(JVt,{onSelectionChange:e}):null}const J8e=[0,0],nHt={x:0,y:0,zoom:1},iHt=["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"],Zae=[...iHt,"rfId"],rHt=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}),Jae={translateExtent:cA,nodeOrigin:J8e,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function sHt(e){const{setNodes:t,setEdges:n,setMinZoom:i,setMaxZoom:r,setTranslateExtent:s,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:c}=or(rHt,zs),u=Vs();p.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=Jae,l()}),[]);const d=p.useRef(Jae);return p.useEffect(()=>{for(const f of Zae){const h=e[f],m=d.current[f];h!==m&&(typeof e[f]>"u"||(f==="nodes"?t(h):f==="edges"?n(h):f==="minZoom"?i(h):f==="maxZoom"?r(h):f==="translateExtent"?s(h):f==="nodeExtent"?o(h):f==="ariaLabelConfig"?u.setState({ariaLabelConfig:Gzt(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},Zae.map(f=>e[f])),null}function eoe(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function aHt(e){var i;const[t,n]=p.useState(e==="system"?null:e);return p.useEffect(()=>{if(e!=="system"){n(e);return}const r=eoe(),s=()=>n(r!=null&&r.matches?"dark":"light");return s(),r==null||r.addEventListener("change",s),()=>{r==null||r.removeEventListener("change",s)}},[e]),t!==null?t:(i=eoe())!=null&&i.matches?"dark":"light"}const toe=typeof document<"u"?document:null;function pA(e=null,t={target:toe,actInsideInputWithModifier:!0}){const[n,i]=p.useState(!1),r=p.useRef(!1),s=p.useRef(new Set([])),[o,l]=p.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",` `).replace(` `,` +`).split(` -`)),d=u.reduce((f,h)=>f.concat(...h),[]);return[u,d]}return[[],[]]},[e]);return p.useEffect(()=>{const c=(t==null?void 0:t.target)??toe,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=m=>{var v,y;if(r.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!r.current||r.current&&!u)&&N8e(m))return!1;const b=ioe(m.code,l);if(s.current.add(m[b]),noe(o,s.current,!1)){const w=((y=(v=m.composedPath)==null?void 0:v.call(m))==null?void 0:y[0])||m.target,x=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";t.preventDefault!==!1&&(r.current||!x)&&m.preventDefault(),i(!0)}},f=m=>{const g=ioe(m.code,l);noe(o,s.current,!0)?(i(!1),s.current.clear()):s.current.delete(m[g]),m.key==="Meta"&&s.current.clear(),r.current=!1},h=()=>{s.current.clear(),i(!1)};return c==null||c.addEventListener("keydown",d),c==null||c.addEventListener("keyup",f),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{c==null||c.removeEventListener("keydown",d),c==null||c.removeEventListener("keyup",f),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,i]),n}function noe(e,t,n){return e.filter(i=>n||i.length===t.size).some(i=>i.every(r=>t.has(r)))}function ioe(e,t){return t.includes(e)?"code":"key"}const aHt=()=>{const e=Vs();return p.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:i}=e.getState();return i?i.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[i,r,s],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??i,y:t.y??r,zoom:t.zoom??s},n),!0):!1},getViewport:()=>{const[t,n,i]=e.getState().transform;return{x:t,y:n,zoom:i}},setCenter:async(t,n,i)=>e.getState().setCenter(t,n,i),fitBounds:async(t,n)=>{const{width:i,height:r,minZoom:s,maxZoom:o,panZoom:l}=e.getState(),c=tK(t,i,r,s,o,(n==null?void 0:n.padding)??.1);return l?(await l.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:i,snapGrid:r,snapToGrid:s,domNode:o}=e.getState();if(!o)return t;const{x:l,y:c}=o.getBoundingClientRect(),u={x:t.x-l,y:t.y-c},d=n.snapGrid??r,f=n.snapToGrid??s;return Ok(u,i,f,d)},flowToScreenPosition:t=>{const{transform:n,domNode:i}=e.getState();if(!i)return t;const{x:r,y:s}=i.getBoundingClientRect(),o=T1(t,n);return{x:o.x+r,y:o.y+s}}}),[])};function J8e(e,t){const n=[],i=new Map,r=[];for(const s of e)if(s.type==="add"){r.push(s);continue}else if(s.type==="remove"||s.type==="replace")i.set(s.id,[s]);else{const o=i.get(s.id);o?o.push(s):i.set(s.id,[s])}for(const s of t){const o=i.get(s.id);if(!o){n.push(s);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const l={...s};for(const c of o)oHt(c,l);n.push(l)}return r.length&&r.forEach(s=>{s.index!==void 0?n.splice(s.index,0,{...s.item}):n.push({...s.item})}),n}function oHt(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 eBe(e,t){return J8e(e,t)}function tBe(e,t){return J8e(e,t)}function py(e,t){return{id:e,type:"select",selected:t}}function Hx(e,t=new Set,n=!1){const i=[];for(const[r,s]of e){const o=t.has(r);!(s.selected===void 0&&!o)&&s.selected!==o&&(n&&(s.selected=o),i.push(py(s.id,o)))}return i}function roe({items:e=[],lookup:t}){var r;const n=[],i=new Map(e.map(s=>[s.id,s]));for(const[s,o]of e.entries()){const l=t.get(o.id),c=((r=l==null?void 0:l.internals)==null?void 0:r.userNode)??l;c!==void 0&&c!==o&&n.push({id:o.id,item:o,type:"replace"}),c===void 0&&n.push({item:o,type:"add",index:s})}for(const[s]of t)i.get(s)===void 0&&n.push({id:s,type:"remove"});return n}function soe(e){return{id:e.id,type:"remove"}}const lHt=T8e();function cHt(e,t,n={}){return eVt(e,t,{...n,onError:n.onError??lHt})}const aoe=e=>Fzt(e),uHt=e=>S8e(e);function nBe(e){return p.forwardRef(e)}const dHt=typeof window<"u"?p.useLayoutEffect:p.useEffect;function ooe(e){const[t,n]=p.useState(BigInt(0)),[i]=p.useState(()=>fHt(()=>n(r=>r+BigInt(1))));return dHt(()=>{const r=i.get();r.length&&(e(r),i.reset())},[t]),i}function fHt(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const iBe=p.createContext(null);function hHt({children:e}){const t=Vs(),n=p.useCallback(l=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:d,onNodesChange:f,nodeLookup:h,fitViewQueued:m,onNodesChangeMiddlewareMap:g}=t.getState();let b=c;for(const y of l)b=typeof y=="function"?y(b):y;let v=roe({items:b,lookup:h});for(const y of g.values())v=y(v);d&&u(b),v.length>0?f==null||f(v):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:y,nodes:w,setNodes:x}=t.getState();y&&x(w)})},[]),i=ooe(n),r=p.useCallback(l=>{const{edges:c=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:f,edgeLookup:h}=t.getState();let m=c;for(const g of l)m=typeof g=="function"?g(m):g;d?u(m):f&&f(roe({items:m,lookup:h}))},[]),s=ooe(r),o=p.useMemo(()=>({nodeQueue:i,edgeQueue:s}),[]);return a.jsx(iBe.Provider,{value:o,children:e})}function pHt(){const e=p.useContext(iBe);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const mHt=e=>!!e.panZoom;function EL(){const e=aHt(),t=Vs(),n=pHt(),i=or(mHt),r=p.useMemo(()=>{const s=f=>t.getState().nodeLookup.get(f),o=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},c=f=>{var y,w;const{nodeLookup:h,nodeOrigin:m}=t.getState(),g=aoe(f)?f:h.get(f.id),b=g.parentId?_8e(g.position,g.measured,g.parentId,h,m):g.position,v={...g,position:b,width:((y=g.measured)==null?void 0:y.width)??g.width,height:((w=g.measured)==null?void 0:w.height)??g.height};return A1(v)},u=(f,h,m={replace:!1})=>{o(g=>g.map(b=>{if(b.id===f){const v=typeof h=="function"?h(b):h;return m.replace&&aoe(v)?v:{...b,...v}}return b}))},d=(f,h,m={replace:!1})=>{l(g=>g.map(b=>{if(b.id===f){const v=typeof h=="function"?h(b):h;return m.replace&&uHt(v)?v:{...b,...v}}return b}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var h;return(h=s(f))==null?void 0:h.internals.userNode},getInternalNode:s,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(h=>({...h}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:o,setEdges:l,addNodes:f=>{const h=Array.isArray(f)?f:[f];n.nodeQueue.push(m=>[...m,...h])},addEdges:f=>{const h=Array.isArray(f)?f:[f];n.edgeQueue.push(m=>[...m,...h])},toObject:()=>{const{nodes:f=[],edges:h=[],transform:m}=t.getState(),[g,b,v]=m;return{nodes:f.map(y=>({...y})),edges:h.map(y=>({...y})),viewport:{x:g,y:b,zoom:v}}},deleteElements:async({nodes:f=[],edges:h=[]})=>{const{nodes:m,edges:g,onNodesDelete:b,onEdgesDelete:v,triggerNodeChanges:y,triggerEdgeChanges:w,onDelete:x,onBeforeDelete:k}=t.getState(),{nodes:S,edges:O}=await Vzt({nodesToRemove:f,edgesToRemove:h,nodes:m,edges:g,onBeforeDelete:k}),A=O.length>0,E=S.length>0;if(A){const j=O.map(soe);v==null||v(O),w(j)}if(E){const j=S.map(soe);b==null||b(S),y(j)}return(E||A)&&(x==null||x({nodes:S,edges:O})),{deletedNodes:S,deletedEdges:O}},getIntersectingNodes:(f,h=!0,m)=>{const g=Mae(f),b=g?f:c(f),v=m!==void 0;return b?(m||t.getState().nodes).filter(y=>{const w=t.getState().nodeLookup.get(y.id);if(w&&!g&&(y.id===f.id||!w.internals.positionAbsolute))return!1;const x=A1(v?y:w),k=fA(x,b);return h&&k>0||k>=x.width*x.height||k>=b.width*b.height}):[]},isNodeIntersecting:(f,h,m=!0)=>{const b=Mae(f)?f:c(f);if(!b)return!1;const v=fA(b,h);return m&&v>0||v>=h.width*h.height||v>=b.width*b.height},updateNode:u,updateNodeData:(f,h,m={replace:!1})=>{u(f,g=>{const b=typeof h=="function"?h(g):h;return m.replace?{...g,data:b}:{...g,data:{...g.data,...b}}},m)},updateEdge:d,updateEdgeData:(f,h,m={replace:!1})=>{d(f,g=>{const b=typeof h=="function"?h(g):h;return m.replace?{...g,data:b}:{...g,data:{...g.data,...b}}},m)},getNodesBounds:f=>{const{nodeLookup:h,nodeOrigin:m}=t.getState();return Bzt(f,{nodeLookup:h,nodeOrigin:m})},getHandleConnections:({type:f,id:h,nodeId:m})=>{var g;return Array.from(((g=t.getState().connectionLookup.get(`${m}-${f}${h?`-${h}`:""}`))==null?void 0:g.values())??[])},getNodeConnections:({type:f,handleId:h,nodeId:m})=>{var g;return Array.from(((g=t.getState().connectionLookup.get(`${m}${f?h?`-${f}-${h}`:`-${f}`:""}`))==null?void 0:g.values())??[])},fitView:async f=>{const h=t.getState().fitViewResolver??Wzt();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:h}),n.nodeQueue.push(m=>[...m]),h.promise}}},[]);return p.useMemo(()=>({...r,...e,viewportInitialized:i}),[i])}const loe=e=>e.selected,gHt=typeof window<"u"?window:void 0;function bHt({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Vs(),{deleteElements:i}=EL(),r=pA(e,{actInsideInputWithModifier:!1}),s=pA(t,{target:gHt});p.useEffect(()=>{if(r){const{edges:o,nodes:l}=n.getState();i({nodes:l.filter(loe),edges:o.filter(loe)}),n.setState({nodesSelectionActive:!1})}},[r]),p.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function yHt(e){const t=Vs();p.useEffect(()=>{const n=()=>{var r,s,o,l;if(!e.current||!(((s=(r=e.current).checkVisibility)==null?void 0:s.call(r))??!0))return!1;const i=iK(e.current);(i.height===0||i.width===0)&&((l=(o=t.getState()).onError)==null||l.call(o,"004",wf.error004())),t.setState({width:i.width||500,height:i.height||500})};if(e.current){n(),window.addEventListener("resize",n);const i=new ResizeObserver(()=>n());return i.observe(e.current),()=>{window.removeEventListener("resize",n),i&&e.current&&i.unobserve(e.current)}}},[])}const CL={position:"absolute",width:"100%",height:"100%",top:0,left:0},vHt=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function xHt({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:r=.5,panOnScrollMode:s=Yy.Free,zoomOnDoubleClick:o=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:m=!0,children:g,noWheelClassName:b,noPanClassName:v,onViewportChange:y,isControlledViewport:w,paneClickDistance:x,selectionOnDrag:k}){const S=Vs(),O=p.useRef(null),{userSelectionActive:A,lib:E,connectionInProgress:j}=or(vHt,zs),T=pA(h),R=p.useRef();yHt(O);const C=p.useCallback(N=>{y==null||y({x:N[0],y:N[1],zoom:N[2]}),w||S.setState({transform:N})},[y,w]);return p.useEffect(()=>{if(O.current){R.current=jVt({domNode:O.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:c,onDraggingChange:D=>S.setState(_=>_.paneDragging===D?_:{paneDragging:D}),onPanZoomStart:(D,_)=>{const{onViewportChangeStart:L,onMoveStart:F}=S.getState();F==null||F(D,_),L==null||L(_)},onPanZoom:(D,_)=>{const{onViewportChange:L,onMove:F}=S.getState();F==null||F(D,_),L==null||L(_)},onPanZoomEnd:(D,_)=>{const{onViewportChangeEnd:L,onMoveEnd:F}=S.getState();F==null||F(D,_),L==null||L(_)}});const{x:N,y:P,zoom:I}=R.current.getViewport();return S.setState({panZoom:R.current,transform:[N,P,I],domNode:O.current.closest(".react-flow")}),()=>{var D;(D=R.current)==null||D.destroy()}}},[]),p.useEffect(()=>{var N;(N=R.current)==null||N.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:r,panOnScrollMode:s,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:T,preventScrolling:m,noPanClassName:v,userSelectionActive:A,noWheelClassName:b,lib:E,onTransformChange:C,connectionInProgress:j,selectionOnDrag:k,paneClickDistance:x})},[e,t,n,i,r,s,o,l,T,m,v,A,b,E,C,j,k,x]),a.jsx("div",{className:"react-flow__renderer",ref:O,style:CL,children:g})}const wHt=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function kHt(){const{userSelectionActive:e,userSelectionRect:t}=or(wHt,zs);return e&&t?a.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 e6=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},OHt=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function SHt({isSelecting:e,selectionKeyPressed:t,selectionMode:n=uA.Full,panOnDrag:i,autoPanOnSelection:r,paneClickDistance:s,selectionOnDrag:o,onSelectionStart:l,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:m,onPaneMouseLeave:g,children:b}){const v=p.useRef(0),y=Vs(),{userSelectionActive:w,elementsSelectable:x,dragging:k,connectionInProgress:S,panBy:O,autoPanSpeed:A}=or(OHt,zs),E=x&&(e||w),j=p.useRef(null),T=p.useRef(),R=p.useRef(new Set),C=p.useRef(new Set),N=p.useRef(!1),P=p.useRef({x:0,y:0}),I=p.useRef(!1),D=W=>{if(N.current||S){N.current=!1;return}u==null||u(W),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})},_=W=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){W.preventDefault();return}d==null||d(W)},L=f?W=>f(W):void 0,F=W=>{N.current&&(W.stopPropagation(),N.current=!1)},M=W=>{var fe,pe;const{domNode:X,transform:le}=y.getState();if(T.current=X==null?void 0:X.getBoundingClientRect(),!T.current)return;const V=W.target===j.current;if(!V&&!!W.target.closest(".nokey")||!e||!(o&&V||t)||W.button!==0||!W.isPrimary)return;(pe=(fe=W.target)==null?void 0:fe.setPointerCapture)==null||pe.call(fe,W.pointerId),N.current=!1;const{x:ue,y:te}=cf(W.nativeEvent,T.current),Oe=Ok({x:ue,y:te},le);y.setState({userSelectionRect:{width:0,height:0,startX:Oe.x,startY:Oe.y,x:ue,y:te}}),V||(W.stopPropagation(),W.preventDefault())};function H(W,X){const{userSelectionRect:le}=y.getState();if(!le)return;const{transform:V,nodeLookup:Y,edgeLookup:K,connectionLookup:ue,triggerNodeChanges:te,triggerEdgeChanges:Oe,defaultEdgeOptions:fe}=y.getState(),pe={x:le.startX,y:le.startY},{x:Se,y:ve}=T1(pe,V),Le={startX:pe.x,startY:pe.y,x:Wse.id)),C.current=new Set;const De=(fe==null?void 0:fe.selectable)??!0;for(const se of R.current){const ce=ue.get(se);if(ce)for(const{edgeId:ye}of ce.values()){const Ae=K.get(ye);Ae&&(Ae.selectable??De)&&C.current.add(ye)}}if(!Lae(He,R.current)){const se=Hx(Y,R.current,!0);te(se)}if(!Lae(Ge,C.current)){const se=Hx(K,C.current);Oe(se)}y.setState({userSelectionRect:Le,userSelectionActive:!0,nodesSelectionActive:!1})}function q(){if(!r||!T.current)return;const[W,X]=eK(P.current,T.current,A);O({x:W,y:X}).then(le=>{if(!N.current||!le){v.current=requestAnimationFrame(q);return}const{x:V,y:Y}=P.current;H(V,Y),v.current=requestAnimationFrame(q)})}const U=()=>{cancelAnimationFrame(v.current),v.current=0,I.current=!1};p.useEffect(()=>()=>U(),[]);const Z=W=>{const{userSelectionRect:X,transform:le,resetSelectedElements:V}=y.getState();if(!T.current||!X)return;const{x:Y,y:K}=cf(W.nativeEvent,T.current);P.current={x:Y,y:K};const ue=T1({x:X.startX,y:X.startY},le);if(!N.current){const te=t?0:s;if(Math.hypot(Y-ue.x,K-ue.y)<=te)return;V(),l==null||l(W)}N.current=!0,I.current||(q(),I.current=!0),H(Y,K)},z=W=>{var X,le;W.button===0&&((le=(X=W.target)==null?void 0:X.releasePointerCapture)==null||le.call(X,W.pointerId),!w&&W.target===j.current&&y.getState().userSelectionRect&&(D==null||D(W)),y.setState({userSelectionActive:!1,userSelectionRect:null}),N.current&&(c==null||c(W),y.setState({nodesSelectionActive:R.current.size>0})),U())},J=W=>{var X,le;(le=(X=W.target)==null?void 0:X.releasePointerCapture)==null||le.call(X,W.pointerId),U()},ne=i===!0||Array.isArray(i)&&i.includes(0);return a.jsxs("div",{className:no(["react-flow__pane",{draggable:ne,dragging:k,selection:e}]),onClick:E?void 0:e6(D,j),onContextMenu:e6(_,j),onWheel:e6(L,j),onPointerEnter:E?void 0:h,onPointerMove:E?Z:m,onPointerUp:E?z:void 0,onPointerCancel:E?J:void 0,onPointerDownCapture:E?M:void 0,onClickCapture:E?F:void 0,onPointerLeave:g,ref:j,style:CL,children:[b,a.jsx(kHt,{})]})}function F7({id:e,store:t,unselect:n=!1,nodeRef:i}){const{addSelectedNodes:r,unselectNodesAndEdges:s,multiSelectionActive:o,nodeLookup:l,onError:c}=t.getState(),u=l.get(e);if(!u){c==null||c("012",wf.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&o)&&(s({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=i==null?void 0:i.current)==null?void 0:d.blur()})):r([e])}function rBe({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:i,nodeId:r,isSelectable:s,nodeClickDistance:o}){const l=Vs(),[c,u]=p.useState(!1),d=p.useRef();return p.useEffect(()=>{d.current=gVt({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{F7({id:f,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),p.useEffect(()=>{if(!(t||!e.current||!d.current))return d.current.update({noDragClassName:n,handleSelector:i,domNode:e.current,isSelectable:s,nodeId:r,nodeClickDistance:o}),()=>{var f;(f=d.current)==null||f.destroy()}},[n,i,t,s,e,r,o]),c}const EHt=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function sBe(){const e=Vs();return p.useCallback(n=>{const{nodeExtent:i,snapToGrid:r,snapGrid:s,nodesDraggable:o,onError:l,updateNodePositions:c,nodeLookup:u,nodeOrigin:d}=e.getState(),f=new Map,h=EHt(o),m=r?s[0]:5,g=r?s[1]:5,b=n.direction.x*m*n.factor,v=n.direction.y*g*n.factor;for(const[,y]of u){if(!h(y))continue;let w={x:y.internals.positionAbsolute.x+b,y:y.internals.positionAbsolute.y+v};r&&(w=KT(w,s));const{position:x,positionAbsolute:k}=E8e({nodeId:y.id,nextPosition:w,nodeLookup:u,nodeExtent:i,nodeOrigin:d,onError:l});y.position=x,y.internals.positionAbsolute=k,f.set(y.id,y)}c(f)},[])}const cK=p.createContext(null),CHt=cK.Provider;cK.Consumer;const aBe=()=>p.useContext(cK),AHt=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),THt=(e,t,n)=>i=>{const{connectionClickStartHandle:r,connectionMode:s,connection:o}=i,{fromHandle:l,toHandle:c,isValid:u}=o,d=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:d,clickConnecting:(r==null?void 0:r.nodeId)===e&&(r==null?void 0:r.id)===t&&(r==null?void 0:r.type)===n,isPossibleEndHandle:s===E1.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!r,valid:d&&u}};function _Ht({type:e="source",position:t=vn.Top,isValidConnection:n,isConnectable:i=!0,isConnectableStart:r=!0,isConnectableEnd:s=!0,id:o,onConnect:l,children:c,className:u,onMouseDown:d,onTouchStart:f,...h},m){var I,D;const g=o||null,b=e==="target",v=Vs(),y=aBe(),{connectOnClick:w,noPanClassName:x,rfId:k}=or(AHt,zs),{connectingFrom:S,connectingTo:O,clickConnecting:A,isPossibleEndHandle:E,connectionInProcess:j,clickConnectionInProcess:T,valid:R}=or(THt(y,g,e),zs);y||(D=(I=v.getState()).onError)==null||D.call(I,"010",wf.error010());const C=_=>{const{defaultEdgeOptions:L,onConnect:F,hasDefaultEdges:M}=v.getState(),H={...L,..._};if(M){const{edges:q,setEdges:U,onError:Z}=v.getState();U(cHt(H,q,{onError:Z}))}F==null||F(H),l==null||l(H)},N=_=>{if(!y)return;const L=R8e(_.nativeEvent);if(r&&(L&&_.button===0||!L)){const F=v.getState();$7.onPointerDown(_.nativeEvent,{handleDomNode:_.currentTarget,autoPanOnConnect:F.autoPanOnConnect,connectionMode:F.connectionMode,connectionRadius:F.connectionRadius,domNode:F.domNode,nodeLookup:F.nodeLookup,lib:F.lib,isTarget:b,handleId:g,nodeId:y,flowId:F.rfId,panBy:F.panBy,cancelConnection:F.cancelConnection,onConnectStart:F.onConnectStart,onConnectEnd:(...M)=>{var H,q;return(q=(H=v.getState()).onConnectEnd)==null?void 0:q.call(H,...M)},updateConnection:F.updateConnection,onConnect:C,isValidConnection:n||((...M)=>{var H,q;return((q=(H=v.getState()).isValidConnection)==null?void 0:q.call(H,...M))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:F.autoPanSpeed,dragThreshold:F.connectionDragThreshold})}L?d==null||d(_):f==null||f(_)},P=_=>{const{onClickConnectStart:L,onClickConnectEnd:F,connectionClickStartHandle:M,connectionMode:H,isValidConnection:q,lib:U,rfId:Z,nodeLookup:z,connection:J}=v.getState();if(!y||!M&&!r)return;if(!M){L==null||L(_.nativeEvent,{nodeId:y,handleId:g,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:y,type:e,id:g}});return}const ne=j8e(_.target),W=n||q,{connection:X,isValid:le}=$7.isValid(_.nativeEvent,{handle:{nodeId:y,id:g,type:e},connectionMode:H,fromNodeId:M.nodeId,fromHandleId:M.id||null,fromType:M.type,isValidConnection:W,flowId:Z,doc:ne,lib:U,nodeLookup:z});le&&X&&C(X);const V=structuredClone(J);delete V.inProgress,V.toPosition=V.toHandle?V.toHandle.position:null,F==null||F(_,V),v.setState({connectionClickStartHandle:null})};return a.jsx("div",{"data-handleid":g,"data-nodeid":y,"data-handlepos":t,"data-id":`${k}-${y}-${g}-${e}`,className:no(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",x,u,{source:!b,target:b,connectable:i,connectablestart:r,connectableend:s,clickconnecting:A,connectingfrom:S,connectingto:O,valid:R,connectionindicator:i&&(!j||E)&&(j||T?s:r)}]),onMouseDown:N,onTouchStart:N,onClick:w?P:void 0,ref:m,...h,children:c})}const Dc=p.memo(nBe(_Ht));function jHt({data:e,isConnectable:t,sourcePosition:n=vn.Bottom}){return a.jsxs(a.Fragment,{children:[e==null?void 0:e.label,a.jsx(Dc,{type:"source",position:n,isConnectable:t})]})}function NHt({data:e,isConnectable:t,targetPosition:n=vn.Top,sourcePosition:i=vn.Bottom}){return a.jsxs(a.Fragment,{children:[a.jsx(Dc,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,a.jsx(Dc,{type:"source",position:i,isConnectable:t})]})}function RHt(){return null}function IHt({data:e,isConnectable:t,targetPosition:n=vn.Top}){return a.jsxs(a.Fragment,{children:[a.jsx(Dc,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const TP={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},coe={input:jHt,default:NHt,output:IHt,group:RHt};function PHt(e){var t,n,i,r;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??((i=e.style)==null?void 0:i.width),height:e.height??((r=e.style)==null?void 0:r.height)}}const DHt=e=>{const{width:t,height:n,x:i,y:r}=WT(e.nodeLookup,{filter:s=>!!s.selected});return{width:lf(t)?t:null,height:lf(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${i}px,${r}px)`}};function MHt({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=Vs(),{width:r,height:s,transformString:o,userSelectionActive:l}=or(DHt,zs),c=sBe(),u=p.useRef(null);p.useEffect(()=>{var m;n||(m=u.current)==null||m.focus({preventScroll:!0})},[n]);const d=!l&&r!==null&&s!==null;if(rBe({nodeRef:u,disabled:!d}),!d)return null;const f=e?m=>{const g=i.getState().nodes.filter(b=>b.selected);e(m,g)}:void 0,h=m=>{Object.prototype.hasOwnProperty.call(TP,m.key)&&(m.preventDefault(),c({direction:TP[m.key],factor:m.shiftKey?4:1}))};return a.jsx("div",{className:no(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:a.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:r,height:s}})})}const uoe=typeof window<"u"?window:void 0,LHt=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function oBe({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:o,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:d,selectionMode:f,onSelectionStart:h,onSelectionEnd:m,multiSelectionKeyCode:g,panActivationKeyCode:b,zoomActivationKeyCode:v,elementsSelectable:y,zoomOnScroll:w,zoomOnPinch:x,panOnScroll:k,panOnScrollSpeed:S,panOnScrollMode:O,zoomOnDoubleClick:A,panOnDrag:E,autoPanOnSelection:j,defaultViewport:T,translateExtent:R,minZoom:C,maxZoom:N,preventScrolling:P,onSelectionContextMenu:I,noWheelClassName:D,noPanClassName:_,disableKeyboardA11y:L,onViewportChange:F,isControlledViewport:M}){const{nodesSelectionActive:H,userSelectionActive:q}=or(LHt,zs),U=pA(u,{target:uoe}),Z=pA(b,{target:uoe}),z=Z||E,J=Z||k,ne=d&&z!==!0,W=U||q||ne;return bHt({deleteKeyCode:c,multiSelectionKeyCode:g}),a.jsx(xHt,{onPaneContextMenu:s,elementsSelectable:y,zoomOnScroll:w,zoomOnPinch:x,panOnScroll:J,panOnScrollSpeed:S,panOnScrollMode:O,zoomOnDoubleClick:A,panOnDrag:!U&&z,defaultViewport:T,translateExtent:R,minZoom:C,maxZoom:N,zoomActivationKeyCode:v,preventScrolling:P,noWheelClassName:D,noPanClassName:_,onViewportChange:F,isControlledViewport:M,paneClickDistance:l,selectionOnDrag:ne,children:a.jsxs(SHt,{onSelectionStart:h,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:o,panOnDrag:z,autoPanOnSelection:j,isSelecting:!!W,selectionMode:f,selectionKeyPressed:U,paneClickDistance:l,selectionOnDrag:ne,children:[e,H&&a.jsx(MHt,{onSelectionContextMenu:I,noPanClassName:_,disableKeyboardA11y:L})]})})}oBe.displayName="FlowRenderer";const $Ht=p.memo(oBe),FHt=e=>t=>e?JW(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 BHt(e){return or(p.useCallback(FHt(e),[e]),zs)}const UHt=e=>e.updateNodeInternals;function QHt(){const e=or(UHt),[t]=p.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const i=new Map;n.forEach(r=>{const s=r.target.getAttribute("data-id");i.set(s,{id:s,nodeElement:r.target,force:!0})}),e(i)}));return p.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function zHt({node:e,nodeType:t,hasDimensions:n,resizeObserver:i}){const r=Vs(),s=p.useRef(null),o=p.useRef(null),l=p.useRef(e.sourcePosition),c=p.useRef(e.targetPosition),u=p.useRef(t),d=n&&!!e.internals.handleBounds;return p.useEffect(()=>{s.current&&!e.hidden&&(!d||o.current!==s.current)&&(o.current&&(i==null||i.unobserve(o.current)),i==null||i.observe(s.current),o.current=s.current)},[d,e.hidden]),p.useEffect(()=>()=>{o.current&&(i==null||i.unobserve(o.current),o.current=null)},[]),p.useEffect(()=>{if(s.current){const f=u.current!==t,h=l.current!==e.sourcePosition,m=c.current!==e.targetPosition;(f||h||m)&&(u.current=t,l.current=e.sourcePosition,c.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:s.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),s}function VHt({id:e,onClick:t,onMouseEnter:n,onMouseMove:i,onMouseLeave:r,onContextMenu:s,onDoubleClick:o,nodesDraggable:l,elementsSelectable:c,nodesConnectable:u,nodesFocusable:d,resizeObserver:f,noDragClassName:h,noPanClassName:m,disableKeyboardA11y:g,rfId:b,nodeTypes:v,nodeClickDistance:y,onError:w}){const{node:x,internals:k,isParent:S}=or(W=>{const X=W.nodeLookup.get(e),le=W.parentLookup.has(e);return{node:X,internals:X.internals,isParent:le}},zs);let O=x.type||"default",A=(v==null?void 0:v[O])||coe[O];A===void 0&&(w==null||w("003",wf.error003(O)),O="default",A=(v==null?void 0:v.default)||coe.default);const E=!!(x.draggable||l&&typeof x.draggable>"u"),j=!!(x.selectable||c&&typeof x.selectable>"u"),T=!!(x.connectable||u&&typeof x.connectable>"u"),R=!!(x.focusable||d&&typeof x.focusable>"u"),C=Vs(),N=nK(x),P=zHt({node:x,nodeType:O,hasDimensions:N,resizeObserver:f}),I=rBe({nodeRef:P,disabled:x.hidden||!E,noDragClassName:h,handleSelector:x.dragHandle,nodeId:e,isSelectable:j,nodeClickDistance:y}),D=sBe();if(x.hidden)return null;const _=km(x),L=PHt(x),F=j||E||t||n||i||r,M=n?W=>n(W,{...k.userNode}):void 0,H=i?W=>i(W,{...k.userNode}):void 0,q=r?W=>r(W,{...k.userNode}):void 0,U=s?W=>s(W,{...k.userNode}):void 0,Z=o?W=>o(W,{...k.userNode}):void 0,z=W=>{const{selectNodesOnDrag:X,nodeDragThreshold:le}=C.getState();j&&(!X||!E||le>0)&&F7({id:e,store:C,nodeRef:P}),t&&t(W,{...k.userNode})},J=W=>{if(!(N8e(W.nativeEvent)||g)){if(x8e.includes(W.key)&&j){const X=W.key==="Escape";F7({id:e,store:C,unselect:X,nodeRef:P})}else if(E&&x.selected&&Object.prototype.hasOwnProperty.call(TP,W.key)){W.preventDefault();const{ariaLabelConfig:X}=C.getState();C.setState({ariaLiveMessage:X["node.a11yDescription.ariaLiveMessage"]({direction:W.key.replace("Arrow","").toLowerCase(),x:~~k.positionAbsolute.x,y:~~k.positionAbsolute.y})}),D({direction:TP[W.key],factor:W.shiftKey?4:1})}}},ne=()=>{var ue;if(g||!((ue=P.current)!=null&&ue.matches(":focus-visible")))return;const{transform:W,width:X,height:le,autoPanOnNodeFocus:V,setCenter:Y}=C.getState();if(!V)return;JW(new Map([[e,x]]),{x:0,y:0,width:X,height:le},W,!0).length>0||Y(x.position.x+_.width/2,x.position.y+_.height/2,{zoom:W[2]})};return a.jsx("div",{className:no(["react-flow__node",`react-flow__node-${O}`,{[m]:E},x.className,{selected:x.selected,selectable:j,parent:S,draggable:E,dragging:I}]),ref:P,style:{zIndex:k.z,transform:`translate(${k.positionAbsolute.x}px,${k.positionAbsolute.y}px)`,pointerEvents:F?"all":"none",visibility:N?"visible":"hidden",...x.style,...L},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:M,onMouseMove:H,onMouseLeave:q,onContextMenu:U,onClick:z,onDoubleClick:Z,onKeyDown:R?J:void 0,tabIndex:R?0:void 0,onFocus:R?ne:void 0,role:x.ariaRole??(R?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${X8e}-${b}`,"aria-label":x.ariaLabel,...x.domAttributes,children:a.jsx(CHt,{value:e,children:a.jsx(A,{id:e,data:x.data,type:O,positionAbsoluteX:k.positionAbsolute.x,positionAbsoluteY:k.positionAbsolute.y,selected:x.selected??!1,selectable:j,draggable:E,deletable:x.deletable??!0,isConnectable:T,sourcePosition:x.sourcePosition,targetPosition:x.targetPosition,dragging:I,dragHandle:x.dragHandle,zIndex:k.z,parentId:x.parentId,..._})})})}var HHt=p.memo(VHt);const qHt=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function lBe(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,onError:s}=or(qHt,zs),o=BHt(e.onlyRenderVisibleElements),l=QHt();return a.jsx("div",{className:"react-flow__nodes",style:CL,children:o.map(c=>a.jsx(HHt,{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:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:s},c))})}lBe.displayName="NodeRenderer";const WHt=p.memo(lBe);function KHt(e){return or(p.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const i=[];if(n.width&&n.height)for(const r of n.edges){const s=n.nodeLookup.get(r.source),o=n.nodeLookup.get(r.target);s&&o&&Yzt({sourceNode:s,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&i.push(r.id)}return i},[e]),zs)}const GHt=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return a.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},XHt=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return a.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},doe={[dA.Arrow]:GHt,[dA.ArrowClosed]:XHt};function YHt(e){const t=Vs();return p.useMemo(()=>{var r,s;return Object.prototype.hasOwnProperty.call(doe,e)?doe[e]:((s=(r=t.getState()).onError)==null||s.call(r,"009",wf.error009(e)),null)},[e])}const ZHt=({id:e,type:t,color:n,width:i=12.5,height:r=12.5,markerUnits:s="strokeWidth",strokeWidth:o,orient:l="auto-start-reverse"})=>{const c=YHt(t);return c?a.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:l,refX:"0",refY:"0",children:a.jsx(c,{color:n,strokeWidth:o})}):null},cBe=({defaultColor:e,rfId:t})=>{const n=or(s=>s.edges),i=or(s=>s.defaultEdgeOptions),r=p.useMemo(()=>sVt(n,{id:t,defaultColor:e,defaultMarkerStart:i==null?void 0:i.markerStart,defaultMarkerEnd:i==null?void 0:i.markerEnd}),[n,i,t,e]);return r.length?a.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:a.jsx("defs",{children:r.map(s=>a.jsx(ZHt,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null};cBe.displayName="MarkerDefinitions";var JHt=p.memo(cBe);function uBe({x:e,y:t,label:n,labelStyle:i,labelShowBg:r=!0,labelBgStyle:s,labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...d}){const[f,h]=p.useState({x:1,y:0,width:0,height:0}),m=no(["react-flow__edge-textwrapper",u]),g=p.useRef(null);return p.useEffect(()=>{if(g.current){const b=g.current.getBBox();h({x:b.x,y:b.y,width:b.width,height:b.height})}},[n]),n?a.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:m,visibility:f.width?"visible":"hidden",...d,children:[r&&a.jsx("rect",{width:f.width+2*o[0],x:-o[0],y:-o[1],height:f.height+2*o[1],className:"react-flow__edge-textbg",style:s,rx:l,ry:l}),a.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:g,style:i,children:n}),c]}):null}uBe.displayName="EdgeText";const eqt=p.memo(uBe);function GT({path:e,labelX:t,labelY:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:u=20,...d}){return a.jsxs(a.Fragment,{children:[a.jsx("path",{...d,d:e,fill:"none",className:no(["react-flow__edge-path",d.className])}),u?a.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,i&&lf(t)&&lf(n)?a.jsx(eqt,{x:t,y:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function foe({pos:e,x1:t,y1:n,x2:i,y2:r}){return e===vn.Left||e===vn.Right?[.5*(t+i),n]:[t,.5*(n+r)]}function dBe({sourceX:e,sourceY:t,sourcePosition:n=vn.Bottom,targetX:i,targetY:r,targetPosition:s=vn.Top}){const[o,l]=foe({pos:n,x1:e,y1:t,x2:i,y2:r}),[c,u]=foe({pos:s,x1:i,y1:r,x2:e,y2:t}),[d,f,h,m]=I8e({sourceX:e,sourceY:t,targetX:i,targetY:r,sourceControlX:o,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${o},${l} ${c},${u} ${i},${r}`,d,f,h,m]}function fBe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:o,targetPosition:l,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,interactionWidth:y})=>{const[w,x,k]=dBe({sourceX:n,sourceY:i,sourcePosition:o,targetX:r,targetY:s,targetPosition:l}),S=e.isInternal?void 0:t;return a.jsx(GT,{id:S,path:w,labelX:x,labelY:k,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,interactionWidth:y})})}const tqt=fBe({isInternal:!1}),hBe=fBe({isInternal:!0});tqt.displayName="SimpleBezierEdge";hBe.displayName="SimpleBezierEdgeInternal";function pBe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:m=vn.Bottom,targetPosition:g=vn.Top,markerEnd:b,markerStart:v,pathOptions:y,interactionWidth:w})=>{const[x,k,S]=AP({sourceX:n,sourceY:i,sourcePosition:m,targetX:r,targetY:s,targetPosition:g,borderRadius:y==null?void 0:y.borderRadius,offset:y==null?void 0:y.offset,stepPosition:y==null?void 0:y.stepPosition}),O=e.isInternal?void 0:t;return a.jsx(GT,{id:O,path:x,labelX:k,labelY:S,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:b,markerStart:v,interactionWidth:w})})}const mBe=pBe({isInternal:!1}),gBe=pBe({isInternal:!0});mBe.displayName="SmoothStepEdge";gBe.displayName="SmoothStepEdgeInternal";function bBe(e){return p.memo(({id:t,...n})=>{var r;const i=e.isInternal?void 0:t;return a.jsx(mBe,{...n,id:i,pathOptions:p.useMemo(()=>{var s;return{borderRadius:0,offset:(s=n.pathOptions)==null?void 0:s.offset}},[(r=n.pathOptions)==null?void 0:r.offset])})})}const nqt=bBe({isInternal:!1}),yBe=bBe({isInternal:!0});nqt.displayName="StepEdge";yBe.displayName="StepEdgeInternal";function vBe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:g,interactionWidth:b})=>{const[v,y,w]=M8e({sourceX:n,sourceY:i,targetX:r,targetY:s}),x=e.isInternal?void 0:t;return a.jsx(GT,{id:x,path:v,labelX:y,labelY:w,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:g,interactionWidth:b})})}const iqt=vBe({isInternal:!1}),xBe=vBe({isInternal:!0});iqt.displayName="StraightEdge";xBe.displayName="StraightEdgeInternal";function wBe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:o=vn.Bottom,targetPosition:l=vn.Top,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,pathOptions:y,interactionWidth:w})=>{const[x,k,S]=P8e({sourceX:n,sourceY:i,sourcePosition:o,targetX:r,targetY:s,targetPosition:l,curvature:y==null?void 0:y.curvature}),O=e.isInternal?void 0:t;return a.jsx(GT,{id:O,path:x,labelX:k,labelY:S,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,interactionWidth:w})})}const rqt=wBe({isInternal:!1}),kBe=wBe({isInternal:!0});rqt.displayName="BezierEdge";kBe.displayName="BezierEdgeInternal";const hoe={default:kBe,straight:xBe,step:yBe,smoothstep:gBe,simplebezier:hBe},poe={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},sqt=(e,t,n)=>n===vn.Left?e-t:n===vn.Right?e+t:e,aqt=(e,t,n)=>n===vn.Top?e-t:n===vn.Bottom?e+t:e,moe="react-flow__edgeupdater";function goe({position:e,centerX:t,centerY:n,radius:i=10,onMouseDown:r,onMouseEnter:s,onMouseOut:o,type:l}){return a.jsx("circle",{onMouseDown:r,onMouseEnter:s,onMouseOut:o,className:no([moe,`${moe}-${l}`]),cx:sqt(t,i,e),cy:aqt(n,i,e),r:i,stroke:"transparent",fill:"transparent"})}function oqt({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:i,sourceY:r,targetX:s,targetY:o,sourcePosition:l,targetPosition:c,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:m}){const g=Vs(),b=(k,S)=>{if(k.button!==0)return;const{autoPanOnConnect:O,domNode:A,connectionMode:E,connectionRadius:j,lib:T,onConnectStart:R,cancelConnection:C,nodeLookup:N,rfId:P,panBy:I,updateConnection:D}=g.getState(),_=S.type==="target",L=(H,q)=>{h(!1),f==null||f(H,n,S.type,q)},F=H=>u==null?void 0:u(n,H),M=(H,q)=>{h(!0),d==null||d(k,n,S.type),R==null||R(H,q)};$7.onPointerDown(k.nativeEvent,{autoPanOnConnect:O,connectionMode:E,connectionRadius:j,domNode:A,handleId:S.id,nodeId:S.nodeId,nodeLookup:N,isTarget:_,edgeUpdaterType:S.type,lib:T,flowId:P,cancelConnection:C,panBy:I,isValidConnection:(...H)=>{var q,U;return((U=(q=g.getState()).isValidConnection)==null?void 0:U.call(q,...H))??!0},onConnect:F,onConnectStart:M,onConnectEnd:(...H)=>{var q,U;return(U=(q=g.getState()).onConnectEnd)==null?void 0:U.call(q,...H)},onReconnectEnd:L,updateConnection:D,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold,handleDomNode:k.currentTarget})},v=k=>b(k,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),y=k=>b(k,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),w=()=>m(!0),x=()=>m(!1);return a.jsxs(a.Fragment,{children:[(e===!0||e==="source")&&a.jsx(goe,{position:l,centerX:i,centerY:r,radius:t,onMouseDown:v,onMouseEnter:w,onMouseOut:x,type:"source"}),(e===!0||e==="target")&&a.jsx(goe,{position:c,centerX:s,centerY:o,radius:t,onMouseDown:y,onMouseEnter:w,onMouseOut:x,type:"target"})]})}function lqt({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:i,onClick:r,onDoubleClick:s,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:m,rfId:g,edgeTypes:b,noPanClassName:v,onError:y,disableKeyboardA11y:w}){let x=or(Y=>Y.edgeLookup.get(e));const k=or(Y=>Y.defaultEdgeOptions);x=k?{...k,...x}:x;let S=x.type||"default",O=(b==null?void 0:b[S])||hoe[S];O===void 0&&(y==null||y("011",wf.error011(S)),S="default",O=(b==null?void 0:b.default)||hoe.default);const A=!!(x.focusable||t&&typeof x.focusable>"u"),E=typeof f<"u"&&(x.reconnectable||n&&typeof x.reconnectable>"u"),j=!!(x.selectable||i&&typeof x.selectable>"u"),T=p.useRef(null),[R,C]=p.useState(!1),[N,P]=p.useState(!1),I=Vs(),{zIndex:D,sourceX:_,sourceY:L,targetX:F,targetY:M,sourcePosition:H,targetPosition:q}=or(p.useCallback(Y=>{const K=Y.nodeLookup.get(x.source),ue=Y.nodeLookup.get(x.target);if(!K||!ue)return{zIndex:x.zIndex,...poe};const te=rVt({id:e,sourceNode:K,targetNode:ue,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:Y.connectionMode,onError:y});return{zIndex:Xzt({selected:x.selected,zIndex:x.zIndex,sourceNode:K,targetNode:ue,elevateOnSelect:Y.elevateEdgesOnSelect,zIndexMode:Y.zIndexMode}),...te||poe}},[x.source,x.target,x.sourceHandle,x.targetHandle,x.selected,x.zIndex]),zs),U=p.useMemo(()=>x.markerStart?`url('#${M7(x.markerStart,g)}')`:void 0,[x.markerStart,g]),Z=p.useMemo(()=>x.markerEnd?`url('#${M7(x.markerEnd,g)}')`:void 0,[x.markerEnd,g]);if(x.hidden||_===null||L===null||F===null||M===null)return null;const z=Y=>{var Oe;const{addSelectedEdges:K,unselectNodesAndEdges:ue,multiSelectionActive:te}=I.getState();j&&(I.setState({nodesSelectionActive:!1}),x.selected&&te?(ue({nodes:[],edges:[x]}),(Oe=T.current)==null||Oe.blur()):K([e])),r&&r(Y,x)},J=s?Y=>{s(Y,{...x})}:void 0,ne=o?Y=>{o(Y,{...x})}:void 0,W=l?Y=>{l(Y,{...x})}:void 0,X=c?Y=>{c(Y,{...x})}:void 0,le=u?Y=>{u(Y,{...x})}:void 0,V=Y=>{var K;if(!w&&x8e.includes(Y.key)&&j){const{unselectNodesAndEdges:ue,addSelectedEdges:te}=I.getState();Y.key==="Escape"?((K=T.current)==null||K.blur(),ue({edges:[x]})):te([e])}};return a.jsx("svg",{style:{zIndex:D},children:a.jsxs("g",{className:no(["react-flow__edge",`react-flow__edge-${S}`,x.className,v,{selected:x.selected,animated:x.animated,inactive:!j&&!r,updating:R,selectable:j}]),onClick:z,onDoubleClick:J,onContextMenu:ne,onMouseEnter:W,onMouseMove:X,onMouseLeave:le,onKeyDown:A?V:void 0,tabIndex:A?0:void 0,role:x.ariaRole??(A?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":x.ariaLabel===null?void 0:x.ariaLabel||`Edge from ${x.source} to ${x.target}`,"aria-describedby":A?`${Y8e}-${g}`:void 0,ref:T,...x.domAttributes,children:[!N&&a.jsx(O,{id:e,source:x.source,target:x.target,type:x.type,selected:x.selected,animated:x.animated,selectable:j,deletable:x.deletable??!0,label:x.label,labelStyle:x.labelStyle,labelShowBg:x.labelShowBg,labelBgStyle:x.labelBgStyle,labelBgPadding:x.labelBgPadding,labelBgBorderRadius:x.labelBgBorderRadius,sourceX:_,sourceY:L,targetX:F,targetY:M,sourcePosition:H,targetPosition:q,data:x.data,style:x.style,sourceHandleId:x.sourceHandle,targetHandleId:x.targetHandle,markerStart:U,markerEnd:Z,pathOptions:"pathOptions"in x?x.pathOptions:void 0,interactionWidth:x.interactionWidth}),E&&a.jsx(oqt,{edge:x,isReconnectable:E,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:m,sourceX:_,sourceY:L,targetX:F,targetY:M,sourcePosition:H,targetPosition:q,setUpdateHover:C,setReconnecting:P})]})})}var cqt=p.memo(lqt);const uqt=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function OBe({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:i,noPanClassName:r,onReconnect:s,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:h,onReconnectStart:m,onReconnectEnd:g,disableKeyboardA11y:b}){const{edgesFocusable:v,edgesReconnectable:y,elementsSelectable:w,onError:x}=or(uqt,zs),k=KHt(t);return a.jsxs("div",{className:"react-flow__edges",children:[a.jsx(JHt,{defaultColor:e,rfId:n}),k.map(S=>a.jsx(cqt,{id:S,edgesFocusable:v,edgesReconnectable:y,elementsSelectable:w,noPanClassName:r,onReconnect:s,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:m,onReconnectEnd:g,rfId:n,onError:x,edgeTypes:i,disableKeyboardA11y:b},S))]})}OBe.displayName="EdgeRenderer";const dqt=p.memo(OBe),fqt=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function hqt({children:e}){const t=or(fqt);return a.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function pqt(e){const t=EL(),n=p.useRef(!1);p.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const mqt=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function gqt(e){const t=or(mqt),n=Vs();return p.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function bqt(e){return e.connection.inProgress?{...e.connection,to:Ok(e.connection.to,e.transform)}:{...e.connection}}function yqt(e){return bqt}function vqt(e){const t=yqt();return or(t,zs)}const xqt=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function wqt({containerStyle:e,style:t,type:n,component:i}){const{nodesConnectable:r,width:s,height:o,isValid:l,inProgress:c}=or(xqt,zs);return!(s&&r&&c)?null:a.jsx("svg",{style:e,width:s,height:o,className:"react-flow__connectionline react-flow__container",children:a.jsx("g",{className:no(["react-flow__connection",O8e(l)]),children:a.jsx(SBe,{style:t,type:n,CustomComponent:i,isValid:l})})})}const SBe=({style:e,type:t=og.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:r,from:s,fromNode:o,fromHandle:l,fromPosition:c,to:u,toNode:d,toHandle:f,toPosition:h,pointer:m}=vqt();if(!r)return;if(n)return a.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:l,fromX:s.x,fromY:s.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:h,connectionStatus:O8e(i),toNode:d,toHandle:f,pointer:m});let g="";const b={sourceX:s.x,sourceY:s.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case og.Bezier:[g]=P8e(b);break;case og.SimpleBezier:[g]=dBe(b);break;case og.Step:[g]=AP({...b,borderRadius:0});break;case og.SmoothStep:[g]=AP(b);break;default:[g]=M8e(b)}return a.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:e})};SBe.displayName="ConnectionLine";const kqt={};function boe(e=kqt){p.useRef(e),Vs(),p.useEffect(()=>{},[e])}function Oqt(){Vs(),p.useRef(!1),p.useEffect(()=>{},[])}function EBe({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:i,onEdgeClick:r,onNodeDoubleClick:s,onEdgeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:h,onSelectionEnd:m,connectionLineType:g,connectionLineStyle:b,connectionLineComponent:v,connectionLineContainerStyle:y,selectionKeyCode:w,selectionOnDrag:x,selectionMode:k,multiSelectionKeyCode:S,panActivationKeyCode:O,zoomActivationKeyCode:A,deleteKeyCode:E,onlyRenderVisibleElements:j,elementsSelectable:T,defaultViewport:R,translateExtent:C,minZoom:N,maxZoom:P,preventScrolling:I,defaultMarkerColor:D,zoomOnScroll:_,zoomOnPinch:L,panOnScroll:F,panOnScrollSpeed:M,panOnScrollMode:H,zoomOnDoubleClick:q,panOnDrag:U,autoPanOnSelection:Z,onPaneClick:z,onPaneMouseEnter:J,onPaneMouseMove:ne,onPaneMouseLeave:W,onPaneScroll:X,onPaneContextMenu:le,paneClickDistance:V,nodeClickDistance:Y,onEdgeContextMenu:K,onEdgeMouseEnter:ue,onEdgeMouseMove:te,onEdgeMouseLeave:Oe,reconnectRadius:fe,onReconnect:pe,onReconnectStart:Se,onReconnectEnd:ve,noDragClassName:Le,noWheelClassName:He,noPanClassName:Ge,disableKeyboardA11y:De,nodeExtent:se,rfId:ce,viewport:ye,onViewportChange:Ae}){return boe(e),boe(t),Oqt(),pqt(n),gqt(ye),a.jsx($Ht,{onPaneClick:z,onPaneMouseEnter:J,onPaneMouseMove:ne,onPaneMouseLeave:W,onPaneContextMenu:le,onPaneScroll:X,paneClickDistance:V,deleteKeyCode:E,selectionKeyCode:w,selectionOnDrag:x,selectionMode:k,onSelectionStart:h,onSelectionEnd:m,multiSelectionKeyCode:S,panActivationKeyCode:O,zoomActivationKeyCode:A,elementsSelectable:T,zoomOnScroll:_,zoomOnPinch:L,zoomOnDoubleClick:q,panOnScroll:F,panOnScrollSpeed:M,panOnScrollMode:H,panOnDrag:U,autoPanOnSelection:Z,defaultViewport:R,translateExtent:C,minZoom:N,maxZoom:P,onSelectionContextMenu:f,preventScrolling:I,noDragClassName:Le,noWheelClassName:He,noPanClassName:Ge,disableKeyboardA11y:De,onViewportChange:Ae,isControlledViewport:!!ye,children:a.jsxs(hqt,{children:[a.jsx(dqt,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:o,onReconnect:pe,onReconnectStart:Se,onReconnectEnd:ve,onlyRenderVisibleElements:j,onEdgeContextMenu:K,onEdgeMouseEnter:ue,onEdgeMouseMove:te,onEdgeMouseLeave:Oe,reconnectRadius:fe,defaultMarkerColor:D,noPanClassName:Ge,disableKeyboardA11y:De,rfId:ce}),a.jsx(wqt,{style:b,type:g,component:v,containerStyle:y}),a.jsx("div",{className:"react-flow__edgelabel-renderer"}),a.jsx(WHt,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:Y,onlyRenderVisibleElements:j,noPanClassName:Ge,noDragClassName:Le,disableKeyboardA11y:De,nodeExtent:se,rfId:ce}),a.jsx("div",{className:"react-flow__viewport-portal"})]})})}EBe.displayName="GraphView";const Sqt=p.memo(EBe),Eqt=T8e(),yoe=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:o,fitViewOptions:l,minZoom:c=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:f,zIndexMode:h="basic"}={})=>{const m=new Map,g=new Map,b=new Map,v=new Map,y=i??t??[],w=n??e??[],x=d??[0,0],k=f??cA;F8e(b,v,y);const{nodesInitialized:S}=L7(w,m,g,{nodeOrigin:x,nodeExtent:k,zIndexMode:h});let O=[0,0,1];if(o&&r&&s){const A=WT(m,{filter:R=>!!((R.width||R.initialWidth)&&(R.height||R.initialHeight))}),{x:E,y:j,zoom:T}=tK(A,r,s,c,u,(l==null?void 0:l.padding)??.1);O=[E,j,T]}return{rfId:"1",width:r??0,height:s??0,transform:O,nodes:w,nodesInitialized:S,nodeLookup:m,parentLookup:g,edges:y,edgeLookup:v,connectionLookup:b,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:cA,nodeExtent:k,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:E1.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:x,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:o??!1,fitViewOptions:l,fitViewResolver:null,connection:{...k8e},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Eqt,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:w8e,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Cqt=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h})=>UVt((m,g)=>{async function b(){const{nodeLookup:v,panZoom:y,fitViewOptions:w,fitViewResolver:x,width:k,height:S,minZoom:O,maxZoom:A}=g();y&&(await zzt({nodes:v,width:k,height:S,panZoom:y,minZoom:O,maxZoom:A},w),x==null||x.resolve(!0),m({fitViewResolver:null}))}return{...yoe({nodes:e,edges:t,width:r,height:s,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,defaultNodes:n,defaultEdges:i,zIndexMode:h}),setNodes:v=>{const{nodeLookup:y,parentLookup:w,nodeOrigin:x,elevateNodesOnSelect:k,fitViewQueued:S,zIndexMode:O,nodesSelectionActive:A}=g(),{nodesInitialized:E,hasSelectedNodes:j}=L7(v,y,w,{nodeOrigin:x,nodeExtent:f,elevateNodesOnSelect:k,checkEquality:!0,zIndexMode:O}),T=A&&j;S&&E?(b(),m({nodes:v,nodesInitialized:E,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:T})):m({nodes:v,nodesInitialized:E,nodesSelectionActive:T})},setEdges:v=>{const{connectionLookup:y,edgeLookup:w}=g();F8e(y,w,v),m({edges:v})},setDefaultNodesAndEdges:(v,y)=>{if(v){const{setNodes:w}=g();w(v),m({hasDefaultNodes:!0})}if(y){const{setEdges:w}=g();w(y),m({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:y,nodeLookup:w,parentLookup:x,domNode:k,nodeOrigin:S,nodeExtent:O,debug:A,fitViewQueued:E,zIndexMode:j}=g(),{changes:T,updatedInternals:R}=fVt(v,w,x,k,S,O,j);R&&(lVt(w,x,{nodeOrigin:S,nodeExtent:O,zIndexMode:j}),E?(b(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(T==null?void 0:T.length)>0&&(A&&console.log("React Flow: trigger node changes",T),y==null||y(T)))},updateNodePositions:(v,y=!1)=>{const w=[];let x=[];const{nodeLookup:k,triggerNodeChanges:S,connection:O,updateConnection:A,onNodesChangeMiddlewareMap:E}=g();for(const[j,T]of v){const R=k.get(j),C=!!(R!=null&&R.expandParent&&(R!=null&&R.parentId)&&(T!=null&&T.position)),N={id:j,type:"position",position:C?{x:Math.max(0,T.position.x),y:Math.max(0,T.position.y)}:T.position,dragging:y};if(R&&O.inProgress&&O.fromNode.id===R.id){const P=Av(R,O.fromHandle,vn.Left,!0);A({...O,from:P})}C&&R.parentId&&w.push({id:j,parentId:R.parentId,rect:{...T.internals.positionAbsolute,width:T.measured.width??0,height:T.measured.height??0}}),x.push(N)}if(w.length>0){const{parentLookup:j,nodeOrigin:T}=g(),R=lK(w,k,j,T);x.push(...R)}for(const j of E.values())x=j(x);S(x)},triggerNodeChanges:v=>{const{onNodesChange:y,setNodes:w,nodes:x,hasDefaultNodes:k,debug:S}=g();if(v!=null&&v.length){if(k){const O=eBe(v,x);w(O)}S&&console.log("React Flow: trigger node changes",v),y==null||y(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:y,setEdges:w,edges:x,hasDefaultEdges:k,debug:S}=g();if(v!=null&&v.length){if(k){const O=tBe(v,x);w(O)}S&&console.log("React Flow: trigger edge changes",v),y==null||y(v)}},addSelectedNodes:v=>{const{multiSelectionActive:y,edgeLookup:w,nodeLookup:x,triggerNodeChanges:k,triggerEdgeChanges:S}=g();if(y){const O=v.map(A=>py(A,!0));k(O);return}k(Hx(x,new Set([...v]),!0)),S(Hx(w))},addSelectedEdges:v=>{const{multiSelectionActive:y,edgeLookup:w,nodeLookup:x,triggerNodeChanges:k,triggerEdgeChanges:S}=g();if(y){const O=v.map(A=>py(A,!0));S(O);return}S(Hx(w,new Set([...v]))),k(Hx(x,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:y}={})=>{const{edges:w,nodes:x,nodeLookup:k,triggerNodeChanges:S,triggerEdgeChanges:O}=g(),A=v||x,E=y||w,j=[];for(const R of A){if(!R.selected)continue;const C=k.get(R.id);C&&(C.selected=!1),j.push(py(R.id,!1))}const T=[];for(const R of E)R.selected&&T.push(py(R.id,!1));S(j),O(T)},setMinZoom:v=>{const{panZoom:y,maxZoom:w}=g();y==null||y.setScaleExtent([v,w]),m({minZoom:v})},setMaxZoom:v=>{const{panZoom:y,minZoom:w}=g();y==null||y.setScaleExtent([w,v]),m({maxZoom:v})},setTranslateExtent:v=>{var y;(y=g().panZoom)==null||y.setTranslateExtent(v),m({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:y,triggerNodeChanges:w,triggerEdgeChanges:x,elementsSelectable:k}=g();if(!k)return;const S=y.reduce((A,E)=>E.selected?[...A,py(E.id,!1)]:A,[]),O=v.reduce((A,E)=>E.selected?[...A,py(E.id,!1)]:A,[]);w(S),x(O)},setNodeExtent:v=>{const{nodes:y,nodeLookup:w,parentLookup:x,nodeOrigin:k,elevateNodesOnSelect:S,nodeExtent:O,zIndexMode:A}=g();v[0][0]===O[0][0]&&v[0][1]===O[0][1]&&v[1][0]===O[1][0]&&v[1][1]===O[1][1]||(L7(y,w,x,{nodeOrigin:k,nodeExtent:v,elevateNodesOnSelect:S,checkEquality:!1,zIndexMode:A}),m({nodeExtent:v}))},panBy:v=>{const{transform:y,width:w,height:x,panZoom:k,translateExtent:S}=g();return hVt({delta:v,panZoom:k,transform:y,translateExtent:S,width:w,height:x})},setCenter:async(v,y,w)=>{const{width:x,height:k,maxZoom:S,panZoom:O}=g();if(!O)return!1;const A=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:S;return await O.setViewport({x:x/2-v*A,y:k/2-y*A,zoom:A},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),!0},cancelConnection:()=>{m({connection:{...k8e}})},updateConnection:v=>{m({connection:v})},reset:()=>m({...yoe()})}},Object.is);function CBe({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:i,initialWidth:r,initialHeight:s,initialMinZoom:o,initialMaxZoom:l,initialFitViewOptions:c,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:m}){const[g]=p.useState(()=>Cqt({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:u,minZoom:o,maxZoom:l,fitViewOptions:c,nodeOrigin:d,nodeExtent:f,zIndexMode:h}));return a.jsx(QVt,{value:g,children:a.jsx(hHt,{children:m})})}function Aqt({children:e,nodes:t,edges:n,defaultNodes:i,defaultEdges:r,width:s,height:o,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:m}){return p.useContext(OL)?a.jsx(a.Fragment,{children:e}):a.jsx(CBe,{initialNodes:t,initialEdges:n,defaultNodes:i,defaultEdges:r,initialWidth:s,initialHeight:o,fitView:l,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:m,children:e})}const Tqt={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function _qt({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,className:r,nodeTypes:s,edgeTypes:o,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:m,onConnectStart:g,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:y,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:k,onNodeContextMenu:S,onNodeDoubleClick:O,onNodeDragStart:A,onNodeDrag:E,onNodeDragStop:j,onNodesDelete:T,onEdgesDelete:R,onDelete:C,onSelectionChange:N,onSelectionDragStart:P,onSelectionDrag:I,onSelectionDragStop:D,onSelectionContextMenu:_,onSelectionStart:L,onSelectionEnd:F,onBeforeDelete:M,connectionMode:H,connectionLineType:q=og.Bezier,connectionLineStyle:U,connectionLineComponent:Z,connectionLineContainerStyle:z,deleteKeyCode:J="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:W=!1,selectionMode:X=uA.Full,panActivationKeyCode:le="Space",multiSelectionKeyCode:V=hA()?"Meta":"Control",zoomActivationKeyCode:Y=hA()?"Meta":"Control",snapToGrid:K,snapGrid:ue,onlyRenderVisibleElements:te=!1,selectNodesOnDrag:Oe,nodesDraggable:fe,autoPanOnNodeFocus:pe,nodesConnectable:Se,nodesFocusable:ve,nodeOrigin:Le=Z8e,edgesFocusable:He,edgesReconnectable:Ge,elementsSelectable:De=!0,defaultViewport:se=tHt,minZoom:ce=.5,maxZoom:ye=2,translateExtent:Ae=cA,preventScrolling:Ee=!0,nodeExtent:Ce,defaultMarkerColor:Be="#b1b1b7",zoomOnScroll:he=!0,zoomOnPinch:ie=!0,panOnScroll:we=!1,panOnScrollSpeed:Re=.5,panOnScrollMode:Ue=Yy.Free,zoomOnDoubleClick:_t=!0,panOnDrag:Pt=!0,onPaneClick:Gt,onPaneMouseEnter:St,onPaneMouseMove:Lt,onPaneMouseLeave:qe,onPaneScroll:yt,onPaneContextMenu:je,paneClickDistance:kt=1,nodeClickDistance:Tt=0,children:fn,onReconnect:tn,onReconnectStart:We,onReconnectEnd:vt,onEdgeContextMenu:Ke,onEdgeDoubleClick:ot,onEdgeMouseEnter:it,onEdgeMouseMove:tt,onEdgeMouseLeave:Ct,reconnectRadius:Ot=10,onNodesChange:Bt,onEdgesChange:Dt,noDragClassName:Ze="nodrag",noWheelClassName:bt="nowheel",noPanClassName:gt="nopan",fitView:an,fitViewOptions:Ft,connectOnClick:cn,attributionPosition:Je,proOptions:lt,defaultEdgeOptions:hn,elevateNodesOnSelect:Sn=!0,elevateEdgesOnSelect:Ji=!1,disableKeyboardA11y:Qn=!1,autoPanOnConnect:_n,autoPanOnNodeDrag:pi,autoPanOnSelection:Nn=!0,autoPanSpeed:Dn,connectionRadius:_i,isValidConnection:Fn,onError:Kn,style:Rn,id:nt,nodeDragThreshold:Ut,connectionDragThreshold:Qe,viewport:xt,onViewportChange:Qt,width:jn,height:lr,colorMode:ta="light",debug:Ms,onScroll:ts,ariaLabelConfig:ci,zIndexMode:Ei="basic",...$r},na){const ns=nt||"1",Il=sHt(ta),fs=p.useCallback(ge=>{ge.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ts==null||ts(ge)},[ts]);return a.jsx("div",{"data-testid":"rf__wrapper",...$r,onScroll:fs,style:{...Rn,...Tqt},ref:na,className:no(["react-flow",r,Il]),id:nt,role:"application",children:a.jsxs(Aqt,{nodes:e,edges:t,width:jn,height:lr,fitView:an,fitViewOptions:Ft,minZoom:ce,maxZoom:ye,nodeOrigin:Le,nodeExtent:Ce,zIndexMode:Ei,children:[a.jsx(rHt,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:m,onConnectStart:g,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:y,nodesDraggable:fe,autoPanOnNodeFocus:pe,nodesConnectable:Se,nodesFocusable:ve,edgesFocusable:He,edgesReconnectable:Ge,elementsSelectable:De,elevateNodesOnSelect:Sn,elevateEdgesOnSelect:Ji,minZoom:ce,maxZoom:ye,nodeExtent:Ce,onNodesChange:Bt,onEdgesChange:Dt,snapToGrid:K,snapGrid:ue,connectionMode:H,translateExtent:Ae,connectOnClick:cn,defaultEdgeOptions:hn,fitView:an,fitViewOptions:Ft,onNodesDelete:T,onEdgesDelete:R,onDelete:C,onNodeDragStart:A,onNodeDrag:E,onNodeDragStop:j,onSelectionDrag:I,onSelectionDragStart:P,onSelectionDragStop:D,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:gt,nodeOrigin:Le,rfId:ns,autoPanOnConnect:_n,autoPanOnNodeDrag:pi,autoPanSpeed:Dn,onError:Kn,connectionRadius:_i,isValidConnection:Fn,selectNodesOnDrag:Oe,nodeDragThreshold:Ut,connectionDragThreshold:Qe,onBeforeDelete:M,debug:Ms,ariaLabelConfig:ci,zIndexMode:Ei}),a.jsx(Sqt,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:k,onNodeContextMenu:S,onNodeDoubleClick:O,nodeTypes:s,edgeTypes:o,connectionLineType:q,connectionLineStyle:U,connectionLineComponent:Z,connectionLineContainerStyle:z,selectionKeyCode:ne,selectionOnDrag:W,selectionMode:X,deleteKeyCode:J,multiSelectionKeyCode:V,panActivationKeyCode:le,zoomActivationKeyCode:Y,onlyRenderVisibleElements:te,defaultViewport:se,translateExtent:Ae,minZoom:ce,maxZoom:ye,preventScrolling:Ee,zoomOnScroll:he,zoomOnPinch:ie,zoomOnDoubleClick:_t,panOnScroll:we,panOnScrollSpeed:Re,panOnScrollMode:Ue,panOnDrag:Pt,autoPanOnSelection:Nn,onPaneClick:Gt,onPaneMouseEnter:St,onPaneMouseMove:Lt,onPaneMouseLeave:qe,onPaneScroll:yt,onPaneContextMenu:je,paneClickDistance:kt,nodeClickDistance:Tt,onSelectionContextMenu:_,onSelectionStart:L,onSelectionEnd:F,onReconnect:tn,onReconnectStart:We,onReconnectEnd:vt,onEdgeContextMenu:Ke,onEdgeDoubleClick:ot,onEdgeMouseEnter:it,onEdgeMouseMove:tt,onEdgeMouseLeave:Ct,reconnectRadius:Ot,defaultMarkerColor:Be,noDragClassName:Ze,noWheelClassName:bt,noPanClassName:gt,rfId:ns,disableKeyboardA11y:Qn,nodeExtent:Ce,viewport:xt,onViewportChange:Qt}),a.jsx(eHt,{onSelectionChange:N}),fn,a.jsx(GVt,{proOptions:lt,position:Je}),a.jsx(KVt,{rfId:ns,disableKeyboardA11y:Qn})]})})}var jqt=nBe(_qt);const Nqt=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function Rqt({children:e}){const t=or(Nqt);return t?vi.createPortal(e,t):null}function Iqt(e){const[t,n]=p.useState(e),i=p.useCallback(r=>n(s=>eBe(r,s)),[]);return[t,n,i]}function Pqt(e){const[t,n]=p.useState(e),i=p.useCallback(r=>n(s=>tBe(r,s)),[]);return[t,n,i]}const Dqt=e=>t=>{if(!e.includeHiddenNodes)return t.nodesInitialized;if(t.nodeLookup.size===0)return!1;for(const[,{internals:n}]of t.nodeLookup)if(n.handleBounds===void 0||!nK(n.userNode))return!1;return!0};function Mqt(e={includeHiddenNodes:!1}){return or(Dqt(e))}function Lqt({dimensions:e,lineWidth:t,variant:n,className:i}){return a.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:no(["react-flow__background-pattern",n,i])})}function $qt({radius:e,className:t}){return a.jsx("circle",{cx:e,cy:e,r:e,className:no(["react-flow__background-pattern","dots",t])})}var $g;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})($g||($g={}));const Fqt={[$g.Dots]:1,[$g.Lines]:1,[$g.Cross]:6},Bqt=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function ABe({id:e,variant:t=$g.Dots,gap:n=20,size:i,lineWidth:r=1,offset:s=0,color:o,bgColor:l,style:c,className:u,patternClassName:d}){const f=p.useRef(null),{transform:h,patternId:m}=or(Bqt,zs),g=i||Fqt[t],b=t===$g.Dots,v=t===$g.Cross,y=Array.isArray(n)?n:[n,n],w=[y[0]*h[2]||1,y[1]*h[2]||1],x=g*h[2],k=Array.isArray(s)?s:[s,s],S=v?[x,x]:w,O=[k[0]*h[2]||1+S[0]/2,k[1]*h[2]||1+S[1]/2],A=`${m}${e||""}`;return a.jsxs("svg",{className:no(["react-flow__background",u]),style:{...c,...CL,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:f,"data-testid":"rf__background",children:[a.jsx("pattern",{id:A,x:h[0]%w[0],y:h[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${O[0]},-${O[1]})`,children:b?a.jsx($qt,{radius:x/2,className:d}):a.jsx(Lqt,{dimensions:S,lineWidth:r,variant:t,className:d})}),a.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${A})`})]})}ABe.displayName="Background";const Uqt=p.memo(ABe);function Qqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:a.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function zqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:a.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Vqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:a.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 Hqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:a.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 qqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:a.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 vj({children:e,className:t,...n}){return a.jsx("button",{type:"button",className:no(["react-flow__controls-button",t]),...n,children:e})}const Wqt=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function TBe({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:i=!0,fitViewOptions:r,onZoomIn:s,onZoomOut:o,onFitView:l,onInteractiveChange:c,className:u,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":m}){const g=Vs(),{isInteractive:b,minZoomReached:v,maxZoomReached:y,ariaLabelConfig:w}=or(Wqt,zs),{zoomIn:x,zoomOut:k,fitView:S}=EL(),O=()=>{x(),s==null||s()},A=()=>{k(),o==null||o()},E=()=>{S(r),l==null||l()},j=()=>{g.setState({nodesDraggable:!b,nodesConnectable:!b,elementsSelectable:!b}),c==null||c(!b)},T=h==="horizontal"?"horizontal":"vertical";return a.jsxs(SL,{className:no(["react-flow__controls",T,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":m??w["controls.ariaLabel"],children:[t&&a.jsxs(a.Fragment,{children:[a.jsx(vj,{onClick:O,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:y,children:a.jsx(Qqt,{})}),a.jsx(vj,{onClick:A,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:v,children:a.jsx(zqt,{})})]}),n&&a.jsx(vj,{className:"react-flow__controls-fitview",onClick:E,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:a.jsx(Vqt,{})}),i&&a.jsx(vj,{className:"react-flow__controls-interactive",onClick:j,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:b?a.jsx(qqt,{}):a.jsx(Hqt,{})}),d]})}TBe.displayName="Controls";const Kqt=p.memo(TBe);function Gqt({id:e,x:t,y:n,width:i,height:r,style:s,color:o,strokeColor:l,strokeWidth:c,className:u,borderRadius:d,shapeRendering:f,selected:h,onClick:m}){const{background:g,backgroundColor:b}=s||{},v=o||g||b;return a.jsx("rect",{className:no(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:i,height:r,style:{fill:v,stroke:l,strokeWidth:c},shapeRendering:f,onClick:m?y=>m(y,e):void 0})}const Xqt=p.memo(Gqt),Yqt=e=>e.nodes.map(t=>t.id),t6=e=>e instanceof Function?e:()=>e;function Zqt({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:r,nodeComponent:s=Xqt,onClick:o}){const l=or(Yqt,zs),c=t6(t),u=t6(e),d=t6(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return a.jsx(a.Fragment,{children:l.map(h=>a.jsx(eWt,{id:h,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:i,nodeStrokeWidth:r,NodeComponent:s,onClick:o,shapeRendering:f},h))})}function Jqt({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:i,nodeBorderRadius:r,nodeStrokeWidth:s,shapeRendering:o,NodeComponent:l,onClick:c}){const{node:u,x:d,y:f,width:h,height:m}=or(g=>{const b=g.nodeLookup.get(e);if(!b)return{node:void 0,x:0,y:0,width:0,height:0};const v=b.internals.userNode,{x:y,y:w}=b.internals.positionAbsolute,{width:x,height:k}=km(v);return{node:v,x:y,y:w,width:x,height:k}},zs);return!u||u.hidden||!nK(u)?null:a.jsx(l,{x:d,y:f,width:h,height:m,style:u.style,selected:!!u.selected,className:i(u),color:t(u),borderRadius:r,strokeColor:n(u),strokeWidth:s,shapeRendering:o,onClick:c,id:u.id})}const eWt=p.memo(Jqt);var tWt=p.memo(Zqt);const nWt=200,iWt=150,rWt=e=>!e.hidden,sWt=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?A8e(WT(e.nodeLookup,{filter:rWt}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},aWt="react-flow__minimap-desc";function _Be({style:e,className:t,nodeStrokeColor:n,nodeColor:i,nodeClassName:r="",nodeBorderRadius:s=5,nodeStrokeWidth:o,nodeComponent:l,bgColor:c,maskColor:u,maskStrokeColor:d,maskStrokeWidth:f,position:h="bottom-right",onClick:m,onNodeClick:g,pannable:b=!1,zoomable:v=!1,ariaLabel:y,inversePan:w,zoomStep:x=1,offsetScale:k=5}){const S=Vs(),O=p.useRef(null),{boundingRect:A,viewBB:E,rfId:j,panZoom:T,translateExtent:R,flowWidth:C,flowHeight:N,ariaLabelConfig:P}=or(sWt,zs),I=(e==null?void 0:e.width)??nWt,D=(e==null?void 0:e.height)??iWt,_=A.width/I,L=A.height/D,F=Math.max(_,L),M=F*I,H=F*D,q=k*F,U=A.x-(M-A.width)/2-q,Z=A.y-(H-A.height)/2-q,z=M+q*2,J=H+q*2,ne=`${aWt}-${j}`,W=p.useRef(0),X=p.useRef();W.current=F,p.useEffect(()=>{if(O.current&&T)return X.current=kVt({domNode:O.current,panZoom:T,getTransform:()=>S.getState().transform,getViewScale:()=>W.current}),()=>{var K;(K=X.current)==null||K.destroy()}},[T]),p.useEffect(()=>{var K;(K=X.current)==null||K.update({translateExtent:R,width:C,height:N,inversePan:w,pannable:b,zoomStep:x,zoomable:v})},[b,v,w,x,R,C,N]);const le=m?K=>{var Oe;const[ue,te]=((Oe=X.current)==null?void 0:Oe.pointer(K))||[0,0];m(K,{x:ue,y:te})}:void 0,V=g?p.useCallback((K,ue)=>{const te=S.getState().nodeLookup.get(ue).internals.userNode;g(K,te)},[]):void 0,Y=y??P["minimap.ariaLabel"];return a.jsx(SL,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*F:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o=="number"?o:void 0},className:no(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:a.jsxs("svg",{width:I,height:D,viewBox:`${U} ${Z} ${z} ${J}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ne,ref:O,onClick:le,children:[Y&&a.jsx("title",{id:ne,children:Y}),a.jsx(tWt,{onClick:V,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:r,nodeStrokeWidth:o,nodeComponent:l}),a.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-q},${Z-q}h${z+q*2}v${J+q*2}h${-z-q*2}z - M${E.x},${E.y}h${E.width}v${E.height}h${-E.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}_Be.displayName="MiniMap";p.memo(_Be);const oWt=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,lWt={[_1.Line]:"right",[_1.Handle]:"bottom-right"};function cWt({nodeId:e,position:t,variant:n=_1.Handle,className:i,style:r=void 0,children:s,color:o,minWidth:l=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:h,autoScale:m=!0,shouldResize:g,onResizeStart:b,onResize:v,onResizeEnd:y}){const w=aBe(),x=typeof e=="string"?e:w,k=Vs(),S=p.useRef(null),O=n===_1.Handle,A=or(p.useCallback(oWt(O&&m),[O,m]),zs),E=p.useRef(null),j=t??lWt[n];p.useEffect(()=>{if(!(!S.current||!x))return E.current||(E.current=DVt({domNode:S.current,nodeId:x,getStoreItems:()=>{const{nodeLookup:R,transform:C,snapGrid:N,snapToGrid:P,nodeOrigin:I,domNode:D}=k.getState();return{nodeLookup:R,transform:C,snapGrid:N,snapToGrid:P,nodeOrigin:I,paneDomNode:D}},onChange:(R,C)=>{const{triggerNodeChanges:N,nodeLookup:P,parentLookup:I,nodeOrigin:D}=k.getState(),_=[],L={x:R.x,y:R.y},F=P.get(x);if(F&&F.expandParent&&F.parentId){const M=F.origin??D,H=R.width??F.measured.width??0,q=R.height??F.measured.height??0,U={id:F.id,parentId:F.parentId,rect:{width:H,height:q,..._8e({x:R.x??F.position.x,y:R.y??F.position.y},{width:H,height:q},F.parentId,P,M)}},Z=lK([U],P,I,D);_.push(...Z),L.x=R.x?Math.max(M[0]*H,R.x):void 0,L.y=R.y?Math.max(M[1]*q,R.y):void 0}if(L.x!==void 0&&L.y!==void 0){const M={id:x,type:"position",position:{...L}};_.push(M)}if(R.width!==void 0&&R.height!==void 0){const H={id:x,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:R.width,height:R.height}};_.push(H)}for(const M of C){const H={...M,type:"position"};_.push(H)}N(_)},onEnd:({width:R,height:C})=>{const N={id:x,type:"dimensions",resizing:!1,dimensions:{width:R,height:C}};k.getState().triggerNodeChanges([N])}})),E.current.update({controlPosition:j,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:b,onResize:v,onResizeEnd:y,shouldResize:g}),()=>{var R;(R=E.current)==null||R.destroy()}},[j,l,c,u,d,f,b,v,y,g]);const T=j.split("-");return a.jsx("div",{className:no(["react-flow__resize-control","nodrag",...T,n,i]),ref:S,style:{...r,scale:A,...o&&{[O?"backgroundColor":"borderColor"]:o}},children:s})}p.memo(cWt);var jBe=Object.defineProperty,uWt=(e,t,n)=>t in e?jBe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dWt=(e,t)=>{for(var n in t)jBe(e,n,{get:t[n],enumerable:!0})},fWt=(e,t,n)=>uWt(e,t+"",n),NBe={};dWt(NBe,{Graph:()=>Ld,alg:()=>uK,json:()=>IBe,version:()=>mWt});var hWt=Object.defineProperty,RBe=(e,t)=>{for(var n in t)hWt(e,n,{get:t[n],enumerable:!0})},Ld=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected="directed"in e?e.directed:!0,this._isMultigraph="multigraph"in e?e.multigraph:!1,this._isCompound="compound"in e?e.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return typeof e!="function"?this._defaultNodeLabelFn=()=>e:this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(n=>{t!==void 0?this.setNode(n,t):this.setNode(n)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(n=>{this.setParent(n)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(t===void 0)t="\0";else{t+="";for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!=="\0")return t}}children(e="\0"){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e==="\0")return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t);for(let i of this.successors(e))n.add(i);return Array.from(n.values())}}isLeaf(e){let t;return this.isDirected()?t=this.successors(e):t=this.neighbors(e),t.length===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([r,s])=>{e(r)&&t.setNode(r,s)}),Object.values(this._edgeObjs).forEach(r=>{t.hasNode(r.v)&&t.hasNode(r.w)&&t.setEdge(r,this.edge(r))});let n={},i=r=>{let s=this.parent(r);return!s||t.hasNode(s)?(n[r]=s??void 0,s??void 0):s in n?n[s]:i(s)};return this._isCompound&&t.nodes().forEach(r=>t.setParent(r,i(r))),t}setDefaultEdgeLabel(e){return typeof e!="function"?this._defaultEdgeLabelFn=()=>e:this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((n,i)=>(t!==void 0?this.setEdge(n,i,t):this.setEdge(n,i),i)),this}setEdge(e,t,n,i){let r,s,o,l,c=!1;typeof e=="object"&&e!==null&&"v"in e?(r=e.v,s=e.w,o=e.name,arguments.length===2&&(l=t,c=!0)):(r=e,s=t,o=i,arguments.length>2&&(l=n,c=!0)),r=""+r,s=""+s,o!==void 0&&(o=""+o);let u=CS(this._isDirected,r,s,o);if(u in this._edgeLabels)return c&&(this._edgeLabels[u]=l),this;if(o!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(r),this.setNode(s),this._edgeLabels[u]=c?l:this._defaultEdgeLabelFn(r,s,o);let d=pWt(this._isDirected,r,s,o);return r=d.v,s=d.w,Object.freeze(d),this._edgeObjs[u]=d,voe(this._preds[s],r),voe(this._sucs[r],s),this._in[s][u]=d,this._out[r][u]=d,this._edgeCount++,this}edge(e,t,n){let i=arguments.length===1?n6(this._isDirected,e):CS(this._isDirected,e,t,n);return this._edgeLabels[i]}edgeAsObj(e,t,n){let i=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof i!="object"?{label:i}:i}hasEdge(e,t,n){return(arguments.length===1?n6(this._isDirected,e):CS(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let i=arguments.length===1?n6(this._isDirected,e):CS(this._isDirected,e,t,n),r=this._edgeObjs[i];if(r){let s=r.v,o=r.w;delete this._edgeLabels[i],delete this._edgeObjs[i],xoe(this._preds[o],s),xoe(this._sucs[s],o),delete this._in[o][i],delete this._out[s][i],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let i=Object.values(e);return n?i.filter(r=>r.v===t&&r.w===n||r.v===n&&r.w===t):i}};function voe(e,t){e[t]?e[t]++:e[t]=1}function xoe(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function CS(e,t,n,i){let r=""+t,s=""+n;if(!e&&r>s){let o=r;r=s,s=o}return r+""+s+""+(i===void 0?"\0":i)}function pWt(e,t,n,i){let r=""+t,s=""+n;if(!e&&r>s){let l=r;r=s,s=l}let o={v:r,w:s};return i&&(o.name=i),o}function n6(e,t){return CS(e,t.v,t.w,t.name)}var mWt="4.0.1",IBe={};RBe(IBe,{read:()=>vWt,write:()=>gWt});function gWt(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:bWt(e),edges:yWt(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function bWt(e){return e.nodes().map(t=>{let n=e.node(t),i=e.parent(t),r={v:t};return n!==void 0&&(r.value=n),i!==void 0&&(r.parent=i),r})}function yWt(e){return e.edges().map(t=>{let n=e.edge(t),i={v:t.v,w:t.w};return t.name!==void 0&&(i.name=t.name),n!==void 0&&(i.value=n),i})}function vWt(e){let t=new Ld(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(n=>{t.setNode(n.v,n.value),n.parent&&t.setParent(n.v,n.parent)}),e.edges.forEach(n=>{t.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),t}var uK={};RBe(uK,{CycleException:()=>jP,bellmanFord:()=>PBe,components:()=>kWt,dijkstra:()=>_P,dijkstraAll:()=>EWt,findCycles:()=>CWt,floydWarshall:()=>TWt,isAcyclic:()=>jWt,postorder:()=>RWt,preorder:()=>IWt,prim:()=>PWt,shortestPaths:()=>DWt,tarjan:()=>MBe,topsort:()=>LBe});var xWt=()=>1;function PBe(e,t,n,i){return wWt(e,String(t),n||xWt,i||function(r){return e.outEdges(r)})}function wWt(e,t,n,i){let r={},s,o=0,l=e.nodes(),c=function(f){let h=n(f);r[f.v].distance+he.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(e,t){let n=this._keyIndices,i=String(e);if(!(i in n)){let r=this._arr,s=r.length;return n[i]=s,r.push({key:i,priority:t}),this._decrease(s),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw new Error(`Key not found: ${e}`);let i=this._arr[n].priority;if(t>i)throw new Error(`New priority is greater than current priority. Key: ${e} Old: ${i} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,i=n+1,r=e;n>1,!(t[i].priority1;function _P(e,t,n,i){let r=function(s){return e.outEdges(s)};return SWt(e,String(t),n||OWt,i||r)}function SWt(e,t,n,i){let r={},s=new DBe,o,l,c=function(u){let d=u.v!==o?u.v:u.w,f=r[d],h=n(u),m=l.distance+h;if(h<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+u+" Weight: "+h);m0&&(o=s.removeMin(),l=r[o],l.distance!==Number.POSITIVE_INFINITY);)i(o).forEach(c);return r}function EWt(e,t,n){return e.nodes().reduce(function(i,r){return i[r]=_P(e,r,t,n),i},{})}function MBe(e){let t=0,n=[],i={},r=[];function s(o){let l=i[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),e.successors(o).forEach(function(c){c in i?i[c].onStack&&(l.lowlink=Math.min(l.lowlink,i[c].index)):(s(c),l.lowlink=Math.min(l.lowlink,i[c].lowlink))}),l.lowlink===l.index){let c=[],u;do u=n.pop(),i[u].onStack=!1,c.push(u);while(o!==u);r.push(c)}}return e.nodes().forEach(function(o){o in i||s(o)}),r}function CWt(e){return MBe(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var AWt=()=>1;function TWt(e,t,n){return _Wt(e,t||AWt,n||function(i){return e.outEdges(i)})}function _Wt(e,t,n){let i={},r=e.nodes();return r.forEach(function(s){i[s]={},i[s][s]={distance:0,predecessor:""},r.forEach(function(o){s!==o&&(i[s][o]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),n(s).forEach(function(o){let l=o.v===s?o.w:o.v,c=t(o);i[s][l]={distance:c,predecessor:s}})}),r.forEach(function(s){let o=i[s];r.forEach(function(l){let c=i[l];r.forEach(function(u){let d=c[s],f=o[u],h=c[u],m=d.distance+f.distance;m{var c;return(c=e.isDirected()?e.successors(l):e.neighbors(l))!=null?c:[]},o={};return t.forEach(function(l){if(!e.hasNode(l))throw new Error("Graph does not have node: "+l);r=$Be(e,l,n==="post",o,s,i,r)}),r}function $Be(e,t,n,i,r,s,o){return t in i||(i[t]=!0,n||(o=s(o,t)),r(t).forEach(function(l){o=$Be(e,l,n,i,r,s,o)}),n&&(o=s(o,t))),o}function FBe(e,t,n){return NWt(e,t,n,function(i,r){return i.push(r),i},[])}function RWt(e,t){return FBe(e,t,"post")}function IWt(e,t){return FBe(e,t,"pre")}function PWt(e,t){let n=new Ld,i={},r=new DBe,s;function o(c){let u=c.v===s?c.w:c.v,d=r.priority(u);if(d!==void 0){let f=t(c);f0;){if(s=r.removeMin(),s in i)n.setEdge(s,i[s]);else{if(l)throw new Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(s).forEach(o)}return n}function DWt(e,t,n,i){return MWt(e,t,n,i??(r=>{let s=e.outEdges(r);return s??[]}))}function MWt(e,t,n,i){if(n===void 0)return _P(e,t,n,i);let r=!1,s=e.nodes();for(let o=0;ot.setNode(n,e.node(n))),e.edges().forEach(n=>{let i=t.edge(n.v,n.w)||{weight:0,minlen:1},r=e.edge(n);t.setEdge(n.v,n.w,{weight:i.weight+r.weight,minlen:Math.max(i.minlen,r.minlen)})}),t}function BBe(e){let t=new Ld({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function woe(e,t){let n=e.x,i=e.y,r=t.x-n,s=t.y-i,o=e.width/2,l=e.height/2;if(!r&&!s)throw new Error("Not possible to find intersection inside of the rectangle");let c,u;return Math.abs(s)*o>Math.abs(r)*l?(s<0&&(l=-l),c=l*r/s,u=l):(r<0&&(o=-o),c=o,u=o*s/r),{x:n+c,y:i+u}}function XT(e){let t=mA(QBe(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let i=e.node(n),r=i.rank;r!==void 0&&(t[r]||(t[r]=[]),t[r][i.order]=n)}),t}function $Wt(e){let t=e.nodes().map(i=>{let r=e.node(i).rank;return r===void 0?Number.MAX_VALUE:r}),n=hh(Math.min,t);e.nodes().forEach(i=>{let r=e.node(i);Object.hasOwn(r,"rank")&&(r.rank-=n)})}function FWt(e){let t=e.nodes().map(o=>e.node(o).rank).filter(o=>o!==void 0),n=hh(Math.min,t),i=[];e.nodes().forEach(o=>{let l=e.node(o).rank-n;i[l]||(i[l]=[]),i[l].push(o)});let r=0,s=e.graph().nodeRankFactor;Array.from(i).forEach((o,l)=>{o===void 0&&l%s!==0?--r:o!==void 0&&r&&o.forEach(c=>e.node(c).rank+=r)})}function koe(e,t,n,i){let r={width:0,height:0};return arguments.length>=4&&(r.rank=n,r.order=i),Sk(e,"border",r,t)}function BWt(e,t=UBe){let n=[];for(let i=0;iUBe){let n=BWt(t);return e(...n.map(i=>e(...i)))}else return e(...t)}function QBe(e){let t=e.nodes().map(n=>{let i=e.node(n).rank;return i===void 0?Number.MIN_VALUE:i});return hh(Math.max,t)}function UWt(e,t){let n={lhs:[],rhs:[]};return e.forEach(i=>{t(i)?n.lhs.push(i):n.rhs.push(i)}),n}function zBe(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}}function VBe(e,t){return t()}var QWt=0;function dK(e){let t=++QWt;return e+(""+t)}function mA(e,t,n=1){t==null&&(t=e,e=0);let i=s=>sti[t]:n=t,Object.entries(e).reduce((i,[r,s])=>(i[r]=n(s,r),i),{})}function zWt(e,t){return e.reduce((n,i,r)=>(n[i]=t[r],n),{})}var TL="\0",VWt="3.0.0",HWt=class{constructor(){fWt(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return Ooe(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&Ooe(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,qWt)),n=n._prev;return"["+e.join(", ")+"]"}};function Ooe(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function qWt(e,t){if(e!=="_next"&&e!=="_prev")return t}var WWt=HWt,KWt=()=>1;function GWt(e,t){if(e.nodeCount()<=1)return[];let n=YWt(e,t||KWt);return XWt(n.graph,n.buckets,n.zeroIdx).flatMap(i=>e.outEdges(i.v,i.w)||[])}function XWt(e,t,n){var i;let r=[],s=t[t.length-1],o=t[0],l;for(;e.nodeCount();){for(;l=o.dequeue();)i6(e,t,n,l);for(;l=s.dequeue();)i6(e,t,n,l);if(e.nodeCount()){for(let c=t.length-2;c>0;--c)if(l=(i=t[c])==null?void 0:i.dequeue(),l){r=r.concat(i6(e,t,n,l,!0)||[]);break}}}return r}function i6(e,t,n,i,r){let s=[],o=r?s:void 0;return(e.inEdges(i.v)||[]).forEach(l=>{let c=e.edge(l),u=e.node(l.v);r&&s.push({v:l.v,w:l.w}),u.out-=c,B7(t,n,u)}),(e.outEdges(i.v)||[]).forEach(l=>{let c=e.edge(l),u=l.w,d=e.node(u);d.in-=c,B7(t,n,d)}),e.removeNode(i.v),o}function YWt(e,t){let n=new Ld,i=0,r=0;e.nodes().forEach(l=>{n.setNode(l,{v:l,in:0,out:0})}),e.edges().forEach(l=>{let c=n.edge(l.v,l.w)||0,u=t(l),d=c+u;n.setEdge(l.v,l.w,d);let f=n.node(l.v),h=n.node(l.w);r=Math.max(r,f.out+=u),i=Math.max(i,h.in+=u)});let s=ZWt(r+i+3).map(()=>new WWt),o=i+1;return n.nodes().forEach(l=>{B7(s,o,n.node(l))}),{graph:n,buckets:s,zeroIdx:o}}function B7(e,t,n){var i,r,s;n.out?n.in?(s=e[n.out-n.in+t])==null||s.enqueue(n):(r=e[e.length-1])==null||r.enqueue(n):(i=e[0])==null||i.enqueue(n)}function ZWt(e){let t=[];for(let n=0;n{let i=e.edge(n);e.removeEdge(n),i.forwardName=n.name,i.reversed=!0,e.setEdge(n.w,n.v,i,dK("rev"))});function t(n){return i=>n.edge(i).weight}}function eKt(e){let t=[],n={},i={};function r(s){Object.hasOwn(i,s)||(i[s]=!0,n[s]=!0,e.outEdges(s).forEach(o=>{Object.hasOwn(n,o.w)?t.push(o):r(o.w)}),delete n[s])}return e.nodes().forEach(r),t}function tKt(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let i=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,i)}})}function nKt(e){e.graph().dummyChains=[],e.edges().forEach(t=>iKt(e,t))}function iKt(e,t){let n=t.v,i=e.node(n).rank,r=t.w,s=e.node(r).rank,o=t.name,l=e.edge(t),c=l.labelRank;if(s===i+1)return;e.removeEdge(t);let u,d,f;for(f=0,++i;i{let n=e.node(t),i=n.edgeLabel,r;for(e.setEdge(n.edgeObj,i);n.dummy;)r=e.successors(t)[0],e.removeNode(t),i.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(i.x=n.x,i.y=n.y,i.width=n.width,i.height=n.height),t=r,n=e.node(t)})}function fK(e){let t={};function n(i){let r=e.node(i);if(Object.hasOwn(t,i))return r.rank;t[i]=!0;let s=e.outEdges(i),o=s?s.map(c=>c==null?Number.POSITIVE_INFINITY:n(c.w)-e.edge(c).minlen):[],l=hh(Math.min,o);return l===Number.POSITIVE_INFINITY&&(l=0),r.rank=l}e.sources().forEach(n)}function j1(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var HBe=sKt;function sKt(e){let t=new Ld({directed:!1}),n=e.nodes();if(n.length===0)throw new Error("Graph must have at least one node");let i=n[0],r=e.nodeCount();t.setNode(i,{});let s,o;for(;aKt(t,e){let o=s.v,l=i===o?s.w:o;!e.hasNode(l)&&!j1(t,s)&&(e.setNode(l,{}),e.setEdge(i,l,{}),n(l))})}return e.nodes().forEach(n),e.nodeCount()}function oKt(e,t){return t.edges().reduce((n,i)=>{let r=Number.POSITIVE_INFINITY;return e.hasNode(i.v)!==e.hasNode(i.w)&&(r=j1(t,i)),rt.node(i).rank+=n)}var{preorder:cKt,postorder:uKt}=uK,dKt=n0;n0.initLowLimValues=pK;n0.initCutValues=hK;n0.calcCutValue=qBe;n0.leaveEdge=KBe;n0.enterEdge=GBe;n0.exchangeEdges=XBe;function n0(e){e=LWt(e),fK(e);let t=HBe(e);pK(t),hK(t,e);let n,i;for(;n=KBe(t);)i=GBe(t,e,n),XBe(t,e,n,i)}function hK(e,t){let n=uKt(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(i=>fKt(e,t,i))}function fKt(e,t,n){let i=e.node(n).parent,r=e.edge(n,i);r.cutvalue=qBe(e,t,n)}function qBe(e,t,n){let i=e.node(n).parent,r=!0,s=t.edge(n,i),o=0;s||(r=!1,s=t.edge(i,n)),o=s.weight;let l=t.nodeEdges(n);return l&&l.forEach(c=>{let u=c.v===n,d=u?c.w:c.v;if(d!==i){let f=u===r,h=t.edge(c).weight;if(o+=f?h:-h,pKt(e,n,d)){let m=e.edge(n,d).cutvalue;o+=f?-m:m}}}),o}function pK(e,t){arguments.length<2&&(t=e.nodes()[0]),WBe(e,{},1,t)}function WBe(e,t,n,i,r){let s=n,o=e.node(i);t[i]=!0;let l=e.neighbors(i);return l&&l.forEach(c=>{Object.hasOwn(t,c)||(n=WBe(e,t,n,c,i))}),o.low=s,o.lim=n++,r?o.parent=r:delete o.parent,n}function KBe(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function GBe(e,t,n){let i=n.v,r=n.w;t.hasEdge(i,r)||(i=n.w,r=n.v);let s=e.node(i),o=e.node(r),l=s,c=!1;return s.lim>o.lim&&(l=o,c=!0),t.edges().filter(u=>c===Soe(e,e.node(u.v),l)&&c!==Soe(e,e.node(u.w),l)).reduce((u,d)=>j1(t,d)!e.node(r).parent);if(!n)return;let i=cKt(e,[n]);i=i.slice(1),i.forEach(r=>{let s=e.node(r).parent,o=t.edge(r,s),l=!1;o||(o=t.edge(s,r),l=!0),t.node(r).rank=t.node(s).rank+(l?o.minlen:-o.minlen)})}function pKt(e,t,n){return e.hasEdge(t,n)}function Soe(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var mKt=gKt;function gKt(e){let t=e.graph().ranker;if(typeof t=="function")return t(e);switch(t){case"network-simplex":Eoe(e);break;case"tight-tree":yKt(e);break;case"longest-path":bKt(e);break;case"none":break;default:Eoe(e)}}var bKt=fK;function yKt(e){fK(e),HBe(e)}function Eoe(e){dKt(e)}var vKt=xKt;function xKt(e){let t=kKt(e);e.graph().dummyChains.forEach(n=>{let i=e.node(n),r=i.edgeObj,s=wKt(e,t,r.v,r.w),o=s.path,l=s.lca,c=0,u=o[c],d=!0;for(;n!==r.w;){if(i=e.node(n),d){for(;(u=o[c])!==l&&e.node(u).maxRanko||l>t[c].lim));let u=c,d=i;for(;(d=e.parent(d))!==u;)s.push(d);return{path:r.concat(s.reverse()),lca:u}}function kKt(e){let t={},n=0;function i(r){let s=n;e.children(r).forEach(i),t[r]={low:s,lim:n++}}return e.children(TL).forEach(i),t}function OKt(e){let t=Sk(e,"root",{},"_root"),n=SKt(e),i=Object.values(n),r=hh(Math.max,i)-1,s=2*r+1;e.graph().nestingRoot=t,e.edges().forEach(l=>e.edge(l).minlen*=s);let o=EKt(e)+1;e.children(TL).forEach(l=>YBe(e,t,s,o,r,n,l)),e.graph().nodeRankFactor=s}function YBe(e,t,n,i,r,s,o){var l;let c=e.children(o);if(!c.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let u=koe(e,"_bt"),d=koe(e,"_bb"),f=e.node(o);e.setParent(u,o),f.borderTop=u,e.setParent(d,o),f.borderBottom=d,c.forEach(h=>{var m;YBe(e,t,n,i,r,s,h);let g=e.node(h),b=g.borderTop?g.borderTop:h,v=g.borderBottom?g.borderBottom:h,y=g.borderTop?i:2*i,w=b!==v?1:r-((m=s[o])!=null?m:0)+1;e.setEdge(u,b,{weight:y,minlen:w,nestingEdge:!0}),e.setEdge(v,d,{weight:y,minlen:w,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,u,{weight:0,minlen:r+((l=s[o])!=null?l:0)})}function SKt(e){let t={};function n(i,r){let s=e.children(i);s&&s.length&&s.forEach(o=>n(o,r+1)),t[i]=r}return e.children(TL).forEach(i=>n(i,1)),t}function EKt(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function CKt(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(n=>{e.edge(n).nestingEdge&&e.removeEdge(n)})}var AKt=TKt;function TKt(e){function t(n){let i=e.children(n),r=e.node(n);if(i.length&&i.forEach(t),Object.hasOwn(r,"minRank")){r.borderLeft=[],r.borderRight=[];for(let s=r.minRank,o=r.maxRank+1;sAoe(e.node(t))),e.edges().forEach(t=>Aoe(e.edge(t)))}function Aoe(e){let t=e.width;e.width=e.height,e.height=t}function NKt(e){e.nodes().forEach(t=>r6(e.node(t))),e.edges().forEach(t=>{var n;let i=e.edge(t);(n=i.points)==null||n.forEach(r6),Object.hasOwn(i,"y")&&r6(i)})}function r6(e){e.y=-e.y}function RKt(e){e.nodes().forEach(t=>s6(e.node(t))),e.edges().forEach(t=>{var n;let i=e.edge(t);(n=i.points)==null||n.forEach(s6),Object.hasOwn(i,"x")&&s6(i)})}function s6(e){let t=e.x;e.x=e.y,e.y=t}function IKt(e){let t={},n=e.nodes().filter(l=>!e.children(l).length),i=n.map(l=>e.node(l).rank),r=hh(Math.max,i),s=mA(r+1).map(()=>[]);function o(l){if(t[l])return;t[l]=!0;let c=e.node(l);s[c.rank].push(l);let u=e.successors(l);u&&u.forEach(o)}return n.sort((l,c)=>e.node(l).rank-e.node(c).rank).forEach(o),s}function PKt(e,t){let n=0;for(let i=1;id)),r=t.flatMap(u=>{let d=e.outEdges(u);return d?d.map(f=>({pos:i[f.w],weight:e.edge(f).weight})).sort((f,h)=>f.pos-h.pos):[]}),s=1;for(;s{let d=u.pos+s;l[d]+=u.weight;let f=0;for(;d>0;)d%2&&(f+=l[d+1]),d=d-1>>1,l[d]+=u.weight;c+=u.weight*f}),c}function MKt(e,t=[]){return t.map(n=>{let i=e.inEdges(n);if(!i||!i.length)return{v:n};{let r=i.reduce((s,o)=>{let l=e.edge(o),c=e.node(o.v);return{sum:s.sum+l.weight*c.order,weight:s.weight+l.weight}},{sum:0,weight:0});return{v:n,barycenter:r.sum/r.weight,weight:r.weight}}})}function LKt(e,t){let n={};e.forEach((r,s)=>{let o={indegree:0,in:[],out:[],vs:[r.v],i:s};r.barycenter!==void 0&&(o.barycenter=r.barycenter,o.weight=r.weight),n[r.v]=o}),t.edges().forEach(r=>{let s=n[r.v],o=n[r.w];s!==void 0&&o!==void 0&&(o.indegree++,s.out.push(o))});let i=Object.values(n).filter(r=>!r.indegree);return $Kt(i)}function $Kt(e){let t=[];function n(r){return s=>{s.merged||(s.barycenter===void 0||r.barycenter===void 0||s.barycenter>=r.barycenter)&&FKt(r,s)}}function i(r){return s=>{s.in.push(r),--s.indegree===0&&e.push(s)}}for(;e.length;){let r=e.pop();t.push(r),r.in.reverse().forEach(n(r)),r.out.forEach(i(r))}return t.filter(r=>!r.merged).map(r=>NP(r,["vs","i","barycenter","weight"]))}function FKt(e,t){let n=0,i=0;e.weight&&(n+=e.barycenter*e.weight,i+=e.weight),t.weight&&(n+=t.barycenter*t.weight,i+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/i,e.weight=i,e.i=Math.min(t.i,e.i),t.merged=!0}function BKt(e,t){let n=UWt(e,d=>Object.hasOwn(d,"barycenter")),i=n.lhs,r=n.rhs.sort((d,f)=>f.i-d.i),s=[],o=0,l=0,c=0;i.sort(UKt(!!t)),c=Toe(s,r,c),i.forEach(d=>{c+=d.vs.length,s.push(d.vs),o+=d.barycenter*d.weight,l+=d.weight,c=Toe(s,r,c)});let u={vs:s.flat(1)};return l&&(u.barycenter=o/l,u.weight=l),u}function Toe(e,t,n){let i;for(;t.length&&(i=t[t.length-1]).i<=n;)t.pop(),e.push(i.vs),n++;return n}function UKt(e){return(t,n)=>t.barycentern.barycenter?1:e?n.i-t.i:t.i-n.i}function JBe(e,t,n,i){let r=e.children(t),s=e.node(t),o=s?s.borderLeft:void 0,l=s?s.borderRight:void 0,c={};o&&(r=r.filter(h=>h!==o&&h!==l));let u=MKt(e,r);u.forEach(h=>{if(e.children(h.v).length){let m=JBe(e,h.v,n,i);c[h.v]=m,Object.hasOwn(m,"barycenter")&&zKt(h,m)}});let d=LKt(u,n);QKt(d,c);let f=BKt(d,i);if(o&&l){f.vs=[o,f.vs,l].flat(1);let h=e.predecessors(o);if(h&&h.length){let m=e.node(h[0]),g=e.predecessors(l),b=e.node(g[0]);Object.hasOwn(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+m.order+b.order)/(f.weight+2),f.weight+=2}}return f}function QKt(e,t){e.forEach(n=>{n.vs=n.vs.flatMap(i=>t[i]?t[i].vs:i)})}function zKt(e,t){e.barycenter!==void 0?(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight):(e.barycenter=t.barycenter,e.weight=t.weight)}function VKt(e,t,n,i){i||(i=e.nodes());let r=HKt(e),s=new Ld({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(o=>e.node(o));return i.forEach(o=>{let l=e.node(o),c=e.parent(o);if(l.rank===t||l.minRank<=t&&t<=l.maxRank){s.setNode(o),s.setParent(o,c||r);let u=e[n](o);u&&u.forEach(d=>{let f=d.v===o?d.w:d.v,h=s.edge(f,o),m=h!==void 0?h.weight:0;s.setEdge(f,o,{weight:e.edge(d).weight+m})}),Object.hasOwn(l,"minRank")&&s.setNode(o,{borderLeft:l.borderLeft[t],borderRight:l.borderRight[t]})}}),s}function HKt(e){let t;for(;e.hasNode(t=dK("_root")););return t}function qKt(e,t,n){let i={},r;n.forEach(s=>{let o=e.parent(s),l,c;for(;o;){if(l=e.parent(o),l?(c=i[l],i[l]=o):(c=r,r=o),c&&c!==o){t.setEdge(c,o);return}o=l}})}function e9e(e,t={}){if(typeof t.customOrder=="function"){t.customOrder(e,e9e);return}let n=QBe(e),i=_oe(e,mA(1,n+1),"inEdges"),r=_oe(e,mA(n-1,-1,-1),"outEdges"),s=IKt(e);if(joe(e,s),t.disableOptimalOrderHeuristic)return;let o=Number.POSITIVE_INFINITY,l,c=t.constraints||[];for(let u=0,d=0;d<4;++u,++d){WKt(u%2?i:r,u%4>=2,c),s=XT(e);let f=PKt(e,s);f{i.has(s)||i.set(s,[]),i.get(s).push(o)};for(let s of e.nodes()){let o=e.node(s);if(typeof o.rank=="number"&&r(o.rank,s),typeof o.minRank=="number"&&typeof o.maxRank=="number")for(let l=o.minRank;l<=o.maxRank;l++)l!==o.rank&&r(l,s)}return t.map(function(s){return VKt(e,s,n,i.get(s)||[])})}function WKt(e,t,n){let i=new Ld;e.forEach(function(r){n.forEach(l=>i.setEdge(l.left,l.right));let s=r.graph().root,o=JBe(r,s,i,t);o.vs.forEach((l,c)=>r.node(l).order=c),qKt(r,i,o.vs)})}function joe(e,t){Object.values(t).forEach(n=>n.forEach((i,r)=>e.node(i).order=r))}function KKt(e,t){let n={};function i(r,s){let o=0,l=0,c=r.length,u=s[s.length-1];return s.forEach((d,f)=>{let h=XKt(e,d),m=h?e.node(h).order:c;(h||d===u)&&(s.slice(l,f+1).forEach(g=>{let b=e.predecessors(g);b&&b.forEach(v=>{let y=e.node(v),w=y.order;(w{let f=s[d];if(f!==void 0&&e.node(f).dummy){let h=e.predecessors(f);h&&h.forEach(m=>{if(m===void 0)return;let g=e.node(m);g.dummy&&(g.orderu)&&t9e(n,m,f)})}})}function r(s,o){let l=-1,c=-1,u=0;return o.forEach((d,f)=>{if(e.node(d).dummy==="border"){let h=e.predecessors(d);if(h&&h.length){let m=h[0];if(m===void 0)return;c=e.node(m).order,i(o,u,f,l,c),u=f,l=c}}i(o,u,o.length,c,s.length)}),o}return t.length&&t.reduce(r),n}function XKt(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(i=>e.node(i).dummy)}}function t9e(e,t,n){if(t>n){let r=t;t=n,n=r}let i=e[t];i||(e[t]=i={}),i[n]=!0}function YKt(e,t,n){if(t>n){let r=t;t=n,n=r}let i=e[t];return i!==void 0&&Object.hasOwn(i,n)}function ZKt(e,t,n,i){let r={},s={},o={};return t.forEach(l=>{l.forEach((c,u)=>{r[c]=c,s[c]=c,o[c]=u})}),t.forEach(l=>{let c=-1;l.forEach(u=>{let d=i(u);if(d&&d.length){let f=d.sort((m,g)=>{let b=o[m],v=o[g];return(b!==void 0?b:0)-(v!==void 0?v:0)}),h=(f.length-1)/2;for(let m=Math.floor(h),g=Math.ceil(h);m<=g;++m){let b=f[m];if(b===void 0)continue;let v=o[b];if(v!==void 0&&s[u]===u&&c{var y;let w=(y=s[v.v])!=null?y:0,x=o.edge(v);return Math.max(b,w+(x!==void 0?x:0))},0):s[m]=0}function d(m){let g=o.outEdges(m),b=Number.POSITIVE_INFINITY;g&&(b=g.reduce((y,w)=>{let x=s[w.w],k=o.edge(w);return Math.min(y,(x!==void 0?x:0)-(k!==void 0?k:0))},Number.POSITIVE_INFINITY));let v=e.node(m);b!==Number.POSITIVE_INFINITY&&v.borderType!==l&&(s[m]=Math.max(s[m]!==void 0?s[m]:0,b))}function f(m){return o.predecessors(m)||[]}function h(m){return o.successors(m)||[]}return c(u,f),c(d,h),Object.keys(i).forEach(m=>{var g;let b=n[m];b!==void 0&&(s[m]=(g=s[b])!=null?g:0)}),s}function eGt(e,t,n,i){let r=new Ld,s=e.graph(),o=sGt(s.nodesep,s.edgesep,i);return t.forEach(l=>{let c;l.forEach(u=>{let d=n[u];if(d!==void 0){if(r.setNode(d),c!==void 0){let f=n[c];if(f!==void 0){let h=r.edge(f,d);r.setEdge(f,d,Math.max(o(e,u,c),h||0))}}c=u}})}),r}function tGt(e,t){return Object.values(t).reduce((n,i)=>{let r=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;Object.entries(i).forEach(([l,c])=>{let u=aGt(e,l)/2;r=Math.max(c+u,r),s=Math.min(c-u,s)});let o=r-s;return o{["l","r"].forEach(o=>{let l=s+o,c=e[l];if(!c||c===t)return;let u=Object.values(c),d=i-hh(Math.min,u);o!=="l"&&(d=r-hh(Math.max,u)),d&&(e[l]=AL(c,f=>f+d))})})}function iGt(e,t=void 0){let n=e.ul;return n?AL(n,(i,r)=>{var s,o;if(t){let c=t.toLowerCase(),u=e[c];if(u&&u[r]!==void 0)return u[r]}let l=Object.values(e).map(c=>{let u=c[r];return u!==void 0?u:0}).sort((c,u)=>c-u);return(((s=l[1])!=null?s:0)+((o=l[2])!=null?o:0))/2}):{}}function rGt(e){let t=XT(e),n=Object.assign(KKt(e,t),GKt(e,t)),i={},r;["u","d"].forEach(o=>{r=o==="u"?t:Object.values(t).reverse(),["l","r"].forEach(l=>{l==="r"&&(r=r.map(d=>Object.values(d).reverse()));let c=ZKt(e,r,n,d=>(o==="u"?e.predecessors(d):e.successors(d))||[]),u=JKt(e,r,c.root,c.align,l==="r");l==="r"&&(u=AL(u,d=>-d)),i[o+l]=u})});let s=tGt(e,i);return nGt(i,s),iGt(i,e.graph().align)}function sGt(e,t,n){return(i,r,s)=>{let o=i.node(r),l=i.node(s),c=0,u;if(c+=o.width/2,Object.hasOwn(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":u=-o.width/2;break;case"r":u=o.width/2;break}if(u&&(c+=n?u:-u),u=void 0,c+=(o.dummy?t:e)/2,c+=(l.dummy?t:e)/2,c+=l.width/2,Object.hasOwn(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":u=l.width/2;break;case"r":u=-l.width/2;break}return u&&(c+=n?u:-u),c}}function aGt(e,t){return e.node(t).width}function oGt(e){e=BBe(e),lGt(e),Object.entries(rGt(e)).forEach(([t,n])=>e.node(t).x=n)}function lGt(e){let t=XT(e),n=e.graph(),i=n.ranksep,r=n.rankalign,s=0;t.forEach(o=>{let l=o.reduce((c,u)=>{var d;let f=(d=e.node(u).height)!=null?d:0;return c>f?c:f},0);o.forEach(c=>{let u=e.node(c);r==="top"?u.y=s+u.height/2:r==="bottom"?u.y=s+l-u.height/2:u.y=s+l/2}),s+=l+i})}function cGt(e,t={}){let n=t.debugTiming?zBe:VBe;return n("layout",()=>{let i=n(" buildLayoutGraph",()=>vGt(e));return n(" runLayout",()=>uGt(i,n,t)),n(" updateInputGraph",()=>dGt(e,i)),i})}function uGt(e,t,n){t(" makeSpaceForEdgeLabels",()=>xGt(e)),t(" removeSelfEdges",()=>_Gt(e)),t(" acyclic",()=>JWt(e)),t(" nestingGraph.run",()=>OKt(e)),t(" rank",()=>mKt(BBe(e))),t(" injectEdgeLabelProxies",()=>wGt(e)),t(" removeEmptyRanks",()=>FWt(e)),t(" nestingGraph.cleanup",()=>CKt(e)),t(" normalizeRanks",()=>$Wt(e)),t(" assignRankMinMax",()=>kGt(e)),t(" removeEdgeLabelProxies",()=>OGt(e)),t(" normalize.run",()=>nKt(e)),t(" parentDummyChains",()=>vKt(e)),t(" addBorderSegments",()=>AKt(e)),t(" order",()=>e9e(e,n)),t(" insertSelfEdges",()=>jGt(e)),t(" adjustCoordinateSystem",()=>_Kt(e)),t(" position",()=>oGt(e)),t(" positionSelfEdges",()=>NGt(e)),t(" removeBorderNodes",()=>TGt(e)),t(" normalize.undo",()=>rKt(e)),t(" fixupEdgeLabelCoords",()=>CGt(e)),t(" undoCoordinateSystem",()=>jKt(e)),t(" translateGraph",()=>SGt(e)),t(" assignNodeIntersects",()=>EGt(e)),t(" reversePoints",()=>AGt(e)),t(" acyclic.undo",()=>tKt(e))}function dGt(e,t){e.nodes().forEach(n=>{let i=e.node(n),r=t.node(n);i&&(i.x=r.x,i.y=r.y,i.order=r.order,i.rank=r.rank,t.children(n).length&&(i.width=r.width,i.height=r.height))}),e.edges().forEach(n=>{let i=e.edge(n),r=t.edge(n);i.points=r.points,Object.hasOwn(r,"x")&&(i.x=r.x,i.y=r.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var fGt=["nodesep","edgesep","ranksep","marginx","marginy"],hGt={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},pGt=["acyclicer","ranker","rankdir","align","rankalign"],mGt=["width","height","rank"],Noe={width:0,height:0},gGt=["minlen","weight","width","height","labeloffset"],bGt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},yGt=["labelpos"];function vGt(e){let t=new Ld({multigraph:!0,compound:!0}),n=o6(e.graph());return t.setGraph(Object.assign({},hGt,a6(n,fGt),NP(n,pGt))),e.nodes().forEach(i=>{let r=o6(e.node(i)),s=a6(r,mGt);Object.keys(Noe).forEach(l=>{s[l]===void 0&&(s[l]=Noe[l])}),t.setNode(i,s);let o=e.parent(i);o!==void 0&&t.setParent(i,o)}),e.edges().forEach(i=>{let r=o6(e.edge(i));t.setEdge(i,Object.assign({},bGt,a6(r,gGt),NP(r,yGt)))}),t}function xGt(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let i=e.edge(n);i.minlen*=2,i.labelpos.toLowerCase()!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?i.width+=i.labeloffset:i.height+=i.labeloffset)})}function wGt(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let i=e.node(t.v),r={rank:(e.node(t.w).rank-i.rank)/2+i.rank,e:t};Sk(e,"edge-proxy",r,"_ep")}})}function kGt(e){let t=0;e.nodes().forEach(n=>{let i=e.node(n);i.borderTop&&(i.minRank=e.node(i.borderTop).rank,i.maxRank=e.node(i.borderBottom).rank,t=Math.max(t,i.maxRank))}),e.graph().maxRank=t}function OGt(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy==="edge-proxy"){let i=n;e.edge(i.e).labelRank=n.rank,e.removeNode(t)}})}function SGt(e){let t=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,r=0,s=e.graph(),o=s.marginx||0,l=s.marginy||0;function c(u){let d=u.x,f=u.y,h=u.width,m=u.height;t=Math.min(t,d-h/2),n=Math.max(n,d+h/2),i=Math.min(i,f-m/2),r=Math.max(r,f+m/2)}e.nodes().forEach(u=>c(e.node(u))),e.edges().forEach(u=>{let d=e.edge(u);Object.hasOwn(d,"x")&&c(d)}),t-=o,i-=l,e.nodes().forEach(u=>{let d=e.node(u);d.x-=t,d.y-=i}),e.edges().forEach(u=>{let d=e.edge(u);d.points.forEach(f=>{f.x-=t,f.y-=i}),Object.hasOwn(d,"x")&&(d.x-=t),Object.hasOwn(d,"y")&&(d.y-=i)}),s.width=n-t+o,s.height=r-i+l}function EGt(e){e.edges().forEach(t=>{let n=e.edge(t),i=e.node(t.v),r=e.node(t.w),s,o;n.points?(s=n.points[0],o=n.points[n.points.length-1]):(n.points=[],s=r,o=i),n.points.unshift(woe(i,s)),n.points.push(woe(r,o))})}function CGt(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,"x"))switch((n.labelpos==="l"||n.labelpos==="r")&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}})}function AGt(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function TGt(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),i=e.node(n.borderTop),r=e.node(n.borderBottom),s=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-s.x),n.height=Math.abs(r.y-i.y),n.x=s.x+n.width/2,n.y=i.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy==="border"&&e.removeNode(t)})}function _Gt(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function jGt(e){XT(e).forEach(t=>{let n=0;t.forEach((i,r)=>{let s=e.node(i);s.order=r+n,(s.selfEdges||[]).forEach(o=>{Sk(e,"selfedge",{width:o.label.width,height:o.label.height,rank:s.rank,order:r+ ++n,e:o.e,label:o.label},"_se")}),delete s.selfEdges})})}function NGt(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy==="selfedge"){let i=n,r=e.node(i.e.v),s=r.x+r.width/2,o=r.y,l=n.x-s,c=r.height/2;e.setEdge(i.e,i.label),e.removeNode(t),i.label.points=[{x:s+2*l/3,y:o-c},{x:s+5*l/6,y:o-c},{x:s+l,y:o},{x:s+5*l/6,y:o+c},{x:s+2*l/3,y:o+c}],i.label.x=n.x,i.label.y=n.y}})}function a6(e,t){return AL(NP(e,t),Number)}function o6(e){let t={};return e&&Object.entries(e).forEach(([n,i])=>{typeof n=="string"&&(n=n.toLowerCase()),t[n]=i}),t}function RGt(e){let t=XT(e),n=new Ld({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(i=>{n.setNode(i,{label:i}),n.setParent(i,"layer"+e.node(i).rank)}),e.edges().forEach(i=>n.setEdge(i.v,i.w,{},i.name)),t.forEach((i,r)=>{let s="layer"+r;n.setNode(s,{rank:"same"}),i.reduce((o,l)=>(n.setEdge(o,l,{style:"invis"}),l))}),n}var IGt={graphlib:NBe,version:VWt,layout:cGt,debug:RGt,util:{time:zBe,notime:VBe}},Roe=IGt;/*! For license information please see dagre.esm.js.LEGAL.txt */const AS={llm:{labelKey:"buildCanvas.patterns.llm.label",descriptionKey:"buildCanvas.patterns.llm.description",icon:Uje},sequential:{labelKey:"buildCanvas.patterns.sequential.label",descriptionKey:"buildCanvas.patterns.sequential.description",icon:zat},parallel:{labelKey:"buildCanvas.patterns.parallel.label",descriptionKey:"buildCanvas.patterns.parallel.description",icon:Oat},loop:{labelKey:"buildCanvas.patterns.loop.label",descriptionKey:"buildCanvas.patterns.loop.description",icon:qje},a2a:{labelKey:"buildCanvas.patterns.a2a.label",descriptionKey:"buildCanvas.patterns.a2a.description",icon:eM}},U7=220,Q7=88,Ioe=96,Poe=34,IE=64,l6=310,qx=24,n9e=56,z7=40,Doe=40,PGt=18,DGt=58,MGt=!1,LGt=e=>e==="sequential"||e==="parallel"||e==="loop";function V7(e,t){const n=e.agentType??"llm";return LGt(n)||n==="llm"&&(t.length===0||e.subAgents.length>0)}function H7(e,t=[],n="horizontal",i=!1){const r=e.agentType??"llm";if(!V7(e,t))return{width:U7,height:Q7};if(i&&e.subAgents.length===0)return{width:l6,height:IE};const s=e.subAgents.map((f,h)=>H7(f,[...t,h],n,i)),o=s.length?Math.max(...s.map(f=>f.width)):0,l=s.length?Math.max(...s.map(f=>f.height)):0,c=s.length&&r!=="parallel"?n9e:qx,u=n==="horizontal"?r!=="parallel":r==="parallel",d=s.length?r==="parallel"?PGt+Doe:r==="loop"?DGt:0:Doe;return u?{width:Math.max(l6,s.reduce((f,h)=>f+h.width,0)+z7*Math.max(0,s.length-1)+c*2),height:IE+qx+l+d+qx}:{width:Math.max(l6,o+qx*2),height:IE+c+s.reduce((f,h)=>f+h.height,0)+z7*Math.max(0,s.length-1)+d+c}}function DO(e){return e.length===0?"agent-root":`agent-${e.join("-")}`}function $Gt(e,t){return e.length===t.length&&e.every((n,i)=>n===t[i])}function Moe(e){const t=n=>[n.agentType??"llm",n.subAgents.map(t)];return JSON.stringify(t(e))}function MO(e,t,n,i){const r=(i==null?void 0:i.tone)==="sequential"?"hsl(213 40% 40%)":(i==null?void 0:i.tone)==="loop"?"hsl(151 34% 34%)":"hsl(220 9% 38%)";return{id:`${e}-${t}${i!=null&&i.loop?"-loop":""}`,source:e,target:t,sourceHandle:i!=null&&i.loop?"loop-source":void 0,targetHandle:i!=null&&i.loop?"loop-target":void 0,label:n,type:"insertStep",data:i?{insert:i.insert,loop:i.loop,tone:i.tone}:void 0,animated:i==null?void 0:i.loop,markerEnd:{type:dA.ArrowClosed,width:16,height:16,color:r},style:{stroke:r,strokeWidth:1.5},labelStyle:{fill:"hsl(215 14% 42%)",fontSize:10,fontWeight:600},labelBgStyle:{fill:"hsl(var(--background))",fillOpacity:.92}}}function Loe(e,t,n=!1,i){const r=[{id:"terminal-input",type:"terminal",position:{x:0,y:0},data:{kind:"terminal",title:i("buildCanvas.terminals.input")},selectable:!1,draggable:!1},{id:"terminal-output",type:"terminal",position:{x:0,y:0},data:{kind:"terminal",title:i("buildCanvas.terminals.output")},selectable:!1,draggable:!1}],s=[];function o(f,h,m,g,b){const v=f.agentType??"llm",y=DO(h);return V7(f,h)?(l(f,h,m,g,b),y):(r.push({id:y,type:"agent",parentId:m,extent:"parent",position:g,data:{kind:"agent",path:h,agent:f,title:v==="a2a"?i("buildCanvas.patterns.a2a.label"):f.name.trim()||(h.length===0?i("buildCanvas.rootAgent"):i("buildCanvas.unnamedStep")),pattern:v,description:f.description.trim()||i(AS[v].descriptionKey),childCount:f.subAgents.length,containedIn:b}}),y)}function l(f,h,m,g={x:0,y:0},b){const v=f.agentType??"sequential",y=DO(h),w=H7(f,h,t,n);r.push({id:y,type:"group",parentId:m,extent:m?"parent":void 0,position:g,style:{width:w.width,height:w.height},data:{kind:"agent",path:h,agent:f,title:f.name.trim()||(h.length===0?i("buildCanvas.rootAgent"):i(AS[v].labelKey)),pattern:v,description:f.description.trim()||i(AS[v].descriptionKey),childCount:f.subAgents.length,containedIn:b,layoutWidth:w.width,layoutHeight:w.height,compactEmptyGroup:n&&f.subAgents.length===0}});const x=f.subAgents.map((E,j)=>H7(E,[...h,j],t,n)),k=x.length&&v!=="parallel"?n9e:qx,S=t==="horizontal"?v!=="parallel":v==="parallel";let O=k;const A=f.subAgents.map((E,j)=>{const T=x[j],R=S?{x:O,y:IE+qx}:{x:(w.width-T.width)/2,y:IE+O};return O+=(S?T.width:T.height)+z7,o(E,[...h,j],y,R,v)});if(v==="sequential"||v==="loop"){for(let E=0;E1&&s.push(MO(A[A.length-1],A[0],i("buildCanvas.edges.continueLoop"),{loop:!0,tone:"loop"}))}return y}const c=(f,h)=>{const m=f.agentType??"llm",g=DO(h);if(V7(f,h))return l(f,h),[g];if(r.push({id:g,type:"agent",position:{x:0,y:0},data:{kind:"agent",path:h,agent:f,title:m==="a2a"?i("buildCanvas.patterns.a2a.label"):f.name.trim()||(h.length===0?i("buildCanvas.rootAgent"):i("buildCanvas.unnamedStep")),pattern:m,description:f.description.trim()||i(AS[m].descriptionKey),childCount:f.subAgents.length}}),f.subAgents.length===0)return[g];const b=[];return f.subAgents.forEach((v,y)=>{const w=[...h,y],x=DO(w);s.push(MO(g,x,i("buildCanvas.edges.call"),{insert:{parentPath:h,index:y}})),b.push(...c(v,w))}),b},u=DO([]),d=c(e,[]);return s.push(MO("terminal-input",u)),d.forEach(f=>s.push(MO(f,"terminal-output"))),FGt(r,s,t)}function FGt(e,t,n){const i=new Roe.graphlib.Graph().setDefaultEdgeLabel(()=>({}));i.setGraph({rankdir:n==="vertical"?"TB":"LR",ranksep:50,nodesep:34,edgesep:14,marginx:24,marginy:24});const r=new Set(e.filter(s=>!s.parentId).map(s=>s.id));return e.filter(s=>!s.parentId).forEach(s=>{const o=s.data.kind==="terminal";i.setNode(s.id,{width:o?Ioe:s.data.layoutWidth??U7,height:o?Poe:s.data.layoutHeight??Q7})}),t.filter(s=>r.has(s.source)&&r.has(s.target)).forEach(s=>i.setEdge(s.source,s.target)),Roe.layout(i),{nodes:e.map(s=>{if(s.parentId)return s;const o=i.node(s.id),l=s.data.kind==="terminal",c=l?Ioe:s.data.layoutWidth??U7,u=l?Poe:s.data.layoutHeight??Q7;return{...s,position:{x:o.x-c/2,y:o.y-u/2}}}),edges:t}}const _L=p.createContext(null),jL=p.createContext("horizontal");function BGt({id:e,sourceX:t,sourceY:n,targetX:i,targetY:r,sourcePosition:s,targetPosition:o,markerEnd:l,style:c,label:u,data:d}){const{t:f}=_e("create"),h=p.useContext(_L),[m,g]=p.useState(!1),[b,v,y]=AP({sourceX:t,sourceY:n,targetX:i,targetY:r,sourcePosition:s,targetPosition:o,offset:d!=null&&d.loop?28:20});return a.jsxs(a.Fragment,{children:[a.jsx(GT,{id:e,path:b,markerEnd:l,style:c}),h&&(d==null?void 0:d.insert)&&a.jsx("path",{d:b,className:"abc-edge-hover-path",onPointerEnter:()=>g(!0),onPointerLeave:()=>g(!1)}),(u||h&&(d==null?void 0:d.insert))&&a.jsx(Rqt,{children:a.jsxs("div",{className:`abc-edge-tools${h&&(d!=null&&d.insert)?" can-insert":""}${m?" is-visible":""}`,style:{transform:`translate(-50%, -50%) translate(${v}px, ${y}px)`},onPointerEnter:()=>g(!0),onPointerLeave:()=>g(!1),children:[u&&a.jsx("span",{className:"abc-edge-label",children:u}),h&&(d==null?void 0:d.insert)&&a.jsx("button",{type:"button",className:"abc-edge-add nodrag nopan","aria-label":f("buildCanvas.actions.insertHere"),title:f("buildCanvas.actions.insertHere"),onClick:w=>{w.stopPropagation(),h==null||h.onInsert(d.insert.parentPath,d.insert.index)},children:a.jsx(ec,{})})]})})]})}function UGt({data:e,selected:t}){const{t:n}=_e("create"),i=p.useContext(_L),r=p.useContext(jL),s=r==="vertical"?vn.Top:vn.Left,o=r==="vertical"?vn.Bottom:vn.Right,l=r==="vertical"?vn.Right:vn.Bottom,c=e.pattern??"llm",u=AS[c],d=u.icon;return a.jsxs("div",{className:`abc-node is-${c}${e.containedIn?` is-contained-in-${e.containedIn}`:""}${t?" is-selected":""}`,children:[a.jsx(Dc,{type:"target",position:s,className:"abc-handle"}),c!=="llm"&&a.jsx("span",{className:"abc-node-icon",children:a.jsx(d,{})}),a.jsxs("span",{className:"abc-node-copy",children:[a.jsx("span",{className:"abc-node-meta",children:a.jsx("span",{children:n(u.labelKey)})}),a.jsx("strong",{children:e.title}),a.jsx("small",{children:e.description})]}),i&&e.path!==void 0&&e.path.length>0&&a.jsx("button",{type:"button",className:"abc-node-delete nodrag nopan","aria-label":n("buildCanvas.actions.deleteNamed",{name:e.title}),title:n("buildCanvas.actions.deleteNode"),onClick:f=>{f.stopPropagation(),i==null||i.onDelete(e.path)},children:a.jsx(Yg,{})}),a.jsx(Dc,{type:"source",position:o,className:"abc-handle"}),e.containedIn==="loop"&&a.jsxs(a.Fragment,{children:[a.jsx(Dc,{id:"loop-target",type:"target",position:l,className:"abc-handle abc-loop-handle"}),a.jsx(Dc,{id:"loop-source",type:"source",position:l,className:"abc-handle abc-loop-handle"})]})]})}function QGt({data:e,selected:t}){const{t:n}=_e("create"),i=p.useContext(_L),r=p.useContext(jL),s=r==="vertical"?vn.Top:vn.Left,o=r==="vertical"?vn.Bottom:vn.Right,l=r==="vertical"?vn.Right:vn.Bottom,c=e.pattern??"sequential",u=e.childCount??0,d=n(c==="llm"?"buildCanvas.actions.addSubagent":c==="parallel"?"buildCanvas.actions.addParallelStep":c==="loop"?"buildCanvas.actions.addLoopStep":"buildCanvas.actions.addNextStep");return a.jsxs("div",{className:`abc-group is-${c}${e.compactEmptyGroup?" is-compact-empty":""}${t?" is-selected":""}`,children:[a.jsx(Dc,{type:"target",position:s,className:"abc-handle"}),a.jsx("header",{className:"abc-group-head",children:a.jsxs("span",{children:[a.jsx("strong",{title:e.title,children:e.title}),a.jsx("small",{children:e.description})]})}),i&&e.path!==void 0&&u>0&&c!=="parallel"&&a.jsxs("div",{className:"abc-group-boundary-actions",children:[a.jsx("button",{type:"button",className:"abc-group-boundary-add is-start nodrag nopan","aria-label":n("buildCanvas.actions.addFirst"),title:n("buildCanvas.actions.addFirst"),onClick:f=>{f.stopPropagation(),i.onInsert(e.path,0)},children:a.jsx(ec,{})}),a.jsx("button",{type:"button",className:"abc-group-boundary-add is-end nodrag nopan","aria-label":n("buildCanvas.actions.addLast"),title:n("buildCanvas.actions.addLast"),onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:a.jsx(ec,{})})]}),i&&e.path!==void 0&&u>0&&c==="parallel"&&a.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-bottom nodrag nopan",onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:[a.jsx(ec,{}),a.jsx("span",{children:d})]}),i&&e.path!==void 0&&u===0&&a.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-empty nodrag nopan",onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:[a.jsx(ec,{}),a.jsx("span",{children:d})]}),i&&e.path!==void 0&&e.path.length>0&&a.jsx("button",{type:"button",className:"abc-node-delete nodrag nopan","aria-label":n("buildCanvas.actions.deleteNamed",{name:e.title}),title:n("buildCanvas.actions.deleteNode"),onClick:f=>{f.stopPropagation(),i==null||i.onDelete(e.path)},children:a.jsx(Yg,{})}),a.jsx(Dc,{type:"source",position:o,className:"abc-handle"}),e.containedIn==="loop"&&a.jsxs(a.Fragment,{children:[a.jsx(Dc,{id:"loop-target",type:"target",position:l,className:"abc-handle abc-loop-handle"}),a.jsx(Dc,{id:"loop-source",type:"source",position:l,className:"abc-handle abc-loop-handle"})]})]})}function zGt({data:e}){const t=p.useContext(jL);return a.jsxs("div",{className:"abc-terminal",children:[a.jsx(Dc,{type:"target",position:t==="vertical"?vn.Top:vn.Left,className:"abc-handle"}),a.jsx("span",{children:e.title}),a.jsx(Dc,{type:"source",position:t==="vertical"?vn.Bottom:vn.Right,className:"abc-handle"})]})}const VGt={agent:UGt,group:QGt,terminal:zGt},HGt={insertStep:BGt};function qGt({draft:e,selectedPath:t,onSelect:n,onAdd:i,onInsert:r,onDelete:s,readOnly:o=!1,interactivePreview:l=!1,direction:c="horizontal"}){const{t:u}=_e("create"),d=p.useMemo(()=>Loe(e,c,o,u),[]),[f,h,m]=Iqt(d.nodes),[g,b,v]=Pqt(d.edges),y=Mqt(),w=p.useRef(`${c}:${o?"readonly":"editable"}:${Moe(e)}`),x=p.useRef(null),{fitView:k}=EL(),S=p.useMemo(()=>Loe(e,c,o,u),[c,e,o,u]),[O,A]=p.useState(()=>window.matchMedia("(max-width: 860px)").matches),E=p.useMemo(()=>o?{padding:.16,minZoom:.05,maxZoom:.9}:O?{padding:.08,minZoom:.35,maxZoom:.9}:{padding:.14,minZoom:.42,maxZoom:1.1},[O,o]),j=p.useCallback((R=0)=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{const C=x.current;if(C&&(C.clientWidth===0||C.clientHeight===0)&&R<8){j(R+1);return}k(E)})})},[E,k]);p.useEffect(()=>{const R=window.matchMedia("(max-width: 860px)"),C=N=>A(N.matches);return R.addEventListener("change",C),()=>R.removeEventListener("change",C)},[]),p.useEffect(()=>{const R=`${c}:${o?"readonly":"editable"}:${Moe(e)}`,C=R!==w.current;w.current=R,b(S.edges),h(N=>{const P=new Map(N.map(I=>[I.id,I]));return S.nodes.map(I=>{const D=P.get(I.id);return{...I,measured:!C&&D&&D.type===I.type?D.measured:void 0,position:!C&&D?D.position:I.position,selected:I.data.kind==="agent"&&!!I.data.path&&$Gt(I.data.path,t)}})}),C&&j()},[S,e,j,t,b,h]),p.useEffect(()=>{j()},[O,j]),p.useEffect(()=>{y&&j()},[S,j,y]),p.useEffect(()=>{if(!o||!x.current)return;const R=new ResizeObserver(()=>j());return R.observe(x.current),j(),()=>R.disconnect()},[j,o]);const T=p.useMemo(()=>o?null:{onAdd:i,onInsert:r,onDelete:s},[i,s,r,o]);return a.jsx(jL.Provider,{value:c,children:a.jsx(_L.Provider,{value:T,children:a.jsx("section",{className:`abc-root is-${c}${o?" is-readonly":""}`,"aria-label":u(o?"buildCanvas.readOnlyLabel":"buildCanvas.label"),children:a.jsx("div",{ref:x,className:"abc-canvas",children:a.jsxs(jqt,{nodes:f,edges:g,nodeTypes:VGt,edgeTypes:HGt,onNodesChange:m,onEdgesChange:v,onNodeClick:(R,C)=>{!o&&C.data.kind==="agent"&&C.data.path&&n(C.data.path)},nodesDraggable:!o,nodesConnectable:!1,nodesFocusable:!o,elementsSelectable:!o,edgesFocusable:!1,edgesReconnectable:!1,panOnDrag:!o||l,zoomOnDoubleClick:l,zoomOnPinch:!o||l,zoomOnScroll:!o||l,fitView:!0,fitViewOptions:E,onInit:()=>j(),minZoom:o?.05:.35,maxZoom:1.6,proOptions:{hideAttribution:!0},ariaLabelConfig:{"controls.ariaLabel":u("buildCanvas.controls.ariaLabel"),"controls.zoomIn.ariaLabel":u("buildCanvas.controls.zoomIn"),"controls.zoomOut.ariaLabel":u("buildCanvas.controls.zoomOut"),"controls.fitView.ariaLabel":u("buildCanvas.controls.fitView")},children:[a.jsx(Uqt,{gap:20,size:1.2,color:"hsl(34 20% 82%)"}),(!o||l)&&a.jsx(Kqt,{showInteractive:!1}),MGt]})})})})})}function RP(e){return a.jsx(CBe,{children:a.jsx(qGt,{...e})})}function WGt(e){return[{id:"case-1",itemKey:"case-1",kind:"good",input:e("agentWorkspace.defaultCases.weeklyFeedback.input"),output:e("agentWorkspace.defaultCases.weeklyFeedback.output"),referenceOutput:e("agentWorkspace.defaultCases.weeklyFeedback.output"),comment:"",agentName:e("agentWorkspace.defaultCases.agentName"),sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T09:12:00+08:00",evaluationSetId:"",evaluationSetName:e("agentWorkspace.defaultCases.goodSetName"),workspaceId:"",tag:e("agentWorkspace.defaultCases.weeklyFeedback.tag"),source:"auto",score:.92,reason:e("agentWorkspace.defaultCases.weeklyFeedback.reason")},{id:"case-2",itemKey:"case-2",kind:"good",input:e("agentWorkspace.defaultCases.research.input"),output:e("agentWorkspace.defaultCases.research.output"),referenceOutput:e("agentWorkspace.defaultCases.research.output"),comment:"",agentName:e("agentWorkspace.defaultCases.agentName"),sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T08:47:00+08:00",evaluationSetId:"",evaluationSetName:e("agentWorkspace.defaultCases.goodSetName"),workspaceId:"",tag:e("agentWorkspace.defaultCases.research.tag"),source:"user"},{id:"case-3",itemKey:"case-3",kind:"bad",input:e("agentWorkspace.defaultCases.uncertainConclusion.input"),output:e("agentWorkspace.defaultCases.uncertainConclusion.output"),referenceOutput:"",comment:"",agentName:e("agentWorkspace.defaultCases.agentName"),sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T07:35:00+08:00",evaluationSetId:"",evaluationSetName:e("agentWorkspace.defaultCases.badSetName"),workspaceId:"",tag:e("agentWorkspace.defaultCases.uncertainConclusion.tag"),source:"auto",score:.28,reason:e("agentWorkspace.defaultCases.uncertainConclusion.reason")},{id:"case-4",itemKey:"case-4",kind:"bad",input:e("agentWorkspace.defaultCases.repeatedTool.input"),output:e("agentWorkspace.defaultCases.repeatedTool.output"),referenceOutput:"",comment:"",agentName:e("agentWorkspace.defaultCases.agentName"),sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T06:58:00+08:00",evaluationSetId:"",evaluationSetName:e("agentWorkspace.defaultCases.badSetName"),workspaceId:"",tag:e("agentWorkspace.defaultCases.repeatedTool.tag"),source:"user"}]}const KGt=[{id:"eval-regression",name:"核心能力回归",agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量","工具调用"],concurrency:"4",history:[{id:"run-1",createdAt:"今天 10:32",score:88,status:"completed"},{id:"run-2",createdAt:"昨天 16:08",score:84,status:"completed"}]},{id:"eval-safety",name:"安全与幻觉检查",agentIds:[],caseSet:"安全边界集",evaluator:"事实一致性评估器",metrics:["事实准确性","拒答合理性"],concurrency:"2",history:[{id:"run-3",createdAt:"7 月 25 日 14:20",score:91,status:"completed"}]}],GGt={核心能力回归:"agentWorkspace.evaluationDefaults.coreRegression",安全与幻觉检查:"agentWorkspace.evaluationDefaults.safetyCheck",核心回归集:"agentWorkspace.evaluationDefaults.coreSet",安全边界集:"agentWorkspace.evaluationDefaults.safetySet",工具调用集:"agentWorkspace.evaluationDefaults.toolSet",综合质量评估器:"agentWorkspace.evaluationDefaults.qualityEvaluator",事实一致性评估器:"agentWorkspace.evaluationDefaults.factualEvaluator",工具调用评估器:"agentWorkspace.evaluationDefaults.toolEvaluator",回答质量:"agentWorkspace.evaluationDefaults.responseQuality",事实准确性:"agentWorkspace.evaluationDefaults.factualAccuracy",工具调用:"agentWorkspace.evaluationDefaults.toolUse",响应效率:"agentWorkspace.evaluationDefaults.responseEfficiency","今天 10:32":"agentWorkspace.evaluationDefaults.todayTime","昨天 16:08":"agentWorkspace.evaluationDefaults.yesterdayTime","7 月 25 日 14:20":"agentWorkspace.evaluationDefaults.julyTime",刚刚:"agentWorkspace.evaluationDefaults.justNow"};function TS(e,t){const n=GGt[e];return n?t(n):e}const XGt=["basic","profileConfig","sessionConfig","usage","diagnostics","evaluations","optimizations","integrations","versions"],YGt=20;function i9e(e,t,n){const i=Date.parse(e);return Number.isNaN(i)?n("agentWorkspace.notProvided"):new Intl.DateTimeFormat(t,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).format(i)}const LO=[{id:"api-server",label:"API Server"},{id:"a2a",label:"A2A"}];function r9e(e){if(!e||typeof e!="object")return"";const t=e.id;return typeof t=="string"?t:""}function mx(e){var t;return r9e((t=e==null?void 0:e.effectiveRefs)==null?void 0:t.model)}function $oe(e,t){var r;const n=(r=e==null?void 0:e.overrides)==null?void 0:r[t];if(!n||typeof n!="object")return"";const i=n.mode;return i==="replace"||i==="clear"||i==="inherit"?i:""}function s9e(e){var n;const t=(n=e==null?void 0:e.effectiveRefs)==null?void 0:n.mcpServers;return Array.isArray(t)?t.map(r9e).filter(Boolean):[]}function ZGt(e,t){switch(e){case"active_operation":return t("agentWorkspace.mpaDeleteBlockerActiveOperation");case"active_sessions":return t("agentWorkspace.mpaDeleteBlockerActiveSessions");case"binding_ambiguous":return t("agentWorkspace.mpaDeleteBlockerBindingAmbiguous");case"runtime_missing":return t("agentWorkspace.mpaDeleteBlockerRuntimeMissing");case"orphan_runtime":return t("agentWorkspace.mpaDeleteBlockerOrphanRuntime");default:return e}}function JGt(e,t){switch(e){case"runtime_legacy_auth_unsupported":return t("agentWorkspace.mpaRuntimeLegacyAuthUnsupported");case"profile_not_found":return t("agentWorkspace.mpaRuntimeOrphan");case"binding_ambiguous":return t("agentWorkspace.mpaRuntimeBindingAmbiguous");case"runtime_missing":return t("agentWorkspace.mpaRuntimeMissing");default:return e??""}}function eXt({preview:e,t}){var i,r;const n=e.blockers.map(s=>ZGt(s,t));return a.jsxs("div",{className:"aw-mpa-delete-preview",children:[a.jsx("p",{children:t("agentWorkspace.mpaDeletePreviewSummary")}),a.jsxs("dl",{className:"aw-mpa-delete-preview__stats",children:[a.jsxs("div",{children:[a.jsx("dt",{children:t("agentWorkspace.mpaDeletePreviewSessions")}),a.jsx("dd",{children:e.sessionCounts.total})]}),a.jsxs("div",{children:[a.jsx("dt",{children:t("agentWorkspace.mpaDeletePreviewActiveSessions")}),a.jsx("dd",{children:e.sessionCounts.active})]}),a.jsxs("div",{children:[a.jsx("dt",{children:t("agentWorkspace.mpaDeletePreviewIdleSessions")}),a.jsx("dd",{children:e.sessionCounts.idle})]})]}),n.length>0?a.jsxs("div",{className:"aw-mpa-delete-preview__blockers",role:"status",children:[a.jsx("strong",{children:t("agentWorkspace.mpaDeleteBlocked")}),a.jsx("ul",{children:n.map(s=>a.jsx("li",{children:s},s))})]}):a.jsx("ol",{className:"aw-mpa-delete-preview__plan",children:e.cleanupPlan.map(s=>a.jsxs("li",{children:[t(`agentWorkspace.mpaDeleteStage.${s.stage}`,{count:s.count}),s.resourceId&&a.jsxs("span",{children:[" (",s.resourceId,")"]})]},s.stage))}),!!((i=e.retainedResources)!=null&&i.length)&&a.jsxs("div",{children:[a.jsx("strong",{children:t("agentWorkspace.mpaDeleteRetained")}),a.jsx("ul",{children:(r=e.retainedResources)==null?void 0:r.map(s=>a.jsxs("li",{children:[s.resourceId," — ",t(`agentWorkspace.mpaDeleteRetainedReason.${s.reason}`,{defaultValue:s.reason})]},`${s.stage}:${s.resourceId}`))})]})]})}function c6(e,t){return e instanceof rw&&e.status===412?t:e instanceof Error?e.message:String(e)}function tXt(e){return s9e(e).length}function Foe(e,t){const n=s9e(e);return n.length?n.join(", "):t("agentWorkspace.none")}function Boe(e,t){var n;return!!((n=e==null?void 0:e.overrides)!=null&&n[t])}function nXt(e,t,n){return`mpa-session-profile-upgrade:${e}:${t}:${n}`}function u6(e,t){return e?`${e.replace(/\/+$/,"")}${t}`:""}function iXt(e,t){const n=e.trim();if(!n||!t)return n;try{const i=new URL(n),r=i.hostname.replace(/^\[|\]$/g,"").toLowerCase();if(!["localhost","127.0.0.1","::1"].includes(r))return n;const s=new URL(t);return i.protocol=s.protocol,i.hostname=s.hostname,i.port=s.port,i.toString()}catch{return n}}function Uoe(e,t){return e==="key_auth"?"API Key":e==="custom_jwt"?"OAuth / JWT":t(e==="none"?"agentWorkspace.noAuthentication":"agentWorkspace.notAvailable")}function Qoe(e,t){return t(e==="published"?"agentWorkspace.githubStatus.published":e==="publishing"?"agentWorkspace.githubStatus.publishing":e==="failed"?"agentWorkspace.githubStatus.failed":e==="pending"?"agentWorkspace.githubStatus.pending":"agentWorkspace.githubStatus.unknown")}function rXt(e,t){return e.changeType==="rollback"?t("agentWorkspace.rollbackEvent"):e.version}function q7(e){return JSON.stringify(e)}function a9e(e){return e==="key_auth"?`API_KEY = "" +`)),d=u.reduce((f,h)=>f.concat(...h),[]);return[u,d]}return[[],[]]},[e]);return p.useEffect(()=>{const c=(t==null?void 0:t.target)??toe,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=m=>{var v,y;if(r.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!r.current||r.current&&!u)&&R8e(m))return!1;const b=ioe(m.code,l);if(s.current.add(m[b]),noe(o,s.current,!1)){const w=((y=(v=m.composedPath)==null?void 0:v.call(m))==null?void 0:y[0])||m.target,x=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";t.preventDefault!==!1&&(r.current||!x)&&m.preventDefault(),i(!0)}},f=m=>{const g=ioe(m.code,l);noe(o,s.current,!0)?(i(!1),s.current.clear()):s.current.delete(m[g]),m.key==="Meta"&&s.current.clear(),r.current=!1},h=()=>{s.current.clear(),i(!1)};return c==null||c.addEventListener("keydown",d),c==null||c.addEventListener("keyup",f),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{c==null||c.removeEventListener("keydown",d),c==null||c.removeEventListener("keyup",f),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,i]),n}function noe(e,t,n){return e.filter(i=>n||i.length===t.size).some(i=>i.every(r=>t.has(r)))}function ioe(e,t){return t.includes(e)?"code":"key"}const oHt=()=>{const e=Vs();return p.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:i}=e.getState();return i?i.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[i,r,s],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??i,y:t.y??r,zoom:t.zoom??s},n),!0):!1},getViewport:()=>{const[t,n,i]=e.getState().transform;return{x:t,y:n,zoom:i}},setCenter:async(t,n,i)=>e.getState().setCenter(t,n,i),fitBounds:async(t,n)=>{const{width:i,height:r,minZoom:s,maxZoom:o,panZoom:l}=e.getState(),c=tK(t,i,r,s,o,(n==null?void 0:n.padding)??.1);return l?(await l.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:i,snapGrid:r,snapToGrid:s,domNode:o}=e.getState();if(!o)return t;const{x:l,y:c}=o.getBoundingClientRect(),u={x:t.x-l,y:t.y-c},d=n.snapGrid??r,f=n.snapToGrid??s;return Ok(u,i,f,d)},flowToScreenPosition:t=>{const{transform:n,domNode:i}=e.getState();if(!i)return t;const{x:r,y:s}=i.getBoundingClientRect(),o=T1(t,n);return{x:o.x+r,y:o.y+s}}}),[])};function eBe(e,t){const n=[],i=new Map,r=[];for(const s of e)if(s.type==="add"){r.push(s);continue}else if(s.type==="remove"||s.type==="replace")i.set(s.id,[s]);else{const o=i.get(s.id);o?o.push(s):i.set(s.id,[s])}for(const s of t){const o=i.get(s.id);if(!o){n.push(s);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const l={...s};for(const c of o)lHt(c,l);n.push(l)}return r.length&&r.forEach(s=>{s.index!==void 0?n.splice(s.index,0,{...s.item}):n.push({...s.item})}),n}function lHt(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 tBe(e,t){return eBe(e,t)}function nBe(e,t){return eBe(e,t)}function py(e,t){return{id:e,type:"select",selected:t}}function Hx(e,t=new Set,n=!1){const i=[];for(const[r,s]of e){const o=t.has(r);!(s.selected===void 0&&!o)&&s.selected!==o&&(n&&(s.selected=o),i.push(py(s.id,o)))}return i}function roe({items:e=[],lookup:t}){var r;const n=[],i=new Map(e.map(s=>[s.id,s]));for(const[s,o]of e.entries()){const l=t.get(o.id),c=((r=l==null?void 0:l.internals)==null?void 0:r.userNode)??l;c!==void 0&&c!==o&&n.push({id:o.id,item:o,type:"replace"}),c===void 0&&n.push({item:o,type:"add",index:s})}for(const[s]of t)i.get(s)===void 0&&n.push({id:s,type:"remove"});return n}function soe(e){return{id:e.id,type:"remove"}}const cHt=_8e();function uHt(e,t,n={}){return tVt(e,t,{...n,onError:n.onError??cHt})}const aoe=e=>Bzt(e),dHt=e=>E8e(e);function iBe(e){return p.forwardRef(e)}const fHt=typeof window<"u"?p.useLayoutEffect:p.useEffect;function ooe(e){const[t,n]=p.useState(BigInt(0)),[i]=p.useState(()=>hHt(()=>n(r=>r+BigInt(1))));return fHt(()=>{const r=i.get();r.length&&(e(r),i.reset())},[t]),i}function hHt(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const rBe=p.createContext(null);function pHt({children:e}){const t=Vs(),n=p.useCallback(l=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:d,onNodesChange:f,nodeLookup:h,fitViewQueued:m,onNodesChangeMiddlewareMap:g}=t.getState();let b=c;for(const y of l)b=typeof y=="function"?y(b):y;let v=roe({items:b,lookup:h});for(const y of g.values())v=y(v);d&&u(b),v.length>0?f==null||f(v):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:y,nodes:w,setNodes:x}=t.getState();y&&x(w)})},[]),i=ooe(n),r=p.useCallback(l=>{const{edges:c=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:f,edgeLookup:h}=t.getState();let m=c;for(const g of l)m=typeof g=="function"?g(m):g;d?u(m):f&&f(roe({items:m,lookup:h}))},[]),s=ooe(r),o=p.useMemo(()=>({nodeQueue:i,edgeQueue:s}),[]);return a.jsx(rBe.Provider,{value:o,children:e})}function mHt(){const e=p.useContext(rBe);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const gHt=e=>!!e.panZoom;function EL(){const e=oHt(),t=Vs(),n=mHt(),i=or(gHt),r=p.useMemo(()=>{const s=f=>t.getState().nodeLookup.get(f),o=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},c=f=>{var y,w;const{nodeLookup:h,nodeOrigin:m}=t.getState(),g=aoe(f)?f:h.get(f.id),b=g.parentId?j8e(g.position,g.measured,g.parentId,h,m):g.position,v={...g,position:b,width:((y=g.measured)==null?void 0:y.width)??g.width,height:((w=g.measured)==null?void 0:w.height)??g.height};return A1(v)},u=(f,h,m={replace:!1})=>{o(g=>g.map(b=>{if(b.id===f){const v=typeof h=="function"?h(b):h;return m.replace&&aoe(v)?v:{...b,...v}}return b}))},d=(f,h,m={replace:!1})=>{l(g=>g.map(b=>{if(b.id===f){const v=typeof h=="function"?h(b):h;return m.replace&&dHt(v)?v:{...b,...v}}return b}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var h;return(h=s(f))==null?void 0:h.internals.userNode},getInternalNode:s,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(h=>({...h}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:o,setEdges:l,addNodes:f=>{const h=Array.isArray(f)?f:[f];n.nodeQueue.push(m=>[...m,...h])},addEdges:f=>{const h=Array.isArray(f)?f:[f];n.edgeQueue.push(m=>[...m,...h])},toObject:()=>{const{nodes:f=[],edges:h=[],transform:m}=t.getState(),[g,b,v]=m;return{nodes:f.map(y=>({...y})),edges:h.map(y=>({...y})),viewport:{x:g,y:b,zoom:v}}},deleteElements:async({nodes:f=[],edges:h=[]})=>{const{nodes:m,edges:g,onNodesDelete:b,onEdgesDelete:v,triggerNodeChanges:y,triggerEdgeChanges:w,onDelete:x,onBeforeDelete:k}=t.getState(),{nodes:S,edges:O}=await Hzt({nodesToRemove:f,edgesToRemove:h,nodes:m,edges:g,onBeforeDelete:k}),A=O.length>0,E=S.length>0;if(A){const j=O.map(soe);v==null||v(O),w(j)}if(E){const j=S.map(soe);b==null||b(S),y(j)}return(E||A)&&(x==null||x({nodes:S,edges:O})),{deletedNodes:S,deletedEdges:O}},getIntersectingNodes:(f,h=!0,m)=>{const g=Mae(f),b=g?f:c(f),v=m!==void 0;return b?(m||t.getState().nodes).filter(y=>{const w=t.getState().nodeLookup.get(y.id);if(w&&!g&&(y.id===f.id||!w.internals.positionAbsolute))return!1;const x=A1(v?y:w),k=fA(x,b);return h&&k>0||k>=x.width*x.height||k>=b.width*b.height}):[]},isNodeIntersecting:(f,h,m=!0)=>{const b=Mae(f)?f:c(f);if(!b)return!1;const v=fA(b,h);return m&&v>0||v>=h.width*h.height||v>=b.width*b.height},updateNode:u,updateNodeData:(f,h,m={replace:!1})=>{u(f,g=>{const b=typeof h=="function"?h(g):h;return m.replace?{...g,data:b}:{...g,data:{...g.data,...b}}},m)},updateEdge:d,updateEdgeData:(f,h,m={replace:!1})=>{d(f,g=>{const b=typeof h=="function"?h(g):h;return m.replace?{...g,data:b}:{...g,data:{...g.data,...b}}},m)},getNodesBounds:f=>{const{nodeLookup:h,nodeOrigin:m}=t.getState();return Uzt(f,{nodeLookup:h,nodeOrigin:m})},getHandleConnections:({type:f,id:h,nodeId:m})=>{var g;return Array.from(((g=t.getState().connectionLookup.get(`${m}-${f}${h?`-${h}`:""}`))==null?void 0:g.values())??[])},getNodeConnections:({type:f,handleId:h,nodeId:m})=>{var g;return Array.from(((g=t.getState().connectionLookup.get(`${m}${f?h?`-${f}-${h}`:`-${f}`:""}`))==null?void 0:g.values())??[])},fitView:async f=>{const h=t.getState().fitViewResolver??Kzt();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:h}),n.nodeQueue.push(m=>[...m]),h.promise}}},[]);return p.useMemo(()=>({...r,...e,viewportInitialized:i}),[i])}const loe=e=>e.selected,bHt=typeof window<"u"?window:void 0;function yHt({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Vs(),{deleteElements:i}=EL(),r=pA(e,{actInsideInputWithModifier:!1}),s=pA(t,{target:bHt});p.useEffect(()=>{if(r){const{edges:o,nodes:l}=n.getState();i({nodes:l.filter(loe),edges:o.filter(loe)}),n.setState({nodesSelectionActive:!1})}},[r]),p.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function vHt(e){const t=Vs();p.useEffect(()=>{const n=()=>{var r,s,o,l;if(!e.current||!(((s=(r=e.current).checkVisibility)==null?void 0:s.call(r))??!0))return!1;const i=iK(e.current);(i.height===0||i.width===0)&&((l=(o=t.getState()).onError)==null||l.call(o,"004",wf.error004())),t.setState({width:i.width||500,height:i.height||500})};if(e.current){n(),window.addEventListener("resize",n);const i=new ResizeObserver(()=>n());return i.observe(e.current),()=>{window.removeEventListener("resize",n),i&&e.current&&i.unobserve(e.current)}}},[])}const CL={position:"absolute",width:"100%",height:"100%",top:0,left:0},xHt=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function wHt({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:r=.5,panOnScrollMode:s=Yy.Free,zoomOnDoubleClick:o=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:m=!0,children:g,noWheelClassName:b,noPanClassName:v,onViewportChange:y,isControlledViewport:w,paneClickDistance:x,selectionOnDrag:k}){const S=Vs(),O=p.useRef(null),{userSelectionActive:A,lib:E,connectionInProgress:j}=or(xHt,zs),T=pA(h),R=p.useRef();vHt(O);const C=p.useCallback(N=>{y==null||y({x:N[0],y:N[1],zoom:N[2]}),w||S.setState({transform:N})},[y,w]);return p.useEffect(()=>{if(O.current){R.current=NVt({domNode:O.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:c,onDraggingChange:D=>S.setState(_=>_.paneDragging===D?_:{paneDragging:D}),onPanZoomStart:(D,_)=>{const{onViewportChangeStart:L,onMoveStart:F}=S.getState();F==null||F(D,_),L==null||L(_)},onPanZoom:(D,_)=>{const{onViewportChange:L,onMove:F}=S.getState();F==null||F(D,_),L==null||L(_)},onPanZoomEnd:(D,_)=>{const{onViewportChangeEnd:L,onMoveEnd:F}=S.getState();F==null||F(D,_),L==null||L(_)}});const{x:N,y:P,zoom:I}=R.current.getViewport();return S.setState({panZoom:R.current,transform:[N,P,I],domNode:O.current.closest(".react-flow")}),()=>{var D;(D=R.current)==null||D.destroy()}}},[]),p.useEffect(()=>{var N;(N=R.current)==null||N.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:r,panOnScrollMode:s,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:T,preventScrolling:m,noPanClassName:v,userSelectionActive:A,noWheelClassName:b,lib:E,onTransformChange:C,connectionInProgress:j,selectionOnDrag:k,paneClickDistance:x})},[e,t,n,i,r,s,o,l,T,m,v,A,b,E,C,j,k,x]),a.jsx("div",{className:"react-flow__renderer",ref:O,style:CL,children:g})}const kHt=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function OHt(){const{userSelectionActive:e,userSelectionRect:t}=or(kHt,zs);return e&&t?a.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 e6=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},SHt=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function EHt({isSelecting:e,selectionKeyPressed:t,selectionMode:n=uA.Full,panOnDrag:i,autoPanOnSelection:r,paneClickDistance:s,selectionOnDrag:o,onSelectionStart:l,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:m,onPaneMouseLeave:g,children:b}){const v=p.useRef(0),y=Vs(),{userSelectionActive:w,elementsSelectable:x,dragging:k,connectionInProgress:S,panBy:O,autoPanSpeed:A}=or(SHt,zs),E=x&&(e||w),j=p.useRef(null),T=p.useRef(),R=p.useRef(new Set),C=p.useRef(new Set),N=p.useRef(!1),P=p.useRef({x:0,y:0}),I=p.useRef(!1),D=W=>{if(N.current||S){N.current=!1;return}u==null||u(W),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})},_=W=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){W.preventDefault();return}d==null||d(W)},L=f?W=>f(W):void 0,F=W=>{N.current&&(W.stopPropagation(),N.current=!1)},M=W=>{var he,ge;const{domNode:X,transform:ce}=y.getState();if(T.current=X==null?void 0:X.getBoundingClientRect(),!T.current)return;const V=W.target===j.current;if(!V&&!!W.target.closest(".nokey")||!e||!(o&&V||t)||W.button!==0||!W.isPrimary)return;(ge=(he=W.target)==null?void 0:he.setPointerCapture)==null||ge.call(he,W.pointerId),N.current=!1;const{x:de,y:ee}=cf(W.nativeEvent,T.current),Oe=Ok({x:de,y:ee},ce);y.setState({userSelectionRect:{width:0,height:0,startX:Oe.x,startY:Oe.y,x:de,y:ee}}),V||(W.stopPropagation(),W.preventDefault())};function H(W,X){const{userSelectionRect:ce}=y.getState();if(!ce)return;const{transform:V,nodeLookup:Y,edgeLookup:K,connectionLookup:de,triggerNodeChanges:ee,triggerEdgeChanges:Oe,defaultEdgeOptions:he}=y.getState(),ge={x:ce.startX,y:ce.startY},{x:Se,y:xe}=T1(ge,V),Pe={startX:ge.x,startY:ge.y,x:Wre.id)),C.current=new Set;const Me=(he==null?void 0:he.selectable)??!0;for(const re of R.current){const ue=de.get(re);if(ue)for(const{edgeId:be}of ue.values()){const Ce=K.get(be);Ce&&(Ce.selectable??Me)&&C.current.add(be)}}if(!Lae(Ue,R.current)){const re=Hx(Y,R.current,!0);ee(re)}if(!Lae(Ke,C.current)){const re=Hx(K,C.current);Oe(re)}y.setState({userSelectionRect:Pe,userSelectionActive:!0,nodesSelectionActive:!1})}function q(){if(!r||!T.current)return;const[W,X]=eK(P.current,T.current,A);O({x:W,y:X}).then(ce=>{if(!N.current||!ce){v.current=requestAnimationFrame(q);return}const{x:V,y:Y}=P.current;H(V,Y),v.current=requestAnimationFrame(q)})}const U=()=>{cancelAnimationFrame(v.current),v.current=0,I.current=!1};p.useEffect(()=>()=>U(),[]);const Z=W=>{const{userSelectionRect:X,transform:ce,resetSelectedElements:V}=y.getState();if(!T.current||!X)return;const{x:Y,y:K}=cf(W.nativeEvent,T.current);P.current={x:Y,y:K};const de=T1({x:X.startX,y:X.startY},ce);if(!N.current){const ee=t?0:s;if(Math.hypot(Y-de.x,K-de.y)<=ee)return;V(),l==null||l(W)}N.current=!0,I.current||(q(),I.current=!0),H(Y,K)},z=W=>{var X,ce;W.button===0&&((ce=(X=W.target)==null?void 0:X.releasePointerCapture)==null||ce.call(X,W.pointerId),!w&&W.target===j.current&&y.getState().userSelectionRect&&(D==null||D(W)),y.setState({userSelectionActive:!1,userSelectionRect:null}),N.current&&(c==null||c(W),y.setState({nodesSelectionActive:R.current.size>0})),U())},J=W=>{var X,ce;(ce=(X=W.target)==null?void 0:X.releasePointerCapture)==null||ce.call(X,W.pointerId),U()},ne=i===!0||Array.isArray(i)&&i.includes(0);return a.jsxs("div",{className:no(["react-flow__pane",{draggable:ne,dragging:k,selection:e}]),onClick:E?void 0:e6(D,j),onContextMenu:e6(_,j),onWheel:e6(L,j),onPointerEnter:E?void 0:h,onPointerMove:E?Z:m,onPointerUp:E?z:void 0,onPointerCancel:E?J:void 0,onPointerDownCapture:E?M:void 0,onClickCapture:E?F:void 0,onPointerLeave:g,ref:j,style:CL,children:[b,a.jsx(OHt,{})]})}function F7({id:e,store:t,unselect:n=!1,nodeRef:i}){const{addSelectedNodes:r,unselectNodesAndEdges:s,multiSelectionActive:o,nodeLookup:l,onError:c}=t.getState(),u=l.get(e);if(!u){c==null||c("012",wf.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&o)&&(s({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=i==null?void 0:i.current)==null?void 0:d.blur()})):r([e])}function sBe({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:i,nodeId:r,isSelectable:s,nodeClickDistance:o}){const l=Vs(),[c,u]=p.useState(!1),d=p.useRef();return p.useEffect(()=>{d.current=bVt({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{F7({id:f,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),p.useEffect(()=>{if(!(t||!e.current||!d.current))return d.current.update({noDragClassName:n,handleSelector:i,domNode:e.current,isSelectable:s,nodeId:r,nodeClickDistance:o}),()=>{var f;(f=d.current)==null||f.destroy()}},[n,i,t,s,e,r,o]),c}const CHt=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function aBe(){const e=Vs();return p.useCallback(n=>{const{nodeExtent:i,snapToGrid:r,snapGrid:s,nodesDraggable:o,onError:l,updateNodePositions:c,nodeLookup:u,nodeOrigin:d}=e.getState(),f=new Map,h=CHt(o),m=r?s[0]:5,g=r?s[1]:5,b=n.direction.x*m*n.factor,v=n.direction.y*g*n.factor;for(const[,y]of u){if(!h(y))continue;let w={x:y.internals.positionAbsolute.x+b,y:y.internals.positionAbsolute.y+v};r&&(w=KT(w,s));const{position:x,positionAbsolute:k}=C8e({nodeId:y.id,nextPosition:w,nodeLookup:u,nodeExtent:i,nodeOrigin:d,onError:l});y.position=x,y.internals.positionAbsolute=k,f.set(y.id,y)}c(f)},[])}const cK=p.createContext(null),AHt=cK.Provider;cK.Consumer;const oBe=()=>p.useContext(cK),THt=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),_Ht=(e,t,n)=>i=>{const{connectionClickStartHandle:r,connectionMode:s,connection:o}=i,{fromHandle:l,toHandle:c,isValid:u}=o,d=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:d,clickConnecting:(r==null?void 0:r.nodeId)===e&&(r==null?void 0:r.id)===t&&(r==null?void 0:r.type)===n,isPossibleEndHandle:s===E1.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!r,valid:d&&u}};function jHt({type:e="source",position:t=vn.Top,isValidConnection:n,isConnectable:i=!0,isConnectableStart:r=!0,isConnectableEnd:s=!0,id:o,onConnect:l,children:c,className:u,onMouseDown:d,onTouchStart:f,...h},m){var I,D;const g=o||null,b=e==="target",v=Vs(),y=oBe(),{connectOnClick:w,noPanClassName:x,rfId:k}=or(THt,zs),{connectingFrom:S,connectingTo:O,clickConnecting:A,isPossibleEndHandle:E,connectionInProcess:j,clickConnectionInProcess:T,valid:R}=or(_Ht(y,g,e),zs);y||(D=(I=v.getState()).onError)==null||D.call(I,"010",wf.error010());const C=_=>{const{defaultEdgeOptions:L,onConnect:F,hasDefaultEdges:M}=v.getState(),H={...L,..._};if(M){const{edges:q,setEdges:U,onError:Z}=v.getState();U(uHt(H,q,{onError:Z}))}F==null||F(H),l==null||l(H)},N=_=>{if(!y)return;const L=I8e(_.nativeEvent);if(r&&(L&&_.button===0||!L)){const F=v.getState();$7.onPointerDown(_.nativeEvent,{handleDomNode:_.currentTarget,autoPanOnConnect:F.autoPanOnConnect,connectionMode:F.connectionMode,connectionRadius:F.connectionRadius,domNode:F.domNode,nodeLookup:F.nodeLookup,lib:F.lib,isTarget:b,handleId:g,nodeId:y,flowId:F.rfId,panBy:F.panBy,cancelConnection:F.cancelConnection,onConnectStart:F.onConnectStart,onConnectEnd:(...M)=>{var H,q;return(q=(H=v.getState()).onConnectEnd)==null?void 0:q.call(H,...M)},updateConnection:F.updateConnection,onConnect:C,isValidConnection:n||((...M)=>{var H,q;return((q=(H=v.getState()).isValidConnection)==null?void 0:q.call(H,...M))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:F.autoPanSpeed,dragThreshold:F.connectionDragThreshold})}L?d==null||d(_):f==null||f(_)},P=_=>{const{onClickConnectStart:L,onClickConnectEnd:F,connectionClickStartHandle:M,connectionMode:H,isValidConnection:q,lib:U,rfId:Z,nodeLookup:z,connection:J}=v.getState();if(!y||!M&&!r)return;if(!M){L==null||L(_.nativeEvent,{nodeId:y,handleId:g,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:y,type:e,id:g}});return}const ne=N8e(_.target),W=n||q,{connection:X,isValid:ce}=$7.isValid(_.nativeEvent,{handle:{nodeId:y,id:g,type:e},connectionMode:H,fromNodeId:M.nodeId,fromHandleId:M.id||null,fromType:M.type,isValidConnection:W,flowId:Z,doc:ne,lib:U,nodeLookup:z});ce&&X&&C(X);const V=structuredClone(J);delete V.inProgress,V.toPosition=V.toHandle?V.toHandle.position:null,F==null||F(_,V),v.setState({connectionClickStartHandle:null})};return a.jsx("div",{"data-handleid":g,"data-nodeid":y,"data-handlepos":t,"data-id":`${k}-${y}-${g}-${e}`,className:no(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",x,u,{source:!b,target:b,connectable:i,connectablestart:r,connectableend:s,clickconnecting:A,connectingfrom:S,connectingto:O,valid:R,connectionindicator:i&&(!j||E)&&(j||T?s:r)}]),onMouseDown:N,onTouchStart:N,onClick:w?P:void 0,ref:m,...h,children:c})}const Dc=p.memo(iBe(jHt));function NHt({data:e,isConnectable:t,sourcePosition:n=vn.Bottom}){return a.jsxs(a.Fragment,{children:[e==null?void 0:e.label,a.jsx(Dc,{type:"source",position:n,isConnectable:t})]})}function RHt({data:e,isConnectable:t,targetPosition:n=vn.Top,sourcePosition:i=vn.Bottom}){return a.jsxs(a.Fragment,{children:[a.jsx(Dc,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,a.jsx(Dc,{type:"source",position:i,isConnectable:t})]})}function IHt(){return null}function PHt({data:e,isConnectable:t,targetPosition:n=vn.Top}){return a.jsxs(a.Fragment,{children:[a.jsx(Dc,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const TP={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},coe={input:NHt,default:RHt,output:PHt,group:IHt};function DHt(e){var t,n,i,r;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??((i=e.style)==null?void 0:i.width),height:e.height??((r=e.style)==null?void 0:r.height)}}const MHt=e=>{const{width:t,height:n,x:i,y:r}=WT(e.nodeLookup,{filter:s=>!!s.selected});return{width:lf(t)?t:null,height:lf(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${i}px,${r}px)`}};function LHt({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=Vs(),{width:r,height:s,transformString:o,userSelectionActive:l}=or(MHt,zs),c=aBe(),u=p.useRef(null);p.useEffect(()=>{var m;n||(m=u.current)==null||m.focus({preventScroll:!0})},[n]);const d=!l&&r!==null&&s!==null;if(sBe({nodeRef:u,disabled:!d}),!d)return null;const f=e?m=>{const g=i.getState().nodes.filter(b=>b.selected);e(m,g)}:void 0,h=m=>{Object.prototype.hasOwnProperty.call(TP,m.key)&&(m.preventDefault(),c({direction:TP[m.key],factor:m.shiftKey?4:1}))};return a.jsx("div",{className:no(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:a.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:r,height:s}})})}const uoe=typeof window<"u"?window:void 0,$Ht=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function lBe({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:o,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:d,selectionMode:f,onSelectionStart:h,onSelectionEnd:m,multiSelectionKeyCode:g,panActivationKeyCode:b,zoomActivationKeyCode:v,elementsSelectable:y,zoomOnScroll:w,zoomOnPinch:x,panOnScroll:k,panOnScrollSpeed:S,panOnScrollMode:O,zoomOnDoubleClick:A,panOnDrag:E,autoPanOnSelection:j,defaultViewport:T,translateExtent:R,minZoom:C,maxZoom:N,preventScrolling:P,onSelectionContextMenu:I,noWheelClassName:D,noPanClassName:_,disableKeyboardA11y:L,onViewportChange:F,isControlledViewport:M}){const{nodesSelectionActive:H,userSelectionActive:q}=or($Ht,zs),U=pA(u,{target:uoe}),Z=pA(b,{target:uoe}),z=Z||E,J=Z||k,ne=d&&z!==!0,W=U||q||ne;return yHt({deleteKeyCode:c,multiSelectionKeyCode:g}),a.jsx(wHt,{onPaneContextMenu:s,elementsSelectable:y,zoomOnScroll:w,zoomOnPinch:x,panOnScroll:J,panOnScrollSpeed:S,panOnScrollMode:O,zoomOnDoubleClick:A,panOnDrag:!U&&z,defaultViewport:T,translateExtent:R,minZoom:C,maxZoom:N,zoomActivationKeyCode:v,preventScrolling:P,noWheelClassName:D,noPanClassName:_,onViewportChange:F,isControlledViewport:M,paneClickDistance:l,selectionOnDrag:ne,children:a.jsxs(EHt,{onSelectionStart:h,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:o,panOnDrag:z,autoPanOnSelection:j,isSelecting:!!W,selectionMode:f,selectionKeyPressed:U,paneClickDistance:l,selectionOnDrag:ne,children:[e,H&&a.jsx(LHt,{onSelectionContextMenu:I,noPanClassName:_,disableKeyboardA11y:L})]})})}lBe.displayName="FlowRenderer";const FHt=p.memo(lBe),BHt=e=>t=>e?JW(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 UHt(e){return or(p.useCallback(BHt(e),[e]),zs)}const QHt=e=>e.updateNodeInternals;function zHt(){const e=or(QHt),[t]=p.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const i=new Map;n.forEach(r=>{const s=r.target.getAttribute("data-id");i.set(s,{id:s,nodeElement:r.target,force:!0})}),e(i)}));return p.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function VHt({node:e,nodeType:t,hasDimensions:n,resizeObserver:i}){const r=Vs(),s=p.useRef(null),o=p.useRef(null),l=p.useRef(e.sourcePosition),c=p.useRef(e.targetPosition),u=p.useRef(t),d=n&&!!e.internals.handleBounds;return p.useEffect(()=>{s.current&&!e.hidden&&(!d||o.current!==s.current)&&(o.current&&(i==null||i.unobserve(o.current)),i==null||i.observe(s.current),o.current=s.current)},[d,e.hidden]),p.useEffect(()=>()=>{o.current&&(i==null||i.unobserve(o.current),o.current=null)},[]),p.useEffect(()=>{if(s.current){const f=u.current!==t,h=l.current!==e.sourcePosition,m=c.current!==e.targetPosition;(f||h||m)&&(u.current=t,l.current=e.sourcePosition,c.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:s.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),s}function HHt({id:e,onClick:t,onMouseEnter:n,onMouseMove:i,onMouseLeave:r,onContextMenu:s,onDoubleClick:o,nodesDraggable:l,elementsSelectable:c,nodesConnectable:u,nodesFocusable:d,resizeObserver:f,noDragClassName:h,noPanClassName:m,disableKeyboardA11y:g,rfId:b,nodeTypes:v,nodeClickDistance:y,onError:w}){const{node:x,internals:k,isParent:S}=or(W=>{const X=W.nodeLookup.get(e),ce=W.parentLookup.has(e);return{node:X,internals:X.internals,isParent:ce}},zs);let O=x.type||"default",A=(v==null?void 0:v[O])||coe[O];A===void 0&&(w==null||w("003",wf.error003(O)),O="default",A=(v==null?void 0:v.default)||coe.default);const E=!!(x.draggable||l&&typeof x.draggable>"u"),j=!!(x.selectable||c&&typeof x.selectable>"u"),T=!!(x.connectable||u&&typeof x.connectable>"u"),R=!!(x.focusable||d&&typeof x.focusable>"u"),C=Vs(),N=nK(x),P=VHt({node:x,nodeType:O,hasDimensions:N,resizeObserver:f}),I=sBe({nodeRef:P,disabled:x.hidden||!E,noDragClassName:h,handleSelector:x.dragHandle,nodeId:e,isSelectable:j,nodeClickDistance:y}),D=aBe();if(x.hidden)return null;const _=km(x),L=DHt(x),F=j||E||t||n||i||r,M=n?W=>n(W,{...k.userNode}):void 0,H=i?W=>i(W,{...k.userNode}):void 0,q=r?W=>r(W,{...k.userNode}):void 0,U=s?W=>s(W,{...k.userNode}):void 0,Z=o?W=>o(W,{...k.userNode}):void 0,z=W=>{const{selectNodesOnDrag:X,nodeDragThreshold:ce}=C.getState();j&&(!X||!E||ce>0)&&F7({id:e,store:C,nodeRef:P}),t&&t(W,{...k.userNode})},J=W=>{if(!(R8e(W.nativeEvent)||g)){if(w8e.includes(W.key)&&j){const X=W.key==="Escape";F7({id:e,store:C,unselect:X,nodeRef:P})}else if(E&&x.selected&&Object.prototype.hasOwnProperty.call(TP,W.key)){W.preventDefault();const{ariaLabelConfig:X}=C.getState();C.setState({ariaLiveMessage:X["node.a11yDescription.ariaLiveMessage"]({direction:W.key.replace("Arrow","").toLowerCase(),x:~~k.positionAbsolute.x,y:~~k.positionAbsolute.y})}),D({direction:TP[W.key],factor:W.shiftKey?4:1})}}},ne=()=>{var de;if(g||!((de=P.current)!=null&&de.matches(":focus-visible")))return;const{transform:W,width:X,height:ce,autoPanOnNodeFocus:V,setCenter:Y}=C.getState();if(!V)return;JW(new Map([[e,x]]),{x:0,y:0,width:X,height:ce},W,!0).length>0||Y(x.position.x+_.width/2,x.position.y+_.height/2,{zoom:W[2]})};return a.jsx("div",{className:no(["react-flow__node",`react-flow__node-${O}`,{[m]:E},x.className,{selected:x.selected,selectable:j,parent:S,draggable:E,dragging:I}]),ref:P,style:{zIndex:k.z,transform:`translate(${k.positionAbsolute.x}px,${k.positionAbsolute.y}px)`,pointerEvents:F?"all":"none",visibility:N?"visible":"hidden",...x.style,...L},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:M,onMouseMove:H,onMouseLeave:q,onContextMenu:U,onClick:z,onDoubleClick:Z,onKeyDown:R?J:void 0,tabIndex:R?0:void 0,onFocus:R?ne:void 0,role:x.ariaRole??(R?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${Y8e}-${b}`,"aria-label":x.ariaLabel,...x.domAttributes,children:a.jsx(AHt,{value:e,children:a.jsx(A,{id:e,data:x.data,type:O,positionAbsoluteX:k.positionAbsolute.x,positionAbsoluteY:k.positionAbsolute.y,selected:x.selected??!1,selectable:j,draggable:E,deletable:x.deletable??!0,isConnectable:T,sourcePosition:x.sourcePosition,targetPosition:x.targetPosition,dragging:I,dragHandle:x.dragHandle,zIndex:k.z,parentId:x.parentId,..._})})})}var qHt=p.memo(HHt);const WHt=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function cBe(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,onError:s}=or(WHt,zs),o=UHt(e.onlyRenderVisibleElements),l=zHt();return a.jsx("div",{className:"react-flow__nodes",style:CL,children:o.map(c=>a.jsx(qHt,{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:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:s},c))})}cBe.displayName="NodeRenderer";const KHt=p.memo(cBe);function GHt(e){return or(p.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const i=[];if(n.width&&n.height)for(const r of n.edges){const s=n.nodeLookup.get(r.source),o=n.nodeLookup.get(r.target);s&&o&&Zzt({sourceNode:s,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&i.push(r.id)}return i},[e]),zs)}const XHt=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return a.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},YHt=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return a.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},doe={[dA.Arrow]:XHt,[dA.ArrowClosed]:YHt};function ZHt(e){const t=Vs();return p.useMemo(()=>{var r,s;return Object.prototype.hasOwnProperty.call(doe,e)?doe[e]:((s=(r=t.getState()).onError)==null||s.call(r,"009",wf.error009(e)),null)},[e])}const JHt=({id:e,type:t,color:n,width:i=12.5,height:r=12.5,markerUnits:s="strokeWidth",strokeWidth:o,orient:l="auto-start-reverse"})=>{const c=ZHt(t);return c?a.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:l,refX:"0",refY:"0",children:a.jsx(c,{color:n,strokeWidth:o})}):null},uBe=({defaultColor:e,rfId:t})=>{const n=or(s=>s.edges),i=or(s=>s.defaultEdgeOptions),r=p.useMemo(()=>aVt(n,{id:t,defaultColor:e,defaultMarkerStart:i==null?void 0:i.markerStart,defaultMarkerEnd:i==null?void 0:i.markerEnd}),[n,i,t,e]);return r.length?a.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:a.jsx("defs",{children:r.map(s=>a.jsx(JHt,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null};uBe.displayName="MarkerDefinitions";var eqt=p.memo(uBe);function dBe({x:e,y:t,label:n,labelStyle:i,labelShowBg:r=!0,labelBgStyle:s,labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...d}){const[f,h]=p.useState({x:1,y:0,width:0,height:0}),m=no(["react-flow__edge-textwrapper",u]),g=p.useRef(null);return p.useEffect(()=>{if(g.current){const b=g.current.getBBox();h({x:b.x,y:b.y,width:b.width,height:b.height})}},[n]),n?a.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:m,visibility:f.width?"visible":"hidden",...d,children:[r&&a.jsx("rect",{width:f.width+2*o[0],x:-o[0],y:-o[1],height:f.height+2*o[1],className:"react-flow__edge-textbg",style:s,rx:l,ry:l}),a.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:g,style:i,children:n}),c]}):null}dBe.displayName="EdgeText";const tqt=p.memo(dBe);function GT({path:e,labelX:t,labelY:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:u=20,...d}){return a.jsxs(a.Fragment,{children:[a.jsx("path",{...d,d:e,fill:"none",className:no(["react-flow__edge-path",d.className])}),u?a.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,i&&lf(t)&&lf(n)?a.jsx(tqt,{x:t,y:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function foe({pos:e,x1:t,y1:n,x2:i,y2:r}){return e===vn.Left||e===vn.Right?[.5*(t+i),n]:[t,.5*(n+r)]}function fBe({sourceX:e,sourceY:t,sourcePosition:n=vn.Bottom,targetX:i,targetY:r,targetPosition:s=vn.Top}){const[o,l]=foe({pos:n,x1:e,y1:t,x2:i,y2:r}),[c,u]=foe({pos:s,x1:i,y1:r,x2:e,y2:t}),[d,f,h,m]=P8e({sourceX:e,sourceY:t,targetX:i,targetY:r,sourceControlX:o,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${o},${l} ${c},${u} ${i},${r}`,d,f,h,m]}function hBe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:o,targetPosition:l,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,interactionWidth:y})=>{const[w,x,k]=fBe({sourceX:n,sourceY:i,sourcePosition:o,targetX:r,targetY:s,targetPosition:l}),S=e.isInternal?void 0:t;return a.jsx(GT,{id:S,path:w,labelX:x,labelY:k,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,interactionWidth:y})})}const nqt=hBe({isInternal:!1}),pBe=hBe({isInternal:!0});nqt.displayName="SimpleBezierEdge";pBe.displayName="SimpleBezierEdgeInternal";function mBe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:m=vn.Bottom,targetPosition:g=vn.Top,markerEnd:b,markerStart:v,pathOptions:y,interactionWidth:w})=>{const[x,k,S]=AP({sourceX:n,sourceY:i,sourcePosition:m,targetX:r,targetY:s,targetPosition:g,borderRadius:y==null?void 0:y.borderRadius,offset:y==null?void 0:y.offset,stepPosition:y==null?void 0:y.stepPosition}),O=e.isInternal?void 0:t;return a.jsx(GT,{id:O,path:x,labelX:k,labelY:S,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:b,markerStart:v,interactionWidth:w})})}const gBe=mBe({isInternal:!1}),bBe=mBe({isInternal:!0});gBe.displayName="SmoothStepEdge";bBe.displayName="SmoothStepEdgeInternal";function yBe(e){return p.memo(({id:t,...n})=>{var r;const i=e.isInternal?void 0:t;return a.jsx(gBe,{...n,id:i,pathOptions:p.useMemo(()=>{var s;return{borderRadius:0,offset:(s=n.pathOptions)==null?void 0:s.offset}},[(r=n.pathOptions)==null?void 0:r.offset])})})}const iqt=yBe({isInternal:!1}),vBe=yBe({isInternal:!0});iqt.displayName="StepEdge";vBe.displayName="StepEdgeInternal";function xBe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:g,interactionWidth:b})=>{const[v,y,w]=L8e({sourceX:n,sourceY:i,targetX:r,targetY:s}),x=e.isInternal?void 0:t;return a.jsx(GT,{id:x,path:v,labelX:y,labelY:w,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:g,interactionWidth:b})})}const rqt=xBe({isInternal:!1}),wBe=xBe({isInternal:!0});rqt.displayName="StraightEdge";wBe.displayName="StraightEdgeInternal";function kBe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:o=vn.Bottom,targetPosition:l=vn.Top,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,pathOptions:y,interactionWidth:w})=>{const[x,k,S]=D8e({sourceX:n,sourceY:i,sourcePosition:o,targetX:r,targetY:s,targetPosition:l,curvature:y==null?void 0:y.curvature}),O=e.isInternal?void 0:t;return a.jsx(GT,{id:O,path:x,labelX:k,labelY:S,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,interactionWidth:w})})}const sqt=kBe({isInternal:!1}),OBe=kBe({isInternal:!0});sqt.displayName="BezierEdge";OBe.displayName="BezierEdgeInternal";const hoe={default:OBe,straight:wBe,step:vBe,smoothstep:bBe,simplebezier:pBe},poe={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},aqt=(e,t,n)=>n===vn.Left?e-t:n===vn.Right?e+t:e,oqt=(e,t,n)=>n===vn.Top?e-t:n===vn.Bottom?e+t:e,moe="react-flow__edgeupdater";function goe({position:e,centerX:t,centerY:n,radius:i=10,onMouseDown:r,onMouseEnter:s,onMouseOut:o,type:l}){return a.jsx("circle",{onMouseDown:r,onMouseEnter:s,onMouseOut:o,className:no([moe,`${moe}-${l}`]),cx:aqt(t,i,e),cy:oqt(n,i,e),r:i,stroke:"transparent",fill:"transparent"})}function lqt({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:i,sourceY:r,targetX:s,targetY:o,sourcePosition:l,targetPosition:c,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:m}){const g=Vs(),b=(k,S)=>{if(k.button!==0)return;const{autoPanOnConnect:O,domNode:A,connectionMode:E,connectionRadius:j,lib:T,onConnectStart:R,cancelConnection:C,nodeLookup:N,rfId:P,panBy:I,updateConnection:D}=g.getState(),_=S.type==="target",L=(H,q)=>{h(!1),f==null||f(H,n,S.type,q)},F=H=>u==null?void 0:u(n,H),M=(H,q)=>{h(!0),d==null||d(k,n,S.type),R==null||R(H,q)};$7.onPointerDown(k.nativeEvent,{autoPanOnConnect:O,connectionMode:E,connectionRadius:j,domNode:A,handleId:S.id,nodeId:S.nodeId,nodeLookup:N,isTarget:_,edgeUpdaterType:S.type,lib:T,flowId:P,cancelConnection:C,panBy:I,isValidConnection:(...H)=>{var q,U;return((U=(q=g.getState()).isValidConnection)==null?void 0:U.call(q,...H))??!0},onConnect:F,onConnectStart:M,onConnectEnd:(...H)=>{var q,U;return(U=(q=g.getState()).onConnectEnd)==null?void 0:U.call(q,...H)},onReconnectEnd:L,updateConnection:D,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold,handleDomNode:k.currentTarget})},v=k=>b(k,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),y=k=>b(k,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),w=()=>m(!0),x=()=>m(!1);return a.jsxs(a.Fragment,{children:[(e===!0||e==="source")&&a.jsx(goe,{position:l,centerX:i,centerY:r,radius:t,onMouseDown:v,onMouseEnter:w,onMouseOut:x,type:"source"}),(e===!0||e==="target")&&a.jsx(goe,{position:c,centerX:s,centerY:o,radius:t,onMouseDown:y,onMouseEnter:w,onMouseOut:x,type:"target"})]})}function cqt({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:i,onClick:r,onDoubleClick:s,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:m,rfId:g,edgeTypes:b,noPanClassName:v,onError:y,disableKeyboardA11y:w}){let x=or(Y=>Y.edgeLookup.get(e));const k=or(Y=>Y.defaultEdgeOptions);x=k?{...k,...x}:x;let S=x.type||"default",O=(b==null?void 0:b[S])||hoe[S];O===void 0&&(y==null||y("011",wf.error011(S)),S="default",O=(b==null?void 0:b.default)||hoe.default);const A=!!(x.focusable||t&&typeof x.focusable>"u"),E=typeof f<"u"&&(x.reconnectable||n&&typeof x.reconnectable>"u"),j=!!(x.selectable||i&&typeof x.selectable>"u"),T=p.useRef(null),[R,C]=p.useState(!1),[N,P]=p.useState(!1),I=Vs(),{zIndex:D,sourceX:_,sourceY:L,targetX:F,targetY:M,sourcePosition:H,targetPosition:q}=or(p.useCallback(Y=>{const K=Y.nodeLookup.get(x.source),de=Y.nodeLookup.get(x.target);if(!K||!de)return{zIndex:x.zIndex,...poe};const ee=sVt({id:e,sourceNode:K,targetNode:de,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:Y.connectionMode,onError:y});return{zIndex:Yzt({selected:x.selected,zIndex:x.zIndex,sourceNode:K,targetNode:de,elevateOnSelect:Y.elevateEdgesOnSelect,zIndexMode:Y.zIndexMode}),...ee||poe}},[x.source,x.target,x.sourceHandle,x.targetHandle,x.selected,x.zIndex]),zs),U=p.useMemo(()=>x.markerStart?`url('#${M7(x.markerStart,g)}')`:void 0,[x.markerStart,g]),Z=p.useMemo(()=>x.markerEnd?`url('#${M7(x.markerEnd,g)}')`:void 0,[x.markerEnd,g]);if(x.hidden||_===null||L===null||F===null||M===null)return null;const z=Y=>{var Oe;const{addSelectedEdges:K,unselectNodesAndEdges:de,multiSelectionActive:ee}=I.getState();j&&(I.setState({nodesSelectionActive:!1}),x.selected&&ee?(de({nodes:[],edges:[x]}),(Oe=T.current)==null||Oe.blur()):K([e])),r&&r(Y,x)},J=s?Y=>{s(Y,{...x})}:void 0,ne=o?Y=>{o(Y,{...x})}:void 0,W=l?Y=>{l(Y,{...x})}:void 0,X=c?Y=>{c(Y,{...x})}:void 0,ce=u?Y=>{u(Y,{...x})}:void 0,V=Y=>{var K;if(!w&&w8e.includes(Y.key)&&j){const{unselectNodesAndEdges:de,addSelectedEdges:ee}=I.getState();Y.key==="Escape"?((K=T.current)==null||K.blur(),de({edges:[x]})):ee([e])}};return a.jsx("svg",{style:{zIndex:D},children:a.jsxs("g",{className:no(["react-flow__edge",`react-flow__edge-${S}`,x.className,v,{selected:x.selected,animated:x.animated,inactive:!j&&!r,updating:R,selectable:j}]),onClick:z,onDoubleClick:J,onContextMenu:ne,onMouseEnter:W,onMouseMove:X,onMouseLeave:ce,onKeyDown:A?V:void 0,tabIndex:A?0:void 0,role:x.ariaRole??(A?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":x.ariaLabel===null?void 0:x.ariaLabel||`Edge from ${x.source} to ${x.target}`,"aria-describedby":A?`${Z8e}-${g}`:void 0,ref:T,...x.domAttributes,children:[!N&&a.jsx(O,{id:e,source:x.source,target:x.target,type:x.type,selected:x.selected,animated:x.animated,selectable:j,deletable:x.deletable??!0,label:x.label,labelStyle:x.labelStyle,labelShowBg:x.labelShowBg,labelBgStyle:x.labelBgStyle,labelBgPadding:x.labelBgPadding,labelBgBorderRadius:x.labelBgBorderRadius,sourceX:_,sourceY:L,targetX:F,targetY:M,sourcePosition:H,targetPosition:q,data:x.data,style:x.style,sourceHandleId:x.sourceHandle,targetHandleId:x.targetHandle,markerStart:U,markerEnd:Z,pathOptions:"pathOptions"in x?x.pathOptions:void 0,interactionWidth:x.interactionWidth}),E&&a.jsx(lqt,{edge:x,isReconnectable:E,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:m,sourceX:_,sourceY:L,targetX:F,targetY:M,sourcePosition:H,targetPosition:q,setUpdateHover:C,setReconnecting:P})]})})}var uqt=p.memo(cqt);const dqt=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function SBe({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:i,noPanClassName:r,onReconnect:s,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:h,onReconnectStart:m,onReconnectEnd:g,disableKeyboardA11y:b}){const{edgesFocusable:v,edgesReconnectable:y,elementsSelectable:w,onError:x}=or(dqt,zs),k=GHt(t);return a.jsxs("div",{className:"react-flow__edges",children:[a.jsx(eqt,{defaultColor:e,rfId:n}),k.map(S=>a.jsx(uqt,{id:S,edgesFocusable:v,edgesReconnectable:y,elementsSelectable:w,noPanClassName:r,onReconnect:s,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:m,onReconnectEnd:g,rfId:n,onError:x,edgeTypes:i,disableKeyboardA11y:b},S))]})}SBe.displayName="EdgeRenderer";const fqt=p.memo(SBe),hqt=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function pqt({children:e}){const t=or(hqt);return a.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function mqt(e){const t=EL(),n=p.useRef(!1);p.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const gqt=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function bqt(e){const t=or(gqt),n=Vs();return p.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function yqt(e){return e.connection.inProgress?{...e.connection,to:Ok(e.connection.to,e.transform)}:{...e.connection}}function vqt(e){return yqt}function xqt(e){const t=vqt();return or(t,zs)}const wqt=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function kqt({containerStyle:e,style:t,type:n,component:i}){const{nodesConnectable:r,width:s,height:o,isValid:l,inProgress:c}=or(wqt,zs);return!(s&&r&&c)?null:a.jsx("svg",{style:e,width:s,height:o,className:"react-flow__connectionline react-flow__container",children:a.jsx("g",{className:no(["react-flow__connection",S8e(l)]),children:a.jsx(EBe,{style:t,type:n,CustomComponent:i,isValid:l})})})}const EBe=({style:e,type:t=og.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:r,from:s,fromNode:o,fromHandle:l,fromPosition:c,to:u,toNode:d,toHandle:f,toPosition:h,pointer:m}=xqt();if(!r)return;if(n)return a.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:l,fromX:s.x,fromY:s.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:h,connectionStatus:S8e(i),toNode:d,toHandle:f,pointer:m});let g="";const b={sourceX:s.x,sourceY:s.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case og.Bezier:[g]=D8e(b);break;case og.SimpleBezier:[g]=fBe(b);break;case og.Step:[g]=AP({...b,borderRadius:0});break;case og.SmoothStep:[g]=AP(b);break;default:[g]=L8e(b)}return a.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:e})};EBe.displayName="ConnectionLine";const Oqt={};function boe(e=Oqt){p.useRef(e),Vs(),p.useEffect(()=>{},[e])}function Sqt(){Vs(),p.useRef(!1),p.useEffect(()=>{},[])}function CBe({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:i,onEdgeClick:r,onNodeDoubleClick:s,onEdgeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:h,onSelectionEnd:m,connectionLineType:g,connectionLineStyle:b,connectionLineComponent:v,connectionLineContainerStyle:y,selectionKeyCode:w,selectionOnDrag:x,selectionMode:k,multiSelectionKeyCode:S,panActivationKeyCode:O,zoomActivationKeyCode:A,deleteKeyCode:E,onlyRenderVisibleElements:j,elementsSelectable:T,defaultViewport:R,translateExtent:C,minZoom:N,maxZoom:P,preventScrolling:I,defaultMarkerColor:D,zoomOnScroll:_,zoomOnPinch:L,panOnScroll:F,panOnScrollSpeed:M,panOnScrollMode:H,zoomOnDoubleClick:q,panOnDrag:U,autoPanOnSelection:Z,onPaneClick:z,onPaneMouseEnter:J,onPaneMouseMove:ne,onPaneMouseLeave:W,onPaneScroll:X,onPaneContextMenu:ce,paneClickDistance:V,nodeClickDistance:Y,onEdgeContextMenu:K,onEdgeMouseEnter:de,onEdgeMouseMove:ee,onEdgeMouseLeave:Oe,reconnectRadius:he,onReconnect:ge,onReconnectStart:Se,onReconnectEnd:xe,noDragClassName:Pe,noWheelClassName:Ue,noPanClassName:Ke,disableKeyboardA11y:Me,nodeExtent:re,rfId:ue,viewport:be,onViewportChange:Ce}){return boe(e),boe(t),Sqt(),mqt(n),bqt(be),a.jsx(FHt,{onPaneClick:z,onPaneMouseEnter:J,onPaneMouseMove:ne,onPaneMouseLeave:W,onPaneContextMenu:ce,onPaneScroll:X,paneClickDistance:V,deleteKeyCode:E,selectionKeyCode:w,selectionOnDrag:x,selectionMode:k,onSelectionStart:h,onSelectionEnd:m,multiSelectionKeyCode:S,panActivationKeyCode:O,zoomActivationKeyCode:A,elementsSelectable:T,zoomOnScroll:_,zoomOnPinch:L,zoomOnDoubleClick:q,panOnScroll:F,panOnScrollSpeed:M,panOnScrollMode:H,panOnDrag:U,autoPanOnSelection:Z,defaultViewport:R,translateExtent:C,minZoom:N,maxZoom:P,onSelectionContextMenu:f,preventScrolling:I,noDragClassName:Pe,noWheelClassName:Ue,noPanClassName:Ke,disableKeyboardA11y:Me,onViewportChange:Ce,isControlledViewport:!!be,children:a.jsxs(pqt,{children:[a.jsx(fqt,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:o,onReconnect:ge,onReconnectStart:Se,onReconnectEnd:xe,onlyRenderVisibleElements:j,onEdgeContextMenu:K,onEdgeMouseEnter:de,onEdgeMouseMove:ee,onEdgeMouseLeave:Oe,reconnectRadius:he,defaultMarkerColor:D,noPanClassName:Ke,disableKeyboardA11y:Me,rfId:ue}),a.jsx(kqt,{style:b,type:g,component:v,containerStyle:y}),a.jsx("div",{className:"react-flow__edgelabel-renderer"}),a.jsx(KHt,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:Y,onlyRenderVisibleElements:j,noPanClassName:Ke,noDragClassName:Pe,disableKeyboardA11y:Me,nodeExtent:re,rfId:ue}),a.jsx("div",{className:"react-flow__viewport-portal"})]})})}CBe.displayName="GraphView";const Eqt=p.memo(CBe),Cqt=_8e(),yoe=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:o,fitViewOptions:l,minZoom:c=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:f,zIndexMode:h="basic"}={})=>{const m=new Map,g=new Map,b=new Map,v=new Map,y=i??t??[],w=n??e??[],x=d??[0,0],k=f??cA;B8e(b,v,y);const{nodesInitialized:S}=L7(w,m,g,{nodeOrigin:x,nodeExtent:k,zIndexMode:h});let O=[0,0,1];if(o&&r&&s){const A=WT(m,{filter:R=>!!((R.width||R.initialWidth)&&(R.height||R.initialHeight))}),{x:E,y:j,zoom:T}=tK(A,r,s,c,u,(l==null?void 0:l.padding)??.1);O=[E,j,T]}return{rfId:"1",width:r??0,height:s??0,transform:O,nodes:w,nodesInitialized:S,nodeLookup:m,parentLookup:g,edges:y,edgeLookup:v,connectionLookup:b,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:cA,nodeExtent:k,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:E1.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:x,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:o??!1,fitViewOptions:l,fitViewResolver:null,connection:{...O8e},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Cqt,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:k8e,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Aqt=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h})=>QVt((m,g)=>{async function b(){const{nodeLookup:v,panZoom:y,fitViewOptions:w,fitViewResolver:x,width:k,height:S,minZoom:O,maxZoom:A}=g();y&&(await Vzt({nodes:v,width:k,height:S,panZoom:y,minZoom:O,maxZoom:A},w),x==null||x.resolve(!0),m({fitViewResolver:null}))}return{...yoe({nodes:e,edges:t,width:r,height:s,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,defaultNodes:n,defaultEdges:i,zIndexMode:h}),setNodes:v=>{const{nodeLookup:y,parentLookup:w,nodeOrigin:x,elevateNodesOnSelect:k,fitViewQueued:S,zIndexMode:O,nodesSelectionActive:A}=g(),{nodesInitialized:E,hasSelectedNodes:j}=L7(v,y,w,{nodeOrigin:x,nodeExtent:f,elevateNodesOnSelect:k,checkEquality:!0,zIndexMode:O}),T=A&&j;S&&E?(b(),m({nodes:v,nodesInitialized:E,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:T})):m({nodes:v,nodesInitialized:E,nodesSelectionActive:T})},setEdges:v=>{const{connectionLookup:y,edgeLookup:w}=g();B8e(y,w,v),m({edges:v})},setDefaultNodesAndEdges:(v,y)=>{if(v){const{setNodes:w}=g();w(v),m({hasDefaultNodes:!0})}if(y){const{setEdges:w}=g();w(y),m({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:y,nodeLookup:w,parentLookup:x,domNode:k,nodeOrigin:S,nodeExtent:O,debug:A,fitViewQueued:E,zIndexMode:j}=g(),{changes:T,updatedInternals:R}=hVt(v,w,x,k,S,O,j);R&&(cVt(w,x,{nodeOrigin:S,nodeExtent:O,zIndexMode:j}),E?(b(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(T==null?void 0:T.length)>0&&(A&&console.log("React Flow: trigger node changes",T),y==null||y(T)))},updateNodePositions:(v,y=!1)=>{const w=[];let x=[];const{nodeLookup:k,triggerNodeChanges:S,connection:O,updateConnection:A,onNodesChangeMiddlewareMap:E}=g();for(const[j,T]of v){const R=k.get(j),C=!!(R!=null&&R.expandParent&&(R!=null&&R.parentId)&&(T!=null&&T.position)),N={id:j,type:"position",position:C?{x:Math.max(0,T.position.x),y:Math.max(0,T.position.y)}:T.position,dragging:y};if(R&&O.inProgress&&O.fromNode.id===R.id){const P=Av(R,O.fromHandle,vn.Left,!0);A({...O,from:P})}C&&R.parentId&&w.push({id:j,parentId:R.parentId,rect:{...T.internals.positionAbsolute,width:T.measured.width??0,height:T.measured.height??0}}),x.push(N)}if(w.length>0){const{parentLookup:j,nodeOrigin:T}=g(),R=lK(w,k,j,T);x.push(...R)}for(const j of E.values())x=j(x);S(x)},triggerNodeChanges:v=>{const{onNodesChange:y,setNodes:w,nodes:x,hasDefaultNodes:k,debug:S}=g();if(v!=null&&v.length){if(k){const O=tBe(v,x);w(O)}S&&console.log("React Flow: trigger node changes",v),y==null||y(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:y,setEdges:w,edges:x,hasDefaultEdges:k,debug:S}=g();if(v!=null&&v.length){if(k){const O=nBe(v,x);w(O)}S&&console.log("React Flow: trigger edge changes",v),y==null||y(v)}},addSelectedNodes:v=>{const{multiSelectionActive:y,edgeLookup:w,nodeLookup:x,triggerNodeChanges:k,triggerEdgeChanges:S}=g();if(y){const O=v.map(A=>py(A,!0));k(O);return}k(Hx(x,new Set([...v]),!0)),S(Hx(w))},addSelectedEdges:v=>{const{multiSelectionActive:y,edgeLookup:w,nodeLookup:x,triggerNodeChanges:k,triggerEdgeChanges:S}=g();if(y){const O=v.map(A=>py(A,!0));S(O);return}S(Hx(w,new Set([...v]))),k(Hx(x,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:y}={})=>{const{edges:w,nodes:x,nodeLookup:k,triggerNodeChanges:S,triggerEdgeChanges:O}=g(),A=v||x,E=y||w,j=[];for(const R of A){if(!R.selected)continue;const C=k.get(R.id);C&&(C.selected=!1),j.push(py(R.id,!1))}const T=[];for(const R of E)R.selected&&T.push(py(R.id,!1));S(j),O(T)},setMinZoom:v=>{const{panZoom:y,maxZoom:w}=g();y==null||y.setScaleExtent([v,w]),m({minZoom:v})},setMaxZoom:v=>{const{panZoom:y,minZoom:w}=g();y==null||y.setScaleExtent([w,v]),m({maxZoom:v})},setTranslateExtent:v=>{var y;(y=g().panZoom)==null||y.setTranslateExtent(v),m({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:y,triggerNodeChanges:w,triggerEdgeChanges:x,elementsSelectable:k}=g();if(!k)return;const S=y.reduce((A,E)=>E.selected?[...A,py(E.id,!1)]:A,[]),O=v.reduce((A,E)=>E.selected?[...A,py(E.id,!1)]:A,[]);w(S),x(O)},setNodeExtent:v=>{const{nodes:y,nodeLookup:w,parentLookup:x,nodeOrigin:k,elevateNodesOnSelect:S,nodeExtent:O,zIndexMode:A}=g();v[0][0]===O[0][0]&&v[0][1]===O[0][1]&&v[1][0]===O[1][0]&&v[1][1]===O[1][1]||(L7(y,w,x,{nodeOrigin:k,nodeExtent:v,elevateNodesOnSelect:S,checkEquality:!1,zIndexMode:A}),m({nodeExtent:v}))},panBy:v=>{const{transform:y,width:w,height:x,panZoom:k,translateExtent:S}=g();return pVt({delta:v,panZoom:k,transform:y,translateExtent:S,width:w,height:x})},setCenter:async(v,y,w)=>{const{width:x,height:k,maxZoom:S,panZoom:O}=g();if(!O)return!1;const A=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:S;return await O.setViewport({x:x/2-v*A,y:k/2-y*A,zoom:A},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),!0},cancelConnection:()=>{m({connection:{...O8e}})},updateConnection:v=>{m({connection:v})},reset:()=>m({...yoe()})}},Object.is);function ABe({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:i,initialWidth:r,initialHeight:s,initialMinZoom:o,initialMaxZoom:l,initialFitViewOptions:c,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:m}){const[g]=p.useState(()=>Aqt({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:u,minZoom:o,maxZoom:l,fitViewOptions:c,nodeOrigin:d,nodeExtent:f,zIndexMode:h}));return a.jsx(zVt,{value:g,children:a.jsx(pHt,{children:m})})}function Tqt({children:e,nodes:t,edges:n,defaultNodes:i,defaultEdges:r,width:s,height:o,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:m}){return p.useContext(OL)?a.jsx(a.Fragment,{children:e}):a.jsx(ABe,{initialNodes:t,initialEdges:n,defaultNodes:i,defaultEdges:r,initialWidth:s,initialHeight:o,fitView:l,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:m,children:e})}const _qt={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function jqt({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,className:r,nodeTypes:s,edgeTypes:o,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:m,onConnectStart:g,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:y,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:k,onNodeContextMenu:S,onNodeDoubleClick:O,onNodeDragStart:A,onNodeDrag:E,onNodeDragStop:j,onNodesDelete:T,onEdgesDelete:R,onDelete:C,onSelectionChange:N,onSelectionDragStart:P,onSelectionDrag:I,onSelectionDragStop:D,onSelectionContextMenu:_,onSelectionStart:L,onSelectionEnd:F,onBeforeDelete:M,connectionMode:H,connectionLineType:q=og.Bezier,connectionLineStyle:U,connectionLineComponent:Z,connectionLineContainerStyle:z,deleteKeyCode:J="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:W=!1,selectionMode:X=uA.Full,panActivationKeyCode:ce="Space",multiSelectionKeyCode:V=hA()?"Meta":"Control",zoomActivationKeyCode:Y=hA()?"Meta":"Control",snapToGrid:K,snapGrid:de,onlyRenderVisibleElements:ee=!1,selectNodesOnDrag:Oe,nodesDraggable:he,autoPanOnNodeFocus:ge,nodesConnectable:Se,nodesFocusable:xe,nodeOrigin:Pe=J8e,edgesFocusable:Ue,edgesReconnectable:Ke,elementsSelectable:Me=!0,defaultViewport:re=nHt,minZoom:ue=.5,maxZoom:be=2,translateExtent:Ce=cA,preventScrolling:Ee=!0,nodeExtent:Ve,defaultMarkerColor:Ge="#b1b1b7",zoomOnScroll:ye=!0,zoomOnPinch:oe=!0,panOnScroll:ie=!1,panOnScrollSpeed:Ae=.5,panOnScrollMode:Re=Yy.Free,zoomOnDoubleClick:St=!0,panOnDrag:Nt=!0,onPaneClick:Dt,onPaneMouseEnter:Et,onPaneMouseMove:$t,onPaneMouseLeave:He,onPaneScroll:yt,onPaneContextMenu:je,paneClickDistance:kt=1,nodeClickDistance:_t=0,children:fn,onReconnect:tn,onReconnectStart:qe,onReconnectEnd:vt,onEdgeContextMenu:We,onEdgeDoubleClick:ot,onEdgeMouseEnter:it,onEdgeMouseMove:tt,onEdgeMouseLeave:At,reconnectRadius:Ot=10,onNodesChange:Ut,onEdgesChange:Mt,noDragClassName:Ze="nodrag",noWheelClassName:bt="nowheel",noPanClassName:gt="nopan",fitView:an,fitViewOptions:Bt,connectOnClick:cn,attributionPosition:Je,proOptions:lt,defaultEdgeOptions:hn,elevateNodesOnSelect:Sn=!0,elevateEdgesOnSelect:Ji=!1,disableKeyboardA11y:Qn=!1,autoPanOnConnect:_n,autoPanOnNodeDrag:pi,autoPanOnSelection:Nn=!0,autoPanSpeed:Dn,connectionRadius:_i,isValidConnection:Fn,onError:Kn,style:Rn,id:nt,nodeDragThreshold:Qt,connectionDragThreshold:Be,viewport:xt,onViewportChange:zt,width:jn,height:lr,colorMode:ta="light",debug:Ms,onScroll:ts,ariaLabelConfig:ci,zIndexMode:Ei="basic",...$r},na){const ns=nt||"1",Il=aHt(ta),fs=p.useCallback(me=>{me.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ts==null||ts(me)},[ts]);return a.jsx("div",{"data-testid":"rf__wrapper",...$r,onScroll:fs,style:{...Rn,..._qt},ref:na,className:no(["react-flow",r,Il]),id:nt,role:"application",children:a.jsxs(Tqt,{nodes:e,edges:t,width:jn,height:lr,fitView:an,fitViewOptions:Bt,minZoom:ue,maxZoom:be,nodeOrigin:Pe,nodeExtent:Ve,zIndexMode:Ei,children:[a.jsx(sHt,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:m,onConnectStart:g,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:y,nodesDraggable:he,autoPanOnNodeFocus:ge,nodesConnectable:Se,nodesFocusable:xe,edgesFocusable:Ue,edgesReconnectable:Ke,elementsSelectable:Me,elevateNodesOnSelect:Sn,elevateEdgesOnSelect:Ji,minZoom:ue,maxZoom:be,nodeExtent:Ve,onNodesChange:Ut,onEdgesChange:Mt,snapToGrid:K,snapGrid:de,connectionMode:H,translateExtent:Ce,connectOnClick:cn,defaultEdgeOptions:hn,fitView:an,fitViewOptions:Bt,onNodesDelete:T,onEdgesDelete:R,onDelete:C,onNodeDragStart:A,onNodeDrag:E,onNodeDragStop:j,onSelectionDrag:I,onSelectionDragStart:P,onSelectionDragStop:D,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:gt,nodeOrigin:Pe,rfId:ns,autoPanOnConnect:_n,autoPanOnNodeDrag:pi,autoPanSpeed:Dn,onError:Kn,connectionRadius:_i,isValidConnection:Fn,selectNodesOnDrag:Oe,nodeDragThreshold:Qt,connectionDragThreshold:Be,onBeforeDelete:M,debug:Ms,ariaLabelConfig:ci,zIndexMode:Ei}),a.jsx(Eqt,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:k,onNodeContextMenu:S,onNodeDoubleClick:O,nodeTypes:s,edgeTypes:o,connectionLineType:q,connectionLineStyle:U,connectionLineComponent:Z,connectionLineContainerStyle:z,selectionKeyCode:ne,selectionOnDrag:W,selectionMode:X,deleteKeyCode:J,multiSelectionKeyCode:V,panActivationKeyCode:ce,zoomActivationKeyCode:Y,onlyRenderVisibleElements:ee,defaultViewport:re,translateExtent:Ce,minZoom:ue,maxZoom:be,preventScrolling:Ee,zoomOnScroll:ye,zoomOnPinch:oe,zoomOnDoubleClick:St,panOnScroll:ie,panOnScrollSpeed:Ae,panOnScrollMode:Re,panOnDrag:Nt,autoPanOnSelection:Nn,onPaneClick:Dt,onPaneMouseEnter:Et,onPaneMouseMove:$t,onPaneMouseLeave:He,onPaneScroll:yt,onPaneContextMenu:je,paneClickDistance:kt,nodeClickDistance:_t,onSelectionContextMenu:_,onSelectionStart:L,onSelectionEnd:F,onReconnect:tn,onReconnectStart:qe,onReconnectEnd:vt,onEdgeContextMenu:We,onEdgeDoubleClick:ot,onEdgeMouseEnter:it,onEdgeMouseMove:tt,onEdgeMouseLeave:At,reconnectRadius:Ot,defaultMarkerColor:Ge,noDragClassName:Ze,noWheelClassName:bt,noPanClassName:gt,rfId:ns,disableKeyboardA11y:Qn,nodeExtent:Ve,viewport:xt,onViewportChange:zt}),a.jsx(tHt,{onSelectionChange:N}),fn,a.jsx(XVt,{proOptions:lt,position:Je}),a.jsx(GVt,{rfId:ns,disableKeyboardA11y:Qn})]})})}var Nqt=iBe(jqt);const Rqt=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function Iqt({children:e}){const t=or(Rqt);return t?vi.createPortal(e,t):null}function Pqt(e){const[t,n]=p.useState(e),i=p.useCallback(r=>n(s=>tBe(r,s)),[]);return[t,n,i]}function Dqt(e){const[t,n]=p.useState(e),i=p.useCallback(r=>n(s=>nBe(r,s)),[]);return[t,n,i]}const Mqt=e=>t=>{if(!e.includeHiddenNodes)return t.nodesInitialized;if(t.nodeLookup.size===0)return!1;for(const[,{internals:n}]of t.nodeLookup)if(n.handleBounds===void 0||!nK(n.userNode))return!1;return!0};function Lqt(e={includeHiddenNodes:!1}){return or(Mqt(e))}function $qt({dimensions:e,lineWidth:t,variant:n,className:i}){return a.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:no(["react-flow__background-pattern",n,i])})}function Fqt({radius:e,className:t}){return a.jsx("circle",{cx:e,cy:e,r:e,className:no(["react-flow__background-pattern","dots",t])})}var $g;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})($g||($g={}));const Bqt={[$g.Dots]:1,[$g.Lines]:1,[$g.Cross]:6},Uqt=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function TBe({id:e,variant:t=$g.Dots,gap:n=20,size:i,lineWidth:r=1,offset:s=0,color:o,bgColor:l,style:c,className:u,patternClassName:d}){const f=p.useRef(null),{transform:h,patternId:m}=or(Uqt,zs),g=i||Bqt[t],b=t===$g.Dots,v=t===$g.Cross,y=Array.isArray(n)?n:[n,n],w=[y[0]*h[2]||1,y[1]*h[2]||1],x=g*h[2],k=Array.isArray(s)?s:[s,s],S=v?[x,x]:w,O=[k[0]*h[2]||1+S[0]/2,k[1]*h[2]||1+S[1]/2],A=`${m}${e||""}`;return a.jsxs("svg",{className:no(["react-flow__background",u]),style:{...c,...CL,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:f,"data-testid":"rf__background",children:[a.jsx("pattern",{id:A,x:h[0]%w[0],y:h[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${O[0]},-${O[1]})`,children:b?a.jsx(Fqt,{radius:x/2,className:d}):a.jsx($qt,{dimensions:S,lineWidth:r,variant:t,className:d})}),a.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${A})`})]})}TBe.displayName="Background";const Qqt=p.memo(TBe);function zqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:a.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Vqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:a.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Hqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:a.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 qqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:a.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 Wqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:a.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 vj({children:e,className:t,...n}){return a.jsx("button",{type:"button",className:no(["react-flow__controls-button",t]),...n,children:e})}const Kqt=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:i=!0,fitViewOptions:r,onZoomIn:s,onZoomOut:o,onFitView:l,onInteractiveChange:c,className:u,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":m}){const g=Vs(),{isInteractive:b,minZoomReached:v,maxZoomReached:y,ariaLabelConfig:w}=or(Kqt,zs),{zoomIn:x,zoomOut:k,fitView:S}=EL(),O=()=>{x(),s==null||s()},A=()=>{k(),o==null||o()},E=()=>{S(r),l==null||l()},j=()=>{g.setState({nodesDraggable:!b,nodesConnectable:!b,elementsSelectable:!b}),c==null||c(!b)},T=h==="horizontal"?"horizontal":"vertical";return a.jsxs(SL,{className:no(["react-flow__controls",T,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":m??w["controls.ariaLabel"],children:[t&&a.jsxs(a.Fragment,{children:[a.jsx(vj,{onClick:O,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:y,children:a.jsx(zqt,{})}),a.jsx(vj,{onClick:A,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:v,children:a.jsx(Vqt,{})})]}),n&&a.jsx(vj,{className:"react-flow__controls-fitview",onClick:E,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:a.jsx(Hqt,{})}),i&&a.jsx(vj,{className:"react-flow__controls-interactive",onClick:j,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:b?a.jsx(Wqt,{}):a.jsx(qqt,{})}),d]})}_Be.displayName="Controls";const Gqt=p.memo(_Be);function Xqt({id:e,x:t,y:n,width:i,height:r,style:s,color:o,strokeColor:l,strokeWidth:c,className:u,borderRadius:d,shapeRendering:f,selected:h,onClick:m}){const{background:g,backgroundColor:b}=s||{},v=o||g||b;return a.jsx("rect",{className:no(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:i,height:r,style:{fill:v,stroke:l,strokeWidth:c},shapeRendering:f,onClick:m?y=>m(y,e):void 0})}const Yqt=p.memo(Xqt),Zqt=e=>e.nodes.map(t=>t.id),t6=e=>e instanceof Function?e:()=>e;function Jqt({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:r,nodeComponent:s=Yqt,onClick:o}){const l=or(Zqt,zs),c=t6(t),u=t6(e),d=t6(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return a.jsx(a.Fragment,{children:l.map(h=>a.jsx(tWt,{id:h,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:i,nodeStrokeWidth:r,NodeComponent:s,onClick:o,shapeRendering:f},h))})}function eWt({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:i,nodeBorderRadius:r,nodeStrokeWidth:s,shapeRendering:o,NodeComponent:l,onClick:c}){const{node:u,x:d,y:f,width:h,height:m}=or(g=>{const b=g.nodeLookup.get(e);if(!b)return{node:void 0,x:0,y:0,width:0,height:0};const v=b.internals.userNode,{x:y,y:w}=b.internals.positionAbsolute,{width:x,height:k}=km(v);return{node:v,x:y,y:w,width:x,height:k}},zs);return!u||u.hidden||!nK(u)?null:a.jsx(l,{x:d,y:f,width:h,height:m,style:u.style,selected:!!u.selected,className:i(u),color:t(u),borderRadius:r,strokeColor:n(u),strokeWidth:s,shapeRendering:o,onClick:c,id:u.id})}const tWt=p.memo(eWt);var nWt=p.memo(Jqt);const iWt=200,rWt=150,sWt=e=>!e.hidden,aWt=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?T8e(WT(e.nodeLookup,{filter:sWt}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},oWt="react-flow__minimap-desc";function jBe({style:e,className:t,nodeStrokeColor:n,nodeColor:i,nodeClassName:r="",nodeBorderRadius:s=5,nodeStrokeWidth:o,nodeComponent:l,bgColor:c,maskColor:u,maskStrokeColor:d,maskStrokeWidth:f,position:h="bottom-right",onClick:m,onNodeClick:g,pannable:b=!1,zoomable:v=!1,ariaLabel:y,inversePan:w,zoomStep:x=1,offsetScale:k=5}){const S=Vs(),O=p.useRef(null),{boundingRect:A,viewBB:E,rfId:j,panZoom:T,translateExtent:R,flowWidth:C,flowHeight:N,ariaLabelConfig:P}=or(aWt,zs),I=(e==null?void 0:e.width)??iWt,D=(e==null?void 0:e.height)??rWt,_=A.width/I,L=A.height/D,F=Math.max(_,L),M=F*I,H=F*D,q=k*F,U=A.x-(M-A.width)/2-q,Z=A.y-(H-A.height)/2-q,z=M+q*2,J=H+q*2,ne=`${oWt}-${j}`,W=p.useRef(0),X=p.useRef();W.current=F,p.useEffect(()=>{if(O.current&&T)return X.current=OVt({domNode:O.current,panZoom:T,getTransform:()=>S.getState().transform,getViewScale:()=>W.current}),()=>{var K;(K=X.current)==null||K.destroy()}},[T]),p.useEffect(()=>{var K;(K=X.current)==null||K.update({translateExtent:R,width:C,height:N,inversePan:w,pannable:b,zoomStep:x,zoomable:v})},[b,v,w,x,R,C,N]);const ce=m?K=>{var Oe;const[de,ee]=((Oe=X.current)==null?void 0:Oe.pointer(K))||[0,0];m(K,{x:de,y:ee})}:void 0,V=g?p.useCallback((K,de)=>{const ee=S.getState().nodeLookup.get(de).internals.userNode;g(K,ee)},[]):void 0,Y=y??P["minimap.ariaLabel"];return a.jsx(SL,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*F:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o=="number"?o:void 0},className:no(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:a.jsxs("svg",{width:I,height:D,viewBox:`${U} ${Z} ${z} ${J}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ne,ref:O,onClick:ce,children:[Y&&a.jsx("title",{id:ne,children:Y}),a.jsx(nWt,{onClick:V,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:r,nodeStrokeWidth:o,nodeComponent:l}),a.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-q},${Z-q}h${z+q*2}v${J+q*2}h${-z-q*2}z + M${E.x},${E.y}h${E.width}v${E.height}h${-E.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}jBe.displayName="MiniMap";p.memo(jBe);const lWt=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,cWt={[_1.Line]:"right",[_1.Handle]:"bottom-right"};function uWt({nodeId:e,position:t,variant:n=_1.Handle,className:i,style:r=void 0,children:s,color:o,minWidth:l=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:h,autoScale:m=!0,shouldResize:g,onResizeStart:b,onResize:v,onResizeEnd:y}){const w=oBe(),x=typeof e=="string"?e:w,k=Vs(),S=p.useRef(null),O=n===_1.Handle,A=or(p.useCallback(lWt(O&&m),[O,m]),zs),E=p.useRef(null),j=t??cWt[n];p.useEffect(()=>{if(!(!S.current||!x))return E.current||(E.current=MVt({domNode:S.current,nodeId:x,getStoreItems:()=>{const{nodeLookup:R,transform:C,snapGrid:N,snapToGrid:P,nodeOrigin:I,domNode:D}=k.getState();return{nodeLookup:R,transform:C,snapGrid:N,snapToGrid:P,nodeOrigin:I,paneDomNode:D}},onChange:(R,C)=>{const{triggerNodeChanges:N,nodeLookup:P,parentLookup:I,nodeOrigin:D}=k.getState(),_=[],L={x:R.x,y:R.y},F=P.get(x);if(F&&F.expandParent&&F.parentId){const M=F.origin??D,H=R.width??F.measured.width??0,q=R.height??F.measured.height??0,U={id:F.id,parentId:F.parentId,rect:{width:H,height:q,...j8e({x:R.x??F.position.x,y:R.y??F.position.y},{width:H,height:q},F.parentId,P,M)}},Z=lK([U],P,I,D);_.push(...Z),L.x=R.x?Math.max(M[0]*H,R.x):void 0,L.y=R.y?Math.max(M[1]*q,R.y):void 0}if(L.x!==void 0&&L.y!==void 0){const M={id:x,type:"position",position:{...L}};_.push(M)}if(R.width!==void 0&&R.height!==void 0){const H={id:x,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:R.width,height:R.height}};_.push(H)}for(const M of C){const H={...M,type:"position"};_.push(H)}N(_)},onEnd:({width:R,height:C})=>{const N={id:x,type:"dimensions",resizing:!1,dimensions:{width:R,height:C}};k.getState().triggerNodeChanges([N])}})),E.current.update({controlPosition:j,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:b,onResize:v,onResizeEnd:y,shouldResize:g}),()=>{var R;(R=E.current)==null||R.destroy()}},[j,l,c,u,d,f,b,v,y,g]);const T=j.split("-");return a.jsx("div",{className:no(["react-flow__resize-control","nodrag",...T,n,i]),ref:S,style:{...r,scale:A,...o&&{[O?"backgroundColor":"borderColor"]:o}},children:s})}p.memo(uWt);var NBe=Object.defineProperty,dWt=(e,t,n)=>t in e?NBe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fWt=(e,t)=>{for(var n in t)NBe(e,n,{get:t[n],enumerable:!0})},hWt=(e,t,n)=>dWt(e,t+"",n),RBe={};fWt(RBe,{Graph:()=>Ld,alg:()=>uK,json:()=>PBe,version:()=>gWt});var pWt=Object.defineProperty,IBe=(e,t)=>{for(var n in t)pWt(e,n,{get:t[n],enumerable:!0})},Ld=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected="directed"in e?e.directed:!0,this._isMultigraph="multigraph"in e?e.multigraph:!1,this._isCompound="compound"in e?e.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return typeof e!="function"?this._defaultNodeLabelFn=()=>e:this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(n=>{t!==void 0?this.setNode(n,t):this.setNode(n)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(n=>{this.setParent(n)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(t===void 0)t="\0";else{t+="";for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!=="\0")return t}}children(e="\0"){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e==="\0")return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t);for(let i of this.successors(e))n.add(i);return Array.from(n.values())}}isLeaf(e){let t;return this.isDirected()?t=this.successors(e):t=this.neighbors(e),t.length===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([r,s])=>{e(r)&&t.setNode(r,s)}),Object.values(this._edgeObjs).forEach(r=>{t.hasNode(r.v)&&t.hasNode(r.w)&&t.setEdge(r,this.edge(r))});let n={},i=r=>{let s=this.parent(r);return!s||t.hasNode(s)?(n[r]=s??void 0,s??void 0):s in n?n[s]:i(s)};return this._isCompound&&t.nodes().forEach(r=>t.setParent(r,i(r))),t}setDefaultEdgeLabel(e){return typeof e!="function"?this._defaultEdgeLabelFn=()=>e:this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((n,i)=>(t!==void 0?this.setEdge(n,i,t):this.setEdge(n,i),i)),this}setEdge(e,t,n,i){let r,s,o,l,c=!1;typeof e=="object"&&e!==null&&"v"in e?(r=e.v,s=e.w,o=e.name,arguments.length===2&&(l=t,c=!0)):(r=e,s=t,o=i,arguments.length>2&&(l=n,c=!0)),r=""+r,s=""+s,o!==void 0&&(o=""+o);let u=CS(this._isDirected,r,s,o);if(u in this._edgeLabels)return c&&(this._edgeLabels[u]=l),this;if(o!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(r),this.setNode(s),this._edgeLabels[u]=c?l:this._defaultEdgeLabelFn(r,s,o);let d=mWt(this._isDirected,r,s,o);return r=d.v,s=d.w,Object.freeze(d),this._edgeObjs[u]=d,voe(this._preds[s],r),voe(this._sucs[r],s),this._in[s][u]=d,this._out[r][u]=d,this._edgeCount++,this}edge(e,t,n){let i=arguments.length===1?n6(this._isDirected,e):CS(this._isDirected,e,t,n);return this._edgeLabels[i]}edgeAsObj(e,t,n){let i=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof i!="object"?{label:i}:i}hasEdge(e,t,n){return(arguments.length===1?n6(this._isDirected,e):CS(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let i=arguments.length===1?n6(this._isDirected,e):CS(this._isDirected,e,t,n),r=this._edgeObjs[i];if(r){let s=r.v,o=r.w;delete this._edgeLabels[i],delete this._edgeObjs[i],xoe(this._preds[o],s),xoe(this._sucs[s],o),delete this._in[o][i],delete this._out[s][i],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let i=Object.values(e);return n?i.filter(r=>r.v===t&&r.w===n||r.v===n&&r.w===t):i}};function voe(e,t){e[t]?e[t]++:e[t]=1}function xoe(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function CS(e,t,n,i){let r=""+t,s=""+n;if(!e&&r>s){let o=r;r=s,s=o}return r+""+s+""+(i===void 0?"\0":i)}function mWt(e,t,n,i){let r=""+t,s=""+n;if(!e&&r>s){let l=r;r=s,s=l}let o={v:r,w:s};return i&&(o.name=i),o}function n6(e,t){return CS(e,t.v,t.w,t.name)}var gWt="4.0.1",PBe={};IBe(PBe,{read:()=>xWt,write:()=>bWt});function bWt(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:yWt(e),edges:vWt(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function yWt(e){return e.nodes().map(t=>{let n=e.node(t),i=e.parent(t),r={v:t};return n!==void 0&&(r.value=n),i!==void 0&&(r.parent=i),r})}function vWt(e){return e.edges().map(t=>{let n=e.edge(t),i={v:t.v,w:t.w};return t.name!==void 0&&(i.name=t.name),n!==void 0&&(i.value=n),i})}function xWt(e){let t=new Ld(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(n=>{t.setNode(n.v,n.value),n.parent&&t.setParent(n.v,n.parent)}),e.edges.forEach(n=>{t.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),t}var uK={};IBe(uK,{CycleException:()=>jP,bellmanFord:()=>DBe,components:()=>OWt,dijkstra:()=>_P,dijkstraAll:()=>CWt,findCycles:()=>AWt,floydWarshall:()=>_Wt,isAcyclic:()=>NWt,postorder:()=>IWt,preorder:()=>PWt,prim:()=>DWt,shortestPaths:()=>MWt,tarjan:()=>LBe,topsort:()=>$Be});var wWt=()=>1;function DBe(e,t,n,i){return kWt(e,String(t),n||wWt,i||function(r){return e.outEdges(r)})}function kWt(e,t,n,i){let r={},s,o=0,l=e.nodes(),c=function(f){let h=n(f);r[f.v].distance+he.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(e,t){let n=this._keyIndices,i=String(e);if(!(i in n)){let r=this._arr,s=r.length;return n[i]=s,r.push({key:i,priority:t}),this._decrease(s),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw new Error(`Key not found: ${e}`);let i=this._arr[n].priority;if(t>i)throw new Error(`New priority is greater than current priority. Key: ${e} Old: ${i} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,i=n+1,r=e;n>1,!(t[i].priority1;function _P(e,t,n,i){let r=function(s){return e.outEdges(s)};return EWt(e,String(t),n||SWt,i||r)}function EWt(e,t,n,i){let r={},s=new MBe,o,l,c=function(u){let d=u.v!==o?u.v:u.w,f=r[d],h=n(u),m=l.distance+h;if(h<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+u+" Weight: "+h);m0&&(o=s.removeMin(),l=r[o],l.distance!==Number.POSITIVE_INFINITY);)i(o).forEach(c);return r}function CWt(e,t,n){return e.nodes().reduce(function(i,r){return i[r]=_P(e,r,t,n),i},{})}function LBe(e){let t=0,n=[],i={},r=[];function s(o){let l=i[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),e.successors(o).forEach(function(c){c in i?i[c].onStack&&(l.lowlink=Math.min(l.lowlink,i[c].index)):(s(c),l.lowlink=Math.min(l.lowlink,i[c].lowlink))}),l.lowlink===l.index){let c=[],u;do u=n.pop(),i[u].onStack=!1,c.push(u);while(o!==u);r.push(c)}}return e.nodes().forEach(function(o){o in i||s(o)}),r}function AWt(e){return LBe(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var TWt=()=>1;function _Wt(e,t,n){return jWt(e,t||TWt,n||function(i){return e.outEdges(i)})}function jWt(e,t,n){let i={},r=e.nodes();return r.forEach(function(s){i[s]={},i[s][s]={distance:0,predecessor:""},r.forEach(function(o){s!==o&&(i[s][o]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),n(s).forEach(function(o){let l=o.v===s?o.w:o.v,c=t(o);i[s][l]={distance:c,predecessor:s}})}),r.forEach(function(s){let o=i[s];r.forEach(function(l){let c=i[l];r.forEach(function(u){let d=c[s],f=o[u],h=c[u],m=d.distance+f.distance;m{var c;return(c=e.isDirected()?e.successors(l):e.neighbors(l))!=null?c:[]},o={};return t.forEach(function(l){if(!e.hasNode(l))throw new Error("Graph does not have node: "+l);r=FBe(e,l,n==="post",o,s,i,r)}),r}function FBe(e,t,n,i,r,s,o){return t in i||(i[t]=!0,n||(o=s(o,t)),r(t).forEach(function(l){o=FBe(e,l,n,i,r,s,o)}),n&&(o=s(o,t))),o}function BBe(e,t,n){return RWt(e,t,n,function(i,r){return i.push(r),i},[])}function IWt(e,t){return BBe(e,t,"post")}function PWt(e,t){return BBe(e,t,"pre")}function DWt(e,t){let n=new Ld,i={},r=new MBe,s;function o(c){let u=c.v===s?c.w:c.v,d=r.priority(u);if(d!==void 0){let f=t(c);f0;){if(s=r.removeMin(),s in i)n.setEdge(s,i[s]);else{if(l)throw new Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(s).forEach(o)}return n}function MWt(e,t,n,i){return LWt(e,t,n,i??(r=>{let s=e.outEdges(r);return s??[]}))}function LWt(e,t,n,i){if(n===void 0)return _P(e,t,n,i);let r=!1,s=e.nodes();for(let o=0;ot.setNode(n,e.node(n))),e.edges().forEach(n=>{let i=t.edge(n.v,n.w)||{weight:0,minlen:1},r=e.edge(n);t.setEdge(n.v,n.w,{weight:i.weight+r.weight,minlen:Math.max(i.minlen,r.minlen)})}),t}function UBe(e){let t=new Ld({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function woe(e,t){let n=e.x,i=e.y,r=t.x-n,s=t.y-i,o=e.width/2,l=e.height/2;if(!r&&!s)throw new Error("Not possible to find intersection inside of the rectangle");let c,u;return Math.abs(s)*o>Math.abs(r)*l?(s<0&&(l=-l),c=l*r/s,u=l):(r<0&&(o=-o),c=o,u=o*s/r),{x:n+c,y:i+u}}function XT(e){let t=mA(zBe(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let i=e.node(n),r=i.rank;r!==void 0&&(t[r]||(t[r]=[]),t[r][i.order]=n)}),t}function FWt(e){let t=e.nodes().map(i=>{let r=e.node(i).rank;return r===void 0?Number.MAX_VALUE:r}),n=hh(Math.min,t);e.nodes().forEach(i=>{let r=e.node(i);Object.hasOwn(r,"rank")&&(r.rank-=n)})}function BWt(e){let t=e.nodes().map(o=>e.node(o).rank).filter(o=>o!==void 0),n=hh(Math.min,t),i=[];e.nodes().forEach(o=>{let l=e.node(o).rank-n;i[l]||(i[l]=[]),i[l].push(o)});let r=0,s=e.graph().nodeRankFactor;Array.from(i).forEach((o,l)=>{o===void 0&&l%s!==0?--r:o!==void 0&&r&&o.forEach(c=>e.node(c).rank+=r)})}function koe(e,t,n,i){let r={width:0,height:0};return arguments.length>=4&&(r.rank=n,r.order=i),Sk(e,"border",r,t)}function UWt(e,t=QBe){let n=[];for(let i=0;iQBe){let n=UWt(t);return e(...n.map(i=>e(...i)))}else return e(...t)}function zBe(e){let t=e.nodes().map(n=>{let i=e.node(n).rank;return i===void 0?Number.MIN_VALUE:i});return hh(Math.max,t)}function QWt(e,t){let n={lhs:[],rhs:[]};return e.forEach(i=>{t(i)?n.lhs.push(i):n.rhs.push(i)}),n}function VBe(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}}function HBe(e,t){return t()}var zWt=0;function dK(e){let t=++zWt;return e+(""+t)}function mA(e,t,n=1){t==null&&(t=e,e=0);let i=s=>sti[t]:n=t,Object.entries(e).reduce((i,[r,s])=>(i[r]=n(s,r),i),{})}function VWt(e,t){return e.reduce((n,i,r)=>(n[i]=t[r],n),{})}var TL="\0",HWt="3.0.0",qWt=class{constructor(){hWt(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return Ooe(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&Ooe(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,WWt)),n=n._prev;return"["+e.join(", ")+"]"}};function Ooe(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function WWt(e,t){if(e!=="_next"&&e!=="_prev")return t}var KWt=qWt,GWt=()=>1;function XWt(e,t){if(e.nodeCount()<=1)return[];let n=ZWt(e,t||GWt);return YWt(n.graph,n.buckets,n.zeroIdx).flatMap(i=>e.outEdges(i.v,i.w)||[])}function YWt(e,t,n){var i;let r=[],s=t[t.length-1],o=t[0],l;for(;e.nodeCount();){for(;l=o.dequeue();)i6(e,t,n,l);for(;l=s.dequeue();)i6(e,t,n,l);if(e.nodeCount()){for(let c=t.length-2;c>0;--c)if(l=(i=t[c])==null?void 0:i.dequeue(),l){r=r.concat(i6(e,t,n,l,!0)||[]);break}}}return r}function i6(e,t,n,i,r){let s=[],o=r?s:void 0;return(e.inEdges(i.v)||[]).forEach(l=>{let c=e.edge(l),u=e.node(l.v);r&&s.push({v:l.v,w:l.w}),u.out-=c,B7(t,n,u)}),(e.outEdges(i.v)||[]).forEach(l=>{let c=e.edge(l),u=l.w,d=e.node(u);d.in-=c,B7(t,n,d)}),e.removeNode(i.v),o}function ZWt(e,t){let n=new Ld,i=0,r=0;e.nodes().forEach(l=>{n.setNode(l,{v:l,in:0,out:0})}),e.edges().forEach(l=>{let c=n.edge(l.v,l.w)||0,u=t(l),d=c+u;n.setEdge(l.v,l.w,d);let f=n.node(l.v),h=n.node(l.w);r=Math.max(r,f.out+=u),i=Math.max(i,h.in+=u)});let s=JWt(r+i+3).map(()=>new KWt),o=i+1;return n.nodes().forEach(l=>{B7(s,o,n.node(l))}),{graph:n,buckets:s,zeroIdx:o}}function B7(e,t,n){var i,r,s;n.out?n.in?(s=e[n.out-n.in+t])==null||s.enqueue(n):(r=e[e.length-1])==null||r.enqueue(n):(i=e[0])==null||i.enqueue(n)}function JWt(e){let t=[];for(let n=0;n{let i=e.edge(n);e.removeEdge(n),i.forwardName=n.name,i.reversed=!0,e.setEdge(n.w,n.v,i,dK("rev"))});function t(n){return i=>n.edge(i).weight}}function tKt(e){let t=[],n={},i={};function r(s){Object.hasOwn(i,s)||(i[s]=!0,n[s]=!0,e.outEdges(s).forEach(o=>{Object.hasOwn(n,o.w)?t.push(o):r(o.w)}),delete n[s])}return e.nodes().forEach(r),t}function nKt(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let i=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,i)}})}function iKt(e){e.graph().dummyChains=[],e.edges().forEach(t=>rKt(e,t))}function rKt(e,t){let n=t.v,i=e.node(n).rank,r=t.w,s=e.node(r).rank,o=t.name,l=e.edge(t),c=l.labelRank;if(s===i+1)return;e.removeEdge(t);let u,d,f;for(f=0,++i;i{let n=e.node(t),i=n.edgeLabel,r;for(e.setEdge(n.edgeObj,i);n.dummy;)r=e.successors(t)[0],e.removeNode(t),i.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(i.x=n.x,i.y=n.y,i.width=n.width,i.height=n.height),t=r,n=e.node(t)})}function fK(e){let t={};function n(i){let r=e.node(i);if(Object.hasOwn(t,i))return r.rank;t[i]=!0;let s=e.outEdges(i),o=s?s.map(c=>c==null?Number.POSITIVE_INFINITY:n(c.w)-e.edge(c).minlen):[],l=hh(Math.min,o);return l===Number.POSITIVE_INFINITY&&(l=0),r.rank=l}e.sources().forEach(n)}function j1(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var qBe=aKt;function aKt(e){let t=new Ld({directed:!1}),n=e.nodes();if(n.length===0)throw new Error("Graph must have at least one node");let i=n[0],r=e.nodeCount();t.setNode(i,{});let s,o;for(;oKt(t,e){let o=s.v,l=i===o?s.w:o;!e.hasNode(l)&&!j1(t,s)&&(e.setNode(l,{}),e.setEdge(i,l,{}),n(l))})}return e.nodes().forEach(n),e.nodeCount()}function lKt(e,t){return t.edges().reduce((n,i)=>{let r=Number.POSITIVE_INFINITY;return e.hasNode(i.v)!==e.hasNode(i.w)&&(r=j1(t,i)),rt.node(i).rank+=n)}var{preorder:uKt,postorder:dKt}=uK,fKt=n0;n0.initLowLimValues=pK;n0.initCutValues=hK;n0.calcCutValue=WBe;n0.leaveEdge=GBe;n0.enterEdge=XBe;n0.exchangeEdges=YBe;function n0(e){e=$Wt(e),fK(e);let t=qBe(e);pK(t),hK(t,e);let n,i;for(;n=GBe(t);)i=XBe(t,e,n),YBe(t,e,n,i)}function hK(e,t){let n=dKt(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(i=>hKt(e,t,i))}function hKt(e,t,n){let i=e.node(n).parent,r=e.edge(n,i);r.cutvalue=WBe(e,t,n)}function WBe(e,t,n){let i=e.node(n).parent,r=!0,s=t.edge(n,i),o=0;s||(r=!1,s=t.edge(i,n)),o=s.weight;let l=t.nodeEdges(n);return l&&l.forEach(c=>{let u=c.v===n,d=u?c.w:c.v;if(d!==i){let f=u===r,h=t.edge(c).weight;if(o+=f?h:-h,mKt(e,n,d)){let m=e.edge(n,d).cutvalue;o+=f?-m:m}}}),o}function pK(e,t){arguments.length<2&&(t=e.nodes()[0]),KBe(e,{},1,t)}function KBe(e,t,n,i,r){let s=n,o=e.node(i);t[i]=!0;let l=e.neighbors(i);return l&&l.forEach(c=>{Object.hasOwn(t,c)||(n=KBe(e,t,n,c,i))}),o.low=s,o.lim=n++,r?o.parent=r:delete o.parent,n}function GBe(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function XBe(e,t,n){let i=n.v,r=n.w;t.hasEdge(i,r)||(i=n.w,r=n.v);let s=e.node(i),o=e.node(r),l=s,c=!1;return s.lim>o.lim&&(l=o,c=!0),t.edges().filter(u=>c===Soe(e,e.node(u.v),l)&&c!==Soe(e,e.node(u.w),l)).reduce((u,d)=>j1(t,d)!e.node(r).parent);if(!n)return;let i=uKt(e,[n]);i=i.slice(1),i.forEach(r=>{let s=e.node(r).parent,o=t.edge(r,s),l=!1;o||(o=t.edge(s,r),l=!0),t.node(r).rank=t.node(s).rank+(l?o.minlen:-o.minlen)})}function mKt(e,t,n){return e.hasEdge(t,n)}function Soe(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var gKt=bKt;function bKt(e){let t=e.graph().ranker;if(typeof t=="function")return t(e);switch(t){case"network-simplex":Eoe(e);break;case"tight-tree":vKt(e);break;case"longest-path":yKt(e);break;case"none":break;default:Eoe(e)}}var yKt=fK;function vKt(e){fK(e),qBe(e)}function Eoe(e){fKt(e)}var xKt=wKt;function wKt(e){let t=OKt(e);e.graph().dummyChains.forEach(n=>{let i=e.node(n),r=i.edgeObj,s=kKt(e,t,r.v,r.w),o=s.path,l=s.lca,c=0,u=o[c],d=!0;for(;n!==r.w;){if(i=e.node(n),d){for(;(u=o[c])!==l&&e.node(u).maxRanko||l>t[c].lim));let u=c,d=i;for(;(d=e.parent(d))!==u;)s.push(d);return{path:r.concat(s.reverse()),lca:u}}function OKt(e){let t={},n=0;function i(r){let s=n;e.children(r).forEach(i),t[r]={low:s,lim:n++}}return e.children(TL).forEach(i),t}function SKt(e){let t=Sk(e,"root",{},"_root"),n=EKt(e),i=Object.values(n),r=hh(Math.max,i)-1,s=2*r+1;e.graph().nestingRoot=t,e.edges().forEach(l=>e.edge(l).minlen*=s);let o=CKt(e)+1;e.children(TL).forEach(l=>ZBe(e,t,s,o,r,n,l)),e.graph().nodeRankFactor=s}function ZBe(e,t,n,i,r,s,o){var l;let c=e.children(o);if(!c.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let u=koe(e,"_bt"),d=koe(e,"_bb"),f=e.node(o);e.setParent(u,o),f.borderTop=u,e.setParent(d,o),f.borderBottom=d,c.forEach(h=>{var m;ZBe(e,t,n,i,r,s,h);let g=e.node(h),b=g.borderTop?g.borderTop:h,v=g.borderBottom?g.borderBottom:h,y=g.borderTop?i:2*i,w=b!==v?1:r-((m=s[o])!=null?m:0)+1;e.setEdge(u,b,{weight:y,minlen:w,nestingEdge:!0}),e.setEdge(v,d,{weight:y,minlen:w,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,u,{weight:0,minlen:r+((l=s[o])!=null?l:0)})}function EKt(e){let t={};function n(i,r){let s=e.children(i);s&&s.length&&s.forEach(o=>n(o,r+1)),t[i]=r}return e.children(TL).forEach(i=>n(i,1)),t}function CKt(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function AKt(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(n=>{e.edge(n).nestingEdge&&e.removeEdge(n)})}var TKt=_Kt;function _Kt(e){function t(n){let i=e.children(n),r=e.node(n);if(i.length&&i.forEach(t),Object.hasOwn(r,"minRank")){r.borderLeft=[],r.borderRight=[];for(let s=r.minRank,o=r.maxRank+1;sAoe(e.node(t))),e.edges().forEach(t=>Aoe(e.edge(t)))}function Aoe(e){let t=e.width;e.width=e.height,e.height=t}function RKt(e){e.nodes().forEach(t=>r6(e.node(t))),e.edges().forEach(t=>{var n;let i=e.edge(t);(n=i.points)==null||n.forEach(r6),Object.hasOwn(i,"y")&&r6(i)})}function r6(e){e.y=-e.y}function IKt(e){e.nodes().forEach(t=>s6(e.node(t))),e.edges().forEach(t=>{var n;let i=e.edge(t);(n=i.points)==null||n.forEach(s6),Object.hasOwn(i,"x")&&s6(i)})}function s6(e){let t=e.x;e.x=e.y,e.y=t}function PKt(e){let t={},n=e.nodes().filter(l=>!e.children(l).length),i=n.map(l=>e.node(l).rank),r=hh(Math.max,i),s=mA(r+1).map(()=>[]);function o(l){if(t[l])return;t[l]=!0;let c=e.node(l);s[c.rank].push(l);let u=e.successors(l);u&&u.forEach(o)}return n.sort((l,c)=>e.node(l).rank-e.node(c).rank).forEach(o),s}function DKt(e,t){let n=0;for(let i=1;id)),r=t.flatMap(u=>{let d=e.outEdges(u);return d?d.map(f=>({pos:i[f.w],weight:e.edge(f).weight})).sort((f,h)=>f.pos-h.pos):[]}),s=1;for(;s{let d=u.pos+s;l[d]+=u.weight;let f=0;for(;d>0;)d%2&&(f+=l[d+1]),d=d-1>>1,l[d]+=u.weight;c+=u.weight*f}),c}function LKt(e,t=[]){return t.map(n=>{let i=e.inEdges(n);if(!i||!i.length)return{v:n};{let r=i.reduce((s,o)=>{let l=e.edge(o),c=e.node(o.v);return{sum:s.sum+l.weight*c.order,weight:s.weight+l.weight}},{sum:0,weight:0});return{v:n,barycenter:r.sum/r.weight,weight:r.weight}}})}function $Kt(e,t){let n={};e.forEach((r,s)=>{let o={indegree:0,in:[],out:[],vs:[r.v],i:s};r.barycenter!==void 0&&(o.barycenter=r.barycenter,o.weight=r.weight),n[r.v]=o}),t.edges().forEach(r=>{let s=n[r.v],o=n[r.w];s!==void 0&&o!==void 0&&(o.indegree++,s.out.push(o))});let i=Object.values(n).filter(r=>!r.indegree);return FKt(i)}function FKt(e){let t=[];function n(r){return s=>{s.merged||(s.barycenter===void 0||r.barycenter===void 0||s.barycenter>=r.barycenter)&&BKt(r,s)}}function i(r){return s=>{s.in.push(r),--s.indegree===0&&e.push(s)}}for(;e.length;){let r=e.pop();t.push(r),r.in.reverse().forEach(n(r)),r.out.forEach(i(r))}return t.filter(r=>!r.merged).map(r=>NP(r,["vs","i","barycenter","weight"]))}function BKt(e,t){let n=0,i=0;e.weight&&(n+=e.barycenter*e.weight,i+=e.weight),t.weight&&(n+=t.barycenter*t.weight,i+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/i,e.weight=i,e.i=Math.min(t.i,e.i),t.merged=!0}function UKt(e,t){let n=QWt(e,d=>Object.hasOwn(d,"barycenter")),i=n.lhs,r=n.rhs.sort((d,f)=>f.i-d.i),s=[],o=0,l=0,c=0;i.sort(QKt(!!t)),c=Toe(s,r,c),i.forEach(d=>{c+=d.vs.length,s.push(d.vs),o+=d.barycenter*d.weight,l+=d.weight,c=Toe(s,r,c)});let u={vs:s.flat(1)};return l&&(u.barycenter=o/l,u.weight=l),u}function Toe(e,t,n){let i;for(;t.length&&(i=t[t.length-1]).i<=n;)t.pop(),e.push(i.vs),n++;return n}function QKt(e){return(t,n)=>t.barycentern.barycenter?1:e?n.i-t.i:t.i-n.i}function e9e(e,t,n,i){let r=e.children(t),s=e.node(t),o=s?s.borderLeft:void 0,l=s?s.borderRight:void 0,c={};o&&(r=r.filter(h=>h!==o&&h!==l));let u=LKt(e,r);u.forEach(h=>{if(e.children(h.v).length){let m=e9e(e,h.v,n,i);c[h.v]=m,Object.hasOwn(m,"barycenter")&&VKt(h,m)}});let d=$Kt(u,n);zKt(d,c);let f=UKt(d,i);if(o&&l){f.vs=[o,f.vs,l].flat(1);let h=e.predecessors(o);if(h&&h.length){let m=e.node(h[0]),g=e.predecessors(l),b=e.node(g[0]);Object.hasOwn(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+m.order+b.order)/(f.weight+2),f.weight+=2}}return f}function zKt(e,t){e.forEach(n=>{n.vs=n.vs.flatMap(i=>t[i]?t[i].vs:i)})}function VKt(e,t){e.barycenter!==void 0?(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight):(e.barycenter=t.barycenter,e.weight=t.weight)}function HKt(e,t,n,i){i||(i=e.nodes());let r=qKt(e),s=new Ld({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(o=>e.node(o));return i.forEach(o=>{let l=e.node(o),c=e.parent(o);if(l.rank===t||l.minRank<=t&&t<=l.maxRank){s.setNode(o),s.setParent(o,c||r);let u=e[n](o);u&&u.forEach(d=>{let f=d.v===o?d.w:d.v,h=s.edge(f,o),m=h!==void 0?h.weight:0;s.setEdge(f,o,{weight:e.edge(d).weight+m})}),Object.hasOwn(l,"minRank")&&s.setNode(o,{borderLeft:l.borderLeft[t],borderRight:l.borderRight[t]})}}),s}function qKt(e){let t;for(;e.hasNode(t=dK("_root")););return t}function WKt(e,t,n){let i={},r;n.forEach(s=>{let o=e.parent(s),l,c;for(;o;){if(l=e.parent(o),l?(c=i[l],i[l]=o):(c=r,r=o),c&&c!==o){t.setEdge(c,o);return}o=l}})}function t9e(e,t={}){if(typeof t.customOrder=="function"){t.customOrder(e,t9e);return}let n=zBe(e),i=_oe(e,mA(1,n+1),"inEdges"),r=_oe(e,mA(n-1,-1,-1),"outEdges"),s=PKt(e);if(joe(e,s),t.disableOptimalOrderHeuristic)return;let o=Number.POSITIVE_INFINITY,l,c=t.constraints||[];for(let u=0,d=0;d<4;++u,++d){KKt(u%2?i:r,u%4>=2,c),s=XT(e);let f=DKt(e,s);f{i.has(s)||i.set(s,[]),i.get(s).push(o)};for(let s of e.nodes()){let o=e.node(s);if(typeof o.rank=="number"&&r(o.rank,s),typeof o.minRank=="number"&&typeof o.maxRank=="number")for(let l=o.minRank;l<=o.maxRank;l++)l!==o.rank&&r(l,s)}return t.map(function(s){return HKt(e,s,n,i.get(s)||[])})}function KKt(e,t,n){let i=new Ld;e.forEach(function(r){n.forEach(l=>i.setEdge(l.left,l.right));let s=r.graph().root,o=e9e(r,s,i,t);o.vs.forEach((l,c)=>r.node(l).order=c),WKt(r,i,o.vs)})}function joe(e,t){Object.values(t).forEach(n=>n.forEach((i,r)=>e.node(i).order=r))}function GKt(e,t){let n={};function i(r,s){let o=0,l=0,c=r.length,u=s[s.length-1];return s.forEach((d,f)=>{let h=YKt(e,d),m=h?e.node(h).order:c;(h||d===u)&&(s.slice(l,f+1).forEach(g=>{let b=e.predecessors(g);b&&b.forEach(v=>{let y=e.node(v),w=y.order;(w{let f=s[d];if(f!==void 0&&e.node(f).dummy){let h=e.predecessors(f);h&&h.forEach(m=>{if(m===void 0)return;let g=e.node(m);g.dummy&&(g.orderu)&&n9e(n,m,f)})}})}function r(s,o){let l=-1,c=-1,u=0;return o.forEach((d,f)=>{if(e.node(d).dummy==="border"){let h=e.predecessors(d);if(h&&h.length){let m=h[0];if(m===void 0)return;c=e.node(m).order,i(o,u,f,l,c),u=f,l=c}}i(o,u,o.length,c,s.length)}),o}return t.length&&t.reduce(r),n}function YKt(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(i=>e.node(i).dummy)}}function n9e(e,t,n){if(t>n){let r=t;t=n,n=r}let i=e[t];i||(e[t]=i={}),i[n]=!0}function ZKt(e,t,n){if(t>n){let r=t;t=n,n=r}let i=e[t];return i!==void 0&&Object.hasOwn(i,n)}function JKt(e,t,n,i){let r={},s={},o={};return t.forEach(l=>{l.forEach((c,u)=>{r[c]=c,s[c]=c,o[c]=u})}),t.forEach(l=>{let c=-1;l.forEach(u=>{let d=i(u);if(d&&d.length){let f=d.sort((m,g)=>{let b=o[m],v=o[g];return(b!==void 0?b:0)-(v!==void 0?v:0)}),h=(f.length-1)/2;for(let m=Math.floor(h),g=Math.ceil(h);m<=g;++m){let b=f[m];if(b===void 0)continue;let v=o[b];if(v!==void 0&&s[u]===u&&c{var y;let w=(y=s[v.v])!=null?y:0,x=o.edge(v);return Math.max(b,w+(x!==void 0?x:0))},0):s[m]=0}function d(m){let g=o.outEdges(m),b=Number.POSITIVE_INFINITY;g&&(b=g.reduce((y,w)=>{let x=s[w.w],k=o.edge(w);return Math.min(y,(x!==void 0?x:0)-(k!==void 0?k:0))},Number.POSITIVE_INFINITY));let v=e.node(m);b!==Number.POSITIVE_INFINITY&&v.borderType!==l&&(s[m]=Math.max(s[m]!==void 0?s[m]:0,b))}function f(m){return o.predecessors(m)||[]}function h(m){return o.successors(m)||[]}return c(u,f),c(d,h),Object.keys(i).forEach(m=>{var g;let b=n[m];b!==void 0&&(s[m]=(g=s[b])!=null?g:0)}),s}function tGt(e,t,n,i){let r=new Ld,s=e.graph(),o=aGt(s.nodesep,s.edgesep,i);return t.forEach(l=>{let c;l.forEach(u=>{let d=n[u];if(d!==void 0){if(r.setNode(d),c!==void 0){let f=n[c];if(f!==void 0){let h=r.edge(f,d);r.setEdge(f,d,Math.max(o(e,u,c),h||0))}}c=u}})}),r}function nGt(e,t){return Object.values(t).reduce((n,i)=>{let r=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;Object.entries(i).forEach(([l,c])=>{let u=oGt(e,l)/2;r=Math.max(c+u,r),s=Math.min(c-u,s)});let o=r-s;return o{["l","r"].forEach(o=>{let l=s+o,c=e[l];if(!c||c===t)return;let u=Object.values(c),d=i-hh(Math.min,u);o!=="l"&&(d=r-hh(Math.max,u)),d&&(e[l]=AL(c,f=>f+d))})})}function rGt(e,t=void 0){let n=e.ul;return n?AL(n,(i,r)=>{var s,o;if(t){let c=t.toLowerCase(),u=e[c];if(u&&u[r]!==void 0)return u[r]}let l=Object.values(e).map(c=>{let u=c[r];return u!==void 0?u:0}).sort((c,u)=>c-u);return(((s=l[1])!=null?s:0)+((o=l[2])!=null?o:0))/2}):{}}function sGt(e){let t=XT(e),n=Object.assign(GKt(e,t),XKt(e,t)),i={},r;["u","d"].forEach(o=>{r=o==="u"?t:Object.values(t).reverse(),["l","r"].forEach(l=>{l==="r"&&(r=r.map(d=>Object.values(d).reverse()));let c=JKt(e,r,n,d=>(o==="u"?e.predecessors(d):e.successors(d))||[]),u=eGt(e,r,c.root,c.align,l==="r");l==="r"&&(u=AL(u,d=>-d)),i[o+l]=u})});let s=nGt(e,i);return iGt(i,s),rGt(i,e.graph().align)}function aGt(e,t,n){return(i,r,s)=>{let o=i.node(r),l=i.node(s),c=0,u;if(c+=o.width/2,Object.hasOwn(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":u=-o.width/2;break;case"r":u=o.width/2;break}if(u&&(c+=n?u:-u),u=void 0,c+=(o.dummy?t:e)/2,c+=(l.dummy?t:e)/2,c+=l.width/2,Object.hasOwn(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":u=l.width/2;break;case"r":u=-l.width/2;break}return u&&(c+=n?u:-u),c}}function oGt(e,t){return e.node(t).width}function lGt(e){e=UBe(e),cGt(e),Object.entries(sGt(e)).forEach(([t,n])=>e.node(t).x=n)}function cGt(e){let t=XT(e),n=e.graph(),i=n.ranksep,r=n.rankalign,s=0;t.forEach(o=>{let l=o.reduce((c,u)=>{var d;let f=(d=e.node(u).height)!=null?d:0;return c>f?c:f},0);o.forEach(c=>{let u=e.node(c);r==="top"?u.y=s+u.height/2:r==="bottom"?u.y=s+l-u.height/2:u.y=s+l/2}),s+=l+i})}function uGt(e,t={}){let n=t.debugTiming?VBe:HBe;return n("layout",()=>{let i=n(" buildLayoutGraph",()=>xGt(e));return n(" runLayout",()=>dGt(i,n,t)),n(" updateInputGraph",()=>fGt(e,i)),i})}function dGt(e,t,n){t(" makeSpaceForEdgeLabels",()=>wGt(e)),t(" removeSelfEdges",()=>jGt(e)),t(" acyclic",()=>eKt(e)),t(" nestingGraph.run",()=>SKt(e)),t(" rank",()=>gKt(UBe(e))),t(" injectEdgeLabelProxies",()=>kGt(e)),t(" removeEmptyRanks",()=>BWt(e)),t(" nestingGraph.cleanup",()=>AKt(e)),t(" normalizeRanks",()=>FWt(e)),t(" assignRankMinMax",()=>OGt(e)),t(" removeEdgeLabelProxies",()=>SGt(e)),t(" normalize.run",()=>iKt(e)),t(" parentDummyChains",()=>xKt(e)),t(" addBorderSegments",()=>TKt(e)),t(" order",()=>t9e(e,n)),t(" insertSelfEdges",()=>NGt(e)),t(" adjustCoordinateSystem",()=>jKt(e)),t(" position",()=>lGt(e)),t(" positionSelfEdges",()=>RGt(e)),t(" removeBorderNodes",()=>_Gt(e)),t(" normalize.undo",()=>sKt(e)),t(" fixupEdgeLabelCoords",()=>AGt(e)),t(" undoCoordinateSystem",()=>NKt(e)),t(" translateGraph",()=>EGt(e)),t(" assignNodeIntersects",()=>CGt(e)),t(" reversePoints",()=>TGt(e)),t(" acyclic.undo",()=>nKt(e))}function fGt(e,t){e.nodes().forEach(n=>{let i=e.node(n),r=t.node(n);i&&(i.x=r.x,i.y=r.y,i.order=r.order,i.rank=r.rank,t.children(n).length&&(i.width=r.width,i.height=r.height))}),e.edges().forEach(n=>{let i=e.edge(n),r=t.edge(n);i.points=r.points,Object.hasOwn(r,"x")&&(i.x=r.x,i.y=r.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var hGt=["nodesep","edgesep","ranksep","marginx","marginy"],pGt={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},mGt=["acyclicer","ranker","rankdir","align","rankalign"],gGt=["width","height","rank"],Noe={width:0,height:0},bGt=["minlen","weight","width","height","labeloffset"],yGt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},vGt=["labelpos"];function xGt(e){let t=new Ld({multigraph:!0,compound:!0}),n=o6(e.graph());return t.setGraph(Object.assign({},pGt,a6(n,hGt),NP(n,mGt))),e.nodes().forEach(i=>{let r=o6(e.node(i)),s=a6(r,gGt);Object.keys(Noe).forEach(l=>{s[l]===void 0&&(s[l]=Noe[l])}),t.setNode(i,s);let o=e.parent(i);o!==void 0&&t.setParent(i,o)}),e.edges().forEach(i=>{let r=o6(e.edge(i));t.setEdge(i,Object.assign({},yGt,a6(r,bGt),NP(r,vGt)))}),t}function wGt(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let i=e.edge(n);i.minlen*=2,i.labelpos.toLowerCase()!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?i.width+=i.labeloffset:i.height+=i.labeloffset)})}function kGt(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let i=e.node(t.v),r={rank:(e.node(t.w).rank-i.rank)/2+i.rank,e:t};Sk(e,"edge-proxy",r,"_ep")}})}function OGt(e){let t=0;e.nodes().forEach(n=>{let i=e.node(n);i.borderTop&&(i.minRank=e.node(i.borderTop).rank,i.maxRank=e.node(i.borderBottom).rank,t=Math.max(t,i.maxRank))}),e.graph().maxRank=t}function SGt(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy==="edge-proxy"){let i=n;e.edge(i.e).labelRank=n.rank,e.removeNode(t)}})}function EGt(e){let t=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,r=0,s=e.graph(),o=s.marginx||0,l=s.marginy||0;function c(u){let d=u.x,f=u.y,h=u.width,m=u.height;t=Math.min(t,d-h/2),n=Math.max(n,d+h/2),i=Math.min(i,f-m/2),r=Math.max(r,f+m/2)}e.nodes().forEach(u=>c(e.node(u))),e.edges().forEach(u=>{let d=e.edge(u);Object.hasOwn(d,"x")&&c(d)}),t-=o,i-=l,e.nodes().forEach(u=>{let d=e.node(u);d.x-=t,d.y-=i}),e.edges().forEach(u=>{let d=e.edge(u);d.points.forEach(f=>{f.x-=t,f.y-=i}),Object.hasOwn(d,"x")&&(d.x-=t),Object.hasOwn(d,"y")&&(d.y-=i)}),s.width=n-t+o,s.height=r-i+l}function CGt(e){e.edges().forEach(t=>{let n=e.edge(t),i=e.node(t.v),r=e.node(t.w),s,o;n.points?(s=n.points[0],o=n.points[n.points.length-1]):(n.points=[],s=r,o=i),n.points.unshift(woe(i,s)),n.points.push(woe(r,o))})}function AGt(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,"x"))switch((n.labelpos==="l"||n.labelpos==="r")&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}})}function TGt(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function _Gt(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),i=e.node(n.borderTop),r=e.node(n.borderBottom),s=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-s.x),n.height=Math.abs(r.y-i.y),n.x=s.x+n.width/2,n.y=i.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy==="border"&&e.removeNode(t)})}function jGt(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function NGt(e){XT(e).forEach(t=>{let n=0;t.forEach((i,r)=>{let s=e.node(i);s.order=r+n,(s.selfEdges||[]).forEach(o=>{Sk(e,"selfedge",{width:o.label.width,height:o.label.height,rank:s.rank,order:r+ ++n,e:o.e,label:o.label},"_se")}),delete s.selfEdges})})}function RGt(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy==="selfedge"){let i=n,r=e.node(i.e.v),s=r.x+r.width/2,o=r.y,l=n.x-s,c=r.height/2;e.setEdge(i.e,i.label),e.removeNode(t),i.label.points=[{x:s+2*l/3,y:o-c},{x:s+5*l/6,y:o-c},{x:s+l,y:o},{x:s+5*l/6,y:o+c},{x:s+2*l/3,y:o+c}],i.label.x=n.x,i.label.y=n.y}})}function a6(e,t){return AL(NP(e,t),Number)}function o6(e){let t={};return e&&Object.entries(e).forEach(([n,i])=>{typeof n=="string"&&(n=n.toLowerCase()),t[n]=i}),t}function IGt(e){let t=XT(e),n=new Ld({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(i=>{n.setNode(i,{label:i}),n.setParent(i,"layer"+e.node(i).rank)}),e.edges().forEach(i=>n.setEdge(i.v,i.w,{},i.name)),t.forEach((i,r)=>{let s="layer"+r;n.setNode(s,{rank:"same"}),i.reduce((o,l)=>(n.setEdge(o,l,{style:"invis"}),l))}),n}var PGt={graphlib:RBe,version:HWt,layout:uGt,debug:IGt,util:{time:VBe,notime:HBe}},Roe=PGt;/*! For license information please see dagre.esm.js.LEGAL.txt */const AS={llm:{labelKey:"buildCanvas.patterns.llm.label",descriptionKey:"buildCanvas.patterns.llm.description",icon:Qje},sequential:{labelKey:"buildCanvas.patterns.sequential.label",descriptionKey:"buildCanvas.patterns.sequential.description",icon:Vat},parallel:{labelKey:"buildCanvas.patterns.parallel.label",descriptionKey:"buildCanvas.patterns.parallel.description",icon:Sat},loop:{labelKey:"buildCanvas.patterns.loop.label",descriptionKey:"buildCanvas.patterns.loop.description",icon:Wje},a2a:{labelKey:"buildCanvas.patterns.a2a.label",descriptionKey:"buildCanvas.patterns.a2a.description",icon:eM}},U7=220,Q7=88,Ioe=96,Poe=34,IE=64,l6=310,qx=24,i9e=56,z7=40,Doe=40,DGt=18,MGt=58,LGt=!1,$Gt=e=>e==="sequential"||e==="parallel"||e==="loop";function V7(e,t){const n=e.agentType??"llm";return $Gt(n)||n==="llm"&&(t.length===0||e.subAgents.length>0)}function H7(e,t=[],n="horizontal",i=!1){const r=e.agentType??"llm";if(!V7(e,t))return{width:U7,height:Q7};if(i&&e.subAgents.length===0)return{width:l6,height:IE};const s=e.subAgents.map((f,h)=>H7(f,[...t,h],n,i)),o=s.length?Math.max(...s.map(f=>f.width)):0,l=s.length?Math.max(...s.map(f=>f.height)):0,c=s.length&&r!=="parallel"?i9e:qx,u=n==="horizontal"?r!=="parallel":r==="parallel",d=s.length?r==="parallel"?DGt+Doe:r==="loop"?MGt:0:Doe;return u?{width:Math.max(l6,s.reduce((f,h)=>f+h.width,0)+z7*Math.max(0,s.length-1)+c*2),height:IE+qx+l+d+qx}:{width:Math.max(l6,o+qx*2),height:IE+c+s.reduce((f,h)=>f+h.height,0)+z7*Math.max(0,s.length-1)+d+c}}function DO(e){return e.length===0?"agent-root":`agent-${e.join("-")}`}function FGt(e,t){return e.length===t.length&&e.every((n,i)=>n===t[i])}function Moe(e){const t=n=>[n.agentType??"llm",n.subAgents.map(t)];return JSON.stringify(t(e))}function MO(e,t,n,i){const r=(i==null?void 0:i.tone)==="sequential"?"hsl(213 40% 40%)":(i==null?void 0:i.tone)==="loop"?"hsl(151 34% 34%)":"hsl(220 9% 38%)";return{id:`${e}-${t}${i!=null&&i.loop?"-loop":""}`,source:e,target:t,sourceHandle:i!=null&&i.loop?"loop-source":void 0,targetHandle:i!=null&&i.loop?"loop-target":void 0,label:n,type:"insertStep",data:i?{insert:i.insert,loop:i.loop,tone:i.tone}:void 0,animated:i==null?void 0:i.loop,markerEnd:{type:dA.ArrowClosed,width:16,height:16,color:r},style:{stroke:r,strokeWidth:1.5},labelStyle:{fill:"hsl(215 14% 42%)",fontSize:10,fontWeight:600},labelBgStyle:{fill:"hsl(var(--background))",fillOpacity:.92}}}function Loe(e,t,n=!1,i){const r=[{id:"terminal-input",type:"terminal",position:{x:0,y:0},data:{kind:"terminal",title:i("buildCanvas.terminals.input")},selectable:!1,draggable:!1},{id:"terminal-output",type:"terminal",position:{x:0,y:0},data:{kind:"terminal",title:i("buildCanvas.terminals.output")},selectable:!1,draggable:!1}],s=[];function o(f,h,m,g,b){const v=f.agentType??"llm",y=DO(h);return V7(f,h)?(l(f,h,m,g,b),y):(r.push({id:y,type:"agent",parentId:m,extent:"parent",position:g,data:{kind:"agent",path:h,agent:f,title:v==="a2a"?i("buildCanvas.patterns.a2a.label"):f.name.trim()||(h.length===0?i("buildCanvas.rootAgent"):i("buildCanvas.unnamedStep")),pattern:v,description:f.description.trim()||i(AS[v].descriptionKey),childCount:f.subAgents.length,containedIn:b}}),y)}function l(f,h,m,g={x:0,y:0},b){const v=f.agentType??"sequential",y=DO(h),w=H7(f,h,t,n);r.push({id:y,type:"group",parentId:m,extent:m?"parent":void 0,position:g,style:{width:w.width,height:w.height},data:{kind:"agent",path:h,agent:f,title:f.name.trim()||(h.length===0?i("buildCanvas.rootAgent"):i(AS[v].labelKey)),pattern:v,description:f.description.trim()||i(AS[v].descriptionKey),childCount:f.subAgents.length,containedIn:b,layoutWidth:w.width,layoutHeight:w.height,compactEmptyGroup:n&&f.subAgents.length===0}});const x=f.subAgents.map((E,j)=>H7(E,[...h,j],t,n)),k=x.length&&v!=="parallel"?i9e:qx,S=t==="horizontal"?v!=="parallel":v==="parallel";let O=k;const A=f.subAgents.map((E,j)=>{const T=x[j],R=S?{x:O,y:IE+qx}:{x:(w.width-T.width)/2,y:IE+O};return O+=(S?T.width:T.height)+z7,o(E,[...h,j],y,R,v)});if(v==="sequential"||v==="loop"){for(let E=0;E1&&s.push(MO(A[A.length-1],A[0],i("buildCanvas.edges.continueLoop"),{loop:!0,tone:"loop"}))}return y}const c=(f,h)=>{const m=f.agentType??"llm",g=DO(h);if(V7(f,h))return l(f,h),[g];if(r.push({id:g,type:"agent",position:{x:0,y:0},data:{kind:"agent",path:h,agent:f,title:m==="a2a"?i("buildCanvas.patterns.a2a.label"):f.name.trim()||(h.length===0?i("buildCanvas.rootAgent"):i("buildCanvas.unnamedStep")),pattern:m,description:f.description.trim()||i(AS[m].descriptionKey),childCount:f.subAgents.length}}),f.subAgents.length===0)return[g];const b=[];return f.subAgents.forEach((v,y)=>{const w=[...h,y],x=DO(w);s.push(MO(g,x,i("buildCanvas.edges.call"),{insert:{parentPath:h,index:y}})),b.push(...c(v,w))}),b},u=DO([]),d=c(e,[]);return s.push(MO("terminal-input",u)),d.forEach(f=>s.push(MO(f,"terminal-output"))),BGt(r,s,t)}function BGt(e,t,n){const i=new Roe.graphlib.Graph().setDefaultEdgeLabel(()=>({}));i.setGraph({rankdir:n==="vertical"?"TB":"LR",ranksep:50,nodesep:34,edgesep:14,marginx:24,marginy:24});const r=new Set(e.filter(s=>!s.parentId).map(s=>s.id));return e.filter(s=>!s.parentId).forEach(s=>{const o=s.data.kind==="terminal";i.setNode(s.id,{width:o?Ioe:s.data.layoutWidth??U7,height:o?Poe:s.data.layoutHeight??Q7})}),t.filter(s=>r.has(s.source)&&r.has(s.target)).forEach(s=>i.setEdge(s.source,s.target)),Roe.layout(i),{nodes:e.map(s=>{if(s.parentId)return s;const o=i.node(s.id),l=s.data.kind==="terminal",c=l?Ioe:s.data.layoutWidth??U7,u=l?Poe:s.data.layoutHeight??Q7;return{...s,position:{x:o.x-c/2,y:o.y-u/2}}}),edges:t}}const _L=p.createContext(null),jL=p.createContext("horizontal");function UGt({id:e,sourceX:t,sourceY:n,targetX:i,targetY:r,sourcePosition:s,targetPosition:o,markerEnd:l,style:c,label:u,data:d}){const{t:f}=_e("create"),h=p.useContext(_L),[m,g]=p.useState(!1),[b,v,y]=AP({sourceX:t,sourceY:n,targetX:i,targetY:r,sourcePosition:s,targetPosition:o,offset:d!=null&&d.loop?28:20});return a.jsxs(a.Fragment,{children:[a.jsx(GT,{id:e,path:b,markerEnd:l,style:c}),h&&(d==null?void 0:d.insert)&&a.jsx("path",{d:b,className:"abc-edge-hover-path",onPointerEnter:()=>g(!0),onPointerLeave:()=>g(!1)}),(u||h&&(d==null?void 0:d.insert))&&a.jsx(Iqt,{children:a.jsxs("div",{className:`abc-edge-tools${h&&(d!=null&&d.insert)?" can-insert":""}${m?" is-visible":""}`,style:{transform:`translate(-50%, -50%) translate(${v}px, ${y}px)`},onPointerEnter:()=>g(!0),onPointerLeave:()=>g(!1),children:[u&&a.jsx("span",{className:"abc-edge-label",children:u}),h&&(d==null?void 0:d.insert)&&a.jsx("button",{type:"button",className:"abc-edge-add nodrag nopan","aria-label":f("buildCanvas.actions.insertHere"),title:f("buildCanvas.actions.insertHere"),onClick:w=>{w.stopPropagation(),h==null||h.onInsert(d.insert.parentPath,d.insert.index)},children:a.jsx(ec,{})})]})})]})}function QGt({data:e,selected:t}){const{t:n}=_e("create"),i=p.useContext(_L),r=p.useContext(jL),s=r==="vertical"?vn.Top:vn.Left,o=r==="vertical"?vn.Bottom:vn.Right,l=r==="vertical"?vn.Right:vn.Bottom,c=e.pattern??"llm",u=AS[c],d=u.icon;return a.jsxs("div",{className:`abc-node is-${c}${e.containedIn?` is-contained-in-${e.containedIn}`:""}${t?" is-selected":""}`,children:[a.jsx(Dc,{type:"target",position:s,className:"abc-handle"}),c!=="llm"&&a.jsx("span",{className:"abc-node-icon",children:a.jsx(d,{})}),a.jsxs("span",{className:"abc-node-copy",children:[a.jsx("span",{className:"abc-node-meta",children:a.jsx("span",{children:n(u.labelKey)})}),a.jsx("strong",{children:e.title}),a.jsx("small",{children:e.description})]}),i&&e.path!==void 0&&e.path.length>0&&a.jsx("button",{type:"button",className:"abc-node-delete nodrag nopan","aria-label":n("buildCanvas.actions.deleteNamed",{name:e.title}),title:n("buildCanvas.actions.deleteNode"),onClick:f=>{f.stopPropagation(),i==null||i.onDelete(e.path)},children:a.jsx(Yg,{})}),a.jsx(Dc,{type:"source",position:o,className:"abc-handle"}),e.containedIn==="loop"&&a.jsxs(a.Fragment,{children:[a.jsx(Dc,{id:"loop-target",type:"target",position:l,className:"abc-handle abc-loop-handle"}),a.jsx(Dc,{id:"loop-source",type:"source",position:l,className:"abc-handle abc-loop-handle"})]})]})}function zGt({data:e,selected:t}){const{t:n}=_e("create"),i=p.useContext(_L),r=p.useContext(jL),s=r==="vertical"?vn.Top:vn.Left,o=r==="vertical"?vn.Bottom:vn.Right,l=r==="vertical"?vn.Right:vn.Bottom,c=e.pattern??"sequential",u=e.childCount??0,d=n(c==="llm"?"buildCanvas.actions.addSubagent":c==="parallel"?"buildCanvas.actions.addParallelStep":c==="loop"?"buildCanvas.actions.addLoopStep":"buildCanvas.actions.addNextStep");return a.jsxs("div",{className:`abc-group is-${c}${e.compactEmptyGroup?" is-compact-empty":""}${t?" is-selected":""}`,children:[a.jsx(Dc,{type:"target",position:s,className:"abc-handle"}),a.jsx("header",{className:"abc-group-head",children:a.jsxs("span",{children:[a.jsx("strong",{title:e.title,children:e.title}),a.jsx("small",{children:e.description})]})}),i&&e.path!==void 0&&u>0&&c!=="parallel"&&a.jsxs("div",{className:"abc-group-boundary-actions",children:[a.jsx("button",{type:"button",className:"abc-group-boundary-add is-start nodrag nopan","aria-label":n("buildCanvas.actions.addFirst"),title:n("buildCanvas.actions.addFirst"),onClick:f=>{f.stopPropagation(),i.onInsert(e.path,0)},children:a.jsx(ec,{})}),a.jsx("button",{type:"button",className:"abc-group-boundary-add is-end nodrag nopan","aria-label":n("buildCanvas.actions.addLast"),title:n("buildCanvas.actions.addLast"),onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:a.jsx(ec,{})})]}),i&&e.path!==void 0&&u>0&&c==="parallel"&&a.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-bottom nodrag nopan",onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:[a.jsx(ec,{}),a.jsx("span",{children:d})]}),i&&e.path!==void 0&&u===0&&a.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-empty nodrag nopan",onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:[a.jsx(ec,{}),a.jsx("span",{children:d})]}),i&&e.path!==void 0&&e.path.length>0&&a.jsx("button",{type:"button",className:"abc-node-delete nodrag nopan","aria-label":n("buildCanvas.actions.deleteNamed",{name:e.title}),title:n("buildCanvas.actions.deleteNode"),onClick:f=>{f.stopPropagation(),i==null||i.onDelete(e.path)},children:a.jsx(Yg,{})}),a.jsx(Dc,{type:"source",position:o,className:"abc-handle"}),e.containedIn==="loop"&&a.jsxs(a.Fragment,{children:[a.jsx(Dc,{id:"loop-target",type:"target",position:l,className:"abc-handle abc-loop-handle"}),a.jsx(Dc,{id:"loop-source",type:"source",position:l,className:"abc-handle abc-loop-handle"})]})]})}function VGt({data:e}){const t=p.useContext(jL);return a.jsxs("div",{className:"abc-terminal",children:[a.jsx(Dc,{type:"target",position:t==="vertical"?vn.Top:vn.Left,className:"abc-handle"}),a.jsx("span",{children:e.title}),a.jsx(Dc,{type:"source",position:t==="vertical"?vn.Bottom:vn.Right,className:"abc-handle"})]})}const HGt={agent:QGt,group:zGt,terminal:VGt},qGt={insertStep:UGt};function WGt({draft:e,selectedPath:t,onSelect:n,onAdd:i,onInsert:r,onDelete:s,readOnly:o=!1,interactivePreview:l=!1,direction:c="horizontal"}){const{t:u}=_e("create"),d=p.useMemo(()=>Loe(e,c,o,u),[]),[f,h,m]=Pqt(d.nodes),[g,b,v]=Dqt(d.edges),y=Lqt(),w=p.useRef(`${c}:${o?"readonly":"editable"}:${Moe(e)}`),x=p.useRef(null),{fitView:k}=EL(),S=p.useMemo(()=>Loe(e,c,o,u),[c,e,o,u]),[O,A]=p.useState(()=>window.matchMedia("(max-width: 860px)").matches),E=p.useMemo(()=>o?{padding:.16,minZoom:.05,maxZoom:.9}:O?{padding:.08,minZoom:.35,maxZoom:.9}:{padding:.14,minZoom:.42,maxZoom:1.1},[O,o]),j=p.useCallback((R=0)=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{const C=x.current;if(C&&(C.clientWidth===0||C.clientHeight===0)&&R<8){j(R+1);return}k(E)})})},[E,k]);p.useEffect(()=>{const R=window.matchMedia("(max-width: 860px)"),C=N=>A(N.matches);return R.addEventListener("change",C),()=>R.removeEventListener("change",C)},[]),p.useEffect(()=>{const R=`${c}:${o?"readonly":"editable"}:${Moe(e)}`,C=R!==w.current;w.current=R,b(S.edges),h(N=>{const P=new Map(N.map(I=>[I.id,I]));return S.nodes.map(I=>{const D=P.get(I.id);return{...I,measured:!C&&D&&D.type===I.type?D.measured:void 0,position:!C&&D?D.position:I.position,selected:I.data.kind==="agent"&&!!I.data.path&&FGt(I.data.path,t)}})}),C&&j()},[S,e,j,t,b,h]),p.useEffect(()=>{j()},[O,j]),p.useEffect(()=>{y&&j()},[S,j,y]),p.useEffect(()=>{if(!o||!x.current)return;const R=new ResizeObserver(()=>j());return R.observe(x.current),j(),()=>R.disconnect()},[j,o]);const T=p.useMemo(()=>o?null:{onAdd:i,onInsert:r,onDelete:s},[i,s,r,o]);return a.jsx(jL.Provider,{value:c,children:a.jsx(_L.Provider,{value:T,children:a.jsx("section",{className:`abc-root is-${c}${o?" is-readonly":""}`,"aria-label":u(o?"buildCanvas.readOnlyLabel":"buildCanvas.label"),children:a.jsx("div",{ref:x,className:"abc-canvas",children:a.jsxs(Nqt,{nodes:f,edges:g,nodeTypes:HGt,edgeTypes:qGt,onNodesChange:m,onEdgesChange:v,onNodeClick:(R,C)=>{!o&&C.data.kind==="agent"&&C.data.path&&n(C.data.path)},nodesDraggable:!o,nodesConnectable:!1,nodesFocusable:!o,elementsSelectable:!o,edgesFocusable:!1,edgesReconnectable:!1,panOnDrag:!o||l,zoomOnDoubleClick:l,zoomOnPinch:!o||l,zoomOnScroll:!o||l,fitView:!0,fitViewOptions:E,onInit:()=>j(),minZoom:o?.05:.35,maxZoom:1.6,proOptions:{hideAttribution:!0},ariaLabelConfig:{"controls.ariaLabel":u("buildCanvas.controls.ariaLabel"),"controls.zoomIn.ariaLabel":u("buildCanvas.controls.zoomIn"),"controls.zoomOut.ariaLabel":u("buildCanvas.controls.zoomOut"),"controls.fitView.ariaLabel":u("buildCanvas.controls.fitView")},children:[a.jsx(Qqt,{gap:20,size:1.2,color:"hsl(34 20% 82%)"}),(!o||l)&&a.jsx(Gqt,{showInteractive:!1}),LGt]})})})})})}function RP(e){return a.jsx(ABe,{children:a.jsx(WGt,{...e})})}function KGt(e){return[{id:"case-1",itemKey:"case-1",kind:"good",input:e("agentWorkspace.defaultCases.weeklyFeedback.input"),output:e("agentWorkspace.defaultCases.weeklyFeedback.output"),referenceOutput:e("agentWorkspace.defaultCases.weeklyFeedback.output"),comment:"",agentName:e("agentWorkspace.defaultCases.agentName"),sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T09:12:00+08:00",evaluationSetId:"",evaluationSetName:e("agentWorkspace.defaultCases.goodSetName"),workspaceId:"",tag:e("agentWorkspace.defaultCases.weeklyFeedback.tag"),source:"auto",score:.92,reason:e("agentWorkspace.defaultCases.weeklyFeedback.reason")},{id:"case-2",itemKey:"case-2",kind:"good",input:e("agentWorkspace.defaultCases.research.input"),output:e("agentWorkspace.defaultCases.research.output"),referenceOutput:e("agentWorkspace.defaultCases.research.output"),comment:"",agentName:e("agentWorkspace.defaultCases.agentName"),sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T08:47:00+08:00",evaluationSetId:"",evaluationSetName:e("agentWorkspace.defaultCases.goodSetName"),workspaceId:"",tag:e("agentWorkspace.defaultCases.research.tag"),source:"user"},{id:"case-3",itemKey:"case-3",kind:"bad",input:e("agentWorkspace.defaultCases.uncertainConclusion.input"),output:e("agentWorkspace.defaultCases.uncertainConclusion.output"),referenceOutput:"",comment:"",agentName:e("agentWorkspace.defaultCases.agentName"),sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T07:35:00+08:00",evaluationSetId:"",evaluationSetName:e("agentWorkspace.defaultCases.badSetName"),workspaceId:"",tag:e("agentWorkspace.defaultCases.uncertainConclusion.tag"),source:"auto",score:.28,reason:e("agentWorkspace.defaultCases.uncertainConclusion.reason")},{id:"case-4",itemKey:"case-4",kind:"bad",input:e("agentWorkspace.defaultCases.repeatedTool.input"),output:e("agentWorkspace.defaultCases.repeatedTool.output"),referenceOutput:"",comment:"",agentName:e("agentWorkspace.defaultCases.agentName"),sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T06:58:00+08:00",evaluationSetId:"",evaluationSetName:e("agentWorkspace.defaultCases.badSetName"),workspaceId:"",tag:e("agentWorkspace.defaultCases.repeatedTool.tag"),source:"user"}]}const GGt=[{id:"eval-regression",name:"核心能力回归",agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量","工具调用"],concurrency:"4",history:[{id:"run-1",createdAt:"今天 10:32",score:88,status:"completed"},{id:"run-2",createdAt:"昨天 16:08",score:84,status:"completed"}]},{id:"eval-safety",name:"安全与幻觉检查",agentIds:[],caseSet:"安全边界集",evaluator:"事实一致性评估器",metrics:["事实准确性","拒答合理性"],concurrency:"2",history:[{id:"run-3",createdAt:"7 月 25 日 14:20",score:91,status:"completed"}]}],XGt={核心能力回归:"agentWorkspace.evaluationDefaults.coreRegression",安全与幻觉检查:"agentWorkspace.evaluationDefaults.safetyCheck",核心回归集:"agentWorkspace.evaluationDefaults.coreSet",安全边界集:"agentWorkspace.evaluationDefaults.safetySet",工具调用集:"agentWorkspace.evaluationDefaults.toolSet",综合质量评估器:"agentWorkspace.evaluationDefaults.qualityEvaluator",事实一致性评估器:"agentWorkspace.evaluationDefaults.factualEvaluator",工具调用评估器:"agentWorkspace.evaluationDefaults.toolEvaluator",回答质量:"agentWorkspace.evaluationDefaults.responseQuality",事实准确性:"agentWorkspace.evaluationDefaults.factualAccuracy",工具调用:"agentWorkspace.evaluationDefaults.toolUse",响应效率:"agentWorkspace.evaluationDefaults.responseEfficiency","今天 10:32":"agentWorkspace.evaluationDefaults.todayTime","昨天 16:08":"agentWorkspace.evaluationDefaults.yesterdayTime","7 月 25 日 14:20":"agentWorkspace.evaluationDefaults.julyTime",刚刚:"agentWorkspace.evaluationDefaults.justNow"};function TS(e,t){const n=XGt[e];return n?t(n):e}const YGt=["basic","profileConfig","sessionConfig","usage","diagnostics","evaluations","optimizations","integrations","versions"],ZGt=20;function r9e(e,t,n){const i=Date.parse(e);return Number.isNaN(i)?n("agentWorkspace.notProvided"):new Intl.DateTimeFormat(t,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).format(i)}const LO=[{id:"api-server",label:"API Server"},{id:"a2a",label:"A2A"}];function s9e(e){if(!e||typeof e!="object")return"";const t=e.id;return typeof t=="string"?t:""}function mx(e){var t;return s9e((t=e==null?void 0:e.effectiveRefs)==null?void 0:t.model)}function $oe(e,t){var r;const n=(r=e==null?void 0:e.overrides)==null?void 0:r[t];if(!n||typeof n!="object")return"";const i=n.mode;return i==="replace"||i==="clear"||i==="inherit"?i:""}function a9e(e){var n;const t=(n=e==null?void 0:e.effectiveRefs)==null?void 0:n.mcpServers;return Array.isArray(t)?t.map(s9e).filter(Boolean):[]}function JGt(e,t){switch(e){case"active_operation":return t("agentWorkspace.mpaDeleteBlockerActiveOperation");case"active_sessions":return t("agentWorkspace.mpaDeleteBlockerActiveSessions");case"binding_ambiguous":return t("agentWorkspace.mpaDeleteBlockerBindingAmbiguous");case"runtime_missing":return t("agentWorkspace.mpaDeleteBlockerRuntimeMissing");case"orphan_runtime":return t("agentWorkspace.mpaDeleteBlockerOrphanRuntime");default:return e}}function eXt(e,t){switch(e){case"runtime_legacy_auth_unsupported":return t("agentWorkspace.mpaRuntimeLegacyAuthUnsupported");case"profile_not_found":return t("agentWorkspace.mpaRuntimeOrphan");case"binding_ambiguous":return t("agentWorkspace.mpaRuntimeBindingAmbiguous");case"runtime_missing":return t("agentWorkspace.mpaRuntimeMissing");default:return e??""}}function tXt({preview:e,t}){var i,r;const n=e.blockers.map(s=>JGt(s,t));return a.jsxs("div",{className:"aw-mpa-delete-preview",children:[a.jsx("p",{children:t("agentWorkspace.mpaDeletePreviewSummary")}),a.jsxs("dl",{className:"aw-mpa-delete-preview__stats",children:[a.jsxs("div",{children:[a.jsx("dt",{children:t("agentWorkspace.mpaDeletePreviewSessions")}),a.jsx("dd",{children:e.sessionCounts.total})]}),a.jsxs("div",{children:[a.jsx("dt",{children:t("agentWorkspace.mpaDeletePreviewActiveSessions")}),a.jsx("dd",{children:e.sessionCounts.active})]}),a.jsxs("div",{children:[a.jsx("dt",{children:t("agentWorkspace.mpaDeletePreviewIdleSessions")}),a.jsx("dd",{children:e.sessionCounts.idle})]})]}),n.length>0?a.jsxs("div",{className:"aw-mpa-delete-preview__blockers",role:"status",children:[a.jsx("strong",{children:t("agentWorkspace.mpaDeleteBlocked")}),a.jsx("ul",{children:n.map(s=>a.jsx("li",{children:s},s))})]}):a.jsx("ol",{className:"aw-mpa-delete-preview__plan",children:e.cleanupPlan.map(s=>a.jsxs("li",{children:[t(`agentWorkspace.mpaDeleteStage.${s.stage}`,{count:s.count}),s.resourceId&&a.jsxs("span",{children:[" (",s.resourceId,")"]})]},s.stage))}),!!((i=e.retainedResources)!=null&&i.length)&&a.jsxs("div",{children:[a.jsx("strong",{children:t("agentWorkspace.mpaDeleteRetained")}),a.jsx("ul",{children:(r=e.retainedResources)==null?void 0:r.map(s=>a.jsxs("li",{children:[s.resourceId," — ",t(`agentWorkspace.mpaDeleteRetainedReason.${s.reason}`,{defaultValue:s.reason})]},`${s.stage}:${s.resourceId}`))})]})]})}function c6(e,t){return e instanceof rw&&e.status===412?t:e instanceof Error?e.message:String(e)}function nXt(e){return a9e(e).length}function Foe(e,t){const n=a9e(e);return n.length?n.join(", "):t("agentWorkspace.none")}function Boe(e,t){var n;return!!((n=e==null?void 0:e.overrides)!=null&&n[t])}function iXt(e,t,n){return`mpa-session-profile-upgrade:${e}:${t}:${n}`}function u6(e,t){return e?`${e.replace(/\/+$/,"")}${t}`:""}function rXt(e,t){const n=e.trim();if(!n||!t)return n;try{const i=new URL(n),r=i.hostname.replace(/^\[|\]$/g,"").toLowerCase();if(!["localhost","127.0.0.1","::1"].includes(r))return n;const s=new URL(t);return i.protocol=s.protocol,i.hostname=s.hostname,i.port=s.port,i.toString()}catch{return n}}function Uoe(e,t){return e==="key_auth"?"API Key":e==="custom_jwt"?"OAuth / JWT":t(e==="none"?"agentWorkspace.noAuthentication":"agentWorkspace.notAvailable")}function Qoe(e,t){return t(e==="published"?"agentWorkspace.githubStatus.published":e==="publishing"?"agentWorkspace.githubStatus.publishing":e==="failed"?"agentWorkspace.githubStatus.failed":e==="pending"?"agentWorkspace.githubStatus.pending":"agentWorkspace.githubStatus.unknown")}function sXt(e,t){return e.changeType==="rollback"?t("agentWorkspace.rollbackEvent"):e.version}function q7(e){return JSON.stringify(e)}function o9e(e){return e==="key_auth"?`API_KEY = "" HEADERS = {"Authorization": f"Bearer {API_KEY}"}`:e==="custom_jwt"?`ACCESS_TOKEN = "" HEADERS = {"Authorization": f"Bearer {ACCESS_TOKEN}"}`:e==="none"?"HEADERS = {}":`AUTH_TOKEN = "" -HEADERS = {"Authorization": f"Bearer {AUTH_TOKEN}"}`}function sXt(e,t,n){const i=e.replace(/\/+$/,"");return`\`\`\`python +HEADERS = {"Authorization": f"Bearer {AUTH_TOKEN}"}`}function aXt(e,t,n){const i=e.replace(/\/+$/,"");return`\`\`\`python import uuid import requests @@ -789,7 +789,7 @@ BASE_URL = ${q7(i)} APP_NAME = ${q7(t)} USER_ID = "demo-user" SESSION_ID = str(uuid.uuid4()) -${a9e(n)} +${o9e(n)} session_response = requests.post( f"{BASE_URL}/apps/{APP_NAME}/users/{USER_ID}/sessions/{SESSION_ID}", @@ -819,13 +819,13 @@ with requests.post( for line in response.iter_lines(): if line: print(line.decode("utf-8")) -\`\`\``}function aXt(e,t){return`\`\`\`python +\`\`\``}function oXt(e,t){return`\`\`\`python import uuid import requests AGENT_URL = ${q7(e)} -${a9e(t)} +${o9e(t)} response = requests.post( AGENT_URL, @@ -846,23 +846,23 @@ response = requests.post( ) response.raise_for_status() print(response.json()) -\`\`\``}function oXt({visible:e}){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M2.8 12s3.3-5.4 9.2-5.4 9.2 5.4 9.2 5.4-3.3 5.4-9.2 5.4S2.8 12 2.8 12Z"}),a.jsx("circle",{cx:"12",cy:"12",r:"2.4"}),!e&&a.jsx("path",{d:"m4.2 4.2 15.6 15.6"})]})}function zoe({available:e,authType:t,value:n,visible:i,loading:r,error:s,onToggle:o}){const{t:l}=_e("ui");return e?t==="none"?l("agentWorkspace.noApiKeyRequired"):t==="custom_jwt"?l("agentWorkspace.usesOauthJwt"):t!=="key_auth"?l("agentWorkspace.notAvailable"):a.jsxs("span",{className:"aw-integration-secret",children:[a.jsx("span",{className:"aw-integration-secret-value","aria-live":"polite",children:i&&n?n:"****"}),a.jsx("button",{type:"button",className:"aw-integration-secret-toggle","aria-label":l(i?"agentWorkspace.hideApiKey":"agentWorkspace.showApiKey"),title:l(i?"agentWorkspace.hideApiKey":"agentWorkspace.showApiKey"),disabled:r,onClick:o,children:r?a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}):a.jsx(oXt,{visible:i})}),s&&a.jsx("span",{className:"aw-integration-secret-error",role:"alert",children:s})]}):l("agentWorkspace.notAvailable")}function Voe({protocol:e,title:t,available:n,fields:i,example:r}){const{t:s}=_e("ui");return a.jsxs("section",{className:`aw-integration-panel${n&&r?" has-example":""}`,id:`integration-${e}-panel`,role:"tabpanel","aria-labelledby":`integration-${e}-tab`,children:[a.jsx("header",{children:a.jsx("h3",{children:t})}),a.jsx("dl",{children:i.map(o=>a.jsxs("div",{children:[a.jsx("dt",{children:o.label}),a.jsx("dd",{children:o.value||s("agentWorkspace.notAvailable")})]},o.label))}),n&&r&&a.jsxs("section",{className:"aw-integration-example",children:[a.jsx("h4",{children:s("agentWorkspace.pythonExample")}),a.jsx(Nd,{text:r,className:"aw-integration-example-code",allowRawHtml:!1})]})]})}function K0(e,t){const n=(e??[]).flatMap(i=>{const r=i.name??i.id??i.skillId??i.source;return typeof r=="string"&&r.trim()?[r.trim()]:[]});return n.length?n.join(", "):t}function W7(e){return Array.isArray(e)?`[${e.map(W7).join(",")}]`:e&&typeof e=="object"?`{${Object.entries(e).filter(([,n])=>n!==void 0).sort(([n],[i])=>n.localeCompare(i)).map(([n,i])=>`${JSON.stringify(n)}:${W7(i)}`).join(",")}}`:JSON.stringify(e)}async function lXt(e,t,n){const i=new TextEncoder().encode(W7(n)),r=await crypto.subtle.digest("SHA-256",i),s=Array.from(new Uint8Array(r),o=>o.toString(16).padStart(2,"0")).join("");return`mpa-profile:${e}:${t}:${s}`}function cXt({profile:e,profileStatus:t,runtimeReady:n,disabledReason:i,saving:r,error:s,notice:o,onApply:l,onEditProfile:c,onRefresh:u}){var m;const{t:d}=_e("ui"),f=(t==null?void 0:t.status)==="applied",h=n&&!r;return a.jsxs("section",{className:"aw-session-config aw-profile-config","aria-busy":r,children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:d("agentWorkspace.profileConfigTitle")}),a.jsx("p",{children:d("agentWorkspace.profileConfigDescription")})]}),i?a.jsx("div",{className:"aw-session-config-state",children:i}):a.jsxs(a.Fragment,{children:[s&&a.jsxs("div",{className:"aw-session-config-state is-error",role:"alert",children:[a.jsx("span",{children:s}),a.jsx("button",{type:"button",onClick:u,disabled:r,children:d("common.retry")})]}),o&&!s&&a.jsx("div",{className:"aw-session-config-notice",role:"status",children:o}),a.jsxs("div",{className:"aw-session-config-actions",children:[a.jsx("button",{type:"button",onClick:c,disabled:r,children:d("agentWorkspace.editProfile")}),a.jsx("button",{type:"button",onClick:u,disabled:r,children:d("common.refresh")})]}),a.jsxs("dl",{className:"aw-session-config-grid",children:[a.jsxs("div",{children:[a.jsx("dt",{children:d("agentWorkspace.profileStatus")}),a.jsx("dd",{children:d(f?"agentWorkspace.profileApplied":"agentWorkspace.profileNotApplied")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:d("agentWorkspace.latestProfileRevision")}),a.jsx("dd",{children:(t==null?void 0:t.profileRevision)??d("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:d("agentWorkspace.modelId")}),a.jsx("dd",{children:String(((m=e.model)==null?void 0:m.id)||d("agentWorkspace.notAvailable"))})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"ETag"}),a.jsx("dd",{children:(t==null?void 0:t.etag)||d("agentWorkspace.notAvailable")})]})]}),!f&&a.jsxs("div",{className:"aw-session-config-upgrade",role:"status",children:[a.jsx("span",{children:d("agentWorkspace.profileNotAppliedDescription")}),a.jsx("button",{type:"button",onClick:l,disabled:!h,children:d(r?"agentWorkspace.profileApplying":"agentWorkspace.applyProfile")})]}),f&&a.jsx("div",{className:"aw-session-config-actions",children:a.jsx("button",{type:"button",onClick:l,disabled:!h,children:d(r?"agentWorkspace.profileApplying":"agentWorkspace.reapplyProfile")})}),a.jsx("div",{className:"aw-session-config-card",children:a.jsxs("div",{children:[a.jsx("h4",{children:d("agentWorkspace.profilePrompt")}),a.jsx("p",{children:e.system||d("agentWorkspace.notAvailable")})]})}),a.jsxs("div",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:d("agentWorkspace.profileResources")}),a.jsx("p",{children:d("agentWorkspace.profileResourceSummary",{tools:e.tools.length,skills:e.skills.length,mcp:e.mcpServers.length})})]}),a.jsxs("div",{className:"aw-profile-config-list",children:[a.jsxs("span",{title:K0(e.tools,d("agentWorkspace.notAvailable")),children:[d("agentSelector.tools"),": ",K0(e.tools,d("agentWorkspace.notAvailable"))]}),a.jsxs("span",{title:K0(e.skills,d("agentWorkspace.notAvailable")),children:[d("agentSelector.skills"),": ",K0(e.skills,d("agentWorkspace.notAvailable"))]}),a.jsxs("span",{title:K0(e.mcpServers,d("agentWorkspace.notAvailable")),children:["MCP: ",K0(e.mcpServers,d("agentWorkspace.notAvailable"))]})]})]})]})]})}function uXt({config:e,profileStatus:t,loadable:n,disabledReason:i,loading:r,saving:s,upgrading:o,error:l,notice:c,modelValue:u,modelDirty:d,profileUpgradeAvailable:f,onModelChange:h,onSaveModel:m,onInheritModel:g,onClearMcp:b,onInheritMcp:v,onUpgradeProfile:y,onRefresh:w}){const{t:x}=_e("ui"),k=r||s||o,S=$oe(e,"model"),O=$oe(e,"mcpServers"),A=mx(e),E=(t==null?void 0:t.status)==="applied"?t.profileRevision:null;return a.jsxs("section",{className:"aw-session-config","aria-busy":k,children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:x("agentWorkspace.sessionConfigTitle")}),a.jsx("p",{children:x("agentWorkspace.sessionConfigDescription")})]}),n?r&&!e?a.jsxs("div",{className:"aw-session-config-state",role:"status",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsx("span",{children:x("agentWorkspace.loadingSessionConfig")})]}):a.jsxs(a.Fragment,{children:[l&&a.jsxs("div",{className:"aw-session-config-state is-error",role:"alert",children:[a.jsx("span",{children:l}),a.jsx("button",{type:"button",onClick:w,disabled:k,children:x("common.retry")})]}),c&&!l&&a.jsx("div",{className:"aw-session-config-notice",role:"status",children:c}),e&&a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"aw-session-config-grid",children:[a.jsxs("div",{children:[a.jsx("dt",{children:x("agentWorkspace.sessionConfigRevision")}),a.jsx("dd",{children:e.revision})]}),a.jsxs("div",{children:[a.jsx("dt",{children:x("agentWorkspace.sessionProfileRevision")}),a.jsx("dd",{children:e.profileRevision})]}),a.jsxs("div",{children:[a.jsx("dt",{children:x("agentWorkspace.latestProfileRevision")}),a.jsx("dd",{children:E??x("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"ETag"}),a.jsx("dd",{children:e.etag||x("agentWorkspace.notAvailable")})]})]}),f&&E!=null&&a.jsxs("div",{className:"aw-session-config-upgrade",role:"status",children:[a.jsx("span",{children:x("agentWorkspace.sessionProfileUpgradeAvailable",{current:e.profileRevision,target:E})}),a.jsx("button",{type:"button",onClick:y,disabled:k,children:x(o?"agentWorkspace.sessionProfileUpgrading":"agentWorkspace.upgradeSessionProfile")})]}),a.jsxs("div",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:x("agentWorkspace.sessionModelOverride")}),a.jsx("p",{children:x(S?`agentWorkspace.executionConfigMode.${S}`:"agentWorkspace.executionConfigMode.inherit")})]}),a.jsxs("label",{className:"aw-session-config-field",children:[a.jsx("span",{children:x("agentWorkspace.modelId")}),a.jsx("input",{type:"text",value:u,onChange:j=>h(j.currentTarget.value),placeholder:A||x("agentWorkspace.inheritProfileDefault"),disabled:k})]}),a.jsxs("div",{className:"aw-session-config-actions",children:[a.jsx("button",{type:"button",onClick:m,disabled:k||!d,children:x(s?"common.saving":"common.save")}),a.jsx("button",{type:"button",onClick:g,disabled:k||!Boe(e,"model"),children:x("agentWorkspace.inheritProfileDefault")})]})]}),a.jsxs("div",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:x("agentWorkspace.sessionMcpServers")}),a.jsx("p",{children:x(O?`agentWorkspace.executionConfigMode.${O}`:"agentWorkspace.executionConfigMode.inherit")})]}),a.jsxs("div",{className:"aw-session-config-value",children:[a.jsx("span",{children:x("agentWorkspace.mcpServerCount",{count:tXt(e)})}),a.jsx("small",{title:Foe(e,x),children:Foe(e,x)})]}),a.jsxs("div",{className:"aw-session-config-actions",children:[a.jsx("button",{type:"button",onClick:b,disabled:k||O==="clear",children:x("agentWorkspace.clearSessionMcp")}),a.jsx("button",{type:"button",onClick:v,disabled:k||!Boe(e,"mcpServers"),children:x("agentWorkspace.inheritProfileDefault")})]})]})]})]}):a.jsx("div",{className:"aw-session-config-state",children:i})]})}function Hoe(e,t){const n=e==null?void 0:e[t];return n==null||n===""?"":String(n)}function dXt(e,t){const n=e==null?void 0:e.worker;if(!n||typeof n!="object")return"";const i=n[t];return i==null||i===""?"":String(i)}function fXt(e,t){return typeof e!="number"||!Number.isFinite(e)?t("agentWorkspace.notAvailable"):`${Math.round(e)} ms`}function hXt({data:e,loadable:t,disabledReason:n,loading:i,error:r,onRefresh:s,locale:o}){const{t:l}=_e("ui"),c=(e==null?void 0:e.runs)??[],u=(e==null?void 0:e.trace)??null,d=c[0],f=(u==null?void 0:u.correlation)??{},h=[["mpaInstanceId",l("agentWorkspace.mpaInstanceId")],["profileRevision",l("agentWorkspace.sessionProfileRevision")],["executionConfigRevision",l("agentWorkspace.sessionConfigRevision")],["turnId",l("agentWorkspace.turnId")],["taskId",l("agentWorkspace.taskId")],["runtimeId","Runtime ID"],["runtimeVersion",l("systemInfo.currentVersion")]],m=[["kind",l("agentWorkspace.workerKind")],["sessionId",l("agentWorkspace.workerSession")],["turnId",l("agentWorkspace.workerTurn")],["profileId",l("agentWorkspace.workerProfile")],["profileVersion",l("agentWorkspace.workerProfileVersion")]];return a.jsxs("section",{className:"aw-mpa-diagnostics","aria-busy":i,children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:l("agentWorkspace.mpaDiagnosticsTitle")}),a.jsx("p",{children:l("agentWorkspace.mpaDiagnosticsDescription")})]}),t?i&&!e?a.jsxs("div",{className:"aw-session-config-state",role:"status",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsx("span",{children:l("agentWorkspace.loadingMpaDiagnostics")})]}):r?a.jsxs("div",{className:"aw-session-config-state is-error",role:"alert",children:[a.jsx("span",{children:r}),a.jsx("button",{type:"button",onClick:s,disabled:i,children:l("common.retry")})]}):d?a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"aw-session-config-grid",children:[a.jsxs("div",{children:[a.jsx("dt",{children:l("agentWorkspace.latestRun")}),a.jsx("dd",{children:d.invocationId})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("agentSelector.status")}),a.jsx("dd",{children:d.status})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("agentWorkspace.lastUsed")}),a.jsx("dd",{children:i9e(d.startedAt,o,l)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("agentWorkspace.stepCount")}),a.jsx("dd",{children:d.stepCount})]})]}),a.jsxs("section",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:l("agentWorkspace.traceCorrelation")}),a.jsx("p",{children:l("agentWorkspace.traceCorrelationDescription")})]}),a.jsxs("dl",{className:"aw-mpa-correlation",children:[h.map(([g,b])=>a.jsxs("div",{children:[a.jsx("dt",{children:b}),a.jsx("dd",{children:Hoe(f,g)||l("agentWorkspace.notAvailable")})]},g)),m.map(([g,b])=>a.jsxs("div",{children:[a.jsx("dt",{children:b}),a.jsx("dd",{children:dXt(f,g)||l("agentWorkspace.notAvailable")})]},`worker-${g}`))]})]}),a.jsxs("section",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:l("agentWorkspace.traceSteps")}),a.jsx("p",{children:l("agentWorkspace.traceStepsDescription")})]}),u!=null&&u.steps.length?a.jsx("div",{className:"aw-usage-table-wrap",children:a.jsxs("table",{className:"aw-usage-table aw-mpa-trace-table",children:[a.jsx("caption",{children:l("agentWorkspace.traceSteps")}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:l("agentWorkspace.step")}),a.jsx("th",{scope:"col",children:l("agentSelector.status")}),a.jsx("th",{scope:"col",children:l("agentWorkspace.duration")}),a.jsx("th",{scope:"col",children:l("agentWorkspace.turnId")})]})}),a.jsx("tbody",{children:u.steps.slice(0,20).map(g=>a.jsxs("tr",{children:[a.jsxs("td",{children:[a.jsx("strong",{children:g.title||g.kind}),a.jsx("small",{children:g.kind})]}),a.jsx("td",{children:g.status}),a.jsx("td",{children:fXt(g.durationMs,l)}),a.jsx("td",{children:Hoe(g.correlation,"turnId")||l("agentWorkspace.notAvailable")})]},g.stepId))})]})}):a.jsx("div",{className:"aw-session-config-value",children:a.jsx("span",{children:l("agentWorkspace.noTraceSteps")})})]})]}):a.jsx("div",{className:"aw-session-config-state",children:l("agentWorkspace.noMpaDiagnostics")}):a.jsx("div",{className:"aw-session-config-state",children:n})]})}function pXt(e,t,n){var i;return hH({appName:((i=e==null?void 0:e.appName)==null?void 0:i.trim())||t,name:e==null?void 0:e.name,description:e==null?void 0:e.description,type:e==null?void 0:e.type,model:e==null?void 0:e.model,tools:e==null?void 0:e.tools,skills:e==null?void 0:e.skills,graph:e==null?void 0:e.graph,draft:e==null?void 0:e.draft},n)}function o9e(e){return e?1+e.children.reduce((t,n)=>t+o9e(n),0):1}function l9e(e){return 1+e.subAgents.reduce((t,n)=>t+l9e(n),0)}function K7(e){if(!e)return 0;const t=Number(e);if(Number.isFinite(t))return t<1e12?t*1e3:t;const n=Date.parse(e);return Number.isFinite(n)?n:0}function mXt(e,t,n){const i=K7(e);return i?new Intl.DateTimeFormat(t,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(i)):n("agentWorkspace.unknownTime")}function gXt(e,t){return typeof e.score!="number"||!Number.isFinite(e.score)?"—":t("agentWorkspace.scoreValue",{score:Math.round(e.score*100)})}function bXt(e,t){return t(`agentWorkspace.priority.${e}`)}const yXt={agent_structure:"agentWorkspace.modules.agentStructure",prompt:"agentWorkspace.modules.prompt",tool:"agentWorkspace.modules.tool",knowledge:"agentWorkspace.modules.knowledge",memory:"agentWorkspace.modules.memory",workflow:"agentWorkspace.modules.workflow",other:"agentWorkspace.modules.other"};function vXt(e,t){var n;return e.module==="other"?((n=e.customModule)==null?void 0:n.trim())||t("agentWorkspace.modules.other"):t(yXt[e.module])}function xXt(e,t){return e.find(n=>n.kind===t)}function qoe(e,t){return e.items.map(n=>({...n,tag:t(n.kind==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")})).sort((n,i)=>K7(i.createdAt)-K7(n.createdAt))}function wXt(e){const t=n=>[n.name,n.description,n.agentType??"llm",n.modelName??"",n.tools??[],n.builtinTools??[],(n.customTools??[]).map(i=>i.name),(n.mcpTools??[]).map(i=>i.name),n.skills??[],(n.selectedSkills??[]).map(i=>i.name),(n.subAgents??[]).map(t)];return JSON.stringify(t(e))}function kXt(e){return[{phase:"prepare",label:e("agentWorkspace.deploymentSteps.prepare.label"),description:e("agentWorkspace.deploymentSteps.prepare.description")},{phase:"build",label:e("agentWorkspace.deploymentSteps.build.label"),description:e("agentWorkspace.deploymentSteps.build.description")},{phase:"deploy",label:e("agentWorkspace.deploymentSteps.deploy.label"),description:e("agentWorkspace.deploymentSteps.deploy.description")},{phase:"publish",label:e("agentWorkspace.deploymentSteps.publish.label"),description:e("agentWorkspace.deploymentSteps.publish.description")},{phase:"complete",label:e("agentWorkspace.deploymentSteps.complete.label"),description:e("agentWorkspace.deploymentSteps.complete.description")}]}function OXt(e,t){return{phase:"update",label:t("agentWorkspace.deploymentSteps.update.label"),description:t("agentWorkspace.deploymentSteps.update.description",e)}}function c9e(e,t){const n=kXt(t),i=[...n.slice(0,-1)];return e.instanceRange&&i.push(OXt(e.instanceRange,t)),e.createEvaluationSets&&i.push({phase:"evaluation",label:t("agentWorkspace.deploymentSteps.evaluation.label"),description:t("agentWorkspace.deploymentSteps.evaluation.description")}),e.mpaProfile&&(i.push({phase:"profile_applying",label:t("agentWorkspace.deploymentSteps.profileApplying.label"),description:t("agentWorkspace.deploymentSteps.profileApplying.description")}),e.mpaSmoke&&(i.push({phase:"smoke_running",label:t("agentWorkspace.deploymentSteps.smokeRunning.label"),description:t("agentWorkspace.deploymentSteps.smokeRunning.description")}),i.push({phase:"runnable",label:t("agentWorkspace.deploymentSteps.runnable.label"),description:t("agentWorkspace.deploymentSteps.runnable.description")}))),e.githubDelivery&&i.push({phase:"github",label:t("agentWorkspace.deploymentSteps.github.label"),description:t("agentWorkspace.deploymentSteps.github.description")}),i.push(n[n.length-1]),i}function u9e(e,t){const n=c9e(e,t);if(e.status==="success")return n.length-1;const i=e.phase??{准备部署:"prepare",构建镜像:"build",部署:"deploy",发布:"publish",创建评测集:"evaluation","应用 MPA Profile":"profile_applying","验证 MPA Runtime":"smoke_running","MPA Runtime 可运行":"runnable","挂载 GitHub 持续交付":"github",部署完成:"complete"}[e.label],r=n.findIndex(s=>s.phase===i);return r<0?0:r}function SXt(e,t){if(!e)return"";try{return new Intl.DateTimeFormat(t,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(new Date(e))}catch{return""}}function d9e({log:e,autoExpand:t,title:n,ariaLabel:i,copyLabel:r,defaultPendingMessage:s}){const{t:o,i18n:l}=_e("ui"),c=p.useRef(null),u=!!((e==null?void 0:e.status)!=="complete"&&t),[d,f]=p.useState(u),[h,m]=p.useState(!1),g=!!(e!=null&&e.text||e!=null&&e.error),b=(e==null?void 0:e.text)||(e==null?void 0:e.error)||"",v=b.split(` +\`\`\``}function lXt({visible:e}){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M2.8 12s3.3-5.4 9.2-5.4 9.2 5.4 9.2 5.4-3.3 5.4-9.2 5.4S2.8 12 2.8 12Z"}),a.jsx("circle",{cx:"12",cy:"12",r:"2.4"}),!e&&a.jsx("path",{d:"m4.2 4.2 15.6 15.6"})]})}function zoe({available:e,authType:t,value:n,visible:i,loading:r,error:s,onToggle:o}){const{t:l}=_e("ui");return e?t==="none"?l("agentWorkspace.noApiKeyRequired"):t==="custom_jwt"?l("agentWorkspace.usesOauthJwt"):t!=="key_auth"?l("agentWorkspace.notAvailable"):a.jsxs("span",{className:"aw-integration-secret",children:[a.jsx("span",{className:"aw-integration-secret-value","aria-live":"polite",children:i&&n?n:"****"}),a.jsx("button",{type:"button",className:"aw-integration-secret-toggle","aria-label":l(i?"agentWorkspace.hideApiKey":"agentWorkspace.showApiKey"),title:l(i?"agentWorkspace.hideApiKey":"agentWorkspace.showApiKey"),disabled:r,onClick:o,children:r?a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}):a.jsx(lXt,{visible:i})}),s&&a.jsx("span",{className:"aw-integration-secret-error",role:"alert",children:s})]}):l("agentWorkspace.notAvailable")}function Voe({protocol:e,title:t,available:n,fields:i,example:r}){const{t:s}=_e("ui");return a.jsxs("section",{className:`aw-integration-panel${n&&r?" has-example":""}`,id:`integration-${e}-panel`,role:"tabpanel","aria-labelledby":`integration-${e}-tab`,children:[a.jsx("header",{children:a.jsx("h3",{children:t})}),a.jsx("dl",{children:i.map(o=>a.jsxs("div",{children:[a.jsx("dt",{children:o.label}),a.jsx("dd",{children:o.value||s("agentWorkspace.notAvailable")})]},o.label))}),n&&r&&a.jsxs("section",{className:"aw-integration-example",children:[a.jsx("h4",{children:s("agentWorkspace.pythonExample")}),a.jsx(Nd,{text:r,className:"aw-integration-example-code",allowRawHtml:!1})]})]})}function K0(e,t){const n=(e??[]).flatMap(i=>{const r=i.name??i.id??i.skillId??i.source;return typeof r=="string"&&r.trim()?[r.trim()]:[]});return n.length?n.join(", "):t}function W7(e){return Array.isArray(e)?`[${e.map(W7).join(",")}]`:e&&typeof e=="object"?`{${Object.entries(e).filter(([,n])=>n!==void 0).sort(([n],[i])=>n.localeCompare(i)).map(([n,i])=>`${JSON.stringify(n)}:${W7(i)}`).join(",")}}`:JSON.stringify(e)}async function cXt(e,t,n){const i=new TextEncoder().encode(W7(n)),r=await crypto.subtle.digest("SHA-256",i),s=Array.from(new Uint8Array(r),o=>o.toString(16).padStart(2,"0")).join("");return`mpa-profile:${e}:${t}:${s}`}function uXt({profile:e,profileStatus:t,runtimeReady:n,disabledReason:i,saving:r,error:s,notice:o,onApply:l,onEditProfile:c,onRefresh:u}){var m;const{t:d}=_e("ui"),f=(t==null?void 0:t.status)==="applied",h=n&&!r;return a.jsxs("section",{className:"aw-session-config aw-profile-config","aria-busy":r,children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:d("agentWorkspace.profileConfigTitle")}),a.jsx("p",{children:d("agentWorkspace.profileConfigDescription")})]}),i?a.jsx("div",{className:"aw-session-config-state",children:i}):a.jsxs(a.Fragment,{children:[s&&a.jsxs("div",{className:"aw-session-config-state is-error",role:"alert",children:[a.jsx("span",{children:s}),a.jsx("button",{type:"button",onClick:u,disabled:r,children:d("common.retry")})]}),o&&!s&&a.jsx("div",{className:"aw-session-config-notice",role:"status",children:o}),a.jsxs("div",{className:"aw-session-config-actions",children:[a.jsx("button",{type:"button",onClick:c,disabled:r,children:d("agentWorkspace.editProfile")}),a.jsx("button",{type:"button",onClick:u,disabled:r,children:d("common.refresh")})]}),a.jsxs("dl",{className:"aw-session-config-grid",children:[a.jsxs("div",{children:[a.jsx("dt",{children:d("agentWorkspace.profileStatus")}),a.jsx("dd",{children:d(f?"agentWorkspace.profileApplied":"agentWorkspace.profileNotApplied")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:d("agentWorkspace.latestProfileRevision")}),a.jsx("dd",{children:(t==null?void 0:t.profileRevision)??d("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:d("agentWorkspace.modelId")}),a.jsx("dd",{children:String(((m=e.model)==null?void 0:m.id)||d("agentWorkspace.notAvailable"))})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"ETag"}),a.jsx("dd",{children:(t==null?void 0:t.etag)||d("agentWorkspace.notAvailable")})]})]}),!f&&a.jsxs("div",{className:"aw-session-config-upgrade",role:"status",children:[a.jsx("span",{children:d("agentWorkspace.profileNotAppliedDescription")}),a.jsx("button",{type:"button",onClick:l,disabled:!h,children:d(r?"agentWorkspace.profileApplying":"agentWorkspace.applyProfile")})]}),f&&a.jsx("div",{className:"aw-session-config-actions",children:a.jsx("button",{type:"button",onClick:l,disabled:!h,children:d(r?"agentWorkspace.profileApplying":"agentWorkspace.reapplyProfile")})}),a.jsx("div",{className:"aw-session-config-card",children:a.jsxs("div",{children:[a.jsx("h4",{children:d("agentWorkspace.profilePrompt")}),a.jsx("p",{children:e.system||d("agentWorkspace.notAvailable")})]})}),a.jsxs("div",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:d("agentWorkspace.profileResources")}),a.jsx("p",{children:d("agentWorkspace.profileResourceSummary",{tools:e.tools.length,skills:e.skills.length,mcp:e.mcpServers.length})})]}),a.jsxs("div",{className:"aw-profile-config-list",children:[a.jsxs("span",{title:K0(e.tools,d("agentWorkspace.notAvailable")),children:[d("agentSelector.tools"),": ",K0(e.tools,d("agentWorkspace.notAvailable"))]}),a.jsxs("span",{title:K0(e.skills,d("agentWorkspace.notAvailable")),children:[d("agentSelector.skills"),": ",K0(e.skills,d("agentWorkspace.notAvailable"))]}),a.jsxs("span",{title:K0(e.mcpServers,d("agentWorkspace.notAvailable")),children:["MCP: ",K0(e.mcpServers,d("agentWorkspace.notAvailable"))]})]})]})]})]})}function dXt({config:e,profileStatus:t,loadable:n,disabledReason:i,loading:r,saving:s,upgrading:o,error:l,notice:c,modelValue:u,modelDirty:d,profileUpgradeAvailable:f,onModelChange:h,onSaveModel:m,onInheritModel:g,onClearMcp:b,onInheritMcp:v,onUpgradeProfile:y,onRefresh:w}){const{t:x}=_e("ui"),k=r||s||o,S=$oe(e,"model"),O=$oe(e,"mcpServers"),A=mx(e),E=(t==null?void 0:t.status)==="applied"?t.profileRevision:null;return a.jsxs("section",{className:"aw-session-config","aria-busy":k,children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:x("agentWorkspace.sessionConfigTitle")}),a.jsx("p",{children:x("agentWorkspace.sessionConfigDescription")})]}),n?r&&!e?a.jsxs("div",{className:"aw-session-config-state",role:"status",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsx("span",{children:x("agentWorkspace.loadingSessionConfig")})]}):a.jsxs(a.Fragment,{children:[l&&a.jsxs("div",{className:"aw-session-config-state is-error",role:"alert",children:[a.jsx("span",{children:l}),a.jsx("button",{type:"button",onClick:w,disabled:k,children:x("common.retry")})]}),c&&!l&&a.jsx("div",{className:"aw-session-config-notice",role:"status",children:c}),e&&a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"aw-session-config-grid",children:[a.jsxs("div",{children:[a.jsx("dt",{children:x("agentWorkspace.sessionConfigRevision")}),a.jsx("dd",{children:e.revision})]}),a.jsxs("div",{children:[a.jsx("dt",{children:x("agentWorkspace.sessionProfileRevision")}),a.jsx("dd",{children:e.profileRevision})]}),a.jsxs("div",{children:[a.jsx("dt",{children:x("agentWorkspace.latestProfileRevision")}),a.jsx("dd",{children:E??x("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"ETag"}),a.jsx("dd",{children:e.etag||x("agentWorkspace.notAvailable")})]})]}),f&&E!=null&&a.jsxs("div",{className:"aw-session-config-upgrade",role:"status",children:[a.jsx("span",{children:x("agentWorkspace.sessionProfileUpgradeAvailable",{current:e.profileRevision,target:E})}),a.jsx("button",{type:"button",onClick:y,disabled:k,children:x(o?"agentWorkspace.sessionProfileUpgrading":"agentWorkspace.upgradeSessionProfile")})]}),a.jsxs("div",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:x("agentWorkspace.sessionModelOverride")}),a.jsx("p",{children:x(S?`agentWorkspace.executionConfigMode.${S}`:"agentWorkspace.executionConfigMode.inherit")})]}),a.jsxs("label",{className:"aw-session-config-field",children:[a.jsx("span",{children:x("agentWorkspace.modelId")}),a.jsx("input",{type:"text",value:u,onChange:j=>h(j.currentTarget.value),placeholder:A||x("agentWorkspace.inheritProfileDefault"),disabled:k})]}),a.jsxs("div",{className:"aw-session-config-actions",children:[a.jsx("button",{type:"button",onClick:m,disabled:k||!d,children:x(s?"common.saving":"common.save")}),a.jsx("button",{type:"button",onClick:g,disabled:k||!Boe(e,"model"),children:x("agentWorkspace.inheritProfileDefault")})]})]}),a.jsxs("div",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:x("agentWorkspace.sessionMcpServers")}),a.jsx("p",{children:x(O?`agentWorkspace.executionConfigMode.${O}`:"agentWorkspace.executionConfigMode.inherit")})]}),a.jsxs("div",{className:"aw-session-config-value",children:[a.jsx("span",{children:x("agentWorkspace.mcpServerCount",{count:nXt(e)})}),a.jsx("small",{title:Foe(e,x),children:Foe(e,x)})]}),a.jsxs("div",{className:"aw-session-config-actions",children:[a.jsx("button",{type:"button",onClick:b,disabled:k||O==="clear",children:x("agentWorkspace.clearSessionMcp")}),a.jsx("button",{type:"button",onClick:v,disabled:k||!Boe(e,"mcpServers"),children:x("agentWorkspace.inheritProfileDefault")})]})]})]})]}):a.jsx("div",{className:"aw-session-config-state",children:i})]})}function Hoe(e,t){const n=e==null?void 0:e[t];return n==null||n===""?"":String(n)}function fXt(e,t){const n=e==null?void 0:e.worker;if(!n||typeof n!="object")return"";const i=n[t];return i==null||i===""?"":String(i)}function hXt(e,t){return typeof e!="number"||!Number.isFinite(e)?t("agentWorkspace.notAvailable"):`${Math.round(e)} ms`}function pXt({data:e,loadable:t,disabledReason:n,loading:i,error:r,onRefresh:s,locale:o}){const{t:l}=_e("ui"),c=(e==null?void 0:e.runs)??[],u=(e==null?void 0:e.trace)??null,d=c[0],f=(u==null?void 0:u.correlation)??{},h=[["mpaInstanceId",l("agentWorkspace.mpaInstanceId")],["profileRevision",l("agentWorkspace.sessionProfileRevision")],["executionConfigRevision",l("agentWorkspace.sessionConfigRevision")],["turnId",l("agentWorkspace.turnId")],["taskId",l("agentWorkspace.taskId")],["runtimeId","Runtime ID"],["runtimeVersion",l("systemInfo.currentVersion")]],m=[["kind",l("agentWorkspace.workerKind")],["sessionId",l("agentWorkspace.workerSession")],["turnId",l("agentWorkspace.workerTurn")],["profileId",l("agentWorkspace.workerProfile")],["profileVersion",l("agentWorkspace.workerProfileVersion")]];return a.jsxs("section",{className:"aw-mpa-diagnostics","aria-busy":i,children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:l("agentWorkspace.mpaDiagnosticsTitle")}),a.jsx("p",{children:l("agentWorkspace.mpaDiagnosticsDescription")})]}),t?i&&!e?a.jsxs("div",{className:"aw-session-config-state",role:"status",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsx("span",{children:l("agentWorkspace.loadingMpaDiagnostics")})]}):r?a.jsxs("div",{className:"aw-session-config-state is-error",role:"alert",children:[a.jsx("span",{children:r}),a.jsx("button",{type:"button",onClick:s,disabled:i,children:l("common.retry")})]}):d?a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"aw-session-config-grid",children:[a.jsxs("div",{children:[a.jsx("dt",{children:l("agentWorkspace.latestRun")}),a.jsx("dd",{children:d.invocationId})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("agentSelector.status")}),a.jsx("dd",{children:d.status})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("agentWorkspace.lastUsed")}),a.jsx("dd",{children:r9e(d.startedAt,o,l)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("agentWorkspace.stepCount")}),a.jsx("dd",{children:d.stepCount})]})]}),a.jsxs("section",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:l("agentWorkspace.traceCorrelation")}),a.jsx("p",{children:l("agentWorkspace.traceCorrelationDescription")})]}),a.jsxs("dl",{className:"aw-mpa-correlation",children:[h.map(([g,b])=>a.jsxs("div",{children:[a.jsx("dt",{children:b}),a.jsx("dd",{children:Hoe(f,g)||l("agentWorkspace.notAvailable")})]},g)),m.map(([g,b])=>a.jsxs("div",{children:[a.jsx("dt",{children:b}),a.jsx("dd",{children:fXt(f,g)||l("agentWorkspace.notAvailable")})]},`worker-${g}`))]})]}),a.jsxs("section",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:l("agentWorkspace.traceSteps")}),a.jsx("p",{children:l("agentWorkspace.traceStepsDescription")})]}),u!=null&&u.steps.length?a.jsx("div",{className:"aw-usage-table-wrap",children:a.jsxs("table",{className:"aw-usage-table aw-mpa-trace-table",children:[a.jsx("caption",{children:l("agentWorkspace.traceSteps")}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:l("agentWorkspace.step")}),a.jsx("th",{scope:"col",children:l("agentSelector.status")}),a.jsx("th",{scope:"col",children:l("agentWorkspace.duration")}),a.jsx("th",{scope:"col",children:l("agentWorkspace.turnId")})]})}),a.jsx("tbody",{children:u.steps.slice(0,20).map(g=>a.jsxs("tr",{children:[a.jsxs("td",{children:[a.jsx("strong",{children:g.title||g.kind}),a.jsx("small",{children:g.kind})]}),a.jsx("td",{children:g.status}),a.jsx("td",{children:hXt(g.durationMs,l)}),a.jsx("td",{children:Hoe(g.correlation,"turnId")||l("agentWorkspace.notAvailable")})]},g.stepId))})]})}):a.jsx("div",{className:"aw-session-config-value",children:a.jsx("span",{children:l("agentWorkspace.noTraceSteps")})})]})]}):a.jsx("div",{className:"aw-session-config-state",children:l("agentWorkspace.noMpaDiagnostics")}):a.jsx("div",{className:"aw-session-config-state",children:n})]})}function mXt(e,t,n){var i;return hH({appName:((i=e==null?void 0:e.appName)==null?void 0:i.trim())||t,name:e==null?void 0:e.name,description:e==null?void 0:e.description,type:e==null?void 0:e.type,model:e==null?void 0:e.model,tools:e==null?void 0:e.tools,skills:e==null?void 0:e.skills,graph:e==null?void 0:e.graph,draft:e==null?void 0:e.draft},n)}function l9e(e){return e?1+e.children.reduce((t,n)=>t+l9e(n),0):1}function c9e(e){return 1+e.subAgents.reduce((t,n)=>t+c9e(n),0)}function K7(e){if(!e)return 0;const t=Number(e);if(Number.isFinite(t))return t<1e12?t*1e3:t;const n=Date.parse(e);return Number.isFinite(n)?n:0}function gXt(e,t,n){const i=K7(e);return i?new Intl.DateTimeFormat(t,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(i)):n("agentWorkspace.unknownTime")}function bXt(e,t){return typeof e.score!="number"||!Number.isFinite(e.score)?"—":t("agentWorkspace.scoreValue",{score:Math.round(e.score*100)})}function yXt(e,t){return t(`agentWorkspace.priority.${e}`)}const vXt={agent_structure:"agentWorkspace.modules.agentStructure",prompt:"agentWorkspace.modules.prompt",tool:"agentWorkspace.modules.tool",knowledge:"agentWorkspace.modules.knowledge",memory:"agentWorkspace.modules.memory",workflow:"agentWorkspace.modules.workflow",other:"agentWorkspace.modules.other"};function xXt(e,t){var n;return e.module==="other"?((n=e.customModule)==null?void 0:n.trim())||t("agentWorkspace.modules.other"):t(vXt[e.module])}function wXt(e,t){return e.find(n=>n.kind===t)}function qoe(e,t){return e.items.map(n=>({...n,tag:t(n.kind==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")})).sort((n,i)=>K7(i.createdAt)-K7(n.createdAt))}function kXt(e){const t=n=>[n.name,n.description,n.agentType??"llm",n.modelName??"",n.tools??[],n.builtinTools??[],(n.customTools??[]).map(i=>i.name),(n.mcpTools??[]).map(i=>i.name),n.skills??[],(n.selectedSkills??[]).map(i=>i.name),(n.subAgents??[]).map(t)];return JSON.stringify(t(e))}function OXt(e){return[{phase:"prepare",label:e("agentWorkspace.deploymentSteps.prepare.label"),description:e("agentWorkspace.deploymentSteps.prepare.description")},{phase:"build",label:e("agentWorkspace.deploymentSteps.build.label"),description:e("agentWorkspace.deploymentSteps.build.description")},{phase:"deploy",label:e("agentWorkspace.deploymentSteps.deploy.label"),description:e("agentWorkspace.deploymentSteps.deploy.description")},{phase:"publish",label:e("agentWorkspace.deploymentSteps.publish.label"),description:e("agentWorkspace.deploymentSteps.publish.description")},{phase:"complete",label:e("agentWorkspace.deploymentSteps.complete.label"),description:e("agentWorkspace.deploymentSteps.complete.description")}]}function SXt(e,t){return{phase:"update",label:t("agentWorkspace.deploymentSteps.update.label"),description:t("agentWorkspace.deploymentSteps.update.description",e)}}function u9e(e,t){const n=OXt(t),i=[...n.slice(0,-1)];return e.instanceRange&&i.push(SXt(e.instanceRange,t)),e.createEvaluationSets&&i.push({phase:"evaluation",label:t("agentWorkspace.deploymentSteps.evaluation.label"),description:t("agentWorkspace.deploymentSteps.evaluation.description")}),e.mpaProfile&&(i.push({phase:"profile_applying",label:t("agentWorkspace.deploymentSteps.profileApplying.label"),description:t("agentWorkspace.deploymentSteps.profileApplying.description")}),e.mpaSmoke&&(i.push({phase:"smoke_running",label:t("agentWorkspace.deploymentSteps.smokeRunning.label"),description:t("agentWorkspace.deploymentSteps.smokeRunning.description")}),i.push({phase:"runnable",label:t("agentWorkspace.deploymentSteps.runnable.label"),description:t("agentWorkspace.deploymentSteps.runnable.description")}))),e.githubDelivery&&i.push({phase:"github",label:t("agentWorkspace.deploymentSteps.github.label"),description:t("agentWorkspace.deploymentSteps.github.description")}),i.push(n[n.length-1]),i}function d9e(e,t){const n=u9e(e,t);if(e.status==="success")return n.length-1;const i=e.phase??{准备部署:"prepare",构建镜像:"build",部署:"deploy",发布:"publish",创建评测集:"evaluation","应用 MPA Profile":"profile_applying","验证 MPA Runtime":"smoke_running","MPA Runtime 可运行":"runnable","挂载 GitHub 持续交付":"github",部署完成:"complete"}[e.label],r=n.findIndex(s=>s.phase===i);return r<0?0:r}function EXt(e,t){if(!e)return"";try{return new Intl.DateTimeFormat(t,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(new Date(e))}catch{return""}}function f9e({log:e,autoExpand:t,title:n,ariaLabel:i,copyLabel:r,defaultPendingMessage:s}){const{t:o,i18n:l}=_e("ui"),c=p.useRef(null),u=!!((e==null?void 0:e.status)!=="complete"&&t),[d,f]=p.useState(u),[h,m]=p.useState(!1),g=!!(e!=null&&e.text||e!=null&&e.error),b=(e==null?void 0:e.text)||(e==null?void 0:e.error)||"",v=b.split(` `),y=d?b:v.slice(-36).join(` -`),w=(e==null?void 0:e.pendingMessage)||s;if(p.useEffect(()=>{e&&f(u)},[e==null?void 0:e.status,u]),p.useEffect(()=>{if(!d||!g)return;const E=c.current;E&&(E.scrollTop=E.scrollHeight)},[d,g,y]),!e||!e.text&&e.status!=="error"&&!e.pendingMessage)return null;const x=SXt(e.updatedAt,l.resolvedLanguage??l.language),k=e.status==="complete"?o("agentWorkspace.logStatus.synced"):e.status==="error"?o("agentWorkspace.logStatus.failed"):o("agentWorkspace.logStatus.syncing"),S=e.omittedEarly?o("agentWorkspace.logStatus.earlyOmitted"):e.snapshotTruncated?o("agentWorkspace.logStatus.recentOnly"):e.truncated?o("agentWorkspace.logStatus.partiallyOmitted"):"",O=[k,e.lineCount?o("agentWorkspace.logLines",{count:e.lineCount}):"",S,x].filter(Boolean).join(" · ");async function A(){try{await navigator.clipboard.writeText(b),m(!0),window.setTimeout(()=>m(!1),1500)}catch{m(!1)}}return a.jsxs("section",{className:`aw-deploy-log is-${e.status}${d?"":" is-collapsed"}`,"aria-label":i,children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("strong",{children:n}),a.jsx("span",{children:O})]}),a.jsxs("div",{className:"aw-deploy-log-actions",children:[g&&a.jsx("button",{type:"button",onClick:()=>f(E=>!E),children:o(d?"common.collapse":"common.expand")}),g&&a.jsxs("button",{type:"button",onClick:()=>void A(),"aria-label":h?o("agentWorkspace.copiedLabel",{label:r}):o("agentWorkspace.copyLabel",{label:r}),title:h?o("agentWorkspace.copied"):o("agentWorkspace.copyLabel",{label:r}),children:[h?a.jsx(Of,{"aria-hidden":!0}):a.jsx(ZD,{"aria-hidden":!0}),a.jsx("span",{children:o(h?"agentWorkspace.copied":"agentWorkspace.copy")})]})]})]}),d&&(g?a.jsx("pre",{ref:c,children:y}):a.jsx("div",{className:"aw-deploy-log-empty",children:w}))]})}function EXt({task:e}){var n;const{t}=_e("ui");return a.jsx(d9e,{log:e.buildLog,autoExpand:((n=e.buildLog)==null?void 0:n.status)!=="complete"&&(e.status==="running"||e.status==="error")&&u9e(e,t)===1,title:t("agentWorkspace.buildLog"),ariaLabel:t("agentWorkspace.buildLog"),copyLabel:t("agentWorkspace.buildLog"),defaultPendingMessage:t("agentWorkspace.waitingBuildLog")})}function CXt({task:e}){var n;const{t}=_e("ui");return a.jsx(d9e,{log:e.githubLog,autoExpand:((n=e.githubLog)==null?void 0:n.status)!=="complete"&&(e.status==="running"||e.status==="error")&&e.phase==="github",title:t("agentWorkspace.githubMountLog"),ariaLabel:t("agentWorkspace.githubDeliveryMountLog"),copyLabel:t("agentWorkspace.githubMountLog"),defaultPendingMessage:t("agentWorkspace.waitingGithubMountLog")})}function AXt({task:e,onReturnToEdit:t}){const{t:n}=_e("ui"),[i,r]=p.useState(!1),s=c9e(e,n),o=u9e(e,n),l=e.status==="success"?100:Math.max(6,Math.min(100,e.pct??6)),c=e.status==="running"&&e.statusUnconfirmed?n("agentWorkspace.deployStatus.unconfirmed"):e.status==="running"?n("agentWorkspace.deployStatus.running"):e.status==="success"?n("agentWorkspace.deployStatus.success"):e.status==="error"?n("agentWorkspace.deployStatus.error"):n("agentWorkspace.deployStatus.cancelled"),u=()=>{i||!e.retry||(r(!0),e.retry().catch(()=>{}).finally(()=>r(!1)))};return a.jsxs("section",{className:`aw-deploy-progress-card is-${e.status}`,"aria-live":"polite",children:[a.jsxs("div",{className:"aw-deploy-progress-head",children:[a.jsxs("div",{children:[a.jsx("span",{className:"aw-deploy-progress-icon","aria-hidden":!0,children:e.status==="running"&&e.statusUnconfirmed?a.jsx(gN,{}):e.status==="running"?a.jsx(Vi,{className:"spin"}):e.status==="success"?a.jsx(_at,{}):e.status==="error"?a.jsx(gN,{}):a.jsx(oB,{})}),a.jsxs("div",{children:[a.jsx("h3",{children:c}),a.jsx("p",{children:e.runtimeName})]})]}),a.jsx("strong",{children:e.status==="running"&&!e.statusUnconfirmed?`${Math.round(l)}%`:e.label})]}),a.jsx("div",{className:"aw-deploy-progress-track",role:"progressbar","aria-label":n("agentWorkspace.deploymentProgress"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(l),children:a.jsx("span",{style:{width:`${l}%`}})}),a.jsx("ol",{className:"aw-deploy-steps",children:s.map((d,f)=>{const h=e.status==="success"||fnew Set),[_n,pi]=p.useState(()=>new Set),[Nn,Dn]=p.useState(!1),[_i,Fn]=p.useState(""),Kn=p.useRef(null);p.useEffect(()=>()=>{var de;return(de=Kn.current)==null?void 0:de.abort()},[]);const[Rn,nt]=p.useState(null),[Ut,Qe]=p.useState([]),[xt,Qt]=p.useState([]),[jn,lr]=p.useState(!1),[ta,Ms]=p.useState(""),[ts,ci]=p.useState(""),[Ei,$r]=p.useState(0),[na,ns]=p.useState([]),[Il,fs]=p.useState(!1),[ge,Sr]=p.useState(""),[go,bo]=p.useState(0),[La,uc]=p.useState(null),[Ls,Hs]=p.useState(1),[ml,ji]=p.useState(!1),[mi,Pl]=p.useState(""),[yo,dc]=p.useState(0),[Ni,io]=p.useState(null),[Uo,$s]=p.useState(null),[Es,is]=p.useState(null),[qs,$a]=p.useState(!1),[Li,rs]=p.useState(""),[vr,gl]=p.useState(null),[ia,ss]=p.useState(!1),[Ir,Dl]=p.useState(""),[Fr,Bh]=p.useState(0),[vo,xo]=p.useState(""),[wo,Qo]=p.useState(!1),[$d,zo]=p.useState(!1),[Hc,qu]=p.useState(!1),[Rf,Fa]=p.useState(""),[Uh,ra]=p.useState(""),[Vo,Ho]=p.useState(0),[qo,qc]=p.useState({saving:!1,error:"",notice:""}),[Wc,ko]=p.useState(!1),[ya,ro]=p.useState(()=>new Set),[nn,Oo]=p.useState(!1),[Kc,Pr]=p.useState(""),[dr,Gc]=p.useState(""),[Wu,Wo]=p.useState(()=>new Set),bl=p.useRef(!1),fc=p.useRef(""),Ml=p.useRef(null),Ba=p.useRef(0),va=p.useRef(0),Ua=p.useRef(0),Ie=p.useRef(0),[dt,zt]=p.useState(KGt),[Mn,mn]=p.useState("");p.useEffect(()=>{e.length!==0&&zt(de=>de.map(($e,Xe)=>Xe===0&&$e.agentIds.length===0?{...$e,agentIds:e.slice(0,2).map(ut=>ut.id)}:$e))},[e]);const gn=p.useMemo(()=>{const de=new Map;for(const $e of e)$e.runtimeId&&de.set($e.runtimeId,$e);return de},[e]),On=p.useMemo(()=>{var $e;const de=new Map;for(const Xe of t){const ut=($e=Xe.deploymentTarget)==null?void 0:$e.runtimeId;if(!ut||!gn.has(ut))continue;const Xt=de.get(ut);(!Xt||Xe.updatedAt>Xt.updatedAt)&&de.set(ut,Xe)}return de},[gn,t]),Rt=p.useMemo(()=>{const de=new Map;for(const $e of f){if(!$e.runtimeId)continue;const Xe=de.get($e.runtimeId);(!Xe||$e.startedAt>Xe.startedAt)&&de.set($e.runtimeId,$e)}return de},[f]),wn=p.useMemo(()=>{const de=it.trim().toLowerCase();return de?e.filter($e=>{const Xe=$e.runtimeId?On.get($e.runtimeId):void 0,ut=$e.runtimeId?Rt.get($e.runtimeId):void 0;return[$e.label,$e.app,$e.host??"",(Xe==null?void 0:Xe.draft.name)??"",(Xe==null?void 0:Xe.draft.description)??"",(ut==null?void 0:ut.runtimeName)??""].join(" ").toLowerCase().includes(de)}):e},[e,Rt,it,On]),zn=p.useMemo(()=>{const de=it.trim().toLowerCase();return t.filter($e=>{var ut;const Xe=(ut=$e.deploymentTarget)==null?void 0:ut.runtimeId;return Xe&&gn.has(Xe)?!1:de?`${$e.draft.name} ${$e.draft.description}`.toLowerCase().includes(de):!0})},[gn,t,it]),Gn=p.useMemo(()=>t.filter(de=>{var Xe;const $e=(Xe=de.deploymentTarget)==null?void 0:Xe.runtimeId;return!$e||!gn.has($e)}).length,[gn,t]),hs=p.useMemo(()=>{const de=it.trim().toLowerCase();return de?dt.filter($e=>$e.name.toLowerCase().includes(de)):dt},[dt,it]),re=e.find(de=>de.id===U),Vn=t.find(de=>de.id===z),gi=h?f.find(de=>de.id===h):void 0,So=re!=null&&re.runtimeId?On.get(re.runtimeId):void 0,ae=x?Lt:U&&r===U?i:null,ze=(ae==null?void 0:ae.appName)||(re==null?void 0:re.runtimeApp)||(re==null?void 0:re.app)||"",Ne=(re==null?void 0:re.agentCategory)??"general",oe=Ne==="mpa"?"basic":H,Fe=(ne==null?void 0:ne.runtimeId)===(re==null?void 0:re.runtimeId)?ne:null,st=Fe==null?void 0:Fe.mpaInstanceId,ct=(re==null?void 0:re.mpaInstanceId)??st??(re==null?void 0:re.runtimeId)??"",An=XGt.filter(de=>Ne==="mpa"?de==="basic":de==="profileConfig"?!1:de==="usage"?c&&(re==null?void 0:re.runtimeId):!(de==="sessionConfig"||de==="diagnostics")).map(de=>({id:de,label:_(`agentWorkspace.sections.${de}`)})),Ci=JSON.stringify([(re==null?void 0:re.runtimeId)??"",(re==null?void 0:re.region)??"cn-beijing",ze,Ls]),Bi=(La==null?void 0:La.requestKey)===Ci?La.value:null,un=`${(re==null?void 0:re.region)??"cn-beijing"}:${(re==null?void 0:re.runtimeId)??""}`,ui=JSON.stringify([(re==null?void 0:re.runtimeId)??"",ct,(re==null?void 0:re.region)??"cn-beijing",y]),Wt=JSON.stringify([(re==null?void 0:re.runtimeId)??"",ct,(re==null?void 0:re.region)??"cn-beijing"]),di=Wt,Bn=JSON.stringify([(re==null?void 0:re.runtimeId)??"",(re==null?void 0:re.region)??"cn-beijing",y]),$i=(Se==null?void 0:Se.requestKey)===un?Se.value:"",Xn=(X==null?void 0:X.requestKey)===un?X:null,er=(Ni==null?void 0:Ni.requestKey)===ui&&y?Ni.value:null,as=(Es==null?void 0:Es.requestKey)===Wt?Es.value:null,Br=(Uo==null?void 0:Uo.requestKey)===di?Uo.value:(as==null?void 0:as.profile)??null,xr=(as==null?void 0:as.bindingStatus)??"",If=JGt((hc=as==null?void 0:as.safeError)==null?void 0:hc.code,_),Ib=(as==null?void 0:as.capabilities.canWrite)===!0,o0=(vr==null?void 0:vr.requestKey)===Bn?vr:null,l0=!!(re!=null&&re.runtimeId&&Ne==="mpa"&&xr!=="runtime_missing"&&xr!=="binding_ambiguous"),Qh=!!((re==null?void 0:re.agentCategory)==="mpa"&&(re!=null&&re.runtimeId)&&(re==null?void 0:re.runtimeId)===w&&xr==="bound"&&y),fr=(Br==null?void 0:Br.status)==="applied"?Br.profileRevision:null,zh=!!(Qh&&er&&fr!=null&&fr>er.profileRevision),Xc=mx(er),Yc=vo.trim()!==Xc,Zc=!!((k0=Xn==null?void 0:Xn.apiApps)!=null&&k0.length),xa=!!(Xn!=null&&Xn.a2a),Pb=((Ud=Xn==null?void 0:Xn.apiApps)==null?void 0:Ud[0])??ze,Ll=(ne==null?void 0:ne.endpoint)??"",Pf=iXt(((Uk=Xn==null?void 0:Xn.a2a)==null?void 0:Uk.endpoint)??"",Ll),Jc=(re==null?void 0:re.runtimeApp)||"",so=JSON.stringify([(re==null?void 0:re.runtimeId)??"",(re==null?void 0:re.region)??"",(re==null?void 0:re.currentVersion)??null,Jc]),Nt=l&&(re!=null&&re.runtimeId)&&re.region&&Ke===0?H8({runtimeId:re.runtimeId,region:re.region,appName:Jc,currentVersion:re.currentVersion}):null,Ri=(Re==null?void 0:Re.requestKey)===so?Re.value:Nt,yl=Ri!=null&&Ri.reason?_o(Ri.reason,L.resolvedLanguage||L.language):"",Wi=(Ri==null?void 0:Ri.warnings.filter(de=>_o(de,L.resolvedLanguage||L.language)))??[],Pn=Ne!=="mpa";p.useEffect(()=>{const de=Ba.current+1;Ba.current=de,Ue(null),St("");const $e=(re==null?void 0:re.runtimeId)??"",Xe=(re==null?void 0:re.region)??"";if(!Pn||!l||!$e||!Xe){Pt(!1);return}const ut=Ke===0?H8({runtimeId:$e,region:Xe,appName:Jc,currentVersion:re==null?void 0:re.currentVersion}):null;if(ut){Ue({requestKey:so,value:ut}),Pt(!1);return}const Xt=new AbortController;let Ye,kn=0;const Dr=60;Pt(!0);const yi=bs=>{RD({runtimeId:$e,region:Xe,appName:Jc,currentVersion:re==null?void 0:re.currentVersion,signal:Xt.signal,force:bs&&Ke>0}).then(Qa=>{var Lb,Ws;if(de!==Ba.current)return;const Qk=Qa.recoveryStatus==="preparing";if(Qa.runtime.runtimeId!==$e||Qa.runtime.region!==Xe||!Qk&&Jc&&((Lb=Qa.agent)==null?void 0:Lb.appName)!==Jc||Qa.canUpdate&&!((Ws=Qa.agent)!=null&&Ws.appName)){St(_("agentWorkspace.errors.updateCapabilityMismatch"));return}if(Ue({requestKey:so,value:Qa}),Pt(!1),!!Qk){if(kn+=1,kn>=Dr){St(_("agentWorkspace.errors.updateConfigRestoring"));return}Ye=window.setTimeout(()=>yi(!1),1e3)}}).catch(()=>{de!==Ba.current||Xt.signal.aborted||St(_("agentWorkspace.errors.checkUpdateCapability"))}).finally(()=>{de===Ba.current&&!Xt.signal.aborted&&Pt(!1)})};return yi(!0),()=>{Xt.abort(),Ye!=null&&window.clearTimeout(Ye)}},[l,Jc,Ke,re==null?void 0:re.currentVersion,re==null?void 0:re.region,re==null?void 0:re.runtimeId,Pn,so]);const ps=p.useMemo(()=>{const de=new Map(e.map((Xe,ut)=>[Xe.id,ut])),$e=new Map(n.map((Xe,ut)=>[Xe,ut]));return[...wn].sort((Xe,ut)=>{const Xt=Xe.runtimeId?Rt.get(Xe.runtimeId):void 0,Ye=ut.runtimeId?Rt.get(ut.runtimeId):void 0,kn=(Xt==null?void 0:Xt.status)==="running"?Xt.startedAt:0,Dr=(Ye==null?void 0:Ye.status)==="running"?Ye.startedAt:0;if(kn!==Dr)return Dr-kn;const yi=$e.get(Xe.id),bs=$e.get(ut.id);return yi!=null&&bs!=null?yi-bs:yi!=null?-1:bs!=null?1:(de.get(Xe.id)??0)-(de.get(ut.id)??0)})},[n,e,wn,Rt]),Db=(re==null?void 0:re.label)||(ae==null?void 0:ae.name)||(Vn==null?void 0:Vn.draft.name)||(gi==null?void 0:gi.agentName)||((aa=gi==null?void 0:gi.agentDraft)==null?void 0:aa.name)||_("agentWorkspace.noAgentSelected"),c0=dt.find(de=>de.id===Mn),i2=ps.filter(de=>de.canDelete===!0),$l=ps.filter(de=>Ji.has(de.id)&&de.canDelete===!0),u0=zn.filter(de=>_n.has(de.id)),Sm=i2.length+zn.length,d0=$l.length+u0.length,xn=p.useMemo(()=>{var $e;if(gi!=null&&gi.agentDraft)return gi.agentDraft;if(Vn!=null&&Vn.draft)return Vn.draft;const de=($e=re==null?void 0:re.region)!=null&&$e.startsWith("ap-")?"byteplus":"volcengine";return Ri!=null&&Ri.agent&&(Ri.recoveryStatus==="complete"||Ri.recoveryStatus==="draft-only")?hH(Ri.agent,de,Ri.runtime.configuredEnvKeys):pXt(ae,ze||(re==null?void 0:re.label)||"agent",de)},[ae,ze,re==null?void 0:re.label,re==null?void 0:re.region,Vn==null?void 0:Vn.draft,gi==null?void 0:gi.agentDraft,Ri]),Ku=((f2=ae==null?void 0:ae.draft)==null?void 0:f2.harnessSidecar)??dmt(ne==null?void 0:ne.envs),r2=Ku?tk.filter(de=>Ku.componentOverrides[de]):[],s2=p.useMemo(()=>zA(xn),[xn]),Fd=Vn?o?"":_("agentWorkspace.errors.noCreatePermission"):Ne==="mpa"?"":l?re!=null&&re.runtimeId?re.region?_t?_("agentWorkspace.errors.checkingUpdateConfig"):Gt||(Ri?Ri.recoveryStatus!=="complete"&&Ri.recoveryStatus!=="draft-only"?yl||_("agentWorkspace.errors.originalConfigUnavailable"):Ri.canUpdate?(Mf=Ri.agent)!=null&&Mf.appName?"":_("agentWorkspace.errors.agentInfoMissing"):yl||_("agentWorkspace.errors.updateUnsupported"):_("agentWorkspace.errors.updateCapabilityPending")):_("agentWorkspace.errors.runtimeRegionMissing"):_("agentWorkspace.errors.cloudOnlyUpdate"):_("agentWorkspace.errors.noManagePermission"),Rk="aw-update-disabled-reason",f0=re?Ne!=="mpa"?_("agentWorkspace.sessionConfigNonMpa"):qs?_("agentWorkspace.loadingMpaAgentView"):Li||If||(xr==="runtime_missing"?_("agentWorkspace.mpaRuntimeMissing"):xr==="binding_ambiguous"?_("agentWorkspace.mpaRuntimeBindingAmbiguous"):xr&&!l0?_("agentWorkspace.mpaRuntimeMissing"):Ib?"":_("agentWorkspace.errors.noManagePermission")):_("agentWorkspace.sessionConfigNoAgent"),a2=re?Ne!=="mpa"?_("agentWorkspace.sessionConfigNonMpa"):qs?_("agentWorkspace.loadingMpaAgentView"):Li||If||(xr==="runtime_missing"?_("agentWorkspace.mpaRuntimeMissing"):xr==="binding_ambiguous"?_("agentWorkspace.mpaRuntimeBindingAmbiguous"):xr==="orphan_runtime"?_("agentWorkspace.mpaRuntimeOrphan"):y?re.runtimeId!==w?_("agentWorkspace.sessionConfigDifferentRuntime"):"":_("agentWorkspace.sessionConfigNoSession")):_("agentWorkspace.sessionConfigNoAgent"),Em=re?Ne!=="mpa"?_("agentWorkspace.sessionConfigNonMpa"):qs?_("agentWorkspace.loadingMpaAgentView"):Li||(xr!=="bound"?a2:y?re.runtimeId!==w?_("agentWorkspace.sessionConfigDifferentRuntime"):"":_("agentWorkspace.sessionConfigNoSession")):_("agentWorkspace.sessionConfigNoAgent"),h0=p.useMemo(()=>{if(ae)return ae.tools;const de=(xn.builtinTools??[]).map($e=>{var Xe;return((Xe=lT.find(ut=>ut.id===$e))==null?void 0:Xe.label)??$e});return Array.from(new Set([...xn.tools,...de,...(xn.customTools??[]).map($e=>$e.name),...(xn.mcpTools??[]).map($e=>$e.name)].filter(Boolean)))},[xn,ae]),Ik=p.useMemo(()=>ae?ae.skillsPreviewSupported?ae.skills.map(de=>de.name):null:Array.from(new Set([...(xn.selectedSkills??[]).map(de=>de.name),...xn.skills].filter(Boolean))),[xn,ae]),Ur=p.useMemo(()=>{if(gi)return gi;if(Vn){const de=f.filter($e=>$e.draftId===Vn.id).sort(($e,Xe)=>Xe.startedAt-$e.startedAt)[0];return de||f.filter($e=>{var Xe,ut;return((Xe=$e.agentDraft)==null?void 0:Xe.name)===Vn.draft.name||$e.agentName===Vn.draft.name||!!((ut=Vn.deploymentTarget)!=null&&ut.runtimeId)&&$e.runtimeId===Vn.deploymentTarget.runtimeId}).sort(($e,Xe)=>Xe.startedAt-$e.startedAt)[0]}if(re)return f.filter(de=>!!re.runtimeId&&de.runtimeId===re.runtimeId||de.agentName===re.label).sort((de,$e)=>$e.startedAt-de.startedAt)[0]},[f,re,Vn,gi]),p0=!!(h&&Ur&&Ur.id===h),Df=!!(Ur&&(Ur.status!=="success"||p0)),Vh=(Ur==null?void 0:Ur.status)==="running",eu=Ur!=null&&Ur.draftId?t.find(de=>de.id===Ur.draftId)??(Ur.agentDraft?{id:Ur.draftId,draft:Ur.agentDraft,updatedAt:Ur.startedAt}:void 0):void 0,o2=p.useMemo(()=>wXt(xn),[xn]),vl=(re==null?void 0:re.currentVersion)??(ne==null?void 0:ne.currentVersion)??null,Fi=vl??(gi==null?void 0:gi.startedAt)??"unknown",Eo=ae?`runtime:${(re==null?void 0:re.runtimeId)??ae.name}:v${Fi}:${o2}`:`draft:${(gi==null?void 0:gi.id)??(Vn==null?void 0:Vn.id)??(re==null?void 0:re.id)??Db}:${o2}`;p.useEffect(()=>{let de=!1;const $e=(re==null?void 0:re.runtimeId)??"",Xe=ct||$e,ut=(re==null?void 0:re.region)??"cn-beijing",Xt=Wt;if(rs(""),Ne!=="mpa"||!$e||oe!=="profileConfig"&&oe!=="sessionConfig"){is(null),$a(!1);return}const Ye=new AbortController;return $a(!0),_Te({mpaInstanceId:Xe,runtimeId:$e,region:ut,signal:Ye.signal}).then(kn=>{de||(is({requestKey:Xt,value:kn}),$s(kn.profile?{requestKey:di,value:kn.profile}:null))}).catch(kn=>{de||Ye.signal.aborted||(is(null),rs(kn instanceof Error?kn.message:_("agentWorkspace.errors.loadMpaAgentView")))}).finally(()=>{de||$a(!1)}),()=>{de=!0,Ye.abort()}},[Ke,Wt,oe,ct,re==null?void 0:re.region,re==null?void 0:re.runtimeId,Ne,di,_]),p.useEffect(()=>{oe==="usage"&&!c&&q("basic")},[c,oe]),p.useEffect(()=>{oe==="sessionConfig"&&(!(re!=null&&re.runtimeId)||Ne!=="mpa")&&q("basic")},[oe,re==null?void 0:re.runtimeId,Ne]),p.useEffect(()=>{oe==="diagnostics"&&(!(re!=null&&re.runtimeId)||Ne!=="mpa")&&q("basic")},[oe,re==null?void 0:re.runtimeId,Ne]),p.useEffect(()=>{if(!h)return;const de=f.find(Xe=>Xe.id===h),$e=de!=null&&de.runtimeId?gn.get(de.runtimeId):void 0;if($e){J(""),Z($e.id),q("basic");return}Z(""),J(""),q("basic")},[gn,f,h]),p.useEffect(()=>{if(!m){fc.current="";return}const de=`${m}:${g}:${b}:${c}`;fc.current!==de&&e.some($e=>$e.id===m)&&(fc.current=de,J(""),Z(m),q(g==="usage"&&!c?"basic":g),g==="evaluations"&&(Ot(b),Dt("")))},[e,c,m,g,b]),p.useEffect(()=>{for(const de of ps.slice(0,8)){if(!de.runtimeId)continue;const $e=de.region??"cn-beijing";N2e(de.runtimeId,$e),OTe(de.runtimeId,$e,de.runtimeApp??"")}},[ps]),p.useEffect(()=>{let de=!1;const $e=(re==null?void 0:re.runtimeId)??"",Xe=(re==null?void 0:re.region)??"cn-beijing",ut=(re==null?void 0:re.runtimeApp)??"",Xt=$e?kTe($e,Xe,ut):null;if(qe(Xt),Tt(""),tn(!1),je(!!Xt||!x||!$e),!(!x||!$e))return Az($e,Xe,ut,{force:!0}).then(Ye=>{de||qe(Ye)}).catch(Ye=>{!de&&!Xt&&qe(null),de||(tn(Ye instanceof Ea&&Ye.unsupported),Tt(_("agentWorkspace.errors.loadAgentInfo")))}).finally(()=>{de||je(!0)}),()=>{de=!0}},[x,Ke,re==null?void 0:re.currentVersion,re==null?void 0:re.region,re==null?void 0:re.runtimeApp,re==null?void 0:re.runtimeId]),p.useEffect(()=>{let de=!1;const $e=(re==null?void 0:re.runtimeId)??"",Xe=(re==null?void 0:re.region)??"cn-beijing";if(ns([]),Sr(""),oe!=="optimizations"||!$e){fs(!1);return}if(x&&!ze){fs(!yt);return}return fs(!0),lTe({runtimeId:$e,region:Xe,appName:ze}).then(ut=>{de||ns(ut.groups)}).catch(()=>{de||Sr(_("agentWorkspace.errors.loadOptimizations"))}).finally(()=>{de||fs(!1)}),()=>{de=!0}},[yt,x,go,oe,ze,re==null?void 0:re.region,re==null?void 0:re.runtimeId]),p.useEffect(()=>{Hs(1)},[re==null?void 0:re.runtimeId,ze]),p.useEffect(()=>{const de=Ua.current+1;Ua.current=de;const $e=(re==null?void 0:re.runtimeId)??"",Xe=(re==null?void 0:re.region)??"cn-beijing",ut=ze;if(Pl(""),oe!=="usage"||!$e){ji(!1);return}if(!ut){ji(x&&!yt);return}const Xt=new AbortController;return ji(!0),b2e({runtimeId:$e,region:Xe,appName:ut,page:Ls,pageSize:YGt,signal:Xt.signal}).then(Ye=>{if(de===Ua.current){if(Ye.runtimeId!==$e||Ye.appName!==ut||Ye.page!==Ls){Pl(_("agentWorkspace.errors.usageMismatch"));return}uc({requestKey:Ci,value:Ye})}}).catch(()=>{de!==Ua.current||Xt.signal.aborted||Pl(_("agentWorkspace.errors.loadUsage"))}).finally(()=>{de===Ua.current&&ji(!1)}),()=>{Xt.abort()}},[Ls,yo,Ci,yt,x,oe,ze,re==null?void 0:re.region,re==null?void 0:re.runtimeId]),p.useEffect(()=>{va.current+=1,ve(null),He(!1),De(!1),ce(""),pe("api-server")},[un,oe]),p.useEffect(()=>{const de=(re==null?void 0:re.runtimeId)??"",$e=(re==null?void 0:re.region)??"cn-beijing",Xe=Bn;if(Dl(""),oe!=="diagnostics"||Ne!=="mpa"||xr!=="bound"||!de||!y||de!==w){ss(!1),oe!=="diagnostics"&&gl(null);return}const ut=new AbortController;let Xt=!1;return ss(!0),NTe({runtimeId:de,region:$e,sessionId:y,signal:ut.signal}).then(async Ye=>{const kn=Ye.runs[0],Dr=kn?await RTe({runtimeId:de,region:$e,sessionId:y,invocationId:kn.invocationId,signal:ut.signal}):null;return{runs:Ye.runs,trace:Dr}}).then(Ye=>{Xt||gl({requestKey:Xe,...Ye})}).catch(Ye=>{Xt||ut.signal.aborted||(gl(null),Dl(Ye instanceof Error?Ye.message:_("agentWorkspace.errors.loadMpaDiagnostics")))}).finally(()=>{Xt||ss(!1)}),()=>{Xt=!0,ut.abort()}},[w,y,Fr,Bn,oe,re==null?void 0:re.region,re==null?void 0:re.runtimeId,Ne,xr,_]);function ms(){va.current+=1,ve(null),He(!1),De(!1),ce("")}function Pk(de){de!==fe&&(ms(),pe(de))}async function m0(){if(Le){ms();return}const de=(re==null?void 0:re.runtimeId)??"",$e=(re==null?void 0:re.region)??"cn-beijing";if(!de)return;const Xe=va.current+1;va.current=Xe,De(!0),ce("");try{const ut=await A2e(de,$e);if(Xe!==va.current)return;ve({requestKey:un,value:ut}),He(!0)}catch(ut){if(Xe!==va.current)return;ve(null),He(!1),ce(ut instanceof Error?ut.message:_("agentWorkspace.errors.loadApiKey"))}finally{Xe===va.current&&De(!1)}}p.useEffect(()=>{let de=!1;const $e=(re==null?void 0:re.runtimeId)??"",Xe=(re==null?void 0:re.region)??"cn-beijing",ut=$e?j2e($e,Xe):null;if(W(ut),vt(""),!!$e)return ID($e,Xe,{force:!0}).then(Xt=>{de||W(Xt)}).catch(()=>{!de&&!ut&&W(null),de||vt(_("agentWorkspace.errors.loadRuntimeDetails"))}),()=>{de=!0}},[Ke,re==null?void 0:re.currentVersion,re==null?void 0:re.region,re==null?void 0:re.runtimeId]),p.useEffect(()=>{const de=Ie.current+1;if(Ie.current=de,Fa(""),ra(""),zo(!1),qu(!1),oe!=="sessionConfig"||!Qh||!(re!=null&&re.runtimeId)){Qo(!1),io(null),xo("");return}const $e=re.runtimeId,Xe=ct||$e,ut=re.region??"cn-beijing",Xt=ui,Ye=new AbortController;return Qo(!0),Promise.all([Iz({runtimeId:$e,region:ut,sessionId:y,signal:Ye.signal}),TTe({runtimeId:$e,region:ut,mpaInstanceId:Xe,signal:Ye.signal}).catch(()=>null)]).then(([kn,Dr])=>{de===Ie.current&&(io({requestKey:Xt,value:kn}),xo(mx(kn)),$s(Dr?{requestKey:di,value:Dr}:null))}).catch(kn=>{de!==Ie.current||Ye.signal.aborted||(kn==null?void 0:kn.name)==="AbortError"||(io(null),xo(""),Fa(kn instanceof Error?kn.message:_("agentWorkspace.errors.loadSessionConfig")))}).finally(()=>{de===Ie.current&&!Ye.signal.aborted&&Qo(!1)}),()=>{Ye.abort()}},[y,Vo,ui,Qh,oe,di,ct,re==null?void 0:re.region,re==null?void 0:re.runtimeId,_]),p.useEffect(()=>{let de=!1;const $e=(re==null?void 0:re.runtimeId)??"";if(he(""),oe!=="versions"||!$e){Ce(!1),$e||Ae(null);return}return Ce(!0),dN($e).then(Xe=>{de||Ae(Xe)}).catch(()=>{de||(Ae(null),he(_("agentWorkspace.errors.loadGithubVersions")))}).finally(()=>{de||Ce(!1)}),()=>{de=!0}},[oe,re==null?void 0:re.currentVersion,re==null?void 0:re.runtimeId]),p.useEffect(()=>{let de=!1;const $e=(re==null?void 0:re.runtimeId)??"",Xe=(re==null?void 0:re.region)??"cn-beijing",ut=`${Xe}:${$e}`;if(ue(""),oe!=="integrations"||!$e){Y(!1),$e||le(null);return}Y(!0);const Xt=Xw($e,Xe,{retryProbe:!0}).catch(Ye=>{if(Ye instanceof Ea&&Ye.unsupported)return null;throw Ye});return Promise.all([Xt,C2e($e,Xe,{retryProbe:!0})]).then(([Ye,kn])=>{de||le({requestKey:ut,apiApps:Ye,a2a:kn})}).catch(()=>{de||(le(null),ue(_("agentWorkspace.errors.probeIntegration")))}).finally(()=>{de||Y(!1)}),()=>{de=!0}},[te,oe,re==null?void 0:re.currentVersion,re==null?void 0:re.region,re==null?void 0:re.runtimeId]),p.useEffect(()=>{let de=!1;const $e=(re==null?void 0:re.runtimeId)??"",Xe=(re==null?void 0:re.region)??"cn-beijing",ut=$e&&ze?cTe({runtimeId:$e,region:Xe,appName:ze,pageSize:100}):null;if(Qe(ut?qoe(ut,_):[]),Qt((ut==null?void 0:ut.sets)??[]),Ms(""),ci((ut==null?void 0:ut.unsupportedMessage)??""),oe!=="evaluations"||!$e){lr(!1);return}if(x&&!ze){lr(!yt);return}return lr(!ut),AD({runtimeId:$e,region:Xe,appName:ze,pageSize:100},{force:!0}).then(Xt=>{de||(Qt(Xt.sets),Qe(qoe(Xt,_)),ci(Xt.unsupportedMessage??""))}).catch(()=>{de||(Ms(_("agentWorkspace.errors.loadEvaluations")),ci(""))}).finally(()=>{de||lr(!1)}),()=>{de=!0}},[yt,x,Ei,oe,ze,ae==null?void 0:ae.appName,re==null?void 0:re.region,re==null?void 0:re.runtimeId,_]);async function zL(de){const $e=(re==null?void 0:re.runtimeId)??"",Xe=de.commitSha??"";if(!(!$e||!Xe||ie)){we(Xe),he("");try{await l2e({runtimeId:$e,targetCommitSha:Xe,region:re==null?void 0:re.region,agentCategory:Ne});const ut=await dN($e);Ae(ut)}catch(ut){he(ut instanceof Error?ut.message:_("agentWorkspace.errors.rollbackVersion"))}finally{we("")}}}function Dk(de,$e){return!(de instanceof rw)||de.status!==412||!de.currentState?!1:(io({requestKey:ui,value:de.currentState}),xo(mx(de.currentState)),Fa($e),!0)}async function Mk(de="replace"){if(!(re!=null&&re.runtimeId)||!er)return;const $e=re.runtimeId,Xe=re.region??"cn-beijing",ut=vo.trim(),Xt=de==="inherit"?{category:"model",mode:de}:ut?{category:"model",mode:de,value:{id:ut}}:{category:"model",mode:"inherit"};zo(!0),Fa(""),ra("");try{const Ye=await B8({runtimeId:$e,region:Xe,sessionId:y,etag:er.etag,changes:[Xt]});io({requestKey:ui,value:Ye}),xo(mx(Ye)),ra(_("agentWorkspace.sessionConfigSaved"))}catch(Ye){Dk(Ye,_("agentWorkspace.sessionConfigStale"))||Fa(c6(Ye,_("agentWorkspace.sessionConfigStale")))}finally{zo(!1)}}async function l2(de){if(!(re!=null&&re.runtimeId)||!er)return;const $e=re.runtimeId,Xe=re.region??"cn-beijing";zo(!0),Fa(""),ra("");try{const ut=await B8({runtimeId:$e,region:Xe,sessionId:y,etag:er.etag,changes:[{category:"mcpServers",mode:de}]});io({requestKey:ui,value:ut}),ra(_("agentWorkspace.sessionConfigSaved"))}catch(ut){Dk(ut,_("agentWorkspace.sessionConfigStale"))||Fa(c6(ut,_("agentWorkspace.sessionConfigStale")))}finally{zo(!1)}}async function g0(){if(!(re!=null&&re.runtimeId)||!er||!fr)return;const de=re.runtimeId,$e=re.region??"cn-beijing";qu(!0),Fa(""),ra("");try{const Xe=await ITe({runtimeId:de,region:$e,sessionId:y,etag:er.etag,idempotencyKey:nXt(de,y,fr),targetProfileRevision:fr});io({requestKey:ui,value:Xe}),xo(mx(Xe)),ra(_("agentWorkspace.sessionProfileUpgraded"))}catch(Xe){Dk(Xe,_("agentWorkspace.sessionConfigStale"))||Fa(c6(Xe,_("agentWorkspace.sessionProfileUpgradeFailed")))}finally{qu(!1)}}async function c2(){if(!(re!=null&&re.runtimeId))return;const de=re.runtimeId,$e=re.region??"cn-beijing",Xe=ct||de,ut=(Br==null?void 0:Br.status)==="applied"?"update":"create",Xt=(Br==null?void 0:Br.runtimeRevision)||(Br==null?void 0:Br.etag)||"",Ye=await lXt(de,ut,s2);qc({saving:!0,error:"",notice:""});try{const kn=await Nz({operationKind:ut,runtimeId:de,region:$e,mpaInstanceId:Xe,sourceProfileId:`studio-runtime:${de}:${ze||"a2a-default"}`,targetKey:ut==="update"?Xe:`runtime:${$e}:${de}`,runtimeRevision:ut==="update"?Xt:void 0,draft:xn,idempotencyKey:Ye});qc({saving:!1,error:kn.status==="succeeded"?"":kn.safeErrorCode||_("agentWorkspace.profileApplyIncomplete"),notice:kn.status==="succeeded"?_("agentWorkspace.profileAppliedNotice",{revision:kn.profileRevision??_("agentWorkspace.notAvailable")}):""}),ot(Dr=>Dr+1),Ho(Dr=>Dr+1)}catch(kn){qc({saving:!1,error:kn instanceof Error?kn.message:_("agentWorkspace.profileApplyFailed"),notice:""})}}function VL(){!(re!=null&&re.runtimeId)||Ne!=="mpa"||I==null||I({draft:xn,runtimeId:re.runtimeId,mpaInstanceId:ct||re.runtimeId,name:Db,region:re.region??"cn-beijing",appName:ze||"a2a-default",currentVersion:re.currentVersion??(ne==null?void 0:ne.currentVersion),runtimeRevision:(Br==null?void 0:Br.runtimeRevision)||(Br==null?void 0:Br.etag)||void 0})}p.useEffect(()=>{qc({saving:!1,error:"",notice:""})},[Wt]),p.useEffect(()=>{const de=new Set(Ut.map($e=>$e.id));ro($e=>{const Xe=new Set([...$e].filter(ut=>de.has(ut)));return Xe.size===$e.size?$e:Xe}),Wo($e=>{const Xe=new Set([...$e].filter(ut=>de.has(ut)));return Xe.size===$e.size?$e:Xe}),dr&&!de.has(dr)&&Gc("")},[Ut,dr]),p.useEffect(()=>{ko(!1),ro(new Set),Wo(new Set),Pr(""),Gc("")},[re==null?void 0:re.runtimeId]),p.useEffect(()=>{const de=new Set(ps.filter($e=>$e.canDelete===!0).map($e=>$e.id));Qn($e=>{const Xe=new Set([...$e].filter(ut=>de.has(ut)));return Xe.size===$e.size?$e:Xe})},[ps]),p.useEffect(()=>{const de=new Set(zn.map($e=>$e.id));pi($e=>{const Xe=new Set([...$e].filter(ut=>de.has(ut)));return Xe.size===$e.size?$e:Xe})},[zn]);const sa=p.useMemo(()=>!v||!(re!=null&&re.runtimeId)||v.runtimeId!==re.runtimeId||ze&&v.agentName&&v.agentName!==ze?null:{...v,tag:_(v.kind==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")},[v,re==null?void 0:re.runtimeId,ze,_]),Ln=p.useMemo(()=>WGt(_),[_]),b0=p.useMemo(()=>re!=null&&re.runtimeId?sa?[sa,...Ut.filter(de=>de.id!==sa.id&&(!de.messageId||de.messageId!==sa.messageId))]:Ut:Ln,[Ln,Ut,sa,re==null?void 0:re.runtimeId]),Cm=b0.filter(de=>{if(de.kind!==Ct||(de.source==="auto"?"auto":"user")!==Ze)return!1;const Xe=Bt.trim().toLowerCase();return Xe?[de.input,de.output,de.referenceOutput,de.comment,de.tag??"",de.sessionId,de.messageId,de.userId,de.evaluationSetName].join(" ").toLowerCase().includes(Xe):!0}),y0=Cm.filter(de=>ya.has(de.id)),Lk=!!(re!=null&&re.runtimeId),HL=de=>{Ot(de),Dt(""),Pr("");const $e=b0.find(Xe=>Xe.kind===de);Gc(($e==null?void 0:$e.id)??""),window.setTimeout(()=>{var Xe;(Xe=Ml.current)==null||Xe.scrollIntoView({behavior:"smooth",block:"start"})},0)},$k=de=>{Pr(""),ro($e=>{const Xe=new Set($e);return Xe.has(de.id)?Xe.delete(de.id):Xe.add(de.id),Xe})},Bd=()=>{Pr(""),ro(new Set(Cm.map(de=>de.id)))},u2=()=>{Pr(""),ro(new Set),ko(!1)},Fk=de=>{Wo($e=>{const Xe=new Set($e);return Xe.has(de)?Xe.delete(de):Xe.add(de),Xe})},qL=de=>{Gc(de.id),Pr(""),!(!de.sessionId||!de.messageId)&&(R==null||R(de))},d2=async de=>{if(!(re!=null&&re.runtimeId)||!ze||nn||de.length===0)return;const $e=de.length===1?_("agentWorkspace.deleteOneCaseConfirm"):_("agentWorkspace.deleteCasesConfirm",{count:de.length});if(!window.confirm($e))return;const Xe=de.map(Xt=>Xt.id),ut=new Set(Xe);Oo(!0),Pr("");try{await fTe({runtimeId:re.runtimeId,region:re.region??"cn-beijing",appName:ze,itemIds:Xe});const Xt=new Map;for(const Ye of de)Xt.set(Ye.kind,(Xt.get(Ye.kind)??0)+1);Qe(Ye=>Ye.filter(kn=>!ut.has(kn.id))),Qt(Ye=>Ye.map(kn=>({...kn,itemCount:Math.max(0,kn.itemCount-(Xt.get(kn.kind)??0))}))),ro(Ye=>new Set([...Ye].filter(kn=>!ut.has(kn)))),Wo(Ye=>new Set([...Ye].filter(kn=>!ut.has(kn)))),dr&&ut.has(dr)&&Gc(""),de.length>1&&ko(!1),C==null||C(de)}catch(Xt){Pr(Xt instanceof Error?Xt.message:String(Xt))}finally{Oo(!1)}},Hh=de=>{zt($e=>$e.map(Xe=>Xe.id===de.id?de:Xe))},gs=()=>{const de=new Set(e.map(ut=>ut.id)),$e=n.filter(ut=>de.has(ut)),Xe=new Set($e);return[...$e,...e.filter(ut=>!Xe.has(ut.id)).map(ut=>ut.id)]},WL=(de,$e,Xe)=>{if(!O||de===$e)return;const ut=gs().filter(kn=>kn!==de),Xt=ut.indexOf($e),Ye=Xt<0?ut.length:Xe==="after"?Xt+1:Xt;ut.splice(Ye,0,de),O(ut)},v0=(de,$e)=>{if(!gt||gt===$e)return;const Xe=de.currentTarget.getBoundingClientRect();cn($e),lt(de.clientY>Xe.top+Xe.height/2?"after":"before")},Mb=(de,$e)=>{if(!O)return;const Xe=gs(),ut=Xe.indexOf(de),Xt=Math.max(0,Math.min(Xe.length-1,ut+$e));ut<0||ut===Xt||(Xe.splice(ut,1),Xe.splice(Xt,0,de),O(Xe))},Bk=de=>{de.canDelete===!0&&(Fn(""),Qn($e=>{const Xe=new Set($e);return Xe.has(de.id)?Xe.delete(de.id):Xe.add(de.id),Xe}))},KL=de=>{Fn(""),pi($e=>{const Xe=new Set($e);return Xe.has(de.id)?Xe.delete(de.id):Xe.add(de.id),Xe})},GL=()=>{Fn(""),Qn(new Set(i2.map(de=>de.id))),pi(new Set(zn.map(de=>de.id)))},XL=()=>{Fn(""),Qn(new Set),pi(new Set),Sn(!1)},x0=()=>{if(d0===0||Nn)return;const de=$l.length,$e=u0.length;if(de===1&&$e===0){Qr($l[0]);return}Fn(""),nt({kind:"selection",title:_(de===1&&$e===0?"agentWorkspace.deleteAgentTitle":de===0&&$e===1?"myAgents.deleteDraftTitle":"agentWorkspace.deleteSelectedTitle"),description:de===1&&$e===0?_("agentWorkspace.deleteAgentDescription",{name:$l[0].label}):de===0&&$e===1?_("agentWorkspace.deleteDraftDescription",{name:u0[0].draft.name||_("agentSelector.unnamedAgent")}):_("agentWorkspace.deleteSelectionDescription",{count:d0,warning:de>0?_("agentWorkspace.runtimeDeletionWarning",{count:de}):_("agentWorkspace.draftDeletionWarning")}),confirmLabel:_(de===0&&$e===1?"myAgents.deleteDraft":"agentWorkspace.deleteSelected"),agents:$l,drafts:u0})},w0=async()=>{if(!(!Rn||Nn)){if(Rn.kind==="agent"&&Rn.previewFailed){await Qr(Rn.agent);return}if(Rn.canConfirm!==!1){Dn(!0),Fn("");try{if(Rn.kind==="selection"){const{agents:de,drafts:$e}=Rn;if(de.length>0){if(!A)throw new Error(_("agentWorkspace.errors.deleteDeployedUnsupported"));await A(de)}$e.length>0&&(E==null||E($e)),Qn(new Set),pi(new Set),Sn(!1),de.some(Xe=>Xe.id===U)&&Z(""),$e.some(Xe=>Xe.id===z)&&J("")}else if(Rn.kind==="agent"){if(!A)throw new Error(_("agentWorkspace.errors.deleteDeployedUnsupported"));await A([Rn.agent]),U===Rn.agent.id&&Z("")}else{if(!E)throw new Error(_("agentWorkspace.errors.deleteDraftUnsupported"));E([Rn.draft]),z===Rn.draft.id&&J("")}nt(null)}catch(de){Fn(de instanceof Error?de.message:String(de))}finally{Dn(!1)}}}},Qr=async de=>{var Xe;if(!A||de.canDelete!==!0||Nn)return;(Xe=Kn.current)==null||Xe.abort(),Fn("");let $e=null;if(de.agentCategory==="mpa"){const ut=new AbortController;if(Kn.current=ut,nt({kind:"agent",agent:de,title:_("agentWorkspace.deleteAgentTitle"),description:a.jsx("p",{role:"status",children:_("agentWorkspace.mpaDeleteChecking")}),confirmLabel:_("agentWorkspace.mpaDeleteChecking"),canConfirm:!1,previewLoading:!0}),!de.runtimeId||!de.region){Fn(_("agentWorkspace.errors.loadMpaDeletePreview")),nt(Xt=>(Xt==null?void 0:Xt.kind)==="agent"?{...Xt,previewLoading:!1,previewFailed:!0,canConfirm:!0,confirmLabel:_("agentWorkspace.mpaDeleteRetryPreview"),description:_("agentWorkspace.errors.loadMpaDeletePreview")}:Xt);return}try{if($e=await jTe({mpaInstanceId:de.mpaInstanceId??de.runtimeId,runtimeId:de.runtimeId,region:de.region,signal:ut.signal}),ut.signal.aborted||Kn.current!==ut)return}catch(Xt){if(ut.signal.aborted||Kn.current!==ut)return;Fn(Xt instanceof Error?Xt.message:String(Xt)),nt(Ye=>(Ye==null?void 0:Ye.kind)==="agent"?{...Ye,previewLoading:!1,previewFailed:!0,canConfirm:!0,confirmLabel:_("agentWorkspace.mpaDeleteRetryPreview"),description:_("agentWorkspace.mpaDeletePreviewFailed")}:Ye);return}}nt({kind:"agent",title:_("agentWorkspace.deleteAgentTitle"),description:$e?a.jsx(eXt,{preview:$e,t:_}):_("agentWorkspace.deleteAgentDescription",{name:de.label}),confirmLabel:_("agentWorkspace.deleteAgent"),canConfirm:$e?$e.canDelete:!0,agent:de})},Am=de=>{if(!E||Nn)return;const $e=de.draft.name||_("agentSelector.unnamedAgent");Fn(""),nt({kind:"draft",title:_("myAgents.deleteDraftTitle"),description:_("agentWorkspace.deleteDraftDescription",{name:$e}),confirmLabel:_("myAgents.deleteDraft"),draft:de})},bi=()=>{const de=`eval-${Date.now()}`,$e={id:de,name:_("agentWorkspace.newEvaluationGroupName",{count:dt.length+1}),agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量"],concurrency:"4",history:[]};zt(Xe=>[$e,...Xe]),mn(de)},YL=de=>{Hh({...de,history:[{id:`run-${Date.now()}`,createdAt:_("agentWorkspace.evaluationDefaults.justNow"),score:86+de.history.length%7,status:"completed"},...de.history]})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`aw-root${x?" is-detail-only":""}`,children:[a.jsxs("nav",{className:"aw-view-tabs","aria-label":_("agentWorkspace.workspace"),children:[a.jsx("button",{type:"button",className:F==="library"?"is-active":"","aria-pressed":F==="library",onClick:()=>{M("library"),tt("")},children:_("agentWorkspace.library")}),a.jsx("button",{type:"button",className:F==="evaluation"?"is-active":"","aria-pressed":F==="evaluation",onClick:()=>{M("evaluation"),tt("")},children:_("agentWorkspace.evaluation")})]}),a.jsxs("div",{className:"aw-workspace-frame",children:[a.jsxs("div",{className:"aw-workspace","aria-hidden":F==="evaluation"||void 0,ref:de=>{de==null||de.toggleAttribute("inert",F==="evaluation")},children:[a.jsxs("aside",{className:"aw-sidebar","aria-label":_(F==="library"?"agentWorkspace.agentList":"agentWorkspace.evaluationGroupList"),children:[a.jsxs("label",{className:"aw-search",children:[a.jsx(dI,{"aria-hidden":!0}),a.jsx("input",{value:it,onChange:de=>tt(de.currentTarget.value),placeholder:_(F==="library"?"myAgents.searchAgents":"agentWorkspace.searchEvaluationGroups"),"aria-label":_(F==="library"?"myAgents.searchAgents":"agentWorkspace.searchEvaluationGroups")})]}),a.jsxs("button",{type:"button",className:"aw-create-card",onClick:F==="library"?N:bi,disabled:F==="library"&&!o,children:[a.jsx(ec,{"aria-hidden":!0}),a.jsx("span",{children:_(F==="library"?"agentWorkspace.newAgent":"agentWorkspace.newEvaluationGroup")})]}),F==="library"&&(A||E)&&a.jsx("div",{className:`aw-selection-toolbar${hn?" is-active":""}`,children:hn?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"aw-selection-count",children:_("agentWorkspace.selectedCount",{count:d0})}),a.jsx("button",{type:"button",onClick:GL,disabled:Sm===0||Nn,children:_("agentWorkspace.selectAll")}),a.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void x0(),disabled:d0===0||Nn,children:_(Nn?"common.deleting":"agentWorkspace.deleteSelected")}),a.jsx("button",{type:"button",onClick:XL,disabled:Nn,children:_("common.cancel")})]}):a.jsx("button",{type:"button",onClick:()=>{Fn(""),Sn(!0)},disabled:Sm===0,children:_("common.select")})}),F==="library"&&_i&&a.jsx("div",{className:"aw-delete-error",role:"alert",children:_i}),a.jsx("div",{className:"aw-agent-list",children:F==="evaluation"?hs.length===0?a.jsx("div",{className:"aw-list-empty",children:_("agentWorkspace.noMatchingEvaluationGroups")}):hs.map(de=>a.jsxs("button",{type:"button",className:`aw-agent-item${de.id===Mn?" is-active":""}`,onClick:()=>mn(de.id),children:[a.jsxs("span",{className:"aw-agent-copy aw-eval-group-copy",children:[a.jsx("strong",{children:TS(de.name,_)}),a.jsx("small",{children:_("agentWorkspace.groupStats",{agents:de.agentIds.length,runs:de.history.length})})]}),a.jsx(sE,{"aria-hidden":!0})]},de.id)):u&&ps.length===0&&zn.length===0?a.jsx("div",{className:"aw-list-empty",children:_("agentWorkspace.loadingCloudAgents")}):d&&ps.length===0&&zn.length===0?a.jsxs("div",{className:"aw-list-empty aw-list-error",children:[a.jsx("span",{children:d}),S&&a.jsx("button",{type:"button",onClick:S,children:_("common.retry")})]}):ps.length===0&&zn.length===0?a.jsx("div",{className:"aw-list-empty",children:_("myAgents.noMatchingAgents")}):a.jsxs(a.Fragment,{children:[zn.map(de=>{const Xe=f.filter(Xt=>Xt.draftId===de.id).sort((Xt,Ye)=>Ye.startedAt-Xt.startedAt)[0]??f.filter(Xt=>{var Ye,kn;return((Ye=Xt.agentDraft)==null?void 0:Ye.name)===de.draft.name||Xt.agentName===de.draft.name||!!((kn=de.deploymentTarget)!=null&&kn.runtimeId)&&Xt.runtimeId===de.deploymentTarget.runtimeId}).sort((Xt,Ye)=>Ye.startedAt-Xt.startedAt)[0],ut=_n.has(de.id);return a.jsxs("button",{type:"button",className:["aw-agent-item",hn?"is-selecting":"",ut?"is-selected-for-delete":"",de.id===z?"is-active":""].filter(Boolean).join(" "),"aria-pressed":hn?ut:void 0,onClick:()=>{if(hn){KL(de);return}Z(""),J(de.id),q("basic")},children:[hn&&a.jsx("span",{className:`aw-select-marker${ut?" is-checked":""}`,"aria-hidden":"true"}),a.jsxs("span",{className:"aw-agent-copy",children:[a.jsxs("span",{className:"aw-agent-name-row",children:[a.jsx("strong",{children:de.draft.name||_("agentSelector.unnamedAgent")}),a.jsx("span",{className:`aw-draft-badge${(Xe==null?void 0:Xe.status)==="running"?" is-deploying":""}`,children:(Xe==null?void 0:Xe.status)==="running"?_("myAgents.deploying"):_("myAgents.draft")})]}),a.jsx("small",{children:de.deploymentTarget?_("agentWorkspace.updatePending"):_("agentWorkspace.notPublished")})]}),a.jsx(sE,{"aria-hidden":!0})]},de.id)}),ps.map(de=>{const $e=de.runtimeId?Rt.get(de.runtimeId):void 0,Xe=de.runtimeId?On.get(de.runtimeId):void 0,ut=Ji.has(de.id),Xt=de.canDelete===!0,Ye=($e==null?void 0:$e.status)==="running"?{label:_("myAgents.deploying"),className:" is-deploying"}:($e==null?void 0:$e.status)==="error"?{label:_("agentWorkspace.failed"),className:" is-error"}:($e==null?void 0:$e.status)==="cancelled"?{label:_("agentWorkspace.cancelled"),className:" is-muted"}:Xe?{label:_("agentWorkspace.updatePending"),className:""}:null,kn=($e==null?void 0:$e.status)==="running"?_("agentWorkspace.updatingDeployment"):Xe?_("agentWorkspace.updatePending"):de.remote?de.host||_("agentWorkspace.remoteAgent"):_("agentWorkspace.localAgent"),Dr=["aw-agent-item","aw-agent-item--sortable",de.id===U?"is-active":"",hn?"is-selecting":"",ut?"is-selected-for-delete":"",hn&&!Xt?"is-selection-disabled":"",de.id===gt?"is-dragging":"",de.id===Ft&&de.id!==gt?`is-drop-target is-drop-${Je}`:""].filter(Boolean).join(" ");return a.jsxs("button",{type:"button",draggable:!!O&&!hn,className:Dr,"aria-pressed":hn?ut:void 0,"aria-keyshortcuts":O?"Alt+ArrowUp Alt+ArrowDown":void 0,onDragStart:yi=>{O&&(bl.current=!0,an(de.id),yi.dataTransfer.effectAllowed="move",yi.dataTransfer.setData("text/plain",de.id))},onDragEnter:yi=>{v0(yi,de.id)},onDragOver:yi=>{!gt||gt===de.id||(yi.preventDefault(),yi.dataTransfer.dropEffect="move",v0(yi,de.id))},onDragLeave:yi=>{const bs=yi.relatedTarget;bs instanceof Node&&yi.currentTarget.contains(bs)||Ft===de.id&&cn("")},onDrop:yi=>{yi.preventDefault();const bs=yi.dataTransfer.getData("text/plain")||gt;WL(bs,de.id,Je),an(""),cn(""),lt("before")},onDragEnd:()=>{an(""),cn(""),lt("before"),window.setTimeout(()=>{bl.current=!1},0)},onKeyDown:yi=>{yi.altKey&&(yi.key==="ArrowUp"?(yi.preventDefault(),Mb(de.id,-1)):yi.key==="ArrowDown"&&(yi.preventDefault(),Mb(de.id,1)))},onClick:yi=>{if(hn){yi.preventDefault(),Bk(de);return}if(bl.current){yi.preventDefault(),bl.current=!1;return}J(""),Z(de.id),q("basic"),j(de.id)},children:[hn&&a.jsx("span",{className:`aw-select-marker${ut?" is-checked":""}`,"aria-hidden":"true"}),a.jsxs("span",{className:"aw-agent-copy",children:[a.jsxs("span",{className:"aw-agent-name-row",children:[a.jsx("strong",{children:de.label}),de.currentVersion!=null&&a.jsxs("span",{className:"aw-version-badge",children:["v",de.currentVersion]}),Ye&&a.jsx("span",{className:`aw-draft-badge${Ye.className}`,children:Ye.label})]}),a.jsx("small",{children:kn})]}),a.jsx(sE,{"aria-hidden":!0})]},de.id)})]})}),a.jsx("div",{className:"aw-list-count",children:_("agentWorkspace.totalCount",{count:F==="library"?e.length+Gn:dt.length})})]}),F==="evaluation"&&c0?a.jsx(RXt,{group:c0,agents:e,cases:b0,onChange:Hh,onRun:YL}):F==="evaluation"?a.jsx("main",{className:"aw-main aw-empty-selection",children:a.jsx("p",{children:_("agentWorkspace.noEvaluationGroupSelected")})}):!re&&!Vn&&!gi?a.jsx("main",{className:"aw-main aw-empty-selection",children:a.jsx("p",{children:_("agentWorkspace.noAgentSelected")})}):a.jsxs("main",{className:`aw-main${Vh?" is-deploying":""}${x?" resource-page":""}`,children:[re&&!ae&&s&&a.jsx("div",{className:"aw-detail-loading",role:"status","aria-live":"polite",children:a.jsxs("div",{className:"aw-detail-loading-card",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsxs("span",{children:[a.jsx("strong",{children:_("agentWorkspace.loadingAgent")}),a.jsx("small",{children:_("agentWorkspace.loadingAgentDescription")})]})]})}),oe==="integrations"&&V&&a.jsx("div",{className:"aw-detail-loading",role:"status","aria-live":"polite",children:a.jsxs("div",{className:"aw-detail-loading-card",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsxs("span",{children:[a.jsx("strong",{children:_("agentWorkspace.probingIntegration")}),a.jsx("small",{children:_("agentWorkspace.probingIntegrationDescription")})]})]})}),a.jsx(dT,{className:"aw-agent-detail",title:Db,description:xn.description||_(s||x&&!yt?"agentWorkspace.loadingAgentInfo":"common.noDescription"),identitySeed:Db,backLabel:_("agentWorkspace.backToAgentList"),onBack:x?k:void 0,meta:a.jsxs(a.Fragment,{children:[vl!=null&&a.jsxs("span",{className:"aw-agent-meta",children:["v",vl]}),Vn&&a.jsx("span",{className:"aw-agent-meta",children:_("myAgents.draft")}),So&&a.jsx("span",{className:"aw-agent-meta",children:_("agentWorkspace.updatePending")}),!re&&!Vn&&gi&&a.jsx("span",{className:"aw-agent-meta",children:gi.label})]}),actionsClassName:"aw-head-actions",bodyClassName:"aw-agent-detail__body",actions:Vn||So||re!=null&&re.canDelete?a.jsxs(a.Fragment,{children:[(Vn||So)&&a.jsxs(At,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>{const de=Vn??So;de&&Am(de)},disabled:Nn,"aria-label":_("myAgents.deleteDraft"),title:_("myAgents.deleteDraft"),children:[a.jsx(Yg,{"aria-hidden":!0}),a.jsx("span",{children:_("myAgents.deleteDraft")})]}),(re==null?void 0:re.canDelete)&&a.jsxs(At,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>void Qr(re),disabled:Nn,"aria-label":_("agentWorkspace.deleteAgent"),title:_("agentWorkspace.deleteAgent"),children:[a.jsx(Yg,{"aria-hidden":!0}),a.jsx("span",{children:_(Nn?"common.deleting":"agentWorkspace.deleteAgent")})]})]}):void 0,sections:An.map(de=>{var $e,Xe,ut,Xt;return{key:de.id,label:de.label,disabled:Vh,content:de.id===oe?a.jsxs(a.Fragment,{children:[Ur&&Df&&a.jsx("div",{className:`aw-detail-deployment${Vh?" is-running":""}`,children:a.jsx(AXt,{task:Ur,onReturnToEdit:eu&&D?()=>D(eu):void 0})}),a.jsxs("div",{className:"aw-content",children:[oe==="basic"&&a.jsxs("div",{className:"aw-basic-stack",children:[fn&&a.jsx(vh,{className:"aw-detail-fetch-alert",color:"warning",variant:"soft",title:_("agentWorkspace.partialInfoUnavailable"),description:_("agentWorkspace.upgradeRuntimeForDetails")}),(kt&&!fn||We)&&a.jsx(vh,{className:"aw-detail-fetch-alert",color:"danger",variant:"soft",title:_("agentWorkspace.detailLoadFailed"),description:_("agentWorkspace.detailLoadFailedDescription"),actions:a.jsx(At,{type:"button",color:"danger",variant:"soft",size:"sm",pill:!1,onClick:()=>ot(Ye=>Ye+1),children:_("common.retry")})}),Ne==="mpa"&&(qs||Li||xr)&&a.jsx(vh,{className:"aw-detail-fetch-alert",color:xr==="bound"&&!Li?"success":"warning",variant:"soft",title:_("agentWorkspace.mpaControlPlane"),description:qs?_("agentWorkspace.loadingMpaAgentView"):Li||If||_(xr==="bound"?"agentWorkspace.mpaRuntimeBound":xr==="binding_ambiguous"?"agentWorkspace.mpaRuntimeBindingAmbiguous":xr==="orphan_runtime"?"agentWorkspace.mpaRuntimeOrphan":"agentWorkspace.mpaRuntimeMissing")}),re&&Ne!=="mpa"&&Ri&&!Ri.canUpdate&&a.jsxs("div",{className:"aw-update-recovery-notice",role:Ri.recoveryStatus==="preparing"?"status":"alert",children:[a.jsx("strong",{children:Ri.recoveryStatus==="preparing"?_("agentWorkspace.restoringUpdateConfig"):_("agentWorkspace.updateConfigUnavailable")}),yl&&a.jsx("span",{children:yl}),Wi.map(Ye=>a.jsx("span",{children:Ye},Ye))]}),a.jsxs("section",{className:"aw-deployment-panel aw-settings-card",children:[a.jsx("div",{className:"aw-section-head",children:a.jsxs("div",{children:[a.jsx("h3",{children:_("agentWorkspace.deploymentConfig")}),a.jsx("p",{children:_("agentWorkspace.deploymentConfigDescription")})]})}),a.jsxs("dl",{className:"aw-readonly-config",children:[a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.runtimeStatus")}),a.jsxs("dd",{className:(ne==null?void 0:ne.status.toLowerCase())==="ready"?"is-ready":void 0,children:[(ne==null?void 0:ne.status.toLowerCase())==="ready"&&a.jsx("span",{className:"aw-status-dot"}),(ne==null?void 0:ne.status)||_("agentWorkspace.loading")]})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.deploymentRegion")}),a.jsx("dd",{children:(ne==null?void 0:ne.region)||(re==null?void 0:re.region)||(Ur==null?void 0:Ur.region)||_("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.networkAccess")}),a.jsx("dd",{children:ne!=null&&ne.networkTypes.length?ne.networkTypes.join(" / "):_("agentWorkspace.notAvailable")})]})]})]}),a.jsxs("section",{className:"aw-canvas-card",children:[a.jsx("div",{className:"aw-card-head",children:a.jsx("strong",{children:_("agentWorkspace.executionFlow")})}),a.jsx("div",{className:"aw-canvas",children:a.jsx(RP,{draft:xn,direction:"horizontal",selectedPath:[],onSelect:()=>{},onAdd:()=>{},onInsert:()=>{},onDelete:()=>{},readOnly:!0,interactivePreview:!0},Eo)})]}),a.jsxs("section",{className:"aw-details-card",children:[a.jsx("div",{className:"aw-card-head",children:a.jsx("strong",{children:_("agentWorkspace.details")})}),a.jsxs("dl",{className:"aw-facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:_("agentSelector.model")}),a.jsx("dd",{children:fH(ae==null?void 0:ae.model)||xn.modelName||_("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.agentCountLabel")}),a.jsx("dd",{children:ae!=null&&ae.graph?o9e(ae.graph):l9e(xn)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentSelector.tools")}),a.jsx("dd",{className:"aw-fact-badges",children:h0.length?h0.map(Ye=>a.jsx("span",{children:Ye},Ye)):_("agentWorkspace.none")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentSelector.skills")}),a.jsx("dd",{className:"aw-fact-badges",children:Ik===null?_("agentSelector.previewUnsupported"):Ik.length?Ik.map(Ye=>a.jsx("span",{children:Ye},Ye)):_("agentWorkspace.none")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("systemInfo.currentVersion")}),a.jsx("dd",{children:vl!=null?`v${vl}`:_("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentSelector.status")}),a.jsx("dd",{children:Vn?_("myAgents.draft"):(Ur==null?void 0:Ur.status)==="error"?_("agentWorkspace.deploymentFailed"):(Ur==null?void 0:Ur.status)==="cancelled"?_("agentWorkspace.cancelled"):So?_("agentWorkspace.updatePending"):a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"aw-status-dot"}),_("skillCenter.status.available")]})})]})]})]}),a.jsxs("section",{className:"aw-sidecar-panel aw-settings-card","aria-label":_("agentWorkspace.selectedOptimizations"),children:[a.jsx("div",{className:"aw-section-head",children:a.jsxs("div",{children:[a.jsx("h3",{children:_("agentWorkspace.selectedOptimizations")}),a.jsx("p",{children:_("agentWorkspace.selectedOptimizationsDescription")})]})}),a.jsxs("dl",{className:"aw-readonly-config",children:[a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.configurationStatus")}),a.jsx("dd",{className:Ku!=null&&Ku.enabled?"is-ready":void 0,children:Ku?Ku.enabled?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"aw-status-dot"}),_("skillCenter.status.enabled")]}):_("skillCenter.status.inactive"):_("agentWorkspace.notRecorded")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.optimizationProfile")}),a.jsx("dd",{children:Ku?cmt(Ku.profile):_("agentWorkspace.legacyConfigMissing")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.selectedOptimizations")}),a.jsx("dd",{className:"aw-fact-badges",children:Ku?r2.length?r2.map(Ye=>a.jsx("span",{children:SN(Ye)},Ye)):_("agentWorkspace.noneSelected"):_("agentWorkspace.legacyConfigMissing")})]})]})]})]}),oe==="usage"&&(re==null?void 0:re.runtimeId)&&a.jsxs("section",{className:"aw-usage","aria-busy":ml,children:[a.jsx("div",{className:"aw-usage-intro",children:a.jsx("h3",{children:_("agentWorkspace.usageOverview")})}),ml&&!Bi&&a.jsx("div",{className:"aw-usage-state",role:"status","aria-live":"polite",children:a.jsx(on,{as:"span",children:_("agentWorkspace.loadingUsage")})}),mi&&a.jsxs("div",{className:"aw-usage-state is-error",role:"alert",children:[a.jsx("span",{children:mi}),a.jsx("button",{type:"button",onClick:()=>dc(Ye=>Ye+1),children:_("common.retry")})]}),!ml&&!mi&&!Bi&&!ze&&a.jsx("div",{className:"aw-usage-state",children:_("agentWorkspace.usageUnavailable")}),Bi&&a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"aw-usage-summary","aria-label":_("agentWorkspace.usageSummary"),children:[a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.totalCalls")}),a.jsx("dd",{children:Bi.totalInvocations.toLocaleString(L.resolvedLanguage??L.language)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.userCount")}),a.jsx("dd",{children:Bi.totalUsers.toLocaleString(L.resolvedLanguage??L.language)})]})]}),a.jsxs("div",{className:"aw-usage-users-head",children:[a.jsx("h3",{children:_("agentWorkspace.userDetails")}),ml&&a.jsx(on,{as:"span",role:"status","aria-live":"polite",children:_("agentWorkspace.refreshing")})]}),Bi.users.length===0?a.jsx("div",{className:"aw-usage-state",children:_("agentWorkspace.noUsage")}):a.jsx("div",{className:"aw-usage-table-wrap",children:a.jsxs("table",{className:"aw-usage-table",children:[a.jsx("caption",{children:_("agentWorkspace.usageUserList")}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:_("agentWorkspace.user")}),a.jsx("th",{scope:"col",children:_("agentWorkspace.callCount")}),a.jsx("th",{scope:"col",children:_("agentWorkspace.lastUsed")})]})}),a.jsx("tbody",{children:Bi.users.map(Ye=>a.jsxs("tr",{children:[a.jsxs("td",{children:[a.jsx("strong",{children:Ye.displayName||Ye.userId||_("agentWorkspace.unknownUser")}),Ye.displayName&&Ye.userId&&a.jsx("small",{title:Ye.userId,children:Ye.userId})]}),a.jsx("td",{children:Ye.invocationCount.toLocaleString(L.resolvedLanguage??L.language)}),a.jsx("td",{children:a.jsx("time",{dateTime:Ye.lastUsedAt,children:i9e(Ye.lastUsedAt,L.resolvedLanguage??L.language,_)})})]},Ye.userId))})]})}),Bi.totalPages>1&&a.jsxs("nav",{className:"aw-usage-pagination","aria-label":_("agentWorkspace.usagePagination"),children:[a.jsx("button",{type:"button",disabled:ml||Bi.page<=1,onClick:()=>Hs(Ye=>Math.max(1,Ye-1)),children:_("common.previousPage")}),a.jsx("span",{"aria-live":"polite",children:_("agentWorkspace.pageOf",{page:Bi.page,total:Bi.totalPages})}),a.jsx("button",{type:"button",disabled:ml||Bi.page>=Bi.totalPages,onClick:()=>Hs(Ye=>Ye+1),children:_("common.nextPage")})]})]})]}),oe==="sessionConfig"&&a.jsx(uXt,{config:er,profileStatus:Br,loadable:Qh,disabledReason:a2,loading:wo,saving:$d,upgrading:Hc,error:Rf,notice:Uh,modelValue:vo,modelDirty:Yc,profileUpgradeAvailable:zh,onModelChange:xo,onSaveModel:()=>void Mk(),onInheritModel:()=>void Mk("inherit"),onClearMcp:()=>void l2("clear"),onInheritMcp:()=>void l2("inherit"),onUpgradeProfile:()=>void g0(),onRefresh:()=>Ho(Ye=>Ye+1)}),oe==="profileConfig"&&a.jsx(cXt,{profile:s2,profileStatus:Br,runtimeReady:Ib,disabledReason:f0,saving:qo.saving,error:qo.error,notice:qo.notice,onApply:()=>void c2(),onEditProfile:VL,onRefresh:()=>ot(Ye=>Ye+1)}),oe==="diagnostics"&&a.jsx(hXt,{data:o0,loadable:!Em,disabledReason:Em,loading:ia,error:Ir,onRefresh:()=>Bh(Ye=>Ye+1),locale:L.resolvedLanguage??L.language}),oe==="versions"&&a.jsxs("section",{className:"aw-version-stack",children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:_("agentWorkspace.githubVersions")}),a.jsx("p",{children:($e=ye==null?void 0:ye.cicd)!=null&&$e.enabled?_("agentWorkspace.githubVersionsDescription"):_("agentWorkspace.currentVersionOnly")})]}),Ee&&a.jsx("div",{className:"aw-case-empty",children:_("agentWorkspace.loadingVersions")}),Be&&a.jsxs("div",{className:"aw-integration-error",role:"alert",children:[a.jsx("span",{children:Be}),(re==null?void 0:re.runtimeId)&&a.jsx("button",{type:"button",onClick:()=>void dN(re.runtimeId??"").then(Ae),children:_("common.retry")})]}),!Ee&&!Be&&a.jsxs("div",{className:"aw-version-list",children:[(ye==null?void 0:ye.githubSyncError)&&a.jsx("div",{className:"aw-integration-error",role:"alert",children:a.jsx("span",{children:ye.githubSyncError})}),(ye==null?void 0:ye.latestSourceRuntimeStatus)&&ye.latestSourceRuntimeStatus!=="published"&&((Xe=ye.versions[0])==null?void 0:Xe.commitSha)&&ye.versions[0].commitSha!==ye.currentCommitSha&&a.jsx("div",{className:"aw-integration-notice",role:"status",children:a.jsxs("span",{children:[_("agentWorkspace.sourceMergedRuntimeStill"),Qoe(ye.latestSourceRuntimeStatus,_),_("agentWorkspace.currentProductionVersionHint")]})}),ye!=null&&ye.versions.length?ye.versions.map(Ye=>{var Qa;const kn=Ye.commitSha??"",Dr=Ye.runtimeStatus??Ye.status,yi=Ye.changeType==="rollback",bs=!!((Qa=ye.cicd)!=null&&Qa.enabled)&&!!kn&&!yi&&kn!==ye.currentCommitSha;return a.jsxs("article",{className:"aw-version-row",children:[a.jsxs("div",{children:[a.jsx("strong",{children:rXt(Ye,_)}),a.jsx("small",{children:Ye.createdAt||_("agentWorkspace.noTime")})]}),a.jsxs("div",{children:[a.jsx("span",{children:_("agentWorkspace.prLink")}),Ye.pullRequestUrl?a.jsx("a",{href:Ye.pullRequestUrl,target:"_blank",rel:"noopener noreferrer",children:_("agentWorkspace.viewPr")}):a.jsx("em",{children:_("agentWorkspace.noPr")})]}),a.jsxs("div",{children:[a.jsx("span",{children:_("agentWorkspace.author")}),a.jsx("em",{children:Ye.author||"Studio"})]}),a.jsxs("div",{children:[a.jsx("span",{children:_("agentWorkspace.publishStatus")}),a.jsx("em",{children:Qoe(Dr,_)})]}),a.jsxs("div",{className:"aw-version-actions",children:[a.jsx("button",{type:"button",disabled:!bs||ie===kn,onClick:()=>void zL(Ye),children:_(ie===kn?"agentWorkspace.rollingBack":"agentWorkspace.rollbackToVersion")}),Ye.workflowRunUrl&&a.jsx("a",{href:Ye.workflowRunUrl,target:"_blank",rel:"noopener noreferrer",children:_("agentWorkspace.viewRelease")})]})]},`${Ye.version}-${kn||Ye.createdAt}`)}):a.jsxs("article",{className:"aw-version-row",children:[a.jsxs("div",{children:[a.jsx("strong",{children:vl!=null?`v${vl}`:_("agentWorkspace.noVersion")}),a.jsx("small",{children:(ne==null?void 0:ne.updatedAt)||_("agentWorkspace.noTime")})]}),a.jsx("p",{children:_("agentWorkspace.currentVersionOnly")})]})]})]}),oe==="integrations"&&a.jsxs("div",{className:"aw-integration-stack",children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:_("agentWorkspace.integrationMethods")}),a.jsx("p",{children:_("agentWorkspace.integrationDescription")})]}),K&&a.jsxs("div",{className:"aw-integration-error",role:"alert",children:[a.jsx("span",{children:K}),a.jsx("button",{type:"button",onClick:()=>Oe(Ye=>Ye+1),children:_("common.retry")})]}),!K&&a.jsxs("div",{className:"aw-integration-body",children:[a.jsxs("div",{className:`aw-integration-protocol-tabs${fe==="a2a"?" is-a2a":""}`,role:"tablist","aria-label":_("agentWorkspace.integrationProtocol"),children:[a.jsx("span",{className:"aw-integration-protocol-slider","aria-hidden":"true"}),LO.map((Ye,kn)=>a.jsx("button",{type:"button",id:`integration-${Ye.id}-tab`,role:"tab","aria-selected":fe===Ye.id,"aria-controls":`integration-${Ye.id}-panel`,tabIndex:fe===Ye.id?0:-1,onClick:()=>Pk(Ye.id),onKeyDown:Dr=>{var Qa;if(!["ArrowLeft","ArrowRight","Home","End"].includes(Dr.key))return;Dr.preventDefault();const yi=Dr.key==="Home"?0:Dr.key==="End"?LO.length-1:(kn+(Dr.key==="ArrowRight"?1:-1)+LO.length)%LO.length,bs=LO[yi];Pk(bs.id),(Qa=document.getElementById(`integration-${bs.id}-tab`))==null||Qa.focus()},children:Ye.label},Ye.id))]}),fe==="api-server"?a.jsx(Voe,{protocol:"api-server",title:"API Server",available:Zc,fields:[{label:"Agent",value:Zc?((ut=Xn==null?void 0:Xn.apiApps)==null?void 0:ut.join("、"))??"":""},{label:_("agentWorkspace.discoveryEndpoint"),value:Zc?u6(Ll,"/list-apps"):""},{label:_("agentWorkspace.invocationEndpoint"),value:Zc?u6(Ll,"/run_sse"):""},{label:_("agentWorkspace.authentication"),value:Zc?Uoe(ne==null?void 0:ne.authType,_):""},{label:"API Key",value:a.jsx(zoe,{available:Zc,authType:ne==null?void 0:ne.authType,value:$i,visible:Le&&!!$i,loading:Ge,error:se,onToggle:()=>void m0()})}],example:Zc?sXt(Ll,Pb,ne==null?void 0:ne.authType):""}):a.jsx(Voe,{protocol:"a2a",title:"A2A",available:xa,fields:[{label:"Agent",value:((Xt=Xn==null?void 0:Xn.a2a)==null?void 0:Xt.name)??""},{label:"Agent Card",value:xa?u6(Ll,"/.well-known/agent-card.json"):""},{label:_("agentWorkspace.invocationUrl"),value:Pf},{label:_("agentWorkspace.authentication"),value:xa?Uoe(ne==null?void 0:ne.authType,_):""},{label:"API Key",value:a.jsx(zoe,{available:xa,authType:ne==null?void 0:ne.authType,value:$i,visible:Le&&!!$i,loading:Ge,error:se,onToggle:()=>void m0()})}],example:xa?aXt(Pf,ne==null?void 0:ne.authType):""})]})]}),oe==="evaluations"&&a.jsxs("section",{className:"aw-cases",children:[(re==null?void 0:re.runtimeId)&&a.jsx("div",{className:"aw-case-summary",children:["good","bad"].map(Ye=>{const kn=xXt(xt,Ye),Dr=b0.filter(bs=>bs.kind===Ye).length,yi=sa?Dr:(kn==null?void 0:kn.itemCount)??Dr;return a.jsxs("button",{type:"button",onClick:()=>HL(Ye),children:[a.jsx("strong",{children:yi}),a.jsx("span",{children:_(Ye==="good"?"agentWorkspace.goodCases":"agentWorkspace.badCases")})]},Ye)})}),a.jsxs("div",{className:"aw-case-filter-bar",children:[a.jsxs("div",{className:"aw-case-filter-stack",children:[a.jsx("div",{className:"aw-case-filters","aria-label":_("agentWorkspace.caseResultFilter"),children:["good","bad"].map(Ye=>a.jsx("button",{type:"button",className:Ct===Ye?"is-active":"","aria-pressed":Ct===Ye,onClick:()=>Ot(Ye),children:_(Ye==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")},Ye))}),a.jsx("div",{className:"aw-case-source-filters","aria-label":_("agentWorkspace.feedbackSourceFilter"),children:["auto","user"].map(Ye=>a.jsx("button",{type:"button",className:Ze===Ye?"is-active":"","aria-pressed":Ze===Ye,onClick:()=>bt(Ye),children:_(Ye==="auto"?"agentWorkspace.automaticFeedback":"agentWorkspace.manualFeedback")},Ye))})]}),a.jsxs("label",{className:"aw-case-search",children:[a.jsx(dI,{"aria-hidden":!0}),a.jsx("input",{type:"search",value:Bt,onChange:Ye=>Dt(Ye.currentTarget.value),placeholder:_("agentWorkspace.searchCasesPlaceholder"),"aria-label":_("agentWorkspace.searchCases")})]})]}),Lk&&a.jsx("div",{className:`aw-case-toolbar${Wc?" is-active":""}`,children:Wc?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"aw-selection-count",children:_("agentWorkspace.selectedCaseCount",{count:y0.length})}),a.jsx("button",{type:"button",onClick:Bd,disabled:Cm.length===0||nn,children:_("agentWorkspace.selectAllVisible")}),a.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void d2(y0),disabled:y0.length===0||nn,children:_(nn?"common.deleting":"agentWorkspace.deleteSelected")}),a.jsx("button",{type:"button",onClick:u2,disabled:nn,children:_("common.cancel")})]}):a.jsx("button",{type:"button",onClick:()=>{Pr(""),ko(!0)},disabled:Cm.length===0||nn,children:_("agentWorkspace.selectCases")})}),Kc&&a.jsx("div",{className:"aw-delete-error",role:"alert",children:Kc}),a.jsx("div",{ref:Ml,children:a.jsx(NXt,{cases:Cm,loading:jn&&Cm.length===0,error:ta,notice:ts,runtimeBacked:!!(re!=null&&re.runtimeId),selectionMode:Wc,selectedCaseIds:ya,focusedCaseId:dr,expandedCaseIds:Wu,deleting:nn,canDelete:Lk,onOpenCase:qL,onToggleCase:$k,onToggleExpanded:Fk,onDeleteCase:Ye=>void d2([Ye]),onRetry:()=>$r(Ye=>Ye+1)})})]}),oe==="optimizations"&&a.jsxs("section",{className:"aw-optimizations",children:[a.jsxs("div",{className:"aw-optimization-intro",children:[a.jsx("h3",{children:_("agentWorkspace.optimizations")}),a.jsx("p",{children:_("agentWorkspace.optimizationsDescription")})]}),Il?a.jsxs("div",{className:"aw-optimization-state",role:"status",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsx("span",{children:_("agentWorkspace.loadingOptimizations")})]}):ge?a.jsxs("div",{className:"aw-optimization-state is-error",role:"alert",children:[a.jsx("span",{children:ge}),a.jsx("button",{type:"button",onClick:()=>bo(Ye=>Ye+1),children:_("common.retry")})]}):na.length>0?a.jsx(_Xt,{groups:na}):a.jsx("div",{className:"aw-optimization-state",children:_("agentWorkspace.noOptimizations")})]})]}),oe==="basic"&&(re||Vn)&&a.jsxs("div",{className:"aw-basic-actions",children:[re&&a.jsxs("button",{type:"button",className:"aw-talk studio-update-action",onClick:()=>T==null?void 0:T(re),children:[a.jsx(qat,{"aria-hidden":!0}),a.jsx("span",{children:_("agentWorkspace.chat")})]}),Ne!=="mpa"&&a.jsxs("span",{className:`aw-update-wrap${Fd?" is-disabled":""}`,tabIndex:Fd?0:void 0,"aria-describedby":Fd?Rk:void 0,children:[a.jsx("button",{type:"button",className:"aw-update studio-update-action",disabled:!!Fd,"aria-busy":_t||void 0,"aria-describedby":Fd?Rk:void 0,onClick:()=>{if(Vn){D==null||D(Vn);return}Ri&&P(Ri)},children:_t?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"loading-gap-spinner aw-update-spinner","aria-hidden":"true"}),a.jsx("span",{children:_("agentWorkspace.preparing")})]}):_(Vn||So?"agentWorkspace.continueEditing":"agentWorkspace.update")}),Fd&&a.jsx("span",{id:Rk,className:"aw-update-disabled-reason",role:"tooltip",children:Fd})]})]})]}):null}}),activeSectionKey:oe,navigationLabel:_("agentWorkspace.agentDetails"),onSectionChange:q})]})]}),F==="evaluation"&&a.jsx("div",{className:"aw-evaluation-glass",role:"status",children:a.jsx("span",{children:_("agentWorkspace.comingSoon")})})]})]}),Rn&&a.jsx(_d,{variant:"danger",title:Rn.title,description:Rn.description,error:_i||void 0,confirmLabel:Nn?_("common.deleting"):Rn.confirmLabel,closeLabel:_("agentWorkspace.closeDeleteConfirmation"),busy:Nn,confirmDisabled:Rn.canConfirm===!1,onCancel:()=>{var de;(de=Kn.current)==null||de.abort(),Kn.current=null,nt(null),Fn("")},onConfirm:()=>void w0()})]})}function _Xt({groups:e}){const{t}=_e("ui");return a.jsx("div",{className:"aw-optimization-table-wrap",children:a.jsxs("table",{className:"aw-optimization-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:t("agentWorkspace.fixPriority")}),a.jsx("th",{scope:"col",children:t("agentWorkspace.suggestedModule")}),a.jsx("th",{scope:"col",children:t("agentWorkspace.suggestionAndReason")})]})}),a.jsx("tbody",{children:e.map(n=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx("span",{className:`aw-priority is-${n.priority}`,children:bXt(n.priority,t)})}),a.jsx("td",{children:a.jsx("span",{className:"aw-optimization-module",children:vXt(n,t)})}),a.jsx("td",{children:a.jsx("ul",{className:"aw-optimization-list",children:n.items.map(i=>a.jsxs("li",{children:[a.jsx("strong",{children:i.suggestion}),a.jsx("p",{children:i.reason})]},`${i.suggestion}:${i.reason}`))})})]},`${n.priority}:${n.module}:${n.customModule??""}`))})]})})}function jXt(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M4.5 7h15"}),a.jsx("path",{d:"M9 7V4.8h6V7"}),a.jsx("path",{d:"m6.5 7 .8 12h9.4l.8-12"}),a.jsx("path",{d:"M10 10.5v5M14 10.5v5"})]})}function NXt({cases:e,loading:t=!1,error:n="",notice:i="",runtimeBacked:r=!1,selectionMode:s=!1,selectedCaseIds:o,focusedCaseId:l="",expandedCaseIds:c,deleting:u=!1,canDelete:d=!1,onOpenCase:f,onToggleCase:h,onToggleExpanded:m,onDeleteCase:g,onRetry:b}){const{t:v,i18n:y}=_e("ui");return a.jsxs("div",{className:"aw-case-table",children:[a.jsxs("div",{className:"aw-case-row aw-case-row-head",children:[a.jsx("span",{children:v("agentWorkspace.userInput")}),a.jsx("span",{children:v("agentWorkspace.agentOutput")}),a.jsx("span",{children:v("agentWorkspace.score")}),a.jsx("span",{children:v("agentWorkspace.scoreReason")}),a.jsx("span",{className:"aw-case-action-head",children:v("skillCenter.actions")})]}),t?a.jsx("div",{className:"aw-case-empty",children:v("agentWorkspace.loadingEvaluationSet")}):n?a.jsxs("div",{className:"aw-case-empty aw-case-error",children:[a.jsx("span",{children:n}),b&&a.jsx("button",{type:"button",onClick:b,children:v("common.retry")})]}):i?a.jsx("div",{className:"aw-case-empty",children:i}):e.length===0?a.jsx("div",{className:"aw-case-empty",children:v(r?"agentWorkspace.noFeedbackCases":"agentWorkspace.noMatchingCases")}):e.map(w=>{var T,R;const x=w.id.startsWith("local:"),k=(o==null?void 0:o.has(w.id))??!1,S=(c==null?void 0:c.has(w.id))??!1,A=w.output.length+w.referenceOutput.length>220||(((T=w.reason)==null?void 0:T.length)??0)>120,E=d&&!x,j=!!(w.comment&&w.comment.trim()!==((R=w.reason)==null?void 0:R.trim()));return a.jsxs("div",{className:["aw-case-row",l===w.id?"is-focused":"",s?"is-selecting":"",k?"is-selected-for-delete":""].filter(Boolean).join(" "),role:"row",tabIndex:0,"aria-selected":s?k:void 0,onClick:()=>{if(s){E&&(h==null||h(w));return}f==null||f(w)},onKeyDown:C=>{C.target===C.currentTarget&&(C.key!=="Enter"&&C.key!==" "||(C.preventDefault(),s?E&&(h==null||h(w)):f==null||f(w)))},children:[a.jsxs("div",{className:"aw-case-text aw-case-cell","data-label":v("agentWorkspace.userInput"),children:[a.jsxs("span",{className:"aw-case-title-line",children:[s&&E&&a.jsx("span",{className:`aw-select-marker${k?" is-checked":""}`,"aria-hidden":"true"}),a.jsx("strong",{title:w.input,children:w.input||v("agentWorkspace.noUserInput")})]}),j&&a.jsxs("small",{title:w.comment,children:[v("agentWorkspace.note"),w.comment]}),a.jsx("small",{className:"aw-case-time",children:mXt(w.createdAt,y.resolvedLanguage??y.language,v)}),(w.userId||w.sessionId)&&a.jsx("small",{title:[w.userId,w.sessionId].filter(Boolean).join(" · "),children:[w.userId,w.sessionId].filter(Boolean).join(" · ")})]}),a.jsxs("div",{className:`aw-case-output aw-case-cell${S?" is-expanded":""}`,"data-label":v("agentWorkspace.agentOutput"),children:[a.jsx("p",{className:"aw-case-output-preview",title:w.output,children:w.output||v("agentWorkspace.noVisibleResponse")}),w.referenceOutput&&a.jsxs("small",{className:"aw-case-output-preview",title:w.referenceOutput,children:[v("agentWorkspace.reference"),": ",w.referenceOutput]}),A&&a.jsx("button",{type:"button",className:"aw-case-expand",onClick:C=>{C.stopPropagation(),m==null||m(w.id)},children:v(S?"common.collapse":"common.expand")})]}),a.jsx("div",{className:"aw-case-score aw-case-cell","data-label":v("agentWorkspace.score"),children:gXt(w,v)}),a.jsx("div",{className:`aw-case-reason aw-case-cell${S?" is-expanded":""}`,"data-label":v("agentWorkspace.scoreReason"),children:a.jsx("p",{title:w.reason||void 0,children:w.reason||"—"})}),a.jsx("div",{className:"aw-case-actions aw-case-cell","data-label":v("skillCenter.actions"),children:E&&a.jsx("button",{type:"button",className:"aw-case-delete",onClick:C=>{C.stopPropagation(),g==null||g(w)},disabled:u,title:v("agentWorkspace.deleteFeedbackCase"),"aria-label":v("agentWorkspace.deleteFeedbackCase"),children:a.jsx(jXt,{})})})]},w.id)})]})}function RXt({group:e,agents:t,cases:n,onChange:i,onRun:r}){const{t:s}=_e("ui"),[o,l]=p.useState("config"),c=e.agentIds.map(h=>t.find(m=>m.id===h)).filter(h=>!!h),u=["回答质量","事实准确性","工具调用","响应效率"];p.useEffect(()=>l("config"),[e.id]);const d=h=>{i({...e,agentIds:e.agentIds.includes(h)?e.agentIds.filter(m=>m!==h):[...e.agentIds,h]})},f=h=>{i({...e,metrics:e.metrics.includes(h)?e.metrics.filter(m=>m!==h):[...e.metrics,h]})};return a.jsxs("main",{className:"aw-main",children:[a.jsxs("div",{className:"aw-eval-head",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"aw-agent-title-row",children:[a.jsx("h2",{children:TS(e.name,s)}),a.jsx("span",{children:s("agentWorkspace.evaluationGroup")})]}),a.jsx("p",{children:s("agentWorkspace.evaluationGroupStats",{agents:c.length,caseSet:TS(e.caseSet,s),runs:e.history.length})})]}),a.jsxs("button",{type:"button",className:"aw-run",onClick:()=>r(e),disabled:!0,children:[a.jsx(Fat,{"aria-hidden":!0}),s("agentWorkspace.startEvaluation")]})]}),a.jsxs("nav",{className:"aw-agent-tabs","aria-label":s("agentWorkspace.evaluationGroupDetails"),children:[a.jsx("button",{type:"button",className:o==="config"?"is-active":"","aria-pressed":o==="config",onClick:()=>l("config"),disabled:!0,children:s("agentWorkspace.evaluationConfig")}),a.jsx("button",{type:"button",className:o==="history"?"is-active":"","aria-pressed":o==="history",onClick:()=>l("history"),disabled:!0,children:s("agentWorkspace.historyResults")})]}),a.jsx("div",{className:"aw-content",children:o==="config"?a.jsxs("div",{className:"aw-eval-setup",children:[a.jsxs("section",{className:"aw-eval-block",children:[a.jsxs("div",{className:"aw-card-head",children:[a.jsx("strong",{children:s("agentWorkspace.participatingAgents")}),a.jsx("span",{children:s("agentWorkspace.selectedCount",{count:c.length})})]}),a.jsx("div",{className:"aw-eval-agent-grid",children:t.map(h=>a.jsxs("label",{children:[a.jsx("input",{type:"checkbox",checked:e.agentIds.includes(h.id),onChange:()=>d(h.id)}),a.jsxs("span",{children:[a.jsx("strong",{children:h.label}),a.jsx("small",{children:h.remote?s("agentWorkspace.remote"):s("agentWorkspace.local")})]})]},h.id))})]}),a.jsxs("div",{className:"aw-eval-setting-grid",children:[a.jsxs("section",{className:"aw-eval-block",children:[a.jsx("div",{className:"aw-card-head",children:a.jsx("strong",{children:s("agentWorkspace.evaluationResources")})}),a.jsxs("div",{className:"aw-eval-fields",children:[a.jsxs("label",{children:[a.jsx("span",{children:s("agentWorkspace.evaluationSet")}),a.jsxs("select",{value:e.caseSet,onChange:h=>i({...e,caseSet:h.currentTarget.value}),children:[a.jsx("option",{value:"核心回归集",children:s("agentWorkspace.evaluationDefaults.coreSet")}),a.jsx("option",{value:"安全边界集",children:s("agentWorkspace.evaluationDefaults.safetySet")}),a.jsx("option",{value:"工具调用集",children:s("agentWorkspace.evaluationDefaults.toolSet")})]}),a.jsx("small",{children:s("agentWorkspace.caseCount",{count:n.length})})]}),a.jsxs("label",{children:[a.jsx("span",{children:s("agentWorkspace.evaluator")}),a.jsxs("select",{value:e.evaluator,onChange:h=>i({...e,evaluator:h.currentTarget.value}),children:[a.jsx("option",{value:"综合质量评估器",children:s("agentWorkspace.evaluationDefaults.qualityEvaluator")}),a.jsx("option",{value:"事实一致性评估器",children:s("agentWorkspace.evaluationDefaults.factualEvaluator")}),a.jsx("option",{value:"工具调用评估器",children:s("agentWorkspace.evaluationDefaults.toolEvaluator")})]})]}),a.jsxs("label",{children:[a.jsx("span",{children:s("agentWorkspace.concurrency")}),a.jsxs("select",{value:e.concurrency,onChange:h=>i({...e,concurrency:h.currentTarget.value}),children:[a.jsx("option",{value:"2",children:"2"}),a.jsx("option",{value:"4",children:"4"}),a.jsx("option",{value:"8",children:"8"})]})]})]})]}),a.jsxs("section",{className:"aw-eval-block",children:[a.jsxs("div",{className:"aw-card-head",children:[a.jsx("strong",{children:s("agentWorkspace.evaluationMetrics")}),a.jsx("span",{children:s("agentWorkspace.selectedMetricCount",{count:e.metrics.length})})]}),a.jsx("div",{className:"aw-metric-list",children:u.map(h=>a.jsxs("label",{children:[a.jsx("input",{type:"checkbox",checked:e.metrics.includes(h),onChange:()=>f(h)}),a.jsx("span",{children:TS(h,s)})]},h))})]})]})]}):a.jsxs("section",{className:"aw-eval-history",children:[a.jsx("div",{className:"aw-section-head",children:a.jsxs("div",{children:[a.jsx("h3",{children:s("agentWorkspace.historyResults")}),a.jsx("p",{children:s("agentWorkspace.historyDescription")})]})}),e.history.length===0?a.jsxs("div",{className:"aw-results-empty",children:[a.jsx("strong",{children:s("agentWorkspace.noHistory")}),a.jsx("span",{children:s("agentWorkspace.noHistoryDescription")})]}):a.jsx("div",{className:"aw-history-list",children:e.history.map((h,m)=>a.jsxs("button",{type:"button",children:[a.jsxs("span",{children:[a.jsx("strong",{children:s("agentWorkspace.evaluationRun",{index:e.history.length-m})}),a.jsx("small",{children:s("agentWorkspace.evaluationRunMeta",{time:TS(h.createdAt,s),agents:c.length})})]}),a.jsxs("span",{className:"aw-history-score",children:[a.jsx("strong",{children:h.score}),a.jsx("small",{children:s("agentWorkspace.overallScore")})]}),a.jsxs("span",{className:"aw-complete",children:[a.jsx(Of,{}),s("agentWorkspace.completed")]}),a.jsx(sE,{"aria-hidden":!0})]},h.id))})]})})]})}async function mK(e,t={}){const n=await fetch(Na(`/web/agent-reviews${e}`),{...t,headers:hl(oc({"Content-Type":"application/json"})),signal:po(t.signal??void 0,6e4)});if(!n.ok)throw new Error(await n.text());return n.json()}function IXt(e,t){return mK(`?${new URLSearchParams({region:e})}`,{signal:t})}function PXt(e,t,n){return mK(`/${encodeURIComponent(e)}?${new URLSearchParams({region:t})}`,{signal:n})}function DXt(e,t,n){return mK(`/${encodeURIComponent(e)}/${t}`,{method:"POST",body:JSON.stringify(n)})}const MXt=20,Woe=256;function d6({label:e,value:t,onChange:n,limit:i,disabled:r,required:s=!1}){const{t:o}=_e("agentReviews");return a.jsxs("label",{children:[e,a.jsx("textarea",{"aria-label":e,value:t,onChange:l=>n(Array.from(l.target.value).slice(0,i).join("")),maxLength:i*2,disabled:r,required:s,rows:3}),a.jsx("span",{className:"agent-review-text-count",children:o("textCount",{count:Array.from(t).length,limit:i})})]})}function IP({person:e}){return a.jsxs("span",{className:"agent-review-person",title:e.email||e.name,children:[e.avatarUrl?a.jsx("img",{src:e.avatarUrl,alt:"",referrerPolicy:"no-referrer",onError:t=>{t.currentTarget.hidden=!0}}):null,a.jsx("span",{children:e.name||e.id})]})}function f9e({runtimeId:e,region:t,name:n,canPublish:i,onClose:r,onChanged:s}){const{t:o,i18n:l}=_e("agentReviews"),[c,u]=p.useState(null),[d,f]=p.useState(!0),[h,m]=p.useState(!1),[g,b]=p.useState(""),[v,y]=p.useState(""),[w,x]=p.useState(""),[k,S]=p.useState(""),[O,A]=p.useState(0),[E,j]=p.useState(!1),[T,R]=p.useState(null);p.useEffect(()=>{const _=new AbortController;return f(!0),b(""),PXt(e,t,_.signal).then(L=>{_.signal.aborted||u(L.application)}).catch(L=>{_.signal.aborted||b(L instanceof Error?L.message:String(L))}).finally(()=>{_.signal.aborted||f(!1)}),()=>_.abort()},[e,t,O]);async function C(_,L){if(!h){m(!0),b("");try{const F=await DXt(e,_,{region:t,..._==="submit"?{message:v}:{},..._==="publish"||_==="decision"?{comment:w}:{},..._==="decision"?{applicationId:c==null?void 0:c.id,decision:L,reason:k}:{}});u(F),x(""),S(""),j(!1),R(null),s()}catch(F){b(F instanceof Error?F.message:String(F))}finally{m(!1)}}}const N=(c==null?void 0:c.status)==="pending",P=!!(c!=null&&c.published),I=!N&&!P,D=_=>new Date(_).toLocaleString(l.language);return a.jsx(t0,{open:!0,onOpenChange:_=>{!_&&!h&&r()},children:a.jsxs(e0,{children:[a.jsx(Zv,{className:"agent-review-backdrop"}),a.jsxs(Jv,{className:"agent-review-dialog",children:[a.jsxs("header",{className:"agent-review-dialog-header",children:[a.jsxs("div",{children:[a.jsx(wk,{children:n}),a.jsx(UT,{children:o("dialogDescription")})]}),a.jsx(dL,{className:"agent-review-close",disabled:h,"aria-label":o("close"),children:a.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m6 6 12 12M6 18 18 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})})]}),a.jsxs("div",{className:"agent-review-dialog-body",children:[d?a.jsx(fl,{}):null,g?a.jsxs("div",{className:"agent-review-error",role:"alert",children:[a.jsx("p",{children:g}),a.jsx("button",{type:"button",disabled:h||d,onClick:()=>A(_=>_+1),children:o("refresh")})]}):null,!d&&c?a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"agent-review-facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:o("statusTitle")}),a.jsxs("dd",{children:[o(`status.${c.status}`),c.status==="approved"&&!P?` · ${o("private")}`:""]})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("submitter")}),a.jsx("dd",{children:a.jsx(IP,{person:c.submitter})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("submittedAt")}),a.jsx("dd",{children:D(c.submittedAt)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("version")}),a.jsx("dd",{children:c.agent.version??"—"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("model")}),a.jsx("dd",{children:c.agent.model||"—"})]}),c.reviewer?a.jsxs("div",{children:[a.jsx("dt",{children:o(c.status==="returned"?"returnedBy":"approvedBy")}),a.jsx("dd",{children:a.jsx(IP,{person:c.reviewer})})]}):null,c.reviewedAt?a.jsxs("div",{children:[a.jsx("dt",{children:o("reviewedAt")}),a.jsx("dd",{children:D(c.reviewedAt)})]}):null]}),a.jsxs("section",{children:[a.jsx("h3",{children:o("description")}),a.jsx("p",{children:c.agent.description||"—"})]}),c.message?a.jsxs("section",{children:[a.jsx("h3",{children:o("message")}),a.jsx("p",{children:c.message})]}):null,c.reason?a.jsxs("section",{children:[a.jsx("h3",{children:o("reason")}),a.jsx("p",{children:c.reason})]}):null,c.comment?a.jsxs("section",{children:[a.jsx("h3",{children:o("comment")}),a.jsx("p",{children:c.comment})]}):null,c.contentChanged?a.jsx("p",{role:"alert",className:"agent-review-warning",children:o("contentChanged")}):null]}):null,!d&&!g&&I&&!i?a.jsx(d6,{label:o("message"),value:v,onChange:y,limit:MXt,disabled:h}):null,!d&&!g&&i&&(N||I)?a.jsx(d6,{label:o("comment"),value:w,onChange:x,limit:Woe,disabled:h}):null,E?a.jsx(d6,{label:o("reasonRequired"),value:k,onChange:S,limit:Woe,disabled:h,required:!0}):null,T?a.jsx("p",{role:"status",children:o(`${T}Confirm`)}):null]}),a.jsxs("footer",{className:"agent-review-dialog-footer",children:[h?a.jsx("span",{role:"status",children:o("saving")}):null,!d&&(!g||c)?T?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",disabled:h,onClick:()=>R(null),children:o("cancel")}),a.jsx("button",{type:"button",disabled:h,onClick:()=>void C(T),children:o("confirm")})]}):E?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",disabled:h,onClick:()=>j(!1),children:o("cancel")}),a.jsx("button",{type:"button",disabled:h||!k.trim(),onClick:()=>void C("decision","returned"),children:o("return")})]}):a.jsxs(a.Fragment,{children:[P?a.jsx("button",{type:"button",disabled:h,onClick:()=>R("unpublish"),children:o("unpublish")}):null,N?a.jsx("button",{type:"button",disabled:h,onClick:()=>R("withdraw"),children:o("withdraw")}):null,N&&i?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",disabled:h,onClick:()=>j(!0),children:o("return")}),a.jsx("button",{type:"button",className:"is-primary",disabled:h||(c==null?void 0:c.contentChanged),onClick:()=>void C("decision","approved"),children:o("approve")})]}):null,I?a.jsx("button",{type:"button",className:"is-primary",disabled:h,onClick:()=>void C(i?"publish":"submit"),children:o(i?"publish":"submit")}):null]}):null]})]})]})})}const LXt=5e3,$Xt=4;let f6=0;const Koe=[];function Goe(e){return e instanceof Error&&e.name==="AbortError"}function FXt(e){return e instanceof Error&&e.name==="TimeoutError"}function BXt(e){return FXt(e)||e instanceof ND&&[500,502,503,504].includes(e.status)}function UXt(e,t){return t!=null&&t.aborted?Promise.reject(t.reason??new DOMException("Request aborted","AbortError")):new Promise((n,i)=>{const r=()=>{globalThis.clearTimeout(s),i((t==null?void 0:t.reason)??new DOMException("Request aborted","AbortError"))},s=globalThis.setTimeout(()=>{t==null||t.removeEventListener("abort",r),n()},e);t==null||t.addEventListener("abort",r,{once:!0})})}async function QXt(e={},t={}){const n=t.request??$v,i=t.wait??UXt;try{return await n(e)}catch(r){if(!BXt(r))throw r;return await i(LXt,e.signal),n(e)}}async function h9e(e){var t;f6>=$Xt&&await new Promise(n=>Koe.push(n)),f6+=1;try{return await e()}finally{f6-=1,(t=Koe.shift())==null||t()}}async function zXt(e,t){await Promise.allSettled(e.map(n=>h9e(()=>t(n))))}function wy(e,t,n){const i=e instanceof Error?`${e.name}: ${e.message}`:String(e||Q("common.unknownError"));return[Q("requestError.actionFailed",{action:t}),Q("requestError.detail",{detail:i}),n?Q("requestError.request",{request:n}):""].filter(Boolean).join(` -`)}const VXt=/^[A-Za-z_][A-Za-z0-9_]*$/,NL=/^\$\{([A-Za-z_][A-Za-z0-9_]*)\}$/;function Xoe(e,t){return e.trim().toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"")||t}function HXt(e,t){if(!t.has(e))return e;let n=2;for(;t.has(`${e}_${n}`);)n+=1;return`${e}_${n}`}function Ek(e){var n,i,r;const t=(n=e.authTokenEnv)==null?void 0:n.trim();return t&&VXt.test(t)?t:((r=(i=e.authToken)==null?void 0:i.trim().match(NL))==null?void 0:r[1])??""}function PP(e,t){var n;for(const i of e.mcpTools??[])t(i);for(const i of e.subAgents)PP(i,t);for(const i of((n=e.workflow)==null?void 0:n.nodes)??[])PP(i.agent,t)}function p9e(e){try{const t=(e??"").trim(),n=new URL(t);if(n.protocol!=="http:"&&n.protocol!=="https:"||n.username||n.password||n.search||n.hash)return null;const i=t.indexOf("://")+3,r=t.indexOf("/",i),s=(r>=0?t.slice(r):"").replace(/\/+$/,"");return`${n.protocol}//${n.host}${s}`}catch{return null}}function qXt(e,t){let n=e.name.trim();if(!n){const i=p9e(e.url),r=(i==null?void 0:i.split("/").filter(Boolean))??[];n=r[r.length-1]??""}return n=n.replace(/[^A-Za-z0-9_.-]+/g,"_").replace(/^[_.-]+|[_.-]+$/g,""),n||`mcp_${t+1}`}function m9e(e){const t=new Set,n=new Set;let i=null;const r=s=>{var o;(s.mcpTools??[]).forEach((l,c)=>{if(i||l.transport!=="http")return;const u=qXt(l,c),d=p9e(l.url);if(t.has(u)){i="duplicateName";return}if(d&&n.has(d)){i="duplicateUrl";return}t.add(u),d&&n.add(d)}),!i&&(s.subAgents.forEach(r),(o=s.workflow)==null||o.nodes.forEach(l=>r(l.agent)))};return r(e),i}function h6(e){const t=new Set;return PP(e,n=>{const i=Ek(n);n.credentialConfigured&&i&&t.add(i)}),[...t]}function g9e(e){const t=new Set;return PP(e,n=>{const i=Ek(n);i&&t.add(i)}),[...t]}function WXt(e,t){const n=new Set(g9e(t));return[...new Set(e)].filter(i=>!n.has(i))}function KXt(e){if(e.authToken)return e.authToken;if(e.credentialConfigured)return"";const t=Ek(e);return t?`\${${t}}`:""}function GXt(e,t){if(!t){const i={...e,credentialConfigured:!1};return delete i.authToken,delete i.authTokenEnv,delete i.credentialSourceUrl,delete i.credentialSourceAuthTokenEnv,i}const n=t.trim().match(NL);if(n){const i={...e,authTokenEnv:n[1],credentialConfigured:e.credentialConfigured&&Ek(e)===n[1]};return delete i.authToken,i}return{...e,authToken:t,credentialConfigured:!1}}function XXt(e){if(!e.trim())return!1;try{return new URL(e).pathname.replace(/\/+$/,"")===""}catch{return!1}}function Yoe(e){return(e??"").trim().replace(/\/+$/,"")}function YXt(e,t){return{...e,url:t}}function ZXt(e,t){const n=new Map(t.map(r=>[[r.agentName.trim(),r.authTokenEnv.trim(),Yoe(r.url)].join("\0"),r.value])),i=r=>({...r,mcpTools:(r.mcpTools??[]).map(s=>{var c;const o=Ek(s);if(!o)return s;const l=n.get([r.name.trim(),o,Yoe(s.url)].join("\0"));return l?{...s,authToken:l,credentialConfigured:!0,credentialSourceUrl:((c=s.url)==null?void 0:c.trim())??"",credentialSourceAuthTokenEnv:o}:s}),subAgents:r.subAgents.map(i),...r.workflow?{workflow:{...r.workflow,nodes:r.workflow.nodes.map(s=>({...s,agent:i(s.agent)}))}}:{}});return i(e)}function JXt(e){const t=Ck(e),n={},i=o=>{var l,c;Object.assign(n,((l=o.deployment)==null?void 0:l.envValues)??{}),o.subAgents.forEach(i),(c=o.workflow)==null||c.nodes.forEach(u=>i(u.agent))};i(e),Object.assign(n,t.envValues);const r=[],s=o=>{var l,c,u;for(const d of o.mcpTools??[]){const f=((l=d.authTokenEnv)==null?void 0:l.trim())??"",h=f?(n[f]??"").trim():"";d.transport!=="http"||!h||r.push({agentName:o.name.trim(),name:d.name.trim(),url:((c=d.url)==null?void 0:c.trim())??"",value:h})}o.subAgents.forEach(s),(u=o.workflow)==null||u.nodes.forEach(d=>s(d.agent))};return s(t.draft),r}function eYt(e){const t=[],n=i=>{var r,s,o;for(const l of i.mcpTools??[]){const c=((r=l.authToken)==null?void 0:r.trim())??"";l.transport!=="http"||!c||NL.test(c)||t.push({agentName:i.name.trim(),name:l.name.trim(),url:((s=l.url)==null?void 0:s.trim())??"",value:c})}i.subAgents.forEach(n),(o=i.workflow)==null||o.nodes.forEach(l=>n(l.agent))};return n(e),t}function Ck(e){const t=new Set,n={},i=r=>{var u;const s=Xoe(r.name,"AGENT"),o=(u=r.mcpTools)==null?void 0:u.map((d,f)=>{var y,w;const h=((y=d.authToken)==null?void 0:y.trim())??"",m=((w=h.match(NL))==null?void 0:w[1])??"";let b=Ek(d);if(!b&&h){const x=Xoe(d.name,`TOOL_${f+1}`);b=HXt(`MCP_${s}_${x}_AUTH_TOKEN`,t)}b&&t.add(b),b&&h&&!m&&(n[b]=h);const v={...d};return delete v.authToken,delete v.credentialConfigured,delete v.credentialSourceUrl,delete v.credentialSourceAuthTokenEnv,b?v.authTokenEnv=b:delete v.authTokenEnv,v}),l=r.subAgents.map(i),c=r.workflow?{...r.workflow,nodes:r.workflow.nodes.map(d=>({...d,agent:i(d.agent)}))}:void 0;return{...r,subAgents:l,...o?{mcpTools:o}:{},...c?{workflow:c}:{}}};return{draft:i(e),envValues:n}}const tYt=/^[A-Za-z_][A-Za-z0-9_]*$/;function xj(e){return typeof e=="string"?e.trim():""}function Zy(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.modelName=="string"}function b9e(e){return typeof e=="string"?e:e.modelName}function y9e(e){var t,n,i;return typeof e=="string"||!((t=e.modelProvider)!=null&&t.trim())&&!((n=e.modelApiBase)!=null&&n.trim())&&!((i=e.modelApiKeyEnv)!=null&&i.trim())}function gK(e,t){return`FALLBACK_MODEL_${(e??"").trim().toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"")||"AGENT"}_${t+1}_API_KEY`}function v9e(e){return tYt.test(e)}function x9e(e,t,n){const i=new Set((n??[]).map(o=>{var l;return Zy(o)?(l=o.modelApiKeyEnv)==null?void 0:l.trim():""}).filter(o=>!!o)),r=gK(e,t);if(!i.has(r))return r;let s=2;for(;i.has(`${r}_${s}`);)s+=1;return`${r}_${s}`}function nYt(e,t,n,i){var s;const r=((s=i.modelApiKeyEnv)==null?void 0:s.trim())??"";return r&&v9e(r)?r:x9e(e,t,n)}function Lu(e,t){var s,o,l;const n=(e??"").trim(),i=new Set;n&&i.add(`same:${n}`);const r=[];for(const c of t??[]){const u=iYt(c);if(!u)continue;const d=b9e(u).trim(),f=y9e(u);if(!d||f&&d===n)continue;const h=typeof u=="string"?`same:${d}`:["endpoint",d,((s=u.modelProvider)==null?void 0:s.trim())??"",((o=u.modelApiBase)==null?void 0:o.trim())??"",((l=u.modelApiKeyEnv)==null?void 0:l.trim())??""].join("\0");i.has(h)||(i.add(h),r.push(u))}return r}function iYt(e){if(typeof e=="string")return e.trim()||null;if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e,n=xj(t.modelName??t.model_name??t.model);if(!n)return null;const i={modelName:n},r=xj(t.modelProvider??t.model_provider??t.provider),s=xj(t.modelApiBase??t.model_api_base??t.apiBase??t.api_base??t.baseUrl??t.base_url),o=xj(t.modelApiKeyEnv??t.model_api_key_env??t.apiKeyEnv??t.api_key_env);return r&&(i.modelProvider=r),s&&(i.modelApiBase=s),o&&v9e(o)&&(i.modelApiKeyEnv=o),y9e(i)?n:i}function w9e(e,t){return Lu(e,t).filter(n=>typeof n=="string")}function k9e(e,t){const n=Array.isArray(e)?e:[e],i=typeof n[0]=="string"?n[0].trim():"";return{modelName:i,modelFallbacks:Lu(i,[...n.slice(1),...Array.isArray(t)?t:[]])}}function rYt(e,t){return e.trim().toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"")||t}function wj(e,t){if(!t.has(e))return e;let n=2;for(;t.has(`${e}_${n}`);)n+=1;return`${e}_${n}`}function O9e(e,t){const n=e==null?void 0:e.trim();if(!n)return!1;try{const i=new URL(n),r=new URL(t),s=i.pathname.replace(/\/+$/,""),o=r.pathname.replace(/\/+$/,"");return i.protocol==="https:"&&i.username===""&&i.password===""&&i.search===""&&i.hash===""&&i.hostname.toLowerCase()===r.hostname.toLowerCase()&&i.port===r.port&&s===o}catch{return!1}}function RL(e,t){const n=[],i=new Set,r=(s,o=[])=>{var u,d,f,h;const l=rYt(s.name,"AGENT"),c=s.agentType===void 0||s.agentType==="llm";if(c&&s.modelSource!=="ark"&&(s.modelSource==="custom"||(u=s.modelApiBase)!=null&&u.trim()&&!O9e(s.modelApiBase,t))){const m=((d=s.modelProvider)==null?void 0:d.trim())??"",g=((f=s.modelApiBase)==null?void 0:f.trim())??"",b=m?wj(`CUSTOM_MODEL_${l}_PROVIDER`,i):void 0;b&&i.add(b);const v=g?wj(`CUSTOM_MODEL_${l}_API_BASE`,i):void 0;v&&i.add(v);const y=wj(`CUSTOM_MODEL_${l}_API_KEY`,i);i.add(y),n.push({providerKey:b,apiBaseKey:v,apiKeyKey:y,provider:m,apiBase:g,label:Yt("helpers.customModel.apiKeyLabel",{name:s.name.trim()||Yt("helpers.customModel.fallbackName")}),path:o})}if(!c){s.subAgents.forEach((m,g)=>r(m,[...o,g]));return}(h=s.modelFallbacks)==null||h.forEach((m,g)=>{var w,x,k;if(!Zy(m))return;const b=m.modelName.trim();if(!b)return;const y=(((w=m.modelApiKeyEnv)==null?void 0:w.trim())??"")||wj(gK(s.name,g),i);i.add(y),n.push({apiKeyKey:y,provider:((x=m.modelProvider)==null?void 0:x.trim())??"",apiBase:((k=m.modelApiBase)==null?void 0:k.trim())??"",label:Yt("helpers.customModel.fallbackApiKeyLabel",{name:s.name.trim()||Yt("helpers.customModel.fallbackName"),model:b}),path:o})}),s.subAgents.forEach((m,g)=>r(m,[...o,g]))};return r(e),n}function bK(e,t){return RL(e,t).map(({apiKeyKey:n,label:i})=>({key:n,label:i}))}function S9e(e,t,n,i=[]){const r=new Set(i);return RL(e,t).map(({apiKeyKey:s,label:o,path:l})=>({key:s,label:o,path:l})).find(({key:s})=>{var o;return!((o=n[s])!=null&&o.trim())&&!r.has(s)})??null}function Zoe(e){const t=new Set,n=i=>{var r,s;for(const o of i.modelFallbacks??[]){if(!Zy(o))continue;const l=((r=o.modelApiKeyEnv)==null?void 0:r.trim())??"";l&&t.add(l)}i.subAgents.forEach(n),(s=i.workflow)==null||s.nodes.forEach(o=>n(o.agent))};return n(e),[...t]}const E9e=1,sYt="MODEL_AGENT_API_KEY",C9e="WorkspaceDraftError";function G7(e){const t=new Error(Yt(e));return t.name=C9e,t}function DP(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function aYt(e){return DP(e)&&typeof e.id=="string"&&typeof e.updatedAt=="number"&&(e.creationMode===void 0||e.creationMode==="quick"||e.creationMode==="traditional")&&DP(e.draft)}function _w(e){return(e==null?void 0:e.agentCategory)??((e==null?void 0:e.mpaProfileOnly)===!0?"mpa":"general")}function p6(e){return e.creationMode?e.creationMode:e.draft.dynamicAgentDelegation===!0?"quick":"traditional"}function IL(e){return`veadk.agentDrafts.${encodeURIComponent(e)}`}function X7(e,t,n,i){const r=e.deployment,s=r==null?void 0:r.envValues,o=r?{...r,...s?{envValues:Object.fromEntries(Object.entries(s).filter(([l])=>l!==sYt&&!t.has(l)&&!i.has(l)))}:{}}:void 0;return{...e,...e.mcpTools?{mcpTools:e.mcpTools.map(l=>{if(!l.authTokenEnv||!n.has(l.authTokenEnv))return l;const c={...l};return delete c.authTokenEnv,c})}:{},...o?{deployment:o}:{},subAgents:e.subAgents.map(l=>X7(l,t,n,i)),...e.workflow?{workflow:{...e.workflow,nodes:e.workflow.nodes.map(l=>({...l,agent:X7(l.agent,t,n,i)}))}}:{}}}function Y7(e,t){return{...e,...e.mcpTools?{mcpTools:e.mcpTools.map((n,i)=>{var r,s;return{...n,...((s=(r=t.mcpTools)==null?void 0:r[i])==null?void 0:s.credentialConfigured)===!0?{credentialConfigured:!0}:{}}})}:{},subAgents:e.subAgents.map((n,i)=>Y7(n,t.subAgents[i]??n)),...e.workflow?{workflow:{...e.workflow,nodes:e.workflow.nodes.map((n,i)=>{var r,s;return{...n,agent:Y7(n.agent,((s=(r=t.workflow)==null?void 0:r.nodes[i])==null?void 0:s.agent)??n.agent)}})}}:{}}}function oYt(e){const t=Ck(e),n=Y7(t.draft,e),i=new Set([...bK(t.draft,Fo(t.draft.cloudProvider??"volcengine")).map(r=>r.key),...Zoe(t.draft),...Zoe(e)]);return X7(n,new Set(g9e(t.draft)),new Set(Object.keys(t.envValues)),i)}function A9e(e){return{...e,draft:oYt(e.draft)}}function lYt(e){const t=Array.isArray(e)?e:DP(e)&&e.version===E9e?e.drafts:void 0;if(!Array.isArray(t)||!t.every(aYt))throw DP(e)&&typeof e.version=="number"?G7("helpers.drafts.unsupportedVersion"):G7("helpers.drafts.invalidFormat");return t.map(A9e)}function cYt(e,t){if(!t)return[];const n=e.getItem(IL(t));if(!n)return[];try{return lYt(JSON.parse(n))}catch(i){throw i instanceof Error&&i.name===C9e?i:G7("helpers.drafts.readFailed")}}function Joe(e,t,n){if(!t)return;const i={version:E9e,drafts:n.map(A9e)};try{e.setItem(IL(t),JSON.stringify(i))}catch(r){throw r instanceof DOMException&&(r.name==="QuotaExceededError"||r.name==="NS_ERROR_DOM_QUOTA_REACHED")?new Error(Yt("helpers.drafts.quotaExceeded")):new Error(Yt("helpers.drafts.writeRejected"))}}function _p({className:e="icon"}){return a.jsxs("svg",{className:`${e} sidebar-agent-face`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"4.25",y:"5.25",width:"15.5",height:"13.5",rx:"4.75"}),a.jsx("path",{className:"sidebar-agent-face__eye",d:"M8.5 10.7v2"}),a.jsx("path",{className:"sidebar-agent-face__eye",d:"M15.5 10.7v2"})]})}function uYt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M8.4 18.4H7.2a4.2 4.2 0 0 1-.65-8.35A5.7 5.7 0 0 1 17.3 8.2a4.6 4.6 0 0 1-.4 9.2h-3.2"}),a.jsx("path",{d:"m7.8 12.3 2 2-2 2M12.2 16.3h3.2"})]})}function dYt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M18.9 6.25A8.4 8.4 0 1 0 19.6 16"}),a.jsx("path",{d:"M19 6.2c.1 2.1-.65 3.75-2.25 4.95-1.2.9-2.75 1.25-4.2.9"}),a.jsx("circle",{cx:"10.6",cy:"12.8",r:"2.45"}),a.jsx("path",{d:"m5.25 18.6 3.65-3.9M14.8 17.9c1.9-.45 3.55-1.65 4.65-3.35"})]})}function fYt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6.2 20c.55-2.15.75-4.1.75-6.7V9.8A5.35 5.35 0 0 1 12.35 4c3.35 0 5.65 2.35 5.65 5.65v4.6c0 2.35.35 4.25 1.15 5.75"}),a.jsx("path",{d:"M8.05 10.2c1.35-.6 2.2-1.65 2.55-3.15.45 1.55 1.35 2.55 2.7 3.05.1-1 .4-1.95.85-2.75.45 1.25 1.2 2.2 2.15 2.75"}),a.jsx("path",{d:"M9.3 12.65h.01M14.9 12.65h.01M10.8 15.55c.8.5 1.65.5 2.45 0"}),a.jsx("path",{d:"M8.45 19.85c.95-.85 1.45-1.95 1.5-3.25M15.1 16.65c.05 1.2.55 2.3 1.55 3.2"})]})}function hYt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5.2 17.2V8.1a3 3 0 0 1 3-3h7.6a3 3 0 0 1 3 3v9.1"}),a.jsx("path",{d:"M7.4 17.2h9.2M9 19.9h6"}),a.jsx("path",{d:"M9.1 9.25h5.8M9.1 12h3.1"}),a.jsx("path",{d:"m14.1 12.4 2 2.1M16.2 12.4l-2.1 2.1"})]})}function gA({kind:e,...t}){return e==="codex"?a.jsx(uYt,{...t}):e==="deepseek-harness"?a.jsx(hYt,{...t}):e==="openclaw"?a.jsx(dYt,{...t}):a.jsx(fYt,{...t})}const pYt="data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='visible'%20style='display:%20block;'%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Icon%20Frame'%3e%3cpath%20id='Vector%208798'%20d='M5%205L15%2015'%20stroke='white'%20stroke-opacity='0.15'%20stroke-width='1.25'%20stroke-linecap='round'/%3e%3cpath%20id='Vector%208800'%20d='M15%205L5%2015'%20stroke='white'%20stroke-opacity='0.15'%20stroke-width='1.25'%20stroke-linecap='round'/%3e%3c/g%3e%3c/svg%3e";function T9e({title:e,topGlow:t=!0,children:n,footer:i,cancelLabel:r="Cancel",confirmLabel:s="Confirm",closeLabel:o="Close",onClose:l,onCancel:c,onConfirm:u,className:d="",...f}){const h=p.useId();return a.jsxs("div",{role:"dialog","aria-labelledby":h,...f,className:`studio-modal-layout ${t?"studio-modal-layout--glow":""} ${d}`.trim(),children:[a.jsxs("header",{className:"studio-modal-layout__header",children:[a.jsx("h3",{id:h,children:e}),a.jsx(ki,{variant:"ghost",size:"compact",iconOnly:!0,className:"studio-modal-layout__close","aria-label":o,onClick:l,startIcon:a.jsx("img",{src:pYt,alt:""})})]}),a.jsx("div",{className:"studio-modal-layout__body",children:n}),i!==null&&a.jsx("footer",{className:"studio-modal-layout__footer",children:i===void 0?a.jsxs(a.Fragment,{children:[a.jsx(ki,{variant:"outline",className:"studio-modal-layout__cancel",onClick:c,children:r}),a.jsx(ki,{className:"studio-modal-layout__confirm",onClick:u,children:s})]}):i})]})}class Z7 extends Error{constructor(t,n,i){super(n),this.status=t,this.code=i,this.name="MpaCreationRequestError"}}async function Ak(e,t,n){var r;const i=await fetch(Na(`/web/mpa-creation/${e}`),{method:n===void 0?"GET":"POST",headers:hl(oc({"Content-Type":"application/json"})),body:n===void 0?void 0:JSON.stringify(n),signal:po(t,eo)});if(!i.ok){const s=await i.json().catch(()=>({}));throw new Z7(i.status,typeof s.detail=="string"?s.detail:`HTTP ${i.status}`,typeof((r=s.detail)==null?void 0:r.code)=="string"?s.detail.code:void 0)}return i.json()}const mYt=(e,t)=>Ak(`config?region=${encodeURIComponent(e)}`,t),gYt=(e,t)=>Ak("tasks",t,e),bYt=(e,t)=>Ak(`tasks?region=${encodeURIComponent(e)}`,t),yYt=(e,t)=>Ak("name-check",t,e),vYt=(e,t)=>Ak(`tasks/${encodeURIComponent(e)}`,t),xYt=(e,t)=>Ak(`tasks/${encodeURIComponent(e)}/cancel`,t,{}),wYt=/^[A-Za-z0-9_-]+$/,_9e=4,MP=64,LP=6,ele="agent-runtime";function j9e(e){const t=e.trim();if(!t)return ele;let n=t.replace(/[^A-Za-z0-9_-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,MP);return n?(n.length<_9e&&(n=`${n}-rt`.slice(0,MP)),n):ele}function kYt(e,t){const n=t.toLowerCase().replace(/[^a-z0-9]+/g,"").slice(0,LP).padEnd(LP,"0"),i=MP-n.length-1;return`${j9e(e).slice(0,i).replace(/[-_]+$/g,"")||"agent"}-${n}`}function yK(e,t=Math.random){const n=Math.min(Math.max(t(),0),1-Number.EPSILON),i=Math.floor(n*36**LP).toString(36).padStart(LP,"0");return kYt(e,i)}function OYt(e,t,n){return n??!!(t!=null&&t.trim())?t??"":j9e(e)}function i0(e,t=n=>Yt(`validation.runtimeName.${n}`)){return e?wYt.test(e)?e.length<_9e||e.length>MP?t("length"):null:t("characters"):t("required")}function SYt(e="",t=""){const n=e.trim(),i=t.trim();return!n&&!i||n.length<=255&&/^[A-Za-z0-9][A-Za-z0-9.-]*$/.test(n)&&!n.includes("..")&&/^[0-9]{1,5}$/.test(i)&&Number(i)>=1&&Number(i)<=65535}function EYt(e="",t="",n=""){const i=e.trim(),r=t.trim();if(!i&&!r&&!n)return!0;if(!i||!r||!n.trim()||i.length>1024||/\s/.test(i)||i.replace(/^https:\/\//,"").split("/",1)[0].includes(":"))return!1;try{const o=new URL(i);return o.protocol==="https:"&&!!o.hostname&&!o.username&&!o.password&&!o.port&&!o.search&&!o.hash&&r.length<=128&&/^ov-[a-zA-Z0-9_-]+$/.test(r)}catch{return!1}}function CYt(e){return[{value:"auto",label:e("deploymentResources.mode.auto"),description:e("deploymentResources.mode.autoDescription"),badge:e("deploymentResources.mode.recommended")},{value:"create",label:e("deploymentResources.mode.create"),description:e("deploymentResources.mode.createDescription")},{value:"existing",label:e("deploymentResources.mode.existing"),description:e("deploymentResources.mode.existingDescription")}]}const N9e={tos:{mode:"auto"},cr:{mode:"auto"},codePipeline:{mode:"auto"}};function Zf(e){const[t,n]=p.useState([]),[i,r]=p.useState(""),[s,o]=p.useState(1),[l,c]=p.useState(0),[u,d]=p.useState(!1),[f,h]=p.useState(!1),[m,g]=p.useState(null),[b,v]=p.useState(""),[y,w]=p.useState(""),[x,k]=p.useState(""),[S,O]=p.useState(0),A=p.useRef(!1),E=p.useRef(null),j=e?JSON.stringify(e):"",T=e?JSON.stringify({...e,search:y}):"";p.useEffect(()=>{const I=window.setTimeout(()=>{w(b.trim())},250);return()=>window.clearTimeout(I)},[b]),p.useEffect(()=>{v(""),w("")},[j]);const R=p.useCallback((I,D)=>{var F;if(!T)return;(F=E.current)==null||F.abort();const _=new AbortController;E.current=_;const L=JSON.parse(T);D&&n([]),A.current=!0,h(!0),g(null),PTe({...L,pageNumber:I,pageSize:100},_.signal).then(M=>{n(H=>{if(D)return M.items;const q=new Set(H.map(U=>`${U.id}\0${U.name}`));return[...H,...M.items.filter(U=>!q.has(`${U.id}\0${U.name}`))]}),r(M.serviceRegion),o(M.pageNumber),c(M.totalCount),d(M.hasMore),k(T)}).catch(M=>{M instanceof DOMException&&M.name==="AbortError"||(k(T),g(M instanceof Error?M.message:String(M)))}).finally(()=>{E.current===_&&(E.current=null,A.current=!1,h(!1))})},[T]);p.useEffect(()=>{var I;if(!T){(I=E.current)==null||I.abort(),E.current=null,A.current=!1,n([]),r(""),o(1),c(0),d(!1),k(""),h(!1),g(null);return}return R(1,!0),()=>{var D;return(D=E.current)==null?void 0:D.abort()}},[R,T,S]);const C=!!T&&x===T&&b.trim()===y,N=p.useCallback(()=>{k(""),O(I=>I+1)},[]),P=p.useCallback(()=>{!C||A.current||!u||R(s+1,!1)},[u,R,s,C]);return{items:t,serviceRegion:i,totalCount:l,hasMore:C?u:!1,loading:!!T&&(!C||f),error:m,search:b,setSearch:v,reload:N,loadMore:P}}function AYt(e,t){return e.map(n=>({value:n[t],label:n.name,description:[n.status,n.region,n.id].filter(Boolean).join(" · ")}))}function Jf({ariaLabel:e,value:t,valueLabel:n,state:i,disabled:r,disabledMessage:s,valueField:o="id",onChange:l}){const{t:c}=_e("ui"),u=p.useMemo(()=>AYt(i.items,o),[i.items,o]);return a.jsxs("div",{className:"pp-resource-picker",children:[a.jsx(bf,{ariaLabel:e,value:t,valueLabel:n,placeholder:i.loading?c("common.loading"):c("deploymentResources.selectExisting"),options:u,disabled:r||!!i.error,searchValue:i.search,searchPlaceholder:c("deploymentResources.searchResource"),loading:i.loading,hasMore:i.hasMore,emptyMessage:i.search.trim()?c("deploymentResources.noMatch"):c("deploymentResources.noAvailable"),onSearchChange:i.setSearch,onLoadMore:i.loadMore,onChange:d=>{const f=i.items.find(h=>h[o]===d);f&&l(f)}}),s?a.jsx("span",{className:"pp-resource-status",children:s}):i.error?a.jsxs("div",{className:"pp-resource-error",role:"alert",children:[a.jsx("span",{children:i.error}),a.jsx("button",{type:"button",onClick:i.reload,children:c("common.retry")})]}):i.loading&&i.items.length===0?a.jsx("span",{className:"pp-resource-status","aria-live":"polite",children:i.search.trim()?c("deploymentResources.searching"):c("deploymentResources.loading")}):i.items.length===0?a.jsx("span",{className:"pp-resource-status",children:i.search.trim()?c("deploymentResources.noMatchSentence"):c("deploymentResources.noAvailableSentence")}):i.serviceRegion?a.jsx("span",{className:"pp-resource-status",children:c("deploymentResources.loadedSummary",{region:i.serviceRegion,loaded:i.items.length,total:i.totalCount>0?`/${i.totalCount}`:""})}):null]})}function R9e({region:e,value:t,disabled:n=!1,onChange:i}){const{t:r}=_e("ui"),s=Zf(e?{kind:"cr-registry",region:e}:null),o=Zf(e&&(t!=null&&t.registry)?{kind:"cr-namespace",region:e,registry:t.registry}:null),l=Zf(e&&(t!=null&&t.registry)&&t.namespace?{kind:"cr-repository",region:e,registry:t.registry,namespace:t.namespace}:null),c=t??{region:e,registry:"",namespace:"",repository:""};return a.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three environment-repository-fields",children:[a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:r("deploymentResources.registryInstance")}),a.jsx(Jf,{ariaLabel:r("deploymentResources.registryAriaLabel"),value:c.registry,valueLabel:c.registry,state:s,disabled:n||!e,valueField:"name",onChange:u=>i({region:e,registry:u.name,namespace:"",repository:""})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:r("deploymentResources.namespace")}),a.jsx(Jf,{ariaLabel:r("deploymentResources.namespaceAriaLabel"),value:c.namespace,valueLabel:c.namespace,state:o,disabled:n||!c.registry,disabledMessage:c.registry?void 0:r("deploymentResources.selectRegistryFirst"),valueField:"name",onChange:u=>i({...c,region:e,namespace:u.name,repository:""})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:r("deploymentResources.repository")}),a.jsx(Jf,{ariaLabel:r("deploymentResources.existingRepository"),value:c.repository,valueLabel:c.repository,state:l,disabled:n||!c.registry||!c.namespace,disabledMessage:c.registry?c.namespace?void 0:r("deploymentResources.selectNamespaceFirst"):r("deploymentResources.selectRegistryFirst"),valueField:"name",onChange:u=>i({...c,region:e,repository:u.name})})]})]})}function m6({resource:e,value:t,disabled:n,onChange:i}){const{t:r}=_e("ui");return a.jsxs("label",{className:"pp-resource-field pp-resource-mode",children:[a.jsx("span",{children:r("deploymentResources.configurationMode")}),a.jsx(bf,{ariaLabel:r("deploymentResources.configurationModeAriaLabel",{resource:e}),value:t,placeholder:r("deploymentResources.selectConfigurationMode"),options:CYt(r),disabled:n,onChange:s=>i(s)})]})}function G0({label:e,value:t,placeholder:n,disabled:i,onChange:r}){return a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:e}),a.jsx("input",{value:t,placeholder:n,disabled:i,autoComplete:"off",onChange:s=>r(s.currentTarget.value)})]})}function g6({items:e,note:t}){const{t:n}=_e("ui");return a.jsxs("div",{className:"pp-resource-auto-names",children:[a.jsx("span",{children:n("deploymentResources.automaticNames")}),a.jsx("dl",{children:e.map(i=>a.jsxs("div",{children:[a.jsx("dt",{children:i.label}),a.jsx("dd",{title:i.name,children:i.name})]},i.label))}),t&&a.jsx("small",{children:t})]})}function I9e(e){var t,n,i,r,s,o,l,c;return e.tos.mode!=="auto"&&!((t=e.tos.bucket)!=null&&t.trim())?bn.t("ui:deploymentResources.validation.tos"):e.cr.mode!=="auto"&&(!((n=e.cr.instance)!=null&&n.trim())||!((i=e.cr.namespace)!=null&&i.trim())||!((r=e.cr.repository)!=null&&r.trim()))?bn.t("ui:deploymentResources.validation.cr"):e.codePipeline.mode!=="auto"&&(!((s=e.codePipeline.workspaceName)!=null&&s.trim())||!((o=e.codePipeline.pipelineName)!=null&&o.trim()))?bn.t("ui:deploymentResources.validation.codePipeline"):e.codePipeline.mode==="existing"&&(!((l=e.codePipeline.workspaceId)!=null&&l.trim())||!((c=e.codePipeline.pipelineId)!=null&&c.trim()))?bn.t("ui:deploymentResources.validation.existingCodePipeline"):null}function P9e({value:e,agentName:t,runtimeName:n,region:i,disabled:r,validationError:s,onChange:o}){const{t:l}=_e("ui"),c=t.trim()||"agentkit-app",u=n.trim()||c,d=i&&i!=="cn-beijing"?l("deploymentResources.autoBucketWithRegion",{region:i.startsWith("cn-")?i.slice(3):i}):l("deploymentResources.autoBucket"),f=Zf(e.tos.mode==="existing"?{kind:"tos-bucket",region:i}:null),h=Zf(e.cr.mode==="existing"?{kind:"cr-registry",region:i}:null),m=Zf(e.cr.mode==="existing"&&e.cr.instance?{kind:"cr-namespace",region:i,registry:e.cr.instance}:null),g=Zf(e.cr.mode==="existing"&&e.cr.instance&&e.cr.namespace?{kind:"cr-repository",region:i,registry:e.cr.instance,namespace:e.cr.namespace}:null),b=Zf(e.codePipeline.mode==="existing"?{kind:"cp-workspace",region:i}:null),v=Zf(e.codePipeline.mode==="existing"&&e.codePipeline.workspaceId?{kind:"cp-pipeline",region:i,workspaceId:e.codePipeline.workspaceId}:null),y=w=>o({...e,...w});return a.jsxs("div",{className:"pp-resource-list",children:[a.jsxs("div",{className:"pp-resource-item",children:[a.jsx("div",{className:"pp-resource-name",children:l("deploymentResources.tosBucket")}),a.jsxs("div",{className:"pp-resource-grid",children:[a.jsx(m6,{resource:l("deploymentResources.tosBucket"),value:e.tos.mode,disabled:r,onChange:w=>y({tos:{mode:w}})}),e.tos.mode==="create"&&a.jsx(G0,{label:l("deploymentResources.bucketName"),value:e.tos.bucket??"",placeholder:l("deploymentResources.bucketNamePlaceholder"),disabled:r,onChange:w=>y({tos:{...e.tos,bucket:w}})}),e.tos.mode==="existing"&&a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.existingBucket")}),a.jsx(Jf,{ariaLabel:l("deploymentResources.existingTosBucket"),value:e.tos.bucket??"",valueLabel:e.tos.bucket,state:f,disabled:r,onChange:w=>y({tos:{...e.tos,bucket:w.name}})})]}),e.tos.mode==="auto"&&a.jsx(g6,{items:[{label:l("deploymentResources.bucket"),name:d}],note:l("deploymentResources.accountIdResolved")})]})]}),a.jsxs("div",{className:"pp-resource-item",children:[a.jsx("div",{className:"pp-resource-name",children:l("deploymentResources.containerRegistry")}),a.jsxs("div",{className:"pp-resource-grid",children:[a.jsx(m6,{resource:"CR",value:e.cr.mode,disabled:r,onChange:w=>y({cr:{mode:w}})}),e.cr.mode==="create"&&a.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three",children:[a.jsx(G0,{label:l("deploymentResources.instanceName"),value:e.cr.instance??"",placeholder:l("deploymentResources.crInstance"),disabled:r,onChange:w=>y({cr:{...e.cr,instance:w}})}),a.jsx(G0,{label:l("deploymentResources.namespace"),value:e.cr.namespace??"",placeholder:l("deploymentResources.namespace"),disabled:r,onChange:w=>y({cr:{...e.cr,namespace:w}})}),a.jsx(G0,{label:l("deploymentResources.repository"),value:e.cr.repository??"",placeholder:l("deploymentResources.repository"),disabled:r,onChange:w=>y({cr:{...e.cr,repository:w}})})]}),e.cr.mode==="existing"&&a.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three",children:[a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.crInstance")}),a.jsx(Jf,{ariaLabel:l("deploymentResources.existingCrInstance"),value:e.cr.instance??"",valueLabel:e.cr.instance,state:h,disabled:r,valueField:"name",onChange:w=>y({cr:{mode:"existing",instance:w.name}})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.namespace")}),a.jsx(Jf,{ariaLabel:l("deploymentResources.existingCrNamespace"),value:e.cr.namespace??"",valueLabel:e.cr.namespace,state:m,disabled:r||!e.cr.instance,valueField:"name",onChange:w=>y({cr:{...e.cr,namespace:w.name,repository:void 0}})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.repository")}),a.jsx(Jf,{ariaLabel:l("deploymentResources.existingCrRepository"),value:e.cr.repository??"",valueLabel:e.cr.repository,state:g,disabled:r||!e.cr.namespace,valueField:"name",onChange:w=>y({cr:{...e.cr,repository:w.name}})})]})]}),e.cr.mode==="auto"&&a.jsx(g6,{items:[{label:l("deploymentResources.crInstance"),name:l("deploymentResources.autoRegistry")},{label:l("deploymentResources.namespace"),name:"agentkit"},{label:l("deploymentResources.repository"),name:l("deploymentResources.autoRepositoryName",{name:c})}],note:l("deploymentResources.registryNameNote")})]})]}),a.jsxs("div",{className:"pp-resource-item",children:[a.jsx("div",{className:"pp-resource-name",children:"CodePipeline"}),a.jsxs("div",{className:"pp-resource-grid",children:[a.jsx(m6,{resource:"CodePipeline",value:e.codePipeline.mode,disabled:r,onChange:w=>y({codePipeline:{mode:w}})}),e.codePipeline.mode==="create"&&a.jsxs("div",{className:"pp-resource-fields",children:[a.jsx(G0,{label:l("deploymentResources.workspaceName"),value:e.codePipeline.workspaceName??"",placeholder:l("deploymentResources.workspaceName"),disabled:r,onChange:w=>y({codePipeline:{...e.codePipeline,workspaceName:w}})}),a.jsx(G0,{label:l("deploymentResources.pipelineName"),value:e.codePipeline.pipelineName??"",placeholder:l("deploymentResources.pipelineName"),disabled:r,onChange:w=>y({codePipeline:{...e.codePipeline,pipelineName:w}})})]}),e.codePipeline.mode==="existing"&&a.jsxs("div",{className:"pp-resource-fields",children:[a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.workspace")}),a.jsx(Jf,{ariaLabel:l("deploymentResources.existingWorkspace"),value:e.codePipeline.workspaceId??"",valueLabel:e.codePipeline.workspaceName,state:b,disabled:r,onChange:w=>y({codePipeline:{mode:"existing",workspaceId:w.id,workspaceName:w.name}})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.compatiblePipeline")}),a.jsx(Jf,{ariaLabel:l("deploymentResources.existingPipeline"),value:e.codePipeline.pipelineId??"",valueLabel:e.codePipeline.pipelineName,state:v,disabled:r||!e.codePipeline.workspaceId,onChange:w=>y({codePipeline:{...e.codePipeline,pipelineId:w.id,pipelineName:w.name}})})]})]}),e.codePipeline.mode==="auto"&&a.jsx(g6,{items:[{label:l("deploymentResources.workspace"),name:"agentkit-cli-workspace"},{label:l("deploymentResources.pipeline"),name:u}],note:l("deploymentResources.pipelineNameNote")})]})]}),s&&a.jsx("p",{className:"pp-resource-validation",role:"alert",children:s})]})}const TYt="https://console.volcengine.com/aidap/region:aidap+cn-beijing/",_Yt="https://console.volcengine.com/vikingdb/openviking/region:openviking+cn-beijing/ov-6689fabdf032294/context-management?accountId=default&userId=default&projectName=default";function vK(e){return e==="byteplus"?10:20}function D9e(e,t){return{region:e,requestId:crypto.randomUUID(),name:"",description:"",maxInstance:vK(t)}}function bA(e){const t={...e};return Reflect.deleteProperty(t,"tosAccessKey"),Reflect.deleteProperty(t,"tosSecretKey"),t}function jYt(e){const t=bA(e);for(const n of Object.keys(t))(t[n]===void 0||t[n]==="")&&delete t[n];return t}function NYt(e,t){var n;try{const i=JSON.parse(sessionStorage.getItem(`mpa-create:${e}`)||"null");if(((n=i==null?void 0:i.input)==null?void 0:n.region)===e&&typeof i.input.requestId=="string"){if(i.submitted||i.taskId)return{...i,input:bA(i.input)};const r={...i.input,name:typeof i.input.name=="string"?i.input.name:"",maxInstance:i.input.maxInstance??vK(t)};return delete r.agentId,delete r.runtimeImage,delete r.workerImage,{...i,input:bA(r)}}}catch{}return{input:D9e(e,t)}}function RYt({region:e,cloudProvider:t="volcengine",onClose:n,onCreated:i}){var Ce,Be,he;const{t:r}=_e("ui"),s=ie=>`myAgents.mpaCreate.${ie}`,o=vK(t),[l]=p.useState(()=>NYt(e,t)),c=!!(l.step||l.input.name||l.input.description||l.input.agentId||l.input.pgHost||l.input.pgPort||l.input.openvikingUrl||l.input.openvikingResourceId||l.input.tosBucket),[u,d]=p.useState(l.input),[f,h]=p.useState(String(l.input.maxInstance??o)),[m,g]=p.useState(""),[b,v]=p.useState(l.submitted||l.taskId?2:Math.min(2,Math.max(0,l.step??0))),[y,w]=p.useState(l.taskId),[x,k]=p.useState(!!(l.submitted||l.taskId)),S=p.useRef(x);S.current=x;const[O,A]=p.useState(null),[E,j]=p.useState(null),[T,R]=p.useState(!0),[C,N]=p.useState(!1),[P,I]=p.useState(""),[D,_]=p.useState(0),[L,F]=p.useState(!1),M=p.useRef(!1),H=p.useRef(!1),q=p.useRef(!0),U=p.useRef(null),Z=p.useRef(!1),z=p.useRef(i);z.current=i;const J=(O==null?void 0:O.state)==="running"||(O==null?void 0:O.state)==="cancelling",W=x&&u.name===void 0&&!!u.agentId?null:i0((u.name??"").trim(),ie=>r(`validation.runtimeName.${ie}`,{ns:"create"})),X=!W,le=x&&u.maxInstance===void 0,V=le||f.trim()!==""&&Number.isSafeInteger(Number(f))&&Number(f)>=1,Y=(E==null?void 0:E.postgresMode)==="auto",K=(x?u.businessDatabaseName:E==null?void 0:E.businessDatabaseName)==="aidb",ue=(x?u.businessWorkspaceMode:E==null?void 0:E.businessWorkspaceMode)==="per-agent",te=Y?!u.pgHost&&!u.pgPort:SYt(u.pgHost,u.pgPort),Oe=u.openvikingMode==="auto",fe=Oe||EYt(u.openvikingUrl,u.openvikingResourceId,m),pe=((Ce=u.tosBucket)==null?void 0:Ce.trim())??"",Se=!pe||pe.startsWith("agentkit-platform-")&&/^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/.test(pe),ve=C||x&&(!O||J||O.state==="succeeded"),Le=Zf(b===2&&!ve?{kind:"tos-bucket",region:e,namePrefix:"agentkit-platform-"}:null);p.useEffect(()=>{if(!(x||y))try{sessionStorage.setItem(`mpa-create:${e}`,JSON.stringify({input:bA(u),step:b}))}catch{}},[u,b,e,x,y]);function He(ie){try{sessionStorage.setItem(`mpa-create:${e}`,JSON.stringify({input:bA(u),taskId:ie,submitted:!0,step:2}))}catch{}}function Ge(ie){const we=jYt({requestId:ie.requestId,agentId:ie.agentId,name:ie.name,description:ie.description??"",maxInstance:ie.maxInstance??o,region:ie.region,runtimeImage:ie.runtimeImage,workerImage:ie.workerImage,pgHost:ie.pgHost,pgPort:ie.pgPort,openvikingUrl:ie.openvikingUrl,openvikingResourceId:ie.openvikingResourceId,openvikingMode:ie.openvikingMode,businessWorkspaceMode:ie.businessWorkspaceMode,businessDatabaseName:ie.businessDatabaseName,tosBucket:ie.tosBucket});d(we),h(String(we.maxInstance??o)),v(2),k(!0),w(ie.taskId),A(ie);try{sessionStorage.setItem(`mpa-create:${e}`,JSON.stringify({input:we,taskId:ie.taskId,submitted:!0,step:2}))}catch{}}p.useEffect(()=>(q.current=!0,()=>{var ie;q.current=!1,(ie=U.current)==null||ie.abort()}),[]),p.useEffect(()=>{if(Z.current||y||l.taskId||c&&!x&&!l.submitted)return;Z.current=!0;const ie=new AbortController;return bYt(e,ie.signal).then(we=>{if(ie.signal.aborted||!q.current)return;const Re=we.tasks.find(Ue=>Ue.requestId===u.requestId)??we.tasks.find(Ue=>Ue.state!=="succeeded");Re&&Ge(Re)}).catch(()=>{}),()=>ie.abort()},[c,u.requestId,e,l.submitted,l.taskId,x,y]),p.useEffect(()=>{const ie=new AbortController;return R(!0),mYt(e,ie.signal).then(we=>{ie.signal.aborted||(j(we),we.configured&&!S.current&&!l.submitted&&!l.taskId&&!M.current&&d(Re=>({...Re,...we.businessDatabaseName==="aidb"?{businessDatabaseName:"aidb"}:{},...we.businessWorkspaceMode==="per-agent"?{businessWorkspaceMode:"per-agent"}:{},...we.openvikingMode==="auto"?{openvikingMode:"auto",openvikingUrl:void 0,openvikingResourceId:void 0}:{},pgHost:we.postgresMode==="auto"?"":Re.pgHost??we.pgHost??"",pgPort:we.postgresMode==="auto"?"":Re.pgPort??we.pgPort??""})))}).catch(()=>{ie.signal.aborted||I(r(s("loadFailed")))}).finally(()=>{ie.signal.aborted||R(!1)}),()=>ie.abort()},[e,D,t,r]),p.useEffect(()=>{if(!y)return;const ie=new AbortController;let we;async function Re(){try{const Ue=await vYt(y,ie.signal);if(ie.signal.aborted)return;if(A(Ue),I(""),Ue.state==="succeeded"&&!H.current){H.current=!0;try{sessionStorage.removeItem(`mpa-create:${e}`)}catch{}z.current()}if(Ue.state!=="running"&&Ue.state!=="cancelling")return}catch{if(ie.signal.aborted)return;I(r(s("pollFailed")))}we=setTimeout(Re,2e3)}return Re(),()=>{ie.abort(),clearTimeout(we)}},[y,e,D,r]);function De(ie){return ie instanceof Z7&&(ie.code==="runtimeNameTaken"||ie.code==="runtimeNameCheckFailed")?r(s(ie.code)):ie instanceof Error?ie.message:r(s("creationFailed"))}function se(ie){var we;return((we=ie.latestDiagnostic)==null?void 0:we.category)==="configuration_changed"?"configurationChanged":ie.error||"creationFailed"}async function ce(){var we;if(M.current||!X||!V)return;if(b!==0||x||u.businessDatabaseName!=="aidb"){v(Re=>Re+1);return}if(T||!(E!=null&&E.configured))return;M.current=!0,N(!0),I("");const ie=new AbortController;U.current=ie;try{const Re=await yYt({requestId:u.requestId,agentId:u.agentId,name:(we=u.name)==null?void 0:we.trim(),region:e},ie.signal);if(!q.current||ie.signal.aborted)return;if(!Re.available){I(r(s("runtimeNameTaken")));return}v(1)}catch(Re){q.current&&!ie.signal.aborted&&I(De(Re))}finally{M.current=!1,q.current&&N(!1)}}async function ye(){if(M.current||!(E!=null&&E.configured)||!X||!V||!te||!fe||!Se||b!==2||J||(O==null?void 0:O.state)==="succeeded")return;M.current=!0,N(!0);const ie=x;k(!0),I(""),He(y);const we=new AbortController;U.current=we;try{const Re=await gYt({...u,...le?{}:{maxInstance:Number(f)},...u.name===void 0?{}:{name:u.name.trim()},openvikingApiKey:m},we.signal);if(!q.current||we.signal.aborted)return;He(Re.taskId),w(Re.taskId),A(Re),_(Ue=>Ue+1)}catch(Re){q.current&&!we.signal.aborted&&(Re instanceof Z7&&(Re.status===400||Re.status===422||!ie&&(Re.code==="runtimeNameTaken"||Re.code==="runtimeNameCheckFailed"))&&k(!1),I(De(Re)))}finally{M.current=!1,q.current&&N(!1)}}async function Ae(){if(!y||M.current)return;F(!1),M.current=!0,N(!0);const ie=new AbortController;U.current=ie;try{const we=await xYt(y,ie.signal);q.current&&!ie.signal.aborted&&A(we)}catch{q.current&&!ie.signal.aborted&&I(r(s("cancelFailed")))}finally{M.current=!1,q.current&&N(!1)}}function Ee(){const ie={...D9e(e,t),...(E==null?void 0:E.businessDatabaseName)==="aidb"?{businessDatabaseName:"aidb"}:{},...(E==null?void 0:E.businessWorkspaceMode)==="per-agent"?{businessWorkspaceMode:"per-agent"}:{},...(E==null?void 0:E.openvikingMode)==="auto"?{openvikingMode:"auto"}:{},pgHost:Y?"":(E==null?void 0:E.pgHost)??"",pgPort:Y?"":(E==null?void 0:E.pgPort)??""};try{sessionStorage.setItem(`mpa-create:${e}`,JSON.stringify({input:ie,step:0}))}catch{}d(ie),h(String(o)),g(""),v(0),w(void 0),k(!1),A(null),I(""),F(!1),H.current=!1}return a.jsx(a.Fragment,{children:a.jsx(t0,{open:!0,onOpenChange:ie=>{!ie&&!C&&(L?F(!1):n())},children:a.jsxs(e0,{children:[a.jsx(Zv,{className:"studio-modal-button__backdrop mpa-create-backdrop"}),a.jsx(Jv,{className:"mpa-create-popup","aria-label":r(s("title")),children:a.jsx(T9e,{className:"mpa-create-dialog",title:r(s("title")),topGlow:!1,footer:null,onClose:()=>{C||n()},closeLabel:r(s("close")),children:a.jsxs("div",{className:"mpa-create-body",children:[a.jsx("ol",{className:"mpa-create-steps","aria-label":r(s("stepsLabel")),children:["basics","postgres","openviking"].map((ie,we)=>a.jsx("li",{"aria-current":b===we?"step":void 0,children:a.jsxs("button",{type:"button",disabled:C||we>b&&!x&&(!X||!V||we===2&&!te),onClick:()=>v(we),children:[a.jsx("span",{children:we+1}),r(s(`steps.${ie==="postgres"&&Y?"autoPostgres":ie}`))]})},ie))}),b===0&&a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[r(s("region")),":",e]}),a.jsxs("label",{children:[r(s("name")),a.jsx("input",{name:"name",placeholder:r(s("namePlaceholder")),value:u.name??u.agentId??"",maxLength:64,disabled:C||x,required:!0,autoComplete:"off","aria-invalid":!!W,"aria-describedby":"mpa-name-help",onChange:ie=>{d({...u,name:ie.target.value}),I("")}}),a.jsx("p",{id:"mpa-name-help",role:W?"alert":void 0,children:W||r(s("nameHelp"))})]}),a.jsxs("label",{children:[r(s("description")),a.jsx(_Ie,{className:"mpa-create-description",value:u.description,maxLength:512,disabled:C||x,onChange:ie=>d({...u,description:ie.target.value})})]}),!le&&a.jsxs("label",{children:[r(s("maxInstance")),a.jsx("input",{name:"maxInstance",type:"number",min:1,max:Number.MAX_SAFE_INTEGER,step:1,value:f,disabled:C||x,required:!0,"aria-invalid":!V,"aria-describedby":"mpa-maximum-help",onChange:ie=>{const we=ie.target.value;h(we),d({...u,maxInstance:Number(we)})}}),a.jsx("p",{id:"mpa-maximum-help",role:V?void 0:"alert",children:r(s(V?"maxInstanceHelp":"maxInstanceInvalid"),{maximum:o})})]}),a.jsxs("section",{className:"mpa-create-plan","aria-label":r(s("plan")),children:[a.jsx("strong",{children:r(s("plan"))}),a.jsxs("ul",{children:[a.jsx("li",{children:r(s("sharedResources"))}),a.jsx("li",{children:r(s("agentResources"))}),a.jsx("li",{children:r(s("readiness"))})]})]})]}),b===1&&a.jsxs(a.Fragment,{children:[a.jsx("p",{children:r(s(Y?K?"pgAidbDescription":ue?"pgPerAgentDescription":"pgAutoDescription":(E==null?void 0:E.postgresLayout)==="split-workspaces"?"pgSplitDescription":"pgDescription"))}),a.jsx("a",{href:t==="byteplus"?"https://console.byteplus.com/aidap/":TYt,target:"_blank",rel:"noopener noreferrer",children:r(s(t==="byteplus"?"pgConsoleByteplus":"pgConsole"))}),!Y&&a.jsxs(a.Fragment,{children:[a.jsxs("label",{children:[r(s("pgHost")),a.jsx("input",{name:"pgHost",value:u.pgHost??"",maxLength:255,disabled:C||x,"aria-invalid":!te,onChange:ie=>d(we=>({...we,pgHost:ie.target.value}))})]}),a.jsxs("label",{children:[r(s("pgPort")),a.jsx("input",{name:"pgPort",value:u.pgPort??"",inputMode:"numeric",maxLength:5,disabled:C||x,"aria-invalid":!te,onChange:ie=>d(we=>({...we,pgPort:ie.target.value}))})]}),!te&&a.jsx("p",{role:"alert",children:r(s("pgInvalid"))}),a.jsx("p",{children:r(s("pgCredentials"))})]})]}),b===2&&a.jsxs(a.Fragment,{children:[a.jsx("p",{children:r(s(Oe?t==="byteplus"?"openvikingAutoByteplusDescription":"openvikingAutoDescription":"openvikingDescription"))}),a.jsx("a",{href:t==="byteplus"?"https://console.byteplus.com/vikingdb/":Oe?"https://console.volcengine.com/vikingdb/openviking/region:openviking+cn-beijing/":_Yt,target:"_blank",rel:"noopener noreferrer",children:r(s(t==="byteplus"?"openvikingConsoleByteplus":"openvikingConsole"))}),Oe?a.jsx("p",{children:r(s(t==="byteplus"?"openvikingAutoByteplusRequirements":"openvikingAutoBilling"))}):a.jsxs(a.Fragment,{children:[a.jsxs("label",{children:[r(s("openvikingUrl")),a.jsx("input",{name:"openvikingUrl",value:u.openvikingUrl??"",maxLength:1024,disabled:C||x,autoComplete:"off",spellCheck:!1,"aria-invalid":!fe,onChange:ie=>d(we=>({...we,openvikingUrl:ie.target.value}))})]}),a.jsxs("label",{children:[r(s("openvikingResourceId")),a.jsx("input",{name:"openvikingResourceId",value:u.openvikingResourceId??"",maxLength:128,disabled:C||x,autoComplete:"off",spellCheck:!1,"aria-invalid":!fe,onChange:ie=>d(we=>({...we,openvikingResourceId:ie.target.value}))})]}),a.jsxs("label",{children:[r(s("openvikingApiKey")),a.jsx("input",{type:"password",name:"openvikingApiKey",value:m,maxLength:512,disabled:C||J||(O==null?void 0:O.state)==="succeeded",autoComplete:"off",spellCheck:!1,onChange:ie=>g(ie.target.value)})]}),!fe&&a.jsx("p",{role:"alert",children:r(s("openvikingInvalid"))}),a.jsx("p",{children:r(s("openvikingCredentials"))})]}),a.jsxs("fieldset",{className:"mpa-create-tos",children:[a.jsx("legend",{children:r(s("tosTitle"))}),a.jsx("p",{children:r(s("tosDescription"))}),a.jsxs("div",{children:[a.jsx("span",{children:r(s("tosBucket"))}),a.jsx(Jf,{ariaLabel:r(s("tosBucket")),value:pe,valueLabel:pe,valueField:"name",state:Le,disabled:ve,onChange:ie=>d(we=>({...we,tosBucket:ie.name}))})]}),pe&&a.jsx(ki,{variant:"outline",disabled:ve,onClick:()=>d(ie=>({...ie,tosBucket:""})),children:r(s("tosDisable"))}),!Se&&a.jsx("p",{role:"alert",children:r(s("tosInvalid"))}),a.jsx("p",{children:r(s("tosCredentials"))})]})]}),T?a.jsx("p",{role:"status",children:r(s("checking"))}):E!=null&&E.configured?a.jsx("p",{children:r(s("configured"))}):a.jsxs("div",{role:"alert",children:[a.jsx("p",{children:r(s("notConfigured"))}),a.jsx("p",{children:E!=null&&E.postgresMigrationRequired?r(s("pgMigrationRequired")):E==null?void 0:E.error}),a.jsx(ki,{variant:"outline",onClick:()=>_(ie=>ie+1),children:r(s("reload"))})]}),O&&a.jsxs("section",{"aria-live":"polite",children:[a.jsx("strong",{children:r(s(`states.${O.state}`))}),O.state!=="succeeded"&&a.jsx("p",{children:r(s(`stages.${O.stage}`),{defaultValue:O.stage})}),O.state==="failed"||O.state==="cancelled"?O.error==="runtimeNameTaken"?a.jsx(vh,{color:"danger",variant:"soft",description:r(s(O.error))}):a.jsx("p",{children:r(s(se(O)))}):null,((Be=O.result)==null?void 0:Be.runtime_id)&&a.jsxs("p",{children:["Runtime ID:",O.result.runtime_id]}),((he=O.result)==null?void 0:he.skill_space_id)&&a.jsxs("p",{children:[r(s("skillSpace")),":",O.result.skill_space_id]})]}),Y&&!te&&a.jsx("p",{role:"alert",children:r(s("pgModeChanged"))}),P&&a.jsx(vh,{color:"danger",variant:"soft",description:P}),J&&a.jsx("p",{children:r(s("background"))}),x&&a.jsx("p",{children:r(s("newAgentDescription"))}),L?a.jsxs("section",{role:"alertdialog","aria-label":r(s("cancel")),className:"mpa-create-plan",children:[a.jsx("p",{children:r(s("cancelDescription"))}),a.jsxs("div",{className:"mpa-create-actions",children:[a.jsx(ki,{autoFocus:!0,variant:"outline",onClick:()=>F(!1),children:r(s("back"))}),a.jsx(ki,{onClick:()=>void Ae(),children:r(s("confirmCancel"))})]})]}):a.jsxs("div",{className:"mpa-create-actions",children:[a.jsx(ki,{variant:"outline",disabled:C,onClick:n,children:r(s("close"))}),x&&a.jsx(ki,{variant:"outline",disabled:C||T,onClick:Ee,children:r(s("newAgent"))}),b>0&&a.jsx(ki,{variant:"outline",disabled:C,onClick:()=>v(ie=>ie-1),children:r(s("previousStep"))}),J?a.jsx(ki,{variant:"outline",disabled:C||(O==null?void 0:O.state)==="cancelling",onClick:()=>F(!0),children:r(s("cancel"))}):(O==null?void 0:O.state)!=="succeeded"&&b<2?a.jsx(ki,{disabled:C||b===0&&(!X||!V)||b===1&&!te,onClick:()=>void ce(),loading:C,children:r(s("next"))}):(O==null?void 0:O.state)!=="succeeded"?a.jsx(ki,{loading:C,disabled:T||!(E!=null&&E.configured)||!X||!V||!te||!fe||!Se,onClick:()=>void ye(),children:r(s(O||x?"retry":"submit"))}):null]})]})})})]})})})}const IYt=["general","mpa","codex","deepseek-harness","openclaw","hermes"];function PYt(e){return e!=="general"&&e!=="mpa"}const DYt=24,MYt=3e4,LYt=7e3,$Yt=2e4,FYt=6,BYt=2,UYt=250,wg=new Map,jw=new Map,QYt=new Set;function Yb(e){const t=e.runtime;return t?`${t.region}:${t.runtimeId}:${t.currentVersion??""}`:""}function tle(e,t){const n=e instanceof Error&&e.message.trim()?e.message.trim():t("myAgents.compatibility.unknownError");return{status:e instanceof Ea&&e.unsupported?"unsupported":"error",message:n}}function Ym(e){if(!e){wg.clear(),jw.clear(),W8();return}const t=new Set(e);if(t.size!==0){for(const[n,i]of jw)i.page.runtimes.some(r=>t.has(r.runtimeId))&&jw.delete(n);for(const n of t)W8(n);wg.clear()}}function zYt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function VYt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8.313 3.646a.5.5 0 0 1 .707 0l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 1 1-.707-.708L11.46 8.5H3.333a.5.5 0 0 1 0-1h8.127L8.313 4.354a.5.5 0 0 1 0-.708Z",fill:"currentColor"})})}function HYt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M2.75 5.25h8.75m0 0-2-2m2 2-2 2M13.25 10.75H4.5m0 0 2 2m-2-2 2-2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function qYt({type:e}){return e==="general"||e==="mpa"?a.jsx(_p,{}):a.jsx(gA,{kind:e})}function WYt(e,t=Date.now(),n){const i=Date.parse(e);if(!Number.isFinite(i)||i-t<6e4)return n("myAgents.expiringSoon");const r=Math.ceil((i-t)/6e4),s=Math.floor(r/60),o=r%60;return n("myAgents.sandboxRemaining",{hours:s,minutes:o})}function nle(e,t,n="general"){var r;const i=e.agentCategory??n;return{id:e.runtimeId,name:e.name,description:((r=e.description)==null?void 0:r.trim())||t("common.noDescription"),createdAt:e.createdAt??"",specificationLabel:t("myAgents.creator"),specification:JMe(e.author),isMine:e.isMine,agentCategory:i,runtime:{runtimeId:e.runtimeId,mpaInstanceId:e.mpaInstanceId,region:e.region,currentVersion:e.currentVersion,agentCategory:e.agentCategory??n,canDelete:e.canDelete,canManage:e.canManage,canPublish:e.canPublish,visibility:e.visibility,reviewStatus:e.reviewStatus}}}function KYt(e,t){const n=PD(e.status);return{id:e.id,name:e.displayName||t("myAgents.namedAgent",{name:e.toolName}),description:t(`myAgents.sandboxStatus.${n}`,{defaultValue:t("myAgents.sandboxStatus.unknown")}),createdAt:e.createdAt,specificationLabel:t("myAgents.creator"),specification:JMe(e.createdBy),isMine:e.isMine,region:e.region,sandbox:e}}function GYt(e,t){var n,i;return{id:e.id,name:e.draft.name||t("agentSelector.unnamedAgent"),description:((n=e.draft.description)==null?void 0:n.trim())||t("common.noDescription"),createdAt:new Date(e.updatedAt).toISOString(),specificationLabel:t("myAgents.storageLocation"),specification:t("myAgents.currentBrowser"),isMine:!0,region:(i=e.deploymentTarget)==null?void 0:i.region,agentCategory:_w(e.deploymentTarget),draft:e}}function XYt(e,t,n){if(!e.draft)return e;const i=e.draft.deploymentTarget;return i?t.find(r=>{var s;return((s=r.runtime)==null?void 0:s.runtimeId)===i.runtimeId&&r.runtime.region===i.region})??{id:i.runtimeId,appName:i.appName,name:i.name||e.name,description:e.description,createdAt:e.createdAt,specificationLabel:n("myAgents.region"),specification:i.region,isMine:!0,runtime:{runtimeId:i.runtimeId,agentCategory:_w(i),mpaInstanceId:i.mpaInstanceId,region:i.region,currentVersion:i.currentVersion,canDelete:!1}}:null}function YYt(e,t){return e.trim()||nr(t)}async function ZYt(e,t,n,i,r,s,o){const l=`${e}:${t}:${n}:${i}`,c=jw.get(l);if(c&&c.expiresAt>Date.now())return r(c.page.runtimes.map(f=>nle(f,s,e))),c.page.nextToken;c&&jw.delete(l);let u=wg.get(l);u||(u=QXt({agentCategory:e,scope:t,region:n,pageSize:DYt,nextToken:i,signal:o}),wg.set(l,u),u.then(()=>wg.delete(l),()=>wg.delete(l)));const d=await u;return jw.set(l,{page:d,expiresAt:Date.now()+MYt}),r(d.runtimes.map(f=>nle(f,s,e))),d.nextToken}function JYt({agent:e,onReview:t,onUse:n,onViewDetails:i,onPrepareUpdate:r,compatibility:s,onRetryCompatibility:o,connecting:l,connectError:c,connected:u,deploymentTask:d,nowMs:f,onViewDeploymentTask:h,onEditDraft:m,onDeleteDraft:g}){var R,C,N,P;const{t:b,i18n:v}=_e("ui"),y=(R=e.sandbox)==null?void 0:R.status.toLowerCase(),w=((C=e.sandbox)==null?void 0:C.resourceType)==="snapshot",x=!!(e.runtime||y==="ready"||y==="wakeable"),k=(s==null?void 0:s.status)==="checking",S=(s==null?void 0:s.status)==="unsupported",O=(s==null?void 0:s.status)==="error",A=((N=e.sandbox)==null?void 0:N.resourceType)==="snapshot"?e.sandbox.sourceSessionId||e.sandbox.snapshotId:(P=e.sandbox)==null?void 0:P.id,E=()=>{if(e.draft){d?h==null||h(d):i==null||i(e);return}!x&&!e.sandbox||(d?h==null||h(d):i==null||i(e))},j=(e.draft||x||!!e.sandbox)&&!!(d?h:i),T=e.draft?d?b("myAgents.viewDeploymentProgress",{name:e.name}):b("myAgents.viewRuntimeDetails",{name:e.name}):d?b("myAgents.viewDeploymentProgress",{name:e.name}):b("myAgents.viewDetails",{name:e.name});return a.jsxs(xH,{className:`my-agent-card${l?" is-connecting":""}${e.runtime?" has-review":""}`,activateLabel:j?T:void 0,onActivate:j?E:void 0,onPointerEnter:()=>r==null?void 0:r(e),onFocusCapture:()=>r==null?void 0:r(e),footer:a.jsxs("div",{className:"my-agent-card-footer",children:[a.jsx(tPe,{className:"my-agent-meta",items:[{label:e.specificationLabel,value:e.specification,hideLabel:!0,className:"my-agent-region"},{label:b("myAgents.time"),value:zT(e.createdAt,f,v.resolvedLanguage??v.language),hideLabel:!0,className:"my-agent-created-at"},...e.sandbox?[{label:b("myAgents.remainingTime"),value:e.sandbox.resourceType==="snapshot"||e.sandbox.persistent?b("myAgents.neverExpires"):WYt(e.sandbox.expireAt,f,b),className:`my-agent-expiry${e.sandbox.resourceType==="snapshot"||e.sandbox.persistent?"":" is-expiring"}`}]:[]]}),e.runtime?a.jsxs("div",{className:"agent-review-card-controls",children:[a.jsx("span",{className:"agent-review-card-status",children:b(e.runtime.visibility==="enterprise"?"enterprise":"private",{ns:"agentReviews"})}),e.runtime.canManage?a.jsxs(CN,{className:"agent-review-card-action",onClick:I=>{I.stopPropagation(),t==null||t(e)},children:[b(e.runtime.reviewStatus?"details":e.runtime.canPublish?"publish":"submit",{ns:"agentReviews"}),e.runtime.reviewStatus?` · ${b(`status.${e.runtime.reviewStatus}`,{ns:"agentReviews"})}`:""]}):null]}):null]}),actions:e.draft?a.jsxs(a.Fragment,{children:[a.jsx(CN,{"aria-label":d?b("myAgents.viewDeploymentProgress",{name:e.name}):b("myAgents.editDraftNamed",{name:e.name}),onClick:()=>d?h==null?void 0:h(d):m==null?void 0:m(e.draft),children:b(d?"myAgents.viewProgress":"common.edit")}),a.jsx(CN,{tone:"danger","aria-label":b("myAgents.deleteDraftNamed",{name:e.name}),onClick:()=>g==null?void 0:g(e.draft),children:b("common.delete")})]}):O||S?a.jsxs(At,{type:"button",color:"primary",size:"sm",pill:!1,"aria-label":b("myAgents.recheckCompatibility",{name:e.name}),onClick:()=>o==null?void 0:o(e),children:[a.jsx(YD,{}),b("common.retry")]}):a.jsx(MB,{className:u?"my-agent-use is-connected":"my-agent-use",disabled:!x||k||S||l||u,"aria-busy":l||void 0,label:u?b("myAgents.connectedNamed",{name:e.name}):w?b("myAgents.wakeAndChat",{name:e.name}):b("myAgents.chatWith",{name:e.name}),onClick:()=>void(n==null?void 0:n(e)),children:l?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-use-spinner","aria-hidden":"true"}),a.jsx("span",{className:"sr-only",children:b(w?"myAgents.waking":"agentSelector.connecting")})]}):a.jsx(VYt,{})}),children:[a.jsx(wH,{leading:a.jsx(r1,{seed:e.name}),title:e.name,subtitle:e.sandbox?a.jsx("span",{className:"my-agent-session-id",title:A,children:A}):void 0,status:e.draft?d?a.jsx("span",{className:"my-agent-deploying-badge",children:b("myAgents.deploying")}):a.jsx("span",{className:"my-agent-draft-badge",children:b("myAgents.draft")}):e.sandbox?a.jsx("span",{className:"my-agent-status-label","data-ready":PD(e.sandbox.status)==="ready"||void 0,children:e.description}):e.runtime&&d?a.jsx("span",{className:"my-agent-deploying-badge",children:b("myAgents.deploying")}):k?a.jsx(Ca,{content:s==null?void 0:s.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:a.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:a.jsxs(Za,{className:"my-agent-compatibility-status",color:"secondary",variant:"soft",size:"sm",pill:!0,children:[a.jsx("span",{className:"my-agent-compatibility-spinner","aria-hidden":"true"}),a.jsx("span",{children:b("myAgents.checking")})]})})}):S?a.jsx(Ca,{content:s==null?void 0:s.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:a.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:a.jsx(Za,{className:"my-agent-compatibility-status",color:"warning",variant:"soft",size:"sm",pill:!0,children:b("myAgents.chatUnsupported")})})}):O?a.jsx(Ca,{content:s==null?void 0:s.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:a.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:a.jsx(Za,{className:"my-agent-compatibility-status",color:"danger",variant:"soft",size:"sm",pill:!0,children:b("myAgents.checkFailed")})})}):null}),c?a.jsx(Ca,{content:c,contentClassName:"my-agent-error-tooltip",maxWidth:360,interactive:!0,children:a.jsx("p",{className:"my-agent-wake-note",role:"alert",tabIndex:0,children:c})}):null,w&&l?a.jsx("p",{className:"my-agent-wake-note",role:"status",children:a.jsx(on,{children:b("myAgents.wakingHint")})}):null,e.sandbox?null:a.jsx(kH,{children:e.description})]})}function eZt({cloudProvider:e,studioRegion:t,canCreateRuntimeAgents:n,canCreatePersonalAgents:i,canUpdate:r,runtimeScope:s,onCreateAgent:o,onOpenCodexProjectUpload:l,onUseAgent:c,onViewAgentDetails:u,onCreateSandboxAgent:d,onUseSandboxAgent:f,onViewSandboxAgentDetails:h,activeType:m,onActiveTypeChange:g,sandboxRefreshKey:b=0,connectedRuntimeId:v="",hiddenRuntimeIds:y=QYt,drafts:w=[],deploymentTasks:x=[],draftDeploymentTaskIds:k={},onViewDeploymentTask:S,onEditDraft:O,onDeleteDraft:A}){const{t:E}=_e("ui"),j=p.useRef(null),T=p.useRef(null),R=p.useRef(0),C=p.useRef(null),N=p.useRef(0),P=p.useRef(null),I=p.useRef(new Map),D=YYt(t,e),[_,L]=p.useState(null),[F,M]=p.useState(""),[H,q]=p.useState(s==="mine"?"mine":"all"),[U,Z]=p.useState(D),[z,J]=p.useState(null),[ne,W]=p.useState([]),[X,le]=p.useState(""),[V,Y]=p.useState(!0),[K,ue]=p.useState(""),[te,Oe]=p.useState([]),[fe,pe]=p.useState(!1),[Se,ve]=p.useState(""),[Le,He]=p.useState(""),[Ge,De]=p.useState({}),[se,ce]=p.useState({}),[ye,Ae]=p.useState(null),[Ee,Ce]=p.useState(()=>Date.now()),Be=p.useMemo(()=>IYt.map(Ke=>({value:Ke,label:E(`myAgents.agentTypes.${Ke}`)})),[E]),he=p.useMemo(()=>{const Ke=Pu(e);return Ke.some(ot=>ot.value===D)?Ke:[{value:D,label:D},...Ke]},[e,D]);p.useEffect(()=>{s==="mine"&&q("mine")},[s]),p.useEffect(()=>{Z(D)},[D]),p.useEffect(()=>{Ce(Date.now());const Ke=window.setInterval(()=>Ce(Date.now()),1e3);return()=>window.clearInterval(Ke)},[]);const ie=p.useMemo(()=>w.filter(Ke=>_w(Ke.deploymentTarget)===m).map(Ke=>GYt(Ke,E)),[w,m,E]),we=p.useMemo(()=>{const Ke=new Map,ot=new Map,it=new Map;for(const tt of x){if(tt.status!=="running")continue;if(Ke.set(tt.id,tt),tt.draftId){const Ot=ot.get(tt.draftId);(!Ot||tt.startedAt>Ot.startedAt)&&ot.set(tt.draftId,tt)}if(!tt.runtimeId)continue;const Ct=it.get(tt.runtimeId);(!Ct||tt.startedAt>Ct.startedAt)&&it.set(tt.runtimeId,tt)}return{byId:Ke,byDraftId:ot,byRuntimeId:it}},[x]),Re=p.useCallback(Ke=>{var it;if(Ke.draft){const tt=k[Ke.draft.id];return we.byDraftId.get(Ke.draft.id)??(tt?we.byId.get(tt):void 0)}const ot=(it=Ke.runtime)==null?void 0:it.runtimeId;return ot?we.byRuntimeId.get(ot):void 0},[we,k]),Ue=p.useCallback((Ke,ot)=>{var Ot;(Ot=C.current)==null||Ot.abort(),wg.clear();const it=new AbortController;C.current=it;const tt=++R.current;return Y(!0),ue(""),ZYt(m==="mpa"?"mpa":"general",H,U,Ke,Bt=>{R.current===tt&&W(Dt=>ot?Bt:[...Dt,...Bt])},E,it.signal).then(Bt=>{R.current===tt&&le(Bt)}).catch(Bt=>{R.current===tt&&(Goe(Bt)||ue(wy(Bt,E("myAgents.loadGeneralAgents"),"GET /web/runtimes")))}).finally(()=>{R.current===tt&&Y(!1),C.current===it&&(C.current=null)})},[m,H,U,E]);p.useEffect(()=>{if(!(m!=="general"&&m!=="mpa"))return W([]),le(""),Ue("",!0),()=>{var Ke;(Ke=C.current)==null||Ke.abort(),C.current=null,wg.clear(),R.current+=1}},[m,Ue]),p.useEffect(()=>{if(m!=="general"&&m!=="mpa"){for(const it of I.current.values())it.abort();I.current.clear();return}const Ke=new Set(ne.filter(it=>{var tt,Ct;return((tt=it.runtime)==null?void 0:tt.runtimeId)!==v&&((Ct=it.runtime)==null?void 0:Ct.region)===U}).map(Yb).filter(Boolean));for(const[it,tt]of I.current)Ke.has(it)||(tt.abort(),I.current.delete(it));const ot=ne.filter(it=>{var Bt,Dt,Ze;const tt=(Bt=it.runtime)==null?void 0:Bt.runtimeId;if(!tt||tt===v||((Dt=it.runtime)==null?void 0:Dt.region)!==U)return!1;const Ct=Yb(it),Ot=(Ze=se[Ct])==null?void 0:Ze.status;return!I.current.has(Ct)&&(!Ot||Ot==="checking")});for(const it of ot)I.current.set(Yb(it),new AbortController);ce(it=>{var Ot,Bt;let tt=!1;const Ct={...it};for(const Dt of ne){const Ze=Yb(Dt);if(!Ze)continue;const bt=((Ot=Dt.runtime)==null?void 0:Ot.runtimeId)===v;bt&&((Bt=Ct[Ze])==null?void 0:Bt.status)!=="compatible"?(Ct[Ze]={status:"compatible",message:E("myAgents.compatibility.supported")},tt=!0):!bt&&!Ct[Ze]&&(Ct[Ze]={status:"checking",message:E("myAgents.compatibility.checking")},tt=!0)}return tt?Ct:it}),zXt(ot,async it=>{const tt=it.runtime;if(!tt)return;const Ct=Yb(it),Ot=I.current.get(Ct);if(Ot)try{const Bt=await Xw(tt.runtimeId,tt.region,{signal:Ot.signal,preferCached:!0,timeoutMs:LYt,currentVersion:tt.currentVersion});if(Ot.signal.aborted)return;ce(Dt=>({...Dt,[Ct]:Bt&&Bt.length>0?{status:"compatible",message:E("myAgents.compatibility.supported")}:{status:"unsupported",message:E("myAgents.compatibility.empty")}}))}catch(Bt){if(Ot.signal.aborted||(Bt==null?void 0:Bt.name)==="AbortError")return;ce(Dt=>({...Dt,[Ct]:tle(Bt,E)}))}finally{I.current.get(Ct)===Ot&&I.current.delete(Ct)}})},[m,v,U,ne,E]),p.useEffect(()=>()=>{var Ke;(Ke=C.current)==null||Ke.abort();for(const ot of I.current.values())ot.abort();I.current.clear()},[]);const _t=p.useCallback(async Ke=>{var tt;(tt=P.current)==null||tt.abort();const ot=new AbortController;P.current=ot;const it=++N.current;pe(!0),ve(""),Oe([]);try{const Ct=Ke==="codex"?await Hr.listSessions({signal:ot.signal,autoResumeSnapshots:!1}):await Hr.listAgentSessions(Ke,{signal:ot.signal,autoResumeSnapshots:!1});if(N.current!==it)return;Oe(Ct.map(Ot=>KYt(Ot,E)))}catch(Ct){if((Ct==null?void 0:Ct.name)==="AbortError"||N.current!==it)return;ve(wy(Ct,E("myAgents.loadAgentType",{type:E(`myAgents.agentTypes.${Ke}`)}),`GET /web/${Ke==="codex"?"sandbox":Ke}/sessions`))}finally{P.current===ot&&(P.current=null),N.current===it&&pe(!1)}},[E]);function Pt(Ke){var ot;Ke!==m&&(Ke==="general"||Ke==="mpa"?(R.current+=1,W([]),le(""),ue(""),Y(!0)):((ot=P.current)==null||ot.abort(),P.current=null,N.current+=1,Oe([]),ve(""),pe(!0)),g(Ke))}function Gt(){m!=="general"&&m!=="mpa"||(R.current+=1,W([]),le(""),ue(""),Y(!0))}function St(Ke){Ke!==H&&(Gt(),q(Ke))}function Lt(Ke){Ke!==U&&(Gt(),Z(Ke))}p.useEffect(()=>{var Ke;if(m==="general"||m==="mpa"){(Ke=P.current)==null||Ke.abort(),P.current=null,N.current+=1;return}return _t(m),()=>{var ot;(ot=P.current)==null||ot.abort(),P.current=null,N.current+=1}},[m,_t,b]),p.useEffect(()=>{const Ke=T.current,ot=j.current;if(!Ke||!ot||m!=="general"&&m!=="mpa"||!X||V)return;const it=new IntersectionObserver(([tt])=>{tt.isIntersecting&&Ue(X,!1)},{root:ot,rootMargin:"240px 0px",threshold:.01});return it.observe(Ke),()=>it.disconnect()},[m,Ue,V,X]);const qe=p.useCallback(async Ke=>{if(!Le){He(Ke.id),De(ot=>({...ot,[Ke.id]:""}));try{await new Promise(ot=>requestAnimationFrame(()=>ot())),Ke.sandbox?await f(Ke.sandbox):await c(Ke)}catch(ot){De(it=>({...it,[Ke.id]:ot instanceof Error?ot.message:String(ot)}))}finally{He("")}}},[Le,c,f]),yt=p.useCallback(async Ke=>{var Ct;const ot=Ke.runtime;if(!ot)return;const it=Yb(Ke);ce(Ot=>({...Ot,[it]:{status:"checking",message:E("myAgents.compatibility.checking")}})),(Ct=I.current.get(it))==null||Ct.abort();const tt=new AbortController;I.current.set(it,tt);try{const Ot=await h9e(()=>Xw(ot.runtimeId,ot.region,{retryProbe:!0,signal:tt.signal,timeoutMs:$Yt,currentVersion:ot.currentVersion}));if(tt.signal.aborted)return;ce(Bt=>({...Bt,[it]:Ot&&Ot.length>0?{status:"compatible",message:E("myAgents.compatibility.supported")}:{status:"unsupported",message:E("myAgents.compatibility.empty")}}))}catch(Ot){if(tt.signal.aborted||Goe(Ot))return;ce(Bt=>({...Bt,[it]:tle(Ot,E)}))}finally{I.current.get(it)===tt&&I.current.delete(it)}},[E]),je=p.useCallback(Ke=>{const ot=Ke.runtime;!r||!ot||Re(Ke)||q8({runtimeId:ot.runtimeId,region:ot.region,appName:Ke.appName,currentVersion:ot.currentVersion})},[r,Re]),kt=p.useMemo(()=>{const Ke=F.trim().toLocaleLowerCase(),ot=m==="general"||m==="mpa"?[...ie,...ne]:te,tt=(H==="mine"?ot.filter(Dt=>Dt.isMine):ot).filter(Dt=>{var bt;const Ze=((bt=Dt.runtime)==null?void 0:bt.region)??Dt.region;return!Ze||Ze===U}),Ct=Ke?tt.filter(Dt=>Dt.name.toLocaleLowerCase().includes(Ke)):tt;if(m!=="general"&&m!=="mpa")return Ct;const Ot=y.size>0?Ct.filter(Dt=>!Dt.runtime||!y.has(Dt.runtime.runtimeId)):Ct,Bt=Ot.findIndex(Dt=>{var Ze;return((Ze=Dt.runtime)==null?void 0:Ze.runtimeId)===v});return Bt<=0?Ot:[Ot[Bt],...Ot.slice(0,Bt),...Ot.slice(Bt+1)]},[m,v,ie,y,F,H,U,ne,te]);p.useEffect(()=>{if(!r||m!=="general"&&m!=="mpa")return;const Ke=kt.filter(Ot=>!!Ot.runtime).filter(Ot=>!Re(Ot)).slice(0,FYt);if(Ke.length===0)return;let ot=!1,it=0;const tt=async()=>{for(;!ot;){const Ot=Ke[it];if(it+=1,!(Ot!=null&&Ot.runtime)||(await q8({runtimeId:Ot.runtime.runtimeId,region:Ot.runtime.region,appName:Ot.appName,currentVersion:Ot.runtime.currentVersion}),ot))return}},Ct=window.setTimeout(()=>{for(let Ot=0;Ot{ot=!0,window.clearTimeout(Ct)}},[m,r,Re,kt]);const Tt=E(`myAgents.agentTypes.${m}`,{defaultValue:E("myAgents.agent")}),fn=m==="general"||m==="mpa"?V&&ne.length===0&&ie.length===0:fe&&te.length===0,tn=!fn&&kt.length===0;let We;m==="general"&&n?We=()=>o(U,"general"):m==="mpa"&&n?We=()=>J(U):PYt(m)&&i&&(We=()=>d(m));const vt=m==="codex"&&i&&!!l;return a.jsxs(Ch,{className:"my-agents-page","aria-label":E("myAgents.agent"),children:[a.jsx(Qv,{title:E("myAgents.agent"),className:"my-agents-header"}),a.jsxs(ib,{className:"my-agent-toolbar",children:[a.jsx(rb,{idPrefix:"my-agent-ownership",ariaLabel:E("myAgents.creatorFilter"),value:H,items:[{id:"all",label:E("common.all"),disabled:s==="mine"},{id:"mine",label:E("agentSelector.createdByMe")}],onChange:St}),a.jsxs("div",{className:"resource-toolbar__actions",children:[a.jsx(sb,{id:"my-agent-type-filter",ariaLabel:E("myAgents.agentType"),value:m,options:Be,onChange:Pt}),a.jsx(sb,{id:"my-agent-region-filter",ariaLabel:E("myAgents.region"),value:U,options:he,onChange:Lt}),a.jsx(em,{className:"my-agent-search","aria-label":E("myAgents.searchAgents"),value:F,onChange:Ke=>M(Ke.target.value),placeholder:E("common.search")}),vt?a.jsxs("button",{type:"button",className:"my-agent-create-secondary",onClick:l,children:[a.jsx(HYt,{}),a.jsx("span",{children:E("myAgents.handoff")})]}):null]})]}),a.jsxs(tm,{className:"my-agent-results",ref:j,"aria-label":E("myAgents.agentList",{type:Tt}),children:[fn?a.jsx(fl,{}):(m==="general"||m==="mpa"?K:Se)&&kt.length===0?a.jsxs("div",{className:"my-agent-empty",role:"alert",children:[a.jsx("p",{children:m==="general"||m==="mpa"?K:Se}),a.jsx("button",{type:"button",onClick:()=>{m==="general"||m==="mpa"?Ue("",!0):_t(m)},children:E("common.reload")})]}):tn&&!We?F.trim()||H==="mine"||U!==D?a.jsx("div",{className:"my-agent-empty-message",children:a.jsxs(qn,{fill:"none",children:[a.jsx(qn.Icon,{children:a.jsx(oat,{})}),a.jsx(qn.Title,{children:E("myAgents.noMatchingAgents")}),a.jsx(qn.Description,{children:E("myAgents.adjustSearch")})]})}):m!=="general"?a.jsx("div",{className:"my-agent-empty-message",children:a.jsxs(qn,{fill:"none",children:[a.jsx(qn.Icon,{children:a.jsx(qYt,{type:m})}),a.jsx(qn.Title,{className:"my-agent-sandbox-empty-title",children:E("myAgents.noAgentType",{type:Tt})})]})}):a.jsx("div",{className:"my-agent-empty-message",children:a.jsxs(qn,{fill:"none",children:[a.jsx(qn.Icon,{children:a.jsx(_p,{})}),a.jsx(qn.Title,{children:E("myAgents.noGeneralAgents")}),a.jsx(qn.Description,{children:E("myAgents.createGeneralAgentDescription")})]})}):a.jsxs(a.Fragment,{children:[(m==="general"||m==="mpa")&&K?a.jsxs("div",{className:"my-agent-inline-error",role:"alert",children:[a.jsx("span",{children:K}),a.jsx("button",{type:"button",onClick:()=>void Ue("",!0),children:E("common.reload")})]}):null,a.jsxs(zv,{className:"my-agent-grid",children:[We?a.jsx(ab,{className:"my-agent-create-card","aria-label":E("myAgents.createAgentType",{type:Tt}),onClick:We,icon:a.jsx(zYt,{}),children:E(m==="mpa"?"myAgents.mpaCreate.title":"myAgents.createAgent")}):null,kt.map(Ke=>{var it,tt,Ct,Ot,Bt;const ot=XYt(Ke,ne,E);return a.jsx(JYt,{agent:Ke,onReview:L,deploymentTask:Re(Ke),nowMs:Ee,onViewDeploymentTask:S,onUse:qe,compatibility:Ke.runtime?se[Yb(Ke)]??{status:"checking",message:E("myAgents.compatibility.checking")}:void 0,onRetryCompatibility:yt,onPrepareUpdate:((it=Ke.runtime)==null?void 0:it.canManage)===!1||((tt=Ke.runtime)==null?void 0:tt.visibility)==="enterprise"||((Ct=Ke.runtime)==null?void 0:Ct.reviewStatus)==="pending"?void 0:je,onViewDetails:ot&&((Ot=Ke.runtime)==null?void 0:Ot.canManage)!==!1?()=>{ot.sandbox?h(ot.sandbox):u(ot)}:void 0,connecting:Ke.id===Le,connectError:Ge[Ke.id],connected:((Bt=Ke.runtime)==null?void 0:Bt.runtimeId)===v,onEditDraft:O,onDeleteDraft:Ae},Ke.id)})]})]}),(m==="general"||m==="mpa")&&!K&&!fn&&(kt.length>0||!!X)&&a.jsx("div",{className:"my-agent-load-more",ref:T,"aria-live":"polite",children:V?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:E("myAgents.loadingMore")})]}):X?a.jsx("span",{children:E("myAgents.scrollForMore")}):a.jsx("span",{children:E("myAgents.allLoaded")})})]}),z&&a.jsx(RYt,{region:z,cloudProvider:e,onClose:()=>J(null),onCreated:()=>{Ym(),U===z&&m==="mpa"&&Ue("",!0)}},z),_!=null&&_.runtime?a.jsx(f9e,{runtimeId:_.runtime.runtimeId,region:_.runtime.region,name:_.name,canPublish:_.runtime.canPublish===!0,onClose:()=>L(null),onChanged:()=>{Ym(),Ue("",!0)}},`${_.runtime.region}:${_.runtime.runtimeId}`):null,ye?a.jsx(_d,{title:E("myAgents.deleteDraftTitle"),description:E("myAgents.deleteDraftDescription",{name:ye.draft.name||E("agentSelector.unnamedAgent")}),confirmLabel:E("myAgents.deleteDraft"),variant:"danger",onCancel:()=>Ae(null),onConfirm:()=>{A==null||A(ye),Ae(null)}}):null]})}function xK({section:e,onWorkspace:t,onEnvironment:n,onProjects:i,actions:r,children:s,className:o=""}){const{t:l}=_e("ui"),c=l(e==="workspaces"?"workspace.title":e==="environments"?"common.environment":"workspace.codeProjects");return a.jsxs(Ch,{className:`workspace-center ${o}`,"aria-label":c,children:[a.jsx(Qv,{title:c}),a.jsxs(ib,{children:[(t||n)&&a.jsx(rb,{items:[{id:"workspaces",label:l("workspace.title")},{id:"environments",label:l("common.environment")},...i?[{id:"projects",label:l("workspace.codeProjects")}]:[]],value:e,onChange:u=>{u==="workspaces"&&(t==null||t()),u==="environments"&&(n==null||n()),u==="projects"&&(i==null||i())},ariaLabel:l("workspace.resourceType"),idPrefix:"workspace-center"}),a.jsx("div",{className:"resource-toolbar__actions",children:r})]}),s]})}const tZt="_Container_13560_1",nZt="_Textarea_13560_174",ile={Container:tZt,Textarea:nZt},bb=e=>{const t=p.useRef(null),i=`search-ui-input-${p.useId()}`,{id:r,name:s,variant:o="outline",size:l="md",gutterSize:c,className:u,autoComplete:d,disabled:f=!1,readOnly:h=!1,invalid:m=!1,allowAutofillExtensions:g=!!s,onFocus:b,onBlur:v,onAnimationStart:y,onAutofill:w,autoSelect:x,rows:k=3,maxRows:S,autoResize:O,ref:A,onChange:E,...j}=e,[T,R]=p.useState(!1),C=O?Math.max(S??10,k):k;p.useEffect(()=>{var I;x&&((I=t.current)==null||I.select())},[x]);const N=I=>{y==null||y(I),I.animationName==="native-autofill-in"&&(w==null||w())},P=p.useCallback(()=>{if(!O||!t.current||C===void 0)return;t.current.style.height="0px";const I=t.current.scrollHeight;t.current.style.height=I+"px"},[O,C]);return p.useEffect(()=>{P()},[e.value,k,P]),a.jsx("div",{className:qi(ile.Container,u),"data-variant":o,"data-size":l,"data-gutter-size":c,"data-focused":T,"data-disabled":f?"":void 0,"data-readonly":h?"":void 0,"data-invalid":m?"":void 0,style:Fv({"textarea-min-rows":`${k}`,"textarea-max-rows":`${C}`}),children:a.jsx("textarea",{...j,onChange:I=>{E==null||E(I),P()},ref:rT([t,A]),id:r||(g?void 0:i),className:ile.Textarea,name:s,readOnly:h,disabled:f,rows:k,onFocus:I=>{R(!0),b==null||b(I)},onBlur:I=>{R(!1),v==null||v(I)},onAnimationStart:N,"data-lpignore":g?void 0:!0,"data-1p-ignore":g?void 0:!0})})},PL="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2048%2048'%3e%3cimage%20width='48'%20height='48'%20href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAMKADAAQAAAABAAAAMAAAAADbN2wMAAAH7UlEQVRoBdVZWWwbVRQ9492Onc1xTfaWLukq9oSqLKnYBZRSNgn6AagsAgmJRfzxg4SEEDtiER8IBKKAChK0FS1tKYWW0lZQKKV0gxCVJm3ikDiO17EdzrUzSdw4jj1OpeQqNzO237vvnHfvu/e9GWVwcBBDYue1mrqE2kI1UqeSJAnmIHUzNUCNUmGiKtQy6oPUR6geqnw/FSVOUH9R36KupfaDHnBQn6MGqEnqVJcEAfZTBbNL4b+lZPI1VbwwnaSfYO8z8N+TVMd0Qj6EVdbs3eIBP29cVFkL00kk+wSEwHAamgh9bDAJSQWTITZFnF+85J1tBPyOUC9OqqnsVdTIRkVBi70Msy125uriHJ8XAXFRfzKBTQM+rO0/hc54cSQE8iyzAx/XLcEltjIU44uCQijOaHvPfxIv97TjWCzEcMo7+sZ4TGa+2V6KT2rPQ73ZptsPBZE30fVrymvxTvUCtDoqYC0ijhMk/3MkgDd62xFheOqVggjIIAbOVaujEh/ULsaNzioUsxhVAv/A34GD0YBubxZMQJupWpMNr58zHytcHth1ekICsDcRx4u+fxBK6vOCbgKyEIXEK975WOmaoZuErKv1QR8ORQd0eUE3Ac0TNSYrXvI24fZSLxwGfebiDKW3e08gln9J0oYvKoMNG6kmiRdmzMOtTi8sOsJJJfANA93oiseGbeZ7k1EHZAKCEcApu4wCxUsSz3rm4HQiim3B/wpOsBJA2yP/4cZIJYIBFcGwCjWeSKEwm4wosZtR7rKizGXJQJZRB1TuttftAprnAbOrM9rl9UHqwg+s1o+eOow/GNN5CaPOklSgdKq4us+Ji7pt6Dw1AF9vBOGImjJht5lRVWFDY7UL58/3wOt2YPEcN2xWVpPRe6EQC+y9rwINPNKsuRaYX5cXhIxGkks+Y7V+6vQRdLBi5yx1bGwicFebivj+ARgOhZGMJMFyQyWpoV2GRIa2ZXOX2bDyqnPxzEPNKC+1Zj957eDBTbz34PXAwvoMfBN+kGV8Bxf00VgQz/vaEB6nSCnRQVj2h2DZG4TyZwQWlSils3m8RDDEhk2uaqlHaYklVb3Ha42dh4B3eMzZ//eEmMc0kGL3cEU9WksqU4XvzAYKZ9n6fQCOz3thORCGkhgCf2bDMz4bjQpW39yE65Y1QO5FxiUgP+76E3hzI7D1VyBcwP5NTFcZzXjaPRMNZmvGPkfA23YMwLHRD0Mf3ZwTgaBIi8GgYMGsSjx2z3kEP9Jp5E5rOeoqQH75C3htPfDpD4CskXxFvHC5vQKPVjSwPqQfcKTAfxuA/Ws/lBAXwEhUTGjWSAL3r1qYykSju+UkIFbZDx09wPvb0iH1W9uEYw03MHAV3ltew1CqgDkyCNtWgt/cnwY/3GriG5n9hbMrccNljRmzLz0nJCCNJBsEwsCH24E3NgDr96brhfyWS2Sm3EYLVsOL0i0DsG8h+LDkqcLExHhfc9siVDDrjJ59sZJRyHKZFRKybiSkTtIjR08CrXwEdtGcXL2A4+192LOuDeatfqg6wMvsL5lbhWuWysIdO995E9BgSkh19THX7wQOtANXLgKWLQSaarUWI9dNP7bjo68OY9uef6GqhcW8ZkViX2a/nBWYQ4+RggmIBfFGnHgOcD0c7wD2HgOW0xuXk0xN5SDaOwL4cnsb1m05joPHejKK0hgEOb4Q8Muba3H1pXUwZZl96aqLgHSU2RCbEe6/9hzh875OYPdhYF5NDLt/Oohd+46gNxBjm2zzJhZyi/RyV5TggdsvRJnTOm5j3QQ0i9ra6OHj1u9+B/YdNcLXVQdDmYNPy9oZ971IcIPHjUHadVrHHFfZNphtTtx508W4eJEHsg7Gk6IJaIZlDEn3EdUEl7sBg4la2MtqkYgNIOz/F9FgF6IhX6p5mozcjgbGasw/xWCCs7IeN7U24b4VddwZj26jjTZynTQCmknxSBqIETanh7ceWEpmpIiokT7E6JFosBvxaD/iJCeNDQYzTFYnzHY3SsobmfM9eOyucjTO0KyOf510AqOHkl2kiMlSQoAlsPLAk4hHSCaIJMMqmUgfYBQeggxGK4xmOxprXHh8lYK51em+E/0/qwQyBh8iY+Q52pjlOZD8XFcFPHELcGlT3stlbBaymtOROTReBoZJ+0DjZ9pv4SFq9fL0YWqcjJl1+AwP8OSGS+amq6y4P/fyyWqvoC9lDAG7ainPEJcBs7xMBGOLbU6bGQTMJHAnDUlG2biPFZevEM4GCZl9sSsnPgG+bAHfa+l8vZJxpNSo+oPp/c4XP6bPBN0kog2qtdFz1WzIkfXmZuAKVm6JewlbvZKVgGZMilMPwW9ngdr5B3CEG7iEbCY5ffl6RgPtYDGdybS4ogW4YDbgLefTD5s2kv5rTgKaWdlKi1fau4BDJ3jM5I70NDd0J7grzfZEUMg5CM5Tmg4TiW3ZtVYxTKpcgM2iWS7+mhcBbRiZ/TBTd4jPjtSEVF3AxxdUPgkxTrUUMTcBykKUmLZwhQlYPhWBeCBV5DRjk3QtiEC2McUDsjPVCEhWEQ8Umk2y2c7nOyEwrV/ySdbdQo3nw3aKtRHM3wiBtVQu02knISJ+SQh8Q32TyqTJJ6xTXyQzyzb2LeoBWQOy5pjwcDf1YSqzNIooLex99kTCppsq4N+l+oUArylhoku9sb+O18VU8c5UEiZu7KGyrKKTmgr7/wGxhy03aZIycwAAAABJRU5ErkJggg=='%20/%3e%3c/svg%3e",iZt="data:image/svg+xml,%3c?xml%20version='1.0'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20100%20100'%3e%3ctitle%3ePandoc%20Icon%3c/title%3e%3cdesc%20property='dc:creator'%3eAlbert%20Krewinkel%3c/desc%3e%3cmetadata%20id='license'%20xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23'%20xmlns:dc='http://purl.org/dc/elements/1.1/'%20xmlns:cc='http://creativecommons.org/ns%23'%3e%3crdf:RDF%3e%3ccc:Work%20rdf:about=''%3e%3cdc:format%3eimage/svg+xml%3c/dc:format%3e%3cdc:type%20rdf:resource='http://purl.org/dc/dcmitype/StillImage'%20/%3e%3ccc:license%20rdf:resource='http://creativecommons.org/licenses/by-sa/4.0/'%20/%3e%3c/cc:Work%3e%3ccc:License%20rdf:about='http://creativecommons.org/licenses/by-sa/4.0/'%3e%3ccc:permits%20rdf:resource='http://creativecommons.org/ns%23Reproduction'%20/%3e%3ccc:permits%20rdf:resource='http://creativecommons.org/ns%23Distribution'%20/%3e%3ccc:requires%20rdf:resource='http://creativecommons.org/ns%23Notice'%20/%3e%3ccc:requires%20rdf:resource='http://creativecommons.org/ns%23Attribution'%20/%3e%3ccc:permits%20rdf:resource='http://creativecommons.org/ns%23DerivativeWorks'%20/%3e%3ccc:requires%20rdf:resource='http://creativecommons.org/ns%23ShareAlike'%20/%3e%3c/cc:License%3e%3c/rdf:RDF%3e%3c/metadata%3e%3crect%20fill='%23fed'%20stroke='%23fed'%20width='100'%20height='100'/%3e%3cg%20fill='none'%20stroke='%234093da'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='8'%20transform='skewX(-6)%20translate(8%201)'%3e%3cpath%20d='M%2030,10%20l%200,80%20M%2045,10%20l%200,80%20M%2020,10%20l%2040,0%20l%2018,18%20l%200,25%20l%20-33,0'%20/%3e%3cpath%20fill='%234093da'%20stroke-width='6'%20d='M%2061,10%20l%2017,17%20l%20-17,0%20l%200,-17'%20/%3e%3c/g%3e%3c/svg%3e",rZt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%20100%20100'%20version='1.1'%20id='svg4'%20sodipodi:docname='favicon.svg'%20inkscape:version='1.4.4%20(dcaf3e7,%202026-05-05)'%20xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape'%20xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:svg='http://www.w3.org/2000/svg'%3e%3csodipodi:namedview%20id='namedview4'%20pagecolor='%23ffffff'%20bordercolor='%23000000'%20borderopacity='0.25'%20inkscape:showpageshadow='2'%20inkscape:pageopacity='0.0'%20inkscape:pagecheckerboard='0'%20inkscape:deskcolor='%23d1d1d1'%20showgrid='true'%20inkscape:zoom='8.2236519'%20inkscape:cx='34.534536'%20inkscape:cy='45.174577'%20inkscape:window-width='1881'%20inkscape:window-height='1382'%20inkscape:window-x='1512'%20inkscape:window-y='30'%20inkscape:window-maximized='0'%20inkscape:current-layer='svg4'%3e%3cinkscape:grid%20type='axonomgrid'%20id='grid4'%20units='px'%20originx='0'%20originy='0'%20spacingx='3.7795276'%20spacingy='3.7795276'%20empcolor='%230099e5'%20empopacity='0.30196078'%20color='%230099e5'%20opacity='0.14901961'%20empspacing='0'%20dotted='false'%20gridanglex='40'%20gridanglez='40'%20enabled='true'%20visible='true'%20/%3e%3c/sodipodi:namedview%3e%3cdefs%20id='defs1'%3e%3cfilter%20id='shadow'%20x='0'%20y='0'%20width='1'%20height='1'%3e%3cfeDropShadow%20dx='0'%20dy='2'%20stdDeviation='3'%20flood-color='rgba(50,%2050,%2093,%200.18)'%20/%3e%3c/filter%3e%3c/defs%3e%3crect%20x='4'%20y='4'%20width='92'%20height='92'%20rx='22.08'%20fill='%23e8efff'%20filter='url(%23shadow)'%20id='rect1'%20transform='matrix(1.0869565,0,0,1.0869565,-4.347826,-4.347826)'%20style='stroke-width:0.92'%20ry='22.08'%20/%3e%3cpath%20style='fill:%230a2540;fill-opacity:1;stroke-width:1.88976'%20d='M%2049.999999,6.535431%204.9573423,44.330708%2049.999999,82.125984%2092.790523,46.220471%2095.042656,44.330708%20Z'%20id='path1'%20/%3e%3cpath%20style='fill:%23425466;fill-opacity:1;stroke-width:1.88976'%20d='M%204.9573423,44.330708%20V%2055.669291%20L%2049.999999,93.464567%20V%2082.125984%20Z'%20id='path2'%20/%3e%3cpath%20style='fill:%231a3550;fill-opacity:1;stroke-width:1.88976'%20d='M%2049.999999,82.125984%2095.042656,44.330708%20V%2055.669291%20L%2049.999999,93.464567%20Z'%20id='path3'%20/%3e%3cpath%20style='fill:%234ade80;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;fill-opacity:1'%20d='m%2045.042657,30.236221%209.008531,-7.559055%2022.521328,18.897638%20-9.008531,7.559056%20z'%20id='path5'%20/%3e%3cpath%20style='fill:none;fill-opacity:1;stroke:%234ade80;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1'%20d='M%2027.025594,49.133859%2047.29479,47.244096%2045.042657,64.25197'%20id='path6'%20/%3e%3c/svg%3e",sZt="data:image/svg+xml,%3csvg%20fill='%23261230'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eAstral%3c/title%3e%3cpath%20d='M1.44%200C.6422%200%200%20.6422%200%201.44v21.12C0%2023.3578.6422%2024%201.44%2024h21.12c.7978%200%201.44-.6422%201.44-1.44V1.44C24%20.6422%2023.3578%200%2022.56%200Zm4.7998%204.8h11.5199c.7953%200%201.44.6447%201.44%201.44V19.2h-6.624v-4.32h-1.152v4.32H4.8V6.24c0-.7953.6446-1.44%201.4398-1.44m4.032%205.472v1.152h3.456v-1.152z'/%3e%3c/svg%3e",aZt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='1.34em'%20height='1em'%20viewBox='0%200%20256%20192'%3e%3cpath%20fill='%232d4552'%20d='M84.38%20108.352c-9.556%202.712-15.826%207.467-19.956%2012.218c3.956-3.461%209.255-6.639%2016.402-8.665c7.311-2.072%2013.548-2.057%2018.702-1.062v-4.03c-4.397-.402-9.437-.082-15.148%201.539M63.987%2074.475l-35.49%209.35s.646.914%201.844%202.133l30.092-7.93s-.427%205.495-4.13%2010.41c7.005-5.299%207.684-13.963%207.684-13.963m29.709%2083.41c-49.946%2013.452-76.37-44.43-84.37-74.472c-3.696-13.868-5.31-24.37-5.74-31.148a11.5%2011.5%200%200%201%20.025-1.84C1.021%2050.58-.22%2051.927.032%2055.82c.43%206.773%202.044%2017.275%205.74%2031.147c7.997%2030.038%2034.424%2087.92%2084.37%2074.468c10.871-2.929%2019.038-8.263%2025.17-15.073c-5.652%205.104-12.724%209.123-21.616%2011.523M103.08%2039.05v3.555h19.59c-.401-1.259-.806-2.393-1.208-3.555z'/%3e%3cpath%20fill='%232d4552'%20d='M127.05%2068.325c8.81%202.503%2013.47%208.68%2015.933%2014.146l9.824%202.79s-1.34-19.132-18.645-24.047c-16.189-4.6-26.151%208.995-27.363%2010.754c4.71-3.355%2011.586-6.102%2020.251-3.643m78.197%2014.234c-16.204-4.62-26.162%209.003-27.356%2010.737c4.713-3.351%2011.586-6.099%2020.247-3.629c8.797%202.506%2013.452%208.676%2015.923%2014.146l9.837%202.8s-1.361-19.135-18.651-24.054m-9.76%2050.443l-81.718-22.845s.885%204.485%204.279%2010.293l68.803%2019.234c5.664-3.277%208.636-6.682%208.636-6.682m-56.655%2049.174C74.127%20164.828%2081.949%2082.386%2092.419%2043.32c4.311-16.1%208.743-28.066%2012.419-36.088c-2.193-.451-4.01.704-5.804%204.354C95.13%2019.5%2090.14%2032.387%2085.312%2050.427c-10.467%2039.066-18.29%20121.506%2046.412%20138.854c30.497%208.17%2054.256-4.247%2071.966-23.749c-16.81%2015.226-38.274%2023.763-64.858%2016.644'/%3e%3cpath%20fill='%23e2574c'%20d='M103.081%20138.565v-16.637l-46.223%2013.108s3.415-19.846%2027.522-26.684c7.311-2.072%2013.549-2.058%2018.701-1.063V39.05h23.145c-2.52-7.787-4.958-13.782-7.006-17.948c-3.387-6.895-6.859-2.324-14.741%204.269c-5.552%204.638-19.583%2014.533-40.698%2020.222c-21.114%205.694-38.185%204.184-45.307%202.95c-10.097-1.742-15.378-3.96-14.884%203.721c.43%206.774%202.043%2017.277%205.74%2031.148c7.996%2030.039%2034.424%2087.92%2084.37%2074.468c13.046-3.515%2022.254-10.464%2028.637-19.32h-19.256zm-74.588-54.74l35.494-9.35s-1.034%2013.654-14.34%2017.162c-13.31%203.504-21.154-7.812-21.154-7.812'/%3e%3cpath%20fill='%232ead33'%20d='M236.664%2039.84c-9.226%201.617-31.361%203.632-58.716-3.7c-27.363-7.328-45.517-20.144-52.71-26.168c-10.197-8.54-14.682-14.476-19.096-5.498c-3.902%207.918-8.893%2020.805-13.723%2038.846c-10.466%2039.066-18.289%20121.505%2046.413%20138.853c64.687%2017.333%2099.126-57.978%20109.593-97.047c4.83-18.037%206.948-31.695%207.53-40.502c.665-9.976-6.187-7.08-19.29-4.784M106.668%2072.161s10.196-15.859%2027.49-10.943c17.305%204.915%2018.645%2024.046%2018.645%2024.046zm42.215%2071.163c-30.419-8.91-35.11-33.167-35.11-33.167l81.714%2022.846c0-.004-16.494%2019.12-46.604%2010.32m28.89-49.85s10.183-15.847%2027.474-10.918c17.29%204.923%2018.651%2024.054%2018.651%2024.054z'/%3e%3cpath%20fill='%23d65348'%20d='m86.928%20126.51l-30.07%208.522s3.266-18.609%2025.418-25.983L65.25%2045.147l-1.471.447c-21.115%205.694-38.185%204.184-45.307%202.95c-10.097-1.741-15.379-3.96-14.885%203.722c.43%206.774%202.044%2017.276%205.74%2031.147c7.997%2030.039%2034.425%2087.92%2084.37%2074.468l1.471-.462zM28.493%2083.825l35.494-9.351s-1.034%2013.654-14.34%2017.162c-13.31%203.504-21.154-7.811-21.154-7.811'/%3e%3cpath%20fill='%231d8d22'%20d='m150.255%20143.658l-1.376-.335c-30.419-8.91-35.11-33.166-35.11-33.166l42.137%2011.778l22.308-85.724l-.27-.07c-27.362-7.329-45.516-20.145-52.71-26.17c-10.196-8.54-14.682-14.475-19.096-5.497c-3.898%207.918-8.889%2020.805-13.719%2038.846c-10.466%2039.066-18.289%20121.505%2046.413%20138.852l1.326.3zM106.668%2072.16s10.196-15.859%2027.49-10.943c17.305%204.915%2018.645%2024.046%2018.645%2024.046z'/%3e%3cpath%20fill='%23c04b41'%20d='m88.46%20126.072l-8.064%202.289c1.906%2010.74%205.264%2021.047%2010.534%2030.152c.918-.202%201.828-.376%202.762-.632c2.449-.66%204.72-1.479%206.906-2.371c-5.89-8.74-9.785-18.804-12.137-29.438m-3.148-75.644c-4.144%2015.467-7.852%2037.73-6.831%2060.06c1.826-.793%203.756-1.532%205.9-2.14l1.492-.334c-1.82-23.852%202.114-48.157%206.546-64.694a323%20323%200%200%201%203.373-11.704a105%20105%200%200%201-5.974%203.547a307%20307%200%200%200-4.506%2015.265'/%3e%3c/svg%3e",oZt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='512'%20height='512'%20version='1.1'%20viewBox='0%200%20135.47%20135.47'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m67.733%2067.733%2029.33%2016.933-29.33%2050.8c37.408%200%2067.733-30.325%2067.733-67.733%200-12.341-3.3168-23.901-9.0837-33.867h-58.65z'%20fill='%23afccf9'/%3e%3cpath%20d='m67.733-1e-6c-25.07%200-46.942%2013.63-58.654%2033.875l29.324%2050.792%2029.33-16.933v-33.867h58.65c-11.714-20.24-33.583-33.867-58.65-33.867z'%20fill='%231767d1'/%3e%3cpath%20d='m0%2067.733c0%2037.408%2030.324%2067.733%2067.733%2067.733l29.33-50.8-29.33-16.933-29.33%2016.933-29.324-50.792c-5.7637%209.9632-9.0794%2021.519-9.0794%2033.858'%20fill='%23679ef5'/%3e%3cpath%20d='m101.6%2067.733c0%2018.704-15.163%2033.867-33.867%2033.867-18.704%200-33.867-15.163-33.867-33.867s15.163-33.867%2033.867-33.867c18.704%200%2033.867%2015.163%2033.867%2033.867'%20fill='%23fff'/%3e%3cpath%20d='m95.25%2067.733c0%2015.197-12.32%2027.517-27.517%2027.517-15.197%200-27.517-12.32-27.517-27.517%200-15.197%2012.32-27.517%2027.517-27.517%2015.197%200%2027.517%2012.32%2027.517%2027.517'%20fill='%231a74e7'/%3e%3c/svg%3e",lZt="data:image/svg+xml,%3csvg%20fill='%23F03C2E'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGit%3c/title%3e%3cpath%20d='M13.09%2023.549a1.54%201.54%200%200%201-2.18%200L.451%2013.089a1.54%201.54%200%200%201%200-2.179l7.191-7.19%202.733%202.733a1.85%201.85%200%200%200%20.964%202.326v6.66a1.849%201.849%200%201%200%201.54%200V8.957l2.508%202.508a1.85%201.85%200%201%200%201.09-1.09l-2.634-2.634a1.85%201.85%200%200%200-2.378-2.377L8.73%202.63%2010.91.451a1.54%201.54%200%200%201%202.179%200l10.459%2010.46a1.54%201.54%200%200%201%200%202.179z'/%3e%3c/svg%3e",cZt="data:image/svg+xml,%3csvg%20fill='%23073551'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3ecurl%3c/title%3e%3cpath%20d='M.803%2014.8169c0-.5342.433-.9665.9665-.9665.5335%200%20.9665.4323.9665.9665%200%20.5335-.433.9657-.9665.9657-.5335%200-.9666-.4322-.9666-.9657m2.736%200c0-.1963-.0532-.376-.1119-.5525-.2344-.7024-.876-1.2169-1.6575-1.2169-.1249%200-.2344.0465-.3524.0708C.6149%2013.2865%200%2013.9646%200%2014.817c0%20.9764.7923%201.7694%201.7695%201.7694.9772%200%201.7694-.793%201.7694-1.7694m-1.7694-7.149c.5335%200%20.9665.433.9665.9665%200%20.5335-.433.9665-.9665.9665-.5343%200-.9666-.433-.9666-.9665%200-.5335.4323-.9665.9666-.9665m0%202.7359c.9772%200%201.7694-.7923%201.7694-1.7694%200-.1956-.0532-.376-.1119-.5525-.2344-.7024-.8767-1.2169-1.6575-1.2169-.1249%200-.2344.0465-.3524.0716C.6149%207.104%200%207.782%200%208.6344c0%20.9771.7923%201.7694%201.7695%201.7694m13.221-5.694c-.5342%200-.9665-.433-.9665-.9664a.966.966%200%2001.9666-.9665c.5335%200%20.9658.4322.9658.9665%200%20.5334-.4323.9664-.9658.9664m-9.6%2016.5133c-.5335%200-.9666-.433-.9666-.9665%200-.5342.433-.9665.9666-.9665a.966.966%200%2001.9665.9665c0%20.5335-.4323.9665-.9665.9665m9.6-19.2491c-.978%200-1.7695.7922-1.7695%201.7694%200%20.2085.0525.4025.1187.5882L5.039%2018.5581c-.803.1681-1.4179.8462-1.4179%201.6985%200%20.9772.7923%201.7694%201.7695%201.7694.9772%200%201.7694-.7922%201.7694-1.7694%200-.1963-.0525-.3759-.111-.5525l8.3427-14.2728c.7778-.1865%201.3683-.8531%201.3683-1.688%200-.977-.793-1.7693-1.7694-1.7693m7.24%202.7359c-.5343%200-.9666-.433-.9666-.9665a.966.966%200%2001.9665-.9665c.5335%200%20.9666.4322.9666.9665%200%20.5334-.433.9665-.9666.9665M12.6313%2021.223c-.5343%200-.9665-.433-.9665-.9665a.966.966%200%2001.9665-.9665c.5335%200%20.9658.4323.9658.9665%200%20.5335-.4323.9665-.9658.9665M22.2305%201.974c-.9772%200-1.7694.7922-1.7694%201.7694%200%20.2085.0525.4025.1187.5882l-8.3009%2014.2265c-.8021.1681-1.417.8462-1.417%201.6985%200%20.9772.7922%201.7694%201.7694%201.7694.9764%200%201.7687-.7922%201.7687-1.7694%200-.1963-.0525-.3759-.1111-.5525l8.3427-14.2728C23.4094%205.2448%2024%204.5782%2024%203.7433c0-.977-.7923-1.7693-1.7695-1.7693'/%3e%3c/svg%3e",uZt="data:image/svg+xml,%3csvg%20fill='%23007808'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eFFmpeg%3c/title%3e%3cpath%20d='M21.72%2017.91V6.5l-.53-.49L9.05%2018.52l-1.29-.06L24%201.53l-.33-.95-11.93%201-5.75%206.6v-.23l4.7-5.39-1.38-.77-9.11.77v2.85l1.91.46v.01l.19-.01-.56.66v10.6c.609-.126%201.22-.241%201.83-.36L14.12%205.22l.83-.04L0%2021.44l9.67.82%201.35-.77%206.82-6.74v2.15l-5.72%205.57%2011.26.95.35-.94v-3.16l-3.29-.18c.434-.403.858-.816%201.28-1.23z'/%3e%3c/svg%3e",dZt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%201080%201080'%3e%3c!--%20Generator:%20Adobe%20Illustrator%2030.3.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.3%20Build%20182)%20--%3e%3cdefs%3e%3cstyle%3e%20.st0%20{%20fill:%20%23ff0;%20}%20.st1%20{%20fill:%20%23333;%20}%20%3c/style%3e%3c/defs%3e%3cpath%20class='st0'%20d='M660.52,419.49l-195.15-52.98c-15.84-4.3-19.16-25.29-5.43-34.28l169.23-110.7-9.91-201.97c-.8-16.39,18.13-26.04,30.92-15.76l157.57,126.74,189.03-71.84c15.34-5.83,30.37,9.2,24.54,24.54l-71.84,189.03,126.74,157.57c10.29,12.79.64,31.73-15.76,30.92l-201.97-9.91-110.7,169.23c-8.98,13.73-29.98,10.41-34.28-5.43l-52.98-195.15h-.01Z'/%3e%3cpath%20class='st1'%20d='M603.34,476.66l32.94,121.68,4.45,16.23-429.11,429.11c-48.45,48.45-126.85,48.45-175.3,0C12.16,1019.51,0,987.89,0,956.15s12.02-63.48,36.31-87.77l429.11-429.11,16.35,4.33,121.56,33.06h0Z'/%3e%3c/svg%3e";function wK(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91 .58 .11 .79-.25.79-.56v-2.02c-3.2.7-3.88-1.36-3.88-1.36-.52-1.33-1.28-1.69-1.28-1.69-1.05-.72.08-.7.08-.7 1.16.08 1.77 1.19 1.77 1.19 1.03 1.77 2.71 1.26 3.37.96.1-.75.4-1.26.73-1.55-2.56-.29-5.25-1.28-5.25-5.7 0-1.26.45-2.29 1.19-3.1-.12-.29-.52-1.47.11-3.06 0 0 .97-.31 3.16 1.18A10.98 10.98 0 0 1 12 6.11c.98 0 1.96.13 2.87.39 2.19-1.49 3.16-1.18 3.16-1.18.63 1.59.23 2.77.11 3.06.74.81 1.19 1.84 1.19 3.1 0 4.43-2.7 5.4-5.27 5.69.42.36.78 1.06.78 2.14v3.04c0 .31.21.67.8.56A11.51 11.51 0 0 0 23.5 12C23.5 5.65 18.35.5 12 .5Z"})})}cl.registerLanguage("bash",OM);const fZt=48;function hZt(e,t=fZt){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}function pZt(e){return cl.highlight(e,{language:"bash",ignoreIllegals:!0}).value}function mZt({status:e}){return e==="succeeded"?a.jsx(Of,{"aria-hidden":!0}):e==="failed"?a.jsx(oB,{"aria-hidden":!0}):e==="running"?a.jsx(Vi,{className:"studio-build-progress__spinner","aria-hidden":!0}):a.jsx(jat,{"aria-hidden":!0})}function rle(e,t){if(!e)return"";const n=Date.parse(e);return Number.isNaN(n)?"":new Intl.DateTimeFormat(t,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(n)}function gZt({steps:e,log:t,logError:n="",logTruncated:i=!1,logUpdatedAt:r,loading:s=!1}){const{t:o,i18n:l}=_e("ui"),c=p.useRef(null),u=p.useRef(!0),[d,f]=p.useState(!1),h=p.useMemo(()=>pZt(t),[t]);p.useEffect(()=>{const g=c.current;g&&t&&u.current&&(g.scrollTop=g.scrollHeight)},[t]);const m=async()=>{try{await navigator.clipboard.writeText(t),f(!0),window.setTimeout(()=>f(!1),1500)}catch{f(!1)}};return a.jsxs("div",{className:"studio-build-progress",children:[a.jsx("ol",{className:"studio-build-progress__steps","aria-label":o("studioBuildProgress.steps"),children:e.map(g=>a.jsxs("li",{className:`is-${g.status}`,children:[a.jsx("span",{className:"studio-build-progress__step-icon",children:a.jsx(mZt,{status:g.status})}),a.jsx("span",{children:g.label})]},g.key))}),a.jsxs("section",{className:"studio-build-progress__log","aria-label":o("studioBuildProgress.log"),children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("strong",{children:o("studioBuildProgress.log")}),a.jsxs("span",{children:[o(s?"studioBuildProgress.syncing":n?"studioBuildProgress.loadFailed":"studioBuildProgress.synced"),i?o("studioBuildProgress.recentOnly"):"",rle(r,l.resolvedLanguage??l.language)?` · ${rle(r,l.resolvedLanguage??l.language)}`:""]})]}),a.jsxs(At,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:!t,onClick:()=>void m(),"aria-label":o(d?"studioBuildProgress.copiedLog":"studioBuildProgress.copyLog"),children:[d?a.jsx(Of,{"aria-hidden":!0}):a.jsx(ZD,{"aria-hidden":!0}),o(d?"studioBuildProgress.copied":"studioBuildProgress.copy")]})]}),t?a.jsx("pre",{ref:c,tabIndex:0,"aria-label":o("studioBuildProgress.logContent"),onScroll:g=>{u.current=hZt(g.currentTarget)},children:a.jsx("code",{className:"hljs language-bash",dangerouslySetInnerHTML:{__html:h}})}):a.jsx("div",{className:`studio-build-progress__log-empty${n?" is-error":""}`,children:n||o(s?"studioBuildProgress.waiting":"studioBuildProgress.empty")})]})]})}function sle({name:e,description:t,icon:n,selected:i,disabled:r=!1,onChange:s,className:o=""}){return a.jsxs("button",{type:"button",className:`studio-package-option${i?" is-selected":""}${o?` ${o}`:""}`,"aria-pressed":i,disabled:r,onClick:()=>s(!i),children:[a.jsx("span",{className:"studio-package-option__icon","aria-hidden":"true",children:n}),a.jsxs("span",{className:"studio-package-option__content",children:[a.jsx("strong",{children:e}),t?a.jsx("span",{children:t}):null]}),a.jsx("span",{className:"studio-package-option__action","aria-hidden":"true",children:i?a.jsx(uat,{}):a.jsx(hat,{})})]})}function Zb(e,t){return e[t]|e[t+1]<<8}function X0(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}async function bZt(e){const t=new DecompressionStream("deflate-raw"),n=new Blob([new Uint8Array(e)]).stream().pipeThrough(t);return new Uint8Array(await new Response(n).arrayBuffer())}async function M9e(e,t={}){let i=-1;for(let u=e.length-22;u>=0&&u>e.length-65557;u--)if(X0(e,u)===101010256){i=u;break}if(i<0)throw new Error(Yt("helpers.zip.invalid"));const r=Zb(e,i+10);if(t.maxEntries!==void 0&&r>t.maxEntries)throw new Error(Yt("helpers.zip.tooManyFiles",{count:t.maxEntries}));let s=X0(e,i+16);const o=new TextDecoder("utf-8"),l=[];let c=0;for(let u=0;ut.maxUncompressedBytes)throw new Error(Yt("helpers.zip.tooLarge"));const w=Zb(e,v+26),x=Zb(e,v+28),k=v+30+w+x,S=e.subarray(k,k+f);let O;if(d===0)O=S;else if(d===8)O=await bZt(S);else{s+=46+m+g+b;continue}l.push({name:y,text:o.decode(O)}),s+=46+m+g+b}return l}const J7=/(^|\/)skill\.md$/i;function yZt(e){const t=(e??"").replace(/\r\n?/g,` +`),w=(e==null?void 0:e.pendingMessage)||s;if(p.useEffect(()=>{e&&f(u)},[e==null?void 0:e.status,u]),p.useEffect(()=>{if(!d||!g)return;const E=c.current;E&&(E.scrollTop=E.scrollHeight)},[d,g,y]),!e||!e.text&&e.status!=="error"&&!e.pendingMessage)return null;const x=EXt(e.updatedAt,l.resolvedLanguage??l.language),k=e.status==="complete"?o("agentWorkspace.logStatus.synced"):e.status==="error"?o("agentWorkspace.logStatus.failed"):o("agentWorkspace.logStatus.syncing"),S=e.omittedEarly?o("agentWorkspace.logStatus.earlyOmitted"):e.snapshotTruncated?o("agentWorkspace.logStatus.recentOnly"):e.truncated?o("agentWorkspace.logStatus.partiallyOmitted"):"",O=[k,e.lineCount?o("agentWorkspace.logLines",{count:e.lineCount}):"",S,x].filter(Boolean).join(" · ");async function A(){try{await navigator.clipboard.writeText(b),m(!0),window.setTimeout(()=>m(!1),1500)}catch{m(!1)}}return a.jsxs("section",{className:`aw-deploy-log is-${e.status}${d?"":" is-collapsed"}`,"aria-label":i,children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("strong",{children:n}),a.jsx("span",{children:O})]}),a.jsxs("div",{className:"aw-deploy-log-actions",children:[g&&a.jsx("button",{type:"button",onClick:()=>f(E=>!E),children:o(d?"common.collapse":"common.expand")}),g&&a.jsxs("button",{type:"button",onClick:()=>void A(),"aria-label":h?o("agentWorkspace.copiedLabel",{label:r}):o("agentWorkspace.copyLabel",{label:r}),title:h?o("agentWorkspace.copied"):o("agentWorkspace.copyLabel",{label:r}),children:[h?a.jsx(Of,{"aria-hidden":!0}):a.jsx(ZD,{"aria-hidden":!0}),a.jsx("span",{children:o(h?"agentWorkspace.copied":"agentWorkspace.copy")})]})]})]}),d&&(g?a.jsx("pre",{ref:c,children:y}):a.jsx("div",{className:"aw-deploy-log-empty",children:w}))]})}function CXt({task:e}){var n;const{t}=_e("ui");return a.jsx(f9e,{log:e.buildLog,autoExpand:((n=e.buildLog)==null?void 0:n.status)!=="complete"&&(e.status==="running"||e.status==="error")&&d9e(e,t)===1,title:t("agentWorkspace.buildLog"),ariaLabel:t("agentWorkspace.buildLog"),copyLabel:t("agentWorkspace.buildLog"),defaultPendingMessage:t("agentWorkspace.waitingBuildLog")})}function AXt({task:e}){var n;const{t}=_e("ui");return a.jsx(f9e,{log:e.githubLog,autoExpand:((n=e.githubLog)==null?void 0:n.status)!=="complete"&&(e.status==="running"||e.status==="error")&&e.phase==="github",title:t("agentWorkspace.githubMountLog"),ariaLabel:t("agentWorkspace.githubDeliveryMountLog"),copyLabel:t("agentWorkspace.githubMountLog"),defaultPendingMessage:t("agentWorkspace.waitingGithubMountLog")})}function TXt({task:e,onReturnToEdit:t}){const{t:n}=_e("ui"),[i,r]=p.useState(!1),s=u9e(e,n),o=d9e(e,n),l=e.status==="success"?100:Math.max(6,Math.min(100,e.pct??6)),c=e.status==="running"&&e.statusUnconfirmed?n("agentWorkspace.deployStatus.unconfirmed"):e.status==="running"?n("agentWorkspace.deployStatus.running"):e.status==="success"?n("agentWorkspace.deployStatus.success"):e.status==="error"?n("agentWorkspace.deployStatus.error"):n("agentWorkspace.deployStatus.cancelled"),u=()=>{i||!e.retry||(r(!0),e.retry().catch(()=>{}).finally(()=>r(!1)))};return a.jsxs("section",{className:`aw-deploy-progress-card is-${e.status}`,"aria-live":"polite",children:[a.jsxs("div",{className:"aw-deploy-progress-head",children:[a.jsxs("div",{children:[a.jsx("span",{className:"aw-deploy-progress-icon","aria-hidden":!0,children:e.status==="running"&&e.statusUnconfirmed?a.jsx(gN,{}):e.status==="running"?a.jsx(Vi,{className:"spin"}):e.status==="success"?a.jsx(jat,{}):e.status==="error"?a.jsx(gN,{}):a.jsx(oB,{})}),a.jsxs("div",{children:[a.jsx("h3",{children:c}),a.jsx("p",{children:e.runtimeName})]})]}),a.jsx("strong",{children:e.status==="running"&&!e.statusUnconfirmed?`${Math.round(l)}%`:e.label})]}),a.jsx("div",{className:"aw-deploy-progress-track",role:"progressbar","aria-label":n("agentWorkspace.deploymentProgress"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(l),children:a.jsx("span",{style:{width:`${l}%`}})}),a.jsx("ol",{className:"aw-deploy-steps",children:s.map((d,f)=>{const h=e.status==="success"||fnew Set),[_n,pi]=p.useState(()=>new Set),[Nn,Dn]=p.useState(!1),[_i,Fn]=p.useState(""),Kn=p.useRef(null);p.useEffect(()=>()=>{var fe;return(fe=Kn.current)==null?void 0:fe.abort()},[]);const[Rn,nt]=p.useState(null),[Qt,Be]=p.useState([]),[xt,zt]=p.useState([]),[jn,lr]=p.useState(!1),[ta,Ms]=p.useState(""),[ts,ci]=p.useState(""),[Ei,$r]=p.useState(0),[na,ns]=p.useState([]),[Il,fs]=p.useState(!1),[me,Sr]=p.useState(""),[go,bo]=p.useState(0),[La,uc]=p.useState(null),[Ls,Hs]=p.useState(1),[ml,ji]=p.useState(!1),[mi,Pl]=p.useState(""),[yo,dc]=p.useState(0),[Ni,io]=p.useState(null),[Uo,$s]=p.useState(null),[Es,is]=p.useState(null),[qs,$a]=p.useState(!1),[Li,rs]=p.useState(""),[vr,gl]=p.useState(null),[ia,ss]=p.useState(!1),[Ir,Dl]=p.useState(""),[Fr,Bh]=p.useState(0),[vo,xo]=p.useState(""),[wo,Qo]=p.useState(!1),[$d,zo]=p.useState(!1),[Hc,qu]=p.useState(!1),[Rf,Fa]=p.useState(""),[Uh,ra]=p.useState(""),[Vo,Ho]=p.useState(0),[qo,qc]=p.useState({saving:!1,error:"",notice:""}),[Wc,ko]=p.useState(!1),[ya,ro]=p.useState(()=>new Set),[nn,Oo]=p.useState(!1),[Kc,Pr]=p.useState(""),[dr,Gc]=p.useState(""),[Wu,Wo]=p.useState(()=>new Set),bl=p.useRef(!1),fc=p.useRef(""),Ml=p.useRef(null),Ba=p.useRef(0),va=p.useRef(0),Ua=p.useRef(0),Ie=p.useRef(0),[dt,Vt]=p.useState(GGt),[Mn,mn]=p.useState("");p.useEffect(()=>{e.length!==0&&Vt(fe=>fe.map(($e,Xe)=>Xe===0&&$e.agentIds.length===0?{...$e,agentIds:e.slice(0,2).map(ut=>ut.id)}:$e))},[e]);const gn=p.useMemo(()=>{const fe=new Map;for(const $e of e)$e.runtimeId&&fe.set($e.runtimeId,$e);return fe},[e]),On=p.useMemo(()=>{var $e;const fe=new Map;for(const Xe of t){const ut=($e=Xe.deploymentTarget)==null?void 0:$e.runtimeId;if(!ut||!gn.has(ut))continue;const Xt=fe.get(ut);(!Xt||Xe.updatedAt>Xt.updatedAt)&&fe.set(ut,Xe)}return fe},[gn,t]),It=p.useMemo(()=>{const fe=new Map;for(const $e of f){if(!$e.runtimeId)continue;const Xe=fe.get($e.runtimeId);(!Xe||$e.startedAt>Xe.startedAt)&&fe.set($e.runtimeId,$e)}return fe},[f]),wn=p.useMemo(()=>{const fe=it.trim().toLowerCase();return fe?e.filter($e=>{const Xe=$e.runtimeId?On.get($e.runtimeId):void 0,ut=$e.runtimeId?It.get($e.runtimeId):void 0;return[$e.label,$e.app,$e.host??"",(Xe==null?void 0:Xe.draft.name)??"",(Xe==null?void 0:Xe.draft.description)??"",(ut==null?void 0:ut.runtimeName)??""].join(" ").toLowerCase().includes(fe)}):e},[e,It,it,On]),zn=p.useMemo(()=>{const fe=it.trim().toLowerCase();return t.filter($e=>{var ut;const Xe=(ut=$e.deploymentTarget)==null?void 0:ut.runtimeId;return Xe&&gn.has(Xe)?!1:fe?`${$e.draft.name} ${$e.draft.description}`.toLowerCase().includes(fe):!0})},[gn,t,it]),Gn=p.useMemo(()=>t.filter(fe=>{var Xe;const $e=(Xe=fe.deploymentTarget)==null?void 0:Xe.runtimeId;return!$e||!gn.has($e)}).length,[gn,t]),hs=p.useMemo(()=>{const fe=it.trim().toLowerCase();return fe?dt.filter($e=>$e.name.toLowerCase().includes(fe)):dt},[dt,it]),se=e.find(fe=>fe.id===U),Vn=t.find(fe=>fe.id===z),gi=h?f.find(fe=>fe.id===h):void 0,So=se!=null&&se.runtimeId?On.get(se.runtimeId):void 0,ae=x?$t:U&&r===U?i:null,Qe=(ae==null?void 0:ae.appName)||(se==null?void 0:se.runtimeApp)||(se==null?void 0:se.app)||"",Ne=(se==null?void 0:se.agentCategory)??"general",le=Ne==="mpa"?"basic":H,Fe=(ne==null?void 0:ne.runtimeId)===(se==null?void 0:se.runtimeId)?ne:null,st=Fe==null?void 0:Fe.mpaInstanceId,ct=(se==null?void 0:se.mpaInstanceId)??st??(se==null?void 0:se.runtimeId)??"",An=YGt.filter(fe=>Ne==="mpa"?fe==="basic":fe==="profileConfig"?!1:fe==="usage"?c&&(se==null?void 0:se.runtimeId):!(fe==="sessionConfig"||fe==="diagnostics")).map(fe=>({id:fe,label:_(`agentWorkspace.sections.${fe}`)})),Ci=JSON.stringify([(se==null?void 0:se.runtimeId)??"",(se==null?void 0:se.region)??"cn-beijing",Qe,Ls]),Bi=(La==null?void 0:La.requestKey)===Ci?La.value:null,un=`${(se==null?void 0:se.region)??"cn-beijing"}:${(se==null?void 0:se.runtimeId)??""}`,ui=JSON.stringify([(se==null?void 0:se.runtimeId)??"",ct,(se==null?void 0:se.region)??"cn-beijing",y]),Kt=JSON.stringify([(se==null?void 0:se.runtimeId)??"",ct,(se==null?void 0:se.region)??"cn-beijing"]),di=Kt,Bn=JSON.stringify([(se==null?void 0:se.runtimeId)??"",(se==null?void 0:se.region)??"cn-beijing",y]),$i=(Se==null?void 0:Se.requestKey)===un?Se.value:"",Xn=(X==null?void 0:X.requestKey)===un?X:null,er=(Ni==null?void 0:Ni.requestKey)===ui&&y?Ni.value:null,as=(Es==null?void 0:Es.requestKey)===Kt?Es.value:null,Br=(Uo==null?void 0:Uo.requestKey)===di?Uo.value:(as==null?void 0:as.profile)??null,xr=(as==null?void 0:as.bindingStatus)??"",If=eXt((hc=as==null?void 0:as.safeError)==null?void 0:hc.code,_),Ib=(as==null?void 0:as.capabilities.canWrite)===!0,o0=(vr==null?void 0:vr.requestKey)===Bn?vr:null,l0=!!(se!=null&&se.runtimeId&&Ne==="mpa"&&xr!=="runtime_missing"&&xr!=="binding_ambiguous"),Qh=!!((se==null?void 0:se.agentCategory)==="mpa"&&(se!=null&&se.runtimeId)&&(se==null?void 0:se.runtimeId)===w&&xr==="bound"&&y),fr=(Br==null?void 0:Br.status)==="applied"?Br.profileRevision:null,zh=!!(Qh&&er&&fr!=null&&fr>er.profileRevision),Xc=mx(er),Yc=vo.trim()!==Xc,Zc=!!((k0=Xn==null?void 0:Xn.apiApps)!=null&&k0.length),xa=!!(Xn!=null&&Xn.a2a),Pb=((Ud=Xn==null?void 0:Xn.apiApps)==null?void 0:Ud[0])??Qe,Ll=(ne==null?void 0:ne.endpoint)??"",Pf=rXt(((Uk=Xn==null?void 0:Xn.a2a)==null?void 0:Uk.endpoint)??"",Ll),Jc=(se==null?void 0:se.runtimeApp)||"",so=JSON.stringify([(se==null?void 0:se.runtimeId)??"",(se==null?void 0:se.region)??"",(se==null?void 0:se.currentVersion)??null,Jc]),Rt=l&&(se!=null&&se.runtimeId)&&se.region&&We===0?H8({runtimeId:se.runtimeId,region:se.region,appName:Jc,currentVersion:se.currentVersion}):null,Ri=(Ae==null?void 0:Ae.requestKey)===so?Ae.value:Rt,yl=Ri!=null&&Ri.reason?_o(Ri.reason,L.resolvedLanguage||L.language):"",Wi=(Ri==null?void 0:Ri.warnings.filter(fe=>_o(fe,L.resolvedLanguage||L.language)))??[],Pn=Ne!=="mpa";p.useEffect(()=>{const fe=Ba.current+1;Ba.current=fe,Re(null),Et("");const $e=(se==null?void 0:se.runtimeId)??"",Xe=(se==null?void 0:se.region)??"";if(!Pn||!l||!$e||!Xe){Nt(!1);return}const ut=We===0?H8({runtimeId:$e,region:Xe,appName:Jc,currentVersion:se==null?void 0:se.currentVersion}):null;if(ut){Re({requestKey:so,value:ut}),Nt(!1);return}const Xt=new AbortController;let Ye,kn=0;const Dr=60;Nt(!0);const yi=bs=>{RD({runtimeId:$e,region:Xe,appName:Jc,currentVersion:se==null?void 0:se.currentVersion,signal:Xt.signal,force:bs&&We>0}).then(Qa=>{var Lb,Ws;if(fe!==Ba.current)return;const Qk=Qa.recoveryStatus==="preparing";if(Qa.runtime.runtimeId!==$e||Qa.runtime.region!==Xe||!Qk&&Jc&&((Lb=Qa.agent)==null?void 0:Lb.appName)!==Jc||Qa.canUpdate&&!((Ws=Qa.agent)!=null&&Ws.appName)){Et(_("agentWorkspace.errors.updateCapabilityMismatch"));return}if(Re({requestKey:so,value:Qa}),Nt(!1),!!Qk){if(kn+=1,kn>=Dr){Et(_("agentWorkspace.errors.updateConfigRestoring"));return}Ye=window.setTimeout(()=>yi(!1),1e3)}}).catch(()=>{fe!==Ba.current||Xt.signal.aborted||Et(_("agentWorkspace.errors.checkUpdateCapability"))}).finally(()=>{fe===Ba.current&&!Xt.signal.aborted&&Nt(!1)})};return yi(!0),()=>{Xt.abort(),Ye!=null&&window.clearTimeout(Ye)}},[l,Jc,We,se==null?void 0:se.currentVersion,se==null?void 0:se.region,se==null?void 0:se.runtimeId,Pn,so]);const ps=p.useMemo(()=>{const fe=new Map(e.map((Xe,ut)=>[Xe.id,ut])),$e=new Map(n.map((Xe,ut)=>[Xe,ut]));return[...wn].sort((Xe,ut)=>{const Xt=Xe.runtimeId?It.get(Xe.runtimeId):void 0,Ye=ut.runtimeId?It.get(ut.runtimeId):void 0,kn=(Xt==null?void 0:Xt.status)==="running"?Xt.startedAt:0,Dr=(Ye==null?void 0:Ye.status)==="running"?Ye.startedAt:0;if(kn!==Dr)return Dr-kn;const yi=$e.get(Xe.id),bs=$e.get(ut.id);return yi!=null&&bs!=null?yi-bs:yi!=null?-1:bs!=null?1:(fe.get(Xe.id)??0)-(fe.get(ut.id)??0)})},[n,e,wn,It]),Db=(se==null?void 0:se.label)||(ae==null?void 0:ae.name)||(Vn==null?void 0:Vn.draft.name)||(gi==null?void 0:gi.agentName)||((aa=gi==null?void 0:gi.agentDraft)==null?void 0:aa.name)||_("agentWorkspace.noAgentSelected"),c0=dt.find(fe=>fe.id===Mn),i2=ps.filter(fe=>fe.canDelete===!0),$l=ps.filter(fe=>Ji.has(fe.id)&&fe.canDelete===!0),u0=zn.filter(fe=>_n.has(fe.id)),Sm=i2.length+zn.length,d0=$l.length+u0.length,xn=p.useMemo(()=>{var $e;if(gi!=null&&gi.agentDraft)return gi.agentDraft;if(Vn!=null&&Vn.draft)return Vn.draft;const fe=($e=se==null?void 0:se.region)!=null&&$e.startsWith("ap-")?"byteplus":"volcengine";return Ri!=null&&Ri.agent&&(Ri.recoveryStatus==="complete"||Ri.recoveryStatus==="draft-only")?hH(Ri.agent,fe,Ri.runtime.configuredEnvKeys):mXt(ae,Qe||(se==null?void 0:se.label)||"agent",fe)},[ae,Qe,se==null?void 0:se.label,se==null?void 0:se.region,Vn==null?void 0:Vn.draft,gi==null?void 0:gi.agentDraft,Ri]),Ku=((f2=ae==null?void 0:ae.draft)==null?void 0:f2.harnessSidecar)??fmt(ne==null?void 0:ne.envs),r2=Ku?tk.filter(fe=>Ku.componentOverrides[fe]):[],s2=p.useMemo(()=>zA(xn),[xn]),Fd=Vn?o?"":_("agentWorkspace.errors.noCreatePermission"):Ne==="mpa"?"":l?se!=null&&se.runtimeId?se.region?St?_("agentWorkspace.errors.checkingUpdateConfig"):Dt||(Ri?Ri.recoveryStatus!=="complete"&&Ri.recoveryStatus!=="draft-only"?yl||_("agentWorkspace.errors.originalConfigUnavailable"):Ri.canUpdate?(Mf=Ri.agent)!=null&&Mf.appName?"":_("agentWorkspace.errors.agentInfoMissing"):yl||_("agentWorkspace.errors.updateUnsupported"):_("agentWorkspace.errors.updateCapabilityPending")):_("agentWorkspace.errors.runtimeRegionMissing"):_("agentWorkspace.errors.cloudOnlyUpdate"):_("agentWorkspace.errors.noManagePermission"),Rk="aw-update-disabled-reason",f0=se?Ne!=="mpa"?_("agentWorkspace.sessionConfigNonMpa"):qs?_("agentWorkspace.loadingMpaAgentView"):Li||If||(xr==="runtime_missing"?_("agentWorkspace.mpaRuntimeMissing"):xr==="binding_ambiguous"?_("agentWorkspace.mpaRuntimeBindingAmbiguous"):xr&&!l0?_("agentWorkspace.mpaRuntimeMissing"):Ib?"":_("agentWorkspace.errors.noManagePermission")):_("agentWorkspace.sessionConfigNoAgent"),a2=se?Ne!=="mpa"?_("agentWorkspace.sessionConfigNonMpa"):qs?_("agentWorkspace.loadingMpaAgentView"):Li||If||(xr==="runtime_missing"?_("agentWorkspace.mpaRuntimeMissing"):xr==="binding_ambiguous"?_("agentWorkspace.mpaRuntimeBindingAmbiguous"):xr==="orphan_runtime"?_("agentWorkspace.mpaRuntimeOrphan"):y?se.runtimeId!==w?_("agentWorkspace.sessionConfigDifferentRuntime"):"":_("agentWorkspace.sessionConfigNoSession")):_("agentWorkspace.sessionConfigNoAgent"),Em=se?Ne!=="mpa"?_("agentWorkspace.sessionConfigNonMpa"):qs?_("agentWorkspace.loadingMpaAgentView"):Li||(xr!=="bound"?a2:y?se.runtimeId!==w?_("agentWorkspace.sessionConfigDifferentRuntime"):"":_("agentWorkspace.sessionConfigNoSession")):_("agentWorkspace.sessionConfigNoAgent"),h0=p.useMemo(()=>{if(ae)return ae.tools;const fe=(xn.builtinTools??[]).map($e=>{var Xe;return((Xe=lT.find(ut=>ut.id===$e))==null?void 0:Xe.label)??$e});return Array.from(new Set([...xn.tools,...fe,...(xn.customTools??[]).map($e=>$e.name),...(xn.mcpTools??[]).map($e=>$e.name)].filter(Boolean)))},[xn,ae]),Ik=p.useMemo(()=>ae?ae.skillsPreviewSupported?ae.skills.map(fe=>fe.name):null:Array.from(new Set([...(xn.selectedSkills??[]).map(fe=>fe.name),...xn.skills].filter(Boolean))),[xn,ae]),Ur=p.useMemo(()=>{if(gi)return gi;if(Vn){const fe=f.filter($e=>$e.draftId===Vn.id).sort(($e,Xe)=>Xe.startedAt-$e.startedAt)[0];return fe||f.filter($e=>{var Xe,ut;return((Xe=$e.agentDraft)==null?void 0:Xe.name)===Vn.draft.name||$e.agentName===Vn.draft.name||!!((ut=Vn.deploymentTarget)!=null&&ut.runtimeId)&&$e.runtimeId===Vn.deploymentTarget.runtimeId}).sort(($e,Xe)=>Xe.startedAt-$e.startedAt)[0]}if(se)return f.filter(fe=>!!se.runtimeId&&fe.runtimeId===se.runtimeId||fe.agentName===se.label).sort((fe,$e)=>$e.startedAt-fe.startedAt)[0]},[f,se,Vn,gi]),p0=!!(h&&Ur&&Ur.id===h),Df=!!(Ur&&(Ur.status!=="success"||p0)),Vh=(Ur==null?void 0:Ur.status)==="running",eu=Ur!=null&&Ur.draftId?t.find(fe=>fe.id===Ur.draftId)??(Ur.agentDraft?{id:Ur.draftId,draft:Ur.agentDraft,updatedAt:Ur.startedAt}:void 0):void 0,o2=p.useMemo(()=>kXt(xn),[xn]),vl=(se==null?void 0:se.currentVersion)??(ne==null?void 0:ne.currentVersion)??null,Fi=vl??(gi==null?void 0:gi.startedAt)??"unknown",Eo=ae?`runtime:${(se==null?void 0:se.runtimeId)??ae.name}:v${Fi}:${o2}`:`draft:${(gi==null?void 0:gi.id)??(Vn==null?void 0:Vn.id)??(se==null?void 0:se.id)??Db}:${o2}`;p.useEffect(()=>{let fe=!1;const $e=(se==null?void 0:se.runtimeId)??"",Xe=ct||$e,ut=(se==null?void 0:se.region)??"cn-beijing",Xt=Kt;if(rs(""),Ne!=="mpa"||!$e||le!=="profileConfig"&&le!=="sessionConfig"){is(null),$a(!1);return}const Ye=new AbortController;return $a(!0),jTe({mpaInstanceId:Xe,runtimeId:$e,region:ut,signal:Ye.signal}).then(kn=>{fe||(is({requestKey:Xt,value:kn}),$s(kn.profile?{requestKey:di,value:kn.profile}:null))}).catch(kn=>{fe||Ye.signal.aborted||(is(null),rs(kn instanceof Error?kn.message:_("agentWorkspace.errors.loadMpaAgentView")))}).finally(()=>{fe||$a(!1)}),()=>{fe=!0,Ye.abort()}},[We,Kt,le,ct,se==null?void 0:se.region,se==null?void 0:se.runtimeId,Ne,di,_]),p.useEffect(()=>{le==="usage"&&!c&&q("basic")},[c,le]),p.useEffect(()=>{le==="sessionConfig"&&(!(se!=null&&se.runtimeId)||Ne!=="mpa")&&q("basic")},[le,se==null?void 0:se.runtimeId,Ne]),p.useEffect(()=>{le==="diagnostics"&&(!(se!=null&&se.runtimeId)||Ne!=="mpa")&&q("basic")},[le,se==null?void 0:se.runtimeId,Ne]),p.useEffect(()=>{if(!h)return;const fe=f.find(Xe=>Xe.id===h),$e=fe!=null&&fe.runtimeId?gn.get(fe.runtimeId):void 0;if($e){J(""),Z($e.id),q("basic");return}Z(""),J(""),q("basic")},[gn,f,h]),p.useEffect(()=>{if(!m){fc.current="";return}const fe=`${m}:${g}:${b}:${c}`;fc.current!==fe&&e.some($e=>$e.id===m)&&(fc.current=fe,J(""),Z(m),q(g==="usage"&&!c?"basic":g),g==="evaluations"&&(Ot(b),Mt("")))},[e,c,m,g,b]),p.useEffect(()=>{for(const fe of ps.slice(0,8)){if(!fe.runtimeId)continue;const $e=fe.region??"cn-beijing";R2e(fe.runtimeId,$e),STe(fe.runtimeId,$e,fe.runtimeApp??"")}},[ps]),p.useEffect(()=>{let fe=!1;const $e=(se==null?void 0:se.runtimeId)??"",Xe=(se==null?void 0:se.region)??"cn-beijing",ut=(se==null?void 0:se.runtimeApp)??"",Xt=$e?OTe($e,Xe,ut):null;if(He(Xt),_t(""),tn(!1),je(!!Xt||!x||!$e),!(!x||!$e))return Az($e,Xe,ut,{force:!0}).then(Ye=>{fe||He(Ye)}).catch(Ye=>{!fe&&!Xt&&He(null),fe||(tn(Ye instanceof Ea&&Ye.unsupported),_t(_("agentWorkspace.errors.loadAgentInfo")))}).finally(()=>{fe||je(!0)}),()=>{fe=!0}},[x,We,se==null?void 0:se.currentVersion,se==null?void 0:se.region,se==null?void 0:se.runtimeApp,se==null?void 0:se.runtimeId]),p.useEffect(()=>{let fe=!1;const $e=(se==null?void 0:se.runtimeId)??"",Xe=(se==null?void 0:se.region)??"cn-beijing";if(ns([]),Sr(""),le!=="optimizations"||!$e){fs(!1);return}if(x&&!Qe){fs(!yt);return}return fs(!0),cTe({runtimeId:$e,region:Xe,appName:Qe}).then(ut=>{fe||ns(ut.groups)}).catch(()=>{fe||Sr(_("agentWorkspace.errors.loadOptimizations"))}).finally(()=>{fe||fs(!1)}),()=>{fe=!0}},[yt,x,go,le,Qe,se==null?void 0:se.region,se==null?void 0:se.runtimeId]),p.useEffect(()=>{Hs(1)},[se==null?void 0:se.runtimeId,Qe]),p.useEffect(()=>{const fe=Ua.current+1;Ua.current=fe;const $e=(se==null?void 0:se.runtimeId)??"",Xe=(se==null?void 0:se.region)??"cn-beijing",ut=Qe;if(Pl(""),le!=="usage"||!$e){ji(!1);return}if(!ut){ji(x&&!yt);return}const Xt=new AbortController;return ji(!0),y2e({runtimeId:$e,region:Xe,appName:ut,page:Ls,pageSize:ZGt,signal:Xt.signal}).then(Ye=>{if(fe===Ua.current){if(Ye.runtimeId!==$e||Ye.appName!==ut||Ye.page!==Ls){Pl(_("agentWorkspace.errors.usageMismatch"));return}uc({requestKey:Ci,value:Ye})}}).catch(()=>{fe!==Ua.current||Xt.signal.aborted||Pl(_("agentWorkspace.errors.loadUsage"))}).finally(()=>{fe===Ua.current&&ji(!1)}),()=>{Xt.abort()}},[Ls,yo,Ci,yt,x,le,Qe,se==null?void 0:se.region,se==null?void 0:se.runtimeId]),p.useEffect(()=>{va.current+=1,xe(null),Ue(!1),Me(!1),ue(""),ge("api-server")},[un,le]),p.useEffect(()=>{const fe=(se==null?void 0:se.runtimeId)??"",$e=(se==null?void 0:se.region)??"cn-beijing",Xe=Bn;if(Dl(""),le!=="diagnostics"||Ne!=="mpa"||xr!=="bound"||!fe||!y||fe!==w){ss(!1),le!=="diagnostics"&&gl(null);return}const ut=new AbortController;let Xt=!1;return ss(!0),RTe({runtimeId:fe,region:$e,sessionId:y,signal:ut.signal}).then(async Ye=>{const kn=Ye.runs[0],Dr=kn?await ITe({runtimeId:fe,region:$e,sessionId:y,invocationId:kn.invocationId,signal:ut.signal}):null;return{runs:Ye.runs,trace:Dr}}).then(Ye=>{Xt||gl({requestKey:Xe,...Ye})}).catch(Ye=>{Xt||ut.signal.aborted||(gl(null),Dl(Ye instanceof Error?Ye.message:_("agentWorkspace.errors.loadMpaDiagnostics")))}).finally(()=>{Xt||ss(!1)}),()=>{Xt=!0,ut.abort()}},[w,y,Fr,Bn,le,se==null?void 0:se.region,se==null?void 0:se.runtimeId,Ne,xr,_]);function ms(){va.current+=1,xe(null),Ue(!1),Me(!1),ue("")}function Pk(fe){fe!==he&&(ms(),ge(fe))}async function m0(){if(Pe){ms();return}const fe=(se==null?void 0:se.runtimeId)??"",$e=(se==null?void 0:se.region)??"cn-beijing";if(!fe)return;const Xe=va.current+1;va.current=Xe,Me(!0),ue("");try{const ut=await T2e(fe,$e);if(Xe!==va.current)return;xe({requestKey:un,value:ut}),Ue(!0)}catch(ut){if(Xe!==va.current)return;xe(null),Ue(!1),ue(ut instanceof Error?ut.message:_("agentWorkspace.errors.loadApiKey"))}finally{Xe===va.current&&Me(!1)}}p.useEffect(()=>{let fe=!1;const $e=(se==null?void 0:se.runtimeId)??"",Xe=(se==null?void 0:se.region)??"cn-beijing",ut=$e?N2e($e,Xe):null;if(W(ut),vt(""),!!$e)return ID($e,Xe,{force:!0}).then(Xt=>{fe||W(Xt)}).catch(()=>{!fe&&!ut&&W(null),fe||vt(_("agentWorkspace.errors.loadRuntimeDetails"))}),()=>{fe=!0}},[We,se==null?void 0:se.currentVersion,se==null?void 0:se.region,se==null?void 0:se.runtimeId]),p.useEffect(()=>{const fe=Ie.current+1;if(Ie.current=fe,Fa(""),ra(""),zo(!1),qu(!1),le!=="sessionConfig"||!Qh||!(se!=null&&se.runtimeId)){Qo(!1),io(null),xo("");return}const $e=se.runtimeId,Xe=ct||$e,ut=se.region??"cn-beijing",Xt=ui,Ye=new AbortController;return Qo(!0),Promise.all([Iz({runtimeId:$e,region:ut,sessionId:y,signal:Ye.signal}),_Te({runtimeId:$e,region:ut,mpaInstanceId:Xe,signal:Ye.signal}).catch(()=>null)]).then(([kn,Dr])=>{fe===Ie.current&&(io({requestKey:Xt,value:kn}),xo(mx(kn)),$s(Dr?{requestKey:di,value:Dr}:null))}).catch(kn=>{fe!==Ie.current||Ye.signal.aborted||(kn==null?void 0:kn.name)==="AbortError"||(io(null),xo(""),Fa(kn instanceof Error?kn.message:_("agentWorkspace.errors.loadSessionConfig")))}).finally(()=>{fe===Ie.current&&!Ye.signal.aborted&&Qo(!1)}),()=>{Ye.abort()}},[y,Vo,ui,Qh,le,di,ct,se==null?void 0:se.region,se==null?void 0:se.runtimeId,_]),p.useEffect(()=>{let fe=!1;const $e=(se==null?void 0:se.runtimeId)??"";if(ye(""),le!=="versions"||!$e){Ve(!1),$e||Ce(null);return}return Ve(!0),dN($e).then(Xe=>{fe||Ce(Xe)}).catch(()=>{fe||(Ce(null),ye(_("agentWorkspace.errors.loadGithubVersions")))}).finally(()=>{fe||Ve(!1)}),()=>{fe=!0}},[le,se==null?void 0:se.currentVersion,se==null?void 0:se.runtimeId]),p.useEffect(()=>{let fe=!1;const $e=(se==null?void 0:se.runtimeId)??"",Xe=(se==null?void 0:se.region)??"cn-beijing",ut=`${Xe}:${$e}`;if(de(""),le!=="integrations"||!$e){Y(!1),$e||ce(null);return}Y(!0);const Xt=Xw($e,Xe,{retryProbe:!0}).catch(Ye=>{if(Ye instanceof Ea&&Ye.unsupported)return null;throw Ye});return Promise.all([Xt,A2e($e,Xe,{retryProbe:!0})]).then(([Ye,kn])=>{fe||ce({requestKey:ut,apiApps:Ye,a2a:kn})}).catch(()=>{fe||(ce(null),de(_("agentWorkspace.errors.probeIntegration")))}).finally(()=>{fe||Y(!1)}),()=>{fe=!0}},[ee,le,se==null?void 0:se.currentVersion,se==null?void 0:se.region,se==null?void 0:se.runtimeId]),p.useEffect(()=>{let fe=!1;const $e=(se==null?void 0:se.runtimeId)??"",Xe=(se==null?void 0:se.region)??"cn-beijing",ut=$e&&Qe?uTe({runtimeId:$e,region:Xe,appName:Qe,pageSize:100}):null;if(Be(ut?qoe(ut,_):[]),zt((ut==null?void 0:ut.sets)??[]),Ms(""),ci((ut==null?void 0:ut.unsupportedMessage)??""),le!=="evaluations"||!$e){lr(!1);return}if(x&&!Qe){lr(!yt);return}return lr(!ut),AD({runtimeId:$e,region:Xe,appName:Qe,pageSize:100},{force:!0}).then(Xt=>{fe||(zt(Xt.sets),Be(qoe(Xt,_)),ci(Xt.unsupportedMessage??""))}).catch(()=>{fe||(Ms(_("agentWorkspace.errors.loadEvaluations")),ci(""))}).finally(()=>{fe||lr(!1)}),()=>{fe=!0}},[yt,x,Ei,le,Qe,ae==null?void 0:ae.appName,se==null?void 0:se.region,se==null?void 0:se.runtimeId,_]);async function zL(fe){const $e=(se==null?void 0:se.runtimeId)??"",Xe=fe.commitSha??"";if(!(!$e||!Xe||oe)){ie(Xe),ye("");try{await c2e({runtimeId:$e,targetCommitSha:Xe,region:se==null?void 0:se.region,agentCategory:Ne});const ut=await dN($e);Ce(ut)}catch(ut){ye(ut instanceof Error?ut.message:_("agentWorkspace.errors.rollbackVersion"))}finally{ie("")}}}function Dk(fe,$e){return!(fe instanceof rw)||fe.status!==412||!fe.currentState?!1:(io({requestKey:ui,value:fe.currentState}),xo(mx(fe.currentState)),Fa($e),!0)}async function Mk(fe="replace"){if(!(se!=null&&se.runtimeId)||!er)return;const $e=se.runtimeId,Xe=se.region??"cn-beijing",ut=vo.trim(),Xt=fe==="inherit"?{category:"model",mode:fe}:ut?{category:"model",mode:fe,value:{id:ut}}:{category:"model",mode:"inherit"};zo(!0),Fa(""),ra("");try{const Ye=await B8({runtimeId:$e,region:Xe,sessionId:y,etag:er.etag,changes:[Xt]});io({requestKey:ui,value:Ye}),xo(mx(Ye)),ra(_("agentWorkspace.sessionConfigSaved"))}catch(Ye){Dk(Ye,_("agentWorkspace.sessionConfigStale"))||Fa(c6(Ye,_("agentWorkspace.sessionConfigStale")))}finally{zo(!1)}}async function l2(fe){if(!(se!=null&&se.runtimeId)||!er)return;const $e=se.runtimeId,Xe=se.region??"cn-beijing";zo(!0),Fa(""),ra("");try{const ut=await B8({runtimeId:$e,region:Xe,sessionId:y,etag:er.etag,changes:[{category:"mcpServers",mode:fe}]});io({requestKey:ui,value:ut}),ra(_("agentWorkspace.sessionConfigSaved"))}catch(ut){Dk(ut,_("agentWorkspace.sessionConfigStale"))||Fa(c6(ut,_("agentWorkspace.sessionConfigStale")))}finally{zo(!1)}}async function g0(){if(!(se!=null&&se.runtimeId)||!er||!fr)return;const fe=se.runtimeId,$e=se.region??"cn-beijing";qu(!0),Fa(""),ra("");try{const Xe=await PTe({runtimeId:fe,region:$e,sessionId:y,etag:er.etag,idempotencyKey:iXt(fe,y,fr),targetProfileRevision:fr});io({requestKey:ui,value:Xe}),xo(mx(Xe)),ra(_("agentWorkspace.sessionProfileUpgraded"))}catch(Xe){Dk(Xe,_("agentWorkspace.sessionConfigStale"))||Fa(c6(Xe,_("agentWorkspace.sessionProfileUpgradeFailed")))}finally{qu(!1)}}async function c2(){if(!(se!=null&&se.runtimeId))return;const fe=se.runtimeId,$e=se.region??"cn-beijing",Xe=ct||fe,ut=(Br==null?void 0:Br.status)==="applied"?"update":"create",Xt=(Br==null?void 0:Br.runtimeRevision)||(Br==null?void 0:Br.etag)||"",Ye=await cXt(fe,ut,s2);qc({saving:!0,error:"",notice:""});try{const kn=await Nz({operationKind:ut,runtimeId:fe,region:$e,mpaInstanceId:Xe,sourceProfileId:`studio-runtime:${fe}:${Qe||"a2a-default"}`,targetKey:ut==="update"?Xe:`runtime:${$e}:${fe}`,runtimeRevision:ut==="update"?Xt:void 0,draft:xn,idempotencyKey:Ye});qc({saving:!1,error:kn.status==="succeeded"?"":kn.safeErrorCode||_("agentWorkspace.profileApplyIncomplete"),notice:kn.status==="succeeded"?_("agentWorkspace.profileAppliedNotice",{revision:kn.profileRevision??_("agentWorkspace.notAvailable")}):""}),ot(Dr=>Dr+1),Ho(Dr=>Dr+1)}catch(kn){qc({saving:!1,error:kn instanceof Error?kn.message:_("agentWorkspace.profileApplyFailed"),notice:""})}}function VL(){!(se!=null&&se.runtimeId)||Ne!=="mpa"||I==null||I({draft:xn,runtimeId:se.runtimeId,mpaInstanceId:ct||se.runtimeId,name:Db,region:se.region??"cn-beijing",appName:Qe||"a2a-default",currentVersion:se.currentVersion??(ne==null?void 0:ne.currentVersion),runtimeRevision:(Br==null?void 0:Br.runtimeRevision)||(Br==null?void 0:Br.etag)||void 0})}p.useEffect(()=>{qc({saving:!1,error:"",notice:""})},[Kt]),p.useEffect(()=>{const fe=new Set(Qt.map($e=>$e.id));ro($e=>{const Xe=new Set([...$e].filter(ut=>fe.has(ut)));return Xe.size===$e.size?$e:Xe}),Wo($e=>{const Xe=new Set([...$e].filter(ut=>fe.has(ut)));return Xe.size===$e.size?$e:Xe}),dr&&!fe.has(dr)&&Gc("")},[Qt,dr]),p.useEffect(()=>{ko(!1),ro(new Set),Wo(new Set),Pr(""),Gc("")},[se==null?void 0:se.runtimeId]),p.useEffect(()=>{const fe=new Set(ps.filter($e=>$e.canDelete===!0).map($e=>$e.id));Qn($e=>{const Xe=new Set([...$e].filter(ut=>fe.has(ut)));return Xe.size===$e.size?$e:Xe})},[ps]),p.useEffect(()=>{const fe=new Set(zn.map($e=>$e.id));pi($e=>{const Xe=new Set([...$e].filter(ut=>fe.has(ut)));return Xe.size===$e.size?$e:Xe})},[zn]);const sa=p.useMemo(()=>!v||!(se!=null&&se.runtimeId)||v.runtimeId!==se.runtimeId||Qe&&v.agentName&&v.agentName!==Qe?null:{...v,tag:_(v.kind==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")},[v,se==null?void 0:se.runtimeId,Qe,_]),Ln=p.useMemo(()=>KGt(_),[_]),b0=p.useMemo(()=>se!=null&&se.runtimeId?sa?[sa,...Qt.filter(fe=>fe.id!==sa.id&&(!fe.messageId||fe.messageId!==sa.messageId))]:Qt:Ln,[Ln,Qt,sa,se==null?void 0:se.runtimeId]),Cm=b0.filter(fe=>{if(fe.kind!==At||(fe.source==="auto"?"auto":"user")!==Ze)return!1;const Xe=Ut.trim().toLowerCase();return Xe?[fe.input,fe.output,fe.referenceOutput,fe.comment,fe.tag??"",fe.sessionId,fe.messageId,fe.userId,fe.evaluationSetName].join(" ").toLowerCase().includes(Xe):!0}),y0=Cm.filter(fe=>ya.has(fe.id)),Lk=!!(se!=null&&se.runtimeId),HL=fe=>{Ot(fe),Mt(""),Pr("");const $e=b0.find(Xe=>Xe.kind===fe);Gc(($e==null?void 0:$e.id)??""),window.setTimeout(()=>{var Xe;(Xe=Ml.current)==null||Xe.scrollIntoView({behavior:"smooth",block:"start"})},0)},$k=fe=>{Pr(""),ro($e=>{const Xe=new Set($e);return Xe.has(fe.id)?Xe.delete(fe.id):Xe.add(fe.id),Xe})},Bd=()=>{Pr(""),ro(new Set(Cm.map(fe=>fe.id)))},u2=()=>{Pr(""),ro(new Set),ko(!1)},Fk=fe=>{Wo($e=>{const Xe=new Set($e);return Xe.has(fe)?Xe.delete(fe):Xe.add(fe),Xe})},qL=fe=>{Gc(fe.id),Pr(""),!(!fe.sessionId||!fe.messageId)&&(R==null||R(fe))},d2=async fe=>{if(!(se!=null&&se.runtimeId)||!Qe||nn||fe.length===0)return;const $e=fe.length===1?_("agentWorkspace.deleteOneCaseConfirm"):_("agentWorkspace.deleteCasesConfirm",{count:fe.length});if(!window.confirm($e))return;const Xe=fe.map(Xt=>Xt.id),ut=new Set(Xe);Oo(!0),Pr("");try{await hTe({runtimeId:se.runtimeId,region:se.region??"cn-beijing",appName:Qe,itemIds:Xe});const Xt=new Map;for(const Ye of fe)Xt.set(Ye.kind,(Xt.get(Ye.kind)??0)+1);Be(Ye=>Ye.filter(kn=>!ut.has(kn.id))),zt(Ye=>Ye.map(kn=>({...kn,itemCount:Math.max(0,kn.itemCount-(Xt.get(kn.kind)??0))}))),ro(Ye=>new Set([...Ye].filter(kn=>!ut.has(kn)))),Wo(Ye=>new Set([...Ye].filter(kn=>!ut.has(kn)))),dr&&ut.has(dr)&&Gc(""),fe.length>1&&ko(!1),C==null||C(fe)}catch(Xt){Pr(Xt instanceof Error?Xt.message:String(Xt))}finally{Oo(!1)}},Hh=fe=>{Vt($e=>$e.map(Xe=>Xe.id===fe.id?fe:Xe))},gs=()=>{const fe=new Set(e.map(ut=>ut.id)),$e=n.filter(ut=>fe.has(ut)),Xe=new Set($e);return[...$e,...e.filter(ut=>!Xe.has(ut.id)).map(ut=>ut.id)]},WL=(fe,$e,Xe)=>{if(!O||fe===$e)return;const ut=gs().filter(kn=>kn!==fe),Xt=ut.indexOf($e),Ye=Xt<0?ut.length:Xe==="after"?Xt+1:Xt;ut.splice(Ye,0,fe),O(ut)},v0=(fe,$e)=>{if(!gt||gt===$e)return;const Xe=fe.currentTarget.getBoundingClientRect();cn($e),lt(fe.clientY>Xe.top+Xe.height/2?"after":"before")},Mb=(fe,$e)=>{if(!O)return;const Xe=gs(),ut=Xe.indexOf(fe),Xt=Math.max(0,Math.min(Xe.length-1,ut+$e));ut<0||ut===Xt||(Xe.splice(ut,1),Xe.splice(Xt,0,fe),O(Xe))},Bk=fe=>{fe.canDelete===!0&&(Fn(""),Qn($e=>{const Xe=new Set($e);return Xe.has(fe.id)?Xe.delete(fe.id):Xe.add(fe.id),Xe}))},KL=fe=>{Fn(""),pi($e=>{const Xe=new Set($e);return Xe.has(fe.id)?Xe.delete(fe.id):Xe.add(fe.id),Xe})},GL=()=>{Fn(""),Qn(new Set(i2.map(fe=>fe.id))),pi(new Set(zn.map(fe=>fe.id)))},XL=()=>{Fn(""),Qn(new Set),pi(new Set),Sn(!1)},x0=()=>{if(d0===0||Nn)return;const fe=$l.length,$e=u0.length;if(fe===1&&$e===0){Qr($l[0]);return}Fn(""),nt({kind:"selection",title:_(fe===1&&$e===0?"agentWorkspace.deleteAgentTitle":fe===0&&$e===1?"myAgents.deleteDraftTitle":"agentWorkspace.deleteSelectedTitle"),description:fe===1&&$e===0?_("agentWorkspace.deleteAgentDescription",{name:$l[0].label}):fe===0&&$e===1?_("agentWorkspace.deleteDraftDescription",{name:u0[0].draft.name||_("agentSelector.unnamedAgent")}):_("agentWorkspace.deleteSelectionDescription",{count:d0,warning:fe>0?_("agentWorkspace.runtimeDeletionWarning",{count:fe}):_("agentWorkspace.draftDeletionWarning")}),confirmLabel:_(fe===0&&$e===1?"myAgents.deleteDraft":"agentWorkspace.deleteSelected"),agents:$l,drafts:u0})},w0=async()=>{if(!(!Rn||Nn)){if(Rn.kind==="agent"&&Rn.previewFailed){await Qr(Rn.agent);return}if(Rn.canConfirm!==!1){Dn(!0),Fn("");try{if(Rn.kind==="selection"){const{agents:fe,drafts:$e}=Rn;if(fe.length>0){if(!A)throw new Error(_("agentWorkspace.errors.deleteDeployedUnsupported"));await A(fe)}$e.length>0&&(E==null||E($e)),Qn(new Set),pi(new Set),Sn(!1),fe.some(Xe=>Xe.id===U)&&Z(""),$e.some(Xe=>Xe.id===z)&&J("")}else if(Rn.kind==="agent"){if(!A)throw new Error(_("agentWorkspace.errors.deleteDeployedUnsupported"));await A([Rn.agent]),U===Rn.agent.id&&Z("")}else{if(!E)throw new Error(_("agentWorkspace.errors.deleteDraftUnsupported"));E([Rn.draft]),z===Rn.draft.id&&J("")}nt(null)}catch(fe){Fn(fe instanceof Error?fe.message:String(fe))}finally{Dn(!1)}}}},Qr=async fe=>{var Xe;if(!A||fe.canDelete!==!0||Nn)return;(Xe=Kn.current)==null||Xe.abort(),Fn("");let $e=null;if(fe.agentCategory==="mpa"){const ut=new AbortController;if(Kn.current=ut,nt({kind:"agent",agent:fe,title:_("agentWorkspace.deleteAgentTitle"),description:a.jsx("p",{role:"status",children:_("agentWorkspace.mpaDeleteChecking")}),confirmLabel:_("agentWorkspace.mpaDeleteChecking"),canConfirm:!1,previewLoading:!0}),!fe.runtimeId||!fe.region){Fn(_("agentWorkspace.errors.loadMpaDeletePreview")),nt(Xt=>(Xt==null?void 0:Xt.kind)==="agent"?{...Xt,previewLoading:!1,previewFailed:!0,canConfirm:!0,confirmLabel:_("agentWorkspace.mpaDeleteRetryPreview"),description:_("agentWorkspace.errors.loadMpaDeletePreview")}:Xt);return}try{if($e=await NTe({mpaInstanceId:fe.mpaInstanceId??fe.runtimeId,runtimeId:fe.runtimeId,region:fe.region,signal:ut.signal}),ut.signal.aborted||Kn.current!==ut)return}catch(Xt){if(ut.signal.aborted||Kn.current!==ut)return;Fn(Xt instanceof Error?Xt.message:String(Xt)),nt(Ye=>(Ye==null?void 0:Ye.kind)==="agent"?{...Ye,previewLoading:!1,previewFailed:!0,canConfirm:!0,confirmLabel:_("agentWorkspace.mpaDeleteRetryPreview"),description:_("agentWorkspace.mpaDeletePreviewFailed")}:Ye);return}}nt({kind:"agent",title:_("agentWorkspace.deleteAgentTitle"),description:$e?a.jsx(tXt,{preview:$e,t:_}):_("agentWorkspace.deleteAgentDescription",{name:fe.label}),confirmLabel:_("agentWorkspace.deleteAgent"),canConfirm:$e?$e.canDelete:!0,agent:fe})},Am=fe=>{if(!E||Nn)return;const $e=fe.draft.name||_("agentSelector.unnamedAgent");Fn(""),nt({kind:"draft",title:_("myAgents.deleteDraftTitle"),description:_("agentWorkspace.deleteDraftDescription",{name:$e}),confirmLabel:_("myAgents.deleteDraft"),draft:fe})},bi=()=>{const fe=`eval-${Date.now()}`,$e={id:fe,name:_("agentWorkspace.newEvaluationGroupName",{count:dt.length+1}),agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量"],concurrency:"4",history:[]};Vt(Xe=>[$e,...Xe]),mn(fe)},YL=fe=>{Hh({...fe,history:[{id:`run-${Date.now()}`,createdAt:_("agentWorkspace.evaluationDefaults.justNow"),score:86+fe.history.length%7,status:"completed"},...fe.history]})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`aw-root${x?" is-detail-only":""}`,children:[a.jsxs("nav",{className:"aw-view-tabs","aria-label":_("agentWorkspace.workspace"),children:[a.jsx("button",{type:"button",className:F==="library"?"is-active":"","aria-pressed":F==="library",onClick:()=>{M("library"),tt("")},children:_("agentWorkspace.library")}),a.jsx("button",{type:"button",className:F==="evaluation"?"is-active":"","aria-pressed":F==="evaluation",onClick:()=>{M("evaluation"),tt("")},children:_("agentWorkspace.evaluation")})]}),a.jsxs("div",{className:"aw-workspace-frame",children:[a.jsxs("div",{className:"aw-workspace","aria-hidden":F==="evaluation"||void 0,ref:fe=>{fe==null||fe.toggleAttribute("inert",F==="evaluation")},children:[a.jsxs("aside",{className:"aw-sidebar","aria-label":_(F==="library"?"agentWorkspace.agentList":"agentWorkspace.evaluationGroupList"),children:[a.jsxs("label",{className:"aw-search",children:[a.jsx(dI,{"aria-hidden":!0}),a.jsx("input",{value:it,onChange:fe=>tt(fe.currentTarget.value),placeholder:_(F==="library"?"myAgents.searchAgents":"agentWorkspace.searchEvaluationGroups"),"aria-label":_(F==="library"?"myAgents.searchAgents":"agentWorkspace.searchEvaluationGroups")})]}),a.jsxs("button",{type:"button",className:"aw-create-card",onClick:F==="library"?N:bi,disabled:F==="library"&&!o,children:[a.jsx(ec,{"aria-hidden":!0}),a.jsx("span",{children:_(F==="library"?"agentWorkspace.newAgent":"agentWorkspace.newEvaluationGroup")})]}),F==="library"&&(A||E)&&a.jsx("div",{className:`aw-selection-toolbar${hn?" is-active":""}`,children:hn?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"aw-selection-count",children:_("agentWorkspace.selectedCount",{count:d0})}),a.jsx("button",{type:"button",onClick:GL,disabled:Sm===0||Nn,children:_("agentWorkspace.selectAll")}),a.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void x0(),disabled:d0===0||Nn,children:_(Nn?"common.deleting":"agentWorkspace.deleteSelected")}),a.jsx("button",{type:"button",onClick:XL,disabled:Nn,children:_("common.cancel")})]}):a.jsx("button",{type:"button",onClick:()=>{Fn(""),Sn(!0)},disabled:Sm===0,children:_("common.select")})}),F==="library"&&_i&&a.jsx("div",{className:"aw-delete-error",role:"alert",children:_i}),a.jsx("div",{className:"aw-agent-list",children:F==="evaluation"?hs.length===0?a.jsx("div",{className:"aw-list-empty",children:_("agentWorkspace.noMatchingEvaluationGroups")}):hs.map(fe=>a.jsxs("button",{type:"button",className:`aw-agent-item${fe.id===Mn?" is-active":""}`,onClick:()=>mn(fe.id),children:[a.jsxs("span",{className:"aw-agent-copy aw-eval-group-copy",children:[a.jsx("strong",{children:TS(fe.name,_)}),a.jsx("small",{children:_("agentWorkspace.groupStats",{agents:fe.agentIds.length,runs:fe.history.length})})]}),a.jsx(sE,{"aria-hidden":!0})]},fe.id)):u&&ps.length===0&&zn.length===0?a.jsx("div",{className:"aw-list-empty",children:_("agentWorkspace.loadingCloudAgents")}):d&&ps.length===0&&zn.length===0?a.jsxs("div",{className:"aw-list-empty aw-list-error",children:[a.jsx("span",{children:d}),S&&a.jsx("button",{type:"button",onClick:S,children:_("common.retry")})]}):ps.length===0&&zn.length===0?a.jsx("div",{className:"aw-list-empty",children:_("myAgents.noMatchingAgents")}):a.jsxs(a.Fragment,{children:[zn.map(fe=>{const Xe=f.filter(Xt=>Xt.draftId===fe.id).sort((Xt,Ye)=>Ye.startedAt-Xt.startedAt)[0]??f.filter(Xt=>{var Ye,kn;return((Ye=Xt.agentDraft)==null?void 0:Ye.name)===fe.draft.name||Xt.agentName===fe.draft.name||!!((kn=fe.deploymentTarget)!=null&&kn.runtimeId)&&Xt.runtimeId===fe.deploymentTarget.runtimeId}).sort((Xt,Ye)=>Ye.startedAt-Xt.startedAt)[0],ut=_n.has(fe.id);return a.jsxs("button",{type:"button",className:["aw-agent-item",hn?"is-selecting":"",ut?"is-selected-for-delete":"",fe.id===z?"is-active":""].filter(Boolean).join(" "),"aria-pressed":hn?ut:void 0,onClick:()=>{if(hn){KL(fe);return}Z(""),J(fe.id),q("basic")},children:[hn&&a.jsx("span",{className:`aw-select-marker${ut?" is-checked":""}`,"aria-hidden":"true"}),a.jsxs("span",{className:"aw-agent-copy",children:[a.jsxs("span",{className:"aw-agent-name-row",children:[a.jsx("strong",{children:fe.draft.name||_("agentSelector.unnamedAgent")}),a.jsx("span",{className:`aw-draft-badge${(Xe==null?void 0:Xe.status)==="running"?" is-deploying":""}`,children:(Xe==null?void 0:Xe.status)==="running"?_("myAgents.deploying"):_("myAgents.draft")})]}),a.jsx("small",{children:fe.deploymentTarget?_("agentWorkspace.updatePending"):_("agentWorkspace.notPublished")})]}),a.jsx(sE,{"aria-hidden":!0})]},fe.id)}),ps.map(fe=>{const $e=fe.runtimeId?It.get(fe.runtimeId):void 0,Xe=fe.runtimeId?On.get(fe.runtimeId):void 0,ut=Ji.has(fe.id),Xt=fe.canDelete===!0,Ye=($e==null?void 0:$e.status)==="running"?{label:_("myAgents.deploying"),className:" is-deploying"}:($e==null?void 0:$e.status)==="error"?{label:_("agentWorkspace.failed"),className:" is-error"}:($e==null?void 0:$e.status)==="cancelled"?{label:_("agentWorkspace.cancelled"),className:" is-muted"}:Xe?{label:_("agentWorkspace.updatePending"),className:""}:null,kn=($e==null?void 0:$e.status)==="running"?_("agentWorkspace.updatingDeployment"):Xe?_("agentWorkspace.updatePending"):fe.remote?fe.host||_("agentWorkspace.remoteAgent"):_("agentWorkspace.localAgent"),Dr=["aw-agent-item","aw-agent-item--sortable",fe.id===U?"is-active":"",hn?"is-selecting":"",ut?"is-selected-for-delete":"",hn&&!Xt?"is-selection-disabled":"",fe.id===gt?"is-dragging":"",fe.id===Bt&&fe.id!==gt?`is-drop-target is-drop-${Je}`:""].filter(Boolean).join(" ");return a.jsxs("button",{type:"button",draggable:!!O&&!hn,className:Dr,"aria-pressed":hn?ut:void 0,"aria-keyshortcuts":O?"Alt+ArrowUp Alt+ArrowDown":void 0,onDragStart:yi=>{O&&(bl.current=!0,an(fe.id),yi.dataTransfer.effectAllowed="move",yi.dataTransfer.setData("text/plain",fe.id))},onDragEnter:yi=>{v0(yi,fe.id)},onDragOver:yi=>{!gt||gt===fe.id||(yi.preventDefault(),yi.dataTransfer.dropEffect="move",v0(yi,fe.id))},onDragLeave:yi=>{const bs=yi.relatedTarget;bs instanceof Node&&yi.currentTarget.contains(bs)||Bt===fe.id&&cn("")},onDrop:yi=>{yi.preventDefault();const bs=yi.dataTransfer.getData("text/plain")||gt;WL(bs,fe.id,Je),an(""),cn(""),lt("before")},onDragEnd:()=>{an(""),cn(""),lt("before"),window.setTimeout(()=>{bl.current=!1},0)},onKeyDown:yi=>{yi.altKey&&(yi.key==="ArrowUp"?(yi.preventDefault(),Mb(fe.id,-1)):yi.key==="ArrowDown"&&(yi.preventDefault(),Mb(fe.id,1)))},onClick:yi=>{if(hn){yi.preventDefault(),Bk(fe);return}if(bl.current){yi.preventDefault(),bl.current=!1;return}J(""),Z(fe.id),q("basic"),j(fe.id)},children:[hn&&a.jsx("span",{className:`aw-select-marker${ut?" is-checked":""}`,"aria-hidden":"true"}),a.jsxs("span",{className:"aw-agent-copy",children:[a.jsxs("span",{className:"aw-agent-name-row",children:[a.jsx("strong",{children:fe.label}),fe.currentVersion!=null&&a.jsxs("span",{className:"aw-version-badge",children:["v",fe.currentVersion]}),Ye&&a.jsx("span",{className:`aw-draft-badge${Ye.className}`,children:Ye.label})]}),a.jsx("small",{children:kn})]}),a.jsx(sE,{"aria-hidden":!0})]},fe.id)})]})}),a.jsx("div",{className:"aw-list-count",children:_("agentWorkspace.totalCount",{count:F==="library"?e.length+Gn:dt.length})})]}),F==="evaluation"&&c0?a.jsx(IXt,{group:c0,agents:e,cases:b0,onChange:Hh,onRun:YL}):F==="evaluation"?a.jsx("main",{className:"aw-main aw-empty-selection",children:a.jsx("p",{children:_("agentWorkspace.noEvaluationGroupSelected")})}):!se&&!Vn&&!gi?a.jsx("main",{className:"aw-main aw-empty-selection",children:a.jsx("p",{children:_("agentWorkspace.noAgentSelected")})}):a.jsxs("main",{className:`aw-main${Vh?" is-deploying":""}${x?" resource-page":""}`,children:[se&&!ae&&s&&a.jsx("div",{className:"aw-detail-loading",role:"status","aria-live":"polite",children:a.jsxs("div",{className:"aw-detail-loading-card",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsxs("span",{children:[a.jsx("strong",{children:_("agentWorkspace.loadingAgent")}),a.jsx("small",{children:_("agentWorkspace.loadingAgentDescription")})]})]})}),le==="integrations"&&V&&a.jsx("div",{className:"aw-detail-loading",role:"status","aria-live":"polite",children:a.jsxs("div",{className:"aw-detail-loading-card",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsxs("span",{children:[a.jsx("strong",{children:_("agentWorkspace.probingIntegration")}),a.jsx("small",{children:_("agentWorkspace.probingIntegrationDescription")})]})]})}),a.jsx(dT,{className:"aw-agent-detail",title:Db,description:xn.description||_(s||x&&!yt?"agentWorkspace.loadingAgentInfo":"common.noDescription"),identitySeed:Db,backLabel:_("agentWorkspace.backToAgentList"),onBack:x?k:void 0,meta:a.jsxs(a.Fragment,{children:[vl!=null&&a.jsxs("span",{className:"aw-agent-meta",children:["v",vl]}),Vn&&a.jsx("span",{className:"aw-agent-meta",children:_("myAgents.draft")}),So&&a.jsx("span",{className:"aw-agent-meta",children:_("agentWorkspace.updatePending")}),!se&&!Vn&&gi&&a.jsx("span",{className:"aw-agent-meta",children:gi.label})]}),actionsClassName:"aw-head-actions",bodyClassName:"aw-agent-detail__body",actions:Vn||So||se!=null&&se.canDelete?a.jsxs(a.Fragment,{children:[(Vn||So)&&a.jsxs(Tt,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>{const fe=Vn??So;fe&&Am(fe)},disabled:Nn,"aria-label":_("myAgents.deleteDraft"),title:_("myAgents.deleteDraft"),children:[a.jsx(Yg,{"aria-hidden":!0}),a.jsx("span",{children:_("myAgents.deleteDraft")})]}),(se==null?void 0:se.canDelete)&&a.jsxs(Tt,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>void Qr(se),disabled:Nn,"aria-label":_("agentWorkspace.deleteAgent"),title:_("agentWorkspace.deleteAgent"),children:[a.jsx(Yg,{"aria-hidden":!0}),a.jsx("span",{children:_(Nn?"common.deleting":"agentWorkspace.deleteAgent")})]})]}):void 0,sections:An.map(fe=>{var $e,Xe,ut,Xt;return{key:fe.id,label:fe.label,disabled:Vh,content:fe.id===le?a.jsxs(a.Fragment,{children:[Ur&&Df&&a.jsx("div",{className:`aw-detail-deployment${Vh?" is-running":""}`,children:a.jsx(TXt,{task:Ur,onReturnToEdit:eu&&D?()=>D(eu):void 0})}),a.jsxs("div",{className:"aw-content",children:[le==="basic"&&a.jsxs("div",{className:"aw-basic-stack",children:[fn&&a.jsx(vh,{className:"aw-detail-fetch-alert",color:"warning",variant:"soft",title:_("agentWorkspace.partialInfoUnavailable"),description:_("agentWorkspace.upgradeRuntimeForDetails")}),(kt&&!fn||qe)&&a.jsx(vh,{className:"aw-detail-fetch-alert",color:"danger",variant:"soft",title:_("agentWorkspace.detailLoadFailed"),description:_("agentWorkspace.detailLoadFailedDescription"),actions:a.jsx(Tt,{type:"button",color:"danger",variant:"soft",size:"sm",pill:!1,onClick:()=>ot(Ye=>Ye+1),children:_("common.retry")})}),Ne==="mpa"&&(qs||Li||xr)&&a.jsx(vh,{className:"aw-detail-fetch-alert",color:xr==="bound"&&!Li?"success":"warning",variant:"soft",title:_("agentWorkspace.mpaControlPlane"),description:qs?_("agentWorkspace.loadingMpaAgentView"):Li||If||_(xr==="bound"?"agentWorkspace.mpaRuntimeBound":xr==="binding_ambiguous"?"agentWorkspace.mpaRuntimeBindingAmbiguous":xr==="orphan_runtime"?"agentWorkspace.mpaRuntimeOrphan":"agentWorkspace.mpaRuntimeMissing")}),se&&Ne!=="mpa"&&Ri&&!Ri.canUpdate&&a.jsxs("div",{className:"aw-update-recovery-notice",role:Ri.recoveryStatus==="preparing"?"status":"alert",children:[a.jsx("strong",{children:Ri.recoveryStatus==="preparing"?_("agentWorkspace.restoringUpdateConfig"):_("agentWorkspace.updateConfigUnavailable")}),yl&&a.jsx("span",{children:yl}),Wi.map(Ye=>a.jsx("span",{children:Ye},Ye))]}),a.jsxs("section",{className:"aw-deployment-panel aw-settings-card",children:[a.jsx("div",{className:"aw-section-head",children:a.jsxs("div",{children:[a.jsx("h3",{children:_("agentWorkspace.deploymentConfig")}),a.jsx("p",{children:_("agentWorkspace.deploymentConfigDescription")})]})}),a.jsxs("dl",{className:"aw-readonly-config",children:[a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.runtimeStatus")}),a.jsxs("dd",{className:(ne==null?void 0:ne.status.toLowerCase())==="ready"?"is-ready":void 0,children:[(ne==null?void 0:ne.status.toLowerCase())==="ready"&&a.jsx("span",{className:"aw-status-dot"}),(ne==null?void 0:ne.status)||_("agentWorkspace.loading")]})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.deploymentRegion")}),a.jsx("dd",{children:(ne==null?void 0:ne.region)||(se==null?void 0:se.region)||(Ur==null?void 0:Ur.region)||_("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.networkAccess")}),a.jsx("dd",{children:ne!=null&&ne.networkTypes.length?ne.networkTypes.join(" / "):_("agentWorkspace.notAvailable")})]})]})]}),a.jsxs("section",{className:"aw-canvas-card",children:[a.jsx("div",{className:"aw-card-head",children:a.jsx("strong",{children:_("agentWorkspace.executionFlow")})}),a.jsx("div",{className:"aw-canvas",children:a.jsx(RP,{draft:xn,direction:"horizontal",selectedPath:[],onSelect:()=>{},onAdd:()=>{},onInsert:()=>{},onDelete:()=>{},readOnly:!0,interactivePreview:!0},Eo)})]}),a.jsxs("section",{className:"aw-details-card",children:[a.jsx("div",{className:"aw-card-head",children:a.jsx("strong",{children:_("agentWorkspace.details")})}),a.jsxs("dl",{className:"aw-facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:_("agentSelector.model")}),a.jsx("dd",{children:fH(ae==null?void 0:ae.model)||xn.modelName||_("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.agentCountLabel")}),a.jsx("dd",{children:ae!=null&&ae.graph?l9e(ae.graph):c9e(xn)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentSelector.tools")}),a.jsx("dd",{className:"aw-fact-badges",children:h0.length?h0.map(Ye=>a.jsx("span",{children:Ye},Ye)):_("agentWorkspace.none")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentSelector.skills")}),a.jsx("dd",{className:"aw-fact-badges",children:Ik===null?_("agentSelector.previewUnsupported"):Ik.length?Ik.map(Ye=>a.jsx("span",{children:Ye},Ye)):_("agentWorkspace.none")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("systemInfo.currentVersion")}),a.jsx("dd",{children:vl!=null?`v${vl}`:_("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentSelector.status")}),a.jsx("dd",{children:Vn?_("myAgents.draft"):(Ur==null?void 0:Ur.status)==="error"?_("agentWorkspace.deploymentFailed"):(Ur==null?void 0:Ur.status)==="cancelled"?_("agentWorkspace.cancelled"):So?_("agentWorkspace.updatePending"):a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"aw-status-dot"}),_("skillCenter.status.available")]})})]})]})]}),a.jsxs("section",{className:"aw-sidecar-panel aw-settings-card","aria-label":_("agentWorkspace.selectedOptimizations"),children:[a.jsx("div",{className:"aw-section-head",children:a.jsxs("div",{children:[a.jsx("h3",{children:_("agentWorkspace.selectedOptimizations")}),a.jsx("p",{children:_("agentWorkspace.selectedOptimizationsDescription")})]})}),a.jsxs("dl",{className:"aw-readonly-config",children:[a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.configurationStatus")}),a.jsx("dd",{className:Ku!=null&&Ku.enabled?"is-ready":void 0,children:Ku?Ku.enabled?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"aw-status-dot"}),_("skillCenter.status.enabled")]}):_("skillCenter.status.inactive"):_("agentWorkspace.notRecorded")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.optimizationProfile")}),a.jsx("dd",{children:Ku?umt(Ku.profile):_("agentWorkspace.legacyConfigMissing")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.selectedOptimizations")}),a.jsx("dd",{className:"aw-fact-badges",children:Ku?r2.length?r2.map(Ye=>a.jsx("span",{children:SN(Ye)},Ye)):_("agentWorkspace.noneSelected"):_("agentWorkspace.legacyConfigMissing")})]})]})]})]}),le==="usage"&&(se==null?void 0:se.runtimeId)&&a.jsxs("section",{className:"aw-usage","aria-busy":ml,children:[a.jsx("div",{className:"aw-usage-intro",children:a.jsx("h3",{children:_("agentWorkspace.usageOverview")})}),ml&&!Bi&&a.jsx("div",{className:"aw-usage-state",role:"status","aria-live":"polite",children:a.jsx(on,{as:"span",children:_("agentWorkspace.loadingUsage")})}),mi&&a.jsxs("div",{className:"aw-usage-state is-error",role:"alert",children:[a.jsx("span",{children:mi}),a.jsx("button",{type:"button",onClick:()=>dc(Ye=>Ye+1),children:_("common.retry")})]}),!ml&&!mi&&!Bi&&!Qe&&a.jsx("div",{className:"aw-usage-state",children:_("agentWorkspace.usageUnavailable")}),Bi&&a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"aw-usage-summary","aria-label":_("agentWorkspace.usageSummary"),children:[a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.totalCalls")}),a.jsx("dd",{children:Bi.totalInvocations.toLocaleString(L.resolvedLanguage??L.language)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.userCount")}),a.jsx("dd",{children:Bi.totalUsers.toLocaleString(L.resolvedLanguage??L.language)})]})]}),a.jsxs("div",{className:"aw-usage-users-head",children:[a.jsx("h3",{children:_("agentWorkspace.userDetails")}),ml&&a.jsx(on,{as:"span",role:"status","aria-live":"polite",children:_("agentWorkspace.refreshing")})]}),Bi.users.length===0?a.jsx("div",{className:"aw-usage-state",children:_("agentWorkspace.noUsage")}):a.jsx("div",{className:"aw-usage-table-wrap",children:a.jsxs("table",{className:"aw-usage-table",children:[a.jsx("caption",{children:_("agentWorkspace.usageUserList")}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:_("agentWorkspace.user")}),a.jsx("th",{scope:"col",children:_("agentWorkspace.callCount")}),a.jsx("th",{scope:"col",children:_("agentWorkspace.lastUsed")})]})}),a.jsx("tbody",{children:Bi.users.map(Ye=>a.jsxs("tr",{children:[a.jsxs("td",{children:[a.jsx("strong",{children:Ye.displayName||Ye.userId||_("agentWorkspace.unknownUser")}),Ye.displayName&&Ye.userId&&a.jsx("small",{title:Ye.userId,children:Ye.userId})]}),a.jsx("td",{children:Ye.invocationCount.toLocaleString(L.resolvedLanguage??L.language)}),a.jsx("td",{children:a.jsx("time",{dateTime:Ye.lastUsedAt,children:r9e(Ye.lastUsedAt,L.resolvedLanguage??L.language,_)})})]},Ye.userId))})]})}),Bi.totalPages>1&&a.jsxs("nav",{className:"aw-usage-pagination","aria-label":_("agentWorkspace.usagePagination"),children:[a.jsx("button",{type:"button",disabled:ml||Bi.page<=1,onClick:()=>Hs(Ye=>Math.max(1,Ye-1)),children:_("common.previousPage")}),a.jsx("span",{"aria-live":"polite",children:_("agentWorkspace.pageOf",{page:Bi.page,total:Bi.totalPages})}),a.jsx("button",{type:"button",disabled:ml||Bi.page>=Bi.totalPages,onClick:()=>Hs(Ye=>Ye+1),children:_("common.nextPage")})]})]})]}),le==="sessionConfig"&&a.jsx(dXt,{config:er,profileStatus:Br,loadable:Qh,disabledReason:a2,loading:wo,saving:$d,upgrading:Hc,error:Rf,notice:Uh,modelValue:vo,modelDirty:Yc,profileUpgradeAvailable:zh,onModelChange:xo,onSaveModel:()=>void Mk(),onInheritModel:()=>void Mk("inherit"),onClearMcp:()=>void l2("clear"),onInheritMcp:()=>void l2("inherit"),onUpgradeProfile:()=>void g0(),onRefresh:()=>Ho(Ye=>Ye+1)}),le==="profileConfig"&&a.jsx(uXt,{profile:s2,profileStatus:Br,runtimeReady:Ib,disabledReason:f0,saving:qo.saving,error:qo.error,notice:qo.notice,onApply:()=>void c2(),onEditProfile:VL,onRefresh:()=>ot(Ye=>Ye+1)}),le==="diagnostics"&&a.jsx(pXt,{data:o0,loadable:!Em,disabledReason:Em,loading:ia,error:Ir,onRefresh:()=>Bh(Ye=>Ye+1),locale:L.resolvedLanguage??L.language}),le==="versions"&&a.jsxs("section",{className:"aw-version-stack",children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:_("agentWorkspace.githubVersions")}),a.jsx("p",{children:($e=be==null?void 0:be.cicd)!=null&&$e.enabled?_("agentWorkspace.githubVersionsDescription"):_("agentWorkspace.currentVersionOnly")})]}),Ee&&a.jsx("div",{className:"aw-case-empty",children:_("agentWorkspace.loadingVersions")}),Ge&&a.jsxs("div",{className:"aw-integration-error",role:"alert",children:[a.jsx("span",{children:Ge}),(se==null?void 0:se.runtimeId)&&a.jsx("button",{type:"button",onClick:()=>void dN(se.runtimeId??"").then(Ce),children:_("common.retry")})]}),!Ee&&!Ge&&a.jsxs("div",{className:"aw-version-list",children:[(be==null?void 0:be.githubSyncError)&&a.jsx("div",{className:"aw-integration-error",role:"alert",children:a.jsx("span",{children:be.githubSyncError})}),(be==null?void 0:be.latestSourceRuntimeStatus)&&be.latestSourceRuntimeStatus!=="published"&&((Xe=be.versions[0])==null?void 0:Xe.commitSha)&&be.versions[0].commitSha!==be.currentCommitSha&&a.jsx("div",{className:"aw-integration-notice",role:"status",children:a.jsxs("span",{children:[_("agentWorkspace.sourceMergedRuntimeStill"),Qoe(be.latestSourceRuntimeStatus,_),_("agentWorkspace.currentProductionVersionHint")]})}),be!=null&&be.versions.length?be.versions.map(Ye=>{var Qa;const kn=Ye.commitSha??"",Dr=Ye.runtimeStatus??Ye.status,yi=Ye.changeType==="rollback",bs=!!((Qa=be.cicd)!=null&&Qa.enabled)&&!!kn&&!yi&&kn!==be.currentCommitSha;return a.jsxs("article",{className:"aw-version-row",children:[a.jsxs("div",{children:[a.jsx("strong",{children:sXt(Ye,_)}),a.jsx("small",{children:Ye.createdAt||_("agentWorkspace.noTime")})]}),a.jsxs("div",{children:[a.jsx("span",{children:_("agentWorkspace.prLink")}),Ye.pullRequestUrl?a.jsx("a",{href:Ye.pullRequestUrl,target:"_blank",rel:"noopener noreferrer",children:_("agentWorkspace.viewPr")}):a.jsx("em",{children:_("agentWorkspace.noPr")})]}),a.jsxs("div",{children:[a.jsx("span",{children:_("agentWorkspace.author")}),a.jsx("em",{children:Ye.author||"Studio"})]}),a.jsxs("div",{children:[a.jsx("span",{children:_("agentWorkspace.publishStatus")}),a.jsx("em",{children:Qoe(Dr,_)})]}),a.jsxs("div",{className:"aw-version-actions",children:[a.jsx("button",{type:"button",disabled:!bs||oe===kn,onClick:()=>void zL(Ye),children:_(oe===kn?"agentWorkspace.rollingBack":"agentWorkspace.rollbackToVersion")}),Ye.workflowRunUrl&&a.jsx("a",{href:Ye.workflowRunUrl,target:"_blank",rel:"noopener noreferrer",children:_("agentWorkspace.viewRelease")})]})]},`${Ye.version}-${kn||Ye.createdAt}`)}):a.jsxs("article",{className:"aw-version-row",children:[a.jsxs("div",{children:[a.jsx("strong",{children:vl!=null?`v${vl}`:_("agentWorkspace.noVersion")}),a.jsx("small",{children:(ne==null?void 0:ne.updatedAt)||_("agentWorkspace.noTime")})]}),a.jsx("p",{children:_("agentWorkspace.currentVersionOnly")})]})]})]}),le==="integrations"&&a.jsxs("div",{className:"aw-integration-stack",children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:_("agentWorkspace.integrationMethods")}),a.jsx("p",{children:_("agentWorkspace.integrationDescription")})]}),K&&a.jsxs("div",{className:"aw-integration-error",role:"alert",children:[a.jsx("span",{children:K}),a.jsx("button",{type:"button",onClick:()=>Oe(Ye=>Ye+1),children:_("common.retry")})]}),!K&&a.jsxs("div",{className:"aw-integration-body",children:[a.jsxs("div",{className:`aw-integration-protocol-tabs${he==="a2a"?" is-a2a":""}`,role:"tablist","aria-label":_("agentWorkspace.integrationProtocol"),children:[a.jsx("span",{className:"aw-integration-protocol-slider","aria-hidden":"true"}),LO.map((Ye,kn)=>a.jsx("button",{type:"button",id:`integration-${Ye.id}-tab`,role:"tab","aria-selected":he===Ye.id,"aria-controls":`integration-${Ye.id}-panel`,tabIndex:he===Ye.id?0:-1,onClick:()=>Pk(Ye.id),onKeyDown:Dr=>{var Qa;if(!["ArrowLeft","ArrowRight","Home","End"].includes(Dr.key))return;Dr.preventDefault();const yi=Dr.key==="Home"?0:Dr.key==="End"?LO.length-1:(kn+(Dr.key==="ArrowRight"?1:-1)+LO.length)%LO.length,bs=LO[yi];Pk(bs.id),(Qa=document.getElementById(`integration-${bs.id}-tab`))==null||Qa.focus()},children:Ye.label},Ye.id))]}),he==="api-server"?a.jsx(Voe,{protocol:"api-server",title:"API Server",available:Zc,fields:[{label:"Agent",value:Zc?((ut=Xn==null?void 0:Xn.apiApps)==null?void 0:ut.join("、"))??"":""},{label:_("agentWorkspace.discoveryEndpoint"),value:Zc?u6(Ll,"/list-apps"):""},{label:_("agentWorkspace.invocationEndpoint"),value:Zc?u6(Ll,"/run_sse"):""},{label:_("agentWorkspace.authentication"),value:Zc?Uoe(ne==null?void 0:ne.authType,_):""},{label:"API Key",value:a.jsx(zoe,{available:Zc,authType:ne==null?void 0:ne.authType,value:$i,visible:Pe&&!!$i,loading:Ke,error:re,onToggle:()=>void m0()})}],example:Zc?aXt(Ll,Pb,ne==null?void 0:ne.authType):""}):a.jsx(Voe,{protocol:"a2a",title:"A2A",available:xa,fields:[{label:"Agent",value:((Xt=Xn==null?void 0:Xn.a2a)==null?void 0:Xt.name)??""},{label:"Agent Card",value:xa?u6(Ll,"/.well-known/agent-card.json"):""},{label:_("agentWorkspace.invocationUrl"),value:Pf},{label:_("agentWorkspace.authentication"),value:xa?Uoe(ne==null?void 0:ne.authType,_):""},{label:"API Key",value:a.jsx(zoe,{available:xa,authType:ne==null?void 0:ne.authType,value:$i,visible:Pe&&!!$i,loading:Ke,error:re,onToggle:()=>void m0()})}],example:xa?oXt(Pf,ne==null?void 0:ne.authType):""})]})]}),le==="evaluations"&&a.jsxs("section",{className:"aw-cases",children:[(se==null?void 0:se.runtimeId)&&a.jsx("div",{className:"aw-case-summary",children:["good","bad"].map(Ye=>{const kn=wXt(xt,Ye),Dr=b0.filter(bs=>bs.kind===Ye).length,yi=sa?Dr:(kn==null?void 0:kn.itemCount)??Dr;return a.jsxs("button",{type:"button",onClick:()=>HL(Ye),children:[a.jsx("strong",{children:yi}),a.jsx("span",{children:_(Ye==="good"?"agentWorkspace.goodCases":"agentWorkspace.badCases")})]},Ye)})}),a.jsxs("div",{className:"aw-case-filter-bar",children:[a.jsxs("div",{className:"aw-case-filter-stack",children:[a.jsx("div",{className:"aw-case-filters","aria-label":_("agentWorkspace.caseResultFilter"),children:["good","bad"].map(Ye=>a.jsx("button",{type:"button",className:At===Ye?"is-active":"","aria-pressed":At===Ye,onClick:()=>Ot(Ye),children:_(Ye==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")},Ye))}),a.jsx("div",{className:"aw-case-source-filters","aria-label":_("agentWorkspace.feedbackSourceFilter"),children:["auto","user"].map(Ye=>a.jsx("button",{type:"button",className:Ze===Ye?"is-active":"","aria-pressed":Ze===Ye,onClick:()=>bt(Ye),children:_(Ye==="auto"?"agentWorkspace.automaticFeedback":"agentWorkspace.manualFeedback")},Ye))})]}),a.jsxs("label",{className:"aw-case-search",children:[a.jsx(dI,{"aria-hidden":!0}),a.jsx("input",{type:"search",value:Ut,onChange:Ye=>Mt(Ye.currentTarget.value),placeholder:_("agentWorkspace.searchCasesPlaceholder"),"aria-label":_("agentWorkspace.searchCases")})]})]}),Lk&&a.jsx("div",{className:`aw-case-toolbar${Wc?" is-active":""}`,children:Wc?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"aw-selection-count",children:_("agentWorkspace.selectedCaseCount",{count:y0.length})}),a.jsx("button",{type:"button",onClick:Bd,disabled:Cm.length===0||nn,children:_("agentWorkspace.selectAllVisible")}),a.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void d2(y0),disabled:y0.length===0||nn,children:_(nn?"common.deleting":"agentWorkspace.deleteSelected")}),a.jsx("button",{type:"button",onClick:u2,disabled:nn,children:_("common.cancel")})]}):a.jsx("button",{type:"button",onClick:()=>{Pr(""),ko(!0)},disabled:Cm.length===0||nn,children:_("agentWorkspace.selectCases")})}),Kc&&a.jsx("div",{className:"aw-delete-error",role:"alert",children:Kc}),a.jsx("div",{ref:Ml,children:a.jsx(RXt,{cases:Cm,loading:jn&&Cm.length===0,error:ta,notice:ts,runtimeBacked:!!(se!=null&&se.runtimeId),selectionMode:Wc,selectedCaseIds:ya,focusedCaseId:dr,expandedCaseIds:Wu,deleting:nn,canDelete:Lk,onOpenCase:qL,onToggleCase:$k,onToggleExpanded:Fk,onDeleteCase:Ye=>void d2([Ye]),onRetry:()=>$r(Ye=>Ye+1)})})]}),le==="optimizations"&&a.jsxs("section",{className:"aw-optimizations",children:[a.jsxs("div",{className:"aw-optimization-intro",children:[a.jsx("h3",{children:_("agentWorkspace.optimizations")}),a.jsx("p",{children:_("agentWorkspace.optimizationsDescription")})]}),Il?a.jsxs("div",{className:"aw-optimization-state",role:"status",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsx("span",{children:_("agentWorkspace.loadingOptimizations")})]}):me?a.jsxs("div",{className:"aw-optimization-state is-error",role:"alert",children:[a.jsx("span",{children:me}),a.jsx("button",{type:"button",onClick:()=>bo(Ye=>Ye+1),children:_("common.retry")})]}):na.length>0?a.jsx(jXt,{groups:na}):a.jsx("div",{className:"aw-optimization-state",children:_("agentWorkspace.noOptimizations")})]})]}),le==="basic"&&(se||Vn)&&a.jsxs("div",{className:"aw-basic-actions",children:[se&&a.jsxs("button",{type:"button",className:"aw-talk studio-update-action",onClick:()=>T==null?void 0:T(se),children:[a.jsx(Wat,{"aria-hidden":!0}),a.jsx("span",{children:_("agentWorkspace.chat")})]}),Ne!=="mpa"&&a.jsxs("span",{className:`aw-update-wrap${Fd?" is-disabled":""}`,tabIndex:Fd?0:void 0,"aria-describedby":Fd?Rk:void 0,children:[a.jsx("button",{type:"button",className:"aw-update studio-update-action",disabled:!!Fd,"aria-busy":St||void 0,"aria-describedby":Fd?Rk:void 0,onClick:()=>{if(Vn){D==null||D(Vn);return}Ri&&P(Ri)},children:St?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"loading-gap-spinner aw-update-spinner","aria-hidden":"true"}),a.jsx("span",{children:_("agentWorkspace.preparing")})]}):_(Vn||So?"agentWorkspace.continueEditing":"agentWorkspace.update")}),Fd&&a.jsx("span",{id:Rk,className:"aw-update-disabled-reason",role:"tooltip",children:Fd})]})]})]}):null}}),activeSectionKey:le,navigationLabel:_("agentWorkspace.agentDetails"),onSectionChange:q})]})]}),F==="evaluation"&&a.jsx("div",{className:"aw-evaluation-glass",role:"status",children:a.jsx("span",{children:_("agentWorkspace.comingSoon")})})]})]}),Rn&&a.jsx(_d,{variant:"danger",title:Rn.title,description:Rn.description,error:_i||void 0,confirmLabel:Nn?_("common.deleting"):Rn.confirmLabel,closeLabel:_("agentWorkspace.closeDeleteConfirmation"),busy:Nn,confirmDisabled:Rn.canConfirm===!1,onCancel:()=>{var fe;(fe=Kn.current)==null||fe.abort(),Kn.current=null,nt(null),Fn("")},onConfirm:()=>void w0()})]})}function jXt({groups:e}){const{t}=_e("ui");return a.jsx("div",{className:"aw-optimization-table-wrap",children:a.jsxs("table",{className:"aw-optimization-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:t("agentWorkspace.fixPriority")}),a.jsx("th",{scope:"col",children:t("agentWorkspace.suggestedModule")}),a.jsx("th",{scope:"col",children:t("agentWorkspace.suggestionAndReason")})]})}),a.jsx("tbody",{children:e.map(n=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx("span",{className:`aw-priority is-${n.priority}`,children:yXt(n.priority,t)})}),a.jsx("td",{children:a.jsx("span",{className:"aw-optimization-module",children:xXt(n,t)})}),a.jsx("td",{children:a.jsx("ul",{className:"aw-optimization-list",children:n.items.map(i=>a.jsxs("li",{children:[a.jsx("strong",{children:i.suggestion}),a.jsx("p",{children:i.reason})]},`${i.suggestion}:${i.reason}`))})})]},`${n.priority}:${n.module}:${n.customModule??""}`))})]})})}function NXt(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M4.5 7h15"}),a.jsx("path",{d:"M9 7V4.8h6V7"}),a.jsx("path",{d:"m6.5 7 .8 12h9.4l.8-12"}),a.jsx("path",{d:"M10 10.5v5M14 10.5v5"})]})}function RXt({cases:e,loading:t=!1,error:n="",notice:i="",runtimeBacked:r=!1,selectionMode:s=!1,selectedCaseIds:o,focusedCaseId:l="",expandedCaseIds:c,deleting:u=!1,canDelete:d=!1,onOpenCase:f,onToggleCase:h,onToggleExpanded:m,onDeleteCase:g,onRetry:b}){const{t:v,i18n:y}=_e("ui");return a.jsxs("div",{className:"aw-case-table",children:[a.jsxs("div",{className:"aw-case-row aw-case-row-head",children:[a.jsx("span",{children:v("agentWorkspace.userInput")}),a.jsx("span",{children:v("agentWorkspace.agentOutput")}),a.jsx("span",{children:v("agentWorkspace.score")}),a.jsx("span",{children:v("agentWorkspace.scoreReason")}),a.jsx("span",{className:"aw-case-action-head",children:v("skillCenter.actions")})]}),t?a.jsx("div",{className:"aw-case-empty",children:v("agentWorkspace.loadingEvaluationSet")}):n?a.jsxs("div",{className:"aw-case-empty aw-case-error",children:[a.jsx("span",{children:n}),b&&a.jsx("button",{type:"button",onClick:b,children:v("common.retry")})]}):i?a.jsx("div",{className:"aw-case-empty",children:i}):e.length===0?a.jsx("div",{className:"aw-case-empty",children:v(r?"agentWorkspace.noFeedbackCases":"agentWorkspace.noMatchingCases")}):e.map(w=>{var T,R;const x=w.id.startsWith("local:"),k=(o==null?void 0:o.has(w.id))??!1,S=(c==null?void 0:c.has(w.id))??!1,A=w.output.length+w.referenceOutput.length>220||(((T=w.reason)==null?void 0:T.length)??0)>120,E=d&&!x,j=!!(w.comment&&w.comment.trim()!==((R=w.reason)==null?void 0:R.trim()));return a.jsxs("div",{className:["aw-case-row",l===w.id?"is-focused":"",s?"is-selecting":"",k?"is-selected-for-delete":""].filter(Boolean).join(" "),role:"row",tabIndex:0,"aria-selected":s?k:void 0,onClick:()=>{if(s){E&&(h==null||h(w));return}f==null||f(w)},onKeyDown:C=>{C.target===C.currentTarget&&(C.key!=="Enter"&&C.key!==" "||(C.preventDefault(),s?E&&(h==null||h(w)):f==null||f(w)))},children:[a.jsxs("div",{className:"aw-case-text aw-case-cell","data-label":v("agentWorkspace.userInput"),children:[a.jsxs("span",{className:"aw-case-title-line",children:[s&&E&&a.jsx("span",{className:`aw-select-marker${k?" is-checked":""}`,"aria-hidden":"true"}),a.jsx("strong",{title:w.input,children:w.input||v("agentWorkspace.noUserInput")})]}),j&&a.jsxs("small",{title:w.comment,children:[v("agentWorkspace.note"),w.comment]}),a.jsx("small",{className:"aw-case-time",children:gXt(w.createdAt,y.resolvedLanguage??y.language,v)}),(w.userId||w.sessionId)&&a.jsx("small",{title:[w.userId,w.sessionId].filter(Boolean).join(" · "),children:[w.userId,w.sessionId].filter(Boolean).join(" · ")})]}),a.jsxs("div",{className:`aw-case-output aw-case-cell${S?" is-expanded":""}`,"data-label":v("agentWorkspace.agentOutput"),children:[a.jsx("p",{className:"aw-case-output-preview",title:w.output,children:w.output||v("agentWorkspace.noVisibleResponse")}),w.referenceOutput&&a.jsxs("small",{className:"aw-case-output-preview",title:w.referenceOutput,children:[v("agentWorkspace.reference"),": ",w.referenceOutput]}),A&&a.jsx("button",{type:"button",className:"aw-case-expand",onClick:C=>{C.stopPropagation(),m==null||m(w.id)},children:v(S?"common.collapse":"common.expand")})]}),a.jsx("div",{className:"aw-case-score aw-case-cell","data-label":v("agentWorkspace.score"),children:bXt(w,v)}),a.jsx("div",{className:`aw-case-reason aw-case-cell${S?" is-expanded":""}`,"data-label":v("agentWorkspace.scoreReason"),children:a.jsx("p",{title:w.reason||void 0,children:w.reason||"—"})}),a.jsx("div",{className:"aw-case-actions aw-case-cell","data-label":v("skillCenter.actions"),children:E&&a.jsx("button",{type:"button",className:"aw-case-delete",onClick:C=>{C.stopPropagation(),g==null||g(w)},disabled:u,title:v("agentWorkspace.deleteFeedbackCase"),"aria-label":v("agentWorkspace.deleteFeedbackCase"),children:a.jsx(NXt,{})})})]},w.id)})]})}function IXt({group:e,agents:t,cases:n,onChange:i,onRun:r}){const{t:s}=_e("ui"),[o,l]=p.useState("config"),c=e.agentIds.map(h=>t.find(m=>m.id===h)).filter(h=>!!h),u=["回答质量","事实准确性","工具调用","响应效率"];p.useEffect(()=>l("config"),[e.id]);const d=h=>{i({...e,agentIds:e.agentIds.includes(h)?e.agentIds.filter(m=>m!==h):[...e.agentIds,h]})},f=h=>{i({...e,metrics:e.metrics.includes(h)?e.metrics.filter(m=>m!==h):[...e.metrics,h]})};return a.jsxs("main",{className:"aw-main",children:[a.jsxs("div",{className:"aw-eval-head",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"aw-agent-title-row",children:[a.jsx("h2",{children:TS(e.name,s)}),a.jsx("span",{children:s("agentWorkspace.evaluationGroup")})]}),a.jsx("p",{children:s("agentWorkspace.evaluationGroupStats",{agents:c.length,caseSet:TS(e.caseSet,s),runs:e.history.length})})]}),a.jsxs("button",{type:"button",className:"aw-run",onClick:()=>r(e),disabled:!0,children:[a.jsx(Bat,{"aria-hidden":!0}),s("agentWorkspace.startEvaluation")]})]}),a.jsxs("nav",{className:"aw-agent-tabs","aria-label":s("agentWorkspace.evaluationGroupDetails"),children:[a.jsx("button",{type:"button",className:o==="config"?"is-active":"","aria-pressed":o==="config",onClick:()=>l("config"),disabled:!0,children:s("agentWorkspace.evaluationConfig")}),a.jsx("button",{type:"button",className:o==="history"?"is-active":"","aria-pressed":o==="history",onClick:()=>l("history"),disabled:!0,children:s("agentWorkspace.historyResults")})]}),a.jsx("div",{className:"aw-content",children:o==="config"?a.jsxs("div",{className:"aw-eval-setup",children:[a.jsxs("section",{className:"aw-eval-block",children:[a.jsxs("div",{className:"aw-card-head",children:[a.jsx("strong",{children:s("agentWorkspace.participatingAgents")}),a.jsx("span",{children:s("agentWorkspace.selectedCount",{count:c.length})})]}),a.jsx("div",{className:"aw-eval-agent-grid",children:t.map(h=>a.jsxs("label",{children:[a.jsx("input",{type:"checkbox",checked:e.agentIds.includes(h.id),onChange:()=>d(h.id)}),a.jsxs("span",{children:[a.jsx("strong",{children:h.label}),a.jsx("small",{children:h.remote?s("agentWorkspace.remote"):s("agentWorkspace.local")})]})]},h.id))})]}),a.jsxs("div",{className:"aw-eval-setting-grid",children:[a.jsxs("section",{className:"aw-eval-block",children:[a.jsx("div",{className:"aw-card-head",children:a.jsx("strong",{children:s("agentWorkspace.evaluationResources")})}),a.jsxs("div",{className:"aw-eval-fields",children:[a.jsxs("label",{children:[a.jsx("span",{children:s("agentWorkspace.evaluationSet")}),a.jsxs("select",{value:e.caseSet,onChange:h=>i({...e,caseSet:h.currentTarget.value}),children:[a.jsx("option",{value:"核心回归集",children:s("agentWorkspace.evaluationDefaults.coreSet")}),a.jsx("option",{value:"安全边界集",children:s("agentWorkspace.evaluationDefaults.safetySet")}),a.jsx("option",{value:"工具调用集",children:s("agentWorkspace.evaluationDefaults.toolSet")})]}),a.jsx("small",{children:s("agentWorkspace.caseCount",{count:n.length})})]}),a.jsxs("label",{children:[a.jsx("span",{children:s("agentWorkspace.evaluator")}),a.jsxs("select",{value:e.evaluator,onChange:h=>i({...e,evaluator:h.currentTarget.value}),children:[a.jsx("option",{value:"综合质量评估器",children:s("agentWorkspace.evaluationDefaults.qualityEvaluator")}),a.jsx("option",{value:"事实一致性评估器",children:s("agentWorkspace.evaluationDefaults.factualEvaluator")}),a.jsx("option",{value:"工具调用评估器",children:s("agentWorkspace.evaluationDefaults.toolEvaluator")})]})]}),a.jsxs("label",{children:[a.jsx("span",{children:s("agentWorkspace.concurrency")}),a.jsxs("select",{value:e.concurrency,onChange:h=>i({...e,concurrency:h.currentTarget.value}),children:[a.jsx("option",{value:"2",children:"2"}),a.jsx("option",{value:"4",children:"4"}),a.jsx("option",{value:"8",children:"8"})]})]})]})]}),a.jsxs("section",{className:"aw-eval-block",children:[a.jsxs("div",{className:"aw-card-head",children:[a.jsx("strong",{children:s("agentWorkspace.evaluationMetrics")}),a.jsx("span",{children:s("agentWorkspace.selectedMetricCount",{count:e.metrics.length})})]}),a.jsx("div",{className:"aw-metric-list",children:u.map(h=>a.jsxs("label",{children:[a.jsx("input",{type:"checkbox",checked:e.metrics.includes(h),onChange:()=>f(h)}),a.jsx("span",{children:TS(h,s)})]},h))})]})]})]}):a.jsxs("section",{className:"aw-eval-history",children:[a.jsx("div",{className:"aw-section-head",children:a.jsxs("div",{children:[a.jsx("h3",{children:s("agentWorkspace.historyResults")}),a.jsx("p",{children:s("agentWorkspace.historyDescription")})]})}),e.history.length===0?a.jsxs("div",{className:"aw-results-empty",children:[a.jsx("strong",{children:s("agentWorkspace.noHistory")}),a.jsx("span",{children:s("agentWorkspace.noHistoryDescription")})]}):a.jsx("div",{className:"aw-history-list",children:e.history.map((h,m)=>a.jsxs("button",{type:"button",children:[a.jsxs("span",{children:[a.jsx("strong",{children:s("agentWorkspace.evaluationRun",{index:e.history.length-m})}),a.jsx("small",{children:s("agentWorkspace.evaluationRunMeta",{time:TS(h.createdAt,s),agents:c.length})})]}),a.jsxs("span",{className:"aw-history-score",children:[a.jsx("strong",{children:h.score}),a.jsx("small",{children:s("agentWorkspace.overallScore")})]}),a.jsxs("span",{className:"aw-complete",children:[a.jsx(Of,{}),s("agentWorkspace.completed")]}),a.jsx(sE,{"aria-hidden":!0})]},h.id))})]})})]})}async function mK(e,t={}){const n=await fetch(Na(`/web/agent-reviews${e}`),{...t,headers:hl(oc({"Content-Type":"application/json"})),signal:po(t.signal??void 0,6e4)});if(!n.ok)throw new Error(await n.text());return n.json()}function PXt(e,t){return mK(`?${new URLSearchParams({region:e})}`,{signal:t})}function DXt(e,t,n){return mK(`/${encodeURIComponent(e)}?${new URLSearchParams({region:t})}`,{signal:n})}function MXt(e,t,n){return mK(`/${encodeURIComponent(e)}/${t}`,{method:"POST",body:JSON.stringify(n)})}const LXt=20,Woe=256;function d6({label:e,value:t,onChange:n,limit:i,disabled:r,required:s=!1}){const{t:o}=_e("agentReviews");return a.jsxs("label",{children:[e,a.jsx("textarea",{"aria-label":e,value:t,onChange:l=>n(Array.from(l.target.value).slice(0,i).join("")),maxLength:i*2,disabled:r,required:s,rows:3}),a.jsx("span",{className:"agent-review-text-count",children:o("textCount",{count:Array.from(t).length,limit:i})})]})}function IP({person:e}){return a.jsxs("span",{className:"agent-review-person",title:e.email||e.name,children:[e.avatarUrl?a.jsx("img",{src:e.avatarUrl,alt:"",referrerPolicy:"no-referrer",onError:t=>{t.currentTarget.hidden=!0}}):null,a.jsx("span",{children:e.name||e.id})]})}function h9e({runtimeId:e,region:t,name:n,canPublish:i,onClose:r,onChanged:s}){const{t:o,i18n:l}=_e("agentReviews"),[c,u]=p.useState(null),[d,f]=p.useState(!0),[h,m]=p.useState(!1),[g,b]=p.useState(""),[v,y]=p.useState(""),[w,x]=p.useState(""),[k,S]=p.useState(""),[O,A]=p.useState(0),[E,j]=p.useState(!1),[T,R]=p.useState(null);p.useEffect(()=>{const _=new AbortController;return f(!0),b(""),DXt(e,t,_.signal).then(L=>{_.signal.aborted||u(L.application)}).catch(L=>{_.signal.aborted||b(L instanceof Error?L.message:String(L))}).finally(()=>{_.signal.aborted||f(!1)}),()=>_.abort()},[e,t,O]);async function C(_,L){if(!h){m(!0),b("");try{const F=await MXt(e,_,{region:t,..._==="submit"?{message:v}:{},..._==="publish"||_==="decision"?{comment:w}:{},..._==="decision"?{applicationId:c==null?void 0:c.id,decision:L,reason:k}:{}});u(F),x(""),S(""),j(!1),R(null),s()}catch(F){b(F instanceof Error?F.message:String(F))}finally{m(!1)}}}const N=(c==null?void 0:c.status)==="pending",P=!!(c!=null&&c.published),I=!N&&!P,D=_=>new Date(_).toLocaleString(l.language);return a.jsx(t0,{open:!0,onOpenChange:_=>{!_&&!h&&r()},children:a.jsxs(e0,{children:[a.jsx(Zv,{className:"agent-review-backdrop"}),a.jsxs(Jv,{className:"agent-review-dialog",children:[a.jsxs("header",{className:"agent-review-dialog-header",children:[a.jsxs("div",{children:[a.jsx(wk,{children:n}),a.jsx(UT,{children:o("dialogDescription")})]}),a.jsx(dL,{className:"agent-review-close",disabled:h,"aria-label":o("close"),children:a.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m6 6 12 12M6 18 18 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})})]}),a.jsxs("div",{className:"agent-review-dialog-body",children:[d?a.jsx(fl,{}):null,g?a.jsxs("div",{className:"agent-review-error",role:"alert",children:[a.jsx("p",{children:g}),a.jsx("button",{type:"button",disabled:h||d,onClick:()=>A(_=>_+1),children:o("refresh")})]}):null,!d&&c?a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"agent-review-facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:o("statusTitle")}),a.jsxs("dd",{children:[o(`status.${c.status}`),c.status==="approved"&&!P?` · ${o("private")}`:""]})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("submitter")}),a.jsx("dd",{children:a.jsx(IP,{person:c.submitter})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("submittedAt")}),a.jsx("dd",{children:D(c.submittedAt)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("version")}),a.jsx("dd",{children:c.agent.version??"—"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("model")}),a.jsx("dd",{children:c.agent.model||"—"})]}),c.reviewer?a.jsxs("div",{children:[a.jsx("dt",{children:o(c.status==="returned"?"returnedBy":"approvedBy")}),a.jsx("dd",{children:a.jsx(IP,{person:c.reviewer})})]}):null,c.reviewedAt?a.jsxs("div",{children:[a.jsx("dt",{children:o("reviewedAt")}),a.jsx("dd",{children:D(c.reviewedAt)})]}):null]}),a.jsxs("section",{children:[a.jsx("h3",{children:o("description")}),a.jsx("p",{children:c.agent.description||"—"})]}),c.message?a.jsxs("section",{children:[a.jsx("h3",{children:o("message")}),a.jsx("p",{children:c.message})]}):null,c.reason?a.jsxs("section",{children:[a.jsx("h3",{children:o("reason")}),a.jsx("p",{children:c.reason})]}):null,c.comment?a.jsxs("section",{children:[a.jsx("h3",{children:o("comment")}),a.jsx("p",{children:c.comment})]}):null,c.contentChanged?a.jsx("p",{role:"alert",className:"agent-review-warning",children:o("contentChanged")}):null]}):null,!d&&!g&&I&&!i?a.jsx(d6,{label:o("message"),value:v,onChange:y,limit:LXt,disabled:h}):null,!d&&!g&&i&&(N||I)?a.jsx(d6,{label:o("comment"),value:w,onChange:x,limit:Woe,disabled:h}):null,E?a.jsx(d6,{label:o("reasonRequired"),value:k,onChange:S,limit:Woe,disabled:h,required:!0}):null,T?a.jsx("p",{role:"status",children:o(`${T}Confirm`)}):null]}),a.jsxs("footer",{className:"agent-review-dialog-footer",children:[h?a.jsx("span",{role:"status",children:o("saving")}):null,!d&&(!g||c)?T?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",disabled:h,onClick:()=>R(null),children:o("cancel")}),a.jsx("button",{type:"button",disabled:h,onClick:()=>void C(T),children:o("confirm")})]}):E?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",disabled:h,onClick:()=>j(!1),children:o("cancel")}),a.jsx("button",{type:"button",disabled:h||!k.trim(),onClick:()=>void C("decision","returned"),children:o("return")})]}):a.jsxs(a.Fragment,{children:[P?a.jsx("button",{type:"button",disabled:h,onClick:()=>R("unpublish"),children:o("unpublish")}):null,N?a.jsx("button",{type:"button",disabled:h,onClick:()=>R("withdraw"),children:o("withdraw")}):null,N&&i?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",disabled:h,onClick:()=>j(!0),children:o("return")}),a.jsx("button",{type:"button",className:"is-primary",disabled:h||(c==null?void 0:c.contentChanged),onClick:()=>void C("decision","approved"),children:o("approve")})]}):null,I?a.jsx("button",{type:"button",className:"is-primary",disabled:h,onClick:()=>void C(i?"publish":"submit"),children:o(i?"publish":"submit")}):null]}):null]})]})]})})}const $Xt=5e3,FXt=4;let f6=0;const Koe=[];function Goe(e){return e instanceof Error&&e.name==="AbortError"}function BXt(e){return e instanceof Error&&e.name==="TimeoutError"}function UXt(e){return BXt(e)||e instanceof ND&&[500,502,503,504].includes(e.status)}function QXt(e,t){return t!=null&&t.aborted?Promise.reject(t.reason??new DOMException("Request aborted","AbortError")):new Promise((n,i)=>{const r=()=>{globalThis.clearTimeout(s),i((t==null?void 0:t.reason)??new DOMException("Request aborted","AbortError"))},s=globalThis.setTimeout(()=>{t==null||t.removeEventListener("abort",r),n()},e);t==null||t.addEventListener("abort",r,{once:!0})})}async function zXt(e={},t={}){const n=t.request??$v,i=t.wait??QXt;try{return await n(e)}catch(r){if(!UXt(r))throw r;return await i($Xt,e.signal),n(e)}}async function p9e(e){var t;f6>=FXt&&await new Promise(n=>Koe.push(n)),f6+=1;try{return await e()}finally{f6-=1,(t=Koe.shift())==null||t()}}async function VXt(e,t){await Promise.allSettled(e.map(n=>p9e(()=>t(n))))}function wy(e,t,n){const i=e instanceof Error?`${e.name}: ${e.message}`:String(e||Q("common.unknownError"));return[Q("requestError.actionFailed",{action:t}),Q("requestError.detail",{detail:i}),n?Q("requestError.request",{request:n}):""].filter(Boolean).join(` +`)}const HXt=/^[A-Za-z_][A-Za-z0-9_]*$/,NL=/^\$\{([A-Za-z_][A-Za-z0-9_]*)\}$/;function Xoe(e,t){return e.trim().toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"")||t}function qXt(e,t){if(!t.has(e))return e;let n=2;for(;t.has(`${e}_${n}`);)n+=1;return`${e}_${n}`}function Ek(e){var n,i,r;const t=(n=e.authTokenEnv)==null?void 0:n.trim();return t&&HXt.test(t)?t:((r=(i=e.authToken)==null?void 0:i.trim().match(NL))==null?void 0:r[1])??""}function PP(e,t){var n;for(const i of e.mcpTools??[])t(i);for(const i of e.subAgents)PP(i,t);for(const i of((n=e.workflow)==null?void 0:n.nodes)??[])PP(i.agent,t)}function m9e(e){try{const t=(e??"").trim(),n=new URL(t);if(n.protocol!=="http:"&&n.protocol!=="https:"||n.username||n.password||n.search||n.hash)return null;const i=t.indexOf("://")+3,r=t.indexOf("/",i),s=(r>=0?t.slice(r):"").replace(/\/+$/,"");return`${n.protocol}//${n.host}${s}`}catch{return null}}function WXt(e,t){let n=e.name.trim();if(!n){const i=m9e(e.url),r=(i==null?void 0:i.split("/").filter(Boolean))??[];n=r[r.length-1]??""}return n=n.replace(/[^A-Za-z0-9_.-]+/g,"_").replace(/^[_.-]+|[_.-]+$/g,""),n||`mcp_${t+1}`}function g9e(e){const t=new Set,n=new Set;let i=null;const r=s=>{var o;(s.mcpTools??[]).forEach((l,c)=>{if(i||l.transport!=="http")return;const u=WXt(l,c),d=m9e(l.url);if(t.has(u)){i="duplicateName";return}if(d&&n.has(d)){i="duplicateUrl";return}t.add(u),d&&n.add(d)}),!i&&(s.subAgents.forEach(r),(o=s.workflow)==null||o.nodes.forEach(l=>r(l.agent)))};return r(e),i}function h6(e){const t=new Set;return PP(e,n=>{const i=Ek(n);n.credentialConfigured&&i&&t.add(i)}),[...t]}function b9e(e){const t=new Set;return PP(e,n=>{const i=Ek(n);i&&t.add(i)}),[...t]}function KXt(e,t){const n=new Set(b9e(t));return[...new Set(e)].filter(i=>!n.has(i))}function GXt(e){if(e.authToken)return e.authToken;if(e.credentialConfigured)return"";const t=Ek(e);return t?`\${${t}}`:""}function XXt(e,t){if(!t){const i={...e,credentialConfigured:!1};return delete i.authToken,delete i.authTokenEnv,delete i.credentialSourceUrl,delete i.credentialSourceAuthTokenEnv,i}const n=t.trim().match(NL);if(n){const i={...e,authTokenEnv:n[1],credentialConfigured:e.credentialConfigured&&Ek(e)===n[1]};return delete i.authToken,i}return{...e,authToken:t,credentialConfigured:!1}}function YXt(e){if(!e.trim())return!1;try{return new URL(e).pathname.replace(/\/+$/,"")===""}catch{return!1}}function Yoe(e){return(e??"").trim().replace(/\/+$/,"")}function ZXt(e,t){return{...e,url:t}}function JXt(e,t){const n=new Map(t.map(r=>[[r.agentName.trim(),r.authTokenEnv.trim(),Yoe(r.url)].join("\0"),r.value])),i=r=>({...r,mcpTools:(r.mcpTools??[]).map(s=>{var c;const o=Ek(s);if(!o)return s;const l=n.get([r.name.trim(),o,Yoe(s.url)].join("\0"));return l?{...s,authToken:l,credentialConfigured:!0,credentialSourceUrl:((c=s.url)==null?void 0:c.trim())??"",credentialSourceAuthTokenEnv:o}:s}),subAgents:r.subAgents.map(i),...r.workflow?{workflow:{...r.workflow,nodes:r.workflow.nodes.map(s=>({...s,agent:i(s.agent)}))}}:{}});return i(e)}function eYt(e){const t=Ck(e),n={},i=o=>{var l,c;Object.assign(n,((l=o.deployment)==null?void 0:l.envValues)??{}),o.subAgents.forEach(i),(c=o.workflow)==null||c.nodes.forEach(u=>i(u.agent))};i(e),Object.assign(n,t.envValues);const r=[],s=o=>{var l,c,u;for(const d of o.mcpTools??[]){const f=((l=d.authTokenEnv)==null?void 0:l.trim())??"",h=f?(n[f]??"").trim():"";d.transport!=="http"||!h||r.push({agentName:o.name.trim(),name:d.name.trim(),url:((c=d.url)==null?void 0:c.trim())??"",value:h})}o.subAgents.forEach(s),(u=o.workflow)==null||u.nodes.forEach(d=>s(d.agent))};return s(t.draft),r}function tYt(e){const t=[],n=i=>{var r,s,o;for(const l of i.mcpTools??[]){const c=((r=l.authToken)==null?void 0:r.trim())??"";l.transport!=="http"||!c||NL.test(c)||t.push({agentName:i.name.trim(),name:l.name.trim(),url:((s=l.url)==null?void 0:s.trim())??"",value:c})}i.subAgents.forEach(n),(o=i.workflow)==null||o.nodes.forEach(l=>n(l.agent))};return n(e),t}function Ck(e){const t=new Set,n={},i=r=>{var u;const s=Xoe(r.name,"AGENT"),o=(u=r.mcpTools)==null?void 0:u.map((d,f)=>{var y,w;const h=((y=d.authToken)==null?void 0:y.trim())??"",m=((w=h.match(NL))==null?void 0:w[1])??"";let b=Ek(d);if(!b&&h){const x=Xoe(d.name,`TOOL_${f+1}`);b=qXt(`MCP_${s}_${x}_AUTH_TOKEN`,t)}b&&t.add(b),b&&h&&!m&&(n[b]=h);const v={...d};return delete v.authToken,delete v.credentialConfigured,delete v.credentialSourceUrl,delete v.credentialSourceAuthTokenEnv,b?v.authTokenEnv=b:delete v.authTokenEnv,v}),l=r.subAgents.map(i),c=r.workflow?{...r.workflow,nodes:r.workflow.nodes.map(d=>({...d,agent:i(d.agent)}))}:void 0;return{...r,subAgents:l,...o?{mcpTools:o}:{},...c?{workflow:c}:{}}};return{draft:i(e),envValues:n}}const nYt=/^[A-Za-z_][A-Za-z0-9_]*$/;function xj(e){return typeof e=="string"?e.trim():""}function Zy(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.modelName=="string"}function y9e(e){return typeof e=="string"?e:e.modelName}function v9e(e){var t,n,i;return typeof e=="string"||!((t=e.modelProvider)!=null&&t.trim())&&!((n=e.modelApiBase)!=null&&n.trim())&&!((i=e.modelApiKeyEnv)!=null&&i.trim())}function gK(e,t){return`FALLBACK_MODEL_${(e??"").trim().toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"")||"AGENT"}_${t+1}_API_KEY`}function x9e(e){return nYt.test(e)}function w9e(e,t,n){const i=new Set((n??[]).map(o=>{var l;return Zy(o)?(l=o.modelApiKeyEnv)==null?void 0:l.trim():""}).filter(o=>!!o)),r=gK(e,t);if(!i.has(r))return r;let s=2;for(;i.has(`${r}_${s}`);)s+=1;return`${r}_${s}`}function iYt(e,t,n,i){var s;const r=((s=i.modelApiKeyEnv)==null?void 0:s.trim())??"";return r&&x9e(r)?r:w9e(e,t,n)}function Lu(e,t){var s,o,l;const n=(e??"").trim(),i=new Set;n&&i.add(`same:${n}`);const r=[];for(const c of t??[]){const u=rYt(c);if(!u)continue;const d=y9e(u).trim(),f=v9e(u);if(!d||f&&d===n)continue;const h=typeof u=="string"?`same:${d}`:["endpoint",d,((s=u.modelProvider)==null?void 0:s.trim())??"",((o=u.modelApiBase)==null?void 0:o.trim())??"",((l=u.modelApiKeyEnv)==null?void 0:l.trim())??""].join("\0");i.has(h)||(i.add(h),r.push(u))}return r}function rYt(e){if(typeof e=="string")return e.trim()||null;if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e,n=xj(t.modelName??t.model_name??t.model);if(!n)return null;const i={modelName:n},r=xj(t.modelProvider??t.model_provider??t.provider),s=xj(t.modelApiBase??t.model_api_base??t.apiBase??t.api_base??t.baseUrl??t.base_url),o=xj(t.modelApiKeyEnv??t.model_api_key_env??t.apiKeyEnv??t.api_key_env);return r&&(i.modelProvider=r),s&&(i.modelApiBase=s),o&&x9e(o)&&(i.modelApiKeyEnv=o),v9e(i)?n:i}function k9e(e,t){return Lu(e,t).filter(n=>typeof n=="string")}function O9e(e,t){const n=Array.isArray(e)?e:[e],i=typeof n[0]=="string"?n[0].trim():"";return{modelName:i,modelFallbacks:Lu(i,[...n.slice(1),...Array.isArray(t)?t:[]])}}function sYt(e,t){return e.trim().toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"")||t}function wj(e,t){if(!t.has(e))return e;let n=2;for(;t.has(`${e}_${n}`);)n+=1;return`${e}_${n}`}function S9e(e,t){const n=e==null?void 0:e.trim();if(!n)return!1;try{const i=new URL(n),r=new URL(t),s=i.pathname.replace(/\/+$/,""),o=r.pathname.replace(/\/+$/,"");return i.protocol==="https:"&&i.username===""&&i.password===""&&i.search===""&&i.hash===""&&i.hostname.toLowerCase()===r.hostname.toLowerCase()&&i.port===r.port&&s===o}catch{return!1}}function RL(e,t){const n=[],i=new Set,r=(s,o=[])=>{var u,d,f,h;const l=sYt(s.name,"AGENT"),c=s.agentType===void 0||s.agentType==="llm";if(c&&s.modelSource!=="ark"&&(s.modelSource==="custom"||(u=s.modelApiBase)!=null&&u.trim()&&!S9e(s.modelApiBase,t))){const m=((d=s.modelProvider)==null?void 0:d.trim())??"",g=((f=s.modelApiBase)==null?void 0:f.trim())??"",b=m?wj(`CUSTOM_MODEL_${l}_PROVIDER`,i):void 0;b&&i.add(b);const v=g?wj(`CUSTOM_MODEL_${l}_API_BASE`,i):void 0;v&&i.add(v);const y=wj(`CUSTOM_MODEL_${l}_API_KEY`,i);i.add(y),n.push({providerKey:b,apiBaseKey:v,apiKeyKey:y,provider:m,apiBase:g,label:Yt("helpers.customModel.apiKeyLabel",{name:s.name.trim()||Yt("helpers.customModel.fallbackName")}),path:o})}if(!c){s.subAgents.forEach((m,g)=>r(m,[...o,g]));return}(h=s.modelFallbacks)==null||h.forEach((m,g)=>{var w,x,k;if(!Zy(m))return;const b=m.modelName.trim();if(!b)return;const y=(((w=m.modelApiKeyEnv)==null?void 0:w.trim())??"")||wj(gK(s.name,g),i);i.add(y),n.push({apiKeyKey:y,provider:((x=m.modelProvider)==null?void 0:x.trim())??"",apiBase:((k=m.modelApiBase)==null?void 0:k.trim())??"",label:Yt("helpers.customModel.fallbackApiKeyLabel",{name:s.name.trim()||Yt("helpers.customModel.fallbackName"),model:b}),path:o})}),s.subAgents.forEach((m,g)=>r(m,[...o,g]))};return r(e),n}function bK(e,t){return RL(e,t).map(({apiKeyKey:n,label:i})=>({key:n,label:i}))}function E9e(e,t,n,i=[]){const r=new Set(i);return RL(e,t).map(({apiKeyKey:s,label:o,path:l})=>({key:s,label:o,path:l})).find(({key:s})=>{var o;return!((o=n[s])!=null&&o.trim())&&!r.has(s)})??null}function Zoe(e){const t=new Set,n=i=>{var r,s;for(const o of i.modelFallbacks??[]){if(!Zy(o))continue;const l=((r=o.modelApiKeyEnv)==null?void 0:r.trim())??"";l&&t.add(l)}i.subAgents.forEach(n),(s=i.workflow)==null||s.nodes.forEach(o=>n(o.agent))};return n(e),[...t]}const C9e=1,aYt="MODEL_AGENT_API_KEY",A9e="WorkspaceDraftError";function G7(e){const t=new Error(Yt(e));return t.name=A9e,t}function DP(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function oYt(e){return DP(e)&&typeof e.id=="string"&&typeof e.updatedAt=="number"&&(e.creationMode===void 0||e.creationMode==="quick"||e.creationMode==="traditional")&&DP(e.draft)}function _w(e){return(e==null?void 0:e.agentCategory)??((e==null?void 0:e.mpaProfileOnly)===!0?"mpa":"general")}function p6(e){return e.creationMode?e.creationMode:e.draft.dynamicAgentDelegation===!0?"quick":"traditional"}function IL(e){return`veadk.agentDrafts.${encodeURIComponent(e)}`}function X7(e,t,n,i){const r=e.deployment,s=r==null?void 0:r.envValues,o=r?{...r,...s?{envValues:Object.fromEntries(Object.entries(s).filter(([l])=>l!==aYt&&!t.has(l)&&!i.has(l)))}:{}}:void 0;return{...e,...e.mcpTools?{mcpTools:e.mcpTools.map(l=>{if(!l.authTokenEnv||!n.has(l.authTokenEnv))return l;const c={...l};return delete c.authTokenEnv,c})}:{},...o?{deployment:o}:{},subAgents:e.subAgents.map(l=>X7(l,t,n,i)),...e.workflow?{workflow:{...e.workflow,nodes:e.workflow.nodes.map(l=>({...l,agent:X7(l.agent,t,n,i)}))}}:{}}}function Y7(e,t){return{...e,...e.mcpTools?{mcpTools:e.mcpTools.map((n,i)=>{var r,s;return{...n,...((s=(r=t.mcpTools)==null?void 0:r[i])==null?void 0:s.credentialConfigured)===!0?{credentialConfigured:!0}:{}}})}:{},subAgents:e.subAgents.map((n,i)=>Y7(n,t.subAgents[i]??n)),...e.workflow?{workflow:{...e.workflow,nodes:e.workflow.nodes.map((n,i)=>{var r,s;return{...n,agent:Y7(n.agent,((s=(r=t.workflow)==null?void 0:r.nodes[i])==null?void 0:s.agent)??n.agent)}})}}:{}}}function lYt(e){const t=Ck(e),n=Y7(t.draft,e),i=new Set([...bK(t.draft,Fo(t.draft.cloudProvider??"volcengine")).map(r=>r.key),...Zoe(t.draft),...Zoe(e)]);return X7(n,new Set(b9e(t.draft)),new Set(Object.keys(t.envValues)),i)}function T9e(e){return{...e,draft:lYt(e.draft)}}function cYt(e){const t=Array.isArray(e)?e:DP(e)&&e.version===C9e?e.drafts:void 0;if(!Array.isArray(t)||!t.every(oYt))throw DP(e)&&typeof e.version=="number"?G7("helpers.drafts.unsupportedVersion"):G7("helpers.drafts.invalidFormat");return t.map(T9e)}function uYt(e,t){if(!t)return[];const n=e.getItem(IL(t));if(!n)return[];try{return cYt(JSON.parse(n))}catch(i){throw i instanceof Error&&i.name===A9e?i:G7("helpers.drafts.readFailed")}}function Joe(e,t,n){if(!t)return;const i={version:C9e,drafts:n.map(T9e)};try{e.setItem(IL(t),JSON.stringify(i))}catch(r){throw r instanceof DOMException&&(r.name==="QuotaExceededError"||r.name==="NS_ERROR_DOM_QUOTA_REACHED")?new Error(Yt("helpers.drafts.quotaExceeded")):new Error(Yt("helpers.drafts.writeRejected"))}}function _p({className:e="icon"}){return a.jsxs("svg",{className:`${e} sidebar-agent-face`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"4.25",y:"5.25",width:"15.5",height:"13.5",rx:"4.75"}),a.jsx("path",{className:"sidebar-agent-face__eye",d:"M8.5 10.7v2"}),a.jsx("path",{className:"sidebar-agent-face__eye",d:"M15.5 10.7v2"})]})}function dYt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M8.4 18.4H7.2a4.2 4.2 0 0 1-.65-8.35A5.7 5.7 0 0 1 17.3 8.2a4.6 4.6 0 0 1-.4 9.2h-3.2"}),a.jsx("path",{d:"m7.8 12.3 2 2-2 2M12.2 16.3h3.2"})]})}function fYt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M18.9 6.25A8.4 8.4 0 1 0 19.6 16"}),a.jsx("path",{d:"M19 6.2c.1 2.1-.65 3.75-2.25 4.95-1.2.9-2.75 1.25-4.2.9"}),a.jsx("circle",{cx:"10.6",cy:"12.8",r:"2.45"}),a.jsx("path",{d:"m5.25 18.6 3.65-3.9M14.8 17.9c1.9-.45 3.55-1.65 4.65-3.35"})]})}function hYt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6.2 20c.55-2.15.75-4.1.75-6.7V9.8A5.35 5.35 0 0 1 12.35 4c3.35 0 5.65 2.35 5.65 5.65v4.6c0 2.35.35 4.25 1.15 5.75"}),a.jsx("path",{d:"M8.05 10.2c1.35-.6 2.2-1.65 2.55-3.15.45 1.55 1.35 2.55 2.7 3.05.1-1 .4-1.95.85-2.75.45 1.25 1.2 2.2 2.15 2.75"}),a.jsx("path",{d:"M9.3 12.65h.01M14.9 12.65h.01M10.8 15.55c.8.5 1.65.5 2.45 0"}),a.jsx("path",{d:"M8.45 19.85c.95-.85 1.45-1.95 1.5-3.25M15.1 16.65c.05 1.2.55 2.3 1.55 3.2"})]})}function pYt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5.2 17.2V8.1a3 3 0 0 1 3-3h7.6a3 3 0 0 1 3 3v9.1"}),a.jsx("path",{d:"M7.4 17.2h9.2M9 19.9h6"}),a.jsx("path",{d:"M9.1 9.25h5.8M9.1 12h3.1"}),a.jsx("path",{d:"m14.1 12.4 2 2.1M16.2 12.4l-2.1 2.1"})]})}function gA({kind:e,...t}){return e==="codex"?a.jsx(dYt,{...t}):e==="deepseek-harness"?a.jsx(pYt,{...t}):e==="openclaw"?a.jsx(fYt,{...t}):a.jsx(hYt,{...t})}const mYt="data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='visible'%20style='display:%20block;'%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Icon%20Frame'%3e%3cpath%20id='Vector%208798'%20d='M5%205L15%2015'%20stroke='white'%20stroke-opacity='0.15'%20stroke-width='1.25'%20stroke-linecap='round'/%3e%3cpath%20id='Vector%208800'%20d='M15%205L5%2015'%20stroke='white'%20stroke-opacity='0.15'%20stroke-width='1.25'%20stroke-linecap='round'/%3e%3c/g%3e%3c/svg%3e";function _9e({title:e,topGlow:t=!0,children:n,footer:i,cancelLabel:r="Cancel",confirmLabel:s="Confirm",closeLabel:o="Close",onClose:l,onCancel:c,onConfirm:u,className:d="",...f}){const h=p.useId();return a.jsxs("div",{role:"dialog","aria-labelledby":h,...f,className:`studio-modal-layout ${t?"studio-modal-layout--glow":""} ${d}`.trim(),children:[a.jsxs("header",{className:"studio-modal-layout__header",children:[a.jsx("h3",{id:h,children:e}),a.jsx(ki,{variant:"ghost",size:"compact",iconOnly:!0,className:"studio-modal-layout__close","aria-label":o,onClick:l,startIcon:a.jsx("img",{src:mYt,alt:""})})]}),a.jsx("div",{className:"studio-modal-layout__body",children:n}),i!==null&&a.jsx("footer",{className:"studio-modal-layout__footer",children:i===void 0?a.jsxs(a.Fragment,{children:[a.jsx(ki,{variant:"outline",className:"studio-modal-layout__cancel",onClick:c,children:r}),a.jsx(ki,{className:"studio-modal-layout__confirm",onClick:u,children:s})]}):i})]})}class Z7 extends Error{constructor(t,n,i){super(n),this.status=t,this.code=i,this.name="MpaCreationRequestError"}}async function Ak(e,t,n){var r;const i=await fetch(Na(`/web/mpa-creation/${e}`),{method:n===void 0?"GET":"POST",headers:hl(oc({"Content-Type":"application/json"})),body:n===void 0?void 0:JSON.stringify(n),signal:po(t,eo)});if(!i.ok){const s=await i.json().catch(()=>({}));throw new Z7(i.status,typeof s.detail=="string"?s.detail:`HTTP ${i.status}`,typeof((r=s.detail)==null?void 0:r.code)=="string"?s.detail.code:void 0)}return i.json()}const gYt=(e,t)=>Ak(`config?region=${encodeURIComponent(e)}`,t),bYt=(e,t)=>Ak("tasks",t,e),yYt=(e,t)=>Ak(`tasks?region=${encodeURIComponent(e)}`,t),vYt=(e,t)=>Ak("name-check",t,e),xYt=(e,t)=>Ak(`tasks/${encodeURIComponent(e)}`,t),wYt=(e,t)=>Ak(`tasks/${encodeURIComponent(e)}/cancel`,t,{}),kYt=/^[A-Za-z0-9_-]+$/,j9e=4,MP=64,LP=6,ele="agent-runtime";function N9e(e){const t=e.trim();if(!t)return ele;let n=t.replace(/[^A-Za-z0-9_-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,MP);return n?(n.lengthYt(`validation.runtimeName.${n}`)){return e?kYt.test(e)?e.lengthMP?t("length"):null:t("characters"):t("required")}function EYt(e="",t=""){const n=e.trim(),i=t.trim();return!n&&!i||n.length<=255&&/^[A-Za-z0-9][A-Za-z0-9.-]*$/.test(n)&&!n.includes("..")&&/^[0-9]{1,5}$/.test(i)&&Number(i)>=1&&Number(i)<=65535}function CYt(e="",t="",n=""){const i=e.trim(),r=t.trim();if(!i&&!r&&!n)return!0;if(!i||!r||!n.trim()||i.length>1024||/\s/.test(i)||i.replace(/^https:\/\//,"").split("/",1)[0].includes(":"))return!1;try{const o=new URL(i);return o.protocol==="https:"&&!!o.hostname&&!o.username&&!o.password&&!o.port&&!o.search&&!o.hash&&r.length<=128&&/^ov-[a-zA-Z0-9_-]+$/.test(r)}catch{return!1}}function AYt(e){return[{value:"auto",label:e("deploymentResources.mode.auto"),description:e("deploymentResources.mode.autoDescription"),badge:e("deploymentResources.mode.recommended")},{value:"create",label:e("deploymentResources.mode.create"),description:e("deploymentResources.mode.createDescription")},{value:"existing",label:e("deploymentResources.mode.existing"),description:e("deploymentResources.mode.existingDescription")}]}const R9e={tos:{mode:"auto"},cr:{mode:"auto"},codePipeline:{mode:"auto"}};function Zf(e){const[t,n]=p.useState([]),[i,r]=p.useState(""),[s,o]=p.useState(1),[l,c]=p.useState(0),[u,d]=p.useState(!1),[f,h]=p.useState(!1),[m,g]=p.useState(null),[b,v]=p.useState(""),[y,w]=p.useState(""),[x,k]=p.useState(""),[S,O]=p.useState(0),A=p.useRef(!1),E=p.useRef(null),j=e?JSON.stringify(e):"",T=e?JSON.stringify({...e,search:y}):"";p.useEffect(()=>{const I=window.setTimeout(()=>{w(b.trim())},250);return()=>window.clearTimeout(I)},[b]),p.useEffect(()=>{v(""),w("")},[j]);const R=p.useCallback((I,D)=>{var F;if(!T)return;(F=E.current)==null||F.abort();const _=new AbortController;E.current=_;const L=JSON.parse(T);D&&n([]),A.current=!0,h(!0),g(null),DTe({...L,pageNumber:I,pageSize:100},_.signal).then(M=>{n(H=>{if(D)return M.items;const q=new Set(H.map(U=>`${U.id}\0${U.name}`));return[...H,...M.items.filter(U=>!q.has(`${U.id}\0${U.name}`))]}),r(M.serviceRegion),o(M.pageNumber),c(M.totalCount),d(M.hasMore),k(T)}).catch(M=>{M instanceof DOMException&&M.name==="AbortError"||(k(T),g(M instanceof Error?M.message:String(M)))}).finally(()=>{E.current===_&&(E.current=null,A.current=!1,h(!1))})},[T]);p.useEffect(()=>{var I;if(!T){(I=E.current)==null||I.abort(),E.current=null,A.current=!1,n([]),r(""),o(1),c(0),d(!1),k(""),h(!1),g(null);return}return R(1,!0),()=>{var D;return(D=E.current)==null?void 0:D.abort()}},[R,T,S]);const C=!!T&&x===T&&b.trim()===y,N=p.useCallback(()=>{k(""),O(I=>I+1)},[]),P=p.useCallback(()=>{!C||A.current||!u||R(s+1,!1)},[u,R,s,C]);return{items:t,serviceRegion:i,totalCount:l,hasMore:C?u:!1,loading:!!T&&(!C||f),error:m,search:b,setSearch:v,reload:N,loadMore:P}}function TYt(e,t){return e.map(n=>({value:n[t],label:n.name,description:[n.status,n.region,n.id].filter(Boolean).join(" · ")}))}function Jf({ariaLabel:e,value:t,valueLabel:n,state:i,disabled:r,disabledMessage:s,valueField:o="id",onChange:l}){const{t:c}=_e("ui"),u=p.useMemo(()=>TYt(i.items,o),[i.items,o]);return a.jsxs("div",{className:"pp-resource-picker",children:[a.jsx(bf,{ariaLabel:e,value:t,valueLabel:n,placeholder:i.loading?c("common.loading"):c("deploymentResources.selectExisting"),options:u,disabled:r||!!i.error,searchValue:i.search,searchPlaceholder:c("deploymentResources.searchResource"),loading:i.loading,hasMore:i.hasMore,emptyMessage:i.search.trim()?c("deploymentResources.noMatch"):c("deploymentResources.noAvailable"),onSearchChange:i.setSearch,onLoadMore:i.loadMore,onChange:d=>{const f=i.items.find(h=>h[o]===d);f&&l(f)}}),s?a.jsx("span",{className:"pp-resource-status",children:s}):i.error?a.jsxs("div",{className:"pp-resource-error",role:"alert",children:[a.jsx("span",{children:i.error}),a.jsx("button",{type:"button",onClick:i.reload,children:c("common.retry")})]}):i.loading&&i.items.length===0?a.jsx("span",{className:"pp-resource-status","aria-live":"polite",children:i.search.trim()?c("deploymentResources.searching"):c("deploymentResources.loading")}):i.items.length===0?a.jsx("span",{className:"pp-resource-status",children:i.search.trim()?c("deploymentResources.noMatchSentence"):c("deploymentResources.noAvailableSentence")}):i.serviceRegion?a.jsx("span",{className:"pp-resource-status",children:c("deploymentResources.loadedSummary",{region:i.serviceRegion,loaded:i.items.length,total:i.totalCount>0?`/${i.totalCount}`:""})}):null]})}function I9e({region:e,value:t,disabled:n=!1,onChange:i}){const{t:r}=_e("ui"),s=Zf(e?{kind:"cr-registry",region:e}:null),o=Zf(e&&(t!=null&&t.registry)?{kind:"cr-namespace",region:e,registry:t.registry}:null),l=Zf(e&&(t!=null&&t.registry)&&t.namespace?{kind:"cr-repository",region:e,registry:t.registry,namespace:t.namespace}:null),c=t??{region:e,registry:"",namespace:"",repository:""};return a.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three environment-repository-fields",children:[a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:r("deploymentResources.registryInstance")}),a.jsx(Jf,{ariaLabel:r("deploymentResources.registryAriaLabel"),value:c.registry,valueLabel:c.registry,state:s,disabled:n||!e,valueField:"name",onChange:u=>i({region:e,registry:u.name,namespace:"",repository:""})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:r("deploymentResources.namespace")}),a.jsx(Jf,{ariaLabel:r("deploymentResources.namespaceAriaLabel"),value:c.namespace,valueLabel:c.namespace,state:o,disabled:n||!c.registry,disabledMessage:c.registry?void 0:r("deploymentResources.selectRegistryFirst"),valueField:"name",onChange:u=>i({...c,region:e,namespace:u.name,repository:""})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:r("deploymentResources.repository")}),a.jsx(Jf,{ariaLabel:r("deploymentResources.existingRepository"),value:c.repository,valueLabel:c.repository,state:l,disabled:n||!c.registry||!c.namespace,disabledMessage:c.registry?c.namespace?void 0:r("deploymentResources.selectNamespaceFirst"):r("deploymentResources.selectRegistryFirst"),valueField:"name",onChange:u=>i({...c,region:e,repository:u.name})})]})]})}function m6({resource:e,value:t,disabled:n,onChange:i}){const{t:r}=_e("ui");return a.jsxs("label",{className:"pp-resource-field pp-resource-mode",children:[a.jsx("span",{children:r("deploymentResources.configurationMode")}),a.jsx(bf,{ariaLabel:r("deploymentResources.configurationModeAriaLabel",{resource:e}),value:t,placeholder:r("deploymentResources.selectConfigurationMode"),options:AYt(r),disabled:n,onChange:s=>i(s)})]})}function G0({label:e,value:t,placeholder:n,disabled:i,onChange:r}){return a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:e}),a.jsx("input",{value:t,placeholder:n,disabled:i,autoComplete:"off",onChange:s=>r(s.currentTarget.value)})]})}function g6({items:e,note:t}){const{t:n}=_e("ui");return a.jsxs("div",{className:"pp-resource-auto-names",children:[a.jsx("span",{children:n("deploymentResources.automaticNames")}),a.jsx("dl",{children:e.map(i=>a.jsxs("div",{children:[a.jsx("dt",{children:i.label}),a.jsx("dd",{title:i.name,children:i.name})]},i.label))}),t&&a.jsx("small",{children:t})]})}function P9e(e){var t,n,i,r,s,o,l,c;return e.tos.mode!=="auto"&&!((t=e.tos.bucket)!=null&&t.trim())?bn.t("ui:deploymentResources.validation.tos"):e.cr.mode!=="auto"&&(!((n=e.cr.instance)!=null&&n.trim())||!((i=e.cr.namespace)!=null&&i.trim())||!((r=e.cr.repository)!=null&&r.trim()))?bn.t("ui:deploymentResources.validation.cr"):e.codePipeline.mode!=="auto"&&(!((s=e.codePipeline.workspaceName)!=null&&s.trim())||!((o=e.codePipeline.pipelineName)!=null&&o.trim()))?bn.t("ui:deploymentResources.validation.codePipeline"):e.codePipeline.mode==="existing"&&(!((l=e.codePipeline.workspaceId)!=null&&l.trim())||!((c=e.codePipeline.pipelineId)!=null&&c.trim()))?bn.t("ui:deploymentResources.validation.existingCodePipeline"):null}function D9e({value:e,agentName:t,runtimeName:n,region:i,disabled:r,validationError:s,onChange:o}){const{t:l}=_e("ui"),c=t.trim()||"agentkit-app",u=n.trim()||c,d=i&&i!=="cn-beijing"?l("deploymentResources.autoBucketWithRegion",{region:i.startsWith("cn-")?i.slice(3):i}):l("deploymentResources.autoBucket"),f=Zf(e.tos.mode==="existing"?{kind:"tos-bucket",region:i}:null),h=Zf(e.cr.mode==="existing"?{kind:"cr-registry",region:i}:null),m=Zf(e.cr.mode==="existing"&&e.cr.instance?{kind:"cr-namespace",region:i,registry:e.cr.instance}:null),g=Zf(e.cr.mode==="existing"&&e.cr.instance&&e.cr.namespace?{kind:"cr-repository",region:i,registry:e.cr.instance,namespace:e.cr.namespace}:null),b=Zf(e.codePipeline.mode==="existing"?{kind:"cp-workspace",region:i}:null),v=Zf(e.codePipeline.mode==="existing"&&e.codePipeline.workspaceId?{kind:"cp-pipeline",region:i,workspaceId:e.codePipeline.workspaceId}:null),y=w=>o({...e,...w});return a.jsxs("div",{className:"pp-resource-list",children:[a.jsxs("div",{className:"pp-resource-item",children:[a.jsx("div",{className:"pp-resource-name",children:l("deploymentResources.tosBucket")}),a.jsxs("div",{className:"pp-resource-grid",children:[a.jsx(m6,{resource:l("deploymentResources.tosBucket"),value:e.tos.mode,disabled:r,onChange:w=>y({tos:{mode:w}})}),e.tos.mode==="create"&&a.jsx(G0,{label:l("deploymentResources.bucketName"),value:e.tos.bucket??"",placeholder:l("deploymentResources.bucketNamePlaceholder"),disabled:r,onChange:w=>y({tos:{...e.tos,bucket:w}})}),e.tos.mode==="existing"&&a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.existingBucket")}),a.jsx(Jf,{ariaLabel:l("deploymentResources.existingTosBucket"),value:e.tos.bucket??"",valueLabel:e.tos.bucket,state:f,disabled:r,onChange:w=>y({tos:{...e.tos,bucket:w.name}})})]}),e.tos.mode==="auto"&&a.jsx(g6,{items:[{label:l("deploymentResources.bucket"),name:d}],note:l("deploymentResources.accountIdResolved")})]})]}),a.jsxs("div",{className:"pp-resource-item",children:[a.jsx("div",{className:"pp-resource-name",children:l("deploymentResources.containerRegistry")}),a.jsxs("div",{className:"pp-resource-grid",children:[a.jsx(m6,{resource:"CR",value:e.cr.mode,disabled:r,onChange:w=>y({cr:{mode:w}})}),e.cr.mode==="create"&&a.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three",children:[a.jsx(G0,{label:l("deploymentResources.instanceName"),value:e.cr.instance??"",placeholder:l("deploymentResources.crInstance"),disabled:r,onChange:w=>y({cr:{...e.cr,instance:w}})}),a.jsx(G0,{label:l("deploymentResources.namespace"),value:e.cr.namespace??"",placeholder:l("deploymentResources.namespace"),disabled:r,onChange:w=>y({cr:{...e.cr,namespace:w}})}),a.jsx(G0,{label:l("deploymentResources.repository"),value:e.cr.repository??"",placeholder:l("deploymentResources.repository"),disabled:r,onChange:w=>y({cr:{...e.cr,repository:w}})})]}),e.cr.mode==="existing"&&a.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three",children:[a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.crInstance")}),a.jsx(Jf,{ariaLabel:l("deploymentResources.existingCrInstance"),value:e.cr.instance??"",valueLabel:e.cr.instance,state:h,disabled:r,valueField:"name",onChange:w=>y({cr:{mode:"existing",instance:w.name}})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.namespace")}),a.jsx(Jf,{ariaLabel:l("deploymentResources.existingCrNamespace"),value:e.cr.namespace??"",valueLabel:e.cr.namespace,state:m,disabled:r||!e.cr.instance,valueField:"name",onChange:w=>y({cr:{...e.cr,namespace:w.name,repository:void 0}})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.repository")}),a.jsx(Jf,{ariaLabel:l("deploymentResources.existingCrRepository"),value:e.cr.repository??"",valueLabel:e.cr.repository,state:g,disabled:r||!e.cr.namespace,valueField:"name",onChange:w=>y({cr:{...e.cr,repository:w.name}})})]})]}),e.cr.mode==="auto"&&a.jsx(g6,{items:[{label:l("deploymentResources.crInstance"),name:l("deploymentResources.autoRegistry")},{label:l("deploymentResources.namespace"),name:"agentkit"},{label:l("deploymentResources.repository"),name:l("deploymentResources.autoRepositoryName",{name:c})}],note:l("deploymentResources.registryNameNote")})]})]}),a.jsxs("div",{className:"pp-resource-item",children:[a.jsx("div",{className:"pp-resource-name",children:"CodePipeline"}),a.jsxs("div",{className:"pp-resource-grid",children:[a.jsx(m6,{resource:"CodePipeline",value:e.codePipeline.mode,disabled:r,onChange:w=>y({codePipeline:{mode:w}})}),e.codePipeline.mode==="create"&&a.jsxs("div",{className:"pp-resource-fields",children:[a.jsx(G0,{label:l("deploymentResources.workspaceName"),value:e.codePipeline.workspaceName??"",placeholder:l("deploymentResources.workspaceName"),disabled:r,onChange:w=>y({codePipeline:{...e.codePipeline,workspaceName:w}})}),a.jsx(G0,{label:l("deploymentResources.pipelineName"),value:e.codePipeline.pipelineName??"",placeholder:l("deploymentResources.pipelineName"),disabled:r,onChange:w=>y({codePipeline:{...e.codePipeline,pipelineName:w}})})]}),e.codePipeline.mode==="existing"&&a.jsxs("div",{className:"pp-resource-fields",children:[a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.workspace")}),a.jsx(Jf,{ariaLabel:l("deploymentResources.existingWorkspace"),value:e.codePipeline.workspaceId??"",valueLabel:e.codePipeline.workspaceName,state:b,disabled:r,onChange:w=>y({codePipeline:{mode:"existing",workspaceId:w.id,workspaceName:w.name}})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.compatiblePipeline")}),a.jsx(Jf,{ariaLabel:l("deploymentResources.existingPipeline"),value:e.codePipeline.pipelineId??"",valueLabel:e.codePipeline.pipelineName,state:v,disabled:r||!e.codePipeline.workspaceId,onChange:w=>y({codePipeline:{...e.codePipeline,pipelineId:w.id,pipelineName:w.name}})})]})]}),e.codePipeline.mode==="auto"&&a.jsx(g6,{items:[{label:l("deploymentResources.workspace"),name:"agentkit-cli-workspace"},{label:l("deploymentResources.pipeline"),name:u}],note:l("deploymentResources.pipelineNameNote")})]})]}),s&&a.jsx("p",{className:"pp-resource-validation",role:"alert",children:s})]})}const _Yt="https://console.volcengine.com/aidap/region:aidap+cn-beijing/",jYt="https://console.volcengine.com/vikingdb/openviking/region:openviking+cn-beijing/ov-6689fabdf032294/context-management?accountId=default&userId=default&projectName=default";function vK(e){return e==="byteplus"?10:20}function M9e(e,t){return{region:e,requestId:crypto.randomUUID(),name:"",description:"",maxInstance:vK(t)}}function bA(e){const t={...e};return Reflect.deleteProperty(t,"tosAccessKey"),Reflect.deleteProperty(t,"tosSecretKey"),t}function NYt(e){const t=bA(e);for(const n of Object.keys(t))(t[n]===void 0||t[n]==="")&&delete t[n];return t}function RYt(e,t){var n;try{const i=JSON.parse(sessionStorage.getItem(`mpa-create:${e}`)||"null");if(((n=i==null?void 0:i.input)==null?void 0:n.region)===e&&typeof i.input.requestId=="string"){if(i.submitted||i.taskId)return{...i,input:bA(i.input)};const r={...i.input,name:typeof i.input.name=="string"?i.input.name:"",maxInstance:i.input.maxInstance??vK(t)};return delete r.agentId,delete r.runtimeImage,delete r.workerImage,{...i,input:bA(r)}}}catch{}return{input:M9e(e,t)}}function IYt({region:e,cloudProvider:t="volcengine",onClose:n,onCreated:i}){var Ve,Ge,ye;const{t:r}=_e("ui"),s=oe=>`myAgents.mpaCreate.${oe}`,o=vK(t),[l]=p.useState(()=>RYt(e,t)),c=!!(l.step||l.input.name||l.input.description||l.input.agentId||l.input.pgHost||l.input.pgPort||l.input.openvikingUrl||l.input.openvikingResourceId||l.input.tosBucket),[u,d]=p.useState(l.input),[f,h]=p.useState(String(l.input.maxInstance??o)),[m,g]=p.useState(""),[b,v]=p.useState(l.submitted||l.taskId?2:Math.min(2,Math.max(0,l.step??0))),[y,w]=p.useState(l.taskId),[x,k]=p.useState(!!(l.submitted||l.taskId)),S=p.useRef(x);S.current=x;const[O,A]=p.useState(null),[E,j]=p.useState(null),[T,R]=p.useState(!0),[C,N]=p.useState(!1),[P,I]=p.useState(""),[D,_]=p.useState(0),[L,F]=p.useState(!1),M=p.useRef(!1),H=p.useRef(!1),q=p.useRef(!0),U=p.useRef(null),Z=p.useRef(!1),z=p.useRef(i);z.current=i;const J=(O==null?void 0:O.state)==="running"||(O==null?void 0:O.state)==="cancelling",W=x&&u.name===void 0&&!!u.agentId?null:i0((u.name??"").trim(),oe=>r(`validation.runtimeName.${oe}`,{ns:"create"})),X=!W,ce=x&&u.maxInstance===void 0,V=ce||f.trim()!==""&&Number.isSafeInteger(Number(f))&&Number(f)>=1,Y=(E==null?void 0:E.postgresMode)==="auto",K=(x?u.businessDatabaseName:E==null?void 0:E.businessDatabaseName)==="aidb",de=(x?u.businessWorkspaceMode:E==null?void 0:E.businessWorkspaceMode)==="per-agent",ee=Y?!u.pgHost&&!u.pgPort:EYt(u.pgHost,u.pgPort),Oe=u.openvikingMode==="auto",he=Oe||CYt(u.openvikingUrl,u.openvikingResourceId,m),ge=((Ve=u.tosBucket)==null?void 0:Ve.trim())??"",Se=!ge||ge.startsWith("agentkit-platform-")&&/^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/.test(ge),xe=C||x&&(!O||J||O.state==="succeeded"),Pe=Zf(b===2&&!xe?{kind:"tos-bucket",region:e,namePrefix:"agentkit-platform-"}:null);p.useEffect(()=>{if(!(x||y))try{sessionStorage.setItem(`mpa-create:${e}`,JSON.stringify({input:bA(u),step:b}))}catch{}},[u,b,e,x,y]);function Ue(oe){try{sessionStorage.setItem(`mpa-create:${e}`,JSON.stringify({input:bA(u),taskId:oe,submitted:!0,step:2}))}catch{}}function Ke(oe){const ie=NYt({requestId:oe.requestId,agentId:oe.agentId,name:oe.name,description:oe.description??"",maxInstance:oe.maxInstance??o,region:oe.region,runtimeImage:oe.runtimeImage,workerImage:oe.workerImage,pgHost:oe.pgHost,pgPort:oe.pgPort,openvikingUrl:oe.openvikingUrl,openvikingResourceId:oe.openvikingResourceId,openvikingMode:oe.openvikingMode,businessWorkspaceMode:oe.businessWorkspaceMode,businessDatabaseName:oe.businessDatabaseName,tosBucket:oe.tosBucket});d(ie),h(String(ie.maxInstance??o)),v(2),k(!0),w(oe.taskId),A(oe);try{sessionStorage.setItem(`mpa-create:${e}`,JSON.stringify({input:ie,taskId:oe.taskId,submitted:!0,step:2}))}catch{}}p.useEffect(()=>(q.current=!0,()=>{var oe;q.current=!1,(oe=U.current)==null||oe.abort()}),[]),p.useEffect(()=>{if(Z.current||y||l.taskId||c&&!x&&!l.submitted)return;Z.current=!0;const oe=new AbortController;return yYt(e,oe.signal).then(ie=>{if(oe.signal.aborted||!q.current)return;const Ae=ie.tasks.find(Re=>Re.requestId===u.requestId)??ie.tasks.find(Re=>Re.state!=="succeeded");Ae&&Ke(Ae)}).catch(()=>{}),()=>oe.abort()},[c,u.requestId,e,l.submitted,l.taskId,x,y]),p.useEffect(()=>{const oe=new AbortController;return R(!0),gYt(e,oe.signal).then(ie=>{oe.signal.aborted||(j(ie),ie.configured&&!S.current&&!l.submitted&&!l.taskId&&!M.current&&d(Ae=>({...Ae,...ie.businessDatabaseName==="aidb"?{businessDatabaseName:"aidb"}:{},...ie.businessWorkspaceMode==="per-agent"?{businessWorkspaceMode:"per-agent"}:{},...ie.openvikingMode==="auto"?{openvikingMode:"auto",openvikingUrl:void 0,openvikingResourceId:void 0}:{},pgHost:ie.postgresMode==="auto"?"":Ae.pgHost??ie.pgHost??"",pgPort:ie.postgresMode==="auto"?"":Ae.pgPort??ie.pgPort??""})))}).catch(()=>{oe.signal.aborted||I(r(s("loadFailed")))}).finally(()=>{oe.signal.aborted||R(!1)}),()=>oe.abort()},[e,D,t,r]),p.useEffect(()=>{if(!y)return;const oe=new AbortController;let ie;async function Ae(){try{const Re=await xYt(y,oe.signal);if(oe.signal.aborted)return;if(A(Re),I(""),Re.state==="succeeded"&&!H.current){H.current=!0;try{sessionStorage.removeItem(`mpa-create:${e}`)}catch{}z.current()}if(Re.state!=="running"&&Re.state!=="cancelling")return}catch{if(oe.signal.aborted)return;I(r(s("pollFailed")))}ie=setTimeout(Ae,2e3)}return Ae(),()=>{oe.abort(),clearTimeout(ie)}},[y,e,D,r]);function Me(oe){return oe instanceof Z7&&(oe.code==="runtimeNameTaken"||oe.code==="runtimeNameCheckFailed")?r(s(oe.code)):oe instanceof Error?oe.message:r(s("creationFailed"))}function re(oe){var ie;return((ie=oe.latestDiagnostic)==null?void 0:ie.category)==="configuration_changed"?"configurationChanged":oe.error||"creationFailed"}async function ue(){var ie;if(M.current||!X||!V)return;if(b!==0||x||u.businessDatabaseName!=="aidb"){v(Ae=>Ae+1);return}if(T||!(E!=null&&E.configured))return;M.current=!0,N(!0),I("");const oe=new AbortController;U.current=oe;try{const Ae=await vYt({requestId:u.requestId,agentId:u.agentId,name:(ie=u.name)==null?void 0:ie.trim(),region:e},oe.signal);if(!q.current||oe.signal.aborted)return;if(!Ae.available){I(r(s("runtimeNameTaken")));return}v(1)}catch(Ae){q.current&&!oe.signal.aborted&&I(Me(Ae))}finally{M.current=!1,q.current&&N(!1)}}async function be(){if(M.current||!(E!=null&&E.configured)||!X||!V||!ee||!he||!Se||b!==2||J||(O==null?void 0:O.state)==="succeeded")return;M.current=!0,N(!0);const oe=x;k(!0),I(""),Ue(y);const ie=new AbortController;U.current=ie;try{const Ae=await bYt({...u,...ce?{}:{maxInstance:Number(f)},...u.name===void 0?{}:{name:u.name.trim()},openvikingApiKey:m},ie.signal);if(!q.current||ie.signal.aborted)return;Ue(Ae.taskId),w(Ae.taskId),A(Ae),_(Re=>Re+1)}catch(Ae){q.current&&!ie.signal.aborted&&(Ae instanceof Z7&&(Ae.status===400||Ae.status===422||!oe&&(Ae.code==="runtimeNameTaken"||Ae.code==="runtimeNameCheckFailed"))&&k(!1),I(Me(Ae)))}finally{M.current=!1,q.current&&N(!1)}}async function Ce(){if(!y||M.current)return;F(!1),M.current=!0,N(!0);const oe=new AbortController;U.current=oe;try{const ie=await wYt(y,oe.signal);q.current&&!oe.signal.aborted&&A(ie)}catch{q.current&&!oe.signal.aborted&&I(r(s("cancelFailed")))}finally{M.current=!1,q.current&&N(!1)}}function Ee(){const oe={...M9e(e,t),...(E==null?void 0:E.businessDatabaseName)==="aidb"?{businessDatabaseName:"aidb"}:{},...(E==null?void 0:E.businessWorkspaceMode)==="per-agent"?{businessWorkspaceMode:"per-agent"}:{},...(E==null?void 0:E.openvikingMode)==="auto"?{openvikingMode:"auto"}:{},pgHost:Y?"":(E==null?void 0:E.pgHost)??"",pgPort:Y?"":(E==null?void 0:E.pgPort)??""};try{sessionStorage.setItem(`mpa-create:${e}`,JSON.stringify({input:oe,step:0}))}catch{}d(oe),h(String(o)),g(""),v(0),w(void 0),k(!1),A(null),I(""),F(!1),H.current=!1}return a.jsx(a.Fragment,{children:a.jsx(t0,{open:!0,onOpenChange:oe=>{!oe&&!C&&(L?F(!1):n())},children:a.jsxs(e0,{children:[a.jsx(Zv,{className:"studio-modal-button__backdrop mpa-create-backdrop"}),a.jsx(Jv,{className:"mpa-create-popup","aria-label":r(s("title")),children:a.jsx(_9e,{className:"mpa-create-dialog",title:r(s("title")),topGlow:!1,footer:null,onClose:()=>{C||n()},closeLabel:r(s("close")),children:a.jsxs("div",{className:"mpa-create-body",children:[a.jsx("ol",{className:"mpa-create-steps","aria-label":r(s("stepsLabel")),children:["basics","postgres","openviking"].map((oe,ie)=>a.jsx("li",{"aria-current":b===ie?"step":void 0,children:a.jsxs("button",{type:"button",disabled:C||ie>b&&!x&&(!X||!V||ie===2&&!ee),onClick:()=>v(ie),children:[a.jsx("span",{children:ie+1}),r(s(`steps.${oe==="postgres"&&Y?"autoPostgres":oe}`))]})},oe))}),b===0&&a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[r(s("region")),":",e]}),a.jsxs("label",{children:[r(s("name")),a.jsx("input",{name:"name",placeholder:r(s("namePlaceholder")),value:u.name??u.agentId??"",maxLength:64,disabled:C||x,required:!0,autoComplete:"off","aria-invalid":!!W,"aria-describedby":"mpa-name-help",onChange:oe=>{d({...u,name:oe.target.value}),I("")}}),a.jsx("p",{id:"mpa-name-help",role:W?"alert":void 0,children:W||r(s("nameHelp"))})]}),a.jsxs("label",{children:[r(s("description")),a.jsx(jIe,{className:"mpa-create-description",value:u.description,maxLength:512,disabled:C||x,onChange:oe=>d({...u,description:oe.target.value})})]}),!ce&&a.jsxs("label",{children:[r(s("maxInstance")),a.jsx("input",{name:"maxInstance",type:"number",min:1,max:Number.MAX_SAFE_INTEGER,step:1,value:f,disabled:C||x,required:!0,"aria-invalid":!V,"aria-describedby":"mpa-maximum-help",onChange:oe=>{const ie=oe.target.value;h(ie),d({...u,maxInstance:Number(ie)})}}),a.jsx("p",{id:"mpa-maximum-help",role:V?void 0:"alert",children:r(s(V?"maxInstanceHelp":"maxInstanceInvalid"),{maximum:o})})]}),a.jsxs("section",{className:"mpa-create-plan","aria-label":r(s("plan")),children:[a.jsx("strong",{children:r(s("plan"))}),a.jsxs("ul",{children:[a.jsx("li",{children:r(s("sharedResources"))}),a.jsx("li",{children:r(s("agentResources"))}),a.jsx("li",{children:r(s("readiness"))})]})]})]}),b===1&&a.jsxs(a.Fragment,{children:[a.jsx("p",{children:r(s(Y?K?"pgAidbDescription":de?"pgPerAgentDescription":"pgAutoDescription":(E==null?void 0:E.postgresLayout)==="split-workspaces"?"pgSplitDescription":"pgDescription"))}),a.jsx("a",{href:t==="byteplus"?"https://console.byteplus.com/aidap/":_Yt,target:"_blank",rel:"noopener noreferrer",children:r(s(t==="byteplus"?"pgConsoleByteplus":"pgConsole"))}),!Y&&a.jsxs(a.Fragment,{children:[a.jsxs("label",{children:[r(s("pgHost")),a.jsx("input",{name:"pgHost",value:u.pgHost??"",maxLength:255,disabled:C||x,"aria-invalid":!ee,onChange:oe=>d(ie=>({...ie,pgHost:oe.target.value}))})]}),a.jsxs("label",{children:[r(s("pgPort")),a.jsx("input",{name:"pgPort",value:u.pgPort??"",inputMode:"numeric",maxLength:5,disabled:C||x,"aria-invalid":!ee,onChange:oe=>d(ie=>({...ie,pgPort:oe.target.value}))})]}),!ee&&a.jsx("p",{role:"alert",children:r(s("pgInvalid"))}),a.jsx("p",{children:r(s("pgCredentials"))})]})]}),b===2&&a.jsxs(a.Fragment,{children:[a.jsx("p",{children:r(s(Oe?t==="byteplus"?"openvikingAutoByteplusDescription":"openvikingAutoDescription":"openvikingDescription"))}),a.jsx("a",{href:t==="byteplus"?"https://console.byteplus.com/vikingdb/":Oe?"https://console.volcengine.com/vikingdb/openviking/region:openviking+cn-beijing/":jYt,target:"_blank",rel:"noopener noreferrer",children:r(s(t==="byteplus"?"openvikingConsoleByteplus":"openvikingConsole"))}),Oe?a.jsx("p",{children:r(s(t==="byteplus"?"openvikingAutoByteplusRequirements":"openvikingAutoBilling"))}):a.jsxs(a.Fragment,{children:[a.jsxs("label",{children:[r(s("openvikingUrl")),a.jsx("input",{name:"openvikingUrl",value:u.openvikingUrl??"",maxLength:1024,disabled:C||x,autoComplete:"off",spellCheck:!1,"aria-invalid":!he,onChange:oe=>d(ie=>({...ie,openvikingUrl:oe.target.value}))})]}),a.jsxs("label",{children:[r(s("openvikingResourceId")),a.jsx("input",{name:"openvikingResourceId",value:u.openvikingResourceId??"",maxLength:128,disabled:C||x,autoComplete:"off",spellCheck:!1,"aria-invalid":!he,onChange:oe=>d(ie=>({...ie,openvikingResourceId:oe.target.value}))})]}),a.jsxs("label",{children:[r(s("openvikingApiKey")),a.jsx("input",{type:"password",name:"openvikingApiKey",value:m,maxLength:512,disabled:C||J||(O==null?void 0:O.state)==="succeeded",autoComplete:"off",spellCheck:!1,onChange:oe=>g(oe.target.value)})]}),!he&&a.jsx("p",{role:"alert",children:r(s("openvikingInvalid"))}),a.jsx("p",{children:r(s("openvikingCredentials"))})]}),a.jsxs("fieldset",{className:"mpa-create-tos",children:[a.jsx("legend",{children:r(s("tosTitle"))}),a.jsx("p",{children:r(s("tosDescription"))}),a.jsxs("div",{children:[a.jsx("span",{children:r(s("tosBucket"))}),a.jsx(Jf,{ariaLabel:r(s("tosBucket")),value:ge,valueLabel:ge,valueField:"name",state:Pe,disabled:xe,onChange:oe=>d(ie=>({...ie,tosBucket:oe.name}))})]}),ge&&a.jsx(ki,{variant:"outline",disabled:xe,onClick:()=>d(oe=>({...oe,tosBucket:""})),children:r(s("tosDisable"))}),!Se&&a.jsx("p",{role:"alert",children:r(s("tosInvalid"))}),a.jsx("p",{children:r(s("tosCredentials"))})]})]}),T?a.jsx("p",{role:"status",children:r(s("checking"))}):E!=null&&E.configured?a.jsx("p",{children:r(s("configured"))}):a.jsxs("div",{role:"alert",children:[a.jsx("p",{children:r(s("notConfigured"))}),a.jsx("p",{children:E!=null&&E.postgresMigrationRequired?r(s("pgMigrationRequired")):E==null?void 0:E.error}),a.jsx(ki,{variant:"outline",onClick:()=>_(oe=>oe+1),children:r(s("reload"))})]}),O&&a.jsxs("section",{"aria-live":"polite",children:[a.jsx("strong",{children:r(s(`states.${O.state}`))}),O.state!=="succeeded"&&a.jsx("p",{children:r(s(`stages.${O.stage}`),{defaultValue:O.stage})}),O.state==="failed"||O.state==="cancelled"?O.error==="runtimeNameTaken"?a.jsx(vh,{color:"danger",variant:"soft",description:r(s(O.error))}):a.jsx("p",{children:r(s(re(O)))}):null,((Ge=O.result)==null?void 0:Ge.runtime_id)&&a.jsxs("p",{children:["Runtime ID:",O.result.runtime_id]}),((ye=O.result)==null?void 0:ye.skill_space_id)&&a.jsxs("p",{children:[r(s("skillSpace")),":",O.result.skill_space_id]})]}),Y&&!ee&&a.jsx("p",{role:"alert",children:r(s("pgModeChanged"))}),P&&a.jsx(vh,{color:"danger",variant:"soft",description:P}),J&&a.jsx("p",{children:r(s("background"))}),x&&a.jsx("p",{children:r(s("newAgentDescription"))}),L?a.jsxs("section",{role:"alertdialog","aria-label":r(s("cancel")),className:"mpa-create-plan",children:[a.jsx("p",{children:r(s("cancelDescription"))}),a.jsxs("div",{className:"mpa-create-actions",children:[a.jsx(ki,{autoFocus:!0,variant:"outline",onClick:()=>F(!1),children:r(s("back"))}),a.jsx(ki,{onClick:()=>void Ce(),children:r(s("confirmCancel"))})]})]}):a.jsxs("div",{className:"mpa-create-actions",children:[a.jsx(ki,{variant:"outline",disabled:C,onClick:n,children:r(s("close"))}),x&&a.jsx(ki,{variant:"outline",disabled:C||T,onClick:Ee,children:r(s("newAgent"))}),b>0&&a.jsx(ki,{variant:"outline",disabled:C,onClick:()=>v(oe=>oe-1),children:r(s("previousStep"))}),J?a.jsx(ki,{variant:"outline",disabled:C||(O==null?void 0:O.state)==="cancelling",onClick:()=>F(!0),children:r(s("cancel"))}):(O==null?void 0:O.state)!=="succeeded"&&b<2?a.jsx(ki,{disabled:C||b===0&&(!X||!V)||b===1&&!ee,onClick:()=>void ue(),loading:C,children:r(s("next"))}):(O==null?void 0:O.state)!=="succeeded"?a.jsx(ki,{loading:C,disabled:T||!(E!=null&&E.configured)||!X||!V||!ee||!he||!Se,onClick:()=>void be(),children:r(s(O||x?"retry":"submit"))}):null]})]})})})]})})})}const PYt=["general","mpa","codex","deepseek-harness","openclaw","hermes"];function DYt(e){return e!=="general"&&e!=="mpa"}const MYt=24,LYt=3e4,$Yt=7e3,FYt=2e4,BYt=6,UYt=2,QYt=250,wg=new Map,jw=new Map,zYt=new Set;function Yb(e){const t=e.runtime;return t?`${t.region}:${t.runtimeId}:${t.currentVersion??""}`:""}function tle(e,t){const n=e instanceof Error&&e.message.trim()?e.message.trim():t("myAgents.compatibility.unknownError");return{status:e instanceof Ea&&e.unsupported?"unsupported":"error",message:n}}function Ym(e){if(!e){wg.clear(),jw.clear(),W8();return}const t=new Set(e);if(t.size!==0){for(const[n,i]of jw)i.page.runtimes.some(r=>t.has(r.runtimeId))&&jw.delete(n);for(const n of t)W8(n);wg.clear()}}function VYt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function HYt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8.313 3.646a.5.5 0 0 1 .707 0l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 1 1-.707-.708L11.46 8.5H3.333a.5.5 0 0 1 0-1h8.127L8.313 4.354a.5.5 0 0 1 0-.708Z",fill:"currentColor"})})}function qYt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M2.75 5.25h8.75m0 0-2-2m2 2-2 2M13.25 10.75H4.5m0 0 2 2m-2-2 2-2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function WYt({type:e}){return e==="general"||e==="mpa"?a.jsx(_p,{}):a.jsx(gA,{kind:e})}function KYt(e,t=Date.now(),n){const i=Date.parse(e);if(!Number.isFinite(i)||i-t<6e4)return n("myAgents.expiringSoon");const r=Math.ceil((i-t)/6e4),s=Math.floor(r/60),o=r%60;return n("myAgents.sandboxRemaining",{hours:s,minutes:o})}function nle(e,t,n="general"){var r;const i=e.agentCategory??n;return{id:e.runtimeId,name:e.name,description:((r=e.description)==null?void 0:r.trim())||t("common.noDescription"),createdAt:e.createdAt??"",specificationLabel:t("myAgents.creator"),specification:eLe(e.author),isMine:e.isMine,agentCategory:i,runtime:{runtimeId:e.runtimeId,mpaInstanceId:e.mpaInstanceId,region:e.region,currentVersion:e.currentVersion,agentCategory:e.agentCategory??n,canDelete:e.canDelete,canManage:e.canManage,canPublish:e.canPublish,visibility:e.visibility,reviewStatus:e.reviewStatus}}}function GYt(e,t){const n=PD(e.status);return{id:e.id,name:e.displayName||t("myAgents.namedAgent",{name:e.toolName}),description:t(`myAgents.sandboxStatus.${n}`,{defaultValue:t("myAgents.sandboxStatus.unknown")}),createdAt:e.createdAt,specificationLabel:t("myAgents.creator"),specification:eLe(e.createdBy),isMine:e.isMine,region:e.region,sandbox:e}}function XYt(e,t){var n,i;return{id:e.id,name:e.draft.name||t("agentSelector.unnamedAgent"),description:((n=e.draft.description)==null?void 0:n.trim())||t("common.noDescription"),createdAt:new Date(e.updatedAt).toISOString(),specificationLabel:t("myAgents.storageLocation"),specification:t("myAgents.currentBrowser"),isMine:!0,region:(i=e.deploymentTarget)==null?void 0:i.region,agentCategory:_w(e.deploymentTarget),draft:e}}function YYt(e,t,n){if(!e.draft)return e;const i=e.draft.deploymentTarget;return i?t.find(r=>{var s;return((s=r.runtime)==null?void 0:s.runtimeId)===i.runtimeId&&r.runtime.region===i.region})??{id:i.runtimeId,appName:i.appName,name:i.name||e.name,description:e.description,createdAt:e.createdAt,specificationLabel:n("myAgents.region"),specification:i.region,isMine:!0,runtime:{runtimeId:i.runtimeId,agentCategory:_w(i),mpaInstanceId:i.mpaInstanceId,region:i.region,currentVersion:i.currentVersion,canDelete:!1}}:null}function ZYt(e,t){return e.trim()||nr(t)}async function JYt(e,t,n,i,r,s,o){const l=`${e}:${t}:${n}:${i}`,c=jw.get(l);if(c&&c.expiresAt>Date.now())return r(c.page.runtimes.map(f=>nle(f,s,e))),c.page.nextToken;c&&jw.delete(l);let u=wg.get(l);u||(u=zXt({agentCategory:e,scope:t,region:n,pageSize:MYt,nextToken:i,signal:o}),wg.set(l,u),u.then(()=>wg.delete(l),()=>wg.delete(l)));const d=await u;return jw.set(l,{page:d,expiresAt:Date.now()+LYt}),r(d.runtimes.map(f=>nle(f,s,e))),d.nextToken}function eZt({agent:e,onReview:t,onUse:n,onViewDetails:i,onPrepareUpdate:r,compatibility:s,onRetryCompatibility:o,connecting:l,connectError:c,connected:u,deploymentTask:d,nowMs:f,onViewDeploymentTask:h,onEditDraft:m,onDeleteDraft:g}){var R,C,N,P;const{t:b,i18n:v}=_e("ui"),y=(R=e.sandbox)==null?void 0:R.status.toLowerCase(),w=((C=e.sandbox)==null?void 0:C.resourceType)==="snapshot",x=!!(e.runtime||y==="ready"||y==="wakeable"),k=(s==null?void 0:s.status)==="checking",S=(s==null?void 0:s.status)==="unsupported",O=(s==null?void 0:s.status)==="error",A=((N=e.sandbox)==null?void 0:N.resourceType)==="snapshot"?e.sandbox.sourceSessionId||e.sandbox.snapshotId:(P=e.sandbox)==null?void 0:P.id,E=()=>{if(e.draft){d?h==null||h(d):i==null||i(e);return}!x&&!e.sandbox||(d?h==null||h(d):i==null||i(e))},j=(e.draft||x||!!e.sandbox)&&!!(d?h:i),T=e.draft?d?b("myAgents.viewDeploymentProgress",{name:e.name}):b("myAgents.viewRuntimeDetails",{name:e.name}):d?b("myAgents.viewDeploymentProgress",{name:e.name}):b("myAgents.viewDetails",{name:e.name});return a.jsxs(xH,{className:`my-agent-card${l?" is-connecting":""}${e.runtime?" has-review":""}`,activateLabel:j?T:void 0,onActivate:j?E:void 0,onPointerEnter:()=>r==null?void 0:r(e),onFocusCapture:()=>r==null?void 0:r(e),footer:a.jsxs("div",{className:"my-agent-card-footer",children:[a.jsx(nPe,{className:"my-agent-meta",items:[{label:e.specificationLabel,value:e.specification,hideLabel:!0,className:"my-agent-region"},{label:b("myAgents.time"),value:zT(e.createdAt,f,v.resolvedLanguage??v.language),hideLabel:!0,className:"my-agent-created-at"},...e.sandbox?[{label:b("myAgents.remainingTime"),value:e.sandbox.resourceType==="snapshot"||e.sandbox.persistent?b("myAgents.neverExpires"):KYt(e.sandbox.expireAt,f,b),className:`my-agent-expiry${e.sandbox.resourceType==="snapshot"||e.sandbox.persistent?"":" is-expiring"}`}]:[]]}),e.runtime?a.jsxs("div",{className:"agent-review-card-controls",children:[a.jsx("span",{className:"agent-review-card-status",children:b(e.runtime.visibility==="enterprise"?"enterprise":"private",{ns:"agentReviews"})}),e.runtime.canManage?a.jsxs(CN,{className:"agent-review-card-action",onClick:I=>{I.stopPropagation(),t==null||t(e)},children:[b(e.runtime.reviewStatus?"details":e.runtime.canPublish?"publish":"submit",{ns:"agentReviews"}),e.runtime.reviewStatus?` · ${b(`status.${e.runtime.reviewStatus}`,{ns:"agentReviews"})}`:""]}):null]}):null]}),actions:e.draft?a.jsxs(a.Fragment,{children:[a.jsx(CN,{"aria-label":d?b("myAgents.viewDeploymentProgress",{name:e.name}):b("myAgents.editDraftNamed",{name:e.name}),onClick:()=>d?h==null?void 0:h(d):m==null?void 0:m(e.draft),children:b(d?"myAgents.viewProgress":"common.edit")}),a.jsx(CN,{tone:"danger","aria-label":b("myAgents.deleteDraftNamed",{name:e.name}),onClick:()=>g==null?void 0:g(e.draft),children:b("common.delete")})]}):O||S?a.jsxs(Tt,{type:"button",color:"primary",size:"sm",pill:!1,"aria-label":b("myAgents.recheckCompatibility",{name:e.name}),onClick:()=>o==null?void 0:o(e),children:[a.jsx(YD,{}),b("common.retry")]}):a.jsx(MB,{className:u?"my-agent-use is-connected":"my-agent-use",disabled:!x||k||S||l||u,"aria-busy":l||void 0,label:u?b("myAgents.connectedNamed",{name:e.name}):w?b("myAgents.wakeAndChat",{name:e.name}):b("myAgents.chatWith",{name:e.name}),onClick:()=>void(n==null?void 0:n(e)),children:l?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-use-spinner","aria-hidden":"true"}),a.jsx("span",{className:"sr-only",children:b(w?"myAgents.waking":"agentSelector.connecting")})]}):a.jsx(HYt,{})}),children:[a.jsx(wH,{leading:a.jsx(r1,{seed:e.name}),title:e.name,subtitle:e.sandbox?a.jsx("span",{className:"my-agent-session-id",title:A,children:A}):void 0,status:e.draft?d?a.jsx("span",{className:"my-agent-deploying-badge",children:b("myAgents.deploying")}):a.jsx("span",{className:"my-agent-draft-badge",children:b("myAgents.draft")}):e.sandbox?a.jsx("span",{className:"my-agent-status-label","data-ready":PD(e.sandbox.status)==="ready"||void 0,children:e.description}):e.runtime&&d?a.jsx("span",{className:"my-agent-deploying-badge",children:b("myAgents.deploying")}):k?a.jsx(Ca,{content:s==null?void 0:s.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:a.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:a.jsxs(Za,{className:"my-agent-compatibility-status",color:"secondary",variant:"soft",size:"sm",pill:!0,children:[a.jsx("span",{className:"my-agent-compatibility-spinner","aria-hidden":"true"}),a.jsx("span",{children:b("myAgents.checking")})]})})}):S?a.jsx(Ca,{content:s==null?void 0:s.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:a.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:a.jsx(Za,{className:"my-agent-compatibility-status",color:"warning",variant:"soft",size:"sm",pill:!0,children:b("myAgents.chatUnsupported")})})}):O?a.jsx(Ca,{content:s==null?void 0:s.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:a.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:a.jsx(Za,{className:"my-agent-compatibility-status",color:"danger",variant:"soft",size:"sm",pill:!0,children:b("myAgents.checkFailed")})})}):null}),c?a.jsx(Ca,{content:c,contentClassName:"my-agent-error-tooltip",maxWidth:360,interactive:!0,children:a.jsx("p",{className:"my-agent-wake-note",role:"alert",tabIndex:0,children:c})}):null,w&&l?a.jsx("p",{className:"my-agent-wake-note",role:"status",children:a.jsx(on,{children:b("myAgents.wakingHint")})}):null,e.sandbox?null:a.jsx(kH,{children:e.description})]})}function tZt({cloudProvider:e,studioRegion:t,canCreateRuntimeAgents:n,canCreatePersonalAgents:i,canUpdate:r,runtimeScope:s,onCreateAgent:o,onOpenCodexProjectUpload:l,onUseAgent:c,onViewAgentDetails:u,onCreateSandboxAgent:d,onUseSandboxAgent:f,onViewSandboxAgentDetails:h,activeType:m,onActiveTypeChange:g,sandboxRefreshKey:b=0,connectedRuntimeId:v="",hiddenRuntimeIds:y=zYt,drafts:w=[],deploymentTasks:x=[],draftDeploymentTaskIds:k={},onViewDeploymentTask:S,onEditDraft:O,onDeleteDraft:A}){const{t:E}=_e("ui"),j=p.useRef(null),T=p.useRef(null),R=p.useRef(0),C=p.useRef(null),N=p.useRef(0),P=p.useRef(null),I=p.useRef(new Map),D=ZYt(t,e),[_,L]=p.useState(null),[F,M]=p.useState(""),[H,q]=p.useState(s==="mine"?"mine":"all"),[U,Z]=p.useState(D),[z,J]=p.useState(null),[ne,W]=p.useState([]),[X,ce]=p.useState(""),[V,Y]=p.useState(!0),[K,de]=p.useState(""),[ee,Oe]=p.useState([]),[he,ge]=p.useState(!1),[Se,xe]=p.useState(""),[Pe,Ue]=p.useState(""),[Ke,Me]=p.useState({}),[re,ue]=p.useState({}),[be,Ce]=p.useState(null),[Ee,Ve]=p.useState(()=>Date.now()),Ge=p.useMemo(()=>PYt.map(We=>({value:We,label:E(`myAgents.agentTypes.${We}`)})),[E]),ye=p.useMemo(()=>{const We=Pu(e);return We.some(ot=>ot.value===D)?We:[{value:D,label:D},...We]},[e,D]);p.useEffect(()=>{s==="mine"&&q("mine")},[s]),p.useEffect(()=>{Z(D)},[D]),p.useEffect(()=>{Ve(Date.now());const We=window.setInterval(()=>Ve(Date.now()),1e3);return()=>window.clearInterval(We)},[]);const oe=p.useMemo(()=>w.filter(We=>_w(We.deploymentTarget)===m).map(We=>XYt(We,E)),[w,m,E]),ie=p.useMemo(()=>{const We=new Map,ot=new Map,it=new Map;for(const tt of x){if(tt.status!=="running")continue;if(We.set(tt.id,tt),tt.draftId){const Ot=ot.get(tt.draftId);(!Ot||tt.startedAt>Ot.startedAt)&&ot.set(tt.draftId,tt)}if(!tt.runtimeId)continue;const At=it.get(tt.runtimeId);(!At||tt.startedAt>At.startedAt)&&it.set(tt.runtimeId,tt)}return{byId:We,byDraftId:ot,byRuntimeId:it}},[x]),Ae=p.useCallback(We=>{var it;if(We.draft){const tt=k[We.draft.id];return ie.byDraftId.get(We.draft.id)??(tt?ie.byId.get(tt):void 0)}const ot=(it=We.runtime)==null?void 0:it.runtimeId;return ot?ie.byRuntimeId.get(ot):void 0},[ie,k]),Re=p.useCallback((We,ot)=>{var Ot;(Ot=C.current)==null||Ot.abort(),wg.clear();const it=new AbortController;C.current=it;const tt=++R.current;return Y(!0),de(""),JYt(m==="mpa"?"mpa":"general",H,U,We,Ut=>{R.current===tt&&W(Mt=>ot?Ut:[...Mt,...Ut])},E,it.signal).then(Ut=>{R.current===tt&&ce(Ut)}).catch(Ut=>{R.current===tt&&(Goe(Ut)||de(wy(Ut,E("myAgents.loadGeneralAgents"),"GET /web/runtimes")))}).finally(()=>{R.current===tt&&Y(!1),C.current===it&&(C.current=null)})},[m,H,U,E]);p.useEffect(()=>{if(!(m!=="general"&&m!=="mpa"))return W([]),ce(""),Re("",!0),()=>{var We;(We=C.current)==null||We.abort(),C.current=null,wg.clear(),R.current+=1}},[m,Re]),p.useEffect(()=>{if(m!=="general"&&m!=="mpa"){for(const it of I.current.values())it.abort();I.current.clear();return}const We=new Set(ne.filter(it=>{var tt,At;return((tt=it.runtime)==null?void 0:tt.runtimeId)!==v&&((At=it.runtime)==null?void 0:At.region)===U}).map(Yb).filter(Boolean));for(const[it,tt]of I.current)We.has(it)||(tt.abort(),I.current.delete(it));const ot=ne.filter(it=>{var Ut,Mt,Ze;const tt=(Ut=it.runtime)==null?void 0:Ut.runtimeId;if(!tt||tt===v||((Mt=it.runtime)==null?void 0:Mt.region)!==U)return!1;const At=Yb(it),Ot=(Ze=re[At])==null?void 0:Ze.status;return!I.current.has(At)&&(!Ot||Ot==="checking")});for(const it of ot)I.current.set(Yb(it),new AbortController);ue(it=>{var Ot,Ut;let tt=!1;const At={...it};for(const Mt of ne){const Ze=Yb(Mt);if(!Ze)continue;const bt=((Ot=Mt.runtime)==null?void 0:Ot.runtimeId)===v;bt&&((Ut=At[Ze])==null?void 0:Ut.status)!=="compatible"?(At[Ze]={status:"compatible",message:E("myAgents.compatibility.supported")},tt=!0):!bt&&!At[Ze]&&(At[Ze]={status:"checking",message:E("myAgents.compatibility.checking")},tt=!0)}return tt?At:it}),VXt(ot,async it=>{const tt=it.runtime;if(!tt)return;const At=Yb(it),Ot=I.current.get(At);if(Ot)try{const Ut=await Xw(tt.runtimeId,tt.region,{signal:Ot.signal,preferCached:!0,timeoutMs:$Yt,currentVersion:tt.currentVersion});if(Ot.signal.aborted)return;ue(Mt=>({...Mt,[At]:Ut&&Ut.length>0?{status:"compatible",message:E("myAgents.compatibility.supported")}:{status:"unsupported",message:E("myAgents.compatibility.empty")}}))}catch(Ut){if(Ot.signal.aborted||(Ut==null?void 0:Ut.name)==="AbortError")return;ue(Mt=>({...Mt,[At]:tle(Ut,E)}))}finally{I.current.get(At)===Ot&&I.current.delete(At)}})},[m,v,U,ne,E]),p.useEffect(()=>()=>{var We;(We=C.current)==null||We.abort();for(const ot of I.current.values())ot.abort();I.current.clear()},[]);const St=p.useCallback(async We=>{var tt;(tt=P.current)==null||tt.abort();const ot=new AbortController;P.current=ot;const it=++N.current;ge(!0),xe(""),Oe([]);try{const At=We==="codex"?await Hr.listSessions({signal:ot.signal,autoResumeSnapshots:!1}):await Hr.listAgentSessions(We,{signal:ot.signal,autoResumeSnapshots:!1});if(N.current!==it)return;Oe(At.map(Ot=>GYt(Ot,E)))}catch(At){if((At==null?void 0:At.name)==="AbortError"||N.current!==it)return;xe(wy(At,E("myAgents.loadAgentType",{type:E(`myAgents.agentTypes.${We}`)}),`GET /web/${We==="codex"?"sandbox":We}/sessions`))}finally{P.current===ot&&(P.current=null),N.current===it&&ge(!1)}},[E]);function Nt(We){var ot;We!==m&&(We==="general"||We==="mpa"?(R.current+=1,W([]),ce(""),de(""),Y(!0)):((ot=P.current)==null||ot.abort(),P.current=null,N.current+=1,Oe([]),xe(""),ge(!0)),g(We))}function Dt(){m!=="general"&&m!=="mpa"||(R.current+=1,W([]),ce(""),de(""),Y(!0))}function Et(We){We!==H&&(Dt(),q(We))}function $t(We){We!==U&&(Dt(),Z(We))}p.useEffect(()=>{var We;if(m==="general"||m==="mpa"){(We=P.current)==null||We.abort(),P.current=null,N.current+=1;return}return St(m),()=>{var ot;(ot=P.current)==null||ot.abort(),P.current=null,N.current+=1}},[m,St,b]),p.useEffect(()=>{const We=T.current,ot=j.current;if(!We||!ot||m!=="general"&&m!=="mpa"||!X||V)return;const it=new IntersectionObserver(([tt])=>{tt.isIntersecting&&Re(X,!1)},{root:ot,rootMargin:"240px 0px",threshold:.01});return it.observe(We),()=>it.disconnect()},[m,Re,V,X]);const He=p.useCallback(async We=>{if(!Pe){Ue(We.id),Me(ot=>({...ot,[We.id]:""}));try{await new Promise(ot=>requestAnimationFrame(()=>ot())),We.sandbox?await f(We.sandbox):await c(We)}catch(ot){Me(it=>({...it,[We.id]:ot instanceof Error?ot.message:String(ot)}))}finally{Ue("")}}},[Pe,c,f]),yt=p.useCallback(async We=>{var At;const ot=We.runtime;if(!ot)return;const it=Yb(We);ue(Ot=>({...Ot,[it]:{status:"checking",message:E("myAgents.compatibility.checking")}})),(At=I.current.get(it))==null||At.abort();const tt=new AbortController;I.current.set(it,tt);try{const Ot=await p9e(()=>Xw(ot.runtimeId,ot.region,{retryProbe:!0,signal:tt.signal,timeoutMs:FYt,currentVersion:ot.currentVersion}));if(tt.signal.aborted)return;ue(Ut=>({...Ut,[it]:Ot&&Ot.length>0?{status:"compatible",message:E("myAgents.compatibility.supported")}:{status:"unsupported",message:E("myAgents.compatibility.empty")}}))}catch(Ot){if(tt.signal.aborted||Goe(Ot))return;ue(Ut=>({...Ut,[it]:tle(Ot,E)}))}finally{I.current.get(it)===tt&&I.current.delete(it)}},[E]),je=p.useCallback(We=>{const ot=We.runtime;!r||!ot||Ae(We)||q8({runtimeId:ot.runtimeId,region:ot.region,appName:We.appName,currentVersion:ot.currentVersion})},[r,Ae]),kt=p.useMemo(()=>{const We=F.trim().toLocaleLowerCase(),ot=m==="general"||m==="mpa"?[...oe,...ne]:ee,tt=(H==="mine"?ot.filter(Mt=>Mt.isMine):ot).filter(Mt=>{var bt;const Ze=((bt=Mt.runtime)==null?void 0:bt.region)??Mt.region;return!Ze||Ze===U}),At=We?tt.filter(Mt=>Mt.name.toLocaleLowerCase().includes(We)):tt;if(m!=="general"&&m!=="mpa")return At;const Ot=y.size>0?At.filter(Mt=>!Mt.runtime||!y.has(Mt.runtime.runtimeId)):At,Ut=Ot.findIndex(Mt=>{var Ze;return((Ze=Mt.runtime)==null?void 0:Ze.runtimeId)===v});return Ut<=0?Ot:[Ot[Ut],...Ot.slice(0,Ut),...Ot.slice(Ut+1)]},[m,v,oe,y,F,H,U,ne,ee]);p.useEffect(()=>{if(!r||m!=="general"&&m!=="mpa")return;const We=kt.filter(Ot=>!!Ot.runtime).filter(Ot=>!Ae(Ot)).slice(0,BYt);if(We.length===0)return;let ot=!1,it=0;const tt=async()=>{for(;!ot;){const Ot=We[it];if(it+=1,!(Ot!=null&&Ot.runtime)||(await q8({runtimeId:Ot.runtime.runtimeId,region:Ot.runtime.region,appName:Ot.appName,currentVersion:Ot.runtime.currentVersion}),ot))return}},At=window.setTimeout(()=>{for(let Ot=0;Ot{ot=!0,window.clearTimeout(At)}},[m,r,Ae,kt]);const _t=E(`myAgents.agentTypes.${m}`,{defaultValue:E("myAgents.agent")}),fn=m==="general"||m==="mpa"?V&&ne.length===0&&oe.length===0:he&&ee.length===0,tn=!fn&&kt.length===0;let qe;m==="general"&&n?qe=()=>o(U,"general"):m==="mpa"&&n?qe=()=>J(U):DYt(m)&&i&&(qe=()=>d(m));const vt=m==="codex"&&i&&!!l;return a.jsxs(Ch,{className:"my-agents-page","aria-label":E("myAgents.agent"),children:[a.jsx(Qv,{title:E("myAgents.agent"),className:"my-agents-header"}),a.jsxs(ib,{className:"my-agent-toolbar",children:[a.jsx(rb,{idPrefix:"my-agent-ownership",ariaLabel:E("myAgents.creatorFilter"),value:H,items:[{id:"all",label:E("common.all"),disabled:s==="mine"},{id:"mine",label:E("agentSelector.createdByMe")}],onChange:Et}),a.jsxs("div",{className:"resource-toolbar__actions",children:[a.jsx(sb,{id:"my-agent-type-filter",ariaLabel:E("myAgents.agentType"),value:m,options:Ge,onChange:Nt}),a.jsx(sb,{id:"my-agent-region-filter",ariaLabel:E("myAgents.region"),value:U,options:ye,onChange:$t}),a.jsx(em,{className:"my-agent-search","aria-label":E("myAgents.searchAgents"),value:F,onChange:We=>M(We.target.value),placeholder:E("common.search")}),vt?a.jsxs("button",{type:"button",className:"my-agent-create-secondary",onClick:l,children:[a.jsx(qYt,{}),a.jsx("span",{children:E("myAgents.handoff")})]}):null]})]}),a.jsxs(tm,{className:"my-agent-results",ref:j,"aria-label":E("myAgents.agentList",{type:_t}),children:[fn?a.jsx(fl,{}):(m==="general"||m==="mpa"?K:Se)&&kt.length===0?a.jsxs("div",{className:"my-agent-empty",role:"alert",children:[a.jsx("p",{children:m==="general"||m==="mpa"?K:Se}),a.jsx("button",{type:"button",onClick:()=>{m==="general"||m==="mpa"?Re("",!0):St(m)},children:E("common.reload")})]}):tn&&!qe?F.trim()||H==="mine"||U!==D?a.jsx("div",{className:"my-agent-empty-message",children:a.jsxs(qn,{fill:"none",children:[a.jsx(qn.Icon,{children:a.jsx(lat,{})}),a.jsx(qn.Title,{children:E("myAgents.noMatchingAgents")}),a.jsx(qn.Description,{children:E("myAgents.adjustSearch")})]})}):m!=="general"?a.jsx("div",{className:"my-agent-empty-message",children:a.jsxs(qn,{fill:"none",children:[a.jsx(qn.Icon,{children:a.jsx(WYt,{type:m})}),a.jsx(qn.Title,{className:"my-agent-sandbox-empty-title",children:E("myAgents.noAgentType",{type:_t})})]})}):a.jsx("div",{className:"my-agent-empty-message",children:a.jsxs(qn,{fill:"none",children:[a.jsx(qn.Icon,{children:a.jsx(_p,{})}),a.jsx(qn.Title,{children:E("myAgents.noGeneralAgents")}),a.jsx(qn.Description,{children:E("myAgents.createGeneralAgentDescription")})]})}):a.jsxs(a.Fragment,{children:[(m==="general"||m==="mpa")&&K?a.jsxs("div",{className:"my-agent-inline-error",role:"alert",children:[a.jsx("span",{children:K}),a.jsx("button",{type:"button",onClick:()=>void Re("",!0),children:E("common.reload")})]}):null,a.jsxs(zv,{className:"my-agent-grid",children:[qe?a.jsx(ab,{className:"my-agent-create-card","aria-label":E("myAgents.createAgentType",{type:_t}),onClick:qe,icon:a.jsx(VYt,{}),children:E(m==="mpa"?"myAgents.mpaCreate.title":"myAgents.createAgent")}):null,kt.map(We=>{var it,tt,At,Ot,Ut;const ot=YYt(We,ne,E);return a.jsx(eZt,{agent:We,onReview:L,deploymentTask:Ae(We),nowMs:Ee,onViewDeploymentTask:S,onUse:He,compatibility:We.runtime?re[Yb(We)]??{status:"checking",message:E("myAgents.compatibility.checking")}:void 0,onRetryCompatibility:yt,onPrepareUpdate:((it=We.runtime)==null?void 0:it.canManage)===!1||((tt=We.runtime)==null?void 0:tt.visibility)==="enterprise"||((At=We.runtime)==null?void 0:At.reviewStatus)==="pending"?void 0:je,onViewDetails:ot&&((Ot=We.runtime)==null?void 0:Ot.canManage)!==!1?()=>{ot.sandbox?h(ot.sandbox):u(ot)}:void 0,connecting:We.id===Pe,connectError:Ke[We.id],connected:((Ut=We.runtime)==null?void 0:Ut.runtimeId)===v,onEditDraft:O,onDeleteDraft:Ce},We.id)})]})]}),(m==="general"||m==="mpa")&&!K&&!fn&&(kt.length>0||!!X)&&a.jsx("div",{className:"my-agent-load-more",ref:T,"aria-live":"polite",children:V?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:E("myAgents.loadingMore")})]}):X?a.jsx("span",{children:E("myAgents.scrollForMore")}):a.jsx("span",{children:E("myAgents.allLoaded")})})]}),z&&a.jsx(IYt,{region:z,cloudProvider:e,onClose:()=>J(null),onCreated:()=>{Ym(),U===z&&m==="mpa"&&Re("",!0)}},z),_!=null&&_.runtime?a.jsx(h9e,{runtimeId:_.runtime.runtimeId,region:_.runtime.region,name:_.name,canPublish:_.runtime.canPublish===!0,onClose:()=>L(null),onChanged:()=>{Ym(),Re("",!0)}},`${_.runtime.region}:${_.runtime.runtimeId}`):null,be?a.jsx(_d,{title:E("myAgents.deleteDraftTitle"),description:E("myAgents.deleteDraftDescription",{name:be.draft.name||E("agentSelector.unnamedAgent")}),confirmLabel:E("myAgents.deleteDraft"),variant:"danger",onCancel:()=>Ce(null),onConfirm:()=>{A==null||A(be),Ce(null)}}):null]})}function xK({section:e,onWorkspace:t,onEnvironment:n,onProjects:i,actions:r,children:s,className:o=""}){const{t:l}=_e("ui"),c=l(e==="workspaces"?"workspace.title":e==="environments"?"common.environment":"workspace.codeProjects");return a.jsxs(Ch,{className:`workspace-center ${o}`,"aria-label":c,children:[a.jsx(Qv,{title:c}),a.jsxs(ib,{children:[(t||n)&&a.jsx(rb,{items:[{id:"workspaces",label:l("workspace.title")},{id:"environments",label:l("common.environment")},...i?[{id:"projects",label:l("workspace.codeProjects")}]:[]],value:e,onChange:u=>{u==="workspaces"&&(t==null||t()),u==="environments"&&(n==null||n()),u==="projects"&&(i==null||i())},ariaLabel:l("workspace.resourceType"),idPrefix:"workspace-center"}),a.jsx("div",{className:"resource-toolbar__actions",children:r})]}),s]})}const nZt="_Container_13560_1",iZt="_Textarea_13560_174",ile={Container:nZt,Textarea:iZt},bb=e=>{const t=p.useRef(null),i=`search-ui-input-${p.useId()}`,{id:r,name:s,variant:o="outline",size:l="md",gutterSize:c,className:u,autoComplete:d,disabled:f=!1,readOnly:h=!1,invalid:m=!1,allowAutofillExtensions:g=!!s,onFocus:b,onBlur:v,onAnimationStart:y,onAutofill:w,autoSelect:x,rows:k=3,maxRows:S,autoResize:O,ref:A,onChange:E,...j}=e,[T,R]=p.useState(!1),C=O?Math.max(S??10,k):k;p.useEffect(()=>{var I;x&&((I=t.current)==null||I.select())},[x]);const N=I=>{y==null||y(I),I.animationName==="native-autofill-in"&&(w==null||w())},P=p.useCallback(()=>{if(!O||!t.current||C===void 0)return;t.current.style.height="0px";const I=t.current.scrollHeight;t.current.style.height=I+"px"},[O,C]);return p.useEffect(()=>{P()},[e.value,k,P]),a.jsx("div",{className:qi(ile.Container,u),"data-variant":o,"data-size":l,"data-gutter-size":c,"data-focused":T,"data-disabled":f?"":void 0,"data-readonly":h?"":void 0,"data-invalid":m?"":void 0,style:Fv({"textarea-min-rows":`${k}`,"textarea-max-rows":`${C}`}),children:a.jsx("textarea",{...j,onChange:I=>{E==null||E(I),P()},ref:rT([t,A]),id:r||(g?void 0:i),className:ile.Textarea,name:s,readOnly:h,disabled:f,rows:k,onFocus:I=>{R(!0),b==null||b(I)},onBlur:I=>{R(!1),v==null||v(I)},onAnimationStart:N,"data-lpignore":g?void 0:!0,"data-1p-ignore":g?void 0:!0})})},PL="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2048%2048'%3e%3cimage%20width='48'%20height='48'%20href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAMKADAAQAAAABAAAAMAAAAADbN2wMAAAH7UlEQVRoBdVZWWwbVRQ9492Onc1xTfaWLukq9oSqLKnYBZRSNgn6AagsAgmJRfzxg4SEEDtiER8IBKKAChK0FS1tKYWW0lZQKKV0gxCVJm3ikDiO17EdzrUzSdw4jj1OpeQqNzO237vvnHfvu/e9GWVwcBBDYue1mrqE2kI1UqeSJAnmIHUzNUCNUmGiKtQy6oPUR6geqnw/FSVOUH9R36KupfaDHnBQn6MGqEnqVJcEAfZTBbNL4b+lZPI1VbwwnaSfYO8z8N+TVMd0Qj6EVdbs3eIBP29cVFkL00kk+wSEwHAamgh9bDAJSQWTITZFnF+85J1tBPyOUC9OqqnsVdTIRkVBi70Msy125uriHJ8XAXFRfzKBTQM+rO0/hc54cSQE8iyzAx/XLcEltjIU44uCQijOaHvPfxIv97TjWCzEcMo7+sZ4TGa+2V6KT2rPQ73ZptsPBZE30fVrymvxTvUCtDoqYC0ijhMk/3MkgDd62xFheOqVggjIIAbOVaujEh/ULsaNzioUsxhVAv/A34GD0YBubxZMQJupWpMNr58zHytcHth1ekICsDcRx4u+fxBK6vOCbgKyEIXEK975WOmaoZuErKv1QR8ORQd0eUE3Ac0TNSYrXvI24fZSLxwGfebiDKW3e08gln9J0oYvKoMNG6kmiRdmzMOtTi8sOsJJJfANA93oiseGbeZ7k1EHZAKCEcApu4wCxUsSz3rm4HQiim3B/wpOsBJA2yP/4cZIJYIBFcGwCjWeSKEwm4wosZtR7rKizGXJQJZRB1TuttftAprnAbOrM9rl9UHqwg+s1o+eOow/GNN5CaPOklSgdKq4us+Ji7pt6Dw1AF9vBOGImjJht5lRVWFDY7UL58/3wOt2YPEcN2xWVpPRe6EQC+y9rwINPNKsuRaYX5cXhIxGkks+Y7V+6vQRdLBi5yx1bGwicFebivj+ARgOhZGMJMFyQyWpoV2GRIa2ZXOX2bDyqnPxzEPNKC+1Zj957eDBTbz34PXAwvoMfBN+kGV8Bxf00VgQz/vaEB6nSCnRQVj2h2DZG4TyZwQWlSils3m8RDDEhk2uaqlHaYklVb3Ha42dh4B3eMzZ//eEmMc0kGL3cEU9WksqU4XvzAYKZ9n6fQCOz3thORCGkhgCf2bDMz4bjQpW39yE65Y1QO5FxiUgP+76E3hzI7D1VyBcwP5NTFcZzXjaPRMNZmvGPkfA23YMwLHRD0Mf3ZwTgaBIi8GgYMGsSjx2z3kEP9Jp5E5rOeoqQH75C3htPfDpD4CskXxFvHC5vQKPVjSwPqQfcKTAfxuA/Ws/lBAXwEhUTGjWSAL3r1qYykSju+UkIFbZDx09wPvb0iH1W9uEYw03MHAV3ltew1CqgDkyCNtWgt/cnwY/3GriG5n9hbMrccNljRmzLz0nJCCNJBsEwsCH24E3NgDr96brhfyWS2Sm3EYLVsOL0i0DsG8h+LDkqcLExHhfc9siVDDrjJ59sZJRyHKZFRKybiSkTtIjR08CrXwEdtGcXL2A4+192LOuDeatfqg6wMvsL5lbhWuWysIdO995E9BgSkh19THX7wQOtANXLgKWLQSaarUWI9dNP7bjo68OY9uef6GqhcW8ZkViX2a/nBWYQ4+RggmIBfFGnHgOcD0c7wD2HgOW0xuXk0xN5SDaOwL4cnsb1m05joPHejKK0hgEOb4Q8Muba3H1pXUwZZl96aqLgHSU2RCbEe6/9hzh875OYPdhYF5NDLt/Oohd+46gNxBjm2zzJhZyi/RyV5TggdsvRJnTOm5j3QQ0i9ra6OHj1u9+B/YdNcLXVQdDmYNPy9oZ971IcIPHjUHadVrHHFfZNphtTtx508W4eJEHsg7Gk6IJaIZlDEn3EdUEl7sBg4la2MtqkYgNIOz/F9FgF6IhX6p5mozcjgbGasw/xWCCs7IeN7U24b4VddwZj26jjTZynTQCmknxSBqIETanh7ceWEpmpIiokT7E6JFosBvxaD/iJCeNDQYzTFYnzHY3SsobmfM9eOyucjTO0KyOf510AqOHkl2kiMlSQoAlsPLAk4hHSCaIJMMqmUgfYBQeggxGK4xmOxprXHh8lYK51em+E/0/qwQyBh8iY+Q52pjlOZD8XFcFPHELcGlT3stlbBaymtOROTReBoZJ+0DjZ9pv4SFq9fL0YWqcjJl1+AwP8OSGS+amq6y4P/fyyWqvoC9lDAG7ainPEJcBs7xMBGOLbU6bGQTMJHAnDUlG2biPFZevEM4GCZl9sSsnPgG+bAHfa+l8vZJxpNSo+oPp/c4XP6bPBN0kog2qtdFz1WzIkfXmZuAKVm6JewlbvZKVgGZMilMPwW9ngdr5B3CEG7iEbCY5ffl6RgPtYDGdybS4ogW4YDbgLefTD5s2kv5rTgKaWdlKi1fau4BDJ3jM5I70NDd0J7grzfZEUMg5CM5Tmg4TiW3ZtVYxTKpcgM2iWS7+mhcBbRiZ/TBTd4jPjtSEVF3AxxdUPgkxTrUUMTcBykKUmLZwhQlYPhWBeCBV5DRjk3QtiEC2McUDsjPVCEhWEQ8Umk2y2c7nOyEwrV/ySdbdQo3nw3aKtRHM3wiBtVQu02knISJ+SQh8Q32TyqTJJ6xTXyQzyzb2LeoBWQOy5pjwcDf1YSqzNIooLex99kTCppsq4N+l+oUArylhoku9sb+O18VU8c5UEiZu7KGyrKKTmgr7/wGxhy03aZIycwAAAABJRU5ErkJggg=='%20/%3e%3c/svg%3e",rZt="data:image/svg+xml,%3c?xml%20version='1.0'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20100%20100'%3e%3ctitle%3ePandoc%20Icon%3c/title%3e%3cdesc%20property='dc:creator'%3eAlbert%20Krewinkel%3c/desc%3e%3cmetadata%20id='license'%20xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23'%20xmlns:dc='http://purl.org/dc/elements/1.1/'%20xmlns:cc='http://creativecommons.org/ns%23'%3e%3crdf:RDF%3e%3ccc:Work%20rdf:about=''%3e%3cdc:format%3eimage/svg+xml%3c/dc:format%3e%3cdc:type%20rdf:resource='http://purl.org/dc/dcmitype/StillImage'%20/%3e%3ccc:license%20rdf:resource='http://creativecommons.org/licenses/by-sa/4.0/'%20/%3e%3c/cc:Work%3e%3ccc:License%20rdf:about='http://creativecommons.org/licenses/by-sa/4.0/'%3e%3ccc:permits%20rdf:resource='http://creativecommons.org/ns%23Reproduction'%20/%3e%3ccc:permits%20rdf:resource='http://creativecommons.org/ns%23Distribution'%20/%3e%3ccc:requires%20rdf:resource='http://creativecommons.org/ns%23Notice'%20/%3e%3ccc:requires%20rdf:resource='http://creativecommons.org/ns%23Attribution'%20/%3e%3ccc:permits%20rdf:resource='http://creativecommons.org/ns%23DerivativeWorks'%20/%3e%3ccc:requires%20rdf:resource='http://creativecommons.org/ns%23ShareAlike'%20/%3e%3c/cc:License%3e%3c/rdf:RDF%3e%3c/metadata%3e%3crect%20fill='%23fed'%20stroke='%23fed'%20width='100'%20height='100'/%3e%3cg%20fill='none'%20stroke='%234093da'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='8'%20transform='skewX(-6)%20translate(8%201)'%3e%3cpath%20d='M%2030,10%20l%200,80%20M%2045,10%20l%200,80%20M%2020,10%20l%2040,0%20l%2018,18%20l%200,25%20l%20-33,0'%20/%3e%3cpath%20fill='%234093da'%20stroke-width='6'%20d='M%2061,10%20l%2017,17%20l%20-17,0%20l%200,-17'%20/%3e%3c/g%3e%3c/svg%3e",sZt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%20100%20100'%20version='1.1'%20id='svg4'%20sodipodi:docname='favicon.svg'%20inkscape:version='1.4.4%20(dcaf3e7,%202026-05-05)'%20xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape'%20xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:svg='http://www.w3.org/2000/svg'%3e%3csodipodi:namedview%20id='namedview4'%20pagecolor='%23ffffff'%20bordercolor='%23000000'%20borderopacity='0.25'%20inkscape:showpageshadow='2'%20inkscape:pageopacity='0.0'%20inkscape:pagecheckerboard='0'%20inkscape:deskcolor='%23d1d1d1'%20showgrid='true'%20inkscape:zoom='8.2236519'%20inkscape:cx='34.534536'%20inkscape:cy='45.174577'%20inkscape:window-width='1881'%20inkscape:window-height='1382'%20inkscape:window-x='1512'%20inkscape:window-y='30'%20inkscape:window-maximized='0'%20inkscape:current-layer='svg4'%3e%3cinkscape:grid%20type='axonomgrid'%20id='grid4'%20units='px'%20originx='0'%20originy='0'%20spacingx='3.7795276'%20spacingy='3.7795276'%20empcolor='%230099e5'%20empopacity='0.30196078'%20color='%230099e5'%20opacity='0.14901961'%20empspacing='0'%20dotted='false'%20gridanglex='40'%20gridanglez='40'%20enabled='true'%20visible='true'%20/%3e%3c/sodipodi:namedview%3e%3cdefs%20id='defs1'%3e%3cfilter%20id='shadow'%20x='0'%20y='0'%20width='1'%20height='1'%3e%3cfeDropShadow%20dx='0'%20dy='2'%20stdDeviation='3'%20flood-color='rgba(50,%2050,%2093,%200.18)'%20/%3e%3c/filter%3e%3c/defs%3e%3crect%20x='4'%20y='4'%20width='92'%20height='92'%20rx='22.08'%20fill='%23e8efff'%20filter='url(%23shadow)'%20id='rect1'%20transform='matrix(1.0869565,0,0,1.0869565,-4.347826,-4.347826)'%20style='stroke-width:0.92'%20ry='22.08'%20/%3e%3cpath%20style='fill:%230a2540;fill-opacity:1;stroke-width:1.88976'%20d='M%2049.999999,6.535431%204.9573423,44.330708%2049.999999,82.125984%2092.790523,46.220471%2095.042656,44.330708%20Z'%20id='path1'%20/%3e%3cpath%20style='fill:%23425466;fill-opacity:1;stroke-width:1.88976'%20d='M%204.9573423,44.330708%20V%2055.669291%20L%2049.999999,93.464567%20V%2082.125984%20Z'%20id='path2'%20/%3e%3cpath%20style='fill:%231a3550;fill-opacity:1;stroke-width:1.88976'%20d='M%2049.999999,82.125984%2095.042656,44.330708%20V%2055.669291%20L%2049.999999,93.464567%20Z'%20id='path3'%20/%3e%3cpath%20style='fill:%234ade80;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;fill-opacity:1'%20d='m%2045.042657,30.236221%209.008531,-7.559055%2022.521328,18.897638%20-9.008531,7.559056%20z'%20id='path5'%20/%3e%3cpath%20style='fill:none;fill-opacity:1;stroke:%234ade80;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1'%20d='M%2027.025594,49.133859%2047.29479,47.244096%2045.042657,64.25197'%20id='path6'%20/%3e%3c/svg%3e",aZt="data:image/svg+xml,%3csvg%20fill='%23261230'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eAstral%3c/title%3e%3cpath%20d='M1.44%200C.6422%200%200%20.6422%200%201.44v21.12C0%2023.3578.6422%2024%201.44%2024h21.12c.7978%200%201.44-.6422%201.44-1.44V1.44C24%20.6422%2023.3578%200%2022.56%200Zm4.7998%204.8h11.5199c.7953%200%201.44.6447%201.44%201.44V19.2h-6.624v-4.32h-1.152v4.32H4.8V6.24c0-.7953.6446-1.44%201.4398-1.44m4.032%205.472v1.152h3.456v-1.152z'/%3e%3c/svg%3e",oZt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='1.34em'%20height='1em'%20viewBox='0%200%20256%20192'%3e%3cpath%20fill='%232d4552'%20d='M84.38%20108.352c-9.556%202.712-15.826%207.467-19.956%2012.218c3.956-3.461%209.255-6.639%2016.402-8.665c7.311-2.072%2013.548-2.057%2018.702-1.062v-4.03c-4.397-.402-9.437-.082-15.148%201.539M63.987%2074.475l-35.49%209.35s.646.914%201.844%202.133l30.092-7.93s-.427%205.495-4.13%2010.41c7.005-5.299%207.684-13.963%207.684-13.963m29.709%2083.41c-49.946%2013.452-76.37-44.43-84.37-74.472c-3.696-13.868-5.31-24.37-5.74-31.148a11.5%2011.5%200%200%201%20.025-1.84C1.021%2050.58-.22%2051.927.032%2055.82c.43%206.773%202.044%2017.275%205.74%2031.147c7.997%2030.038%2034.424%2087.92%2084.37%2074.468c10.871-2.929%2019.038-8.263%2025.17-15.073c-5.652%205.104-12.724%209.123-21.616%2011.523M103.08%2039.05v3.555h19.59c-.401-1.259-.806-2.393-1.208-3.555z'/%3e%3cpath%20fill='%232d4552'%20d='M127.05%2068.325c8.81%202.503%2013.47%208.68%2015.933%2014.146l9.824%202.79s-1.34-19.132-18.645-24.047c-16.189-4.6-26.151%208.995-27.363%2010.754c4.71-3.355%2011.586-6.102%2020.251-3.643m78.197%2014.234c-16.204-4.62-26.162%209.003-27.356%2010.737c4.713-3.351%2011.586-6.099%2020.247-3.629c8.797%202.506%2013.452%208.676%2015.923%2014.146l9.837%202.8s-1.361-19.135-18.651-24.054m-9.76%2050.443l-81.718-22.845s.885%204.485%204.279%2010.293l68.803%2019.234c5.664-3.277%208.636-6.682%208.636-6.682m-56.655%2049.174C74.127%20164.828%2081.949%2082.386%2092.419%2043.32c4.311-16.1%208.743-28.066%2012.419-36.088c-2.193-.451-4.01.704-5.804%204.354C95.13%2019.5%2090.14%2032.387%2085.312%2050.427c-10.467%2039.066-18.29%20121.506%2046.412%20138.854c30.497%208.17%2054.256-4.247%2071.966-23.749c-16.81%2015.226-38.274%2023.763-64.858%2016.644'/%3e%3cpath%20fill='%23e2574c'%20d='M103.081%20138.565v-16.637l-46.223%2013.108s3.415-19.846%2027.522-26.684c7.311-2.072%2013.549-2.058%2018.701-1.063V39.05h23.145c-2.52-7.787-4.958-13.782-7.006-17.948c-3.387-6.895-6.859-2.324-14.741%204.269c-5.552%204.638-19.583%2014.533-40.698%2020.222c-21.114%205.694-38.185%204.184-45.307%202.95c-10.097-1.742-15.378-3.96-14.884%203.721c.43%206.774%202.043%2017.277%205.74%2031.148c7.996%2030.039%2034.424%2087.92%2084.37%2074.468c13.046-3.515%2022.254-10.464%2028.637-19.32h-19.256zm-74.588-54.74l35.494-9.35s-1.034%2013.654-14.34%2017.162c-13.31%203.504-21.154-7.812-21.154-7.812'/%3e%3cpath%20fill='%232ead33'%20d='M236.664%2039.84c-9.226%201.617-31.361%203.632-58.716-3.7c-27.363-7.328-45.517-20.144-52.71-26.168c-10.197-8.54-14.682-14.476-19.096-5.498c-3.902%207.918-8.893%2020.805-13.723%2038.846c-10.466%2039.066-18.289%20121.505%2046.413%20138.853c64.687%2017.333%2099.126-57.978%20109.593-97.047c4.83-18.037%206.948-31.695%207.53-40.502c.665-9.976-6.187-7.08-19.29-4.784M106.668%2072.161s10.196-15.859%2027.49-10.943c17.305%204.915%2018.645%2024.046%2018.645%2024.046zm42.215%2071.163c-30.419-8.91-35.11-33.167-35.11-33.167l81.714%2022.846c0-.004-16.494%2019.12-46.604%2010.32m28.89-49.85s10.183-15.847%2027.474-10.918c17.29%204.923%2018.651%2024.054%2018.651%2024.054z'/%3e%3cpath%20fill='%23d65348'%20d='m86.928%20126.51l-30.07%208.522s3.266-18.609%2025.418-25.983L65.25%2045.147l-1.471.447c-21.115%205.694-38.185%204.184-45.307%202.95c-10.097-1.741-15.379-3.96-14.885%203.722c.43%206.774%202.044%2017.276%205.74%2031.147c7.997%2030.039%2034.425%2087.92%2084.37%2074.468l1.471-.462zM28.493%2083.825l35.494-9.351s-1.034%2013.654-14.34%2017.162c-13.31%203.504-21.154-7.811-21.154-7.811'/%3e%3cpath%20fill='%231d8d22'%20d='m150.255%20143.658l-1.376-.335c-30.419-8.91-35.11-33.166-35.11-33.166l42.137%2011.778l22.308-85.724l-.27-.07c-27.362-7.329-45.516-20.145-52.71-26.17c-10.196-8.54-14.682-14.475-19.096-5.497c-3.898%207.918-8.889%2020.805-13.719%2038.846c-10.466%2039.066-18.289%20121.505%2046.413%20138.852l1.326.3zM106.668%2072.16s10.196-15.859%2027.49-10.943c17.305%204.915%2018.645%2024.046%2018.645%2024.046z'/%3e%3cpath%20fill='%23c04b41'%20d='m88.46%20126.072l-8.064%202.289c1.906%2010.74%205.264%2021.047%2010.534%2030.152c.918-.202%201.828-.376%202.762-.632c2.449-.66%204.72-1.479%206.906-2.371c-5.89-8.74-9.785-18.804-12.137-29.438m-3.148-75.644c-4.144%2015.467-7.852%2037.73-6.831%2060.06c1.826-.793%203.756-1.532%205.9-2.14l1.492-.334c-1.82-23.852%202.114-48.157%206.546-64.694a323%20323%200%200%201%203.373-11.704a105%20105%200%200%201-5.974%203.547a307%20307%200%200%200-4.506%2015.265'/%3e%3c/svg%3e",lZt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='512'%20height='512'%20version='1.1'%20viewBox='0%200%20135.47%20135.47'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m67.733%2067.733%2029.33%2016.933-29.33%2050.8c37.408%200%2067.733-30.325%2067.733-67.733%200-12.341-3.3168-23.901-9.0837-33.867h-58.65z'%20fill='%23afccf9'/%3e%3cpath%20d='m67.733-1e-6c-25.07%200-46.942%2013.63-58.654%2033.875l29.324%2050.792%2029.33-16.933v-33.867h58.65c-11.714-20.24-33.583-33.867-58.65-33.867z'%20fill='%231767d1'/%3e%3cpath%20d='m0%2067.733c0%2037.408%2030.324%2067.733%2067.733%2067.733l29.33-50.8-29.33-16.933-29.33%2016.933-29.324-50.792c-5.7637%209.9632-9.0794%2021.519-9.0794%2033.858'%20fill='%23679ef5'/%3e%3cpath%20d='m101.6%2067.733c0%2018.704-15.163%2033.867-33.867%2033.867-18.704%200-33.867-15.163-33.867-33.867s15.163-33.867%2033.867-33.867c18.704%200%2033.867%2015.163%2033.867%2033.867'%20fill='%23fff'/%3e%3cpath%20d='m95.25%2067.733c0%2015.197-12.32%2027.517-27.517%2027.517-15.197%200-27.517-12.32-27.517-27.517%200-15.197%2012.32-27.517%2027.517-27.517%2015.197%200%2027.517%2012.32%2027.517%2027.517'%20fill='%231a74e7'/%3e%3c/svg%3e",cZt="data:image/svg+xml,%3csvg%20fill='%23F03C2E'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGit%3c/title%3e%3cpath%20d='M13.09%2023.549a1.54%201.54%200%200%201-2.18%200L.451%2013.089a1.54%201.54%200%200%201%200-2.179l7.191-7.19%202.733%202.733a1.85%201.85%200%200%200%20.964%202.326v6.66a1.849%201.849%200%201%200%201.54%200V8.957l2.508%202.508a1.85%201.85%200%201%200%201.09-1.09l-2.634-2.634a1.85%201.85%200%200%200-2.378-2.377L8.73%202.63%2010.91.451a1.54%201.54%200%200%201%202.179%200l10.459%2010.46a1.54%201.54%200%200%201%200%202.179z'/%3e%3c/svg%3e",uZt="data:image/svg+xml,%3csvg%20fill='%23073551'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3ecurl%3c/title%3e%3cpath%20d='M.803%2014.8169c0-.5342.433-.9665.9665-.9665.5335%200%20.9665.4323.9665.9665%200%20.5335-.433.9657-.9665.9657-.5335%200-.9666-.4322-.9666-.9657m2.736%200c0-.1963-.0532-.376-.1119-.5525-.2344-.7024-.876-1.2169-1.6575-1.2169-.1249%200-.2344.0465-.3524.0708C.6149%2013.2865%200%2013.9646%200%2014.817c0%20.9764.7923%201.7694%201.7695%201.7694.9772%200%201.7694-.793%201.7694-1.7694m-1.7694-7.149c.5335%200%20.9665.433.9665.9665%200%20.5335-.433.9665-.9665.9665-.5343%200-.9666-.433-.9666-.9665%200-.5335.4323-.9665.9666-.9665m0%202.7359c.9772%200%201.7694-.7923%201.7694-1.7694%200-.1956-.0532-.376-.1119-.5525-.2344-.7024-.8767-1.2169-1.6575-1.2169-.1249%200-.2344.0465-.3524.0716C.6149%207.104%200%207.782%200%208.6344c0%20.9771.7923%201.7694%201.7695%201.7694m13.221-5.694c-.5342%200-.9665-.433-.9665-.9664a.966.966%200%2001.9666-.9665c.5335%200%20.9658.4322.9658.9665%200%20.5334-.4323.9664-.9658.9664m-9.6%2016.5133c-.5335%200-.9666-.433-.9666-.9665%200-.5342.433-.9665.9666-.9665a.966.966%200%2001.9665.9665c0%20.5335-.4323.9665-.9665.9665m9.6-19.2491c-.978%200-1.7695.7922-1.7695%201.7694%200%20.2085.0525.4025.1187.5882L5.039%2018.5581c-.803.1681-1.4179.8462-1.4179%201.6985%200%20.9772.7923%201.7694%201.7695%201.7694.9772%200%201.7694-.7922%201.7694-1.7694%200-.1963-.0525-.3759-.111-.5525l8.3427-14.2728c.7778-.1865%201.3683-.8531%201.3683-1.688%200-.977-.793-1.7693-1.7694-1.7693m7.24%202.7359c-.5343%200-.9666-.433-.9666-.9665a.966.966%200%2001.9665-.9665c.5335%200%20.9666.4322.9666.9665%200%20.5334-.433.9665-.9666.9665M12.6313%2021.223c-.5343%200-.9665-.433-.9665-.9665a.966.966%200%2001.9665-.9665c.5335%200%20.9658.4323.9658.9665%200%20.5335-.4323.9665-.9658.9665M22.2305%201.974c-.9772%200-1.7694.7922-1.7694%201.7694%200%20.2085.0525.4025.1187.5882l-8.3009%2014.2265c-.8021.1681-1.417.8462-1.417%201.6985%200%20.9772.7922%201.7694%201.7694%201.7694.9764%200%201.7687-.7922%201.7687-1.7694%200-.1963-.0525-.3759-.1111-.5525l8.3427-14.2728C23.4094%205.2448%2024%204.5782%2024%203.7433c0-.977-.7923-1.7693-1.7695-1.7693'/%3e%3c/svg%3e",dZt="data:image/svg+xml,%3csvg%20fill='%23007808'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eFFmpeg%3c/title%3e%3cpath%20d='M21.72%2017.91V6.5l-.53-.49L9.05%2018.52l-1.29-.06L24%201.53l-.33-.95-11.93%201-5.75%206.6v-.23l4.7-5.39-1.38-.77-9.11.77v2.85l1.91.46v.01l.19-.01-.56.66v10.6c.609-.126%201.22-.241%201.83-.36L14.12%205.22l.83-.04L0%2021.44l9.67.82%201.35-.77%206.82-6.74v2.15l-5.72%205.57%2011.26.95.35-.94v-3.16l-3.29-.18c.434-.403.858-.816%201.28-1.23z'/%3e%3c/svg%3e",fZt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%201080%201080'%3e%3c!--%20Generator:%20Adobe%20Illustrator%2030.3.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.3%20Build%20182)%20--%3e%3cdefs%3e%3cstyle%3e%20.st0%20{%20fill:%20%23ff0;%20}%20.st1%20{%20fill:%20%23333;%20}%20%3c/style%3e%3c/defs%3e%3cpath%20class='st0'%20d='M660.52,419.49l-195.15-52.98c-15.84-4.3-19.16-25.29-5.43-34.28l169.23-110.7-9.91-201.97c-.8-16.39,18.13-26.04,30.92-15.76l157.57,126.74,189.03-71.84c15.34-5.83,30.37,9.2,24.54,24.54l-71.84,189.03,126.74,157.57c10.29,12.79.64,31.73-15.76,30.92l-201.97-9.91-110.7,169.23c-8.98,13.73-29.98,10.41-34.28-5.43l-52.98-195.15h-.01Z'/%3e%3cpath%20class='st1'%20d='M603.34,476.66l32.94,121.68,4.45,16.23-429.11,429.11c-48.45,48.45-126.85,48.45-175.3,0C12.16,1019.51,0,987.89,0,956.15s12.02-63.48,36.31-87.77l429.11-429.11,16.35,4.33,121.56,33.06h0Z'/%3e%3c/svg%3e";function wK(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91 .58 .11 .79-.25.79-.56v-2.02c-3.2.7-3.88-1.36-3.88-1.36-.52-1.33-1.28-1.69-1.28-1.69-1.05-.72.08-.7.08-.7 1.16.08 1.77 1.19 1.77 1.19 1.03 1.77 2.71 1.26 3.37.96.1-.75.4-1.26.73-1.55-2.56-.29-5.25-1.28-5.25-5.7 0-1.26.45-2.29 1.19-3.1-.12-.29-.52-1.47.11-3.06 0 0 .97-.31 3.16 1.18A10.98 10.98 0 0 1 12 6.11c.98 0 1.96.13 2.87.39 2.19-1.49 3.16-1.18 3.16-1.18.63 1.59.23 2.77.11 3.06.74.81 1.19 1.84 1.19 3.1 0 4.43-2.7 5.4-5.27 5.69.42.36.78 1.06.78 2.14v3.04c0 .31.21.67.8.56A11.51 11.51 0 0 0 23.5 12C23.5 5.65 18.35.5 12 .5Z"})})}cl.registerLanguage("bash",OM);const hZt=48;function pZt(e,t=hZt){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}function mZt(e){return cl.highlight(e,{language:"bash",ignoreIllegals:!0}).value}function gZt({status:e}){return e==="succeeded"?a.jsx(Of,{"aria-hidden":!0}):e==="failed"?a.jsx(oB,{"aria-hidden":!0}):e==="running"?a.jsx(Vi,{className:"studio-build-progress__spinner","aria-hidden":!0}):a.jsx(Nat,{"aria-hidden":!0})}function rle(e,t){if(!e)return"";const n=Date.parse(e);return Number.isNaN(n)?"":new Intl.DateTimeFormat(t,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(n)}function bZt({steps:e,log:t,logError:n="",logTruncated:i=!1,logUpdatedAt:r,loading:s=!1}){const{t:o,i18n:l}=_e("ui"),c=p.useRef(null),u=p.useRef(!0),[d,f]=p.useState(!1),h=p.useMemo(()=>mZt(t),[t]);p.useEffect(()=>{const g=c.current;g&&t&&u.current&&(g.scrollTop=g.scrollHeight)},[t]);const m=async()=>{try{await navigator.clipboard.writeText(t),f(!0),window.setTimeout(()=>f(!1),1500)}catch{f(!1)}};return a.jsxs("div",{className:"studio-build-progress",children:[a.jsx("ol",{className:"studio-build-progress__steps","aria-label":o("studioBuildProgress.steps"),children:e.map(g=>a.jsxs("li",{className:`is-${g.status}`,children:[a.jsx("span",{className:"studio-build-progress__step-icon",children:a.jsx(gZt,{status:g.status})}),a.jsx("span",{children:g.label})]},g.key))}),a.jsxs("section",{className:"studio-build-progress__log","aria-label":o("studioBuildProgress.log"),children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("strong",{children:o("studioBuildProgress.log")}),a.jsxs("span",{children:[o(s?"studioBuildProgress.syncing":n?"studioBuildProgress.loadFailed":"studioBuildProgress.synced"),i?o("studioBuildProgress.recentOnly"):"",rle(r,l.resolvedLanguage??l.language)?` · ${rle(r,l.resolvedLanguage??l.language)}`:""]})]}),a.jsxs(Tt,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:!t,onClick:()=>void m(),"aria-label":o(d?"studioBuildProgress.copiedLog":"studioBuildProgress.copyLog"),children:[d?a.jsx(Of,{"aria-hidden":!0}):a.jsx(ZD,{"aria-hidden":!0}),o(d?"studioBuildProgress.copied":"studioBuildProgress.copy")]})]}),t?a.jsx("pre",{ref:c,tabIndex:0,"aria-label":o("studioBuildProgress.logContent"),onScroll:g=>{u.current=pZt(g.currentTarget)},children:a.jsx("code",{className:"hljs language-bash",dangerouslySetInnerHTML:{__html:h}})}):a.jsx("div",{className:`studio-build-progress__log-empty${n?" is-error":""}`,children:n||o(s?"studioBuildProgress.waiting":"studioBuildProgress.empty")})]})]})}function sle({name:e,description:t,icon:n,selected:i,disabled:r=!1,onChange:s,className:o=""}){return a.jsxs("button",{type:"button",className:`studio-package-option${i?" is-selected":""}${o?` ${o}`:""}`,"aria-pressed":i,disabled:r,onClick:()=>s(!i),children:[a.jsx("span",{className:"studio-package-option__icon","aria-hidden":"true",children:n}),a.jsxs("span",{className:"studio-package-option__content",children:[a.jsx("strong",{children:e}),t?a.jsx("span",{children:t}):null]}),a.jsx("span",{className:"studio-package-option__action","aria-hidden":"true",children:i?a.jsx(dat,{}):a.jsx(pat,{})})]})}function Zb(e,t){return e[t]|e[t+1]<<8}function X0(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}async function yZt(e){const t=new DecompressionStream("deflate-raw"),n=new Blob([new Uint8Array(e)]).stream().pipeThrough(t);return new Uint8Array(await new Response(n).arrayBuffer())}async function L9e(e,t={}){let i=-1;for(let u=e.length-22;u>=0&&u>e.length-65557;u--)if(X0(e,u)===101010256){i=u;break}if(i<0)throw new Error(Yt("helpers.zip.invalid"));const r=Zb(e,i+10);if(t.maxEntries!==void 0&&r>t.maxEntries)throw new Error(Yt("helpers.zip.tooManyFiles",{count:t.maxEntries}));let s=X0(e,i+16);const o=new TextDecoder("utf-8"),l=[];let c=0;for(let u=0;ut.maxUncompressedBytes)throw new Error(Yt("helpers.zip.tooLarge"));const w=Zb(e,v+26),x=Zb(e,v+28),k=v+30+w+x,S=e.subarray(k,k+f);let O;if(d===0)O=S;else if(d===8)O=await yZt(S);else{s+=46+m+g+b;continue}l.push({name:y,text:o.decode(O)}),s+=46+m+g+b}return l}const J7=/(^|\/)skill\.md$/i;function vZt(e){const t=(e??"").replace(/\r\n?/g,` `).split(` -`);if(!t.length||t[0].trim()!=="---")return{name:"",description:""};let n=-1;for(let r=1;r=2&&(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))}function xZt(...e){var t;for(const n of e){const i=(t=n.trim().replace(/\\/g,"/").split("/").filter(Boolean).pop())==null?void 0:t.replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"");if(i)return i.slice(0,64)}return"local-skill"}function wZt(e,t){return t.trim()||e}function L9e(e){const t=e.map(i=>({path:i.path.replace(/\\/g,"/").replace(/^\.\//,""),text:i.text})).filter(i=>i.path.length>0&&!i.path.endsWith("/")),n=new Set(t.map(i=>i.path.split("/")[0]));if(n.size===1&&t.every(i=>i.path.includes("/"))){const i=[...n][0]+"/";return t.map(r=>({path:r.path.slice(i.length),text:r.text}))}return t}function kZt(e){const t=new Map,n=new Set;for(const i of e)if(J7.test("/"+i.path)){const r=i.path.split("/");n.add(r.slice(0,-1).join("/"))}for(const i of e){const r=i.path.split("/");let s="";for(let u=r.length-1;u>=0;u--){const d=r.slice(0,u).join("/");if(n.has(d)){s=d;break}}const o=J7.test("/"+i.path);if(!s&&!o&&!n.has("")||!n.has(s)&&!o)continue;const l=s?i.path.slice(s.length+1):i.path,c=t.get(s)||[];c.push({path:l,text:i.text}),t.set(s,c)}return t}function OZt(e,t,n){const i=`${n}${e?"/"+e:""}`,r=t.find(c=>J7.test("/"+c.path));if(!r)return{hit:null,error:Yt("helpers.skills.missingManifest",{location:i})};const s=yZt(r.text),o=xZt(s.name,e,n.replace(/\.[^.]+$/,"")),l=[];for(const c of t){if(c.path.split("/").some(f=>f===".."))return{hit:null,error:Yt("helpers.skills.invalidParentPath",{location:i,path:c.path})};const d=`skills/${o}/${c.path}`;if(!d.startsWith(`skills/${o}/`))return{hit:null,error:Yt("helpers.skills.invalidPath",{location:i,path:c.path})};l.push({path:d,content:c.text})}return{hit:{source:"local",id:`local:${o}:${t.length}`,name:wZt(o,s.name),description:s.description||Yt("helpers.skills.localDescription"),folder:o,localFiles:l},error:null}}async function SZt(e){const t=new Uint8Array(await e.arrayBuffer()),i=(await M9e(t)).map(r=>({path:r.name,text:r.text}));return $9e(L9e(i),e.name)}async function EZt(e,t=new Map){const n=[];for(let i=0;ie.file(t,n))}async function AZt(e){const t=e.createReader(),n=[];for(;;){const i=await new Promise((r,s)=>t.readEntries(r,s));if(i.length===0)return n;n.push(...i)}}async function F9e(e,t=""){const n=t?`${t}/${e.name}`:e.name;if(e.isFile)return[{file:await CZt(e),path:n}];if(!e.isDirectory)return[];const i=await AZt(e);return(await Promise.all(i.map(r=>F9e(r,n)))).flat()}function TZt({selected:e,onChange:t}){const{t:n}=_e("create"),[i,r]=p.useState([]),[s,o]=p.useState([]),[l,c]=p.useState(!1),[u,d]=p.useState(!1),f=p.useRef(0),h=k=>e.some(S=>S.source==="local"&&S.folder===k),m=k=>{k.localFiles&&(h(k.folder||k.name)?t(e.filter(S=>!(S.source==="local"&&S.folder===(k.folder||k.name)))):t([...e,{source:"local",folder:k.folder||k.name,name:k.name,description:k.description,localFiles:k.localFiles}]))},g=p.useRef([]),b=p.useRef(e);p.useEffect(()=>{g.current=s},[s]),p.useEffect(()=>{b.current=e},[e]);const v=k=>{const S=new Set([...g.current.map(j=>j.folder||j.name),...b.current.filter(j=>j.source==="local").map(j=>j.folder)]),O=[],A=[];for(const j of k.hits){const T=j.folder||j.name;if(S.has(T)){O.push(j.name);continue}S.add(T),A.push(j)}o(j=>[...j,...A]);const E=[...k.errors];if(O.length>0&&E.push(n("skills.local.duplicatesSkipped",{names:O.join(", ")})),r(E),A.length===1&&k.errors.length===0&&O.length===0){const j=A[0];j.localFiles&&t([...b.current,{source:"local",folder:j.folder||j.name,name:j.name,description:j.description,localFiles:j.localFiles}])}},y=k=>{k.preventDefault(),f.current+=1,d(!0)},w=k=>{k.preventDefault(),f.current=Math.max(0,f.current-1),f.current===0&&d(!1)},x=async k=>{if(k.preventDefault(),f.current=0,d(!1),l)return;const S=Array.from(k.dataTransfer.items).map(O=>{var A;return(A=O.webkitGetAsEntry)==null?void 0:A.call(O)}).filter(O=>O!==null);if(S.length===0){r([n("skills.local.invalidDrop")]);return}c(!0);try{const O=(await Promise.all(S.map(j=>F9e(j)))).flat(),A=S.some(j=>j.isDirectory);if(!A&&O.length===1&&O[0].file.name.toLowerCase().endsWith(".zip")){v(await SZt(O[0].file));return}if(!A){r([n("skills.local.invalidDrop")]);return}const E=new Map(O.map(({file:j,path:T})=>[j,T]));v(await EZt(O.map(({file:j})=>j),E))}catch(O){r([n("skills.local.readError",{detail:O instanceof Error?O.message:String(O)})])}finally{c(!1)}};return a.jsxs("div",{className:"cw-local",children:[a.jsxs("div",{className:`cw-local-dropzone ${u?"is-dragging":""}`,role:"group","aria-label":n("skills.local.dropLabel"),onDragEnter:y,onDragOver:k=>k.preventDefault(),onDragLeave:w,onDrop:k=>void x(k),children:[a.jsx(bV,{className:"cw-local-drop-icon","aria-hidden":!0}),a.jsx("p",{className:"cw-local-drop-hint",children:n("skills.local.dropLabel")})]}),a.jsx("p",{className:"cw-local-hint",children:n("skills.local.hint")}),l&&a.jsx("p",{className:"cw-empty-line",children:n("skills.local.reading")}),i.length>0&&a.jsxs("div",{className:"cw-banner",children:[a.jsx(gm,{className:"cw-i"}),a.jsx("span",{children:i.join(";")})]}),s.length>0&&a.jsx("div",{className:"cw-skill-results",children:s.map(k=>{var O;const S=h(k.folder||k.name);return a.jsxs("button",{type:"button",className:`cw-skill-result ${S?"is-on":""}`,onClick:()=>m(k),"aria-pressed":S,children:[a.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:S?a.jsx(Of,{className:"cw-i cw-i-sm"}):a.jsx(ec,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:"cw-skill-result-meta",children:[a.jsx("span",{className:"cw-skill-result-name",children:k.name}),k.description&&a.jsx("span",{className:"cw-skill-result-desc",children:kC(k.description)}),a.jsx("span",{className:"cw-skill-result-repo",children:n("skills.local.fileCount",{count:((O=k.localFiles)==null?void 0:O.length)??0})})]})]},k.id)})})]})}const _Zt="/harness/skills/findskill";async function jZt(e,t="public"){const n=e.trim(),i=new URLSearchParams({query:n,page_number:"1",page_size:"20"}),r=`${_Zt}?${i.toString()}`,s=await fetch(r,{headers:{accept:"application/json"},signal:po(void 0,eo)});if(!s.ok)throw new Error(Yt("helpers.skills.searchFailed",{status:s.status}));return((await s.json()).items??[]).map(l=>({source:"skillhub",id:l.slug??l.name??"",slug:l.slug??"",name:l.name??l.slug??"",description:l.description??"",namespace:t,sourceRepo:l.sourceRepo,downloadCount:l.downloadCount,version:l.version}))}function NZt({selected:e,onChange:t}){const{t:n}=_e("create"),[i,r]=p.useState(""),[s,o]=p.useState([]),[l,c]=p.useState(!1),[u,d]=p.useState(null),[f,h]=p.useState(!1),m=v=>e.some(y=>y.source==="skillhub"&&y.slug===v),g=v=>{v.slug&&(m(v.slug)?t(e.filter(y=>!(y.source==="skillhub"&&y.slug===v.slug))):t([...e,{source:"skillhub",slug:v.slug,name:v.name,folder:v.slug.split("/").pop()||v.name,namespace:v.namespace||"public",description:v.description}]))},b=async v=>{c(!0),d(null),h(!0);try{const y=await jZt(v);o(y)}catch(y){d(y instanceof Error?y.message:n("skills.hub.searchError")),o([])}finally{c(!1)}};return p.useEffect(()=>{const v=i.trim();if(!v){o([]),h(!1),d(null);return}const y=setTimeout(()=>b(v),300);return()=>clearTimeout(y)},[i,n]),a.jsxs("div",{className:"cw-skillhub",children:[a.jsxs("div",{className:"cw-skill-searchrow",children:[a.jsxs("div",{className:"cw-skill-searchbox",children:[a.jsx(dI,{className:"cw-i cw-skill-searchicon","aria-hidden":!0}),a.jsx("input",{className:"cw-input cw-skill-input",value:i,placeholder:n("skills.hub.searchPlaceholder"),onChange:v=>r(v.target.value),onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),i.trim()&&b(i))}})]}),a.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft",onClick:()=>i.trim()&&b(i),disabled:!i.trim()||l,children:[l?a.jsx(Vi,{className:"cw-i cw-spin"}):a.jsx(dI,{className:"cw-i"}),n("skills.hub.search")]})]}),u&&a.jsxs("div",{className:"cw-banner",children:[a.jsx(gm,{className:"cw-i"}),a.jsx("span",{children:u})]}),l&&s.length===0?a.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[a.jsx(Vi,{className:"cw-i cw-spin"})," ",n("skills.hub.searching")]}):s.length>0?a.jsx("div",{className:"cw-skill-results",children:s.map(v=>{const y=m(v.slug||"");return a.jsxs("button",{type:"button",className:`cw-skill-result ${y?"is-on":""}`,onClick:()=>g(v),"aria-pressed":y,children:[a.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:y?a.jsx(Of,{className:"cw-i cw-i-sm"}):a.jsx(ec,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:"cw-skill-result-meta",children:[a.jsx("span",{className:"cw-skill-result-name",children:v.name}),v.description&&a.jsx("span",{className:"cw-skill-result-desc",children:kC(v.description)}),v.sourceRepo&&a.jsx("span",{className:"cw-skill-result-repo",children:v.sourceRepo})]})]},v.id||v.slug)})}):f&&!u?a.jsx("p",{className:"cw-empty-line",children:n("skills.hub.noResults")}):!f&&a.jsx("p",{className:"cw-empty-line",children:n("skills.hub.hint")})]})}function B9e({className:e}){return a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M5.5 7.5h10.75a2 2 0 0 1 2 2v7.75a2 2 0 0 1-2 2H5.5a2 2 0 0 1-2-2V9.5a2 2 0 0 1 2-2Z"}),a.jsx("path",{d:"M7 4.75h9.5a2 2 0 0 1 2 2",opacity:".58"}),a.jsx("path",{d:"m11 10.25.72 1.48 1.63.24-1.18 1.15.28 1.62-1.45-.77-1.45.77.28-1.62-1.18-1.15 1.63-.24.72-1.48Z"}),a.jsx("path",{d:"M19.25 11.25h1.5M20 10.5V12",opacity:".72"})]})}function b6(e){return e.source==="runtime"?`runtime:${e.folder}`:e.source==="skillhub"?`hub:${e.namespace}/${e.slug}`:e.source==="local"?`local:${e.folder}`:`ss:${e.skillSpaceId}/${e.skillId}/${e.version||""}`}function RZt(e){return e.source==="runtime"?"skillSourcePicker.sources.runtime":e.source==="local"?"skillSourcePicker.sources.local":e.source==="skillspace"?"skillSourcePicker.sources.skillspace":"skillSourcePicker.sources.skillhub"}function IZt({skill:e,onRemove:t,disabled:n}){const{t:i}=_e("ui");let r=gC;e.source==="local"||e.source==="runtime"?r=bV:e.source==="skillspace"&&(r=B9e);const s=`${i(RZt(e))}${e.description?` · ${kC(e.description)}`:""}`;return a.jsxs(_r.div,{className:"cw-selected-skill-row",layout:!0,initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.16},children:[a.jsx("span",{className:"cw-selected-skill-icon","aria-hidden":"true",children:a.jsx(r,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:"cw-selected-skill-meta",children:[a.jsx("span",{className:"cw-selected-skill-name",children:e.name}),a.jsx("span",{className:"cw-selected-skill-detail",tabIndex:0,title:s,children:s})]}),a.jsx("button",{type:"button",className:"cw-selected-skill-remove",onClick:t,disabled:n,"aria-label":i("skillSourcePicker.remove",{name:e.name}),title:i("skillSourcePicker.remove",{name:e.name}),children:a.jsx(Bo,{className:"cw-i cw-i-sm"})})]})}const y6=[{id:"local",labelKey:"skillSourcePicker.tabs.local",shortLabelKey:"skillSourcePicker.tabs.localShort",icon:bV},{id:"skillspace",labelKey:"skillSourcePicker.tabs.skillspace",shortLabelKey:"skillSourcePicker.tabs.skillspaceShort",icon:B9e},{id:"skillhub",labelKey:"skillSourcePicker.tabs.skillhub",shortLabelKey:"skillSourcePicker.tabs.skillhubShort",icon:eM}];function kK({selected:e,onChange:t,cloudProvider:n,disabled:i=!1,addLabel:r,showSelectedCount:s=!0}){const{t:o}=_e("ui"),[l,c]=p.useState("local"),[u,d]=p.useState(!1),f=p.useId(),h=p.useId(),m=p.useRef(null),g=y6.findIndex(w=>w.id===l),b=r??o("skillSourcePicker.addSkill");p.useEffect(()=>{var S;if(!u)return;const w=document.body.style.overflow,x=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(S=m.current)==null||S.focus();const k=O=>{O.key==="Escape"&&d(!1)};return window.addEventListener("keydown",k),()=>{document.body.style.overflow=w,window.removeEventListener("keydown",k),x!=null&&x.isConnected&&x.focus()}},[u]);const v=(w,x)=>{x.source==="runtime"&&!window.confirm(o("skillSourcePicker.confirmRemoveRuntime",{name:x.name}))||t(e.filter(k=>b6(k)!==w))},y=w=>{const x=new Set(w.filter(k=>k.source!=="runtime").map(k=>k.folder));t(w.filter(k=>k.source!=="runtime"||!x.has(k.folder)))};return a.jsxs("div",{className:"cw-skillspane",children:[a.jsxs("button",{type:"button",className:"cw-skill-add","aria-haspopup":"dialog",disabled:i,onClick:()=>d(!0),children:[a.jsx("span",{className:"cw-skill-add-icon","aria-hidden":"true",children:a.jsx(ec,{className:"cw-i"})}),a.jsx("span",{children:b})]}),e.length>0&&a.jsxs("div",{className:"cw-skill-selected",children:[s?a.jsx("span",{className:"cw-skill-selected-label",children:o("skillSourcePicker.selectedCount",{count:e.length})}):null,a.jsx("div",{className:"cw-selected-skill-list",children:a.jsx(uf,{initial:!1,children:e.map(w=>a.jsx(IZt,{skill:w,disabled:i,onRemove:()=>v(b6(w),w)},b6(w)))})})]}),vi.createPortal(a.jsx(uf,{children:u&&a.jsx(_r.div,{className:"cw-skill-dialog-backdrop",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16},onMouseDown:w=>{w.target===w.currentTarget&&d(!1)},children:a.jsxs(_r.section,{className:"cw-skill-dialog",role:"dialog","aria-modal":"true","aria-labelledby":f,initial:{opacity:0,y:10,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:6,scale:.99},transition:{duration:.18,ease:"easeOut"},children:[a.jsxs("header",{className:"cw-skill-dialog-head",children:[a.jsx("h3",{id:f,children:b}),a.jsx("button",{ref:m,type:"button",className:"cw-skill-dialog-close","aria-label":o("skillSourcePicker.close",{label:b}),onClick:()=>d(!1),children:a.jsx(Bo,{className:"cw-i"})})]}),a.jsxs("div",{className:"cw-skill-dialog-body",children:[a.jsxs("div",{className:"cw-skill-sourcetabs",role:"tablist",style:{"--cw-skill-tab-slider-width":`calc((100% - 16px) / ${y6.length})`,"--cw-active-skill-tab-offset":`calc(${g*100}% + ${g*4}px)`},children:[a.jsx("span",{className:"cw-skill-tab-slider","aria-hidden":"true"}),y6.map(({id:w,labelKey:x,shortLabelKey:k,icon:S})=>a.jsxs("button",{type:"button",role:"tab",id:`${h}-${w}`,"aria-controls":h,"aria-selected":l===w,className:`cw-skill-pickertab ${l===w?"is-on":""}`,onClick:()=>c(w),children:[a.jsx(S,{className:"cw-i cw-i-sm"}),a.jsx("span",{className:"cw-skill-tab-label-full",children:o(x)}),a.jsx("span",{className:"cw-skill-tab-label-short",children:o(k)})]},w))]}),a.jsxs("div",{id:h,className:"cw-skill-tabbody",role:"tabpanel","aria-labelledby":`${h}-${l}`,children:[l==="skillhub"&&a.jsx(NZt,{selected:e,onChange:y}),l==="local"&&a.jsx(TZt,{selected:e,onChange:y}),l==="skillspace"&&a.jsx(NIe,{selected:e,onChange:y,cloudProvider:n})]})]})]})})}),document.body)]})}const U9e=128*1024,PZt={baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"};function Nw(e,t){return(t==null?void 0:t(`environmentCenter.dockerfileValidation.${e}`))??PZt[e]}function DL(e){return e.replace(/^\uFEFF/,"").replace(/\r\n?/g,` -`)}function Q9e(e){return new TextEncoder().encode(e).byteLength}function DZt(e,t="ubuntu:22.04"){const n=DL(e).match(/^\s*FROM(?:\s+--platform=\S+)?\s+(\S+)/im);return(n==null?void 0:n[1])??t}function MZt(e){const t=DL(e).split(` +`);if(!t.length||t[0].trim()!=="---")return{name:"",description:""};let n=-1;for(let r=1;r=2&&(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))}function wZt(...e){var t;for(const n of e){const i=(t=n.trim().replace(/\\/g,"/").split("/").filter(Boolean).pop())==null?void 0:t.replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"");if(i)return i.slice(0,64)}return"local-skill"}function kZt(e,t){return t.trim()||e}function $9e(e){const t=e.map(i=>({path:i.path.replace(/\\/g,"/").replace(/^\.\//,""),text:i.text})).filter(i=>i.path.length>0&&!i.path.endsWith("/")),n=new Set(t.map(i=>i.path.split("/")[0]));if(n.size===1&&t.every(i=>i.path.includes("/"))){const i=[...n][0]+"/";return t.map(r=>({path:r.path.slice(i.length),text:r.text}))}return t}function OZt(e){const t=new Map,n=new Set;for(const i of e)if(J7.test("/"+i.path)){const r=i.path.split("/");n.add(r.slice(0,-1).join("/"))}for(const i of e){const r=i.path.split("/");let s="";for(let u=r.length-1;u>=0;u--){const d=r.slice(0,u).join("/");if(n.has(d)){s=d;break}}const o=J7.test("/"+i.path);if(!s&&!o&&!n.has("")||!n.has(s)&&!o)continue;const l=s?i.path.slice(s.length+1):i.path,c=t.get(s)||[];c.push({path:l,text:i.text}),t.set(s,c)}return t}function SZt(e,t,n){const i=`${n}${e?"/"+e:""}`,r=t.find(c=>J7.test("/"+c.path));if(!r)return{hit:null,error:Yt("helpers.skills.missingManifest",{location:i})};const s=vZt(r.text),o=wZt(s.name,e,n.replace(/\.[^.]+$/,"")),l=[];for(const c of t){if(c.path.split("/").some(f=>f===".."))return{hit:null,error:Yt("helpers.skills.invalidParentPath",{location:i,path:c.path})};const d=`skills/${o}/${c.path}`;if(!d.startsWith(`skills/${o}/`))return{hit:null,error:Yt("helpers.skills.invalidPath",{location:i,path:c.path})};l.push({path:d,content:c.text})}return{hit:{source:"local",id:`local:${o}:${t.length}`,name:kZt(o,s.name),description:s.description||Yt("helpers.skills.localDescription"),folder:o,localFiles:l},error:null}}async function EZt(e){const t=new Uint8Array(await e.arrayBuffer()),i=(await L9e(t)).map(r=>({path:r.name,text:r.text}));return F9e($9e(i),e.name)}async function CZt(e,t=new Map){const n=[];for(let i=0;ie.file(t,n))}async function TZt(e){const t=e.createReader(),n=[];for(;;){const i=await new Promise((r,s)=>t.readEntries(r,s));if(i.length===0)return n;n.push(...i)}}async function B9e(e,t=""){const n=t?`${t}/${e.name}`:e.name;if(e.isFile)return[{file:await AZt(e),path:n}];if(!e.isDirectory)return[];const i=await TZt(e);return(await Promise.all(i.map(r=>B9e(r,n)))).flat()}function _Zt({selected:e,onChange:t}){const{t:n}=_e("create"),[i,r]=p.useState([]),[s,o]=p.useState([]),[l,c]=p.useState(!1),[u,d]=p.useState(!1),f=p.useRef(0),h=k=>e.some(S=>S.source==="local"&&S.folder===k),m=k=>{k.localFiles&&(h(k.folder||k.name)?t(e.filter(S=>!(S.source==="local"&&S.folder===(k.folder||k.name)))):t([...e,{source:"local",folder:k.folder||k.name,name:k.name,description:k.description,localFiles:k.localFiles}]))},g=p.useRef([]),b=p.useRef(e);p.useEffect(()=>{g.current=s},[s]),p.useEffect(()=>{b.current=e},[e]);const v=k=>{const S=new Set([...g.current.map(j=>j.folder||j.name),...b.current.filter(j=>j.source==="local").map(j=>j.folder)]),O=[],A=[];for(const j of k.hits){const T=j.folder||j.name;if(S.has(T)){O.push(j.name);continue}S.add(T),A.push(j)}o(j=>[...j,...A]);const E=[...k.errors];if(O.length>0&&E.push(n("skills.local.duplicatesSkipped",{names:O.join(", ")})),r(E),A.length===1&&k.errors.length===0&&O.length===0){const j=A[0];j.localFiles&&t([...b.current,{source:"local",folder:j.folder||j.name,name:j.name,description:j.description,localFiles:j.localFiles}])}},y=k=>{k.preventDefault(),f.current+=1,d(!0)},w=k=>{k.preventDefault(),f.current=Math.max(0,f.current-1),f.current===0&&d(!1)},x=async k=>{if(k.preventDefault(),f.current=0,d(!1),l)return;const S=Array.from(k.dataTransfer.items).map(O=>{var A;return(A=O.webkitGetAsEntry)==null?void 0:A.call(O)}).filter(O=>O!==null);if(S.length===0){r([n("skills.local.invalidDrop")]);return}c(!0);try{const O=(await Promise.all(S.map(j=>B9e(j)))).flat(),A=S.some(j=>j.isDirectory);if(!A&&O.length===1&&O[0].file.name.toLowerCase().endsWith(".zip")){v(await EZt(O[0].file));return}if(!A){r([n("skills.local.invalidDrop")]);return}const E=new Map(O.map(({file:j,path:T})=>[j,T]));v(await CZt(O.map(({file:j})=>j),E))}catch(O){r([n("skills.local.readError",{detail:O instanceof Error?O.message:String(O)})])}finally{c(!1)}};return a.jsxs("div",{className:"cw-local",children:[a.jsxs("div",{className:`cw-local-dropzone ${u?"is-dragging":""}`,role:"group","aria-label":n("skills.local.dropLabel"),onDragEnter:y,onDragOver:k=>k.preventDefault(),onDragLeave:w,onDrop:k=>void x(k),children:[a.jsx(bV,{className:"cw-local-drop-icon","aria-hidden":!0}),a.jsx("p",{className:"cw-local-drop-hint",children:n("skills.local.dropLabel")})]}),a.jsx("p",{className:"cw-local-hint",children:n("skills.local.hint")}),l&&a.jsx("p",{className:"cw-empty-line",children:n("skills.local.reading")}),i.length>0&&a.jsxs("div",{className:"cw-banner",children:[a.jsx(gm,{className:"cw-i"}),a.jsx("span",{children:i.join(";")})]}),s.length>0&&a.jsx("div",{className:"cw-skill-results",children:s.map(k=>{var O;const S=h(k.folder||k.name);return a.jsxs("button",{type:"button",className:`cw-skill-result ${S?"is-on":""}`,onClick:()=>m(k),"aria-pressed":S,children:[a.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:S?a.jsx(Of,{className:"cw-i cw-i-sm"}):a.jsx(ec,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:"cw-skill-result-meta",children:[a.jsx("span",{className:"cw-skill-result-name",children:k.name}),k.description&&a.jsx("span",{className:"cw-skill-result-desc",children:kC(k.description)}),a.jsx("span",{className:"cw-skill-result-repo",children:n("skills.local.fileCount",{count:((O=k.localFiles)==null?void 0:O.length)??0})})]})]},k.id)})})]})}const jZt="/harness/skills/findskill";async function NZt(e,t="public"){const n=e.trim(),i=new URLSearchParams({query:n,page_number:"1",page_size:"20"}),r=`${jZt}?${i.toString()}`,s=await fetch(r,{headers:{accept:"application/json"},signal:po(void 0,eo)});if(!s.ok)throw new Error(Yt("helpers.skills.searchFailed",{status:s.status}));return((await s.json()).items??[]).map(l=>({source:"skillhub",id:l.slug??l.name??"",slug:l.slug??"",name:l.name??l.slug??"",description:l.description??"",namespace:t,sourceRepo:l.sourceRepo,downloadCount:l.downloadCount,version:l.version}))}function RZt({selected:e,onChange:t}){const{t:n}=_e("create"),[i,r]=p.useState(""),[s,o]=p.useState([]),[l,c]=p.useState(!1),[u,d]=p.useState(null),[f,h]=p.useState(!1),m=v=>e.some(y=>y.source==="skillhub"&&y.slug===v),g=v=>{v.slug&&(m(v.slug)?t(e.filter(y=>!(y.source==="skillhub"&&y.slug===v.slug))):t([...e,{source:"skillhub",slug:v.slug,name:v.name,folder:v.slug.split("/").pop()||v.name,namespace:v.namespace||"public",description:v.description}]))},b=async v=>{c(!0),d(null),h(!0);try{const y=await NZt(v);o(y)}catch(y){d(y instanceof Error?y.message:n("skills.hub.searchError")),o([])}finally{c(!1)}};return p.useEffect(()=>{const v=i.trim();if(!v){o([]),h(!1),d(null);return}const y=setTimeout(()=>b(v),300);return()=>clearTimeout(y)},[i,n]),a.jsxs("div",{className:"cw-skillhub",children:[a.jsxs("div",{className:"cw-skill-searchrow",children:[a.jsxs("div",{className:"cw-skill-searchbox",children:[a.jsx(dI,{className:"cw-i cw-skill-searchicon","aria-hidden":!0}),a.jsx("input",{className:"cw-input cw-skill-input",value:i,placeholder:n("skills.hub.searchPlaceholder"),onChange:v=>r(v.target.value),onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),i.trim()&&b(i))}})]}),a.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft",onClick:()=>i.trim()&&b(i),disabled:!i.trim()||l,children:[l?a.jsx(Vi,{className:"cw-i cw-spin"}):a.jsx(dI,{className:"cw-i"}),n("skills.hub.search")]})]}),u&&a.jsxs("div",{className:"cw-banner",children:[a.jsx(gm,{className:"cw-i"}),a.jsx("span",{children:u})]}),l&&s.length===0?a.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[a.jsx(Vi,{className:"cw-i cw-spin"})," ",n("skills.hub.searching")]}):s.length>0?a.jsx("div",{className:"cw-skill-results",children:s.map(v=>{const y=m(v.slug||"");return a.jsxs("button",{type:"button",className:`cw-skill-result ${y?"is-on":""}`,onClick:()=>g(v),"aria-pressed":y,children:[a.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:y?a.jsx(Of,{className:"cw-i cw-i-sm"}):a.jsx(ec,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:"cw-skill-result-meta",children:[a.jsx("span",{className:"cw-skill-result-name",children:v.name}),v.description&&a.jsx("span",{className:"cw-skill-result-desc",children:kC(v.description)}),v.sourceRepo&&a.jsx("span",{className:"cw-skill-result-repo",children:v.sourceRepo})]})]},v.id||v.slug)})}):f&&!u?a.jsx("p",{className:"cw-empty-line",children:n("skills.hub.noResults")}):!f&&a.jsx("p",{className:"cw-empty-line",children:n("skills.hub.hint")})]})}function U9e({className:e}){return a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M5.5 7.5h10.75a2 2 0 0 1 2 2v7.75a2 2 0 0 1-2 2H5.5a2 2 0 0 1-2-2V9.5a2 2 0 0 1 2-2Z"}),a.jsx("path",{d:"M7 4.75h9.5a2 2 0 0 1 2 2",opacity:".58"}),a.jsx("path",{d:"m11 10.25.72 1.48 1.63.24-1.18 1.15.28 1.62-1.45-.77-1.45.77.28-1.62-1.18-1.15 1.63-.24.72-1.48Z"}),a.jsx("path",{d:"M19.25 11.25h1.5M20 10.5V12",opacity:".72"})]})}function b6(e){return e.source==="runtime"?`runtime:${e.folder}`:e.source==="skillhub"?`hub:${e.namespace}/${e.slug}`:e.source==="local"?`local:${e.folder}`:`ss:${e.skillSpaceId}/${e.skillId}/${e.version||""}`}function IZt(e){return e.source==="runtime"?"skillSourcePicker.sources.runtime":e.source==="local"?"skillSourcePicker.sources.local":e.source==="skillspace"?"skillSourcePicker.sources.skillspace":"skillSourcePicker.sources.skillhub"}function PZt({skill:e,onRemove:t,disabled:n}){const{t:i}=_e("ui");let r=gC;e.source==="local"||e.source==="runtime"?r=bV:e.source==="skillspace"&&(r=U9e);const s=`${i(IZt(e))}${e.description?` · ${kC(e.description)}`:""}`;return a.jsxs(_r.div,{className:"cw-selected-skill-row",layout:!0,initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.16},children:[a.jsx("span",{className:"cw-selected-skill-icon","aria-hidden":"true",children:a.jsx(r,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:"cw-selected-skill-meta",children:[a.jsx("span",{className:"cw-selected-skill-name",children:e.name}),a.jsx("span",{className:"cw-selected-skill-detail",tabIndex:0,title:s,children:s})]}),a.jsx("button",{type:"button",className:"cw-selected-skill-remove",onClick:t,disabled:n,"aria-label":i("skillSourcePicker.remove",{name:e.name}),title:i("skillSourcePicker.remove",{name:e.name}),children:a.jsx(Bo,{className:"cw-i cw-i-sm"})})]})}const y6=[{id:"local",labelKey:"skillSourcePicker.tabs.local",shortLabelKey:"skillSourcePicker.tabs.localShort",icon:bV},{id:"skillspace",labelKey:"skillSourcePicker.tabs.skillspace",shortLabelKey:"skillSourcePicker.tabs.skillspaceShort",icon:U9e},{id:"skillhub",labelKey:"skillSourcePicker.tabs.skillhub",shortLabelKey:"skillSourcePicker.tabs.skillhubShort",icon:eM}];function kK({selected:e,onChange:t,cloudProvider:n,disabled:i=!1,addLabel:r,showSelectedCount:s=!0}){const{t:o}=_e("ui"),[l,c]=p.useState("local"),[u,d]=p.useState(!1),f=p.useId(),h=p.useId(),m=p.useRef(null),g=y6.findIndex(w=>w.id===l),b=r??o("skillSourcePicker.addSkill");p.useEffect(()=>{var S;if(!u)return;const w=document.body.style.overflow,x=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(S=m.current)==null||S.focus();const k=O=>{O.key==="Escape"&&d(!1)};return window.addEventListener("keydown",k),()=>{document.body.style.overflow=w,window.removeEventListener("keydown",k),x!=null&&x.isConnected&&x.focus()}},[u]);const v=(w,x)=>{x.source==="runtime"&&!window.confirm(o("skillSourcePicker.confirmRemoveRuntime",{name:x.name}))||t(e.filter(k=>b6(k)!==w))},y=w=>{const x=new Set(w.filter(k=>k.source!=="runtime").map(k=>k.folder));t(w.filter(k=>k.source!=="runtime"||!x.has(k.folder)))};return a.jsxs("div",{className:"cw-skillspane",children:[a.jsxs("button",{type:"button",className:"cw-skill-add","aria-haspopup":"dialog",disabled:i,onClick:()=>d(!0),children:[a.jsx("span",{className:"cw-skill-add-icon","aria-hidden":"true",children:a.jsx(ec,{className:"cw-i"})}),a.jsx("span",{children:b})]}),e.length>0&&a.jsxs("div",{className:"cw-skill-selected",children:[s?a.jsx("span",{className:"cw-skill-selected-label",children:o("skillSourcePicker.selectedCount",{count:e.length})}):null,a.jsx("div",{className:"cw-selected-skill-list",children:a.jsx(uf,{initial:!1,children:e.map(w=>a.jsx(PZt,{skill:w,disabled:i,onRemove:()=>v(b6(w),w)},b6(w)))})})]}),vi.createPortal(a.jsx(uf,{children:u&&a.jsx(_r.div,{className:"cw-skill-dialog-backdrop",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16},onMouseDown:w=>{w.target===w.currentTarget&&d(!1)},children:a.jsxs(_r.section,{className:"cw-skill-dialog",role:"dialog","aria-modal":"true","aria-labelledby":f,initial:{opacity:0,y:10,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:6,scale:.99},transition:{duration:.18,ease:"easeOut"},children:[a.jsxs("header",{className:"cw-skill-dialog-head",children:[a.jsx("h3",{id:f,children:b}),a.jsx("button",{ref:m,type:"button",className:"cw-skill-dialog-close","aria-label":o("skillSourcePicker.close",{label:b}),onClick:()=>d(!1),children:a.jsx(Bo,{className:"cw-i"})})]}),a.jsxs("div",{className:"cw-skill-dialog-body",children:[a.jsxs("div",{className:"cw-skill-sourcetabs",role:"tablist",style:{"--cw-skill-tab-slider-width":`calc((100% - 16px) / ${y6.length})`,"--cw-active-skill-tab-offset":`calc(${g*100}% + ${g*4}px)`},children:[a.jsx("span",{className:"cw-skill-tab-slider","aria-hidden":"true"}),y6.map(({id:w,labelKey:x,shortLabelKey:k,icon:S})=>a.jsxs("button",{type:"button",role:"tab",id:`${h}-${w}`,"aria-controls":h,"aria-selected":l===w,className:`cw-skill-pickertab ${l===w?"is-on":""}`,onClick:()=>c(w),children:[a.jsx(S,{className:"cw-i cw-i-sm"}),a.jsx("span",{className:"cw-skill-tab-label-full",children:o(x)}),a.jsx("span",{className:"cw-skill-tab-label-short",children:o(k)})]},w))]}),a.jsxs("div",{id:h,className:"cw-skill-tabbody",role:"tabpanel","aria-labelledby":`${h}-${l}`,children:[l==="skillhub"&&a.jsx(RZt,{selected:e,onChange:y}),l==="local"&&a.jsx(_Zt,{selected:e,onChange:y}),l==="skillspace"&&a.jsx(RIe,{selected:e,onChange:y,cloudProvider:n})]})]})]})})}),document.body)]})}const Q9e=128*1024,DZt={baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"};function Nw(e,t){return(t==null?void 0:t(`environmentCenter.dockerfileValidation.${e}`))??DZt[e]}function DL(e){return e.replace(/^\uFEFF/,"").replace(/\r\n?/g,` +`)}function z9e(e){return new TextEncoder().encode(e).byteLength}function MZt(e,t="ubuntu:22.04"){const n=DL(e).match(/^\s*FROM(?:\s+--platform=\S+)?\s+(\S+)/im);return(n==null?void 0:n[1])??t}function LZt(e){const t=DL(e).split(` `),n=t.findIndex(i=>/^\s*FROM(?:\s|$)/i.test(i));return(n>=0?t.slice(n+1):t).join(` `).replace(/^\n+/,"")}function nR(e,t){const n=`FROM ${e.trim()}`,i=DL(t).replace(/^\n+/,"");return i?`${n} -${i}`:n}function LZt(e,t,n){return t.trim()?/^\s*FROM(?:\s|$)/im.test(e)?Nw("duplicateFrom",n):OK(nR(t,e),void 0,n):Nw("baseImageRequired",n)}function OK(e,t=Q9e(e),n){return t>U9e?Nw("tooLarge",n):e.trim()?/^\s*FROM\s+\S+/im.test(e)?"":Nw("missingFrom",n):Nw("empty",n)}async function $Zt(e,t){if(e.size>U9e)return{content:"",error:Nw("tooLarge",t)};const n=DL(await e.text());return{content:n,error:OK(n,e.size,t)}}function FZt(e){return VM(e,{lineWidth:0})}function BZt(e){return[{value:"custom",label:e("environmentCenter.creation.custom.label"),description:e("environmentCenter.creation.custom.description")},{value:"dockerfile",label:e("environmentCenter.creation.dockerfile.label"),description:e("environmentCenter.creation.dockerfile.description")},{value:"git",label:e("environmentCenter.creation.git.label"),description:e("environmentCenter.creation.git.description")},{value:"image",label:e("environmentCenter.creation.image.label"),description:e("environmentCenter.creation.image.description")}]}const UZt=FIe.map(e=>({value:e.id,label:e.label,description:e.description}));function QZt(e){return[{value:"none",label:e("common.none"),description:e("environmentCenter.presets.none")},{value:"aio-sandbox",label:"AIO Sandbox",description:e("environmentCenter.presets.aio")},{value:"codex-sandbox",label:"Codex Sandbox",description:e("environmentCenter.presets.codex")}]}function zZt(e){const t=DZt(e,"");return t===pH?"aio-sandbox":t.includes("/codexenv:")?"codex-sandbox":"none"}const VZt=yI.map(e=>({value:e.id,label:e.label})),ale=UIe.map(e=>({value:e.id,label:e.label}));function HZt(e){return[{value:"managed",label:e("environmentCenter.repository.managed")},{value:"existing",label:e("environmentCenter.repository.existing")}]}const eU=20,ole=new Set;function qZt(e){const t=e instanceof Error?e.message:String(e??"");return t.includes("HTTP 503")&&(t.includes("未配置持久化存储")||t.includes("storage is not configured"))}async function WZt(){var e;if(typeof navigator>"u"||!((e=navigator.permissions)!=null&&e.query))return!1;try{return(await navigator.permissions.query({name:"clipboard-read"})).state==="denied"}catch{return!1}}const KZt={opencli:rZt,uv:sZt,playwright:aZt,chromium:oZt,git:lZt,curl:cZt,ffmpeg:uZt,imagemagick:dZt};function GZt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function rf(){return a.jsx("span",{className:"environment-required-mark","aria-hidden":"true",children:"*"})}function XZt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M12 3v11m0 0 4-4m-4 4-4-4"}),a.jsx("path",{d:"M5 16v2.5A2.5 2.5 0 0 0 7.5 21h9a2.5 2.5 0 0 0 2.5-2.5V16"})]})}function tU(e,t){const n=e.trim();if(!n)return t("environmentCenter.errors.repositoryRequired");try{const i=new URL(n);if(i.protocol!=="https:"||!i.hostname)return t("environmentCenter.errors.repositoryHttps")}catch{return t("environmentCenter.errors.repositoryInvalid")}return""}function lle(e){return!!(e!=null&&e.region&&e.registry&&e.namespace&&e.repository)}function z9e(e,t){const n=e.trim();return n?/\s/.test(n)?t("environmentCenter.errors.imageReferenceWhitespace"):n.startsWith("sha256:")?/^sha256:[0-9a-fA-F]{64}$/.test(n)?"":t("environmentCenter.errors.imageDigestInvalid"):/[@/]/.test(n)?t("environmentCenter.errors.imageTagOnly"):"":""}function YZt(e){return(e instanceof Error?e.message:String(e)).split(` -原始响应:`,1)[0].trim()}function ZZt(e){return a.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5.5 10.5 16 5l10.5 5.5L16 16 5.5 10.5Z"}),a.jsx("path",{d:"M5.5 16 16 21.5 26.5 16M5.5 21.5 16 27l10.5-5.5"})]})}function JZt({label:e}){return a.jsx("span",{className:"environment-package-fallback",children:e.slice(0,1).toUpperCase()})}function eJt({option:e}){if(e.id==="lark-cli")return a.jsx("img",{src:PL,alt:""});if(e.id==="pandoc")return a.jsx("img",{src:iZt,alt:""});if(e.id==="github-cli")return a.jsx(wK,{});const t=KZt[e.id];return t?a.jsx("img",{src:t,alt:""}):a.jsx(JZt,{label:e.label})}function tJt(e,t){return e?{name:e.name,description:e.description,baseEnvironment:e.baseEnvironment,operatingSystem:e.operatingSystem,language:e.language,optionIds:[...e.optionIds],selectedSkills:[...e.selectedSkills],dockerfile:e.dockerfile===gH(e,t)?void 0:e.dockerfile,gitSource:e.gitSource,containerRepository:e.containerRepository,imageSource:e.imageSource}:{...a4,optionIds:[...a4.optionIds],selectedSkills:[...a4.selectedSkills]}}const Py=new Set(["preparing","queued","building","scanning"]),cle=3e3,v6={preparing:"environmentCenter.buildStatus.preparing",queued:"environmentCenter.buildStatus.queued",building:"environmentCenter.buildStatus.building",scanning:"environmentCenter.buildStatus.scanning",available:"environmentCenter.buildStatus.available",failed:"environmentCenter.buildStatus.failed"};function V9e(e,t){var i;const n=(i=e.latestVersion)==null?void 0:i.status;return n?n==="available"?{label:t(v6[n]),color:"success"}:n==="failed"?{label:t(v6[n]),color:"danger"}:{label:t(v6[n]),color:"warning"}:{label:t("environmentCenter.buildStatus.notBuilt"),color:"secondary"}}function nJt(e,t){return zT(e,Date.now(),t)}function iJt(e,t){const n=Date.parse(e);return Number.isNaN(n)?e:new Intl.DateTimeFormat(t,{dateStyle:"medium",timeStyle:"medium"}).format(n)}function rJt(e,t,n=Date.now()){const i=Date.parse(e.createdAt),s=Py.has(e.status)?n:Date.parse(e.updatedAt);if(Number.isNaN(i)||Number.isNaN(s))return"";const o=Math.max(0,Math.floor((s-i)/1e3));if(o<60)return t("environmentCenter.duration.seconds",{count:o});const l=Math.floor(o/60),c=o%60;return l<60?t("environmentCenter.duration.minutesSeconds",{minutes:l,seconds:c}):t("environmentCenter.duration.hoursMinutes",{hours:Math.floor(l/60),minutes:l%60})}function sJt({environment:e,onClose:t}){var x;const{t:n}=_e("ui"),i=((x=e.latestVersion)==null?void 0:x.versionId)??"",r=p.useId(),s=p.useRef(null),o=p.useRef(t),[l,c]=p.useState(null),[u,d]=p.useState(!0),[f,h]=p.useState(""),[m,g]=p.useState(0),[b,v]=p.useState("idle"),y=p.useMemo(()=>l?FZt(l):"",[l]);o.current=t,p.useEffect(()=>{var A;const k=document.body.style.overflow,S=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(A=s.current)==null||A.focus();const O=E=>{if(E.key==="Escape"){E.preventDefault(),o.current();return}if(E.key!=="Tab"||!s.current)return;const j=Array.from(s.current.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')).filter(C=>C.getClientRects().length>0);if(!j.length)return;const T=j[0],R=j[j.length-1];E.shiftKey&&document.activeElement===T?(E.preventDefault(),R.focus()):!E.shiftKey&&document.activeElement===R&&(E.preventDefault(),T.focus())};return window.addEventListener("keydown",O),()=>{document.body.style.overflow=k,window.removeEventListener("keydown",O),S!=null&&S.isConnected&&S.focus()}},[]),p.useEffect(()=>{const k=new AbortController;return d(!0),h(""),n2e(e.id,i,k.signal).then(c).catch(S=>{(S==null?void 0:S.name)!=="AbortError"&&h(S instanceof Error?S.message:String(S))}).finally(()=>{k.signal.aborted||d(!1)}),()=>k.abort()},[e.id,m,i]),p.useEffect(()=>{if(b!=="copied")return;const k=window.setTimeout(()=>v("idle"),1500);return()=>window.clearTimeout(k)},[b]);const w=async()=>{try{await navigator.clipboard.writeText(y),v("copied")}catch{v("error")}};return vi.createPortal(a.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:k=>{k.target===k.currentTarget&&t()},children:a.jsxs("section",{ref:s,className:"environment-build-dialog environment-manifest-dialog",role:"dialog","aria-modal":"true","aria-labelledby":r,"aria-busy":u||void 0,tabIndex:-1,children:[a.jsxs("header",{className:"environment-build-dialog__header",children:[a.jsxs("div",{children:[a.jsx("div",{className:"environment-build-dialog__title-row",children:a.jsx("h2",{id:r,children:n("environmentCenter.manifest.title")})}),a.jsxs("p",{children:[e.name," / ",i]})]}),a.jsx(At,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,onClick:t,"aria-label":n("environmentCenter.manifest.closeLabel"),children:a.jsx(Bo,{"aria-hidden":!0})})]}),a.jsx("div",{className:"environment-manifest-dialog__body",children:u?a.jsx("div",{className:"environment-manifest-dialog__state",role:"status",children:a.jsx(on,{as:"span",children:n("environmentCenter.manifest.loading")})}):f?a.jsxs("div",{className:"environment-manifest-dialog__state is-error",role:"alert",children:[a.jsx("p",{children:f}),a.jsx(At,{type:"button",color:"secondary",variant:"soft",size:"sm",onClick:()=>g(k=>k+1),children:n("common.reload")})]}):a.jsx("div",{className:"environment-manifest-dialog__editor","aria-label":n("environmentCenter.manifest.editorLabel"),children:a.jsx(BT,{value:y,path:"environment.yaml",readOnly:!0,onChange:()=>{}})})}),a.jsxs("footer",{className:"environment-build-dialog__actions",children:[b==="error"?a.jsx("span",{className:"environment-manifest-dialog__copy-error",role:"alert",children:n("environmentCenter.manifest.copyFailed")}):null,a.jsx(At,{type:"button",color:"secondary",variant:"ghost",size:"sm",onClick:t,children:n("common.close")}),a.jsx(At,{type:"button",color:"info",size:"sm",disabled:!y,onClick:()=>void w(),children:n(b==="copied"?"environmentCenter.manifest.copied":"environmentCenter.manifest.copy")})]})]})}),document.body)}function aJt({environment:e,onClose:t,onBuildUpdate:n,onRebuild:i}){var O,A;const{t:r}=_e("ui"),s=e.latestVersion,[o,l]=p.useState(s),[c,u]=p.useState(!!s),[d,f]=p.useState(""),[h,m]=p.useState(Date.now()),[g,b]=p.useState(!1),v=p.useId(),y=p.useRef(null),w=p.useRef(t),x=p.useRef(n);p.useEffect(()=>{w.current=t,x.current=n},[n,t]),p.useEffect(()=>{var R;const E=document.body.style.overflow,j=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(R=y.current)==null||R.focus();const T=C=>{var D;if(C.key==="Escape"&&w.current(),C.key!=="Tab")return;const N=Array.from(((D=y.current)==null?void 0:D.querySelectorAll('button:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])'))??[]).filter(_=>_.getClientRects().length>0);if(!N.length)return;const P=N[0],I=N[N.length-1];C.shiftKey&&document.activeElement===P?(C.preventDefault(),I.focus()):!C.shiftKey&&document.activeElement===I&&(C.preventDefault(),P.focus())};return window.addEventListener("keydown",T),()=>{document.body.style.overflow=E,window.removeEventListener("keydown",T),j!=null&&j.isConnected&&j.focus()}},[]),p.useEffect(()=>{if(!s)return;let E=0;const j=new AbortController,T=async()=>{u(!0);try{const R=await t2e(e.id,s.versionId,{includeLogs:!0,signal:j.signal});l(R),f(""),x.current(R),Py.has(R.status)&&(E=window.setTimeout(T,cle))}catch(R){if((R==null?void 0:R.name)==="AbortError")return;f(R instanceof Error?R.message:String(R)),E=window.setTimeout(T,cle)}finally{j.signal.aborted||u(!1)}};return T(),()=>{j.abort(),window.clearTimeout(E)}},[e.id,s==null?void 0:s.versionId]),p.useEffect(()=>{if(!o||!Py.has(o.status))return;const E=window.setInterval(()=>m(Date.now()),1e3);return()=>window.clearInterval(E)},[o==null?void 0:o.status]);const k=o?V9e({...e,latestVersion:o},r):{label:r("environmentCenter.buildStatus.notBuilt"),color:"secondary"},S=e.imageSource||(A=(O=o==null?void 0:o.resources)==null?void 0:O.codePipeline)==null?void 0:A.consoleUrl;return vi.createPortal(a.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:E=>{E.target===E.currentTarget&&t()},children:a.jsxs("section",{ref:y,className:"environment-build-dialog",role:"dialog","aria-modal":"true","aria-labelledby":v,tabIndex:-1,children:[a.jsxs("header",{className:"environment-build-dialog__header",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"environment-build-dialog__title-row",children:[a.jsx("h2",{id:v,children:r("environmentCenter.buildDetails.title")}),a.jsx(Za,{color:k.color,size:"sm",children:k.label})]}),a.jsx("p",{children:e.name})]}),a.jsx(At,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,onClick:t,"aria-label":r("environmentCenter.buildDetails.closeLabel"),children:a.jsx(Bo,{"aria-hidden":!0})})]}),a.jsxs("div",{className:"environment-build-dialog__summary",children:[a.jsxs("div",{children:[a.jsx("span",{children:r("environmentCenter.buildDetails.currentStep")}),a.jsx("strong",{children:(o==null?void 0:o.currentStep)||r("environmentCenter.buildDetails.waiting")})]}),a.jsxs("div",{children:[a.jsx("span",{children:r("environmentCenter.buildDetails.elapsed")}),a.jsx("strong",{children:o?rJt(o,r,h):"-"})]}),o!=null&&o.sourceCommitSha?a.jsxs("div",{children:[a.jsx("span",{children:r("environmentCenter.buildDetails.sourceCommit")}),a.jsx("strong",{title:o.sourceCommitSha,children:o.sourceCommitSha.slice(0,12)})]}):null,S?a.jsxs("a",{href:S,target:"_blank",rel:"noreferrer",children:[r("environmentCenter.buildDetails.openCodePipeline")," ",a.jsx(uv,{"aria-hidden":!0})]}):null]}),a.jsxs("div",{className:"environment-build-dialog__body",children:[d?a.jsx("p",{className:"environment-build-dialog__error",role:"alert",children:d}):null,o!=null&&o.progressError?a.jsx("p",{className:"environment-build-dialog__notice",children:o.progressError}):null,a.jsx(gZt,{steps:(o==null?void 0:o.steps)??[],log:(o==null?void 0:o.logTail)??"",logError:o==null?void 0:o.logError,logTruncated:o==null?void 0:o.logTruncated,logUpdatedAt:o==null?void 0:o.logUpdatedAt,loading:c&&!!(o&&Py.has(o.status))}),(o==null?void 0:o.status)==="failed"&&o.error?a.jsx("p",{className:"environment-build-dialog__failure",role:"alert",children:o.error}):null]}),a.jsxs("footer",{className:"environment-build-dialog__actions",children:[a.jsx(At,{type:"button",color:"secondary",variant:"ghost",size:"sm",onClick:t,children:r("common.close")}),o&&!e.imageSource&&!Py.has(o.status)?a.jsx(At,{type:"button",color:"info",size:"sm",disabled:g,onClick:()=>{b(!0),i().then(t).finally(()=>b(!1))},children:r(g?"environmentCenter.buildDetails.starting":"environmentCenter.buildDetails.rebuild")}):null]})]})}),document.body)}function H9e({cloudProvider:e,value:t,disabled:n,onChange:i}){const{t:r}=_e("ui"),s=Pu(e).map(o=>({value:o.value,label:o.label}));return a.jsxs("label",{className:"environment-field environment-region-field",children:[a.jsxs("span",{children:[r("environmentCenter.region"),a.jsx(rf,{})]}),a.jsx(ma,{id:"environment-region",value:t,options:s,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:n,triggerClassName:"environment-select-trigger",onChange:o=>i(o.value)})]})}function oJt({repositoryUrl:e,gitRef:t,dockerfilePath:n,inspection:i,inspectedKey:r,disabled:s,onRepositoryUrlChange:o,onGitRefChange:l,onDockerfilePathChange:c,onInspectionChange:u,onInspectedKeyChange:d}){const{t:f}=_e("ui"),[h,m]=p.useState(!1),[g,b]=p.useState(""),v=p.useRef(null),y=p.useRef(""),w=`${e.trim()}\0${t.trim()}`,x=r===w;p.useEffect(()=>()=>{const A=v.current;v.current=null,A==null||A.abort()},[]);const k=()=>{var A;(A=v.current)==null||A.abort(),v.current=null,m(!1),b(""),u(null),d(""),c(""),y.current=""},S=p.useCallback(async()=>{var j;const A=tU(e,f);if(A){b(A);return}y.current=w,(j=v.current)==null||j.abort();const E=new AbortController;v.current=E,m(!0),b("");try{const T=await WTe({repositoryUrl:e.trim(),...t.trim()?{ref:t.trim()}:{}},E.signal);if(v.current!==E)return;u(T),d(w),c(T.dockerfiles.length===1?T.dockerfiles[0]:"")}catch(T){if((T==null?void 0:T.name)==="AbortError")return;b(YZt(T)),u(null),d(""),c("")}finally{v.current===E&&(v.current=null,m(!1))}},[w,t,c,d,u,e,f]);p.useEffect(()=>{if(s||x||y.current===w||tU(e,f))return;const A=window.setTimeout(()=>void S(),600);return()=>window.clearTimeout(A)},[w,s,S,x,e,f]);const O=x?(i==null?void 0:i.dockerfiles)??[]:[];return a.jsxs("section",{className:"environment-source-section","aria-label":f("environmentCenter.git.sectionLabel"),children:[a.jsxs("div",{className:"environment-form-grid environment-git-fields",children:[a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[f("environmentCenter.git.address"),a.jsx(rf,{})]}),a.jsx(js,{size:"lg",type:"url",required:!0,value:e,placeholder:"https://github.com/owner/repository.git",autoComplete:"url",disabled:s,"aria-invalid":!!g,onChange:A=>{k(),o(A.currentTarget.value)}})]}),a.jsxs("label",{className:"environment-field",children:[a.jsx("span",{children:f("environmentCenter.git.ref")}),a.jsx(js,{size:"lg",value:t,placeholder:f("environmentCenter.git.defaultBranch"),autoComplete:"off",disabled:s,onChange:A=>{k(),l(A.currentTarget.value)}})]})]}),a.jsxs("div",{className:"environment-inspection-status environment-form-feedback","aria-live":"polite",children:[h?a.jsx(on,{as:"span",children:f("environmentCenter.git.inspecting")}):null,g?a.jsxs("div",{className:"environment-source-error",role:"alert",children:[a.jsx("span",{children:g}),a.jsxs(At,{type:"button",color:"primary",size:"sm",pill:!1,disabled:s,onClick:()=>void S(),children:[a.jsx(YD,{}),f("common.retry")]})]}):null,!h&&!g&&x&&i?O.length>0?a.jsx("span",{children:i.commitSha?f("environmentCenter.git.foundDockerfiles",{commit:i.commitSha.slice(0,12),count:O.length}):f("environmentCenter.git.savedDockerfileLoaded")}):a.jsxs("div",{className:"environment-source-error",role:"alert",children:[a.jsx("span",{children:f("environmentCenter.git.noDockerfile")}),a.jsx("button",{type:"button",disabled:s,onClick:()=>void S(),children:f("environmentCenter.git.inspectAgain")})]}):null]}),O.length>0?a.jsxs("label",{className:"environment-field environment-dockerfile-picker",children:[a.jsxs("span",{children:["Dockerfile",a.jsx(rf,{})]}),a.jsx(bf,{ariaLabel:f("environmentCenter.git.selectDockerfile"),value:n,valueLabel:n,placeholder:f("environmentCenter.git.selectDockerfile"),options:O.map(A=>({value:A,label:A})),disabled:s||h,onChange:c})]}):null]})}function lJt({cloudProvider:e,mode:t,region:n,value:i,disabled:r,onModeChange:s,onRegionChange:o,onChange:l}){const{t:c}=_e("ui");return a.jsx("section",{className:"environment-source-section","aria-label":c("environmentCenter.repository.outputSection"),children:a.jsxs("div",{className:"environment-form-grid",children:[a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[c("environmentCenter.repository.type"),a.jsx(rf,{})]}),a.jsx(ma,{id:"environment-repository-mode",value:t,options:HZt(c),optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:r,triggerClassName:"environment-select-trigger",onChange:u=>s(u.value)})]}),a.jsx(H9e,{cloudProvider:e,value:n,disabled:r,onChange:o}),t==="existing"?a.jsx(R9e,{region:n,value:i,disabled:r,onChange:l}):a.jsx("p",{className:"environment-source-note environment-form-feedback",children:c("environmentCenter.repository.managedHint")})]})})}function cJt({cloudProvider:e,region:t,repository:n,reference:i,disabled:r,onRegionChange:s,onRepositoryChange:o,onReferenceChange:l}){const{t:c}=_e("ui"),u=z9e(i,c);return a.jsx("section",{className:"environment-source-section","aria-label":c("environmentCenter.existingImage.sectionLabel"),children:a.jsxs("div",{className:"environment-form-grid",children:[a.jsx(H9e,{cloudProvider:e,value:t,disabled:r,onChange:s}),a.jsx(R9e,{region:t,value:n,disabled:r,onChange:o}),a.jsxs("label",{className:"environment-field environment-image-reference",children:[a.jsxs("span",{children:[c("environmentCenter.existingImage.reference"),a.jsx(rf,{})]}),a.jsx(js,{size:"lg",value:i,required:!0,placeholder:c("environmentCenter.existingImage.placeholder"),autoComplete:"off",disabled:r,"aria-invalid":!!u,onChange:d=>l(d.currentTarget.value)}),u?a.jsx("small",{className:"environment-source-field__error",role:"alert",children:u}):a.jsx("small",{children:c("environmentCenter.existingImage.hint")})]})]})})}function q9e(e,t,n,i){const r=p.useRef(n),s=p.useRef(i);r.current=n,s.current=i,p.useEffect(()=>{const o=document.body.style.overflow,l=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden";const c=window.requestAnimationFrame(()=>{var d;return(d=t.current)==null?void 0:d.focus()}),u=d=>{var g;if(d.key==="Escape"&&!s.current){d.preventDefault(),r.current();return}if(d.key!=="Tab")return;const f=Array.from(((g=e.current)==null?void 0:g.querySelectorAll('button:not([disabled]), textarea:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])'))??[]).filter(b=>b.getClientRects().length>0);if(!f.length)return;const h=f[0],m=f[f.length-1];d.shiftKey&&document.activeElement===h?(d.preventDefault(),m.focus()):!d.shiftKey&&document.activeElement===m&&(d.preventDefault(),h.focus())};return window.addEventListener("keydown",u),()=>{window.cancelAnimationFrame(c),document.body.style.overflow=o,window.removeEventListener("keydown",u),l!=null&&l.isConnected&&l.focus()}},[e,t])}function uJt({environment:e,onClose:t}){const{t:n}=_e("ui"),i=p.useId(),r=p.useId(),s=p.useRef(null),o=p.useRef(null),[l,c]=p.useState(""),[u,d]=p.useState("loading"),[f,h]=p.useState(""),m=u==="loading";q9e(s,o,t,m);const g=async(b="",v)=>{d("loading"),h("");try{const y=b||(await KTe(e.id,v)).shareCode;c(y),await LTe(y),v!=null&&v.aborted||d("copied")}catch(y){if((y==null?void 0:y.name)==="AbortError")return;h(y instanceof Error?y.message:String(y)),d("error")}};return p.useEffect(()=>{const b=new AbortController;return g("",b.signal),()=>b.abort()},[e.id]),vi.createPortal(a.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:b=>{b.target===b.currentTarget&&!m&&t()},children:a.jsxs("section",{ref:s,className:"environment-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":i,"aria-describedby":r,"aria-busy":m||void 0,children:[a.jsxs("header",{className:"environment-build-dialog__header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:i,children:n("environmentCenter.share.title")}),a.jsx("p",{id:r,children:e.name})]}),a.jsx(At,{ref:o,type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,disabled:m,onClick:t,"aria-label":n("environmentCenter.share.closeLabel"),children:a.jsx(Bo,{"aria-hidden":!0})})]}),a.jsx("div",{className:"environment-share-dialog__body",children:u==="loading"?a.jsx(on,{as:"p",children:n("environmentCenter.share.generating")}):a.jsxs("div",{className:"environment-share-dialog__result",children:[u==="copied"?a.jsx("p",{className:"environment-share-dialog__success",role:"status","aria-live":"polite",children:n("environmentCenter.share.copied")}):a.jsxs("div",{className:"environment-share-dialog__error",role:"alert",children:[a.jsx("strong",{children:n("environmentCenter.share.failed")}),a.jsx("span",{children:f})]}),l?a.jsxs("label",{className:"environment-share-dialog__field environment-share-dialog__manual-code",children:[a.jsx("span",{children:n("environmentCenter.share.code")}),a.jsx(bb,{size:"lg",rows:4,value:l,readOnly:!0,"aria-label":n("environmentCenter.share.fullCode"),onFocus:b=>b.currentTarget.select(),onClick:b=>b.currentTarget.select()}),a.jsx("small",{children:n(u==="copied"?"environmentCenter.share.copiedHint":"environmentCenter.share.copyFailedHint")})]}):null,a.jsx("p",{className:"environment-share-dialog__safety",children:n("environmentCenter.share.safety")})]})}),a.jsxs("footer",{className:"environment-build-dialog__actions",children:[a.jsx(At,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:m,onClick:t,children:n("common.close")}),u==="error"?a.jsx(At,{type:"button",color:"info",size:"sm",onClick:()=>void g(l),children:n("common.retry")}):u==="copied"?a.jsx(At,{type:"button",color:"info",size:"sm",onClick:()=>void g(l),children:n("environmentCenter.share.copyAgain")}):null]})]})}),document.body)}function dJt({initialValue:e,autoInspect:t,onClose:n,onImported:i}){const{t:r}=_e("ui"),s=p.useId(),o=p.useId(),l=p.useId(),c=p.useRef(null),u=p.useRef(null),d=p.useRef(!1),[f,h]=p.useState(e),[m,g]=p.useState("editing"),[b,v]=p.useState([]),[y,w]=p.useState(""),[x,k]=p.useState([]),S=p.useMemo(()=>Pz(f),[f]),O=S.length>eU,A=m==="inspecting"||m==="importing",E=b.filter(P=>P.status==="valid"),j=b.filter(P=>P.status==="invalid"),T=m==="ready"&&E.length>0;q9e(c,u,n,A);const R=p.useCallback(async()=>{if(!(!S.length||O)){g("inspecting"),w(""),k([]);try{const P=await GTe(S);v([...P].sort((I,D)=>I.index-D.index)),g("ready")}catch(P){w(P instanceof Error?P.message:String(P)),g("editing")}}},[S,O]);p.useEffect(()=>{!t||d.current||(d.current=!0,R())},[t,R]);const C=async()=>{if(T){g("importing"),w(""),k([]);try{const P=E.map(U=>({code:S[U.index],name:U.name})).filter(U=>!!U.code),I=await XTe(P.map(U=>U.code)),D=I.filter(U=>U.status==="created").length,_=I.filter(U=>U.status==="duplicate").length,L=new Map(I.map(U=>[U.index,U])),F=P.flatMap(({code:U,name:Z},z)=>{const J=L.get(z);return!J||J.status==="failed"?[{code:U,name:Z,status:"valid",error:(J==null?void 0:J.error)||r("environmentCenter.import.noResult")}]:[]}),H=[...j.flatMap(U=>{const Z=S[U.index];return Z?[{code:Z,name:"",status:"invalid",error:U.error||r("environmentCenter.import.invalidCode")}]:[]}),...F],q=new Map;if(I.forEach(U=>{U.environment&&q.set(U.environment.id,U.environment)}),i([...q.values()],D,_,H.length),!H.length){n();return}h(H.map(U=>U.code).join(` -`)),k(F),v(H.map((U,Z)=>({index:Z,status:U.status,name:U.name,error:U.status==="invalid"?U.error:""}))),w(r("environmentCenter.import.partial",{created:D,remaining:H.length})),g("ready")}catch(P){w(P instanceof Error?P.message:String(P)),g("ready")}}},N=m==="inspecting"?r("environmentCenter.import.inspecting"):m==="importing"?r("environmentCenter.import.importing"):T?x.length?r("environmentCenter.import.retryImport"):r("environmentCenter.import.confirm"):r("environmentCenter.import.inspectCodes");return vi.createPortal(a.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:P=>{P.target===P.currentTarget&&!A&&n()},children:a.jsxs("section",{ref:c,className:"environment-share-dialog environment-import-dialog",role:"dialog","aria-modal":"true","aria-labelledby":s,"aria-describedby":o,"aria-busy":A||void 0,children:[a.jsxs("header",{className:"environment-build-dialog__header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:s,children:r("environmentCenter.import.title")}),a.jsx("p",{id:o,children:r("environmentCenter.import.description")})]}),a.jsx(At,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,disabled:A,onClick:n,"aria-label":r("environmentCenter.import.closeLabel"),children:a.jsx(Bo,{"aria-hidden":!0})})]}),a.jsxs("div",{className:"environment-share-dialog__body",children:[a.jsxs("label",{className:"environment-share-dialog__field",children:[a.jsx("span",{children:r("environmentCenter.import.code")}),a.jsx(bb,{ref:u,size:"lg",rows:6,value:f,disabled:A,"aria-invalid":O||j.length>0||void 0,"aria-describedby":l,placeholder:"akenv://v1/...",onChange:P=>{h(P.currentTarget.value),g("editing"),v([]),w(""),k([])}})]}),a.jsx("p",{id:l,className:`environment-share-dialog__help${O?" is-error":""}`,children:O?r("environmentCenter.import.tooMany",{max:eU,count:S.length}):r("environmentCenter.import.multipleHint")}),a.jsx("p",{className:"environment-share-dialog__safety",children:r("environmentCenter.import.safety")}),m==="inspecting"?a.jsx(on,{as:"p",children:r("environmentCenter.import.inspectingCodes")}):E.length?a.jsx("p",{className:"environment-share-dialog__summary",role:"status","aria-live":"polite",children:r("environmentCenter.import.found",{count:E.length,names:E.map(P=>P.name||r("environmentCenter.unnamed")).join(r("environmentCenter.listSeparator"))})}):null,j.length?a.jsx("ul",{className:"environment-share-dialog__failures",role:"alert",children:j.map(P=>a.jsx("li",{children:r("environmentCenter.import.itemError",{index:P.index+1,error:P.error||r("environmentCenter.import.invalidCode")})},P.index))}):null,x.length?a.jsx("ul",{className:"environment-share-dialog__failures",role:"alert",children:x.map((P,I)=>a.jsx("li",{children:r("environmentCenter.import.itemError",{index:I+1,error:P.error})},`${P.code}:${I}`))}):null,y?a.jsx("p",{className:"environment-share-dialog__error-text",role:"alert",children:y}):null]}),a.jsxs("footer",{className:"environment-build-dialog__actions",children:[a.jsx(At,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:A,onClick:n,children:r("common.cancel")}),a.jsx(At,{type:"button",color:"info",size:"sm",loading:A,disabled:A||!S.length||O||m==="ready"&&!T,onClick:()=>T?void C():void R(),children:N})]})]})}),document.body)}function fJt({environment:e,cloudProvider:t,onCancel:n,onDelete:i,onShare:r,onSave:s}){var Re,Ue,_t,Pt,Gt,St,Lt;const{t:o,i18n:l}=_e("ui"),c=BZt(o),u=tJt(e,t),d=u.dockerfile!==void 0,[f,h]=p.useState(()=>({...u,dockerfile:d?void 0:u.dockerfile})),[m,g]=p.useState(u.gitSource?"git":u.imageSource?"image":d?"dockerfile":"custom"),[b,v]=p.useState(d?(e==null?void 0:e.dockerfile)??"":""),[y,w]=p.useState(""),x=p.useRef(null),[k,S]=p.useState(()=>d?zZt((e==null?void 0:e.dockerfile)??""):u.baseEnvironment==="aio-sandbox"||u.baseEnvironment==="codex-sandbox"?u.baseEnvironment:"none"),[O,A]=p.useState(((Re=u.gitSource)==null?void 0:Re.repositoryUrl)??""),[E,j]=p.useState(((Ue=u.gitSource)==null?void 0:Ue.ref)??""),[T,R]=p.useState(((_t=u.gitSource)==null?void 0:_t.dockerfilePath)??""),[C,N]=p.useState(u.gitSource?{repositoryUrl:u.gitSource.repositoryUrl,ref:u.gitSource.ref??"",commitSha:"",dockerfiles:[u.gitSource.dockerfilePath]}:null),[P,I]=p.useState(u.gitSource?`${u.gitSource.repositoryUrl}\0${u.gitSource.ref??""}`:""),[D,_]=p.useState(u.containerRepository?"existing":"managed"),[L,F]=p.useState(((Pt=u.containerRepository)==null?void 0:Pt.region)??nr(t)),[M,H]=p.useState(u.containerRepository??void 0),[q,U]=p.useState(((Gt=u.imageSource)==null?void 0:Gt.region)??nr(t)),[Z,z]=p.useState(u.imageSource?{region:u.imageSource.region,registry:u.imageSource.registry,namespace:u.imageSource.namespace,repository:u.imageSource.repository}:void 0),[J,ne]=p.useState(((St=u.imageSource)==null?void 0:St.reference)??""),[W,X]=p.useState(!1),le=p.useMemo(()=>gH(f,t),[t,f.baseEnvironment,f.operatingSystem,f.language,f.optionIds]),V=f.dockerfile??le,Y=k!=="none",K=k==="aio-sandbox"?pH:k==="codex-sandbox"?BIe[t]:"",ue=Y?MZt(b):b,te=Y?nR(K,""):"",Oe=Y?nR(K,ue):b,fe=y||(Y?LZt(ue,K,o):OK(b,void 0,o)),pe=!!e,Se="environment-editor-form",[ve,Le]=p.useState(!1),[He,Ge]=p.useState(""),De=!!Oe.trim()&&!fe,se=`${O.trim()}\0${E.trim()}`,ce=!tU(O,o)&&P===se&&!!T&&(D==="managed"||lle(M)),ye=lle(Z)&&!!J.trim()&&!z9e(J,o),Ae=!!f.name.trim()&&!ve&&(m==="custom"||m==="dockerfile"&&De||m==="git"&&ce||m==="image"&&ye),Ee=(qe,yt)=>{h(je=>({...je,optionIds:yt?[...je.optionIds,qe]:je.optionIds.filter(kt=>kt!==qe)}))},Ce=qe=>{w(""),v(Y?nR(K,qe):qe)},Be=async qe=>{if(!qe)return;const yt=await $Zt(qe,o);w(yt.error),yt.content&&v(yt.content)},he=()=>{w(""),v(te)},ie=async qe=>{if(qe.preventDefault(),!!Ae){Le(!0),Ge("");try{const yt=_mt(Oe);await s({...f,name:f.name.trim(),description:f.description.trim(),optionIds:m==="custom"?f.optionIds:[],selectedSkills:m==="custom"?f.selectedSkills:[],dockerfile:m==="dockerfile"?Oe:m==="custom"?V:"",gitSource:m==="git"?{repositoryUrl:O.trim(),...E.trim()?{ref:E.trim()}:{},dockerfilePath:T}:null,containerRepository:m==="git"&&D==="existing"?M:null,imageSource:m==="image"&&Z?{...Z,reference:J.trim()}:null,...m==="dockerfile"?yt:{}})}catch(yt){Ge(yt instanceof Error?yt.message:String(yt)),Le(!1)}}},we=f.name.trim()||(pe?(e==null?void 0:e.name)||o("environmentCenter.configure"):o("environmentCenter.create"));return a.jsx(Ch,{className:"environment-editor","aria-label":o(pe?"environmentCenter.details":"environmentCenter.create"),children:a.jsx(dT,{title:we,description:o("environmentCenter.editorDescription"),identitySeed:we,backLabel:o("environmentCenter.backToList"),onBack:n,actions:a.jsxs(a.Fragment,{children:[i?a.jsx(At,{type:"button",color:"danger",variant:"ghost",size:"sm",onClick:i,disabled:ve,children:o("common.delete")}):null,r?a.jsx(At,{color:"secondary",variant:"soft",size:"sm",onClick:r,disabled:ve,children:o("environmentCenter.share.action")}):null,a.jsx(At,{color:"secondary",variant:"soft",size:"sm",onClick:n,disabled:ve,children:o("common.cancel")}),a.jsx(At,{color:"info",size:"sm",type:"submit",form:Se,disabled:!Ae,children:o(ve?"common.saving":m==="image"?pe?"environmentCenter.save":"environmentCenter.create":pe?"environmentCenter.saveAndBuild":"environmentCenter.createAndBuild")})]}),children:a.jsxs("form",{id:Se,className:"environment-form",onSubmit:ie,children:[a.jsxs("div",{className:"environment-fields",children:[a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[o("environmentCenter.name"),a.jsx(rf,{})]}),a.jsx(js,{className:"environment-text-input",type:"text",size:"lg",required:!0,value:f.name,maxLength:60,placeholder:o("environmentCenter.namePlaceholder"),onChange:qe=>h(yt=>({...yt,name:qe.target.value}))})]}),a.jsxs("label",{className:"environment-field",children:[a.jsx("span",{children:o("common.description")}),a.jsx(bb,{className:"environment-description-input",size:"lg",rows:3,value:f.description,maxLength:180,placeholder:o("environmentCenter.descriptionPlaceholder"),onChange:qe=>h(yt=>({...yt,description:qe.target.value}))})]})]}),a.jsxs("label",{className:"environment-field environment-creation-method",children:[a.jsxs("span",{children:[o("environmentCenter.creationMethod"),a.jsx(rf,{})]}),a.jsx(ma,{id:"environment-creation-method",value:m,options:c,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:qe=>{const yt=qe.value;g(yt),yt==="dockerfile"&&!b.trim()&&v(te),Ge("")}}),a.jsx("small",{children:(Lt=c.find(qe=>qe.value===m))==null?void 0:Lt.description})]}),He?a.jsx("p",{className:"environment-form-error",role:"alert",children:He}):null,m==="custom"?a.jsxs("div",{className:"environment-configuration",children:[a.jsx("section",{className:"environment-section environment-form-section","aria-label":o("environmentCenter.baseConfiguration"),children:a.jsxs("div",{className:"environment-form-grid",children:[a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[o("environmentCenter.baseEnvironment"),a.jsx(rf,{})]}),a.jsx(ma,{id:"environment-base-environment",value:f.baseEnvironment,options:UZt.map(qe=>({...qe,description:o(`environmentCenter.baseDescriptions.${qe.value}`)})),optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:qe=>{const yt=qe.value,je=yt==="aio-sandbox"||yt==="codex-sandbox";h(kt=>({...kt,baseEnvironment:yt,operatingSystem:je?"ubuntu-22.04":kt.operatingSystem,language:je?"python-3.12":kt.language}))}}),a.jsx("small",{children:o(`environmentCenter.baseDescriptions.${f.baseEnvironment}`)})]}),a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[o("environmentCenter.operatingSystem"),a.jsx(rf,{})]}),a.jsx(ma,{id:"environment-operating-system",value:f.operatingSystem,options:VZt,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:f.baseEnvironment!=="ubuntu",triggerClassName:"environment-select-trigger",onChange:qe=>h(yt=>({...yt,operatingSystem:qe.value}))}),a.jsx("small",{children:f.baseEnvironment!=="ubuntu"?o("environmentCenter.fixedByBase",{base:IB(f.baseEnvironment),value:"Ubuntu 22.04"}):o("environmentCenter.selectUbuntuVersion")})]}),a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[o("environmentCenter.pythonVersion"),a.jsx(rf,{})]}),a.jsx(ma,{id:"environment-python-version",value:f.language,options:f.baseEnvironment!=="ubuntu"?ale.filter(qe=>qe.value==="python-3.12"):ale,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:f.baseEnvironment!=="ubuntu",triggerClassName:"environment-select-trigger",onChange:qe=>h(yt=>({...yt,language:qe.value}))}),a.jsx("small",{children:f.baseEnvironment!=="ubuntu"?o("environmentCenter.fixedByBase",{base:IB(f.baseEnvironment),value:"Python 3.12"}):o("environmentCenter.selectPythonVersion")})]})]})}),a.jsxs("section",{className:"environment-section","aria-labelledby":"environment-skills-title",children:[a.jsx("h2",{id:"environment-skills-title",children:o("environmentCenter.skills")}),a.jsxs("div",{className:"environment-skill-grid",children:[a.jsx(sle,{name:"VeADK",description:o("environmentCenter.veadkDescription"),selected:W,disabled:ve,onChange:X,icon:a.jsx("img",{src:fM,alt:""})}),a.jsx(kK,{selected:f.selectedSkills,onChange:qe=>h(yt=>({...yt,selectedSkills:qe})),cloudProvider:t,disabled:ve,addLabel:o("environmentCenter.addSkill"),showSelectedCount:!1})]})]}),mH.map(qe=>a.jsxs("section",{className:"environment-section","aria-labelledby":`environment-${qe.id}-title`,children:[a.jsx("h2",{id:`environment-${qe.id}-title`,children:o(`environmentCenter.categories.${qe.id}`)}),a.jsx("div",{className:"environment-option-grid",children:qe.options.map(yt=>{const je=f.optionIds.includes(yt.id);return a.jsx(sle,{name:yt.label,description:o(`environmentCenter.options.${yt.id}`,{defaultValue:yt.description}),selected:je,onChange:kt=>Ee(yt.id,kt),icon:a.jsx(eJt,{option:yt})},yt.id)})})]},qe.id))]}):m==="dockerfile"?a.jsxs("section",{className:"environment-upload","aria-label":o("environmentCenter.customDockerfile"),children:[a.jsx("div",{className:"environment-dockerfile-settings environment-form-grid",children:a.jsxs("label",{className:"environment-field",children:[a.jsx("span",{children:o("environmentCenter.presetEnvironment")}),a.jsx(ma,{id:"environment-dockerfile-base-environment",value:k,options:QZt(o),optionClassName:"environment-select-option",size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:qe=>{w(""),S(qe.value)}}),a.jsx("small",{children:o("environmentCenter.presetHint")})]})}),a.jsxs("div",{className:"environment-upload__preview",children:[a.jsxs("div",{children:[a.jsxs("h3",{children:["Dockerfile",a.jsx(rf,{})]}),a.jsxs("div",{className:"environment-upload__actions",children:[a.jsx("span",{className:"environment-upload__size",children:o("environmentCenter.dockerfileSize",{size:Q9e(Oe).toLocaleString(l.resolvedLanguage??l.language),max:131072 .toLocaleString(l.resolvedLanguage??l.language)})}),a.jsx("input",{ref:x,className:"environment-upload__file-input",type:"file",accept:".dockerfile,text/plain",tabIndex:-1,hidden:!0,onChange:qe=>{var je;const yt=qe.currentTarget;Be((je=yt.files)==null?void 0:je[0]).finally(()=>{yt.value=""})}}),a.jsx(At,{className:"environment-upload__action",type:"button",color:"secondary",variant:"soft",size:"sm",pill:!1,disabled:ve,onClick:()=>{var qe;return(qe=x.current)==null?void 0:qe.click()},children:o("environmentCenter.upload")}),a.jsx(At,{className:"environment-upload__action",type:"button",color:"secondary",variant:"ghost",size:"sm",pill:!1,disabled:ve||!ue,onClick:he,children:o("environmentCenter.reset")})]})]}),a.jsxs("div",{className:`environment-dockerfile-editor${Y?" has-fixed-base":""}${fe?" is-invalid":""}`,children:[Y?a.jsxs("div",{className:"environment-dockerfile-from","aria-label":o("environmentCenter.dockerfileBaseImage"),children:[a.jsx("span",{className:"environment-dockerfile-from__line","aria-hidden":"true",children:"1"}),a.jsxs("code",{children:[a.jsx("span",{className:"environment-dockerfile-from__keyword",children:"FROM"}),a.jsx("span",{title:K,children:K})]})]}):null,a.jsx("div",{className:"environment-dockerfile__editor environment-upload__editor","aria-label":o("environmentCenter.dockerfileContent"),children:a.jsx(BT,{value:ue,path:"Dockerfile",lineNumberStart:Y?2:1,height:"auto",minHeight:"28px",maxHeight:"var(--environment-dockerfile-editor-max-height)",onChange:Ce})})]})]}),fe?a.jsx("p",{className:"environment-upload__error environment-upload__error--below",role:"alert",children:fe}):null]}):m==="git"?a.jsxs("div",{className:"environment-source-workflow",children:[a.jsx(oJt,{repositoryUrl:O,gitRef:E,dockerfilePath:T,inspection:C,inspectedKey:P,disabled:ve,onRepositoryUrlChange:A,onGitRefChange:j,onDockerfilePathChange:R,onInspectionChange:N,onInspectedKeyChange:I}),a.jsx(lJt,{cloudProvider:t,mode:D,region:L,value:M,disabled:ve,onModeChange:qe=>{_(qe),Ge("")},onRegionChange:qe=>{F(qe),H(void 0),Ge("")},onChange:H})]}):a.jsx(cJt,{cloudProvider:t,region:q,repository:Z,reference:J,disabled:ve,onRegionChange:qe=>{U(qe),z(void 0),Ge("")},onRepositoryChange:z,onReferenceChange:ne})]})})})}function W9e({cloudProvider:e="volcengine",onWorkspace:t,onProjects:n,clipboardImport:i=null,clipboardReadError:r=""}){const{t:s,i18n:o}=_e("ui"),[l,c]=p.useState([]),[u,d]=p.useState({kind:"list"}),[f,h]=p.useState(""),[m,g]=p.useState(null),[b,v]=p.useState(null),[y,w]=p.useState(null),[x,k]=p.useState(null),[S,O]=p.useState(null),A=p.useRef(0),[E,j]=p.useState(""),[T,R]=p.useState(!1),[C,N]=p.useState(r),[P,I]=p.useState(!0),[D,_]=p.useState(""),[L,F]=p.useState(0),[M,H]=p.useState(()=>new Set),q=p.useDeferredValue(f),U=p.useMemo(()=>{const Y=q.trim().toLocaleLowerCase();return Y?l.filter(K=>`${K.name} ${K.description} ${RB(K.operatingSystem)} ${Fp(K.language)} ${IB(K.baseEnvironment)}`.toLocaleLowerCase().includes(Y)):l},[q,l]),Z=p.useCallback((Y="",K=!1)=>{A.current+=1,O({key:A.current,initialValue:Y,autoInspect:K})},[]),z=p.useCallback((Y,K=!1)=>{const ue=Y.trim();if(!ue.startsWith("akenv://")||!K&&ole.has(ue))return!1;const te=Pz(ue);return!te.length||te.length>eU?!1:(ole.add(ue),N(""),Z(ue,!0),!0)},[Z]),J=p.useCallback(async()=>{var Y;if(!(u.kind!=="list"||S)){if(typeof navigator>"u"||!((Y=navigator.clipboard)!=null&&Y.readText)){N(s("environmentCenter.clipboardUnsupported"));return}try{const K=await navigator.clipboard.readText();!z(K)&&!K.trim()&&await WZt()&&N(s("environmentCenter.clipboardReadError"))}catch{N(s("environmentCenter.clipboardReadError"))}}},[S,z,s,u.kind]);p.useEffect(()=>{const Y=new AbortController;return l.length===0&&I(!0),_(""),VA(Y.signal).then(K=>{c(K)}).catch(K=>{(K==null?void 0:K.name)!=="AbortError"&&(qZt(K)?(c([]),R(!1),j(s("environmentCenter.storageUnavailable"))):_(K instanceof Error?K.message:String(K)))}).finally(()=>{Y.signal.aborted||I(!1)}),()=>Y.abort()},[L]),p.useEffect(()=>{if(!l.some(K=>K.latestVersion&&Py.has(K.latestVersion.status)))return;const Y=window.setTimeout(()=>F(K=>K+1),2500);return()=>window.clearTimeout(Y)},[l]),p.useEffect(()=>{if(!E||T)return;const Y=window.setTimeout(()=>j(""),2800);return()=>window.clearTimeout(Y)},[T,E]),p.useEffect(()=>{r&&N(r)},[r]),p.useEffect(()=>{i&&z(i.text)},[i,z]),p.useEffect(()=>{if(u.kind!=="list")return;const Y=()=>void J(),K=()=>{document.visibilityState==="visible"&&J()},ue=te=>{var pe;const Oe=te.target;if(Oe instanceof HTMLInputElement||Oe instanceof HTMLTextAreaElement||Oe instanceof HTMLElement&&Oe.isContentEditable)return;const fe=((pe=te.clipboardData)==null?void 0:pe.getData("text/plain"))??"";z(fe,!0)&&te.preventDefault()};return window.addEventListener("focus",Y),document.addEventListener("visibilitychange",K),window.addEventListener("paste",ue),()=>{window.removeEventListener("focus",Y),document.removeEventListener("visibilitychange",K),window.removeEventListener("paste",ue)}},[z,J,u.kind]);const ne=u.kind==="editor"&&u.environmentId?l.find(Y=>Y.id===u.environmentId):void 0,W=async Y=>{const K={...Y,dockerfile:Y.dockerfile??gH(Y,e)},ue=ne?await JTe(ne.id,K):await ZTe(K);if(c(te=>[ue,...te.filter(Oe=>Oe.id!==ue.id)]),d({kind:"list"}),R(!1),K.imageSource){j(s("environmentCenter.status.boundImage",{name:ue.name}));return}try{const te=await U8(ue.id);c(Oe=>Oe.map(fe=>fe.id===ue.id?{...fe,latestVersion:te}:fe)),j(s("environmentCenter.status.queued",{name:ue.name}))}catch(te){R(!0),j(s("environmentCenter.status.savedBuildFailed",{error:te instanceof Error?te.message:String(te)}))}},X=async Y=>{if(!M.has(Y.id)){H(K=>new Set(K).add(Y.id)),R(!1);try{const K=await U8(Y.id);c(ue=>ue.map(te=>te.id===Y.id?{...te,latestVersion:K}:te)),j(s("environmentCenter.status.queued",{name:Y.name}))}catch(K){R(!0),j(K instanceof Error?K.message:String(K))}finally{H(K=>{const ue=new Set(K);return ue.delete(Y.id),ue})}}},le=(Y,K,ue,te)=>{Y.length&&c(Oe=>{const fe=new Set(Y.map(pe=>pe.id));return[...Y,...Oe.filter(pe=>!fe.has(pe.id))]}),R(te>0),j(te>0?s("environmentCenter.status.importedFailed",{created:K,failed:te}):ue>0?s("environmentCenter.status.importedDuplicate",{created:K,duplicate:ue}):s("environmentCenter.status.imported",{count:K}))},V=m?a.jsx(_d,{title:s("environmentCenter.deleteTitle"),description:s("environmentCenter.deleteDescription",{name:m.name}),confirmLabel:s("common.delete"),variant:"danger",onCancel:()=>g(null),onConfirm:()=>{const Y=m;g(null),d({kind:"list"}),e2e(Y.id).then(()=>{c(K=>K.filter(ue=>ue.id!==Y.id)),R(!1),j(s("environmentCenter.status.deleted",{name:Y.name}))}).catch(K=>{R(!0),j(K instanceof Error?K.message:String(K))})}}):null;return u.kind==="editor"?a.jsxs(a.Fragment,{children:[a.jsx(fJt,{environment:ne,cloudProvider:e,onCancel:()=>d({kind:"list"}),onDelete:ne?()=>g(ne):void 0,onShare:ne?()=>k(ne):void 0,onSave:W},u.environmentId??"new"),x?a.jsx(uJt,{environment:x,onClose:()=>k(null)}):null,V]}):a.jsxs(xK,{section:"environments",className:"environment-center",onWorkspace:t,onProjects:n,actions:a.jsxs(a.Fragment,{children:[E?a.jsx("span",{className:`environment-status${T?" is-error":""}`,role:T?"alert":"status","aria-live":"polite",children:E}):null,a.jsx(em,{"aria-label":s("environmentCenter.search"),value:f,onChange:Y=>h(Y.target.value),placeholder:s("environmentCenter.search")})]}),children:[C?a.jsxs("div",{className:"environment-clipboard-notice",role:"alert",children:[a.jsx("span",{children:C}),a.jsx(At,{type:"button",color:"secondary",variant:"soft",size:"sm",onClick:()=>{N(""),Z()},children:s("environmentCenter.manualImport")})]}):null,a.jsx(tm,{"aria-live":"polite",children:P?a.jsx(fl,{}):D?a.jsxs("div",{className:"environment-load-error",role:"alert",children:[a.jsx("p",{children:_o(D,o.resolvedLanguage||o.language)||s("environmentCenter.loadFailed")}),a.jsx(At,{color:"secondary",variant:"soft",size:"sm",onClick:()=>F(Y=>Y+1),children:s("common.reload")})]}):U.length===0&&f.trim()?a.jsx("div",{className:"environment-empty",children:a.jsxs(qn,{fill:"none",children:[a.jsx(qn.Icon,{children:a.jsx(ZZt,{})}),a.jsx(qn.Title,{children:s("environmentCenter.noMatches")}),a.jsx(qn.Description,{children:s("environmentCenter.tryAnotherName")})]})}):a.jsxs(zv,{children:[f.trim()?null:a.jsxs(a.Fragment,{children:[a.jsx(ab,{"aria-label":s("environmentCenter.create"),icon:a.jsx(GZt,{}),onClick:()=>d({kind:"editor",environmentId:null}),children:s("environmentCenter.create")}),a.jsx(ab,{"aria-label":s("environmentCenter.import.title"),icon:a.jsx(XZt,{}),onClick:()=>Z(),children:s("environmentCenter.import.title")})]}),U.map(Y=>{var Oe,fe;const K=V9e(Y,s),ue=!!(Y.latestVersion&&Py.has(Y.latestVersion.status)),te=M.has(Y.id);return a.jsx(Hv,{className:"environment-card",title:Y.name,status:a.jsx(Za,{color:K.color,size:"sm",children:K.label}),description:((Oe=Y.latestVersion)==null?void 0:Oe.error)||(ue?(fe=Y.latestVersion)==null?void 0:fe.currentStep:"")||Y.description||s("common.noDescription"),metadata:[{label:s("workspace.updated"),value:nJt(Y.updatedAt,o.resolvedLanguage??o.language),title:iJt(Y.updatedAt,o.resolvedLanguage??o.language)}],action:{label:Y.latestVersion?s("environmentCenter.buildDetails.title"):s(te?"environmentCenter.buildDetails.starting":"environmentCenter.startBuild"),icon:"play",title:s("environmentCenter.build"),disabled:te,onClick:()=>Y.latestVersion?v(Y.id):void X(Y)},auxiliaryAction:{label:s("environmentCenter.manifest.view"),icon:a.jsx(lat,{}),title:Y.latestVersion?s("environmentCenter.manifest.viewShort"):s("environmentCenter.manifest.unavailable"),disabled:!Y.latestVersion,onClick:()=>w(Y)},detailAction:{label:s("environmentCenter.configure"),onClick:()=>d({kind:"editor",environmentId:Y.id})}},Y.id)})]})}),b?(()=>{const Y=l.find(K=>K.id===b);return Y?a.jsx(aJt,{environment:Y,onClose:()=>v(null),onBuildUpdate:K=>{c(ue=>ue.map(te=>te.id===Y.id?{...te,latestVersion:K}:te))},onRebuild:()=>X(Y)}):null})():null,y!=null&&y.latestVersion?a.jsx(sJt,{environment:y,onClose:()=>w(null)}):null,V,S?a.jsx(dJt,{initialValue:S.initialValue,autoInspect:S.autoInspect,onClose:()=>O(null),onImported:le},S.key):null]})}function hJt(e){const t=e instanceof Error?e.message:String(e??"");return t.includes("HTTP 503")&&(t.includes("未配置持久化存储")||t.includes("storage is not configured"))}function pJt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function mJt(e){return a.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"4.5",y:"7",width:"23",height:"18",rx:"3"}),a.jsx("path",{d:"M10 7V5.5A1.5 1.5 0 0 1 11.5 4h4A1.5 1.5 0 0 1 17 5.5V7M9 13h5v5H9zM18 13h5M18 17h5M9 22h14"})]})}function nU(e,t){const n=Date.parse(e);return Number.isNaN(n)?e:new Intl.DateTimeFormat(t,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(n)}function gJt(e,t){return e.environmentIds.reduce((n,i)=>{var r,s;return((s=(r=t.get(i))==null?void 0:r.latestVersion)==null?void 0:s.status)==="available"?n+1:n},0)}function bJt({workspace:e,environments:t,onBack:n,onSave:i,onDelete:r}){const{t:s,i18n:o}=_e("ui"),[l,c]=p.useState((e==null?void 0:e.name)??""),[u,d]=p.useState((e==null?void 0:e.description)??""),[f,h]=p.useState((e==null?void 0:e.environmentIds)??[]),[m,g]=p.useState(""),[b,v]=p.useState(!1),[y,w]=p.useState(""),x=m.trim().toLocaleLowerCase(),k=t.filter(O=>`${O.name} ${O.description} ${Fp(O.language)}`.toLocaleLowerCase().includes(x)),S=async O=>{if(O.preventDefault(),!(!l.trim()||b)){v(!0),w("");try{await i({name:l.trim(),description:u.trim(),environmentIds:f})}catch(A){w(A instanceof Error?A.message:String(A)),v(!1)}}};return a.jsx(Ch,{className:"workspace-center","aria-label":s(e?"workspace.detail":"workspace.create"),children:a.jsxs(dT,{title:e?e.name:s("workspace.create"),description:s("workspace.editorDescription"),identitySeed:(e==null?void 0:e.name)||s("workspace.create"),backLabel:s("workspace.backToList"),onBack:n,actions:a.jsxs(a.Fragment,{children:[r?a.jsx("button",{type:"button",className:"is-danger",onClick:r,children:s("common.delete")}):null,a.jsx("button",{type:"submit",form:"workspace-form",disabled:b||!l.trim(),children:s(b?"common.saving":"common.save")})]}),children:[e?a.jsxs(yH,{children:[a.jsxs("div",{children:[a.jsx("dt",{children:s("common.environment")}),a.jsx("dd",{children:s("workspace.environmentCount",{count:f.length})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("workspace.createdAt")}),a.jsx("dd",{children:nU(e.createdAt,o.resolvedLanguage??o.language)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("workspace.updatedAt")}),a.jsx("dd",{children:nU(e.updatedAt,o.resolvedLanguage??o.language)})]})]}):null,a.jsxs("form",{id:"workspace-form",className:"workspace-form",onSubmit:S,children:[a.jsxs("section",{className:"workspace-fields","aria-label":s("workspace.basicInfo"),children:[a.jsxs("label",{children:[a.jsx("span",{children:s("common.name")}),a.jsx(js,{value:l,maxLength:128,autoFocus:!0,onChange:O=>c(O.target.value),placeholder:s("workspace.namePlaceholder")})]}),a.jsxs("label",{children:[a.jsx("span",{children:s("common.description")}),a.jsx(bb,{value:u,maxLength:2e3,onChange:O=>d(O.target.value),placeholder:s("workspace.descriptionPlaceholder")})]})]}),a.jsxs("section",{className:"workspace-environments",children:[a.jsx(ePe,{title:s("common.environment"),description:s("workspace.selectedEnvironmentCount",{count:f.length}),actions:a.jsx(em,{"aria-label":s("workspace.searchAvailableEnvironments"),value:m,onChange:O=>g(O.target.value),placeholder:s("workspace.searchEnvironments")})}),t.length===0?a.jsxs("div",{className:"workspace-environment-empty",children:[a.jsx("p",{children:s("workspace.noAvailableEnvironments")}),a.jsx("span",{children:s("workspace.createEnvironmentFirst")})]}):k.length===0?a.jsxs("div",{className:"workspace-environment-empty",children:[a.jsx("p",{children:s("workspace.noMatchingEnvironments")}),a.jsx("span",{children:s("workspace.tryAnotherName")})]}):a.jsx("div",{className:"workspace-environment-list",children:k.map(O=>{var j;const A=f.includes(O.id),E=((j=O.latestVersion)==null?void 0:j.status)==="available"?s("workspace.environmentStatus.available"):O.latestVersion?s("workspace.environmentStatus.building"):s("workspace.environmentStatus.notBuilt");return a.jsxs("label",{className:`workspace-environment-option${A?" is-selected":""}`,children:[a.jsx("input",{type:"checkbox",checked:A,onChange:()=>h(T=>A?T.filter(R=>R!==O.id):[...T,O.id])}),a.jsxs("span",{className:"workspace-environment-option__copy",children:[a.jsx("strong",{title:O.name,children:O.name}),a.jsxs("span",{children:[Fp(O.language)," · ",E]})]}),a.jsx("span",{className:"workspace-environment-option__action",children:s(A?"workspace.added":"common.add")})]},O.id)})})]}),y?a.jsx("p",{className:"workspace-form-error",role:"alert",children:y}):null]})]})})}function yJt({onEnvironment:e,onProjects:t}){const{t:n,i18n:i}=_e("ui"),[r,s]=p.useState([]),[o,l]=p.useState([]),[c,u]=p.useState({kind:"list"}),[d,f]=p.useState(""),[h,m]=p.useState(!0),[g,b]=p.useState(""),[v,y]=p.useState(""),[w,x]=p.useState(!1),[k,S]=p.useState(null),[O,A]=p.useState(0),E=p.useDeferredValue(d);p.useEffect(()=>{const C=new AbortController;return m(!0),b(""),Promise.all([Lz(C.signal),VA(C.signal)]).then(([N,P])=>{s(N),l(P)}).catch(N=>{(N==null?void 0:N.name)!=="AbortError"&&(hJt(N)?(s([]),l([]),x(!1),y(n("workspace.storageUnavailable"))):(console.warn("Unable to load Studio workspaces",N),b(n("workspace.loadFailed"))))}).finally(()=>{C.signal.aborted||m(!1)}),()=>C.abort()},[O,n]),p.useEffect(()=>{if(!v||w)return;const C=window.setTimeout(()=>y(""),2800);return()=>window.clearTimeout(C)},[w,v]);const j=p.useMemo(()=>new Map(o.map(C=>[C.id,C])),[o]),T=p.useMemo(()=>{const C=E.trim().toLocaleLowerCase();return C?r.filter(N=>{const P=N.environmentIds.map(I=>{var D;return((D=j.get(I))==null?void 0:D.name)??""}).join(" ");return`${N.name} ${N.description} ${P}`.toLocaleLowerCase().includes(C)}):r},[E,j,r]),R=c.kind==="detail"&&c.workspaceId?r.find(C=>C.id===c.workspaceId):void 0;return c.kind==="detail"?a.jsx(bJt,{workspace:R,environments:o,onBack:()=>u({kind:"list"}),onDelete:R?()=>S(R):null,onSave:async C=>{const N=R?await HTe(R.id,C):await VTe(C);s(P=>[N,...P.filter(I=>I.id!==N.id)]),x(!1),y(n("workspace.saved",{name:N.name})),u({kind:"list"})}},c.workspaceId??"new"):a.jsxs(xK,{section:"workspaces",onEnvironment:e,onProjects:t,actions:a.jsxs(a.Fragment,{children:[v?a.jsx("span",{className:`workspace-status${w?" is-error":""}`,role:w?"alert":"status","aria-live":"polite",children:v}):null,a.jsx(em,{"aria-label":n("workspace.searchWorkspaces"),value:d,onChange:C=>f(C.target.value),placeholder:n("workspace.searchWorkspaces")})]}),children:[a.jsx(tm,{"aria-live":"polite",children:h?a.jsx(fl,{}):g?a.jsxs("div",{className:"workspace-load-error",role:"alert",children:[a.jsx("p",{children:g}),a.jsx(At,{color:"secondary",variant:"soft",size:"sm",onClick:()=>A(C=>C+1),children:n("common.reload")})]}):T.length===0&&d.trim()?a.jsx("div",{className:"workspace-empty",children:a.jsxs(qn,{fill:"none",children:[a.jsx(qn.Icon,{children:a.jsx(mJt,{})}),a.jsx(qn.Title,{children:n("workspace.noMatchingWorkspaces")}),a.jsx(qn.Description,{children:n("workspace.tryAnotherNameOrEnvironment")})]})}):a.jsxs(zv,{children:[d.trim()?null:a.jsx(ab,{"aria-label":n("workspace.create"),icon:a.jsx(pJt,{}),onClick:()=>u({kind:"detail",workspaceId:null}),children:n("workspace.create")}),T.map(C=>{const N=gJt(C,j),P=C.environmentIds.filter(I=>!j.has(I)).length;return a.jsx(Hv,{className:"workspace-card",title:C.name,status:a.jsx(Za,{color:P?"danger":N===C.environmentIds.length&&N>0?"success":"secondary",size:"sm",children:C.environmentIds.length===0?n("workspace.noEnvironmentAdded"):P?n("workspace.environmentMissing"):n("workspace.availableFraction",{available:N,total:C.environmentIds.length})}),description:C.description||n("common.noDescription"),metadata:[{label:n("common.environment"),value:n("workspace.environmentCount",{count:C.environmentIds.length})},{label:n("workspace.available"),value:n("workspace.availableCount",{count:N})},{label:n("workspace.updated"),value:nU(C.updatedAt,i.resolvedLanguage??i.language)}],detailAction:{label:n("common.manage"),onClick:()=>u({kind:"detail",workspaceId:C.id})},action:{label:n("workspace.addEnvironment"),icon:"plus",onClick:()=>u({kind:"detail",workspaceId:C.id})}},C.id)})]})}),k?a.jsx(_d,{title:n("workspace.deleteTitle"),description:n("workspace.deleteDescription",{name:k.name}),confirmLabel:n("common.delete"),variant:"danger",onCancel:()=>S(null),onConfirm:()=>{const C=k;S(null),qTe(C.id).then(()=>{s(N=>N.filter(P=>P.id!==C.id)),x(!1),y(n("workspace.deleted",{name:C.name})),u({kind:"list"})}).catch(N=>{x(!0),y(N instanceof Error?N.message:String(N))})}}):null]})}function vJt({cloudProvider:e,onProjects:t,initialSection:n="workspaces"}){const[i,r]=p.useState(n),{t:s}=_e("ui"),[o,l]=p.useState(null),[c,u]=p.useState(""),d=p.useRef(0),f=()=>{var g;d.current+=1;const h=d.current;u("");let m=null;if(typeof navigator<"u"&&((g=navigator.clipboard)!=null&&g.readText))try{m=navigator.clipboard.readText()}catch{u(s("workspace.clipboardPermissionError"))}else u(s("workspace.clipboardUnsupported"));r("environments"),m&&m.then(async b=>{var v;if(d.current===h){if(b.trim()){l({key:h,text:b});return}try{const y=await((v=navigator.permissions)==null?void 0:v.query({name:"clipboard-read"}));d.current===h&&(y==null?void 0:y.state)==="denied"&&u(s("workspace.clipboardPermissionError"))}catch{}}}).catch(()=>{d.current===h&&u(s("workspace.clipboardPermissionError"))})};return i==="environments"?a.jsx(W9e,{cloudProvider:e,onWorkspace:()=>r("workspaces"),onProjects:t,clipboardImport:o,clipboardReadError:c}):a.jsx(yJt,{onEnvironment:f,onProjects:t})}const xJt={id:"mpa-channels",kind:"mpa-channels",category:"channels",icon:"mpa-channels",name:"MPA agent messaging channels",description:"Connect an existing MPA agent to Feishu, WeCom and DingTalk."};function wJt(e){return e==="127.0.0.1"}const kJt={id:"coding-agents",kind:"coding-agent",category:"development",icon:"coding-agents",name:"Configure coding agents",badge:"Local",badgeTone:"success",description:"Install built-in VeADK and AgentKit skills globally for Trae, Claude Code, or Codex."},OJt={id:"feishu",kind:"feishu",category:"channels",icon:"feishu",name:"Feishu bot",badge:"Beta",description:"Create a Feishu bot and connect its messages directly to AgentKit Runtime."},SJt={id:"gitlab-review",kind:"gitlab",category:"development",icon:"gitlab",name:"GitLab MR review",description:"Use a GitLab integration to review merge requests in an isolated Sandbox."};bn.hasResourceBundle("en-US","automations")||bn.addResourceBundle("en-US","automations",Sfe,!0,!0);bn.hasResourceBundle("zh-CN","automations")||bn.addResourceBundle("zh-CN","automations",jve,!0,!0);function _h(e,t={}){return bn.t(e,{...t,ns:"automations"})}const K9e={name:"repository",label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL",required:!0},G9e={name:"baseBranch",label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base",required:!1},X9e={name:"runtimeName",label:"Runtime name",placeholder:"support-agent",help:"Used by the AgentKit delivery configuration",required:!0},Y9e={name:"runtimeId",label:"Runtime ID",placeholder:"rt-xxxxxxxx",help:"The AgentKit Runtime that will receive continuous updates",required:!0},EJt="https://ark.cn-beijing.volces.com/api/coding/v3";function CJt(e){return e==="byteplus"?Fo(e):EJt}function SK(e){return e==="byteplus"?{accessKey:"BYTEPLUS_ACCESS_KEY",secretKey:"BYTEPLUS_SECRET_KEY",sessionToken:"BYTEPLUS_SESSION_TOKEN"}:{accessKey:"VOLCENGINE_ACCESS_KEY",secretKey:"VOLCENGINE_SECRET_KEY",sessionToken:"VOLCENGINE_SESSION_TOKEN"}}function Z9e(e){const t=SK(e);return[_h("github.secretPair",{accessKey:t.accessKey,secretKey:t.secretKey}),_h("github.sessionToken",{sessionToken:t.sessionToken})]}function EK(e){return e==="byteplus"?"BytePlus":"Volcengine"}function CK(e,t={}){return{repository:"",baseBranch:"main",projectPath:".",runtimeName:"",runtimeId:"",modelName:"",modelBaseUrl:CJt(e),region:nr(e),token:"",...t}}function J9e(e){return{repository:e.repository.trim(),baseBranch:e.baseBranch.trim()||"main",region:e.region,token:e.token.trim()}}const AJt={id:"review",kind:"github",category:"development",icon:"github",name:"Automated PR review",description:"Use a GitHub App to review pull requests in an isolated Sandbox.",title:"Automated PR review",subtitle:"Trigger Sandbox reviews through the GitHub App and publish results to pull requests",panel:"Install the GitHub App to target repositories, then enable automated review for each repository.",submitLabel:"Install GitHub App",fields:[],initialValues:({cloudProvider:e})=>CK(e),regionHelp:"",secrets:()=>[],async submit(){throw new Error("PR 自动评审已切换为 GitHub App 授权模式。")}},TJt="https://api.github.com",_Jt=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,ule=/^[A-Za-z0-9][A-Za-z0-9._/-]{0,199}$/,jJt=/^[A-Za-z0-9._/-]+$/;function NJt(e,t,n){const i=String((t==null?void 0:t.message)||"");return e===403&&/workflow/i.test(i)?"GitHub Token 缺少 Workflows 写权限,无法创建或更新 .github/workflows 下的文件":e===401||e===403?Q("github.invalidToken"):e===404?Q("github.notFound"):e===422?Q("github.rejectedCommit"):i.split(n).join("***").trim().slice(0,240)||Q("github.requestFailed",{status:e})}async function Jb(e,t){const n={Accept:"application/vnd.github+json",Authorization:`Bearer ${t.token}`,"X-GitHub-Api-Version":"2022-11-28"};t.body&&(n["Content-Type"]="application/json");let i;try{i=await fetch(`${TJt}${e}`,{method:t.method||"GET",headers:n,body:t.body?JSON.stringify(t.body):void 0,signal:t.signal})}catch(s){throw t.signal.aborted?s:new Error(Q("github.networkFailed"))}const r=await i.json().catch(()=>null);if(!t.expected.includes(i.status))throw new Error(NJt(i.status,r,t.token));return{status:i.status,payload:r}}function x6(e){return e.split("/").map(encodeURIComponent).join("/")}function RJt(e){const t=new TextEncoder().encode(e);let n="";const i=32768;for(let r=0;r({...h,path:TK(h.path,"")})),s=AbortSignal.any([t,AbortSignal.timeout(6e4)]),o=`/repos/${n}`;await Jb(`${o}`,{token:e.token,expected:[200],signal:s});const c=(f=(await Jb(`${o}/git/ref/heads/${x6(i)}`,{token:e.token,expected:[200],signal:s})).payload.object)==null?void 0:f.sha;if(!c)throw new Error(Q("github.missingBaseSha"));const u=IJt(e.branchPrefix);await Jb(`${o}/git/refs`,{token:e.token,expected:[201],signal:s,method:"POST",body:{ref:`refs/heads/${u}`,sha:c}});let d=!0;try{for(const m of r){const g=x6(m.path),b=await Jb(`${o}/contents/${g}?ref=${encodeURIComponent(i)}`,{token:e.token,expected:[200,404],signal:s});if(m.mustBeNew&&b.status===200)throw new Error(Q("github.fileAlreadyExists",{path:m.path}));if(b.status===200&&!b.payload.sha)throw new Error(Q("github.pathNotUpdatable",{path:m.path}));await Jb(`${o}/contents/${g}`,{token:e.token,expected:[200,201],signal:s,method:"PUT",body:{message:m.commitMessage,content:RJt(m.content),branch:u,...b.payload.sha?{sha:b.payload.sha}:{}}})}const h=await Jb(`${o}/pulls`,{token:e.token,expected:[201],signal:s,method:"POST",body:{title:e.title,head:u,base:i,body:e.description}});if(!h.payload.number||!h.payload.html_url)throw new Error(Q("github.invalidPullRequest"));return d=!1,{number:h.payload.number,url:h.payload.html_url,branch:u}}finally{d&&await Jb(`${o}/git/refs/heads/${x6(u)}`,{token:e.token,expected:[204],signal:AbortSignal.timeout(15e3),method:"DELETE"}).catch(()=>{})}}async function PJt(e,t){const n=await yn("/web/github/pull-request-reviews",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw await YT(n);const i=await n.json();if(i.status!=="started"||typeof i.sessionId!="string"||!i.sessionId||typeof i.displayName!="string")throw new Error("PR 评审服务返回了无效结果。");return i}async function DJt(e){const t=await yn("/web/github/app/config",{method:"GET",headers:{Accept:"application/json"},signal:e});if(!t.ok)throw await YT(t);const n=await t.json();if(typeof n.configured!="boolean"||typeof n.appSlug!="string"||typeof n.installUrl!="string"||typeof n.reason!="string")throw new Error("GitHub App 配置响应格式无效。");return n}async function MJt(e,t){var s;const n=new URLSearchParams({page:String(t.page),pageSize:String(t.pageSize)});(s=t.query)!=null&&s.trim()&&n.set("q",t.query.trim());const i=await yn(`/web/github/app/repositories?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await YT(i);const r=await i.json();if(!Array.isArray(r.repositories)||typeof r.page!="number"||typeof r.pageSize!="number"||typeof r.hasNextPage!="boolean"||typeof r.reviewSettingsConfigured!="boolean"||typeof r.reviewSettingsReason!="string"||r.repositories.some(o=>typeof o!="object"||o===null||typeof o.installationId!="number"||typeof o.account!="string"||typeof o.fullName!="string"||typeof o.htmlUrl!="string"||typeof o.private!="boolean"||typeof o.reviewEnabled!="boolean"))throw new Error("GitHub App 仓库列表响应格式无效。");return r}async function LJt(e,t){const n=new URLSearchParams({page:String(t.page),pageSize:String(t.pageSize)}),i=await yn(`/web/github/app/review-records?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await YT(i);const r=await i.json();if(!Array.isArray(r.records)||typeof r.page!="number"||typeof r.pageSize!="number"||typeof r.hasNextPage!="boolean"||typeof r.reviewSettingsConfigured!="boolean"||typeof r.reviewSettingsReason!="string"||r.records.some(s=>typeof s!="object"||s===null||typeof s.id!="string"||typeof s.repository!="string"||typeof s.pullRequestUrl!="string"||typeof s.pullRequestNumber!="number"||!["started","completed","ignored","failed"].includes(String(s.status))||!["manual","webhook"].includes(String(s.trigger))||typeof s.createdAt!="string"||typeof s.deliveryId!="string"||typeof s.action!="string"||typeof s.sessionId!="string"||typeof s.displayName!="string"||typeof s.reason!="string"))throw new Error("PR 评审记录响应格式无效。");return r}async function $Jt(e,t){const n=await yn("/web/github/app/review-repositories",{method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw await YT(n);const i=await n.json();if(!Array.isArray(i.repositories)||i.repositories.some(r=>typeof r!="string"))throw new Error("GitHub App 评审仓库保存响应格式无效。");return i.repositories}async function YT(e){const t=await e.text().catch(()=>"");try{const n=JSON.parse(t),i=typeof n.detail=="object"&&n.detail?n.detail.message:n.detail??n.message??n.error,r=typeof i=="string"?i:"";return new Error(r||`PR 评审发起失败(HTTP ${e.status})`)}catch{return new Error(t||`PR 评审发起失败(HTTP ${e.status})`)}}const FJt=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/,BJt="cn-hongkong";function UJt(e){const t=i0(e.runtimeName,n=>_h(`github.validation.runtimeName.${n}`));if(t)throw new Error(t);if(!FJt.test(e.runtimeId))throw new Error(_h("github.validation.runtimeId"))}function t7e(e){UJt(e);const t=e.cloudProvider??"volcengine",n=SK(t),i=t==="byteplus"?` +${i}`:n}function $Zt(e,t,n){return t.trim()?/^\s*FROM(?:\s|$)/im.test(e)?Nw("duplicateFrom",n):OK(nR(t,e),void 0,n):Nw("baseImageRequired",n)}function OK(e,t=z9e(e),n){return t>Q9e?Nw("tooLarge",n):e.trim()?/^\s*FROM\s+\S+/im.test(e)?"":Nw("missingFrom",n):Nw("empty",n)}async function FZt(e,t){if(e.size>Q9e)return{content:"",error:Nw("tooLarge",t)};const n=DL(await e.text());return{content:n,error:OK(n,e.size,t)}}function BZt(e){return VM(e,{lineWidth:0})}function UZt(e){return[{value:"custom",label:e("environmentCenter.creation.custom.label"),description:e("environmentCenter.creation.custom.description")},{value:"dockerfile",label:e("environmentCenter.creation.dockerfile.label"),description:e("environmentCenter.creation.dockerfile.description")},{value:"git",label:e("environmentCenter.creation.git.label"),description:e("environmentCenter.creation.git.description")},{value:"image",label:e("environmentCenter.creation.image.label"),description:e("environmentCenter.creation.image.description")}]}const QZt=BIe.map(e=>({value:e.id,label:e.label,description:e.description}));function zZt(e){return[{value:"none",label:e("common.none"),description:e("environmentCenter.presets.none")},{value:"aio-sandbox",label:"AIO Sandbox",description:e("environmentCenter.presets.aio")},{value:"codex-sandbox",label:"Codex Sandbox",description:e("environmentCenter.presets.codex")}]}function VZt(e){const t=MZt(e,"");return t===pH?"aio-sandbox":t.includes("/codexenv:")?"codex-sandbox":"none"}const HZt=yI.map(e=>({value:e.id,label:e.label})),ale=QIe.map(e=>({value:e.id,label:e.label}));function qZt(e){return[{value:"managed",label:e("environmentCenter.repository.managed")},{value:"existing",label:e("environmentCenter.repository.existing")}]}const eU=20,ole=new Set;function WZt(e){const t=e instanceof Error?e.message:String(e??"");return t.includes("HTTP 503")&&(t.includes("未配置持久化存储")||t.includes("storage is not configured"))}async function KZt(){var e;if(typeof navigator>"u"||!((e=navigator.permissions)!=null&&e.query))return!1;try{return(await navigator.permissions.query({name:"clipboard-read"})).state==="denied"}catch{return!1}}const GZt={opencli:sZt,uv:aZt,playwright:oZt,chromium:lZt,git:cZt,curl:uZt,ffmpeg:dZt,imagemagick:fZt};function XZt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function rf(){return a.jsx("span",{className:"environment-required-mark","aria-hidden":"true",children:"*"})}function YZt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M12 3v11m0 0 4-4m-4 4-4-4"}),a.jsx("path",{d:"M5 16v2.5A2.5 2.5 0 0 0 7.5 21h9a2.5 2.5 0 0 0 2.5-2.5V16"})]})}function tU(e,t){const n=e.trim();if(!n)return t("environmentCenter.errors.repositoryRequired");try{const i=new URL(n);if(i.protocol!=="https:"||!i.hostname)return t("environmentCenter.errors.repositoryHttps")}catch{return t("environmentCenter.errors.repositoryInvalid")}return""}function lle(e){return!!(e!=null&&e.region&&e.registry&&e.namespace&&e.repository)}function V9e(e,t){const n=e.trim();return n?/\s/.test(n)?t("environmentCenter.errors.imageReferenceWhitespace"):n.startsWith("sha256:")?/^sha256:[0-9a-fA-F]{64}$/.test(n)?"":t("environmentCenter.errors.imageDigestInvalid"):/[@/]/.test(n)?t("environmentCenter.errors.imageTagOnly"):"":""}function ZZt(e){return(e instanceof Error?e.message:String(e)).split(` +原始响应:`,1)[0].trim()}function JZt(e){return a.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5.5 10.5 16 5l10.5 5.5L16 16 5.5 10.5Z"}),a.jsx("path",{d:"M5.5 16 16 21.5 26.5 16M5.5 21.5 16 27l10.5-5.5"})]})}function eJt({label:e}){return a.jsx("span",{className:"environment-package-fallback",children:e.slice(0,1).toUpperCase()})}function tJt({option:e}){if(e.id==="lark-cli")return a.jsx("img",{src:PL,alt:""});if(e.id==="pandoc")return a.jsx("img",{src:rZt,alt:""});if(e.id==="github-cli")return a.jsx(wK,{});const t=GZt[e.id];return t?a.jsx("img",{src:t,alt:""}):a.jsx(eJt,{label:e.label})}function nJt(e,t){return e?{name:e.name,description:e.description,baseEnvironment:e.baseEnvironment,operatingSystem:e.operatingSystem,language:e.language,optionIds:[...e.optionIds],selectedSkills:[...e.selectedSkills],dockerfile:e.dockerfile===gH(e,t)?void 0:e.dockerfile,gitSource:e.gitSource,containerRepository:e.containerRepository,imageSource:e.imageSource}:{...a4,optionIds:[...a4.optionIds],selectedSkills:[...a4.selectedSkills]}}const Py=new Set(["preparing","queued","building","scanning"]),cle=3e3,v6={preparing:"environmentCenter.buildStatus.preparing",queued:"environmentCenter.buildStatus.queued",building:"environmentCenter.buildStatus.building",scanning:"environmentCenter.buildStatus.scanning",available:"environmentCenter.buildStatus.available",failed:"environmentCenter.buildStatus.failed"};function H9e(e,t){var i;const n=(i=e.latestVersion)==null?void 0:i.status;return n?n==="available"?{label:t(v6[n]),color:"success"}:n==="failed"?{label:t(v6[n]),color:"danger"}:{label:t(v6[n]),color:"warning"}:{label:t("environmentCenter.buildStatus.notBuilt"),color:"secondary"}}function iJt(e,t){return zT(e,Date.now(),t)}function rJt(e,t){const n=Date.parse(e);return Number.isNaN(n)?e:new Intl.DateTimeFormat(t,{dateStyle:"medium",timeStyle:"medium"}).format(n)}function sJt(e,t,n=Date.now()){const i=Date.parse(e.createdAt),s=Py.has(e.status)?n:Date.parse(e.updatedAt);if(Number.isNaN(i)||Number.isNaN(s))return"";const o=Math.max(0,Math.floor((s-i)/1e3));if(o<60)return t("environmentCenter.duration.seconds",{count:o});const l=Math.floor(o/60),c=o%60;return l<60?t("environmentCenter.duration.minutesSeconds",{minutes:l,seconds:c}):t("environmentCenter.duration.hoursMinutes",{hours:Math.floor(l/60),minutes:l%60})}function aJt({environment:e,onClose:t}){var x;const{t:n}=_e("ui"),i=((x=e.latestVersion)==null?void 0:x.versionId)??"",r=p.useId(),s=p.useRef(null),o=p.useRef(t),[l,c]=p.useState(null),[u,d]=p.useState(!0),[f,h]=p.useState(""),[m,g]=p.useState(0),[b,v]=p.useState("idle"),y=p.useMemo(()=>l?BZt(l):"",[l]);o.current=t,p.useEffect(()=>{var A;const k=document.body.style.overflow,S=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(A=s.current)==null||A.focus();const O=E=>{if(E.key==="Escape"){E.preventDefault(),o.current();return}if(E.key!=="Tab"||!s.current)return;const j=Array.from(s.current.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')).filter(C=>C.getClientRects().length>0);if(!j.length)return;const T=j[0],R=j[j.length-1];E.shiftKey&&document.activeElement===T?(E.preventDefault(),R.focus()):!E.shiftKey&&document.activeElement===R&&(E.preventDefault(),T.focus())};return window.addEventListener("keydown",O),()=>{document.body.style.overflow=k,window.removeEventListener("keydown",O),S!=null&&S.isConnected&&S.focus()}},[]),p.useEffect(()=>{const k=new AbortController;return d(!0),h(""),i2e(e.id,i,k.signal).then(c).catch(S=>{(S==null?void 0:S.name)!=="AbortError"&&h(S instanceof Error?S.message:String(S))}).finally(()=>{k.signal.aborted||d(!1)}),()=>k.abort()},[e.id,m,i]),p.useEffect(()=>{if(b!=="copied")return;const k=window.setTimeout(()=>v("idle"),1500);return()=>window.clearTimeout(k)},[b]);const w=async()=>{try{await navigator.clipboard.writeText(y),v("copied")}catch{v("error")}};return vi.createPortal(a.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:k=>{k.target===k.currentTarget&&t()},children:a.jsxs("section",{ref:s,className:"environment-build-dialog environment-manifest-dialog",role:"dialog","aria-modal":"true","aria-labelledby":r,"aria-busy":u||void 0,tabIndex:-1,children:[a.jsxs("header",{className:"environment-build-dialog__header",children:[a.jsxs("div",{children:[a.jsx("div",{className:"environment-build-dialog__title-row",children:a.jsx("h2",{id:r,children:n("environmentCenter.manifest.title")})}),a.jsxs("p",{children:[e.name," / ",i]})]}),a.jsx(Tt,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,onClick:t,"aria-label":n("environmentCenter.manifest.closeLabel"),children:a.jsx(Bo,{"aria-hidden":!0})})]}),a.jsx("div",{className:"environment-manifest-dialog__body",children:u?a.jsx("div",{className:"environment-manifest-dialog__state",role:"status",children:a.jsx(on,{as:"span",children:n("environmentCenter.manifest.loading")})}):f?a.jsxs("div",{className:"environment-manifest-dialog__state is-error",role:"alert",children:[a.jsx("p",{children:f}),a.jsx(Tt,{type:"button",color:"secondary",variant:"soft",size:"sm",onClick:()=>g(k=>k+1),children:n("common.reload")})]}):a.jsx("div",{className:"environment-manifest-dialog__editor","aria-label":n("environmentCenter.manifest.editorLabel"),children:a.jsx(BT,{value:y,path:"environment.yaml",readOnly:!0,onChange:()=>{}})})}),a.jsxs("footer",{className:"environment-build-dialog__actions",children:[b==="error"?a.jsx("span",{className:"environment-manifest-dialog__copy-error",role:"alert",children:n("environmentCenter.manifest.copyFailed")}):null,a.jsx(Tt,{type:"button",color:"secondary",variant:"ghost",size:"sm",onClick:t,children:n("common.close")}),a.jsx(Tt,{type:"button",color:"info",size:"sm",disabled:!y,onClick:()=>void w(),children:n(b==="copied"?"environmentCenter.manifest.copied":"environmentCenter.manifest.copy")})]})]})}),document.body)}function oJt({environment:e,onClose:t,onBuildUpdate:n,onRebuild:i}){var O,A;const{t:r}=_e("ui"),s=e.latestVersion,[o,l]=p.useState(s),[c,u]=p.useState(!!s),[d,f]=p.useState(""),[h,m]=p.useState(Date.now()),[g,b]=p.useState(!1),v=p.useId(),y=p.useRef(null),w=p.useRef(t),x=p.useRef(n);p.useEffect(()=>{w.current=t,x.current=n},[n,t]),p.useEffect(()=>{var R;const E=document.body.style.overflow,j=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(R=y.current)==null||R.focus();const T=C=>{var D;if(C.key==="Escape"&&w.current(),C.key!=="Tab")return;const N=Array.from(((D=y.current)==null?void 0:D.querySelectorAll('button:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])'))??[]).filter(_=>_.getClientRects().length>0);if(!N.length)return;const P=N[0],I=N[N.length-1];C.shiftKey&&document.activeElement===P?(C.preventDefault(),I.focus()):!C.shiftKey&&document.activeElement===I&&(C.preventDefault(),P.focus())};return window.addEventListener("keydown",T),()=>{document.body.style.overflow=E,window.removeEventListener("keydown",T),j!=null&&j.isConnected&&j.focus()}},[]),p.useEffect(()=>{if(!s)return;let E=0;const j=new AbortController,T=async()=>{u(!0);try{const R=await n2e(e.id,s.versionId,{includeLogs:!0,signal:j.signal});l(R),f(""),x.current(R),Py.has(R.status)&&(E=window.setTimeout(T,cle))}catch(R){if((R==null?void 0:R.name)==="AbortError")return;f(R instanceof Error?R.message:String(R)),E=window.setTimeout(T,cle)}finally{j.signal.aborted||u(!1)}};return T(),()=>{j.abort(),window.clearTimeout(E)}},[e.id,s==null?void 0:s.versionId]),p.useEffect(()=>{if(!o||!Py.has(o.status))return;const E=window.setInterval(()=>m(Date.now()),1e3);return()=>window.clearInterval(E)},[o==null?void 0:o.status]);const k=o?H9e({...e,latestVersion:o},r):{label:r("environmentCenter.buildStatus.notBuilt"),color:"secondary"},S=e.imageSource||(A=(O=o==null?void 0:o.resources)==null?void 0:O.codePipeline)==null?void 0:A.consoleUrl;return vi.createPortal(a.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:E=>{E.target===E.currentTarget&&t()},children:a.jsxs("section",{ref:y,className:"environment-build-dialog",role:"dialog","aria-modal":"true","aria-labelledby":v,tabIndex:-1,children:[a.jsxs("header",{className:"environment-build-dialog__header",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"environment-build-dialog__title-row",children:[a.jsx("h2",{id:v,children:r("environmentCenter.buildDetails.title")}),a.jsx(Za,{color:k.color,size:"sm",children:k.label})]}),a.jsx("p",{children:e.name})]}),a.jsx(Tt,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,onClick:t,"aria-label":r("environmentCenter.buildDetails.closeLabel"),children:a.jsx(Bo,{"aria-hidden":!0})})]}),a.jsxs("div",{className:"environment-build-dialog__summary",children:[a.jsxs("div",{children:[a.jsx("span",{children:r("environmentCenter.buildDetails.currentStep")}),a.jsx("strong",{children:(o==null?void 0:o.currentStep)||r("environmentCenter.buildDetails.waiting")})]}),a.jsxs("div",{children:[a.jsx("span",{children:r("environmentCenter.buildDetails.elapsed")}),a.jsx("strong",{children:o?sJt(o,r,h):"-"})]}),o!=null&&o.sourceCommitSha?a.jsxs("div",{children:[a.jsx("span",{children:r("environmentCenter.buildDetails.sourceCommit")}),a.jsx("strong",{title:o.sourceCommitSha,children:o.sourceCommitSha.slice(0,12)})]}):null,S?a.jsxs("a",{href:S,target:"_blank",rel:"noreferrer",children:[r("environmentCenter.buildDetails.openCodePipeline")," ",a.jsx(uv,{"aria-hidden":!0})]}):null]}),a.jsxs("div",{className:"environment-build-dialog__body",children:[d?a.jsx("p",{className:"environment-build-dialog__error",role:"alert",children:d}):null,o!=null&&o.progressError?a.jsx("p",{className:"environment-build-dialog__notice",children:o.progressError}):null,a.jsx(bZt,{steps:(o==null?void 0:o.steps)??[],log:(o==null?void 0:o.logTail)??"",logError:o==null?void 0:o.logError,logTruncated:o==null?void 0:o.logTruncated,logUpdatedAt:o==null?void 0:o.logUpdatedAt,loading:c&&!!(o&&Py.has(o.status))}),(o==null?void 0:o.status)==="failed"&&o.error?a.jsx("p",{className:"environment-build-dialog__failure",role:"alert",children:o.error}):null]}),a.jsxs("footer",{className:"environment-build-dialog__actions",children:[a.jsx(Tt,{type:"button",color:"secondary",variant:"ghost",size:"sm",onClick:t,children:r("common.close")}),o&&!e.imageSource&&!Py.has(o.status)?a.jsx(Tt,{type:"button",color:"info",size:"sm",disabled:g,onClick:()=>{b(!0),i().then(t).finally(()=>b(!1))},children:r(g?"environmentCenter.buildDetails.starting":"environmentCenter.buildDetails.rebuild")}):null]})]})}),document.body)}function q9e({cloudProvider:e,value:t,disabled:n,onChange:i}){const{t:r}=_e("ui"),s=Pu(e).map(o=>({value:o.value,label:o.label}));return a.jsxs("label",{className:"environment-field environment-region-field",children:[a.jsxs("span",{children:[r("environmentCenter.region"),a.jsx(rf,{})]}),a.jsx(ma,{id:"environment-region",value:t,options:s,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:n,triggerClassName:"environment-select-trigger",onChange:o=>i(o.value)})]})}function lJt({repositoryUrl:e,gitRef:t,dockerfilePath:n,inspection:i,inspectedKey:r,disabled:s,onRepositoryUrlChange:o,onGitRefChange:l,onDockerfilePathChange:c,onInspectionChange:u,onInspectedKeyChange:d}){const{t:f}=_e("ui"),[h,m]=p.useState(!1),[g,b]=p.useState(""),v=p.useRef(null),y=p.useRef(""),w=`${e.trim()}\0${t.trim()}`,x=r===w;p.useEffect(()=>()=>{const A=v.current;v.current=null,A==null||A.abort()},[]);const k=()=>{var A;(A=v.current)==null||A.abort(),v.current=null,m(!1),b(""),u(null),d(""),c(""),y.current=""},S=p.useCallback(async()=>{var j;const A=tU(e,f);if(A){b(A);return}y.current=w,(j=v.current)==null||j.abort();const E=new AbortController;v.current=E,m(!0),b("");try{const T=await KTe({repositoryUrl:e.trim(),...t.trim()?{ref:t.trim()}:{}},E.signal);if(v.current!==E)return;u(T),d(w),c(T.dockerfiles.length===1?T.dockerfiles[0]:"")}catch(T){if((T==null?void 0:T.name)==="AbortError")return;b(ZZt(T)),u(null),d(""),c("")}finally{v.current===E&&(v.current=null,m(!1))}},[w,t,c,d,u,e,f]);p.useEffect(()=>{if(s||x||y.current===w||tU(e,f))return;const A=window.setTimeout(()=>void S(),600);return()=>window.clearTimeout(A)},[w,s,S,x,e,f]);const O=x?(i==null?void 0:i.dockerfiles)??[]:[];return a.jsxs("section",{className:"environment-source-section","aria-label":f("environmentCenter.git.sectionLabel"),children:[a.jsxs("div",{className:"environment-form-grid environment-git-fields",children:[a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[f("environmentCenter.git.address"),a.jsx(rf,{})]}),a.jsx(js,{size:"lg",type:"url",required:!0,value:e,placeholder:"https://github.com/owner/repository.git",autoComplete:"url",disabled:s,"aria-invalid":!!g,onChange:A=>{k(),o(A.currentTarget.value)}})]}),a.jsxs("label",{className:"environment-field",children:[a.jsx("span",{children:f("environmentCenter.git.ref")}),a.jsx(js,{size:"lg",value:t,placeholder:f("environmentCenter.git.defaultBranch"),autoComplete:"off",disabled:s,onChange:A=>{k(),l(A.currentTarget.value)}})]})]}),a.jsxs("div",{className:"environment-inspection-status environment-form-feedback","aria-live":"polite",children:[h?a.jsx(on,{as:"span",children:f("environmentCenter.git.inspecting")}):null,g?a.jsxs("div",{className:"environment-source-error",role:"alert",children:[a.jsx("span",{children:g}),a.jsxs(Tt,{type:"button",color:"primary",size:"sm",pill:!1,disabled:s,onClick:()=>void S(),children:[a.jsx(YD,{}),f("common.retry")]})]}):null,!h&&!g&&x&&i?O.length>0?a.jsx("span",{children:i.commitSha?f("environmentCenter.git.foundDockerfiles",{commit:i.commitSha.slice(0,12),count:O.length}):f("environmentCenter.git.savedDockerfileLoaded")}):a.jsxs("div",{className:"environment-source-error",role:"alert",children:[a.jsx("span",{children:f("environmentCenter.git.noDockerfile")}),a.jsx("button",{type:"button",disabled:s,onClick:()=>void S(),children:f("environmentCenter.git.inspectAgain")})]}):null]}),O.length>0?a.jsxs("label",{className:"environment-field environment-dockerfile-picker",children:[a.jsxs("span",{children:["Dockerfile",a.jsx(rf,{})]}),a.jsx(bf,{ariaLabel:f("environmentCenter.git.selectDockerfile"),value:n,valueLabel:n,placeholder:f("environmentCenter.git.selectDockerfile"),options:O.map(A=>({value:A,label:A})),disabled:s||h,onChange:c})]}):null]})}function cJt({cloudProvider:e,mode:t,region:n,value:i,disabled:r,onModeChange:s,onRegionChange:o,onChange:l}){const{t:c}=_e("ui");return a.jsx("section",{className:"environment-source-section","aria-label":c("environmentCenter.repository.outputSection"),children:a.jsxs("div",{className:"environment-form-grid",children:[a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[c("environmentCenter.repository.type"),a.jsx(rf,{})]}),a.jsx(ma,{id:"environment-repository-mode",value:t,options:qZt(c),optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:r,triggerClassName:"environment-select-trigger",onChange:u=>s(u.value)})]}),a.jsx(q9e,{cloudProvider:e,value:n,disabled:r,onChange:o}),t==="existing"?a.jsx(I9e,{region:n,value:i,disabled:r,onChange:l}):a.jsx("p",{className:"environment-source-note environment-form-feedback",children:c("environmentCenter.repository.managedHint")})]})})}function uJt({cloudProvider:e,region:t,repository:n,reference:i,disabled:r,onRegionChange:s,onRepositoryChange:o,onReferenceChange:l}){const{t:c}=_e("ui"),u=V9e(i,c);return a.jsx("section",{className:"environment-source-section","aria-label":c("environmentCenter.existingImage.sectionLabel"),children:a.jsxs("div",{className:"environment-form-grid",children:[a.jsx(q9e,{cloudProvider:e,value:t,disabled:r,onChange:s}),a.jsx(I9e,{region:t,value:n,disabled:r,onChange:o}),a.jsxs("label",{className:"environment-field environment-image-reference",children:[a.jsxs("span",{children:[c("environmentCenter.existingImage.reference"),a.jsx(rf,{})]}),a.jsx(js,{size:"lg",value:i,required:!0,placeholder:c("environmentCenter.existingImage.placeholder"),autoComplete:"off",disabled:r,"aria-invalid":!!u,onChange:d=>l(d.currentTarget.value)}),u?a.jsx("small",{className:"environment-source-field__error",role:"alert",children:u}):a.jsx("small",{children:c("environmentCenter.existingImage.hint")})]})]})})}function W9e(e,t,n,i){const r=p.useRef(n),s=p.useRef(i);r.current=n,s.current=i,p.useEffect(()=>{const o=document.body.style.overflow,l=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden";const c=window.requestAnimationFrame(()=>{var d;return(d=t.current)==null?void 0:d.focus()}),u=d=>{var g;if(d.key==="Escape"&&!s.current){d.preventDefault(),r.current();return}if(d.key!=="Tab")return;const f=Array.from(((g=e.current)==null?void 0:g.querySelectorAll('button:not([disabled]), textarea:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])'))??[]).filter(b=>b.getClientRects().length>0);if(!f.length)return;const h=f[0],m=f[f.length-1];d.shiftKey&&document.activeElement===h?(d.preventDefault(),m.focus()):!d.shiftKey&&document.activeElement===m&&(d.preventDefault(),h.focus())};return window.addEventListener("keydown",u),()=>{window.cancelAnimationFrame(c),document.body.style.overflow=o,window.removeEventListener("keydown",u),l!=null&&l.isConnected&&l.focus()}},[e,t])}function dJt({environment:e,onClose:t}){const{t:n}=_e("ui"),i=p.useId(),r=p.useId(),s=p.useRef(null),o=p.useRef(null),[l,c]=p.useState(""),[u,d]=p.useState("loading"),[f,h]=p.useState(""),m=u==="loading";W9e(s,o,t,m);const g=async(b="",v)=>{d("loading"),h("");try{const y=b||(await GTe(e.id,v)).shareCode;c(y),await $Te(y),v!=null&&v.aborted||d("copied")}catch(y){if((y==null?void 0:y.name)==="AbortError")return;h(y instanceof Error?y.message:String(y)),d("error")}};return p.useEffect(()=>{const b=new AbortController;return g("",b.signal),()=>b.abort()},[e.id]),vi.createPortal(a.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:b=>{b.target===b.currentTarget&&!m&&t()},children:a.jsxs("section",{ref:s,className:"environment-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":i,"aria-describedby":r,"aria-busy":m||void 0,children:[a.jsxs("header",{className:"environment-build-dialog__header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:i,children:n("environmentCenter.share.title")}),a.jsx("p",{id:r,children:e.name})]}),a.jsx(Tt,{ref:o,type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,disabled:m,onClick:t,"aria-label":n("environmentCenter.share.closeLabel"),children:a.jsx(Bo,{"aria-hidden":!0})})]}),a.jsx("div",{className:"environment-share-dialog__body",children:u==="loading"?a.jsx(on,{as:"p",children:n("environmentCenter.share.generating")}):a.jsxs("div",{className:"environment-share-dialog__result",children:[u==="copied"?a.jsx("p",{className:"environment-share-dialog__success",role:"status","aria-live":"polite",children:n("environmentCenter.share.copied")}):a.jsxs("div",{className:"environment-share-dialog__error",role:"alert",children:[a.jsx("strong",{children:n("environmentCenter.share.failed")}),a.jsx("span",{children:f})]}),l?a.jsxs("label",{className:"environment-share-dialog__field environment-share-dialog__manual-code",children:[a.jsx("span",{children:n("environmentCenter.share.code")}),a.jsx(bb,{size:"lg",rows:4,value:l,readOnly:!0,"aria-label":n("environmentCenter.share.fullCode"),onFocus:b=>b.currentTarget.select(),onClick:b=>b.currentTarget.select()}),a.jsx("small",{children:n(u==="copied"?"environmentCenter.share.copiedHint":"environmentCenter.share.copyFailedHint")})]}):null,a.jsx("p",{className:"environment-share-dialog__safety",children:n("environmentCenter.share.safety")})]})}),a.jsxs("footer",{className:"environment-build-dialog__actions",children:[a.jsx(Tt,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:m,onClick:t,children:n("common.close")}),u==="error"?a.jsx(Tt,{type:"button",color:"info",size:"sm",onClick:()=>void g(l),children:n("common.retry")}):u==="copied"?a.jsx(Tt,{type:"button",color:"info",size:"sm",onClick:()=>void g(l),children:n("environmentCenter.share.copyAgain")}):null]})]})}),document.body)}function fJt({initialValue:e,autoInspect:t,onClose:n,onImported:i}){const{t:r}=_e("ui"),s=p.useId(),o=p.useId(),l=p.useId(),c=p.useRef(null),u=p.useRef(null),d=p.useRef(!1),[f,h]=p.useState(e),[m,g]=p.useState("editing"),[b,v]=p.useState([]),[y,w]=p.useState(""),[x,k]=p.useState([]),S=p.useMemo(()=>Pz(f),[f]),O=S.length>eU,A=m==="inspecting"||m==="importing",E=b.filter(P=>P.status==="valid"),j=b.filter(P=>P.status==="invalid"),T=m==="ready"&&E.length>0;W9e(c,u,n,A);const R=p.useCallback(async()=>{if(!(!S.length||O)){g("inspecting"),w(""),k([]);try{const P=await XTe(S);v([...P].sort((I,D)=>I.index-D.index)),g("ready")}catch(P){w(P instanceof Error?P.message:String(P)),g("editing")}}},[S,O]);p.useEffect(()=>{!t||d.current||(d.current=!0,R())},[t,R]);const C=async()=>{if(T){g("importing"),w(""),k([]);try{const P=E.map(U=>({code:S[U.index],name:U.name})).filter(U=>!!U.code),I=await YTe(P.map(U=>U.code)),D=I.filter(U=>U.status==="created").length,_=I.filter(U=>U.status==="duplicate").length,L=new Map(I.map(U=>[U.index,U])),F=P.flatMap(({code:U,name:Z},z)=>{const J=L.get(z);return!J||J.status==="failed"?[{code:U,name:Z,status:"valid",error:(J==null?void 0:J.error)||r("environmentCenter.import.noResult")}]:[]}),H=[...j.flatMap(U=>{const Z=S[U.index];return Z?[{code:Z,name:"",status:"invalid",error:U.error||r("environmentCenter.import.invalidCode")}]:[]}),...F],q=new Map;if(I.forEach(U=>{U.environment&&q.set(U.environment.id,U.environment)}),i([...q.values()],D,_,H.length),!H.length){n();return}h(H.map(U=>U.code).join(` +`)),k(F),v(H.map((U,Z)=>({index:Z,status:U.status,name:U.name,error:U.status==="invalid"?U.error:""}))),w(r("environmentCenter.import.partial",{created:D,remaining:H.length})),g("ready")}catch(P){w(P instanceof Error?P.message:String(P)),g("ready")}}},N=m==="inspecting"?r("environmentCenter.import.inspecting"):m==="importing"?r("environmentCenter.import.importing"):T?x.length?r("environmentCenter.import.retryImport"):r("environmentCenter.import.confirm"):r("environmentCenter.import.inspectCodes");return vi.createPortal(a.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:P=>{P.target===P.currentTarget&&!A&&n()},children:a.jsxs("section",{ref:c,className:"environment-share-dialog environment-import-dialog",role:"dialog","aria-modal":"true","aria-labelledby":s,"aria-describedby":o,"aria-busy":A||void 0,children:[a.jsxs("header",{className:"environment-build-dialog__header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:s,children:r("environmentCenter.import.title")}),a.jsx("p",{id:o,children:r("environmentCenter.import.description")})]}),a.jsx(Tt,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,disabled:A,onClick:n,"aria-label":r("environmentCenter.import.closeLabel"),children:a.jsx(Bo,{"aria-hidden":!0})})]}),a.jsxs("div",{className:"environment-share-dialog__body",children:[a.jsxs("label",{className:"environment-share-dialog__field",children:[a.jsx("span",{children:r("environmentCenter.import.code")}),a.jsx(bb,{ref:u,size:"lg",rows:6,value:f,disabled:A,"aria-invalid":O||j.length>0||void 0,"aria-describedby":l,placeholder:"akenv://v1/...",onChange:P=>{h(P.currentTarget.value),g("editing"),v([]),w(""),k([])}})]}),a.jsx("p",{id:l,className:`environment-share-dialog__help${O?" is-error":""}`,children:O?r("environmentCenter.import.tooMany",{max:eU,count:S.length}):r("environmentCenter.import.multipleHint")}),a.jsx("p",{className:"environment-share-dialog__safety",children:r("environmentCenter.import.safety")}),m==="inspecting"?a.jsx(on,{as:"p",children:r("environmentCenter.import.inspectingCodes")}):E.length?a.jsx("p",{className:"environment-share-dialog__summary",role:"status","aria-live":"polite",children:r("environmentCenter.import.found",{count:E.length,names:E.map(P=>P.name||r("environmentCenter.unnamed")).join(r("environmentCenter.listSeparator"))})}):null,j.length?a.jsx("ul",{className:"environment-share-dialog__failures",role:"alert",children:j.map(P=>a.jsx("li",{children:r("environmentCenter.import.itemError",{index:P.index+1,error:P.error||r("environmentCenter.import.invalidCode")})},P.index))}):null,x.length?a.jsx("ul",{className:"environment-share-dialog__failures",role:"alert",children:x.map((P,I)=>a.jsx("li",{children:r("environmentCenter.import.itemError",{index:I+1,error:P.error})},`${P.code}:${I}`))}):null,y?a.jsx("p",{className:"environment-share-dialog__error-text",role:"alert",children:y}):null]}),a.jsxs("footer",{className:"environment-build-dialog__actions",children:[a.jsx(Tt,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:A,onClick:n,children:r("common.cancel")}),a.jsx(Tt,{type:"button",color:"info",size:"sm",loading:A,disabled:A||!S.length||O||m==="ready"&&!T,onClick:()=>T?void C():void R(),children:N})]})]})}),document.body)}function hJt({environment:e,cloudProvider:t,onCancel:n,onDelete:i,onShare:r,onSave:s}){var Ae,Re,St,Nt,Dt,Et,$t;const{t:o,i18n:l}=_e("ui"),c=UZt(o),u=nJt(e,t),d=u.dockerfile!==void 0,[f,h]=p.useState(()=>({...u,dockerfile:d?void 0:u.dockerfile})),[m,g]=p.useState(u.gitSource?"git":u.imageSource?"image":d?"dockerfile":"custom"),[b,v]=p.useState(d?(e==null?void 0:e.dockerfile)??"":""),[y,w]=p.useState(""),x=p.useRef(null),[k,S]=p.useState(()=>d?VZt((e==null?void 0:e.dockerfile)??""):u.baseEnvironment==="aio-sandbox"||u.baseEnvironment==="codex-sandbox"?u.baseEnvironment:"none"),[O,A]=p.useState(((Ae=u.gitSource)==null?void 0:Ae.repositoryUrl)??""),[E,j]=p.useState(((Re=u.gitSource)==null?void 0:Re.ref)??""),[T,R]=p.useState(((St=u.gitSource)==null?void 0:St.dockerfilePath)??""),[C,N]=p.useState(u.gitSource?{repositoryUrl:u.gitSource.repositoryUrl,ref:u.gitSource.ref??"",commitSha:"",dockerfiles:[u.gitSource.dockerfilePath]}:null),[P,I]=p.useState(u.gitSource?`${u.gitSource.repositoryUrl}\0${u.gitSource.ref??""}`:""),[D,_]=p.useState(u.containerRepository?"existing":"managed"),[L,F]=p.useState(((Nt=u.containerRepository)==null?void 0:Nt.region)??nr(t)),[M,H]=p.useState(u.containerRepository??void 0),[q,U]=p.useState(((Dt=u.imageSource)==null?void 0:Dt.region)??nr(t)),[Z,z]=p.useState(u.imageSource?{region:u.imageSource.region,registry:u.imageSource.registry,namespace:u.imageSource.namespace,repository:u.imageSource.repository}:void 0),[J,ne]=p.useState(((Et=u.imageSource)==null?void 0:Et.reference)??""),[W,X]=p.useState(!1),ce=p.useMemo(()=>gH(f,t),[t,f.baseEnvironment,f.operatingSystem,f.language,f.optionIds]),V=f.dockerfile??ce,Y=k!=="none",K=k==="aio-sandbox"?pH:k==="codex-sandbox"?UIe[t]:"",de=Y?LZt(b):b,ee=Y?nR(K,""):"",Oe=Y?nR(K,de):b,he=y||(Y?$Zt(de,K,o):OK(b,void 0,o)),ge=!!e,Se="environment-editor-form",[xe,Pe]=p.useState(!1),[Ue,Ke]=p.useState(""),Me=!!Oe.trim()&&!he,re=`${O.trim()}\0${E.trim()}`,ue=!tU(O,o)&&P===re&&!!T&&(D==="managed"||lle(M)),be=lle(Z)&&!!J.trim()&&!V9e(J,o),Ce=!!f.name.trim()&&!xe&&(m==="custom"||m==="dockerfile"&&Me||m==="git"&&ue||m==="image"&&be),Ee=(He,yt)=>{h(je=>({...je,optionIds:yt?[...je.optionIds,He]:je.optionIds.filter(kt=>kt!==He)}))},Ve=He=>{w(""),v(Y?nR(K,He):He)},Ge=async He=>{if(!He)return;const yt=await FZt(He,o);w(yt.error),yt.content&&v(yt.content)},ye=()=>{w(""),v(ee)},oe=async He=>{if(He.preventDefault(),!!Ce){Pe(!0),Ke("");try{const yt=jmt(Oe);await s({...f,name:f.name.trim(),description:f.description.trim(),optionIds:m==="custom"?f.optionIds:[],selectedSkills:m==="custom"?f.selectedSkills:[],dockerfile:m==="dockerfile"?Oe:m==="custom"?V:"",gitSource:m==="git"?{repositoryUrl:O.trim(),...E.trim()?{ref:E.trim()}:{},dockerfilePath:T}:null,containerRepository:m==="git"&&D==="existing"?M:null,imageSource:m==="image"&&Z?{...Z,reference:J.trim()}:null,...m==="dockerfile"?yt:{}})}catch(yt){Ke(yt instanceof Error?yt.message:String(yt)),Pe(!1)}}},ie=f.name.trim()||(ge?(e==null?void 0:e.name)||o("environmentCenter.configure"):o("environmentCenter.create"));return a.jsx(Ch,{className:"environment-editor","aria-label":o(ge?"environmentCenter.details":"environmentCenter.create"),children:a.jsx(dT,{title:ie,description:o("environmentCenter.editorDescription"),identitySeed:ie,backLabel:o("environmentCenter.backToList"),onBack:n,actions:a.jsxs(a.Fragment,{children:[i?a.jsx(Tt,{type:"button",color:"danger",variant:"ghost",size:"sm",onClick:i,disabled:xe,children:o("common.delete")}):null,r?a.jsx(Tt,{color:"secondary",variant:"soft",size:"sm",onClick:r,disabled:xe,children:o("environmentCenter.share.action")}):null,a.jsx(Tt,{color:"secondary",variant:"soft",size:"sm",onClick:n,disabled:xe,children:o("common.cancel")}),a.jsx(Tt,{color:"info",size:"sm",type:"submit",form:Se,disabled:!Ce,children:o(xe?"common.saving":m==="image"?ge?"environmentCenter.save":"environmentCenter.create":ge?"environmentCenter.saveAndBuild":"environmentCenter.createAndBuild")})]}),children:a.jsxs("form",{id:Se,className:"environment-form",onSubmit:oe,children:[a.jsxs("div",{className:"environment-fields",children:[a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[o("environmentCenter.name"),a.jsx(rf,{})]}),a.jsx(js,{className:"environment-text-input",type:"text",size:"lg",required:!0,value:f.name,maxLength:60,placeholder:o("environmentCenter.namePlaceholder"),onChange:He=>h(yt=>({...yt,name:He.target.value}))})]}),a.jsxs("label",{className:"environment-field",children:[a.jsx("span",{children:o("common.description")}),a.jsx(bb,{className:"environment-description-input",size:"lg",rows:3,value:f.description,maxLength:180,placeholder:o("environmentCenter.descriptionPlaceholder"),onChange:He=>h(yt=>({...yt,description:He.target.value}))})]})]}),a.jsxs("label",{className:"environment-field environment-creation-method",children:[a.jsxs("span",{children:[o("environmentCenter.creationMethod"),a.jsx(rf,{})]}),a.jsx(ma,{id:"environment-creation-method",value:m,options:c,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:He=>{const yt=He.value;g(yt),yt==="dockerfile"&&!b.trim()&&v(ee),Ke("")}}),a.jsx("small",{children:($t=c.find(He=>He.value===m))==null?void 0:$t.description})]}),Ue?a.jsx("p",{className:"environment-form-error",role:"alert",children:Ue}):null,m==="custom"?a.jsxs("div",{className:"environment-configuration",children:[a.jsx("section",{className:"environment-section environment-form-section","aria-label":o("environmentCenter.baseConfiguration"),children:a.jsxs("div",{className:"environment-form-grid",children:[a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[o("environmentCenter.baseEnvironment"),a.jsx(rf,{})]}),a.jsx(ma,{id:"environment-base-environment",value:f.baseEnvironment,options:QZt.map(He=>({...He,description:o(`environmentCenter.baseDescriptions.${He.value}`)})),optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:He=>{const yt=He.value,je=yt==="aio-sandbox"||yt==="codex-sandbox";h(kt=>({...kt,baseEnvironment:yt,operatingSystem:je?"ubuntu-22.04":kt.operatingSystem,language:je?"python-3.12":kt.language}))}}),a.jsx("small",{children:o(`environmentCenter.baseDescriptions.${f.baseEnvironment}`)})]}),a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[o("environmentCenter.operatingSystem"),a.jsx(rf,{})]}),a.jsx(ma,{id:"environment-operating-system",value:f.operatingSystem,options:HZt,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:f.baseEnvironment!=="ubuntu",triggerClassName:"environment-select-trigger",onChange:He=>h(yt=>({...yt,operatingSystem:He.value}))}),a.jsx("small",{children:f.baseEnvironment!=="ubuntu"?o("environmentCenter.fixedByBase",{base:IB(f.baseEnvironment),value:"Ubuntu 22.04"}):o("environmentCenter.selectUbuntuVersion")})]}),a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[o("environmentCenter.pythonVersion"),a.jsx(rf,{})]}),a.jsx(ma,{id:"environment-python-version",value:f.language,options:f.baseEnvironment!=="ubuntu"?ale.filter(He=>He.value==="python-3.12"):ale,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:f.baseEnvironment!=="ubuntu",triggerClassName:"environment-select-trigger",onChange:He=>h(yt=>({...yt,language:He.value}))}),a.jsx("small",{children:f.baseEnvironment!=="ubuntu"?o("environmentCenter.fixedByBase",{base:IB(f.baseEnvironment),value:"Python 3.12"}):o("environmentCenter.selectPythonVersion")})]})]})}),a.jsxs("section",{className:"environment-section","aria-labelledby":"environment-skills-title",children:[a.jsx("h2",{id:"environment-skills-title",children:o("environmentCenter.skills")}),a.jsxs("div",{className:"environment-skill-grid",children:[a.jsx(sle,{name:"VeADK",description:o("environmentCenter.veadkDescription"),selected:W,disabled:xe,onChange:X,icon:a.jsx("img",{src:fM,alt:""})}),a.jsx(kK,{selected:f.selectedSkills,onChange:He=>h(yt=>({...yt,selectedSkills:He})),cloudProvider:t,disabled:xe,addLabel:o("environmentCenter.addSkill"),showSelectedCount:!1})]})]}),mH.map(He=>a.jsxs("section",{className:"environment-section","aria-labelledby":`environment-${He.id}-title`,children:[a.jsx("h2",{id:`environment-${He.id}-title`,children:o(`environmentCenter.categories.${He.id}`)}),a.jsx("div",{className:"environment-option-grid",children:He.options.map(yt=>{const je=f.optionIds.includes(yt.id);return a.jsx(sle,{name:yt.label,description:o(`environmentCenter.options.${yt.id}`,{defaultValue:yt.description}),selected:je,onChange:kt=>Ee(yt.id,kt),icon:a.jsx(tJt,{option:yt})},yt.id)})})]},He.id))]}):m==="dockerfile"?a.jsxs("section",{className:"environment-upload","aria-label":o("environmentCenter.customDockerfile"),children:[a.jsx("div",{className:"environment-dockerfile-settings environment-form-grid",children:a.jsxs("label",{className:"environment-field",children:[a.jsx("span",{children:o("environmentCenter.presetEnvironment")}),a.jsx(ma,{id:"environment-dockerfile-base-environment",value:k,options:zZt(o),optionClassName:"environment-select-option",size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:He=>{w(""),S(He.value)}}),a.jsx("small",{children:o("environmentCenter.presetHint")})]})}),a.jsxs("div",{className:"environment-upload__preview",children:[a.jsxs("div",{children:[a.jsxs("h3",{children:["Dockerfile",a.jsx(rf,{})]}),a.jsxs("div",{className:"environment-upload__actions",children:[a.jsx("span",{className:"environment-upload__size",children:o("environmentCenter.dockerfileSize",{size:z9e(Oe).toLocaleString(l.resolvedLanguage??l.language),max:131072 .toLocaleString(l.resolvedLanguage??l.language)})}),a.jsx("input",{ref:x,className:"environment-upload__file-input",type:"file",accept:".dockerfile,text/plain",tabIndex:-1,hidden:!0,onChange:He=>{var je;const yt=He.currentTarget;Ge((je=yt.files)==null?void 0:je[0]).finally(()=>{yt.value=""})}}),a.jsx(Tt,{className:"environment-upload__action",type:"button",color:"secondary",variant:"soft",size:"sm",pill:!1,disabled:xe,onClick:()=>{var He;return(He=x.current)==null?void 0:He.click()},children:o("environmentCenter.upload")}),a.jsx(Tt,{className:"environment-upload__action",type:"button",color:"secondary",variant:"ghost",size:"sm",pill:!1,disabled:xe||!de,onClick:ye,children:o("environmentCenter.reset")})]})]}),a.jsxs("div",{className:`environment-dockerfile-editor${Y?" has-fixed-base":""}${he?" is-invalid":""}`,children:[Y?a.jsxs("div",{className:"environment-dockerfile-from","aria-label":o("environmentCenter.dockerfileBaseImage"),children:[a.jsx("span",{className:"environment-dockerfile-from__line","aria-hidden":"true",children:"1"}),a.jsxs("code",{children:[a.jsx("span",{className:"environment-dockerfile-from__keyword",children:"FROM"}),a.jsx("span",{title:K,children:K})]})]}):null,a.jsx("div",{className:"environment-dockerfile__editor environment-upload__editor","aria-label":o("environmentCenter.dockerfileContent"),children:a.jsx(BT,{value:de,path:"Dockerfile",lineNumberStart:Y?2:1,height:"auto",minHeight:"28px",maxHeight:"var(--environment-dockerfile-editor-max-height)",onChange:Ve})})]})]}),he?a.jsx("p",{className:"environment-upload__error environment-upload__error--below",role:"alert",children:he}):null]}):m==="git"?a.jsxs("div",{className:"environment-source-workflow",children:[a.jsx(lJt,{repositoryUrl:O,gitRef:E,dockerfilePath:T,inspection:C,inspectedKey:P,disabled:xe,onRepositoryUrlChange:A,onGitRefChange:j,onDockerfilePathChange:R,onInspectionChange:N,onInspectedKeyChange:I}),a.jsx(cJt,{cloudProvider:t,mode:D,region:L,value:M,disabled:xe,onModeChange:He=>{_(He),Ke("")},onRegionChange:He=>{F(He),H(void 0),Ke("")},onChange:H})]}):a.jsx(uJt,{cloudProvider:t,region:q,repository:Z,reference:J,disabled:xe,onRegionChange:He=>{U(He),z(void 0),Ke("")},onRepositoryChange:z,onReferenceChange:ne})]})})})}function K9e({cloudProvider:e="volcengine",onWorkspace:t,onProjects:n,clipboardImport:i=null,clipboardReadError:r=""}){const{t:s,i18n:o}=_e("ui"),[l,c]=p.useState([]),[u,d]=p.useState({kind:"list"}),[f,h]=p.useState(""),[m,g]=p.useState(null),[b,v]=p.useState(null),[y,w]=p.useState(null),[x,k]=p.useState(null),[S,O]=p.useState(null),A=p.useRef(0),[E,j]=p.useState(""),[T,R]=p.useState(!1),[C,N]=p.useState(r),[P,I]=p.useState(!0),[D,_]=p.useState(""),[L,F]=p.useState(0),[M,H]=p.useState(()=>new Set),q=p.useDeferredValue(f),U=p.useMemo(()=>{const Y=q.trim().toLocaleLowerCase();return Y?l.filter(K=>`${K.name} ${K.description} ${RB(K.operatingSystem)} ${Fp(K.language)} ${IB(K.baseEnvironment)}`.toLocaleLowerCase().includes(Y)):l},[q,l]),Z=p.useCallback((Y="",K=!1)=>{A.current+=1,O({key:A.current,initialValue:Y,autoInspect:K})},[]),z=p.useCallback((Y,K=!1)=>{const de=Y.trim();if(!de.startsWith("akenv://")||!K&&ole.has(de))return!1;const ee=Pz(de);return!ee.length||ee.length>eU?!1:(ole.add(de),N(""),Z(de,!0),!0)},[Z]),J=p.useCallback(async()=>{var Y;if(!(u.kind!=="list"||S)){if(typeof navigator>"u"||!((Y=navigator.clipboard)!=null&&Y.readText)){N(s("environmentCenter.clipboardUnsupported"));return}try{const K=await navigator.clipboard.readText();!z(K)&&!K.trim()&&await KZt()&&N(s("environmentCenter.clipboardReadError"))}catch{N(s("environmentCenter.clipboardReadError"))}}},[S,z,s,u.kind]);p.useEffect(()=>{const Y=new AbortController;return l.length===0&&I(!0),_(""),VA(Y.signal).then(K=>{c(K)}).catch(K=>{(K==null?void 0:K.name)!=="AbortError"&&(WZt(K)?(c([]),R(!1),j(s("environmentCenter.storageUnavailable"))):_(K instanceof Error?K.message:String(K)))}).finally(()=>{Y.signal.aborted||I(!1)}),()=>Y.abort()},[L]),p.useEffect(()=>{if(!l.some(K=>K.latestVersion&&Py.has(K.latestVersion.status)))return;const Y=window.setTimeout(()=>F(K=>K+1),2500);return()=>window.clearTimeout(Y)},[l]),p.useEffect(()=>{if(!E||T)return;const Y=window.setTimeout(()=>j(""),2800);return()=>window.clearTimeout(Y)},[T,E]),p.useEffect(()=>{r&&N(r)},[r]),p.useEffect(()=>{i&&z(i.text)},[i,z]),p.useEffect(()=>{if(u.kind!=="list")return;const Y=()=>void J(),K=()=>{document.visibilityState==="visible"&&J()},de=ee=>{var ge;const Oe=ee.target;if(Oe instanceof HTMLInputElement||Oe instanceof HTMLTextAreaElement||Oe instanceof HTMLElement&&Oe.isContentEditable)return;const he=((ge=ee.clipboardData)==null?void 0:ge.getData("text/plain"))??"";z(he,!0)&&ee.preventDefault()};return window.addEventListener("focus",Y),document.addEventListener("visibilitychange",K),window.addEventListener("paste",de),()=>{window.removeEventListener("focus",Y),document.removeEventListener("visibilitychange",K),window.removeEventListener("paste",de)}},[z,J,u.kind]);const ne=u.kind==="editor"&&u.environmentId?l.find(Y=>Y.id===u.environmentId):void 0,W=async Y=>{const K={...Y,dockerfile:Y.dockerfile??gH(Y,e)},de=ne?await e2e(ne.id,K):await JTe(K);if(c(ee=>[de,...ee.filter(Oe=>Oe.id!==de.id)]),d({kind:"list"}),R(!1),K.imageSource){j(s("environmentCenter.status.boundImage",{name:de.name}));return}try{const ee=await U8(de.id);c(Oe=>Oe.map(he=>he.id===de.id?{...he,latestVersion:ee}:he)),j(s("environmentCenter.status.queued",{name:de.name}))}catch(ee){R(!0),j(s("environmentCenter.status.savedBuildFailed",{error:ee instanceof Error?ee.message:String(ee)}))}},X=async Y=>{if(!M.has(Y.id)){H(K=>new Set(K).add(Y.id)),R(!1);try{const K=await U8(Y.id);c(de=>de.map(ee=>ee.id===Y.id?{...ee,latestVersion:K}:ee)),j(s("environmentCenter.status.queued",{name:Y.name}))}catch(K){R(!0),j(K instanceof Error?K.message:String(K))}finally{H(K=>{const de=new Set(K);return de.delete(Y.id),de})}}},ce=(Y,K,de,ee)=>{Y.length&&c(Oe=>{const he=new Set(Y.map(ge=>ge.id));return[...Y,...Oe.filter(ge=>!he.has(ge.id))]}),R(ee>0),j(ee>0?s("environmentCenter.status.importedFailed",{created:K,failed:ee}):de>0?s("environmentCenter.status.importedDuplicate",{created:K,duplicate:de}):s("environmentCenter.status.imported",{count:K}))},V=m?a.jsx(_d,{title:s("environmentCenter.deleteTitle"),description:s("environmentCenter.deleteDescription",{name:m.name}),confirmLabel:s("common.delete"),variant:"danger",onCancel:()=>g(null),onConfirm:()=>{const Y=m;g(null),d({kind:"list"}),t2e(Y.id).then(()=>{c(K=>K.filter(de=>de.id!==Y.id)),R(!1),j(s("environmentCenter.status.deleted",{name:Y.name}))}).catch(K=>{R(!0),j(K instanceof Error?K.message:String(K))})}}):null;return u.kind==="editor"?a.jsxs(a.Fragment,{children:[a.jsx(hJt,{environment:ne,cloudProvider:e,onCancel:()=>d({kind:"list"}),onDelete:ne?()=>g(ne):void 0,onShare:ne?()=>k(ne):void 0,onSave:W},u.environmentId??"new"),x?a.jsx(dJt,{environment:x,onClose:()=>k(null)}):null,V]}):a.jsxs(xK,{section:"environments",className:"environment-center",onWorkspace:t,onProjects:n,actions:a.jsxs(a.Fragment,{children:[E?a.jsx("span",{className:`environment-status${T?" is-error":""}`,role:T?"alert":"status","aria-live":"polite",children:E}):null,a.jsx(em,{"aria-label":s("environmentCenter.search"),value:f,onChange:Y=>h(Y.target.value),placeholder:s("environmentCenter.search")})]}),children:[C?a.jsxs("div",{className:"environment-clipboard-notice",role:"alert",children:[a.jsx("span",{children:C}),a.jsx(Tt,{type:"button",color:"secondary",variant:"soft",size:"sm",onClick:()=>{N(""),Z()},children:s("environmentCenter.manualImport")})]}):null,a.jsx(tm,{"aria-live":"polite",children:P?a.jsx(fl,{}):D?a.jsxs("div",{className:"environment-load-error",role:"alert",children:[a.jsx("p",{children:_o(D,o.resolvedLanguage||o.language)||s("environmentCenter.loadFailed")}),a.jsx(Tt,{color:"secondary",variant:"soft",size:"sm",onClick:()=>F(Y=>Y+1),children:s("common.reload")})]}):U.length===0&&f.trim()?a.jsx("div",{className:"environment-empty",children:a.jsxs(qn,{fill:"none",children:[a.jsx(qn.Icon,{children:a.jsx(JZt,{})}),a.jsx(qn.Title,{children:s("environmentCenter.noMatches")}),a.jsx(qn.Description,{children:s("environmentCenter.tryAnotherName")})]})}):a.jsxs(zv,{children:[f.trim()?null:a.jsxs(a.Fragment,{children:[a.jsx(ab,{"aria-label":s("environmentCenter.create"),icon:a.jsx(XZt,{}),onClick:()=>d({kind:"editor",environmentId:null}),children:s("environmentCenter.create")}),a.jsx(ab,{"aria-label":s("environmentCenter.import.title"),icon:a.jsx(YZt,{}),onClick:()=>Z(),children:s("environmentCenter.import.title")})]}),U.map(Y=>{var Oe,he;const K=H9e(Y,s),de=!!(Y.latestVersion&&Py.has(Y.latestVersion.status)),ee=M.has(Y.id);return a.jsx(Hv,{className:"environment-card",title:Y.name,status:a.jsx(Za,{color:K.color,size:"sm",children:K.label}),description:((Oe=Y.latestVersion)==null?void 0:Oe.error)||(de?(he=Y.latestVersion)==null?void 0:he.currentStep:"")||Y.description||s("common.noDescription"),metadata:[{label:s("workspace.updated"),value:iJt(Y.updatedAt,o.resolvedLanguage??o.language),title:rJt(Y.updatedAt,o.resolvedLanguage??o.language)}],action:{label:Y.latestVersion?s("environmentCenter.buildDetails.title"):s(ee?"environmentCenter.buildDetails.starting":"environmentCenter.startBuild"),icon:"play",title:s("environmentCenter.build"),disabled:ee,onClick:()=>Y.latestVersion?v(Y.id):void X(Y)},auxiliaryAction:{label:s("environmentCenter.manifest.view"),icon:a.jsx(cat,{}),title:Y.latestVersion?s("environmentCenter.manifest.viewShort"):s("environmentCenter.manifest.unavailable"),disabled:!Y.latestVersion,onClick:()=>w(Y)},detailAction:{label:s("environmentCenter.configure"),onClick:()=>d({kind:"editor",environmentId:Y.id})}},Y.id)})]})}),b?(()=>{const Y=l.find(K=>K.id===b);return Y?a.jsx(oJt,{environment:Y,onClose:()=>v(null),onBuildUpdate:K=>{c(de=>de.map(ee=>ee.id===Y.id?{...ee,latestVersion:K}:ee))},onRebuild:()=>X(Y)}):null})():null,y!=null&&y.latestVersion?a.jsx(aJt,{environment:y,onClose:()=>w(null)}):null,V,S?a.jsx(fJt,{initialValue:S.initialValue,autoInspect:S.autoInspect,onClose:()=>O(null),onImported:ce},S.key):null]})}function pJt(e){const t=e instanceof Error?e.message:String(e??"");return t.includes("HTTP 503")&&(t.includes("未配置持久化存储")||t.includes("storage is not configured"))}function mJt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function gJt(e){return a.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"4.5",y:"7",width:"23",height:"18",rx:"3"}),a.jsx("path",{d:"M10 7V5.5A1.5 1.5 0 0 1 11.5 4h4A1.5 1.5 0 0 1 17 5.5V7M9 13h5v5H9zM18 13h5M18 17h5M9 22h14"})]})}function nU(e,t){const n=Date.parse(e);return Number.isNaN(n)?e:new Intl.DateTimeFormat(t,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(n)}function bJt(e,t){return e.environmentIds.reduce((n,i)=>{var r,s;return((s=(r=t.get(i))==null?void 0:r.latestVersion)==null?void 0:s.status)==="available"?n+1:n},0)}function yJt({workspace:e,environments:t,onBack:n,onSave:i,onDelete:r}){const{t:s,i18n:o}=_e("ui"),[l,c]=p.useState((e==null?void 0:e.name)??""),[u,d]=p.useState((e==null?void 0:e.description)??""),[f,h]=p.useState((e==null?void 0:e.environmentIds)??[]),[m,g]=p.useState(""),[b,v]=p.useState(!1),[y,w]=p.useState(""),x=m.trim().toLocaleLowerCase(),k=t.filter(O=>`${O.name} ${O.description} ${Fp(O.language)}`.toLocaleLowerCase().includes(x)),S=async O=>{if(O.preventDefault(),!(!l.trim()||b)){v(!0),w("");try{await i({name:l.trim(),description:u.trim(),environmentIds:f})}catch(A){w(A instanceof Error?A.message:String(A)),v(!1)}}};return a.jsx(Ch,{className:"workspace-center","aria-label":s(e?"workspace.detail":"workspace.create"),children:a.jsxs(dT,{title:e?e.name:s("workspace.create"),description:s("workspace.editorDescription"),identitySeed:(e==null?void 0:e.name)||s("workspace.create"),backLabel:s("workspace.backToList"),onBack:n,actions:a.jsxs(a.Fragment,{children:[r?a.jsx("button",{type:"button",className:"is-danger",onClick:r,children:s("common.delete")}):null,a.jsx("button",{type:"submit",form:"workspace-form",disabled:b||!l.trim(),children:s(b?"common.saving":"common.save")})]}),children:[e?a.jsxs(yH,{children:[a.jsxs("div",{children:[a.jsx("dt",{children:s("common.environment")}),a.jsx("dd",{children:s("workspace.environmentCount",{count:f.length})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("workspace.createdAt")}),a.jsx("dd",{children:nU(e.createdAt,o.resolvedLanguage??o.language)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("workspace.updatedAt")}),a.jsx("dd",{children:nU(e.updatedAt,o.resolvedLanguage??o.language)})]})]}):null,a.jsxs("form",{id:"workspace-form",className:"workspace-form",onSubmit:S,children:[a.jsxs("section",{className:"workspace-fields","aria-label":s("workspace.basicInfo"),children:[a.jsxs("label",{children:[a.jsx("span",{children:s("common.name")}),a.jsx(js,{value:l,maxLength:128,autoFocus:!0,onChange:O=>c(O.target.value),placeholder:s("workspace.namePlaceholder")})]}),a.jsxs("label",{children:[a.jsx("span",{children:s("common.description")}),a.jsx(bb,{value:u,maxLength:2e3,onChange:O=>d(O.target.value),placeholder:s("workspace.descriptionPlaceholder")})]})]}),a.jsxs("section",{className:"workspace-environments",children:[a.jsx(tPe,{title:s("common.environment"),description:s("workspace.selectedEnvironmentCount",{count:f.length}),actions:a.jsx(em,{"aria-label":s("workspace.searchAvailableEnvironments"),value:m,onChange:O=>g(O.target.value),placeholder:s("workspace.searchEnvironments")})}),t.length===0?a.jsxs("div",{className:"workspace-environment-empty",children:[a.jsx("p",{children:s("workspace.noAvailableEnvironments")}),a.jsx("span",{children:s("workspace.createEnvironmentFirst")})]}):k.length===0?a.jsxs("div",{className:"workspace-environment-empty",children:[a.jsx("p",{children:s("workspace.noMatchingEnvironments")}),a.jsx("span",{children:s("workspace.tryAnotherName")})]}):a.jsx("div",{className:"workspace-environment-list",children:k.map(O=>{var j;const A=f.includes(O.id),E=((j=O.latestVersion)==null?void 0:j.status)==="available"?s("workspace.environmentStatus.available"):O.latestVersion?s("workspace.environmentStatus.building"):s("workspace.environmentStatus.notBuilt");return a.jsxs("label",{className:`workspace-environment-option${A?" is-selected":""}`,children:[a.jsx("input",{type:"checkbox",checked:A,onChange:()=>h(T=>A?T.filter(R=>R!==O.id):[...T,O.id])}),a.jsxs("span",{className:"workspace-environment-option__copy",children:[a.jsx("strong",{title:O.name,children:O.name}),a.jsxs("span",{children:[Fp(O.language)," · ",E]})]}),a.jsx("span",{className:"workspace-environment-option__action",children:s(A?"workspace.added":"common.add")})]},O.id)})})]}),y?a.jsx("p",{className:"workspace-form-error",role:"alert",children:y}):null]})]})})}function vJt({onEnvironment:e,onProjects:t}){const{t:n,i18n:i}=_e("ui"),[r,s]=p.useState([]),[o,l]=p.useState([]),[c,u]=p.useState({kind:"list"}),[d,f]=p.useState(""),[h,m]=p.useState(!0),[g,b]=p.useState(""),[v,y]=p.useState(""),[w,x]=p.useState(!1),[k,S]=p.useState(null),[O,A]=p.useState(0),E=p.useDeferredValue(d);p.useEffect(()=>{const C=new AbortController;return m(!0),b(""),Promise.all([Lz(C.signal),VA(C.signal)]).then(([N,P])=>{s(N),l(P)}).catch(N=>{(N==null?void 0:N.name)!=="AbortError"&&(pJt(N)?(s([]),l([]),x(!1),y(n("workspace.storageUnavailable"))):(console.warn("Unable to load Studio workspaces",N),b(n("workspace.loadFailed"))))}).finally(()=>{C.signal.aborted||m(!1)}),()=>C.abort()},[O,n]),p.useEffect(()=>{if(!v||w)return;const C=window.setTimeout(()=>y(""),2800);return()=>window.clearTimeout(C)},[w,v]);const j=p.useMemo(()=>new Map(o.map(C=>[C.id,C])),[o]),T=p.useMemo(()=>{const C=E.trim().toLocaleLowerCase();return C?r.filter(N=>{const P=N.environmentIds.map(I=>{var D;return((D=j.get(I))==null?void 0:D.name)??""}).join(" ");return`${N.name} ${N.description} ${P}`.toLocaleLowerCase().includes(C)}):r},[E,j,r]),R=c.kind==="detail"&&c.workspaceId?r.find(C=>C.id===c.workspaceId):void 0;return c.kind==="detail"?a.jsx(yJt,{workspace:R,environments:o,onBack:()=>u({kind:"list"}),onDelete:R?()=>S(R):null,onSave:async C=>{const N=R?await qTe(R.id,C):await HTe(C);s(P=>[N,...P.filter(I=>I.id!==N.id)]),x(!1),y(n("workspace.saved",{name:N.name})),u({kind:"list"})}},c.workspaceId??"new"):a.jsxs(xK,{section:"workspaces",onEnvironment:e,onProjects:t,actions:a.jsxs(a.Fragment,{children:[v?a.jsx("span",{className:`workspace-status${w?" is-error":""}`,role:w?"alert":"status","aria-live":"polite",children:v}):null,a.jsx(em,{"aria-label":n("workspace.searchWorkspaces"),value:d,onChange:C=>f(C.target.value),placeholder:n("workspace.searchWorkspaces")})]}),children:[a.jsx(tm,{"aria-live":"polite",children:h?a.jsx(fl,{}):g?a.jsxs("div",{className:"workspace-load-error",role:"alert",children:[a.jsx("p",{children:g}),a.jsx(Tt,{color:"secondary",variant:"soft",size:"sm",onClick:()=>A(C=>C+1),children:n("common.reload")})]}):T.length===0&&d.trim()?a.jsx("div",{className:"workspace-empty",children:a.jsxs(qn,{fill:"none",children:[a.jsx(qn.Icon,{children:a.jsx(gJt,{})}),a.jsx(qn.Title,{children:n("workspace.noMatchingWorkspaces")}),a.jsx(qn.Description,{children:n("workspace.tryAnotherNameOrEnvironment")})]})}):a.jsxs(zv,{children:[d.trim()?null:a.jsx(ab,{"aria-label":n("workspace.create"),icon:a.jsx(mJt,{}),onClick:()=>u({kind:"detail",workspaceId:null}),children:n("workspace.create")}),T.map(C=>{const N=bJt(C,j),P=C.environmentIds.filter(I=>!j.has(I)).length;return a.jsx(Hv,{className:"workspace-card",title:C.name,status:a.jsx(Za,{color:P?"danger":N===C.environmentIds.length&&N>0?"success":"secondary",size:"sm",children:C.environmentIds.length===0?n("workspace.noEnvironmentAdded"):P?n("workspace.environmentMissing"):n("workspace.availableFraction",{available:N,total:C.environmentIds.length})}),description:C.description||n("common.noDescription"),metadata:[{label:n("common.environment"),value:n("workspace.environmentCount",{count:C.environmentIds.length})},{label:n("workspace.available"),value:n("workspace.availableCount",{count:N})},{label:n("workspace.updated"),value:nU(C.updatedAt,i.resolvedLanguage??i.language)}],detailAction:{label:n("common.manage"),onClick:()=>u({kind:"detail",workspaceId:C.id})},action:{label:n("workspace.addEnvironment"),icon:"plus",onClick:()=>u({kind:"detail",workspaceId:C.id})}},C.id)})]})}),k?a.jsx(_d,{title:n("workspace.deleteTitle"),description:n("workspace.deleteDescription",{name:k.name}),confirmLabel:n("common.delete"),variant:"danger",onCancel:()=>S(null),onConfirm:()=>{const C=k;S(null),WTe(C.id).then(()=>{s(N=>N.filter(P=>P.id!==C.id)),x(!1),y(n("workspace.deleted",{name:C.name})),u({kind:"list"})}).catch(N=>{x(!0),y(N instanceof Error?N.message:String(N))})}}):null]})}function xJt({cloudProvider:e,onProjects:t,initialSection:n="workspaces"}){const[i,r]=p.useState(n),{t:s}=_e("ui"),[o,l]=p.useState(null),[c,u]=p.useState(""),d=p.useRef(0),f=()=>{var g;d.current+=1;const h=d.current;u("");let m=null;if(typeof navigator<"u"&&((g=navigator.clipboard)!=null&&g.readText))try{m=navigator.clipboard.readText()}catch{u(s("workspace.clipboardPermissionError"))}else u(s("workspace.clipboardUnsupported"));r("environments"),m&&m.then(async b=>{var v;if(d.current===h){if(b.trim()){l({key:h,text:b});return}try{const y=await((v=navigator.permissions)==null?void 0:v.query({name:"clipboard-read"}));d.current===h&&(y==null?void 0:y.state)==="denied"&&u(s("workspace.clipboardPermissionError"))}catch{}}}).catch(()=>{d.current===h&&u(s("workspace.clipboardPermissionError"))})};return i==="environments"?a.jsx(K9e,{cloudProvider:e,onWorkspace:()=>r("workspaces"),onProjects:t,clipboardImport:o,clipboardReadError:c}):a.jsx(vJt,{onEnvironment:f,onProjects:t})}const wJt={id:"mpa-channels",kind:"mpa-channels",category:"channels",icon:"mpa-channels",name:"MPA agent messaging channels",description:"Connect an existing MPA agent to Feishu, WeCom and DingTalk."};function kJt(e){return e==="127.0.0.1"}const OJt={id:"coding-agents",kind:"coding-agent",category:"development",icon:"coding-agents",name:"Configure coding agents",badge:"Local",badgeTone:"success",description:"Install built-in VeADK and AgentKit skills globally for Trae, Claude Code, or Codex."},SJt={id:"feishu",kind:"feishu",category:"channels",icon:"feishu",name:"Feishu bot",badge:"Beta",description:"Create a Feishu bot and connect its messages directly to AgentKit Runtime."},EJt={id:"gitlab-review",kind:"gitlab",category:"development",icon:"gitlab",name:"GitLab MR review",description:"Use a GitLab integration to review merge requests in an isolated Sandbox."};bn.hasResourceBundle("en-US","automations")||bn.addResourceBundle("en-US","automations",Efe,!0,!0);bn.hasResourceBundle("zh-CN","automations")||bn.addResourceBundle("zh-CN","automations",Nve,!0,!0);function _h(e,t={}){return bn.t(e,{...t,ns:"automations"})}const G9e={name:"repository",label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL",required:!0},X9e={name:"baseBranch",label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base",required:!1},Y9e={name:"runtimeName",label:"Runtime name",placeholder:"support-agent",help:"Used by the AgentKit delivery configuration",required:!0},Z9e={name:"runtimeId",label:"Runtime ID",placeholder:"rt-xxxxxxxx",help:"The AgentKit Runtime that will receive continuous updates",required:!0},CJt="https://ark.cn-beijing.volces.com/api/coding/v3";function AJt(e){return e==="byteplus"?Fo(e):CJt}function SK(e){return e==="byteplus"?{accessKey:"BYTEPLUS_ACCESS_KEY",secretKey:"BYTEPLUS_SECRET_KEY",sessionToken:"BYTEPLUS_SESSION_TOKEN"}:{accessKey:"VOLCENGINE_ACCESS_KEY",secretKey:"VOLCENGINE_SECRET_KEY",sessionToken:"VOLCENGINE_SESSION_TOKEN"}}function J9e(e){const t=SK(e);return[_h("github.secretPair",{accessKey:t.accessKey,secretKey:t.secretKey}),_h("github.sessionToken",{sessionToken:t.sessionToken})]}function EK(e){return e==="byteplus"?"BytePlus":"Volcengine"}function CK(e,t={}){return{repository:"",baseBranch:"main",projectPath:".",runtimeName:"",runtimeId:"",modelName:"",modelBaseUrl:AJt(e),region:nr(e),token:"",...t}}function e7e(e){return{repository:e.repository.trim(),baseBranch:e.baseBranch.trim()||"main",region:e.region,token:e.token.trim()}}const TJt={id:"review",kind:"github",category:"development",icon:"github",name:"Automated PR review",description:"Use a GitHub App to review pull requests in an isolated Sandbox.",title:"Automated PR review",subtitle:"Trigger Sandbox reviews through the GitHub App and publish results to pull requests",panel:"Install the GitHub App to target repositories, then enable automated review for each repository.",submitLabel:"Install GitHub App",fields:[],initialValues:({cloudProvider:e})=>CK(e),regionHelp:"",secrets:()=>[],async submit(){throw new Error("PR 自动评审已切换为 GitHub App 授权模式。")}},_Jt="https://api.github.com",jJt=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,ule=/^[A-Za-z0-9][A-Za-z0-9._/-]{0,199}$/,NJt=/^[A-Za-z0-9._/-]+$/;function RJt(e,t,n){const i=String((t==null?void 0:t.message)||"");return e===403&&/workflow/i.test(i)?"GitHub Token 缺少 Workflows 写权限,无法创建或更新 .github/workflows 下的文件":e===401||e===403?Q("github.invalidToken"):e===404?Q("github.notFound"):e===422?Q("github.rejectedCommit"):i.split(n).join("***").trim().slice(0,240)||Q("github.requestFailed",{status:e})}async function Jb(e,t){const n={Accept:"application/vnd.github+json",Authorization:`Bearer ${t.token}`,"X-GitHub-Api-Version":"2022-11-28"};t.body&&(n["Content-Type"]="application/json");let i;try{i=await fetch(`${_Jt}${e}`,{method:t.method||"GET",headers:n,body:t.body?JSON.stringify(t.body):void 0,signal:t.signal})}catch(s){throw t.signal.aborted?s:new Error(Q("github.networkFailed"))}const r=await i.json().catch(()=>null);if(!t.expected.includes(i.status))throw new Error(RJt(i.status,r,t.token));return{status:i.status,payload:r}}function x6(e){return e.split("/").map(encodeURIComponent).join("/")}function IJt(e){const t=new TextEncoder().encode(e);let n="";const i=32768;for(let r=0;r({...h,path:TK(h.path,"")})),s=AbortSignal.any([t,AbortSignal.timeout(6e4)]),o=`/repos/${n}`;await Jb(`${o}`,{token:e.token,expected:[200],signal:s});const c=(f=(await Jb(`${o}/git/ref/heads/${x6(i)}`,{token:e.token,expected:[200],signal:s})).payload.object)==null?void 0:f.sha;if(!c)throw new Error(Q("github.missingBaseSha"));const u=PJt(e.branchPrefix);await Jb(`${o}/git/refs`,{token:e.token,expected:[201],signal:s,method:"POST",body:{ref:`refs/heads/${u}`,sha:c}});let d=!0;try{for(const m of r){const g=x6(m.path),b=await Jb(`${o}/contents/${g}?ref=${encodeURIComponent(i)}`,{token:e.token,expected:[200,404],signal:s});if(m.mustBeNew&&b.status===200)throw new Error(Q("github.fileAlreadyExists",{path:m.path}));if(b.status===200&&!b.payload.sha)throw new Error(Q("github.pathNotUpdatable",{path:m.path}));await Jb(`${o}/contents/${g}`,{token:e.token,expected:[200,201],signal:s,method:"PUT",body:{message:m.commitMessage,content:IJt(m.content),branch:u,...b.payload.sha?{sha:b.payload.sha}:{}}})}const h=await Jb(`${o}/pulls`,{token:e.token,expected:[201],signal:s,method:"POST",body:{title:e.title,head:u,base:i,body:e.description}});if(!h.payload.number||!h.payload.html_url)throw new Error(Q("github.invalidPullRequest"));return d=!1,{number:h.payload.number,url:h.payload.html_url,branch:u}}finally{d&&await Jb(`${o}/git/refs/heads/${x6(u)}`,{token:e.token,expected:[204],signal:AbortSignal.timeout(15e3),method:"DELETE"}).catch(()=>{})}}async function DJt(e,t){const n=await yn("/web/github/pull-request-reviews",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw await YT(n);const i=await n.json();if(i.status!=="started"||typeof i.sessionId!="string"||!i.sessionId||typeof i.displayName!="string")throw new Error("PR 评审服务返回了无效结果。");return i}async function MJt(e){const t=await yn("/web/github/app/config",{method:"GET",headers:{Accept:"application/json"},signal:e});if(!t.ok)throw await YT(t);const n=await t.json();if(typeof n.configured!="boolean"||typeof n.appSlug!="string"||typeof n.installUrl!="string"||typeof n.reason!="string")throw new Error("GitHub App 配置响应格式无效。");return n}async function LJt(e,t){var s;const n=new URLSearchParams({page:String(t.page),pageSize:String(t.pageSize)});(s=t.query)!=null&&s.trim()&&n.set("q",t.query.trim());const i=await yn(`/web/github/app/repositories?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await YT(i);const r=await i.json();if(!Array.isArray(r.repositories)||typeof r.page!="number"||typeof r.pageSize!="number"||typeof r.hasNextPage!="boolean"||typeof r.reviewSettingsConfigured!="boolean"||typeof r.reviewSettingsReason!="string"||r.repositories.some(o=>typeof o!="object"||o===null||typeof o.installationId!="number"||typeof o.account!="string"||typeof o.fullName!="string"||typeof o.htmlUrl!="string"||typeof o.private!="boolean"||typeof o.reviewEnabled!="boolean"))throw new Error("GitHub App 仓库列表响应格式无效。");return r}async function $Jt(e,t){const n=new URLSearchParams({page:String(t.page),pageSize:String(t.pageSize)}),i=await yn(`/web/github/app/review-records?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await YT(i);const r=await i.json();if(!Array.isArray(r.records)||typeof r.page!="number"||typeof r.pageSize!="number"||typeof r.hasNextPage!="boolean"||typeof r.reviewSettingsConfigured!="boolean"||typeof r.reviewSettingsReason!="string"||r.records.some(s=>typeof s!="object"||s===null||typeof s.id!="string"||typeof s.repository!="string"||typeof s.pullRequestUrl!="string"||typeof s.pullRequestNumber!="number"||!["started","completed","ignored","failed"].includes(String(s.status))||!["manual","webhook"].includes(String(s.trigger))||typeof s.createdAt!="string"||typeof s.deliveryId!="string"||typeof s.action!="string"||typeof s.sessionId!="string"||typeof s.displayName!="string"||typeof s.reason!="string"))throw new Error("PR 评审记录响应格式无效。");return r}async function FJt(e,t){const n=await yn("/web/github/app/review-repositories",{method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw await YT(n);const i=await n.json();if(!Array.isArray(i.repositories)||i.repositories.some(r=>typeof r!="string"))throw new Error("GitHub App 评审仓库保存响应格式无效。");return i.repositories}async function YT(e){const t=await e.text().catch(()=>"");try{const n=JSON.parse(t),i=typeof n.detail=="object"&&n.detail?n.detail.message:n.detail??n.message??n.error,r=typeof i=="string"?i:"";return new Error(r||`PR 评审发起失败(HTTP ${e.status})`)}catch{return new Error(t||`PR 评审发起失败(HTTP ${e.status})`)}}const BJt=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/,UJt="cn-hongkong";function QJt(e){const t=i0(e.runtimeName,n=>_h(`github.validation.runtimeName.${n}`));if(t)throw new Error(t);if(!BJt.test(e.runtimeId))throw new Error(_h("github.validation.runtimeId"))}function n7e(e){QJt(e);const t=e.cloudProvider??"volcengine",n=SK(t),i=t==="byteplus"?` VOLCENGINE_ACCESS_KEY: \${{ secrets.${n.accessKey} }} VOLCENGINE_SECRET_KEY: \${{ secrets.${n.secretKey} }} VOLCENGINE_SESSION_TOKEN: \${{ secrets.${n.sessionToken} }} BYTEPLUS_REGION: ${JSON.stringify(e.region)}`:"",r=t==="byteplus"?` - "DATABASE_VIKING_REGION": ${JSON.stringify(BJt)},`:"",s=`name: Publish to AgentKit Runtime + "DATABASE_VIKING_REGION": ${JSON.stringify(UJt)},`:"",s=`name: Publish to AgentKit Runtime on: push: @@ -969,8 +969,8 @@ jobs: if not result.success: raise SystemExit(f"AgentKit publish failed: {result.error}") PY -`,o={__BASE_BRANCH__:JSON.stringify(e.baseBranch),__PROJECT_PATH__:JSON.stringify(e.projectPath),__RUNTIME_NAME__:JSON.stringify(e.runtimeName),__RUNTIME_ID__:JSON.stringify(e.runtimeId),__REGION__:JSON.stringify(e.region),__CLOUD_PROVIDER__:JSON.stringify(t),__ACCESS_KEY_SECRET__:n.accessKey,__SECRET_KEY_SECRET__:n.secretKey,__SESSION_TOKEN_SECRET__:n.sessionToken,__BYTEPLUS_ENV__:i,__BYTEPLUS_RUNTIME_ENV__:r,__CONCURRENCY_GROUP__:JSON.stringify(`agentkit-runtime-${e.runtimeId}`)};return Object.entries(o).reduce((l,[c,u])=>l.split(c).join(u),s)}const QJt={id:"delivery",kind:"github",category:"development",icon:"github",name:"AgentKit Runtime delivery",description:"Add a workflow that continuously delivers your repository to AgentKit Runtime.",title:"AgentKit Runtime delivery",subtitle:"Add continuous delivery to the repository through a pull request",panel:"This creates a release branch and opens a pull request containing the GitHub Actions workflow.",submitLabel:"Confirm and create PR",fields:[K9e,G9e,{name:"projectPath",label:"Agent project directory",placeholder:".",help:"Defaults to the repository root; the directory must contain an app.py that mounts the complete Studio App Server",required:!1},X9e,Y9e],initialValues:({cloudProvider:e})=>CK(e),regionHelp:"Must match the target Runtime region",secrets:({cloudProvider:e})=>Z9e(e),submit(e,t,n){const i=J9e(e),r=TK(e.projectPath,"."),s=EK(t.cloudProvider);return e7e({...i,files:[{path:".github/workflows/publish-agentkit.yml",content:t7e({baseBranch:i.baseBranch,projectPath:r,runtimeName:e.runtimeName.trim(),runtimeId:e.runtimeId.trim(),region:i.region,cloudProvider:t.cloudProvider}),commitMessage:"feat: publish Agent to AgentKit Runtime"}],branchPrefix:"feat/agentkit-release",title:_h("cards.delivery.pullRequest.title"),description:_h("cards.delivery.pullRequest.description",{provider:s})},n)}};function zJt(e,t){return e==="."?t:`${e}/${t}`}function VJt(e){return`.github/workflows/publish-agentkit-${e.replace(/[^A-Za-z0-9]+/g,"-").replace(/^-|-$/g,"").toLowerCase()||"root"}.yml`}const HJt={volcengine:"agentkit-prod-public-cn-beijing.cr.volces.com/base/py-simple:python3.12-bookworm-slim-latest",byteplus:"agentkit-prod-public-ap-southeast-1.cr.bytepluses.com/base/py-simple:python3.12-bookworm-slim-latest"},qJt="1.1.13",WJt=["https://mirrors.cloud.tencent.com/pypi/simple","https://pypi.mirrors.ustc.edu.cn/simple","https://pypi.org/simple"];function KJt(e){return e!=="volcengine"?"RUN uv pip install -r requirements.txt":`RUN ${WJt.map(n=>`uv pip install --index-url ${n} -r requirements.txt`).join(` || \\ - `)}`}function GJt(e){const t=SK(e);return`# Local ${EK(e)} credentials. Never commit real values. +`,o={__BASE_BRANCH__:JSON.stringify(e.baseBranch),__PROJECT_PATH__:JSON.stringify(e.projectPath),__RUNTIME_NAME__:JSON.stringify(e.runtimeName),__RUNTIME_ID__:JSON.stringify(e.runtimeId),__REGION__:JSON.stringify(e.region),__CLOUD_PROVIDER__:JSON.stringify(t),__ACCESS_KEY_SECRET__:n.accessKey,__SECRET_KEY_SECRET__:n.secretKey,__SESSION_TOKEN_SECRET__:n.sessionToken,__BYTEPLUS_ENV__:i,__BYTEPLUS_RUNTIME_ENV__:r,__CONCURRENCY_GROUP__:JSON.stringify(`agentkit-runtime-${e.runtimeId}`)};return Object.entries(o).reduce((l,[c,u])=>l.split(c).join(u),s)}const zJt={id:"delivery",kind:"github",category:"development",icon:"github",name:"AgentKit Runtime delivery",description:"Add a workflow that continuously delivers your repository to AgentKit Runtime.",title:"AgentKit Runtime delivery",subtitle:"Add continuous delivery to the repository through a pull request",panel:"This creates a release branch and opens a pull request containing the GitHub Actions workflow.",submitLabel:"Confirm and create PR",fields:[G9e,X9e,{name:"projectPath",label:"Agent project directory",placeholder:".",help:"Defaults to the repository root; the directory must contain an app.py that mounts the complete Studio App Server",required:!1},Y9e,Z9e],initialValues:({cloudProvider:e})=>CK(e),regionHelp:"Must match the target Runtime region",secrets:({cloudProvider:e})=>J9e(e),submit(e,t,n){const i=e7e(e),r=TK(e.projectPath,"."),s=EK(t.cloudProvider);return t7e({...i,files:[{path:".github/workflows/publish-agentkit.yml",content:n7e({baseBranch:i.baseBranch,projectPath:r,runtimeName:e.runtimeName.trim(),runtimeId:e.runtimeId.trim(),region:i.region,cloudProvider:t.cloudProvider}),commitMessage:"feat: publish Agent to AgentKit Runtime"}],branchPrefix:"feat/agentkit-release",title:_h("cards.delivery.pullRequest.title"),description:_h("cards.delivery.pullRequest.description",{provider:s})},n)}};function VJt(e,t){return e==="."?t:`${e}/${t}`}function HJt(e){return`.github/workflows/publish-agentkit-${e.replace(/[^A-Za-z0-9]+/g,"-").replace(/^-|-$/g,"").toLowerCase()||"root"}.yml`}const qJt={volcengine:"agentkit-prod-public-cn-beijing.cr.volces.com/base/py-simple:python3.12-bookworm-slim-latest",byteplus:"agentkit-prod-public-ap-southeast-1.cr.bytepluses.com/base/py-simple:python3.12-bookworm-slim-latest"},WJt="1.1.13",KJt=["https://mirrors.cloud.tencent.com/pypi/simple","https://pypi.mirrors.ustc.edu.cn/simple","https://pypi.org/simple"];function GJt(e){return e!=="volcengine"?"RUN uv pip install -r requirements.txt":`RUN ${KJt.map(n=>`uv pip install --index-url ${n} -r requirements.txt`).join(` || \\ + `)}`}function XJt(e){const t=SK(e);return`# Local ${EK(e)} credentials. Never commit real values. ${t.accessKey}= ${t.secretKey}= # ${t.sessionToken}= @@ -987,7 +987,7 @@ AGENTKIT_CLOUD_PROVIDER=${e} # Optional Feishu Channel credentials. Studio can create and bind these. FEISHU_APP_ID= FEISHU_APP_SECRET= -`}function XJt(e,t="volcengine"){const n={"app.py":`"""__PROJECT_NAME__ — a VeADK agent with the full Studio App Server.""" +`}function YJt(e,t="volcengine"){const n={"app.py":`"""__PROJECT_NAME__ — a VeADK agent with the full Studio App Server.""" from assistant import root_agent from veadk.integrations.agentkit import create_agentkit_app, run_agentkit_app @@ -1031,19 +1031,19 @@ root_agent = Agent( instruction="You are a helpful assistant. Use your tools when relevant.", tools=[get_city_weather], ) -`,"requirements.txt":`veadk-python==${qJt} +`,"requirements.txt":`veadk-python==${WJt} agentkit-sdk-python==0.8.4 google-adk==2.1.0 lark-channel-sdk==1.2.0 lark-oapi==1.7.3 starlette==0.52.1 -`,Dockerfile:`FROM ${HJt[t]} +`,Dockerfile:`FROM ${qJt[t]} ENV UV_SYSTEM_PYTHON=1 UV_COMPILE_BYTECODE=1 PYTHONUNBUFFERED=1 WORKDIR /app COPY requirements.txt ./ -${KJt(t)} +${GJt(t)} COPY . . @@ -1068,7 +1068,7 @@ and local short-term memory fallback. Pushes to the configured target branch are continuously published by the GitHub Actions workflow added with this project. -`,".env.example":GJt(t),".gitignore":`__pycache__/ +`,".env.example":XJt(t),".gitignore":`__pycache__/ *.pyc .venv/ .env @@ -1082,20 +1082,20 @@ __pycache__/ Dockerfile .dockerignore README.md -`};return Object.fromEntries(Object.entries(n).map(([i,r])=>[i,r.split("__PROJECT_NAME__").join(e)]))}const YJt={id:"template",kind:"github",category:"development",icon:"github",name:"Import starter project",description:"Create a minimal Agent project in your repository with continuous delivery to AgentKit Runtime.",title:"Import starter project",subtitle:"Add a ready-to-run basic Agent and continuous delivery configuration to your repository",panel:"This creates a pull request containing the basic project and AgentKit Runtime delivery workflow.",submitLabel:"Import template and create PR",fields:[K9e,G9e,{name:"projectPath",label:"Agent project directory",placeholder:"agentkit-basic-agent",help:"The basic project will be added here; app.py mounts the complete Studio App Server and serves as the entry point",required:!0},X9e,Y9e],initialValues:({cloudProvider:e})=>CK(e,{projectPath:"agentkit-basic-agent"}),regionHelp:"Must match the target Runtime region",secrets:({cloudProvider:e})=>Z9e(e),submit(e,t,n){const i=J9e(e),r=AK(i.repository),s=TK(e.projectPath,"agentkit-basic-agent"),o=s==="."?r.split("/").slice(-1)[0]||"agentkit-basic-agent":s.split("/").slice(-1)[0]||"agentkit-basic-agent",l=Object.entries(XJt(o,t.cloudProvider)).map(([c,u])=>({path:zJt(s,c),content:u,commitMessage:"feat: import AgentKit basic template",mustBeNew:!0}));return l.push({path:VJt(s),content:t7e({baseBranch:i.baseBranch,projectPath:s,runtimeName:e.runtimeName.trim(),runtimeId:e.runtimeId.trim(),region:i.region,cloudProvider:t.cloudProvider}),commitMessage:"feat: add AgentKit Runtime delivery",mustBeNew:!0}),e7e({...i,repository:r,files:l,branchPrefix:"feat/agentkit-basic-template",title:_h("cards.template.pullRequest.title"),description:_h("cards.template.pullRequest.description",{provider:EK(t.cloudProvider)})},n)}},ZJt={id:"website-integration",kind:"website-integration",category:"channels",icon:"website-integration",name:"Website integration",description:"Embed an AgentKit Runtime on your website as a floating chat window."},fle=[{id:"development",label:"Development"},{id:"channels",label:"Messaging channels"}],n7e=[kJt,YJt,QJt,AJt,SJt,OJt,xJt,ZJt],JJt=new Map(n7e.map(e=>[e.id,e]));function een(e){const t=JJt.get(e);if(!t)throw new Error(`Unknown automation: ${e}`);return t}function ten(e){const t=een(e);if(t.kind!=="github")throw new Error(`Automation is not backed by GitHub: ${e}`);return t}function i7e(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"8",y:"3",width:"8",height:"6",rx:"2"}),a.jsx("path",{d:"M12 9v4M5 16v-1a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v1M12 13v3"}),a.jsx("rect",{x:"2",y:"16",width:"6",height:"5",rx:"1.5"}),a.jsx("rect",{x:"9",y:"16",width:"6",height:"5",rx:"1.5"}),a.jsx("rect",{x:"16",y:"16",width:"6",height:"5",rx:"1.5"})]})}function hle(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"10.8",cy:"10.8",r:"6.2",stroke:"currentColor",strokeWidth:"1.7"}),a.jsx("path",{d:"m15.4 15.4 4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function nen(e){return a.jsxs("svg",{viewBox:"0 0 36 36",fill:"none","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"5",width:"18",height:"18",rx:"5",fill:"currentColor",opacity:"0.1"}),a.jsx("rect",{x:"3.5",y:"5",width:"18",height:"18",rx:"5",stroke:"currentColor",strokeWidth:"1.6"}),a.jsx("path",{d:"m9.2 11.2-2.8 2.7 2.8 2.7M12.1 17.4h4.3",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),a.jsx("circle",{cx:"26.5",cy:"12",r:"3",fill:"hsl(var(--background))",stroke:"currentColor",strokeWidth:"1.6"}),a.jsx("circle",{cx:"27",cy:"26.5",r:"3",fill:"hsl(var(--background))",stroke:"currentColor",strokeWidth:"1.6"}),a.jsx("path",{d:"M21.5 12h2M19.3 21l5.6 3.8M27 15v8.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function ien(e){return a.jsxs("svg",{viewBox:"0 0 36 36",fill:"none","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"5",width:"22",height:"18",rx:"4",stroke:"currentColor",strokeWidth:"1.6"}),a.jsx("path",{d:"M4.5 10h20M9 7.5h.1M12 7.5h.1",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),a.jsx("path",{d:"M18 18.5c0-3 2.5-5.5 5.5-5.5h3c3 0 5.5 2.5 5.5 5.5v5c0 3-2.5 5.5-5.5 5.5H25l-4 3v-3.6a5.5 5.5 0 0 1-3-4.9v-5Z",fill:"hsl(var(--background))",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),a.jsx("path",{d:"M22 19.5h6M22 23h4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function ren(e){return a.jsxs("svg",{viewBox:"0 0 36 36",fill:"none","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M18 31 5.5 21.8 8.7 6.5 14 17.1h8L27.3 6.5l3.2 15.3L18 31Z",fill:"currentColor",opacity:"0.12"}),a.jsx("path",{d:"M18 31 5.5 21.8 8.7 6.5 14 17.1h8L27.3 6.5l3.2 15.3L18 31Z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),a.jsx("path",{d:"m14 17.1 4 13.9 4-13.9M5.5 21.8h25",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"})]})}function sen({onOpen:e,initialCategory:t="development",onCategoryChange:n}){var h;const{t:i}=_e("automations"),[r,s]=p.useState(t),[o,l]=p.useState(""),c=p.useDeferredValue(o),u=p.useMemo(()=>{const m=c.trim().toLocaleLowerCase();return n7e.filter(g=>g.category===r).filter(g=>!m||`${i(`cards.${g.id}.name`)} ${i(`cards.${g.id}.description`)}`.toLocaleLowerCase().includes(m))},[r,c,i]),d=(h=fle.find(m=>m.id===r))==null?void 0:h.id,f=wJt(window.location.hostname);return a.jsxs("div",{className:"applications-page",children:[a.jsxs("header",{className:"applications-header",children:[a.jsxs("div",{children:[a.jsx("h1",{children:i("title")}),a.jsx("p",{children:i("description")})]}),a.jsxs("label",{className:"applications-search",children:[a.jsx(hle,{}),a.jsx("input",{type:"search","aria-label":i("search"),value:o,onChange:m=>l(m.target.value),placeholder:i("search")})]})]}),a.jsx("nav",{className:"applications-categories","aria-label":i("categoriesLabel"),children:fle.map(m=>a.jsx("button",{type:"button",className:r===m.id?"is-active":"","aria-pressed":r===m.id,onClick:()=>{s(m.id),n==null||n(m.id)},children:i(`categories.${m.id}`)},m.id))}),a.jsx("section",{className:"applications-results","aria-label":i("resultsLabel",{category:i(`categories.${d}`)}),children:u.length?a.jsx("div",{className:"applications-grid",children:u.map(m=>{const g=m.id==="coding-agents"&&!f,b=g?"coding-agents-local-only-tooltip":void 0;return a.jsxs("div",{className:`application-card-wrap${g?" is-disabled":""}`,tabIndex:g?0:void 0,"aria-describedby":b,children:[a.jsxs("button",{type:"button",className:"application-card",onClick:()=>e(m.id),"aria-label":i("open",{name:i(`cards.${m.id}.name`)}),disabled:g,children:[m.icon==="feishu"?a.jsx("img",{className:"application-card-icon application-card-brand-icon",src:PL,alt:"","aria-hidden":"true"}):m.icon==="mpa-channels"?a.jsx(i7e,{className:"application-card-icon"}):m.icon==="coding-agents"?a.jsx(nen,{className:"application-card-icon"}):m.icon==="website-integration"?a.jsx(ien,{className:"application-card-icon"}):m.icon==="gitlab"?a.jsx(ren,{className:"application-card-icon"}):a.jsx(wK,{className:"application-card-icon"}),a.jsxs("div",{className:"application-card-copy",children:[a.jsxs("div",{className:"application-card-title",children:[a.jsx("h2",{children:i(`cards.${m.id}.name`)}),m.badge?a.jsx("span",{className:`application-card-badge is-${m.badgeTone||"default"}`,children:i(`cards.${m.id}.badge`,{defaultValue:m.badge})}):null]}),a.jsx("p",{children:i(`cards.${m.id}.description`)})]})]}),g?a.jsx("span",{id:b,className:"application-card-tooltip",role:"tooltip",children:i("localOnly")}):null]},m.id)})}):a.jsxs("div",{className:"applications-empty",role:"status",children:[a.jsx(hle,{}),a.jsx("h2",{children:i("emptyTitle")}),a.jsx("p",{children:i("emptyDescription")})]})})]})}function $h({open:e,keepMounted:t=!1,title:n,subtitle:i,icon:r,className:s="",busy:o=!1,initialFocusRef:l,onClose:c,children:u}){const{t:d}=_e("sandbox"),f=p.useId(),h=p.useRef(null),m=p.useRef(null),g=p.useRef(c);g.current=c;const b=p.useRef(o);return b.current=o,p.useEffect(()=>{var w;if(!e)return;m.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const v=document.body.style.overflow;document.body.style.overflow="hidden",(w=(l==null?void 0:l.current)??h.current)==null||w.focus();const y=x=>{var E;if(x.key==="Escape"){x.preventDefault(),b.current||g.current();return}if(x.key!=="Tab")return;const k=(E=h.current)==null?void 0:E.closest("[role=dialog]"),S=Array.from((k==null?void 0:k.querySelectorAll('button:not(:disabled), input:not(:disabled), iframe, [tabindex]:not([tabindex="-1"])'))??[]);if(S.length===0){x.preventDefault();return}const O=S[0],A=S[S.length-1];x.shiftKey&&document.activeElement===O?(x.preventDefault(),A.focus()):!x.shiftKey&&document.activeElement===A&&(x.preventDefault(),O.focus())};return window.addEventListener("keydown",y),()=>{var x;document.body.style.overflow=v,window.removeEventListener("keydown",y),(x=m.current)==null||x.focus()}},[e,l]),!e&&!t?null:vi.createPortal(a.jsx("div",{className:"sandbox-control-backdrop",hidden:!e,onMouseDown:v=>{v.target===v.currentTarget&&!o&&c()},children:a.jsxs("section",{className:`sandbox-control-dialog ${s}`.trim(),role:"dialog","aria-modal":"true","aria-labelledby":f,"aria-busy":o||void 0,children:[a.jsxs("header",{className:"sandbox-control-head",children:[a.jsx("span",{className:"sandbox-control-head-icon","aria-hidden":"true",children:r}),a.jsxs("div",{children:[a.jsx("h2",{id:f,children:n}),i?a.jsx("p",{children:i}):null]}),a.jsx("button",{ref:h,type:"button",className:"sandbox-control-close","aria-label":d("common.closeDialog",{title:n}),title:d("common.closeDialog",{title:n}),disabled:o,onClick:c,children:a.jsx(QAe,{})})]}),u]})}),document.body)}function aen({open:e,kind:t,launch:n,loading:i,error:r,onReload:s,onClose:o}){const{t:l}=_e("sandbox"),c=t==="terminal",u=l(c?"tool.terminalTitle":"tool.browserTitle");return a.jsxs($h,{open:e,title:u,subtitle:l(c?"tool.terminalSubtitle":"tool.browserSubtitle"),icon:c?a.jsx(sv,{}):a.jsx(UAe,{}),className:`sandbox-tool-dialog sandbox-tool-dialog--${t}`,onClose:o,children:[a.jsx("div",{className:"sandbox-tool-toolbar",children:a.jsxs("span",{children:[a.jsx("i",{className:i?"is-loading":n?"is-ready":""}),l(i?"tool.connecting":n?"tool.connected":"tool.notConnected")]})}),a.jsx("div",{className:"sandbox-tool-surface",children:i?a.jsxs("div",{className:"sandbox-control-state",children:[a.jsx(_c,{className:"spin"}),a.jsx("strong",{children:l("tool.opening",{title:u})}),a.jsx("span",{children:l("tool.connectingSession")})]}):r?a.jsxs("div",{className:"sandbox-control-state is-error",children:[a.jsx("strong",{children:l("tool.openFailed",{title:u})}),a.jsx("span",{children:r}),a.jsx("button",{type:"button",onClick:s,children:l("common.retry")})]}):n?a.jsx("iframe",{src:n.url,title:u,allow:"clipboard-read; clipboard-write",sandbox:"allow-downloads allow-forms allow-modals allow-popups allow-pointer-lock allow-same-origin allow-scripts"}):null})]})}function oen({open:e,threads:t,currentThreadId:n,loading:i,error:r,onSelect:s,onClose:o}){const{t:l,i18n:c}=_e("sandbox");return a.jsx($h,{open:e,title:l("threads.title"),subtitle:l("threads.subtitle"),icon:a.jsx(ret,{}),className:"sandbox-threads-dialog",onClose:o,children:a.jsx("div",{className:"sandbox-thread-list",children:i?a.jsxs("div",{className:"sandbox-control-state",children:[a.jsx(_c,{className:"spin"}),a.jsx("strong",{children:l("threads.loading")})]}):r?a.jsxs("div",{className:"sandbox-control-state is-error",children:[a.jsx("strong",{children:l("threads.loadFailed")}),a.jsx("span",{children:r})]}):t.length===0?a.jsx("div",{className:"sandbox-control-state",children:a.jsx("strong",{children:l("threads.empty")})}):t.map(u=>{const d=u.id===n,f=u.name||u.preview||`Thread ${u.id.slice(0,8)}`;return a.jsxs("button",{type:"button",className:d?"is-active":"",disabled:d,onClick:()=>s(u.id),children:[a.jsxs("span",{children:[a.jsx("strong",{children:f}),a.jsx("small",{children:u.preview||u.cwd||u.id})]}),a.jsx("time",{children:u.updatedAt?new Date(u.updatedAt*1e3).toLocaleString(c.resolvedLanguage??c.language):""}),a.jsx(_8,{})]},u.id)})})})}const len=[{value:"read-only",labelKey:"permissions.sandboxChoices.readOnly.label",detailKey:"permissions.sandboxChoices.readOnly.detail"},{value:"workspace-write",labelKey:"permissions.sandboxChoices.workspaceWrite.label",detailKey:"permissions.sandboxChoices.workspaceWrite.detail"},{value:"danger-full-access",labelKey:"permissions.sandboxChoices.fullAccess.label",detailKey:"permissions.sandboxChoices.fullAccess.detail",danger:!0}],cen=[{value:"untrusted",labelKey:"permissions.approvalChoices.untrusted.label",detailKey:"permissions.approvalChoices.untrusted.detail"},{value:"on-request",labelKey:"permissions.approvalChoices.onRequest.label",detailKey:"permissions.approvalChoices.onRequest.detail"},{value:"never",labelKey:"permissions.approvalChoices.never.label",detailKey:"permissions.approvalChoices.never.detail",danger:!0}],uen=[{value:"user",labelKey:"permissions.reviewerChoices.user.label",detailKey:"permissions.reviewerChoices.user.detail"},{value:"auto_review",labelKey:"permissions.reviewerChoices.autoReview.label",detailKey:"permissions.reviewerChoices.autoReview.detail"}];function den({open:e,value:t,busy:n,error:i,onSave:r,onClose:s}){const{t:o}=_e("sandbox"),[l,c]=p.useState(t);return p.useEffect(()=>{e&&c(t)},[e,t]),a.jsxs($h,{open:e,title:o("permissions.title"),subtitle:o("permissions.subtitle"),icon:a.jsx(pz,{}),className:"sandbox-settings-dialog",onClose:s,children:[a.jsxs("div",{className:"sandbox-control-body",children:[a.jsx(w6,{label:o("permissions.sandboxMode"),choices:len.map(u=>({...u,label:o(u.labelKey),detail:o(u.detailKey)})),value:l.sandboxMode,disabled:n,onChange:u=>c(d=>({...d,sandboxMode:u,networkAccess:u==="danger-full-access"?!0:d.networkAccess}))}),a.jsx(w6,{label:o("permissions.approvalPolicy"),choices:cen.map(u=>({...u,label:o(u.labelKey),detail:o(u.detailKey)})),value:l.approvalPolicy,disabled:n,onChange:u=>c(d=>({...d,approvalPolicy:u}))}),a.jsx(w6,{label:o("permissions.approvalMethod"),choices:uen.map(u=>({...u,label:o(u.labelKey),detail:o(u.detailKey)})),value:l.approvalsReviewer,disabled:n,onChange:u=>c(d=>({...d,approvalsReviewer:u}))}),a.jsxs("label",{className:`sandbox-network-toggle${l.sandboxMode==="danger-full-access"?" is-disabled":""}`,children:[a.jsxs("span",{children:[a.jsx("strong",{children:o("permissions.networkAccess")}),a.jsx("small",{children:o("permissions.networkAccessHelp")})]}),a.jsx("input",{type:"checkbox",checked:l.networkAccess,disabled:n||l.sandboxMode==="danger-full-access",onChange:u=>c(d=>({...d,networkAccess:u.target.checked}))})]}),l.sandboxMode==="danger-full-access"?a.jsx("div",{className:"sandbox-control-note is-danger",children:o("permissions.fullAccessWarning")}):null,i?a.jsx("div",{className:"sandbox-control-error",children:i}):null]}),a.jsxs("footer",{className:"sandbox-control-actions",children:[a.jsx("button",{type:"button",onClick:s,disabled:n,children:o("common.cancel")}),a.jsxs("button",{type:"button",className:"is-primary",disabled:n,onClick:()=>r(l),children:[n?a.jsx(_c,{className:"spin"}):null,o("permissions.save")]})]})]})}function w6({label:e,choices:t,value:n,disabled:i,onChange:r}){return a.jsxs("fieldset",{className:"sandbox-choice-group",disabled:i,role:"radiogroup","aria-label":e,children:[a.jsx("legend",{children:e}),a.jsx("div",{className:"sandbox-choice-list",children:t.map(s=>a.jsxs("button",{type:"button",role:"radio",className:`${n===s.value?"is-active":""}${s.danger?" is-danger":""}`.trim(),"aria-checked":n===s.value,onClick:()=>r(s.value),onKeyDown:o=>{var d,f;const l=t.findIndex(h=>h.value===s.value);let c=l;if(o.key==="ArrowRight"||o.key==="ArrowDown")c=(l+1)%t.length;else if(o.key==="ArrowLeft"||o.key==="ArrowUp")c=(l-1+t.length)%t.length;else if(o.key==="Home")c=0;else if(o.key==="End")c=t.length-1;else return;o.preventDefault(),r(t[c].value);const u=(d=o.currentTarget.parentElement)==null?void 0:d.querySelectorAll('[role="radio"]');(f=u==null?void 0:u[c])==null||f.focus()},children:[a.jsx("i",{}),a.jsxs("span",{children:[a.jsx("strong",{children:s.label}),a.jsx("small",{children:s.detail})]})]},s.value))})]})}function fen({open:e,cwd:t,locked:n,busy:i,error:r,browse:s,onSave:o,onClose:l}){const{t:c}=_e("sandbox"),[u,d]=p.useState(t||"/"),[f,h]=p.useState(null),[m,g]=p.useState(!1),[b,v]=p.useState("");p.useEffect(()=>{if(!e)return;const w=t||"/";d(w),y(w)},[t,e]);async function y(w){g(!0),v("");try{const x=await s(w);h(x),d(x.path)}catch(x){v(x instanceof Error?x.message:String(x))}finally{g(!1)}}return a.jsxs($h,{open:e,title:c("workspace.title"),subtitle:c("workspace.subtitle"),icon:a.jsx(aN,{}),className:"sandbox-workspace-dialog",onClose:l,children:[a.jsxs("div",{className:"sandbox-control-body",children:[a.jsxs("label",{className:"sandbox-workspace-input",children:[a.jsx("span",{children:c("workspace.absolutePath")}),a.jsxs("div",{children:[a.jsx("input",{value:u,disabled:i||n,spellCheck:!1,onChange:w=>d(w.target.value),onKeyDown:w=>{w.key==="Enter"&&u.startsWith("/")&&(w.preventDefault(),y(u))}}),a.jsx("button",{type:"button",disabled:i||m||!u.startsWith("/"),onClick:()=>void y(u),children:c("workspace.browse")})]})]}),a.jsxs("div",{className:"sandbox-directory-browser",children:[a.jsxs("div",{className:"sandbox-directory-head",children:[a.jsx("span",{title:f==null?void 0:f.path,children:(f==null?void 0:f.path)??u}),m?a.jsx(_c,{className:"spin"}):null]}),a.jsxs("div",{className:"sandbox-directory-list",children:[f!=null&&f.parent?a.jsxs("button",{type:"button",disabled:m,onClick:()=>void y(f.parent??"/"),children:[a.jsx(aN,{}),a.jsx("span",{children:c("workspace.parent")}),a.jsx("small",{children:f.parent}),a.jsx(_8,{})]}):null,f==null?void 0:f.directories.map(w=>a.jsxs("button",{type:"button",disabled:m,onClick:()=>void y(w.path),children:[a.jsx(aN,{}),a.jsx("span",{children:w.name}),a.jsx(_8,{})]},w.path)),!m&&(f==null?void 0:f.directories.length)===0?a.jsx("div",{className:"sandbox-directory-empty",children:c("workspace.empty")}):null]})]}),n?a.jsx("div",{className:"sandbox-control-note",children:c("workspace.locked")}):null,b||r?a.jsx("div",{className:"sandbox-control-error",children:b||r}):null]}),a.jsxs("footer",{className:"sandbox-control-actions",children:[a.jsx("button",{type:"button",onClick:l,disabled:i,children:c("common.cancel")}),a.jsxs("button",{type:"button",className:"is-primary",disabled:i||n||!u.startsWith("/"),onClick:()=>o(u),children:[i?a.jsx(_c,{className:"spin"}):null,c("workspace.useDirectory")]})]})]})}function hen({approval:e,busy:t,error:n,onDecision:i}){var l;const{t:r}=_e("sandbox"),s=(l=e==null?void 0:e.command)==null?void 0:l.trim(),o=(e==null?void 0:e.changes)===void 0?"":JSON.stringify(e.changes,null,2);return a.jsxs($h,{open:e!==null,title:(e==null?void 0:e.kind)==="file"?r("approval.fileTitle"):r("approval.commandTitle"),subtitle:r("approval.subtitle"),icon:a.jsx(pz,{}),className:"sandbox-approval-dialog",onClose:()=>{t||i("cancel")},children:[a.jsxs("div",{className:"sandbox-control-body",children:[e!=null&&e.reason?a.jsx("div",{className:"sandbox-approval-reason",children:e.reason}):null,s?a.jsx("pre",{children:s}):null,o?a.jsx("pre",{children:o}):null,e!=null&&e.cwd?a.jsxs("div",{className:"sandbox-approval-meta",children:[r("approval.workingDirectory")," ",a.jsx("code",{children:e.cwd})]}):null,n?a.jsx("div",{className:"sandbox-control-error",children:n}):null]}),a.jsxs("footer",{className:"sandbox-control-actions sandbox-approval-actions",children:[a.jsx("button",{type:"button",disabled:t,onClick:()=>i("decline"),children:r("approval.decline")}),a.jsx("button",{type:"button",disabled:t,onClick:()=>i("accept"),children:r("approval.acceptOnce")}),a.jsxs("button",{type:"button",className:"is-primary",disabled:t,onClick:()=>i("acceptForSession"),children:[t?a.jsx(_c,{className:"spin"}):null,r("approval.acceptSession")]})]})]})}const pen="data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='visible'%20style='display:%20block;'%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='down'%3e%3cpath%20id='&%23229;&%23189;&%23162;&%23231;&%23138;&%23182;'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.46129%203.67509C3.22783%203.44164%202.84933%203.44164%202.61587%203.67509L2.19316%204.0978C1.9597%204.33126%201.9597%204.70977%202.19316%204.94322L5.57484%208.32491C5.6922%208.44226%205.8462%208.50062%206.00001%208.49999C6.15382%208.50062%206.30782%208.44226%206.42518%208.32491L9.80686%204.94322C10.0403%204.70977%2010.0403%204.33126%209.80686%204.0978L9.38415%203.67509C9.15069%203.44164%208.77219%203.44164%208.53873%203.67509L6.00001%206.21381L3.46129%203.67509Z'%20fill='%23737A87'/%3e%3c/g%3e%3c/svg%3e";function _K({options:e,value:t,defaultValue:n,onChange:i,className:r="",style:s,disabled:o,id:l,ref:c,tabIndex:u,"aria-label":d,"aria-labelledby":f,...h}){var D;const m=p.useId(),g=`${m}-list`,b=p.useRef(null),v=p.useRef(null),y=p.useRef(null);p.useImperativeHandle(c,()=>v.current);const[w,x]=p.useState(n??((D=e.find(_=>!_.disabled))==null?void 0:D.value)??""),k=t??w,S=e.find(_=>_.value===k),[O,A]=p.useState(!1),[E,j]=p.useState(0),[T,R]=p.useState({left:0,top:0,width:0,maxHeight:240}),C=p.useRef({text:"",time:0});function N(){if(o)return;const _=e.findIndex(L=>L.value===k&&!L.disabled);j(_>=0?_:e.findIndex(L=>!L.disabled)),A(!0)}function P(_){var F;const L=e[_];!L||L.disabled||(v.current&&k!==L.value&&(v.current.value=L.value,v.current.dispatchEvent(new Event("change",{bubbles:!0}))),A(!1),(F=b.current)==null||F.focus())}function I(_){if(["ArrowDown","ArrowUp","Home","End"].includes(_.key)){if(_.preventDefault(),!O){N();return}const L=e.map((M,H)=>M.disabled?-1:H).filter(M=>M>=0);if(!L.length)return;const F=L.indexOf(E);j(_.key==="Home"?L[0]:_.key==="End"?L[L.length-1]:L[(F+(_.key==="ArrowDown"?1:-1)+L.length)%L.length])}else if(_.key==="Enter"||_.key===" ")_.preventDefault(),O?P(E):N();else if(_.key==="Escape")O&&_.preventDefault(),A(!1);else if(_.key==="Tab")A(!1);else if(_.key.length===1&&!_.ctrlKey&&!_.metaKey&&!_.altKey){const L=Date.now();C.current={text:(L-C.current.time<600?C.current.text:"")+_.key.toLowerCase(),time:L};const F=e.findIndex(M=>!M.disabled&&M.label.toLowerCase().startsWith(C.current.text));F>=0&&(j(F),A(!0))}}return p.useLayoutEffect(()=>{if(!O)return;function _(){var z;const L=(z=b.current)==null?void 0:z.getBoundingClientRect();if(!L)return;const F=window.innerHeight-L.bottom-12,M=L.top-12,H=e.reduce((J,ne)=>J+(ne.description?48:28),0),q=Math.min(240,H+Math.max(0,e.length-1)*4+10),U=FF,Z=Math.max(28,Math.min(240,U?M:F));R({left:Math.max(8,Math.min(L.left,window.innerWidth-L.width-8)),top:U?L.top-Math.min(q,Z)-6:L.bottom+6,width:L.width,maxHeight:Z})}return _(),window.addEventListener("resize",_),window.addEventListener("scroll",_,!0),()=>{window.removeEventListener("resize",_),window.removeEventListener("scroll",_,!0)}},[O,e]),p.useEffect(()=>{if(!O)return;function _(L){var F,M;L.target instanceof Node&&!((F=b.current)!=null&&F.contains(L.target))&&!((M=y.current)!=null&&M.contains(L.target))&&A(!1)}return document.addEventListener("pointerdown",_),()=>document.removeEventListener("pointerdown",_)},[O]),p.useEffect(()=>{o&&A(!1)},[o]),p.useEffect(()=>{var _,L,F;O&&((F=(L=(_=y.current)==null?void 0:_.querySelector(`[data-index="${E}"]`))==null?void 0:L.scrollIntoView)==null||F.call(L,{block:"nearest"}))},[E,O]),a.jsxs("span",{className:`studio-select ${r}`.trim(),style:s,"data-disabled":o||void 0,children:[a.jsxs("button",{ref:b,id:l,type:"button",role:"combobox",className:"studio-select__display",disabled:o,tabIndex:u,"aria-label":d,"aria-labelledby":f,"aria-expanded":O,"aria-haspopup":"listbox","aria-controls":O?g:void 0,"aria-activedescendant":O&&E>=0?`${m}-option-${E}`:void 0,"aria-required":h.required,onClick:()=>O?A(!1):N(),onKeyDown:I,children:[a.jsxs("span",{className:"studio-select__content",children:[(S==null?void 0:S.icon)&&a.jsx("span",{className:"studio-select__icon","aria-hidden":"true",children:S.icon}),a.jsx("span",{className:"studio-select__label",children:S==null?void 0:S.label})]}),a.jsx("img",{className:"studio-select__arrow","data-open":O,src:pen,alt:""})]}),a.jsx("select",{...h,ref:v,className:"studio-select__native","aria-hidden":"true",tabIndex:-1,disabled:o,value:k,onChange:_=>{t===void 0&&x(_.target.value),i==null||i(_)},children:e.map(_=>a.jsx("option",{value:_.value,disabled:_.disabled,children:_.label},_.value))}),O&&vi.createPortal(a.jsx(gf,{ref:y,id:g,role:"listbox","aria-label":d??"选项","aria-labelledby":f,className:"studio-select-menu",contentClassName:"studio-select-menu__items",style:T,children:e.map((_,L)=>a.jsxs("div",{id:`${m}-option-${L}`,role:"option","aria-label":_.label,"aria-describedby":_.description?`${m}-description-${L}`:void 0,"aria-selected":_.value===k,"aria-disabled":_.disabled||void 0,"data-active":L===E,"data-index":L,"data-description":!!_.description||void 0,className:"studio-select-menu__option",onPointerMove:()=>!_.disabled&&j(L),onMouseDown:F=>F.preventDefault(),onClick:()=>P(L),children:[_.icon&&a.jsx("span",{className:"studio-select__icon","aria-hidden":"true",children:_.icon}),_.description?a.jsxs("span",{className:"studio-select-menu__text",children:[a.jsx("span",{className:"studio-select__label",children:_.label}),a.jsx("span",{id:`${m}-description-${L}`,className:"studio-select-menu__description",title:_.description,children:_.description})]}):a.jsx("span",{className:"studio-select__label",children:_.label}),_.value===k&&a.jsx("svg",{className:"studio-select-menu__check",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m3 8 3 3 7-7",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})]},_.value))}),document.body)]})}async function r7e(e,t,n){const i=await wc(e,"",{signal:t});if(!i||!Array.isArray(i.channels))throw new Ou(502);const r=[],s=new Set;for(const o of i.channels){if(!o||typeof o!="object"||!("channel"in o))throw new Ou(502);if(o.channel!=="feishu")continue;const l="config"in o&&o.config&&typeof o.config=="object"?o.config:{},c="domain"in l?l.domain:"feishu";if(c!=="feishu"&&c!=="lark")throw new Ou(502);if(!(n&&c!==n)){if(!("appId"in o)||typeof o.appId!="string"||!o.appId.trim()||s.has(o.appId))throw new Ou(502);if(!("enabled"in o)||typeof o.enabled!="boolean")throw new Ou(502);s.add(o.appId),r.push({channel:"feishu",appId:o.appId,enabled:o.enabled,..."appName"in o&&typeof o.appName=="string"?{appName:o.appName}:{}})}}return r}const men=["Once","Interval","Daily","Weekly","Monthly","Cron"],gen=["Queued","Running","Succeeded","Failed","TimedOut","Cancelled","Skipped"];function $O(e){return e.runningAt?"Running":e.lastRunStatus||"Pending"}function $P(e,t,n){return typeof e!="string"||!Number.isFinite(Date.parse(e))?"—":new Intl.DateTimeFormat(t,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",timeZone:n}).format(new Date(e))}function iU(e,t,n){const i=e.schedule,r=typeof i.timezone=="string"?i.timezone:"Asia/Shanghai",s=i.type,o=s==="Once"?$P(i.runAt,n,r):s==="Interval"?`${i.intervalSeconds} ${t("seconds")}`:s==="Cron"?String(i.cronExpression):`${i.time}${s==="Weekly"?` · ${String(i.weekdays)}`:s==="Monthly"?` · ${String(i.monthDays)}`:""}`;return`${t(s)} · ${o} (${r})`}function ben(e){const t=new Date(e.getFullYear(),e.getMonth(),1);return t.setDate(t.getDate()-(t.getDay()+6)%7),Array.from({length:42},(n,i)=>new Date(t.getFullYear(),t.getMonth(),t.getDate()+i))}const rU=(e,t)=>Object.fromEntries(new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).formatToParts(e).map(n=>[n.type,n.value]));function yen(e,t,n,i,r,s){const o=Date.UTC(e,t-1,n,i,r),l=new Set;for(const c of[-864e5,0,864e5]){const u=o+c,d=rU(new Date(u),s),f=Date.UTC(+d.year,+d.month-1,+d.day,+d.hour,+d.minute)-u,h=o-f,m=rU(new Date(h),s);+m.year===e&&+m.month===t&&+m.day===n&&+m.hour===i&&+m.minute===r&&l.add(h)}return[...l]}function ven(e,t){const n=t.getTime(),i=new Date(t.getFullYear(),t.getMonth(),t.getDate()+1).getTime(),r=e.schedule,s=String(r.timezone||"Asia/Shanghai"),o=Date.parse(e.createdAt||"")||-1/0,l=b=>b>=Math.max(n,o)&&b59||!/^\d+$/.test(b[1])||+b[1]>23||b[3]!=="*"||!/^(\*|\d+(,\d+)*)$/.test(b[2])||!/^(\*|\d+(,\d+)*)$/.test(b[4])||b[2]!=="*"&&b[4]!=="*"){const v=Date.parse(e.nextRunAt||"");return l(v)?{at:v,count:1,nextOnly:!0}:null}c=`${b[1]}:${b[0]}`,d=b[2]==="*"?void 0:b[2].split(",").map(Number),u=b[4]==="*"?void 0:b[4].split(",").map(v=>+v==0?7:+v)}const[f,h]=c.split(":").map(Number);if(!Number.isFinite(f)||!Number.isFinite(h))return null;const m=[];for(let b=-1;b<=1;b++){const v=rU(new Date(n+b*864e5),s),y=+v.year,w=+v.month,x=+v.day,k=new Date(Date.UTC(y,w-1,x)).getUTCDay()||7;u&&!u.includes(k)||d&&!d.includes(x)||m.push(...yen(y,w,x,f,h,s).filter(l))}const g=[...new Set(m)].sort((b,v)=>b-v);return g.length?{at:g[0],count:g.length,nextOnly:!1}:null}function Zm({kind:e}){const t={filter:"M4 5h16l-6 7v7l-4-2v-5Z",plus:"M12 5v14M5 12h14",play:"M8 5l11 7-11 7Z",edit:"m15 4 5 5-11 11H4v-5ZM13 6l5 5",more:"M5 12h.01M12 12h.01M19 12h.01",detail:"M7 3h10l3 3v15H4V3ZM8 9h8M8 13h8M8 17h5",copy:"M9 8V3h12v13h-5M3 8h13v13H3Z",delete:"M3 6h18M9 6V3h6v3M5 6l1 15h12l1-15M10 10v7M14 10v7"};return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:"icon","aria-hidden":"true",children:a.jsx("path",{d:t[e]})})}function xen({task:e,runtime:t,copy:n,busy:i,error:r,onClose:s,onSave:o}){var fe,pe,Se;const{t:l}=_e("cronjobs"),c=ve=>l(`mpa.manage.${ve}`),u=e==null?void 0:e.schedule,[d,f]=p.useState(e?e.name+(n?` (${c("copy")})`:""):""),[h,m]=p.useState((e==null?void 0:e.prompt)||""),[g,b]=p.useState((u==null?void 0:u.type)||"Daily"),[v,y]=p.useState(String((u==null?void 0:u.timezone)||"Asia/Shanghai")),[w,x]=p.useState(String((u==null?void 0:u.time)||"09:00")),[k,S]=p.useState(()=>{if(!(u!=null&&u.runAt))return"";const ve=new Date(String(u.runAt));return new Date(ve.getTime()-ve.getTimezoneOffset()*6e4).toISOString().slice(0,16)}),[O,A]=p.useState(String((u==null?void 0:u.intervalSeconds)||3600)),[E,j]=p.useState(String((u==null?void 0:u.weekdays)||"1,2,3,4,5")),[T,R]=p.useState(String((u==null?void 0:u.monthDays)||"1")),[C,N]=p.useState(String((u==null?void 0:u.cronExpression)||"0 9 * * *")),[P,I]=p.useState((e==null?void 0:e.enabled)??!0),[D,_]=p.useState(String(((fe=e==null?void 0:e.delivery)==null?void 0:fe.channel)||"Web")),[L,F]=p.useState(String(((pe=e==null?void 0:e.delivery)==null?void 0:pe.targetId)||"")),[M,H]=p.useState(String(((Se=e==null?void 0:e.delivery)==null?void 0:Se.appId)||"")),[q,U]=p.useState([]),[Z,z]=p.useState(!1),[J,ne]=p.useState(!1),[W,X]=p.useState(""),[le,V]=p.useState(0);p.useEffect(()=>{if(!t||D!=="Feishu"){ne(!1);return}const ve=new AbortController,Le={runtimeId:t.runtimeId,region:t.region};return ne(!0),X(""),(async()=>{var se;let He;try{He=await wc(Le,"/capabilities",{signal:ve.signal})}catch(ce){if(ce instanceof Ou&&ce.status===404){ve.signal.aborted||z(!1);return}throw ce}if(ve.signal.aborted)return;const Ge=!!((se=He.multiBotChannels)!=null&&se.includes("feishu"));if(z(Ge),!Ge)return;const De=await r7e(Le,ve.signal);ve.signal.aborted||(U(De),H(ce=>ce||(De.length===1&&De[0].enabled?De[0].appId:"")))})().catch(He=>{ve.signal.aborted||X(He instanceof Ou&&[401,403].includes(He.status)?"botsUnauthorized":"botsFailed")}).finally(()=>{ve.signal.aborted||ne(!1)}),()=>ve.abort()},[t==null?void 0:t.runtimeId,t==null?void 0:t.region,D,le]);const[Y,K]=p.useState(""),ue=p.useRef(!1),te=p.useRef(null);function Oe(){var He;if(i||ue.current)return;if(D==="Feishu"&&t){if(J||W)return;if(Z&&!q.some(Ge=>Ge.appId===M&&Ge.enabled)){K(c("selectBot"));return}}try{new Intl.DateTimeFormat("en-US",{timeZone:v})}catch{K(c("timezoneInvalid"));return}const ve={type:g,timezone:v};if(g==="Once"){const Ge=Date.parse(k);if(!Number.isFinite(Ge)||Ge<=Date.now()){K(c("futureTime"));return}ve.runAt=new Date(Ge).toISOString()}else if(g==="Interval"){const Ge=Number(O);if(!Number.isInteger(Ge)||Ge<30||Ge>31536e3){K(c("intervalInvalid"));return}ve.intervalSeconds=Ge,(u==null?void 0:u.type)===g&&u.anchorAt&&(ve.anchorAt=u.anchorAt)}else if(g==="Cron"){if(C.trim().split(/\s+/).length!==5){K(l("validation.cronFields"));return}ve.cronExpression=C.trim()}else if(ve.time=w,g==="Weekly"||g==="Monthly"){const Ge=(g==="Weekly"?E:T).split(",").map(Number),De=g==="Weekly"?7:31;if(!Ge.length||Ge.some(se=>!Number.isInteger(se)||se<1||se>De)||new Set(Ge).size!==Ge.length){K(c("daysInvalid"));return}ve[g==="Weekly"?"weekdays":"monthDays"]=Ge}if(!d.trim()||!h.trim()||D==="Feishu"&&!L.trim()){K(c("required"));return}const Le=((He=e==null?void 0:e.delivery)==null?void 0:He.channel)===D&&String(e.delivery.targetId||"")===L&&(D!=="Feishu"||!Z||String(e.delivery.appId||"")===M)&&!(D==="Web"&&e.delivery.appId)?e.delivery:{channel:D,...D==="Feishu"&&Z?{appId:M}:{},targetId:D==="Web"?null:L.trim(),receiveIdType:"chat_id",bestEffort:!0};K(""),o({name:d.trim(),...e!=null&&e.agentId?{agentId:e.agentId}:{},prompt:h.trim(),enabled:P,schedule:ve,delivery:Le,jitterSeconds:(e==null?void 0:e.jitterSeconds)??0,timeoutSeconds:(e==null?void 0:e.timeoutSeconds)??3600})}return a.jsx($h,{open:!0,title:c(e&&!n?"edit":"create"),icon:a.jsx(Zm,{kind:"edit"}),className:"mpa-dialog",initialFocusRef:te,busy:i,onClose:s,children:a.jsxs("form",{onSubmit:ve=>{ve.preventDefault(),Oe()},onCompositionStart:()=>{ue.current=!0},onCompositionEnd:()=>{ue.current=!1},onKeyDown:ve=>{ve.key==="Enter"&&(ue.current||ve.nativeEvent.isComposing||ve.keyCode===229)&&ve.preventDefault()},children:[a.jsxs("div",{className:"sandbox-control-body mpa-editor",children:[a.jsxs("fieldset",{disabled:i,children:[a.jsxs("label",{children:[c("name"),a.jsx("input",{ref:te,className:"cw-input",required:!0,maxLength:128,value:d,onChange:ve=>f(ve.target.value)})]}),a.jsxs("label",{children:[c("prompt"),a.jsx("textarea",{className:"cw-input",required:!0,maxLength:4e3,rows:5,value:h,onChange:ve=>m(ve.target.value)})]}),a.jsxs("div",{className:"mpa-fields",children:[a.jsxs("div",{children:[a.jsx("span",{children:c("schedule")}),a.jsx(bf,{ariaLabel:c("schedule"),placeholder:"",value:g,options:men.map(ve=>({value:ve,label:c(ve)})),onChange:b})]}),a.jsxs("label",{children:[c("timezone"),a.jsx("input",{className:"cw-input",required:!0,value:v,onChange:ve=>y(ve.target.value)})]})]}),g==="Once"?a.jsxs("label",{children:[c("localTime"),a.jsx("input",{className:"cw-input",required:!0,type:"datetime-local",value:k,onChange:ve=>S(ve.target.value)})]}):g==="Interval"?a.jsxs("label",{children:[c("interval"),a.jsx("input",{className:"cw-input",required:!0,type:"number",min:30,max:31536e3,value:O,onChange:ve=>A(ve.target.value)})]}):g==="Cron"?a.jsxs("label",{children:[c("Cron"),a.jsx("input",{className:"cw-input",required:!0,value:C,maxLength:128,onChange:ve=>N(ve.target.value)})]}):a.jsxs("label",{children:[c("time"),a.jsx("input",{className:"cw-input",type:"time",required:!0,value:w,onChange:ve=>x(ve.target.value)})]}),g==="Weekly"&&a.jsxs("label",{children:[c("weekdays"),a.jsx("input",{className:"cw-input",required:!0,value:E,onChange:ve=>j(ve.target.value)})]}),g==="Monthly"&&a.jsxs("label",{children:[c("monthDays"),a.jsx("input",{className:"cw-input",required:!0,value:T,onChange:ve=>R(ve.target.value)})]}),a.jsxs("div",{children:[a.jsx("span",{children:c("delivery")}),a.jsx(bf,{ariaLabel:c("delivery"),placeholder:"",value:D,options:["Web","Feishu"].map(ve=>({value:ve,label:c(ve)})),onChange:_})]}),D==="Feishu"&&t&&a.jsxs(a.Fragment,{children:[J&&a.jsx("p",{role:"status",children:c("botsLoading")}),W&&a.jsxs("div",{role:"alert",children:[a.jsx("p",{children:c(W)}),a.jsx("button",{type:"button",className:"cw-btn cw-btn-ghost",disabled:i||J,onClick:()=>V(ve=>ve+1),children:c("retryBots")})]}),Z&&a.jsxs("div",{children:[a.jsx("span",{children:c("botAccount")}),a.jsx(_K,{"aria-label":c("botAccount"),value:M,disabled:i||J||!!W,options:[{value:"",label:c("selectBot")},...q.map(ve=>({value:ve.appId,label:`${ve.appName||ve.appId} | ${ve.appId}${ve.enabled?"":` | ${c("botDisabled")}`}`,disabled:!ve.enabled}))],onChange:ve=>H(ve.target.value)}),!J&&!W&&!q.some(ve=>ve.appId===M&&ve.enabled)&&a.jsx("p",{role:"status",children:c("selectBot")})]})]}),D==="Feishu"&&a.jsxs("label",{children:[c("target"),a.jsx("input",{className:"cw-input",required:!0,maxLength:512,value:L,onChange:ve=>F(ve.target.value)})]}),a.jsxs("label",{className:"mpa-checkbox",children:[a.jsx("input",{type:"checkbox",checked:P,onChange:ve=>I(ve.target.checked)}),c("enabled")]})]}),(Y||r)&&a.jsx("p",{role:"alert",className:"cw-error-text",children:Y||r})]}),a.jsxs("footer",{className:"sandbox-control-actions",children:[a.jsx("button",{type:"button",className:"cw-btn cw-btn-ghost",disabled:i,onClick:s,children:c("cancel")}),a.jsx("button",{className:"cw-btn cw-btn-primary is-primary",disabled:i||D==="Feishu"&&!!t&&(J||!!W),type:"submit",children:c(i?"saving":"save")})]})]})})}function sU(e){const t=e instanceof Error?e.message:"";return{MPA_HTTP_401:"mpa.authRequired",MPA_HTTP_403:"mpa.forbidden",MPA_HTTP_404:"mpa.unsupported",MPA_HTTP_409:"mpa.manage.conflict",MPA_HTTP_422:"mpa.manage.invalid",MPA_INVALID_RESPONSE:"mpa.invalidResponse"}[t]||"mpa.loadFailed"}function wen({task:e,runtime:t,onClose:n}){const{t:i,i18n:r}=_e("cronjobs"),s=v=>i(`mpa.manage.${v}`),[o,l]=p.useState(0),[c,u]=p.useState(0),[d,f]=p.useState(null),[h,m]=p.useState(""),[g,b]=p.useState(!0);return p.useEffect(()=>{const v=new AbortController;return b(!0),m(""),f(null),U2e(t,e.id,o,v.signal).then(y=>{v.signal.aborted||f(y)}).catch(y=>{v.signal.aborted||m(sU(y))}).finally(()=>{v.signal.aborted||b(!1)}),()=>v.abort()},[t.runtimeId,t.region,e.id,o,c]),a.jsx($h,{open:!0,title:e.name,icon:a.jsx(Zm,{kind:"detail"}),className:"mpa-dialog mpa-detail",onClose:n,children:a.jsxs("div",{className:"sandbox-control-body",children:[a.jsxs("dl",{className:"mpa-details",children:[a.jsx("dt",{children:s("agent")}),a.jsx("dd",{children:e.agentId||"—"}),a.jsx("dt",{children:s("schedule")}),a.jsx("dd",{children:iU(e,s,r.language)}),a.jsx("dt",{children:i("mpa.columns.next")}),a.jsx("dd",{children:$P(e.nextRunAt,r.language)}),a.jsx("dt",{children:s("prompt")}),a.jsx("dd",{className:"mpa-prompt",children:e.prompt})]}),a.jsxs("div",{className:"mpa-history-title",children:[a.jsx("h3",{children:s("history")}),a.jsx("button",{className:"cw-btn cw-btn-ghost",disabled:g,onClick:()=>u(v=>v+1),children:i("mpa.refresh")})]}),h&&a.jsx("p",{className:"cw-error-text",role:"alert",children:i(h)}),g&&a.jsx(on,{children:i("mpa.loading")}),d&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"mpa-cron-table",children:a.jsxs("table",{children:[a.jsx("thead",{children:a.jsx("tr",{children:["lastRun","lastStatus","duration","result"].map(v=>a.jsx("th",{children:s(v)},v))})}),a.jsx("tbody",{children:d.items.map(v=>a.jsxs("tr",{children:[a.jsx("td",{children:$P(v.startedAt||v.scheduledAt,r.language)}),a.jsx("td",{children:s(v.status)}),a.jsx("td",{children:v.durationMs==null?"—":`${v.durationMs} ms`}),a.jsx("td",{children:v.errorMessage||v.sessionId||"—"})]},v.id))})]})}),d.items.length===0&&a.jsx("p",{children:s("noRuns")}),a.jsxs("nav",{className:"mpa-cron-pages",children:[a.jsx("span",{children:i("mpa.total",{total:d.total})}),a.jsx("button",{className:"cw-btn cw-btn-ghost",disabled:o===0,onClick:()=>l(Math.max(0,o-20)),children:i("mpa.previous")}),a.jsx("button",{className:"cw-btn cw-btn-ghost",disabled:!d.hasMore,onClick:()=>l(d.nextOffset),children:i("mpa.next")})]})]})]})})}function ken({runtime:e}){const{t}=_e("cronjobs");return e?a.jsx(Oen,{runtime:e},`${e.region}:${e.runtimeId}`):a.jsx("p",{role:"status",children:t("mpa.selectRuntime")})}function Oen({runtime:e}){const{t,i18n:n}=_e("cronjobs"),i=V=>t(`mpa.manage.${V}`),[r,s]=p.useState(""),[o,l]=p.useState(""),[c,u]=p.useState(0),[d,f]=p.useState(0),[h,m]=p.useState(null),[g,b]=p.useState(!0),[v,y]=p.useState(""),[w,x]=p.useState(""),[k,S]=p.useState("list"),[O,A]=p.useState("all"),[E,j]=p.useState(()=>new Date),[T,R]=p.useState(null),[C,N]=p.useState(null),[P,I]=p.useState(null),[D,_]=p.useState(!1),[L,F]=p.useState(""),M=p.useRef(!1),H=p.useRef(!1),q=p.useRef(new AbortController),U=p.useRef(new Map);p.useEffect(()=>{const V=new AbortController;return q.current=V,()=>V.abort()},[]),p.useEffect(()=>{const V=new AbortController;return b(!0),y(""),m(null),(async()=>{const Y=await K8(e,0,o,V.signal),K=[...Y.items];let ue=Y,te=0;for(;ue.hasMore;){if(V.signal.aborted)return;if(ue.nextOffset===null||ue.nextOffset<=te||K.length>1e5)throw new Error("MPA_INVALID_RESPONSE");te=ue.nextOffset,ue=await K8(e,te,o,V.signal),K.push(...ue.items)}V.signal.aborted||m({...Y,items:[...new Map(K.map(Oe=>[Oe.id,Oe])).values()],hasMore:!1,nextOffset:null})})().catch(Y=>{V.signal.aborted||y(sU(Y))}).finally(()=>{V.signal.aborted||b(!1)}),()=>V.abort()},[e.runtimeId,e.region,o,d]);const Z=p.useMemo(()=>(h==null?void 0:h.items.filter(V=>O==="all"||$O(V)===O))||[],[h,O]),z=p.useMemo(()=>ben(E),[E]),J=p.useMemo(()=>z.map(V=>({day:V,tasks:Z.flatMap(Y=>{const K=ven(Y,V);return K?[{task:Y,...K}]:[]})})),[z,Z]),ne=Z.slice(c,c+10);function W(V){let Y=U.current.get(V);return Y||(Y=crypto.randomUUID(),U.current.set(V,Y)),Y}async function X(V,Y,K){if(M.current)return;M.current=!0,_(!0),F(""),x("");const ue=q.current,te=V==="create"?JSON.stringify(K):`${V}:${Y==null?void 0:Y.id}`;try{const Oe=Y?`/${encodeURIComponent(Y.id)}${V==="run"?"/run":""}`:"";if((V==="edit"||V==="toggle")&&(!Number.isInteger(Y==null?void 0:Y.version)||Number(Y==null?void 0:Y.version)<1))throw new Error("MPA_INVALID_RESPONSE");const fe=V==="delete"?void 0:V==="run"?{clientToken:W(te),mode:"Force"}:V==="create"?{...K,clientToken:W(te)}:{...V==="toggle"?{enabled:!Y.enabled}:K,expectedVersion:Y.version},pe=await B2e(e,V==="delete"?"DELETE":"POST",Oe,fe,ue.signal);if(V==="delete"?pe.removed!==!0:V==="run"?!pe.run:!pe.task)throw new Error("MPA_INVALID_RESPONSE");U.current.delete(te),ue.signal.aborted||(R(null),I(null),N(null),x(i(V==="run"?"queued":"saved")),u(0),f(Se=>Se+1))}catch(Oe){ue.signal.aborted||F(t(sU(Oe)))}finally{M.current=!1,ue.signal.aborted||_(!1)}}function le(V,Y=!1){F(""),R({task:V,copy:Y})}return a.jsxs("section",{className:"mpa-cron","aria-label":t("mpa.title"),children:[a.jsxs("div",{className:"mpa-cron-target",children:[a.jsx("strong",{children:e.name}),a.jsxs("span",{children:[e.runtimeId," · ",e.region]})]}),a.jsxs("div",{className:"mpa-cron-heading",children:[a.jsx("div",{className:"mpa-segment",role:"group","aria-label":i("view"),children:["list","calendar"].map(V=>a.jsx("button",{"aria-pressed":k===V,onClick:()=>S(V),children:i(V)},V))}),a.jsxs("button",{className:"cw-btn cw-btn-primary mpa-create",disabled:D,onClick:()=>le(),children:[a.jsx(Zm,{kind:"plus"}),i("create")]})]}),a.jsxs("div",{className:"mpa-toolbar",children:[a.jsxs("form",{className:"mpa-cron-search",onSubmit:V=>{V.preventDefault(),!H.current&&(u(0),l(r),f(Y=>Y+1))},children:[a.jsx("input",{"aria-label":t("mpa.search"),placeholder:t("mpa.search"),type:"search",maxLength:200,value:r,onChange:V=>s(V.target.value),onCompositionStart:()=>{H.current=!0},onCompositionEnd:()=>{H.current=!1},onKeyDown:V=>{V.key==="Enter"&&(H.current||V.nativeEvent.isComposing||V.keyCode===229)&&V.preventDefault()}}),a.jsx("button",{className:"cw-btn cw-btn-ghost",disabled:g,type:"submit",children:t("mpa.search")}),a.jsx("button",{className:"cw-btn cw-btn-ghost",disabled:g,type:"button",onClick:()=>f(V=>V+1),children:t("mpa.refresh")})]}),(h==null?void 0:h.overview)&&a.jsxs("div",{className:"mpa-cron-overview",children:[a.jsx("span",{children:i("overview")}),a.jsxs("span",{children:[t("mpa.successRate")," ",a.jsxs("strong",{children:[Math.round(h.overview.successRate*100),"%"]})]}),a.jsxs("span",{children:[t("mpa.executionCount")," ",a.jsx("strong",{children:h.overview.executionCount})]})]})]}),v&&a.jsx("p",{role:"alert",className:"mpa-cron-error",children:t(v)}),L&&!T&&!P&&a.jsx("p",{role:"alert",className:"mpa-cron-error",children:L}),w&&a.jsx("p",{role:"status",children:w}),g&&a.jsx("div",{className:"mpa-state",role:"status",children:a.jsx(on,{children:t("mpa.loading")})}),!g&&!v&&h&&a.jsx(a.Fragment,{children:k==="list"?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mpa-cron-table",tabIndex:0,role:"region","aria-label":t("mpa.title"),children:[a.jsxs("table",{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:i("name")}),a.jsx("th",{children:i("lastRun")}),a.jsx("th",{children:i("schedule")}),a.jsx("th",{children:a.jsxs(rr,{children:[a.jsx(rr.Trigger,{children:a.jsxs("button",{className:"mpa-status-filter","aria-label":i("lastStatus"),children:[i(O==="all"?"lastStatus":O),a.jsx(Zm,{kind:"filter"})]})}),a.jsx(rr.Content,{side:"bottom",align:"start",children:["all","Pending",...gen].map(V=>a.jsx(rr.Item,{onSelect:()=>{A(V),u(0)},children:i(V)},V))})]})}),a.jsx("th",{children:i("agent")}),a.jsx("th",{children:i("actions")})]})}),a.jsx("tbody",{children:ne.map(V=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx("button",{className:"mpa-task-link",title:V.name,onClick:()=>N(V),children:V.name})}),a.jsx("td",{children:$P(V.lastRunAt,n.language)}),a.jsx("td",{children:iU(V,i,n.language)}),a.jsx("td",{children:a.jsx("span",{className:`mpa-status mpa-status-${$O(V)}`,children:i($O(V))})}),a.jsx("td",{children:V.agentId||"—"}),a.jsx("td",{children:a.jsxs("div",{className:"mpa-actions",children:[a.jsx("button",{role:"switch","aria-checked":V.enabled,"aria-label":`${i("enabled")} ${V.name}`,disabled:D,className:"mpa-switch",onClick:()=>void X("toggle",V),children:a.jsx("span",{})}),a.jsx("button",{className:"mpa-icon-button",title:i("run"),"aria-label":`${i("run")} ${V.name}`,disabled:D||$O(V)==="Running"||$O(V)==="Queued",onClick:()=>void X("run",V),children:a.jsx(Zm,{kind:"play"})}),a.jsxs(rr,{children:[a.jsx(rr.Trigger,{children:a.jsx("button",{className:"mpa-icon-button",disabled:D,"aria-label":`${i("actions")} ${V.name}`,children:a.jsx(Zm,{kind:"more"})})}),a.jsx(rr.Content,{side:"bottom",align:"end",minWidth:148,children:["detail","edit","copy","delete"].map(Y=>a.jsxs(rr.Item,{onSelect:()=>{Y==="detail"?N(V):Y==="delete"?(F(""),I(V)):le(V,Y==="copy")},children:[a.jsx(Zm,{kind:Y}),a.jsx("span",{children:i(Y)})]},Y))})]})]})})]},V.id))})]}),Z.length===0&&a.jsx("div",{className:"mpa-state",role:"status",children:t("mpa.empty")})]}),a.jsxs("nav",{className:"mpa-cron-pages","aria-label":t("mpa.pagination"),children:[a.jsx("span",{children:t("mpa.total",{total:Z.length})}),a.jsx("button",{className:"cw-btn cw-btn-ghost",disabled:c===0,onClick:()=>u(Math.max(0,c-10)),children:t("mpa.previous")}),a.jsx("button",{className:"cw-btn cw-btn-ghost",disabled:c+10>=Z.length,onClick:()=>u(c+10),children:t("mpa.next")})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mpa-calendar-bar",children:[a.jsx("strong",{children:new Intl.DateTimeFormat(n.language,{year:"numeric",month:"long"}).format(E)}),a.jsxs("span",{children:[i("calendarZone")," ",Intl.DateTimeFormat().resolvedOptions().timeZone]}),a.jsx("button",{className:"cw-btn cw-btn-ghost",onClick:()=>j(new Date(E.getFullYear(),E.getMonth()-1,1)),children:i("prevMonth")}),a.jsx("button",{className:"cw-btn cw-btn-ghost",onClick:()=>j(new Date),children:i("today")}),a.jsx("button",{className:"cw-btn cw-btn-ghost",onClick:()=>j(new Date(E.getFullYear(),E.getMonth()+1,1)),children:i("nextMonth")})]}),a.jsxs("div",{className:"mpa-calendar",children:[z.slice(0,7).map(V=>a.jsx("div",{className:"mpa-calendar-weekday",children:new Intl.DateTimeFormat(n.language,{weekday:"short"}).format(V)},V.toISOString())),J.map(({day:V,tasks:Y})=>a.jsxs("div",{className:`mpa-calendar-day ${V.getMonth()!==E.getMonth()?"is-outside":""}`,children:[a.jsx("time",{dateTime:V.toISOString(),children:V.getDate()}),Y.map(({task:K,at:ue,count:te,nextOnly:Oe})=>a.jsxs("button",{className:"mpa-calendar-task",onClick:()=>N(K),title:`${K.name} · ${iU(K,i,n.language)}`,children:[a.jsxs("span",{children:[new Intl.DateTimeFormat(n.language,{hour:"2-digit",minute:"2-digit"}).format(ue)," ",K.name]}),te>1&&a.jsxs("small",{children:[" × ",te]}),Oe&&a.jsx("small",{children:i("nextOnly")})]},K.id))]},V.toISOString()))]}),a.jsx("p",{children:i("calendarHint")})]})}),T&&a.jsx(xen,{runtime:e,task:T.task,copy:T.copy,busy:D,error:L,onClose:()=>R(null),onSave:V=>void X(T.task&&!T.copy?"edit":"create",T.copy?void 0:T.task,V)}),C&&a.jsx(wen,{runtime:e,task:C,onClose:()=>N(null)},C.id),P&&a.jsxs($h,{open:!0,title:i("delete"),icon:a.jsx(Zm,{kind:"delete"}),busy:D,onClose:()=>I(null),children:[a.jsxs("div",{className:"sandbox-control-body",children:[a.jsx("p",{children:t("mpa.manage.deleteConfirm",{name:P.name})}),L&&a.jsx("p",{role:"alert",className:"cw-error-text",children:L})]}),a.jsxs("footer",{className:"sandbox-control-actions",children:[a.jsx("button",{className:"cw-btn cw-btn-ghost",disabled:D,onClick:()=>I(null),children:i("cancel")}),a.jsx("button",{className:"cw-btn cw-btn-primary",disabled:D,onClick:()=>void X("delete",P),children:i("delete")})]})]})]})}const Sen="_Container_1bl61_1",Een="_Track_1bl61_16",Cen="_Thumb_1bl61_56",Aen="_Label_1bl61_78",kj={Container:Sen,Track:Een,Thumb:Cen,Label:Aen},aU=({className:e,label:t,id:n,disabled:i,labelPosition:r="end",...s})=>{const o=p.useId(),l=n??o;return a.jsxs("div",{className:qi(kj.Container,e),"data-disabled":i?"":void 0,"data-has-label":t?"":void 0,"data-label-position":r,children:[a.jsx(hft,{id:l,className:kj.Track,disabled:i,...s,children:a.jsx(mft,{className:kj.Thumb})}),t&&a.jsx("label",{htmlFor:l,className:kj.Label,children:t})]})};function yb({message:e,className:t="",onRetry:n,retryLabel:i,defaultExpanded:r=!0}){const{t:s}=_e("ui"),o=i??s("deploymentError.retryDeployment"),[l,c]=p.useState(r),[u,d]=p.useState(!1),f=async()=>{if(!(!n||u)){d(!0);try{await n()}finally{d(!1)}}};return a.jsxs("div",{className:`deploy-error-message${l?" is-expanded":""}${t?` ${t}`:""}`,role:"alert",children:[a.jsx("p",{className:"deploy-error-message-text",children:e}),a.jsxs("div",{className:"deploy-error-message-actions",children:[n&&a.jsxs(At,{type:"button",className:"deploy-error-retry",color:"danger",variant:"soft",size:"sm",pill:!1,loading:u,onClick:()=>void f(),children:[!u&&a.jsx(Xst,{}),u?s("deploymentError.retrying"):o]}),a.jsx(At,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,pill:!1,title:s(l?"deploymentError.collapse":"deploymentError.expand"),"aria-label":s(l?"deploymentError.collapse":"deploymentError.expand"),onClick:()=>c(h=>!h),children:l?a.jsx(tat,{}):a.jsx(aat,{})}),a.jsx(aH,{copyValue:e,color:"secondary",variant:"ghost",size:"sm",uniform:!0,pill:!1,title:s("deploymentError.copy"),"aria-label":s("deploymentError.copy")})]})]})}const Ten={queued:"status.queued",pending:"status.pending",running:"status.running",retrying:"status.retrying",success:"status.success",failed:"status.failed",cancelled:"status.cancelled",skipped:"status.skipped"},s7e=["weekdays.sunday","weekdays.monday","weekdays.tuesday","weekdays.wednesday","weekdays.thursday","weekdays.friday","weekdays.saturday"];function oU(e){if(!e)return"-";const t=new Date(e);return Number.isNaN(t.getTime())?e:new Intl.DateTimeFormat(bn.resolvedLanguage,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).format(t).replace(/\//g,"-")}function _en(e){if(!e.startedAt)return"-";const t=Date.parse(e.startedAt),n=e.finishedAt?Date.parse(e.finishedAt):Date.now();if(!Number.isFinite(t)||!Number.isFinite(n)||n{const d=i.current;!d||r.current||c(d.scrollHeight>d.clientHeight+1)},[]);return p.useLayoutEffect(()=>{r.current=s,s||u()},[s,u,e]),p.useEffect(()=>{const d=i.current;if(!d||typeof ResizeObserver>"u")return;const f=new ResizeObserver(u);return f.observe(d),()=>f.disconnect()},[u]),a.jsxs("div",{className:`cronjobs-run-output-body${s?" is-expanded":""}`,children:[a.jsx("p",{id:n,ref:i,children:e}),l?a.jsx(At,{type:"button",className:"cronjobs-run-output-toggle",color:"secondary",variant:"ghost",size:"sm",pill:!1,"aria-expanded":s,"aria-controls":n,onClick:()=>o(d=>!d),children:t(s?"actions.collapse":"actions.expand")}):null]})}const cU="Asia/Shanghai",Nen=3e3,Ren=["Asia/Shanghai","Asia/Singapore","Asia/Tokyo","Europe/London","America/Los_Angeles","America/New_York","UTC"];function It(e,t){return bn.t(e,{ns:"cronjobs",...t})}function Ien(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||cU}catch{return cU}}function Pen(){const e=Ien(),t=new Date(Date.now()+24*60*60*1e3);return t.setSeconds(0,0),{name:"",runtimeId:"",prompt:"",scheduleType:"daily",onceAt:new Date(t.getTime()-t.getTimezoneOffset()*6e4).toISOString().slice(0,16),time:"09:00",weekday:1,cron:"0 9 * * *",timezone:e,enabled:!0}}function Den(e){return{name:e.name,runtimeId:e.runtimeId,prompt:e.prompt,scheduleType:e.schedule.type,onceAt:e.schedule.onceAt??"",time:e.schedule.time??"09:00",weekday:e.schedule.weekday??1,cron:e.schedule.cron??"0 9 * * *",timezone:e.schedule.timezone||cU,enabled:e.enabled}}function Men({run:e}){const t=e?e.status==="success"?"success":e.status==="failed"?"danger":["queued","pending","running","retrying"].includes(e.status)?"info":"secondary":"secondary";return a.jsx(Za,{className:"cronjobs-status",color:t,variant:"soft",size:"sm",pill:!0,children:It(e?Ten[e.status]:"status.notRun")})}function ple({job:e,runtimes:t,cloudProvider:n,busy:i,onClose:r,onSubmit:s}){const[o,l]=p.useState(()=>e?Den(e):Pen()),[c,u]=p.useState(""),[d,f]=p.useState(!1),h=p.useRef(null),m=p.useRef(null),g=p.useRef(null),b=i||d,v=p.useRef(b),y=p.useRef(r),w=p.useMemo(()=>Array.from(new Set([o.timezone,...Ren])),[o.timezone]),x=p.useMemo(()=>t.map(A=>({value:A.runtimeId,label:A.name,description:Sh(A.region,n)})),[n,t]),k=p.useMemo(()=>s7e.map((A,E)=>({value:String(E),label:It(A)})),[]),S=p.useMemo(()=>w.map(A=>({value:A,label:A})),[w]);p.useEffect(()=>{v.current=b,y.current=r},[b,r]),p.useEffect(()=>{var T;const A=document.body.style.overflow,E=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(T=m.current)==null||T.focus();const j=R=>{var D,_;if(R.key==="Escape"&&!v.current){y.current();return}if(R.key!=="Tab")return;const C=Array.from(((D=h.current)==null?void 0:D.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))??[]).filter(L=>!L.hidden&&L.getClientRects().length>0);if(C.length===0){R.preventDefault();return}const N=C[0],P=C[C.length-1],I=document.activeElement;R.shiftKey&&(I===N||!((_=h.current)!=null&&_.contains(I)))?(R.preventDefault(),P.focus()):!R.shiftKey&&I===P&&(R.preventDefault(),N.focus())};return window.addEventListener("keydown",j),()=>{document.body.style.overflow=A,window.removeEventListener("keydown",j),E!=null&&E.isConnected&&E.focus()}},[]);const O=async A=>{A.preventDefault();const E=o.name.trim(),j=o.prompt.trim(),T=t.find(C=>C.runtimeId===o.runtimeId);if(!E)return u(It("validation.nameRequired"));if(!T)return u(It("validation.runtimeRequired"));if(!j)return u(It("validation.promptRequired"));if(o.scheduleType==="once"&&!o.onceAt||(o.scheduleType==="daily"||o.scheduleType==="weekly")&&!o.time)return u(It("validation.timeRequired"));const R=o.cron.trim().split(/\s+/);if(o.scheduleType==="cron"&&R.length!==5)return u(It("validation.cronFields"));u(""),f(!0);try{let C=(e==null?void 0:e.runtimeId)===T.runtimeId?e.agentName.trim():"";if(!C){const[N]=await QA("","",{runtimeId:T.runtimeId,region:T.region});C=(N==null?void 0:N.trim())??""}if(!C)throw new Error(It("validation.runtimeAppMissing"));await s({name:E,runtimeId:T.runtimeId,runtimeName:T.name,agentName:C,region:T.region,prompt:j,enabled:o.enabled,schedule:{type:o.scheduleType,timezone:o.timezone,...o.scheduleType==="once"?{onceAt:o.onceAt}:{},...o.scheduleType==="daily"?{time:o.time}:{},...o.scheduleType==="weekly"?{time:o.time,weekday:o.weekday}:{},...o.scheduleType==="cron"?{cron:o.cron.trim()}:{}}})}catch(C){u(C instanceof Error?C.message:String(C)),window.requestAnimationFrame(()=>{var N;return(N=g.current)==null?void 0:N.focus()})}finally{f(!1)}};return a.jsx("div",{className:"cronjobs-drawer-backdrop",onMouseDown:A=>{A.target===A.currentTarget&&!b&&r()},children:a.jsxs("aside",{ref:h,className:"cronjobs-drawer",role:"dialog","aria-modal":"true","aria-labelledby":"cronjobs-drawer-title",children:[a.jsxs("header",{className:"cronjobs-drawer-head",children:[a.jsxs("div",{children:[a.jsx("h2",{id:"cronjobs-drawer-title",children:It(e?"drawer.editTitle":"drawer.createTitle")}),a.jsx("p",{children:It("drawer.description")})]}),a.jsx(At,{type:"button",color:"secondary",variant:"ghost",size:"lg",uniform:!0,pill:!1,onClick:r,disabled:b,"aria-label":It("actions.closeDrawer"),children:a.jsx(mV,{})})]}),a.jsxs("form",{className:"cronjobs-form",onSubmit:A=>void O(A),children:[a.jsxs("div",{className:"cronjobs-form-scroll",children:[a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:It("fields.name")}),a.jsx(js,{ref:m,size:"lg",value:o.name,maxLength:80,invalid:!!c&&!o.name.trim(),onChange:A=>l({...o,name:A.target.value}),placeholder:It("fields.namePlaceholder")})]}),a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:It("fields.runtimeAgent")}),a.jsx(ma,{value:o.runtimeId,options:x,size:"lg",disabled:t.length===0,placeholder:It(t.length?"fields.runtimePlaceholder":"fields.noRuntime"),onChange:A=>l({...o,runtimeId:A.value})}),a.jsx("small",{children:It("fields.runtimeHelp")})]}),a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:It("fields.prompt")}),a.jsx(bb,{value:o.prompt,rows:5,maxRows:10,autoResize:!0,maxLength:2e4,invalid:!!c&&!o.prompt.trim(),onChange:A=>l({...o,prompt:A.target.value}),placeholder:It("fields.promptPlaceholder")}),a.jsxs("small",{className:"cronjobs-character-count",children:[o.prompt.length.toLocaleString()," / 20,000"]})]}),a.jsxs("fieldset",{className:"cronjobs-fieldset",children:[a.jsx("legend",{children:It("fields.schedule")}),a.jsxs(dd,{className:"cronjobs-schedule-types",value:o.scheduleType,size:"lg",block:!0,"aria-label":It("fields.scheduleType"),onChange:A=>l({...o,scheduleType:A}),children:[a.jsx(dd.Option,{value:"once",children:It("scheduleTypes.once")}),a.jsx(dd.Option,{value:"daily",children:It("scheduleTypes.daily")}),a.jsx(dd.Option,{value:"weekly",children:It("scheduleTypes.weekly")}),a.jsx(dd.Option,{value:"cron",children:"Cron"})]}),o.scheduleType==="once"?a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:It("fields.runAt")}),a.jsx(js,{size:"lg",type:"datetime-local",value:o.onceAt,onChange:A=>l({...o,onceAt:A.target.value})})]}):null,o.scheduleType==="daily"?a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:It("fields.dailyTime")}),a.jsx(js,{size:"lg",type:"time",value:o.time,onChange:A=>l({...o,time:A.target.value})})]}):null,o.scheduleType==="weekly"?a.jsxs("div",{className:"cronjobs-inline-fields",children:[a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:It("fields.weekday")}),a.jsx(ma,{value:String(o.weekday),options:k,size:"lg",onChange:A=>l({...o,weekday:Number(A.value)})})]}),a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:It("fields.runAt")}),a.jsx(js,{size:"lg",type:"time",value:o.time,onChange:A=>l({...o,time:A.target.value})})]})]}):null,o.scheduleType==="cron"?a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:It("fields.cronExpression")}),a.jsx(js,{size:"lg",value:o.cron,onChange:A=>l({...o,cron:A.target.value}),placeholder:"0 9 * * *"}),a.jsx("small",{children:It("fields.cronHelp")})]}):null,a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:It("fields.timezone")}),a.jsx(ma,{value:o.timezone,options:S,size:"lg",onChange:A=>l({...o,timezone:A.value})})]})]}),a.jsxs("div",{className:"cronjobs-switch-row",children:[a.jsxs("span",{children:[a.jsx("strong",{children:It("fields.enableAfterCreate")}),a.jsx("small",{children:It("fields.enableHelp")})]}),a.jsx(aU,{checked:o.enabled,onCheckedChange:A=>l({...o,enabled:A}),"aria-label":It("fields.enableAfterCreate")})]}),c?a.jsx("div",{ref:g,className:"cronjobs-inline-error",tabIndex:-1,children:a.jsx(vh,{color:"danger",variant:"soft",description:c})}):null]}),a.jsxs("footer",{className:"cronjobs-drawer-actions",children:[a.jsx(At,{type:"button",color:"secondary",variant:"ghost",size:"lg",pill:!1,onClick:r,disabled:b,children:It("actions.cancel")}),a.jsx(At,{type:"submit",color:"primary",size:"lg",pill:!1,loading:b,disabled:t.length===0,"aria-busy":b||void 0,children:It(d?"actions.connectingRuntime":i?"actions.saving":e?"actions.saveChanges":"actions.createTask")})]})]})]})})}function Len({jobs:e,canCreate:t,onCreate:n,onSelect:i}){return a.jsxs(zv,{children:[a.jsx(ab,{icon:a.jsx(Dje,{}),onClick:n,disabled:!t,title:It(t?"actions.createScheduledTask":"fields.noRuntime"),children:It("actions.createScheduledTask")}),e.map(r=>{const s=a7e(r.schedule);return a.jsx(Hv,{className:"cronjobs-card",title:r.name,status:a.jsx(Za,{color:r.enabled?"success":"secondary",variant:"soft",size:"sm",pill:!0,children:It(r.enabled?"status.enabled":"status.paused")}),description:r.prompt,metadata:[{label:It("fields.schedule"),value:s,title:s}],detailAction:{label:It("actions.viewDetails"),onClick:()=>i(r)}},r.jobId)})]})}function $en({job:e,runs:t,runsLoading:n,runsError:i,busyAction:r,onBack:s,onEdit:o,onToggle:l,onRun:c,onDelete:u,onCancel:d,onRetryRun:f,onRetryRuns:h}){const m=t.find(b=>b.status==="queued"||b.status==="running"||b.status==="retrying"||b.status==="pending")??(lU(e)?e.latestRun:void 0),g=r.includes(e.jobId);return a.jsxs("div",{className:"cronjobs-detail",children:[a.jsxs("header",{className:"cronjobs-detail-head",children:[a.jsxs("div",{className:"cronjobs-detail-title",children:[a.jsx(At,{type:"button",color:"secondary",variant:"ghost",size:"lg",uniform:!0,pill:!1,onClick:s,"aria-label":It("actions.backToList"),children:a.jsx(Kst,{})}),a.jsxs("div",{children:[a.jsx("h1",{children:e.name}),a.jsxs("p",{children:[e.runtimeName||e.agentName," · ",a7e(e.schedule)]})]})]}),a.jsxs("div",{className:"cronjobs-detail-actions",children:[a.jsxs(At,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:o,disabled:g,children:[a.jsx(sat,{}),It("actions.edit")]}),a.jsxs(At,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:l,disabled:g,children:[e.enabled?a.jsx(dat,{}):a.jsx(YJ,{}),It(e.enabled?"actions.pause":"actions.enable")]}),m?a.jsxs(At,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>d(m),disabled:g||!!m.cancellationRequestedAt,children:[a.jsx(gat,{}),It(m.cancellationRequestedAt?m.status==="queued"?"actions.cancelling":"actions.stopping":m.status==="queued"?"actions.cancelQueue":"actions.stopRun")]}):a.jsxs(At,{type:"button",color:"primary",size:"lg",pill:!1,onClick:c,disabled:g||!e.enabled,children:[a.jsx(YJ,{}),It("actions.runNow")]}),a.jsx(Ca,{compact:!0,content:It(m?m.status==="queued"?"actions.cancelQueueFirst":"actions.stopRunFirst":"actions.deleteTask"),children:a.jsxs(At,{type:"button",color:"danger",variant:"ghost",size:"lg",pill:!1,onClick:u,disabled:g||!!m,"aria-label":It("actions.deleteTask"),children:[a.jsx(nat,{}),It("actions.delete")]})})]})]}),a.jsxs("div",{className:"cronjobs-detail-scroll",children:[a.jsxs("section",{className:"cronjobs-summary-grid","aria-label":It("detail.configuration"),children:[a.jsxs("dl",{children:[a.jsxs("div",{children:[a.jsx("dt",{children:It("detail.status")}),a.jsx("dd",{children:It(e.enabled?"status.enabled":"status.paused")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:It("detail.nextRun")}),a.jsx("dd",{children:e.enabled?oU(e.nextRunAt):"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:It("detail.runtime")}),a.jsx("dd",{title:e.runtimeName,children:e.runtimeName})]}),a.jsxs("div",{children:[a.jsx("dt",{children:It("detail.region")}),a.jsx("dd",{children:e.region})]})]}),a.jsxs("div",{className:"cronjobs-prompt",children:[a.jsx("span",{children:It("fields.prompt")}),a.jsx("p",{children:e.prompt})]})]}),a.jsxs("section",{className:"cronjobs-history",children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("h2",{children:It("history.title")}),a.jsx("p",{children:It("history.description")})]}),a.jsx(Ca,{compact:!0,content:It("actions.refresh"),children:a.jsx(At,{type:"button",color:"secondary",variant:"ghost",size:"lg",uniform:!0,pill:!1,onClick:h,disabled:n,"aria-label":It("actions.refreshHistory"),children:a.jsx(YD,{})})})]}),n&&t.length===0?a.jsx(fl,{}):i?a.jsx(vh,{className:"cronjobs-history-alert",color:"danger",variant:"soft",title:It("history.loadFailed"),description:i,actions:a.jsx(At,{type:"button",color:"danger",variant:"soft",size:"sm",pill:!1,onClick:h,children:It("actions.retry")})}):t.length===0?a.jsxs(qn,{className:"cronjobs-history-state",fill:"none",children:[a.jsx(qn.Icon,{children:a.jsx(pV,{})}),a.jsx(qn.Title,{children:It("history.emptyTitle")}),a.jsx(qn.Description,{children:It("history.emptyDescription")})]}):a.jsx("div",{className:"cronjobs-runs",children:t.map(b=>a.jsxs("article",{className:"cronjobs-run",children:[a.jsxs("div",{className:"cronjobs-run-main",children:[a.jsx(Men,{run:b}),a.jsxs("div",{children:[a.jsx("strong",{children:oU(b.startedAt||b.scheduledAt)}),a.jsxs("span",{children:[It("history.duration",{duration:_en(b)}),b.runtimeVersion?` · Runtime v${b.runtimeVersion}`:""]})]})]}),b.sessionId?a.jsxs("div",{className:"cronjobs-run-meta",children:[a.jsx("span",{children:It("history.session")}),a.jsx("strong",{title:b.sessionId,children:b.sessionId})]}):null,b.output?a.jsxs("div",{className:"cronjobs-run-output",children:[a.jsx("span",{children:It("history.finalAnswer")}),a.jsx(jen,{output:b.output})]}):null,b.error?a.jsxs("div",{className:"cronjobs-run-output is-error",children:[a.jsx("span",{children:It("history.errorDetails")}),a.jsx(yb,{message:b.error,className:"cronjobs-run-error-detail",defaultExpanded:!1,onRetry:b.status==="failed"?f:void 0,retryLabel:It("actions.rerun")})]}):null,b.status==="queued"||b.status==="running"||b.status==="retrying"||b.status==="pending"?a.jsx(At,{type:"button",className:"cronjobs-run-cancel",color:"danger",variant:"soft",size:"sm",pill:!1,onClick:()=>d(b),disabled:g||!!b.cancellationRequestedAt,loading:!!b.cancellationRequestedAt,children:It(b.cancellationRequestedAt?"actions.stopping":b.status==="queued"?"actions.cancelQueue":"actions.stop")}):null]},b.runId))})]})]})]})}function Fen({cloudProvider:e,selectedRuntime:t}){const[n,i]=p.useState("studio");_e("cronjobs");const[r,s]=p.useState([]),[o,l]=p.useState([]),[c,u]=p.useState(!0),[d,f]=p.useState(""),[h,m]=p.useState(""),[g,b]=p.useState(void 0),[v,y]=p.useState([]),[w,x]=p.useState(!1),[k,S]=p.useState(""),[O,A]=p.useState(""),[E,j]=p.useState("all"),[T,R]=p.useState(""),[C,N]=p.useState(null),[P,I]=p.useState(""),D=r.find(W=>W.jobId===h),_=E==="all"?r:r.filter(W=>E==="enabled"?W.enabled:!W.enabled),L=p.useCallback(async W=>{u(!0),f("");try{const[X,le]=await Promise.all([z8(W),$v({scope:"all",region:"all",pageSize:100})]);if(W!=null&&W.aborted)return;s(X),l(le.runtimes.filter(V=>V.status.toLowerCase()==="ready"))}catch(X){if(W!=null&&W.aborted)return;console.warn("Unable to load scheduled tasks",X),f(It("page.loadFailedDescription"))}finally{W!=null&&W.aborted||u(!1)}},[]);p.useEffect(()=>{const W=new AbortController;return L(W.signal),()=>W.abort()},[L]);const F=p.useCallback(async(W,X)=>{x(!0),S("");try{const le=await V8(W,X);X!=null&&X.aborted||y(le)}catch(le){X!=null&&X.aborted||(console.warn("Unable to load scheduled-task history",le),S(It("history.loadFailedDescription")))}finally{X!=null&&X.aborted||x(!1)}},[]);p.useEffect(()=>{if(!h){y([]),S("");return}const W=new AbortController;return F(h,W.signal),()=>W.abort()},[F,h]);const M=r.some(lU);p.useEffect(()=>{!M&&T===It("notices.queued")&&R("")},[M,T]),p.useEffect(()=>{if(!M)return;const W=new AbortController,X=async()=>{try{const[V,Y]=await Promise.all([z8(W.signal),h?V8(h,W.signal):Promise.resolve(null)]);if(W.signal.aborted)return;s(V),Y&&y(Y),V.some(lU)||R("")}catch(V){W.signal.aborted||R(V instanceof Error?V.message:String(V))}},le=window.setInterval(()=>void X(),Nen);return()=>{window.clearInterval(le),W.abort()}},[M,h]);const H=W=>s(X=>X.some(le=>le.jobId===W.jobId)?X.map(le=>le.jobId===W.jobId?W:le):[W,...X]),q=async(W,X,le,V=!1)=>{A(W),R("");try{await X(),R(le)}catch(Y){const K=Y instanceof Error?Y.message:String(Y);if(V)throw new Error(K);R(K)}finally{A("")}},U=async W=>{const X=g??null;await q(`${(X==null?void 0:X.jobId)??"new"}:save`,async()=>{const le=X?await v2e(X.jobId,W):await y2e(W);H(le),b(void 0),X&&m(le.jobId)},It(X?"notices.updated":"notices.created"),!0)},Z=W=>void q(`${W.jobId}:toggle`,async()=>H(await x2e(W.jobId,!W.enabled)),It(W.enabled?"notices.paused":"notices.enabled")),z=(W,X)=>q(`${W.jobId}:run`,async()=>{const le=await w2e(W.jobId);H({...W,latestRun:le}),h===W.jobId&&y(V=>[le,...V.filter(Y=>Y.runId!==le.runId)])},X),J=W=>void z(W,It("notices.queued")),ne=()=>{if(!C)return;I("");const W=C;W.kind==="delete"?q(`${W.job.jobId}:delete`,async()=>{await O2e(W.job.jobId),s(X=>X.filter(le=>le.jobId!==W.job.jobId)),m(""),N(null)},It("notices.deleted"),!0).catch(X=>{I(X instanceof Error?X.message:String(X))}):q(`${W.job.jobId}:cancel`,async()=>{var le;const X=await k2e(W.job.jobId,W.run.runId);y(V=>V.map(Y=>Y.runId===X.runId?X:Y)),H({...W.job,latestRun:((le=W.job.latestRun)==null?void 0:le.runId)===X.runId?X:W.job.latestRun}),N(null)},It("notices.cancelRequested"),!0).catch(X=>{I(X instanceof Error?X.message:String(X))})};return D?a.jsxs(Ch,{className:"cronjobs-page","aria-label":It("detail.pageLabel"),children:[a.jsx($en,{job:D,runs:v,runsLoading:w,runsError:k,busyAction:O,onBack:()=>m(""),onEdit:()=>b(D),onToggle:()=>Z(D),onRun:()=>J(D),onDelete:()=>{I(""),N({kind:"delete",job:D})},onCancel:W=>{I(""),N({kind:"cancel",job:D,run:W})},onRetryRun:()=>z(D,It("notices.requeued")),onRetryRuns:()=>void F(D.jobId)}),T?a.jsx("div",{className:"cronjobs-notice",role:"status",children:a.jsx(vh,{color:"info",variant:"soft",description:T})}):null,g!==void 0?a.jsx(ple,{job:g,runtimes:o,cloudProvider:e,busy:O.endsWith(":save"),onClose:()=>b(void 0),onSubmit:U}):null,C?a.jsx(_d,{title:It(C.kind==="delete"?"confirm.deleteTitle":"confirm.cancelTitle"),description:C.kind==="delete"?It("confirm.deleteDescription",{name:C.job.name}):It("confirm.cancelDescription"),error:P,confirmLabel:It(C.kind==="delete"?"actions.deleteTask":"actions.stop"),variant:"danger",busy:O.endsWith(C.kind),onCancel:()=>{I(""),N(null)},onConfirm:ne}):null]}):a.jsxs(Ch,{className:"cronjobs-page","aria-label":It("page.title"),children:[a.jsx(Qv,{className:"cronjobs-page-head",title:It("page.title")}),a.jsx(ib,{children:a.jsx(rb,{idPrefix:"cronjobs-source",ariaLabel:It("mpa.source"),value:n,items:[{id:"studio",label:It("mpa.studio")},{id:"runtime",label:It("mpa.title")}],onChange:i})}),n==="runtime"?a.jsx(tm,{children:a.jsx(ken,{runtime:t})}):a.jsxs(a.Fragment,{children:[a.jsx(ib,{children:a.jsx(rb,{idPrefix:"cronjobs-filter",ariaLabel:It("page.filterLabel"),value:E,items:[{id:"all",label:It("filters.all")},{id:"enabled",label:It("status.enabled")},{id:"paused",label:It("status.paused")}],onChange:j})}),T?a.jsx("div",{className:"cronjobs-banner",role:"status",children:a.jsx(vh,{color:"info",variant:"soft",description:T})}):null,a.jsx(tm,{"aria-label":It("page.listLabel"),children:c&&r.length===0?a.jsx(fl,{}):d?a.jsxs(qn,{className:"cronjobs-state",fill:"none",children:[a.jsx(qn.Icon,{color:"danger",children:a.jsx(pV,{})}),a.jsx(qn.Title,{color:"danger",children:It("page.loadFailed")}),a.jsx(qn.Description,{children:d}),a.jsx(qn.ActionRow,{children:a.jsxs(At,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>void L(),children:[a.jsx(YD,{}),It("actions.retry")]})})]}):a.jsx(Len,{jobs:_,canCreate:!c&&o.length>0,onCreate:()=>b(null),onSelect:W=>m(W.jobId)})})]}),g!==void 0?a.jsx(ple,{job:g,runtimes:o,cloudProvider:e,busy:O.endsWith(":save"),onClose:()=>b(void 0),onSubmit:U}):null]})}const Ben={volcengine:"https://console.volcengine.com",byteplus:"https://console.byteplus.com"};function yA(e){return e.trim()}function jK(e){return Ben[e]}function Uen(e){const t=yA(e);if(!t)return null;let n=t;try{n=new URL(t.includes("://")?t:`https://${t}`).hostname}catch{return null}const i=n.match(/^(.+)\.tos-([a-z0-9-]+)\.(?:volces|bytepluses)\.com$/i);return i?{bucket:i[1],region:i[2]}:null}function Qen(e,t){const n=Uen(t);if(!n)return null;const i=new URLSearchParams({id:n.bucket,region:n.region,type:"objects"});return`${jK(e)}/tos/bucket/setting?${i.toString()}`}function zen(e,t,n){const i=yA(t),r=yA(n);return!i||!r?null:`${jK(e)}/agentkit/region:agentkit+${encodeURIComponent(i)}/builtintools/${encodeURIComponent(r)}/detail`}function Ven(e,t,n){const i=yA(t),r=yA(n);return!i||!r?null:`${jK(e)}/identity/region:identity+${encodeURIComponent(i)}/user-pools/${encodeURIComponent(r)}/info`}function FO({href:e,label:t,children:n}){return e?a.jsxs("a",{className:"system-info-resource-link",href:e,target:"_blank",rel:"noreferrer","aria-label":t,title:t,children:[a.jsx("span",{children:n}),a.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[a.jsx("path",{d:"M7.75 5.25h-2.5a1.5 1.5 0 0 0-1.5 1.5v8a1.5 1.5 0 0 0 1.5 1.5h8a1.5 1.5 0 0 0 1.5-1.5v-2.5"}),a.jsx("path",{d:"M10.25 3.75h6v6M16 4 9 11"})]})]}):a.jsx("span",{children:n})}function Hen(e){return e instanceof Error&&e.message.includes("Volcengine credentials not found")}function qen({spinning:e}){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e?"is-spinning":"",children:a.jsx("path",{d:"M19.5 9A8 8 0 0 0 5 6L3 9m0-5v5h5M4.5 15A8 8 0 0 0 19 18l2-3m0 5v-5h-5"})})}function Wen(){return{busy:!1,error:"",message:""}}function Ken({version:e,localMode:t,role:n,provider:i,region:r,onBack:s}){const{t:o}=_e("ui"),l=n==="admin"||n==="super_admin",[c,u]=p.useState(""),[d,f]=p.useState([]),[h,m]=p.useState([]),[g,b]=p.useState(null),[v,y]=p.useState(!0),[w,x]=p.useState(""),[k,S]=p.useState(!0),[O,A]=p.useState(""),[E,j]=p.useState(!0),[T,R]=p.useState(""),[C,N]=p.useState(0),[P,I]=p.useState(0),[D,_]=p.useState(0),L=p.useRef(!1),[F,M]=p.useState({}),[H,q]=p.useState({}),[U,Z]=p.useState(""),[z,J]=p.useState(!0),ne=p.useRef(new Set),W=p.useRef(0),X=`${i}:${r}`,le=p.useRef(X);le.current=X,p.useEffect(()=>{q({}),M({})},[X]),p.useEffect(()=>(L.current=!0,()=>{L.current=!1}),[]);function V(K,ue){M(te=>({...te,[K]:{...Wen(),...te[K],...ue}}))}async function Y(K){if(!K.toolId||ne.current.has(K.toolId))return;const ue=X;ne.current.add(K.toolId),W.current+=1,V(K.toolId,{busy:!0,error:"",message:""});try{const te=await F2e(K.kind);if(!L.current||le.current!==ue)return;W.current+=1,q(Oe=>({...Oe,[K.toolId]:te.state})),V(K.toolId,{busy:!1,error:"",message:te.updated?o("systemInfo.modelEnvUpdated"):o("systemInfo.modelEnvAlreadyCurrent")})}catch{if(!L.current||le.current!==ue)return;W.current+=1,V(K.toolId,{busy:!1,error:o("systemInfo.sandboxUpdateError"),message:""})}finally{ne.current.delete(K.toolId)}}return p.useEffect(()=>{if(!l)return;const K=new AbortController,ue=++W.current;return Z(""),J(!0),$2e(K.signal).then(te=>{K.signal.aborted||ue!==W.current||q(Object.fromEntries(te.map(Oe=>[Oe.toolId,Oe])))}).catch(()=>{!K.signal.aborted&&ue===W.current&&Z(o("systemInfo.versionCheckError"))}).finally(()=>{K.signal.aborted||J(!1)}),()=>K.abort()},[l,i,r,C]),p.useEffect(()=>{if(!Object.values(H).some(ue=>ue.status==="Updating"||ue.status==="Creating"))return;const K=window.setTimeout(()=>N(ue=>ue+1),5e3);return()=>window.clearTimeout(K)},[H]),p.useEffect(()=>{if(!l){u(""),f([]),y(!1),x("");return}const K=new AbortController;return y(!0),x(""),$Te(K.signal).then(ue=>{K.signal.aborted||(u(ue.storage.tosAddress),f(ue.sandboxTools))}).catch(ue=>{(ue==null?void 0:ue.name)!=="AbortError"&&x(o("systemInfo.sandboxInfoError"))}).finally(()=>{K.signal.aborted||y(!1)}),()=>K.abort()},[l,i,r,C]),p.useEffect(()=>{if(!l){m([]),S(!1),A("");return}const K=new AbortController;return S(!0),A(""),jD(K.signal).then(ue=>{m(ue.filter(te=>te.isCurrent))}).catch(ue=>{if((ue==null?void 0:ue.name)!=="AbortError"){if(t&&Hen(ue)){m([]);return}A(o("systemInfo.userPoolError"))}}).finally(()=>{K.signal.aborted||S(!1)}),()=>K.abort()},[l,t,P]),p.useEffect(()=>{if(!l){b(null),j(!1),R("");return}const K=new AbortController;return j(!0),R(""),i2e(K.signal).then(b).catch(ue=>{(ue==null?void 0:ue.name)!=="AbortError"&&R(o("systemInfo.environmentResourcesError"))}).finally(()=>{K.signal.aborted||j(!1)}),()=>K.abort()},[l,D]),a.jsxs("div",{className:"system-info-page",children:[a.jsxs("header",{className:"system-info-page-header",children:[a.jsx(XD,{label:o("common.back"),onClick:s}),a.jsxs("div",{children:[a.jsx("h1",{children:o("systemInfo.title")}),a.jsx("p",{children:o("systemInfo.description")})]})]}),a.jsxs("div",{className:"system-info-scroll",children:[a.jsxs("section",{className:"system-info-section","aria-labelledby":"studio-info-title",children:[a.jsx("h2",{id:"studio-info-title",children:o("systemInfo.general")}),a.jsx("dl",{className:"system-info-summary",children:a.jsxs("div",{children:[a.jsx("dt",{children:o("systemInfo.currentVersion")}),a.jsx("dd",{children:e||"—"})]})})]}),l?a.jsxs(a.Fragment,{children:[a.jsxs("section",{className:"system-info-section","aria-labelledby":"storage-info-title",children:[a.jsx("h2",{id:"storage-info-title",children:o("systemInfo.storage")}),v?a.jsx("div",{className:"system-info-loading",role:"status","aria-live":"polite",children:a.jsx(on,{as:"span",children:o("systemInfo.loadingStorage")})}):w?a.jsxs("div",{className:"system-info-error",role:"alert",children:[a.jsx("p",{children:w}),a.jsx("button",{type:"button",onClick:()=>N(K=>K+1),children:o("common.reload")})]}):a.jsx("dl",{className:"system-info-summary",children:a.jsxs("div",{className:"system-info-resource-row",children:[a.jsx("dt",{children:o("systemInfo.tosAddress")}),a.jsx("dd",{className:`system-info-resource-value${c?"":" is-empty"}`,children:a.jsx(FO,{href:Qen(i,c),label:o("systemInfo.openTosConsole"),children:c||o("common.notConfigured")})})]})})]}),a.jsxs("section",{className:"system-info-section","aria-labelledby":"environment-build-info-title",children:[a.jsx("h2",{id:"environment-build-info-title",children:o("systemInfo.environmentBuild")}),E?a.jsx("div",{className:"system-info-loading",role:"status","aria-live":"polite",children:a.jsx(on,{as:"span",children:o("systemInfo.loadingEnvironmentResources")})}):T?a.jsxs("div",{className:"system-info-error",role:"alert",children:[a.jsx("p",{children:T}),a.jsx("button",{type:"button",onClick:()=>_(K=>K+1),children:o("common.reload")})]}):g?a.jsxs("dl",{className:"system-info-summary",children:[a.jsxs("div",{className:"system-info-resource-row",children:[a.jsx("dt",{children:o("systemInfo.codePipelineWorkspace")}),a.jsx("dd",{className:"system-info-resource-value",children:a.jsx(FO,{href:g.codePipeline.consoleUrl||null,label:o("systemInfo.openCodePipelineWorkspace"),children:g.codePipeline.workspaceName||g.codePipeline.workspaceId||o("systemInfo.createdOnFirstBuild")})})]}),a.jsxs("div",{className:"system-info-resource-row",children:[a.jsx("dt",{children:o("systemInfo.codePipelinePipeline")}),a.jsx("dd",{className:"system-info-resource-value",children:g.codePipeline.pipelineName||g.codePipeline.pipelineId||o("systemInfo.createdOnFirstBuild")})]}),a.jsxs("div",{className:"system-info-resource-row",children:[a.jsx("dt",{children:o("systemInfo.containerRegistryRepository")}),a.jsx("dd",{className:"system-info-resource-value",children:a.jsx(FO,{href:g.containerRegistry.consoleUrl||null,label:o("systemInfo.openContainerRegistryRepository"),children:g.containerRegistry.imageRepository||[g.containerRegistry.registry,g.containerRegistry.namespace,g.containerRegistry.repository].filter(Boolean).join("/")||o("systemInfo.createdOnFirstBuild")})})]})]}):null]}),a.jsxs("section",{className:"system-info-section","aria-labelledby":"sandbox-tool-title",children:[a.jsx("h2",{id:"sandbox-tool-title",children:o("systemInfo.sandboxInfo")}),a.jsx("button",{type:"button",className:"system-info-refresh",disabled:z,onClick:()=>N(K=>K+1),children:o(z?"systemInfo.checkingVersions":"systemInfo.checkUpdates")}),v?a.jsx("div",{className:"system-info-loading",role:"status","aria-live":"polite",children:a.jsx(on,{as:"span",children:o("systemInfo.loadingSandboxInfo")})}):w?a.jsxs("div",{className:"system-info-error",role:"alert",children:[a.jsx("p",{children:w}),a.jsx("button",{type:"button",onClick:()=>N(K=>K+1),children:o("common.reload")})]}):a.jsxs("div",{className:"system-info-tool-list",children:[U?a.jsx("span",{className:"system-info-inline-error",role:"alert",children:U}):null,d.map(K=>{var pe;const ue=H[K.toolId],te=F[K.toolId],Oe=!!K.toolId&&!!(ue!=null&&ue.canUpdate),fe=(te==null?void 0:te.error)||(ue!=null&&ue.error?o("systemInfo.versionCheckError"):ue!=null&&ue.modelEnvError?o("systemInfo.modelEnvRepairUnavailable"):"");return a.jsx("dl",{className:"system-info-tool",children:a.jsxs("div",{className:"system-info-resource-row",children:[a.jsxs("dt",{className:"system-info-tool-label",children:[a.jsx("span",{children:K.label}),K.snapshot?a.jsx("span",{className:"system-info-tool-badge",children:o("systemInfo.snapshot")}):null]}),a.jsxs("dd",{className:`system-info-resource-value${K.toolId?"":" is-empty"}`,children:[a.jsx(FO,{href:zen(i,(ue==null?void 0:ue.region)||r,K.toolId),label:o("systemInfo.openToolConsole",{name:K.label}),children:K.toolId||o("common.notConfigured")}),Oe?a.jsx("button",{type:"button",className:"system-info-resource-update",disabled:te==null?void 0:te.busy,"aria-busy":(te==null?void 0:te.busy)||void 0,"aria-label":o("systemInfo.updateSandbox",{name:K.label,variant:K.snapshot?o("systemInfo.snapshotWithSpace"):""}),title:o("systemInfo.updateSandbox",{name:K.label,variant:K.snapshot?o("systemInfo.snapshotWithSpace"):""}),onClick:()=>void Y(K),children:a.jsx(qen,{spinning:(te==null?void 0:te.busy)||!1})}):null,ue!=null&&ue.currentImage?a.jsxs("span",{className:"system-info-inline-status",title:`${ue.currentImage} → ${ue.latestImage}`,children:[ue.currentImage.split(":").pop(),ue.needsImageUpdate?` → ${(pe=ue.latestImage)==null?void 0:pe.split(":").pop()}`:"",ue.status==="Updating"?` · ${o("systemInfo.updatingSandbox")}`:""]}):null,te!=null&&te.message?a.jsx("span",{className:"system-info-inline-status",role:"status",children:te.message}):null,fe?a.jsx("span",{className:"system-info-inline-error",role:"alert",children:fe}):null]})]})},K.kind)})]})]}),a.jsxs("section",{className:"system-info-section","aria-labelledby":"user-pool-title",children:[a.jsx("h2",{id:"user-pool-title",children:o("systemInfo.userPool")}),k?a.jsx("div",{className:"system-info-loading",role:"status","aria-live":"polite",children:a.jsx(on,{as:"span",children:o("systemInfo.loadingUserPool")})}):O?a.jsxs("div",{className:"system-info-error",role:"alert",children:[a.jsx("p",{children:O}),a.jsx("button",{type:"button",onClick:()=>I(K=>K+1),children:o("common.reload")})]}):h.length>0?a.jsx("div",{className:"system-info-pool-list",children:h.map(K=>a.jsxs("dl",{className:"system-info-pool",children:[a.jsxs("div",{children:[a.jsx("dt",{children:o("common.name")}),a.jsx("dd",{className:"system-info-resource-value",children:a.jsx(FO,{href:Ven(i,K.region||r,K.uid),label:o("systemInfo.openUserPoolConsole",{name:K.name||""}),children:K.name||o("systemInfo.unnamedUserPool")})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("systemInfo.id")}),a.jsx("dd",{children:K.uid||"—"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("systemInfo.domain")}),a.jsx("dd",{children:K.domain||"—"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("systemInfo.region")}),a.jsx("dd",{children:K.region||"—"})]})]},K.uid))}):a.jsx("p",{className:"system-info-empty",children:o(t?"systemInfo.noLocalUserPool":"systemInfo.noUserPool")})]})]}):null]})]})}const Gen="_TextLink_16uec_1",Xen={TextLink:Gen},Oj=e=>{const{children:t,primary:n=!1,underline:i=!n,className:r,target:s,forceExternal:o,as:l,href:c,to:u,...d}=e,f=o??/^https?:\/\//.test(c??u??""),h=uIe(),m=l||(f?"a":h),g={...d,className:qi(Xen.TextLink,r),"data-primary":n?"":void 0,"data-underline":i?"":void 0};if(!c&&!u)return a.jsx("span",{...g,role:"button",children:t});const b={...f?{target:"_blank",rel:"noopener noreferrer",href:c??u}:{href:c,to:u},...g};return a.jsx(m,{...b,children:t})},Yen="/assets/media/article-agent-workflow-GXPkXUjV.webp",Zen="/assets/media/article-tool-debugging-BxiMDz_8.webp",Jen="/assets/media/showcase-a2ui-BgBnE9RT.webp",etn="/assets/media/showcase-customer-service-DNw0mUH1.webp",ttn="/assets/media/showcase-multimodal-BRTl8NLI.webp",ntn="/assets/media/showcase-research-assistant-CbfMFfhS.webp",itn="/assets/media/showcase-web-search-D2kl1imN.webp",rtn={volcengine:{console:"https://console.volcengine.com/agentkit",docs:"https://www.volcengine.com/docs/86681/1844823"},byteplus:{console:"https://console.byteplus.com/agentkit",docs:"https://docs.byteplus.com/en/docs/AgentKit"}};function stn(e){return rtn[e]}const atn=[{id:"documentation",titleKey:"developerResources.sections.documentation.title",descriptionKey:"developerResources.sections.documentation.description"},{id:"best-practices",titleKey:"developerResources.sections.bestPractices.title",descriptionKey:"developerResources.sections.bestPractices.description"},{id:"showcases",titleKey:"developerResources.sections.showcases.title",descriptionKey:"developerResources.sections.showcases.description"}],otn="https://volcengine.github.io/veadk-python/",ltn="https://volcengine.github.io/agentkit-sdk-python/content/2.agentkit-cli/1.overview.html",ctn=[{id:"veadk-development",titleKey:"developerResources.articles.veadkDevelopment.title",descriptionKey:"developerResources.articles.veadkDevelopment.description",meta:"AgentKit · VeADK",image:Yen,href:"https://docs.volcengine.com/docs/86681/2155817?lang=zh"},{id:"agentkit-cli-development",titleKey:"developerResources.articles.cliDevelopment.title",descriptionKey:"developerResources.articles.cliDevelopment.description",meta:"AgentKit · CLI",image:Zen,href:"https://docs.volcengine.com/docs/86681/1844871?lang=zh"}],utn=[{id:"research-assistant",titleKey:"developerResources.showcases.researchAssistant.title",descriptionKey:"developerResources.showcases.researchAssistant.description",image:ntn,href:"https://github.com/volcengine/veadk-python/tree/main/examples/06_multi_agent"},{id:"multimodal-analysis",titleKey:"developerResources.showcases.multimodalAnalysis.title",descriptionKey:"developerResources.showcases.multimodalAnalysis.description",image:ttn,href:"https://github.com/volcengine/veadk-python/tree/main/examples/multimodal_agent"},{id:"customer-service",titleKey:"developerResources.showcases.customerService.title",descriptionKey:"developerResources.showcases.customerService.description",image:etn,href:"https://github.com/volcengine/veadk-python/tree/main/examples/basic-app"},{id:"web-search",titleKey:"developerResources.showcases.webSearch.title",descriptionKey:"developerResources.showcases.webSearch.description",image:itn,href:"https://github.com/volcengine/veadk-python/tree/main/examples/04_web_search"},{id:"a2ui-app",titleKey:"developerResources.showcases.a2uiApp.title",descriptionKey:"developerResources.showcases.a2uiApp.description",image:Jen,href:"https://github.com/volcengine/veadk-python/tree/main/examples/a2ui_agent"}];function dtn({cloudProvider:e}){const{t}=_e("workspaceTools"),n=stn(e);return a.jsxs(Ch,{className:"developer-resources","aria-label":t("developerResources.title"),children:[a.jsx(Qv,{title:t("developerResources.title")}),a.jsx("div",{className:"developer-resources__content",children:atn.map(i=>a.jsxs("section",{className:"developer-resources__section","aria-labelledby":`developer-resources-${i.id}`,children:[a.jsxs("header",{className:"developer-resources__section-header",children:[a.jsx("h2",{id:`developer-resources-${i.id}`,children:t(i.titleKey)}),a.jsx("p",{children:t(i.descriptionKey)})]}),i.id==="documentation"?a.jsxs("ul",{className:"developer-resources__links",children:[a.jsx("li",{children:a.jsxs(Oj,{className:"developer-resources__link",primary:!0,underline:!0,href:otn,target:"_blank",rel:"noreferrer",children:[t("developerResources.links.veadkDocs"),a.jsx(s_,{"aria-hidden":"true"})]})}),a.jsx("li",{children:a.jsxs(Oj,{className:"developer-resources__link",primary:!0,underline:!0,href:ltn,target:"_blank",rel:"noreferrer",children:[t("developerResources.links.cliDocs"),a.jsx(s_,{"aria-hidden":"true"})]})}),a.jsx("li",{children:a.jsxs(Oj,{className:"developer-resources__link",primary:!0,underline:!0,href:n.docs,target:"_blank",rel:"noreferrer",children:[t("developerResources.links.platformDocs"),a.jsx(s_,{"aria-hidden":"true"})]})}),a.jsx("li",{children:a.jsxs(Oj,{className:"developer-resources__link",primary:!0,underline:!0,href:n.console,target:"_blank",rel:"noreferrer",children:[t("developerResources.links.console"),a.jsx(s_,{"aria-hidden":"true"})]})})]}):i.id==="best-practices"?a.jsx("div",{className:"developer-resources__articles",children:ctn.map(r=>a.jsxs("a",{className:"developer-resources__article",href:r.href,target:"_blank",rel:"noreferrer",children:[a.jsx("img",{src:r.image,alt:t("developerResources.articles.coverAlt",{title:t(r.titleKey)}),loading:"lazy"}),a.jsxs("span",{className:"developer-resources__article-copy",children:[a.jsx("strong",{children:t(r.titleKey)}),a.jsx("span",{children:t(r.descriptionKey)}),a.jsx("small",{children:r.meta})]})]},r.id))}):i.id==="showcases"?a.jsx("div",{className:"developer-resources__showcases",children:utn.map(r=>a.jsxs("a",{className:"developer-resources__showcase",href:r.href,target:"_blank",rel:"noreferrer",children:[a.jsx("span",{className:"developer-resources__showcase-media",children:a.jsx("img",{src:r.image,alt:t("developerResources.showcases.previewAlt",{title:t(r.titleKey)}),loading:"lazy"})}),a.jsx("strong",{children:t(r.titleKey)}),a.jsx("span",{children:t(r.descriptionKey)})]},r.id))}):null]},i.id))})]})}function ftn({cloudProvider:e,onPendingCountChange:t,onChanged:n}){const{t:i,i18n:r}=_e("agentReviews"),[s,o]=p.useState(nr(e)),[l,c]=p.useState([]),[u,d]=p.useState(!0),[f,h]=p.useState(""),[m,g]=p.useState(""),[b,v]=p.useState("all"),[y,w]=p.useState(0),[x,k]=p.useState(null);p.useEffect(()=>{o(nr(e))},[e]),p.useEffect(()=>{const A=new AbortController;return d(!0),h(""),IXt(s,A.signal).then(E=>{A.signal.aborted||(c(E.items),t(E.items.filter(j=>j.status==="pending").length))}).catch(E=>{A.signal.aborted||h(E instanceof Error?E.message:String(E))}).finally(()=>{A.signal.aborted||d(!1)}),()=>A.abort()},[s,y,t]);const S=p.useMemo(()=>l.filter(A=>(b==="all"||A.status===b)&&`${A.agent.name} ${A.submitter.name}`.toLocaleLowerCase().includes(m.trim().toLocaleLowerCase())),[l,m,b]),O=[{key:"name",header:i("agent"),className:"review-column-name",render:A=>a.jsx("button",{type:"button",className:"agent-review-name",onClick:()=>k(A),children:A.agent.name})},{key:"submitter",header:i("submitter"),render:A=>a.jsx(IP,{person:A.submitter})},{key:"version",header:i("version"),render:A=>A.agent.version??"—"},{key:"submittedAt",header:i("submittedAt"),render:A=>a.jsx("time",{dateTime:A.submittedAt,children:new Date(A.submittedAt).toLocaleString(r.language)})},{key:"status",header:i("statusTitle"),render:A=>a.jsxs("div",{children:[i(`status.${A.status}`),A.reviewer?a.jsx(IP,{person:A.reviewer}):null]})},{key:"actions",header:i("actions"),render:A=>a.jsx("button",{type:"button",onClick:()=>k(A),children:i(A.status==="pending"?"review":"details")})}];return a.jsxs("div",{className:"agent-review-center","aria-label":i("title"),children:[f?a.jsxs("div",{className:"agent-review-error",role:"alert",children:[a.jsx("p",{children:f}),a.jsx("button",{type:"button",onClick:()=>w(A=>A+1),children:i("refresh")})]}):null,a.jsx(vH,{rows:S,rowKey:A=>`${A.region}:${A.id}`,columns:O,searchValue:m,onSearchChange:g,searchPlaceholder:i("search"),searchLabel:i("search"),toolbarActions:a.jsxs(a.Fragment,{children:[a.jsx(sb,{id:"agent-review-region",ariaLabel:i("region"),value:s,options:Pu(e),onChange:A=>{o(A),c([]),k(null)}}),a.jsx(sb,{id:"agent-review-status",ariaLabel:i("statusTitle"),value:b,options:["all","pending","approved","returned","withdrawn"].map(A=>({value:A,label:i(A==="all"?"all":`status.${A}`)})),onChange:v}),a.jsx("button",{type:"button",disabled:u,onClick:()=>w(A=>A+1),children:i("refresh")})]}),emptyLabel:u?a.jsx(fl,{}):f?null:a.jsx("p",{className:"agent-review-empty",children:i(m||b!=="all"?"noMatches":"empty")})}),x?a.jsx(f9e,{runtimeId:x.runtimeId,region:x.region,name:x.agent.name,canPublish:!0,onClose:()=>k(null),onChanged:()=>{n==null||n(),w(A=>A+1)}},`${x.region}:${x.id}`):null]})}function htn({application:e,decision:t,onClose:n,onDecided:i}){const{t:r}=_e("reviews"),[s,o]=p.useState(""),[l,c]=p.useState(e.status==="approving"&&e.comment||""),[u,d]=p.useState(!1),[f,h]=p.useState(!1),m=p.useRef(!1),[g,b]=p.useState(null),v=t==="returned",y=v&&!s.trim(),w=p.useRef(document.activeElement instanceof HTMLElement?document.activeElement:null),x=async()=>{if(!m.current&&(d(!0),!y)){m.current=!0,h(!0),b(null);try{const k=await Lpt({id:e.id,region:e.region,decision:t,reason:s.trim(),comment:l.trim()});i(k)}catch(k){b(Lr(k,r("decision.failed")))}finally{m.current=!1,h(!1)}}};return a.jsx(t0,{open:!0,onOpenChange:k=>{!k&&!m.current&&n()},children:a.jsxs(e0,{children:[a.jsx(Zv,{className:"review-backdrop"}),a.jsxs(Jv,{className:"confirm-box review-decision",finalFocus:()=>{var k;return(k=w.current)!=null&&k.isConnected?w.current:document.getElementById("review-skill-tab")},children:[a.jsx(wk,{className:"confirm-title",children:r(v?"decision.returnTitle":"decision.approveTitle")}),a.jsx(UT,{className:"confirm-text",children:r(v?"decision.returnDescription":"decision.approveDescription",{name:e.name,version:e.version})}),v?a.jsxs("div",{className:"review-decision__field",children:[a.jsx("label",{className:"cw-label",htmlFor:"review-return-reason",children:r("decision.reason")}),a.jsx("textarea",{id:"review-return-reason",className:"cw-input",rows:4,maxLength:256,required:!0,disabled:f,value:s,onChange:k=>o(k.target.value),onBlur:()=>d(!0),"aria-invalid":u&&y,"aria-describedby":"review-return-help"}),a.jsx("span",{id:"review-return-help",className:u&&y?"cw-error-text":"cw-help",role:u&&y?"alert":void 0,children:r(u&&y?"decision.reasonRequired":"decision.reasonHelp")})]}):null,a.jsxs("div",{className:"review-decision__field",children:[a.jsx("label",{className:"cw-label",htmlFor:"review-decision-comment",children:r("decision.comment")}),a.jsx("textarea",{id:"review-decision-comment",className:"cw-input",rows:3,maxLength:256,disabled:f||e.status==="approving",value:l,onChange:k=>c(k.target.value),"aria-describedby":"review-comment-help"}),a.jsx("span",{id:"review-comment-help",className:"cw-help",children:r("decision.commentHelp")})]}),g?a.jsx("div",{role:"alert",className:"review-decision__error",children:a.jsx(Rs,{error:g})}):null,a.jsxs("div",{className:"confirm-actions",children:[a.jsx(At,{color:"secondary",variant:"outline",size:"md",pill:!1,disabled:f,onClick:n,children:r("actions.cancel")}),a.jsx(At,{color:"primary",size:"md",pill:!1,disabled:f||y,onClick:()=>void x(),children:r(f?"decision.saving":v?"actions.confirmReturn":"actions.confirmApprove")})]})]})]})})}const ptn=p.lazy(()=>Ys(()=>Promise.resolve().then(()=>r9t),void 0).then(e=>({default:e.SkillFileTree})));function mtn({application:e,cloudProvider:t,onClose:n,onDecision:i,onScoreChanged:r}){var k;const{t:s,i18n:o}=_e("reviews"),[l,c]=p.useState("overview"),[u,d]=p.useState([]),[f,h]=p.useState(!1),[m,g]=p.useState(null),[b,v]=p.useState(0),y=p.useRef(document.activeElement instanceof HTMLElement?document.activeElement:null);p.useEffect(()=>{if(l!=="files")return;const S=new AbortController;return h(!0),g(null),Mpt({id:e.id,region:e.region,signal:S.signal}).then(O=>{S.signal.aborted||d(O.files)}).catch(O=>{S.signal.aborted||g(Lr(O,s("detail.filesFailed")))}).finally(()=>{S.signal.aborted||h(!1)}),()=>S.abort()},[e.id,e.region,l,b,s]);const w=e.reviewedAt?new Date(e.reviewedAt).toLocaleString(o.language,{hour12:!1}):"—",x=e.submittedAt?new Date(e.submittedAt).toLocaleString(o.language,{hour12:!1}):"—";return a.jsx(t0,{open:!0,onOpenChange:S=>{S||n()},children:a.jsxs(e0,{children:[a.jsx(Zv,{className:"review-backdrop"}),a.jsxs(Jv,{className:"review-drawer",finalFocus:()=>{var S;return(S=y.current)!=null&&S.isConnected?y.current:document.getElementById("review-skill-tab")},children:[a.jsxs("header",{className:"review-drawer__header",children:[a.jsxs("div",{children:[a.jsx(wk,{children:s("detail.title")}),a.jsx(UT,{children:s("detail.versionFixed")})]}),a.jsx(dL,{className:"review-icon-button","aria-label":s("actions.close"),children:a.jsx(ST,{})})]}),a.jsxs("div",{className:"review-drawer__identity",children:[a.jsx("span",{className:"review-resource-icon",children:a.jsx(xIe,{})}),a.jsxs("div",{children:[a.jsx("h2",{children:e.name}),a.jsxs("span",{children:[s("kind.skill")," · ",e.version]})]}),a.jsx(QT,{status:e.status})]}),a.jsx(rb,{className:"review-drawer__tabs",idPrefix:"review-detail",ariaLabel:s("detail.sections"),value:l,items:[{id:"overview",label:s("detail.overview"),panelId:"review-detail-panel"},{id:"files",label:s("detail.filesTab"),panelId:"review-detail-panel"},{id:"score",label:s("score.title"),panelId:"review-detail-panel"}],onChange:c}),a.jsx("div",{className:"review-drawer__body",id:"review-detail-panel",role:"tabpanel","aria-labelledby":`review-detail-${l}-tab`,children:l==="score"?a.jsx(DFe,{application:e,canRetry:!0,onScoreChanged:r},`${e.region}:${e.id}`):l==="files"?f?a.jsx(fl,{}):m?a.jsxs("div",{role:"alert",children:[a.jsx(Rs,{error:m}),a.jsx("button",{type:"button",onClick:()=>v(S=>S+1),children:s("space.retry")})]}):a.jsx("div",{className:"review-files",children:a.jsx(p.Suspense,{fallback:a.jsx(fl,{}),children:a.jsx(ptn,{files:u})})}):a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"review-facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:s("columns.submitter")}),a.jsx("dd",{children:e.author||s("detail.unknownAuthor")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("columns.submittedAt")}),a.jsx("dd",{children:x})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("columns.version")}),a.jsx("dd",{children:e.version})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("detail.source")}),a.jsx("dd",{children:s("detail.source_skill",{name:e.author})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("detail.destination")}),a.jsx("dd",{children:s("detail.destination_skill")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("detail.region")}),a.jsx("dd",{children:Sh(e.region,t)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("detail.visibility")}),a.jsx("dd",{children:s("detail.shared")})]})]}),a.jsxs("section",{className:"review-detail-section",children:[a.jsx("h3",{children:s("detail.description")}),a.jsx("p",{children:e.description||"—"})]}),a.jsxs("section",{className:"review-detail-section",children:[a.jsx("h3",{children:s("detail.result")}),a.jsx(zW,{application:e})]}),a.jsxs("section",{className:"review-detail-section review-history",children:[a.jsx("h3",{children:s("detail.history")}),a.jsxs("div",{children:[a.jsx("span",{className:"review-history__dot","aria-hidden":"true"}),a.jsxs("p",{children:[a.jsx("strong",{children:s("detail.submitted",{name:e.author})}),a.jsx("span",{children:x})]})]}),e.reviewedAt?a.jsxs("div",{children:[a.jsx("span",{className:"review-history__dot","aria-hidden":"true"}),a.jsxs("p",{children:[a.jsx("strong",{children:s(`detail.${e.status==="approved"?"approved":e.status==="returned"?"returned":"approving"}`,{name:((k=e.reviewer)==null?void 0:k.name)||e.reviewedBy||s("detail.unknownReviewer")})}),a.jsx("span",{children:w})]})]}):null]})]})}),a.jsxs("footer",{className:"review-drawer__footer",children:[e.status==="pending"?a.jsx(At,{color:"secondary",variant:"outline",size:"md",pill:!1,onClick:()=>i("returned"),children:s("actions.return")}):null,e.status==="pending"||e.status==="approving"?a.jsx(At,{color:"primary",size:"md",pill:!1,onClick:()=>i("approved"),children:s(e.status==="approving"?"actions.resumeApproval":"actions.approve")}):a.jsx("span",{children:s(`status.${e.status}`)})]})]})]})})}function gtn({cloudProvider:e,onAgentChanged:t}){const{t:n,i18n:i}=_e("reviews"),[r,s]=p.useState([]),[o,l]=p.useState(null),[c,u]=p.useState("skill"),[d,f]=p.useState(nr(e)),[h,m]=p.useState(!0),[g,b]=p.useState(null),[v,y]=p.useState(0),[w,x]=p.useState("all"),[k,S]=p.useState(""),[O,A]=p.useState(null),[E,j]=p.useState(null),[T,R]=p.useState(""),C=(D,_,L=!1)=>{A(null),R(""),j({application:D,value:_,fromDetails:L})};p.useEffect(()=>{if(c!=="skill")return;const D=new AbortController;let _,L=!1,F=!1;m(!0),b(null);const M=async()=>{if(!(L||D.signal.aborted)){L=!0;try{const q=await Dpt({region:d,signal:D.signal});if(D.signal.aborted)return;s(q.items),A(U=>U&&q.items.find(Z=>Z.id===U.id)||null),F=q.items.some(U=>PFe(U.aiReview)),F&&document.visibilityState!=="hidden"&&(_=setTimeout(()=>void M(),5e3))}catch(q){D.signal.aborted||b(Lr(q,n("space.failed"))),F=!1}finally{L=!1,D.signal.aborted||m(!1)}}},H=()=>{clearTimeout(_),F&&document.visibilityState!=="hidden"&&M()};return M(),document.addEventListener("visibilitychange",H),()=>{D.abort(),clearTimeout(_),document.removeEventListener("visibilitychange",H)}},[d,c,v,n]);const N=g9t(r,c,w,k),P=!!k.trim()||w!=="all",I=[{key:"name",header:n("columns.application"),className:"review-column-name",render:D=>a.jsxs("div",{className:"review-name",children:[a.jsx("span",{className:"review-resource-icon",children:a.jsx(xIe,{})}),a.jsx("div",{children:a.jsx("button",{type:"button",title:D.name,onClick:()=>A(D),children:D.name})})]})},{key:"submitter",header:n("columns.submitter"),className:"review-column-submitter",render:D=>D.author||n("detail.unknownAuthor")},{key:"version",header:n("columns.version"),className:"review-column-version",render:D=>D.version},{key:"submitted",header:n("columns.submittedAt"),className:"review-column-time",render:D=>D.submittedAt?a.jsx("time",{dateTime:D.submittedAt,title:new Date(D.submittedAt).toLocaleString(i.language),children:new Date(D.submittedAt).toLocaleString(i.language,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})}):"—"},{key:"status",header:n("columns.status"),className:"review-column-status",render:D=>a.jsxs("div",{className:"review-table-outcome",children:[a.jsx(QT,{status:D.status}),D.reviewer||D.reviewedBy?a.jsx(QW,{compact:!0,person:D.reviewer,fallback:D.reviewedBy}):null]})},{key:"score",header:n("score.title"),className:"review-column-score",render:D=>a.jsx(UW,{score:D.aiReview})},{key:"actions",header:n("columns.actions"),className:"review-column-actions",render:D=>a.jsxs("div",{className:"review-row-actions",children:[a.jsx("button",{type:"button",onClick:()=>A(D),"aria-label":n("actions.detailsFor",{name:D.name}),children:n("actions.details")}),D.status==="pending"||D.status==="approving"?a.jsx("button",{type:"button",onClick:()=>C(D,"approved"),children:n(D.status==="approving"?"actions.resumeApproval":"actions.approve")}):null,D.status==="pending"?a.jsx("button",{type:"button",onClick:()=>C(D,"returned"),children:n("actions.return")}):null]})}];return a.jsxs(Ch,{className:"review-center","aria-label":n("title"),children:[a.jsx(Qv,{title:n("title")}),a.jsx(ib,{children:a.jsx(rb,{idPrefix:"review",ariaLabel:n("category"),value:c,items:["skill","agent"].map(D=>({id:D,label:a.jsxs(a.Fragment,{children:[n(`kind.${D}`),D==="agent"?o===null?null:a.jsx("span",{className:"review-tab-count",children:o}):a.jsx("span",{className:"review-tab-count",children:r.filter(_=>_.kind===D&&(_.status==="pending"||_.status==="approving")).length})]}),panelId:"review-requests-panel"})),onChange:D=>{u(D),x("all"),S(""),A(null)}})}),a.jsx("div",{className:"review-center__panel",id:"review-requests-panel",role:"tabpanel","aria-labelledby":`review-${c}-tab`,children:c==="agent"?a.jsx(ftn,{cloudProvider:e,onPendingCountChange:l,onChanged:t}):a.jsxs(a.Fragment,{children:[c==="skill"&&g?a.jsxs("div",{role:"alert",children:[a.jsx(Rs,{error:g}),a.jsx("button",{type:"button",onClick:()=>y(D=>D+1),children:n("space.retry")})]}):null,T?a.jsx("p",{role:"status",className:"review-notice",children:T}):null,a.jsx(vH,{rows:N,rowKey:D=>D.id,columns:I,searchValue:k,onSearchChange:S,searchPlaceholder:n("search"),searchLabel:n("search"),toolbarActions:a.jsxs(a.Fragment,{children:[c==="skill"?a.jsxs(a.Fragment,{children:[a.jsx(sb,{id:"review-region",ariaLabel:n("detail.region"),value:d,options:Pu(e),onChange:D=>{s([]),A(null),f(D)}}),a.jsx("button",{type:"button",disabled:h,onClick:()=>y(D=>D+1),children:n("actions.refresh")})]}):null,a.jsx(sb,{id:"review-status",ariaLabel:n("filterStatus"),value:w,options:["all","pending","approving","approved","returned"].map(D=>({value:D,label:n(`status.${D}`)})),onChange:x})]}),emptyLabel:c==="skill"&&h?a.jsx(fl,{}):c==="skill"&&g?null:a.jsxs("div",{className:"review-empty",children:[a.jsx("strong",{children:n(P?"empty.filteredTitle":"empty.title")}),a.jsx("span",{children:n(P?"empty.filteredDescription":"empty.description")}),P?a.jsx("button",{type:"button",onClick:()=>{S(""),x("all")},children:n("actions.clearFilters")}):null]})}),a.jsx("div",{className:"review-center__count",children:n("total",{count:N.length})})]})}),O?a.jsx(mtn,{application:O,cloudProvider:e,onClose:()=>A(null),onDecision:D=>C(O,D,!0),onScoreChanged:(D,_)=>{const L=T9t(D);s(F=>F.map(M=>M.id===O.id?{...M,aiReview:L}:M)),_&&y(F=>F+1)}},O.id):null,E?a.jsx(htn,{application:E.application,decision:E.value,onClose:()=>{E.fromDetails&&A(E.application),j(null),y(D=>D+1)},onDecided:D=>{s(_=>_.map(L=>L.id===D.id?D:L)),E.fromDetails&&A(D),R(n(D.status==="approved"?"decision.approved":"decision.returned",{name:D.name})),j(null)}},`${E.application.id}:${E.value}`):null]})}function btn({role:e,cloudProvider:t,onAgentChanged:n}){const{t:i}=_e("reviews");return e!=="admin"&&e!=="super_admin"?a.jsxs(Ch,{className:"review-center",children:[a.jsx(Qv,{title:i("title")}),a.jsx("p",{role:"status",children:i("adminOnly")})]}):a.jsx(gtn,{cloudProvider:t,onAgentChanged:n},t)}const Sj=10;function ytn(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m9.8 3.5-4.5 4.5 4.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function vtn({hidden:e,...t}){return a.jsxs("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[a.jsx("path",{d:"M2.5 10s2.6-4 7.5-4 7.5 4 7.5 4-2.6 4-7.5 4-7.5-4-7.5-4Z"}),a.jsx("circle",{cx:"10",cy:"10",r:"1.8"}),e?a.jsx("path",{d:"m4 4 12 12"}):null]})}function ey(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M6.5 4H4.8A1.8 1.8 0 0 0 3 5.8v5.4A1.8 1.8 0 0 0 4.8 13h5.4a1.8 1.8 0 0 0 1.8-1.8V9.5M9 3h4v4M12.5 3.5 7.2 8.8",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function xtn(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m4 6 4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function wtn(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m3.5 8.2 2.8 2.8 6.2-6.2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function BO(e,t,n){const i=t.trim();if(!i)return n?"github.validation.required":"";if(e==="repository"&&!/^(?:https:\/\/github\.com\/)?[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+(?:\.git)?$/.test(i))return"github.validation.repository";if(e==="baseBranch"&&(!/^[A-Za-z0-9][A-Za-z0-9._/-]*$/.test(i)||i.includes("..")))return"github.validation.baseBranch";if(e==="projectPath"&&(i.startsWith("/")||i.split("/").includes("..")))return"github.validation.projectPath";if(e==="runtimeName")return i0(i,r=>`github.validation.runtimeName.${r}`)??"";if(e==="runtimeId"&&!/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/.test(i))return"github.validation.runtimeId";if(e==="modelName"&&!/^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$/.test(i))return"github.validation.modelName";if(e==="modelBaseUrl")try{const r=new URL(i);if(r.protocol!=="https:"||r.username||r.password||r.search||r.hash)return"github.validation.modelBaseUrlSafe"}catch{return"github.validation.modelBaseUrl"}return e==="pullRequestUrl"&&!/^https:\/\/github\.com\/[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+\/pull\/[1-9][0-9]*\/?$/.test(i)?"请输入完整的 GitHub Pull Request URL":""}function ktn(e){try{return`https://github.com/${AK(e)}`}catch{return""}}function Otn(e){return e==="started"?"评审中":e==="completed"?"已完成":e==="ignored"?"已忽略":"失败"}function Stn(e){return e==="webhook"?"自动触发":"手动发起"}function Etn(e){return e.reason?e.status!=="ignored"?e.reason:e.reason==="repository-review-disabled"?"忽略原因:仓库未开启自动评审":e.reason==="pull-request-not-reviewable"?"忽略原因:该 PR 事件不需要评审,仅评审新建、更新、重新打开和转为可评审的非 Draft、非 fork PR":e.reason==="review-settings-unavailable"?"忽略原因:自动评审设置不可用":e.reason==="unsupported-event"?"忽略原因:不是 Pull Request 事件":`忽略原因:${e.reason}`:""}function Ctn(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}function mle(e,t,n,i){if(n===0)return`第 ${e} 页`;const r=(e-1)*t+1,s=r+n-1;return`第 ${e} 页 · ${r}-${s}${i?"+":""}`}function Atn({automation:e,cloudProvider:t,onBack:n,onOpenSandboxSession:i}){const{t:r}=_e("automations"),s=ten(e),o=e==="review",l=Pu(t),c=s.secrets({cloudProvider:t}),[u,d]=p.useState(()=>({...s.initialValues({cloudProvider:t})})),f=l.find(Ze=>Ze.value===u.region),[h,m]=p.useState({}),[g,b]=p.useState(""),[v,y]=p.useState(!1),[w,x]=p.useState(!1),[k,S]=p.useState(!1),[O,A]=p.useState(null),[E,j]=p.useState(""),[T,R]=p.useState(null),[C,N]=p.useState(""),[P,I]=p.useState(!1),[D,_]=p.useState(null),[L,F]=p.useState(""),[M,H]=p.useState(o),[q,U]=p.useState([]),[Z,z]=p.useState(o),[J,ne]=p.useState(""),[W,X]=p.useState(null),[le,V]=p.useState(1),[Y,K]=p.useState(!1),[ue,te]=p.useState(""),[Oe,fe]=p.useState(""),[pe,Se]=p.useState(""),[ve,Le]=p.useState([]),[He,Ge]=p.useState(o),[De,se]=p.useState(""),[ce,ye]=p.useState(null),[Ae,Ee]=p.useState(1),[Ce,Be]=p.useState(!1),he=p.useRef(null),ie=p.useRef(null),we=p.useRef(null),Re=p.useRef(null),Ue=p.useRef(null),_t=ktn(u.repository),Pt=_t.replace("https://github.com/",""),Gt=_t?`${_t}/settings/secrets/actions`:"",St=(D==null?void 0:D.appSlug)||"agentkit-veadk-studio",Lt=(D==null?void 0:D.installUrl)||`https://github.com/apps/${St}/installations/new`,qe=dle(E),yt=q.filter(Ze=>Ze.reviewEnabled),je=qe?q.find(Ze=>Ze.fullName.toLowerCase()===qe.toLowerCase()):void 0,kt=le>1||Y,Tt=Ae>1||Ce;p.useEffect(()=>()=>{var Ze,bt,gt,an,Ft;(Ze=he.current)==null||Ze.abort(),(bt=ie.current)==null||bt.abort(),(gt=we.current)==null||gt.abort(),(an=Re.current)==null||an.abort(),(Ft=Ue.current)==null||Ft.abort()},[]),p.useEffect(()=>{var Ze,bt,gt;d({...s.initialValues({cloudProvider:t})}),m({}),b(""),A(null),S(!1),(Ze=he.current)==null||Ze.abort(),(bt=ie.current)==null||bt.abort(),(gt=Ue.current)==null||gt.abort(),R(null),N(""),Le([]),se(""),ye(null),V(1),K(!1),te(""),fe(""),Ee(1),Be(!1)},[e,t,s]),p.useEffect(()=>{var bt;if(!o)return;(bt=we.current)==null||bt.abort();const Ze=new AbortController;we.current=Ze,H(!0),F(""),DJt(Ze.signal).then(gt=>{we.current===Ze&&(_(gt),gt.configured||(z(!1),Ge(!1)))}).catch(gt=>{Ze.signal.aborted||we.current!==Ze||(F(gt instanceof Error?gt.message:String(gt)),z(!1),Ge(!1))}).finally(()=>{we.current===Ze&&(we.current=null,H(!1))})},[o]);const fn=(Ze=le,bt=Oe)=>{var an;(an=Re.current)==null||an.abort();const gt=new AbortController;Re.current=gt,z(!0),ne(""),MJt(gt.signal,{page:Ze,pageSize:Sj,query:bt}).then(Ft=>{if(Re.current===gt){if(Ft.repositories.length===0&&Ft.page>1){V(Ft.page-1),fn(Ft.page-1);return}U(Ft.repositories),V(Ft.page),K(Ft.hasNextPage),X({reviewSettingsConfigured:Ft.reviewSettingsConfigured,reviewSettingsReason:Ft.reviewSettingsReason})}}).catch(Ft=>{gt.signal.aborted||Re.current!==gt||ne(Ft instanceof Error?Ft.message:String(Ft))}).finally(()=>{Re.current===gt&&(Re.current=null,z(!1))})},tn=(Ze=Ae)=>{var gt;(gt=Ue.current)==null||gt.abort();const bt=new AbortController;Ue.current=bt,Ge(!0),se(""),LJt(bt.signal,{page:Ze,pageSize:Sj}).then(an=>{if(Ue.current===bt){if(an.records.length===0&&an.page>1){Ee(an.page-1),tn(an.page-1);return}Le(an.records),Ee(an.page),Be(an.hasNextPage),ye({reviewSettingsConfigured:an.reviewSettingsConfigured,reviewSettingsReason:an.reviewSettingsReason})}}).catch(an=>{bt.signal.aborted||Ue.current!==bt||se(an instanceof Error?an.message:String(an))}).finally(()=>{Ue.current===bt&&(Ue.current=null,Ge(!1))})};p.useEffect(()=>{!o||(D==null?void 0:D.configured)!==!0||(fn(1),tn(1))},[D==null?void 0:D.configured,o]);const We=()=>{const Ze=ue.trim();fe(Ze),V(1),fn(1,Ze)},vt=()=>{te(""),fe(""),V(1),fn(1,"")},Ke=(Ze,bt)=>{if(!(bt<1)){if(Ze==="repositories"){V(bt),fn(bt,Oe);return}Ee(bt),tn(bt)}},ot=async Ze=>{if((W==null?void 0:W.reviewSettingsConfigured)!==!0||pe)return;const bt=new AbortController;Se(Ze.fullName),ne("");try{const gt=await $Jt({repository:Ze.fullName,reviewEnabled:!Ze.reviewEnabled},bt.signal),an=new Set(gt.map(Ft=>Ft.toLowerCase()));U(Ft=>Ft.map(cn=>({...cn,reviewEnabled:an.has(cn.fullName.toLowerCase())})))}catch(gt){ne(gt instanceof Error?gt.message:String(gt))}finally{Se("")}},it=(Ze,bt)=>{d(gt=>({...gt,[Ze]:bt})),h[Ze]&&m(gt=>({...gt,[Ze]:""}))},tt=Ze=>{var Ft;const bt=!o&&Ze==="token"||Ze==="pullRequestUrl"||((Ft=s.fields.find(cn=>cn.name===Ze))==null?void 0:Ft.required)===!0,gt=Ze==="pullRequestUrl"?E:u[Ze],an=BO(Ze,gt,bt);m(cn=>({...cn,[Ze]:an}))},Ct=async Ze=>{var an;if(Ze.preventDefault(),o)return;const bt={};for(const Ft of s.fields){const cn=BO(Ft.name,u[Ft.name],Ft.required);cn&&(bt[Ft.name]=cn)}if(!o){const Ft=BO("token",u.token,!0);Ft&&(bt.token=Ft)}if(m(bt),Object.keys(bt).length)return;(an=he.current)==null||an.abort();const gt=new AbortController;he.current=gt,y(!0),b(""),A(null);try{const Ft=await s.submit(u,{cloudProvider:t},gt.signal);if(he.current!==gt)return;A(Ft),d(cn=>({...cn,token:""}))}catch(Ft){if(gt.signal.aborted||he.current!==gt)return;b(Ft instanceof Error?Ft.message:String(Ft))}finally{he.current===gt&&(he.current=null,y(!1))}},Ot=Ze=>{Ze.key==="Enter"&&(Ze.nativeEvent.isComposing||Ze.nativeEvent.keyCode===229)&&Ze.preventDefault()},Bt=async()=>{var an;const Ze={},bt=BO("pullRequestUrl",E,!0);if(bt&&(Ze.pullRequestUrl=bt),!bt){const Ft=dle(E),cn=q.find(Je=>Je.fullName.toLowerCase()===Ft.toLowerCase());cn?cn.reviewEnabled||(Ze.pullRequestUrl=`请先在下方开启 ${cn.fullName} 的评审`):Ze.pullRequestUrl="PR URL 所属仓库尚未安装 GitHub App"}if(m(Ze),Object.keys(Ze).length)return;(an=ie.current)==null||an.abort();const gt=new AbortController;ie.current=gt,I(!0),N(""),R(null);try{const Ft=await PJt({pullRequestUrl:E.trim()},gt.signal);if(ie.current!==gt)return;R(Ft),d(cn=>({...cn,token:""})),tn(),i==null||i(Ft.sessionId)}catch(Ft){if(gt.signal.aborted||ie.current!==gt)return;N(Ft instanceof Error?Ft.message:String(Ft))}finally{ie.current===gt&&(ie.current=null,I(!1))}},Dt=Ze=>{const{name:bt,placeholder:gt,required:an}=Ze,Ft=bt==="repository",cn=`cards.${e}.fields.${bt}`;return a.jsxs("div",{className:"github-field",children:[a.jsxs("div",{className:"github-field-label-row",children:[a.jsxs("label",{htmlFor:`github-${bt}`,children:[a.jsx("span",{children:r(`${cn}.label`)}),a.jsx("span",{className:`github-field-requirement${an?" is-required":""}`,children:r(an?"github.required":"github.optional")})]}),Ft?a.jsxs("a",{className:"github-field-action",href:"https://github.com/",target:"_blank",rel:"noreferrer",children:["https://github.com/",a.jsx(ey,{})]}):null]}),a.jsx("input",{id:`github-${bt}`,value:u[bt],onChange:Je=>it(bt,Je.target.value),onBlur:()=>tt(bt),placeholder:r(`${cn}.placeholder`,{defaultValue:gt}),required:an,"aria-invalid":!!h[bt],"aria-describedby":`github-${bt}-help${h[bt]?` github-${bt}-error`:""}`}),a.jsx("span",{id:`github-${bt}-help`,className:"github-field-help",children:Ft&&Pt?o?r("github.repositoryReviewHelp",{repository:Pt}):r("github.repositoryConfigHelp",{repository:Pt}):r(`${cn}.help`)}),h[bt]?a.jsx("span",{id:`github-${bt}-error`,className:"github-field-error",role:"alert",children:r(h[bt])}):null]},bt)};return a.jsxs("div",{className:"github-integration-page",children:[a.jsxs("header",{className:"github-integration-header",children:[a.jsx("button",{type:"button",className:"github-back",onClick:n,"aria-label":r("backToAutomations"),children:a.jsx(ytn,{})}),a.jsx(wK,{className:"github-integration-logo"}),a.jsxs("div",{children:[a.jsx("h1",{children:r(`cards.${e}.title`)}),a.jsx("p",{children:r(`cards.${e}.subtitle`)})]})]}),a.jsx("div",{className:"github-integration-layout",children:a.jsxs("section",{id:`github-panel-${e}`,className:"github-section-panel",children:[a.jsx("div",{className:"github-panel-heading",children:a.jsx("p",{children:r(`cards.${e}.panel`)})}),a.jsxs("form",{className:"github-release-form",onSubmit:Ct,onKeyDown:Ot,noValidate:!0,children:[o?null:a.jsxs("div",{className:"github-field-grid",children:[s.fields.map(Dt),a.jsxs("div",{className:"github-field",children:[a.jsxs("label",{id:"github-region-label",children:[a.jsx("span",{children:r("github.region")}),a.jsx("span",{className:"github-field-requirement is-required",children:r("github.required")})]}),a.jsxs("div",{className:"pp-network-region github-region-picker",onKeyDown:Ze=>{Ze.key==="Escape"&&S(!1)},children:[a.jsxs("button",{type:"button",className:"pp-region-trigger","aria-labelledby":"github-region-label","aria-haspopup":"listbox","aria-expanded":k,onClick:()=>S(Ze=>!Ze),children:[a.jsx("span",{children:(f==null?void 0:f.label)??u.region}),a.jsx(xtn,{className:`pp-region-chevron${k?" is-open":""}`})]}),k?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"menu-scrim",onClick:()=>S(!1)}),a.jsx("div",{className:"pp-region-menu",role:"listbox","aria-label":r("github.region"),children:l.map(Ze=>{const bt=Ze.value===u.region;return a.jsxs("button",{type:"button",role:"option","aria-selected":bt,className:`pp-region-option${bt?" is-selected":""}`,onClick:()=>{it("region",Ze.value),S(!1)},children:[a.jsx("span",{children:Ze.label}),bt?a.jsx(wtn,{}):null]},Ze.value)})})]}):null]}),a.jsx("span",{className:"github-field-help",children:r(`cards.${e}.regionHelp`)})]})]}),o?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`github-app-card${D!=null&&D.configured?" is-ready":""}`,children:[a.jsxs("div",{children:[a.jsx("strong",{children:"GitHub App 授权"}),a.jsx("span",{children:M?"正在检查中心服务配置...":D!=null&&D.configured?`安装 ${St} 到目标仓库后,可在下方开启自动评审。`:L||(D==null?void 0:D.reason)||"管理员未配置 GitHub App。"})]}),a.jsxs("a",{className:"github-app-install-link",href:Lt,target:"_blank",rel:"noreferrer",children:["安装 GitHub App",a.jsx(ey,{})]})]}),a.jsxs("section",{className:"github-review-section github-app-repositories","aria-labelledby":"github-app-repositories-title",children:[a.jsxs("div",{className:"github-review-section-header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:"github-app-repositories-title",children:"已安装仓库"}),a.jsx("p",{children:"只有开启评审的仓库会响应 GitHub webhook 自动触发。"})]}),a.jsx("button",{type:"button",onClick:()=>fn(),disabled:!(D!=null&&D.configured)||Z,children:Z?"刷新中...":"刷新"})]}),J?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:J}):null,(W==null?void 0:W.reviewSettingsConfigured)===!1&&!J?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:W.reviewSettingsReason||"管理员未配置 Studio 持久化存储,无法保存启用评审设置。"}):null,a.jsxs("div",{className:"github-app-repository-search",children:[a.jsx("input",{type:"search",value:ue,onChange:Ze=>te(Ze.target.value),onKeyDown:Ze=>{Ze.key==="Enter"&&(Ze.preventDefault(),We())},placeholder:"搜索 owner 或仓库名","aria-label":"搜索已安装仓库"}),a.jsx("button",{type:"button",onClick:We,disabled:!(D!=null&&D.configured)||Z,children:"搜索"}),Oe?a.jsx("button",{type:"button",onClick:vt,disabled:Z,children:"清除"}):null]}),Z&&q.length===0?a.jsx("div",{className:"github-app-repository-empty",children:"正在读取 GitHub App 安装仓库..."}):null,!Z&&q.length===0&&!J?a.jsx("div",{className:"github-app-repository-empty",children:Oe?`没有匹配 “${Oe}” 的已安装仓库。`:"GitHub App 尚未安装到任何仓库。"}):null,q.length>0?a.jsx("div",{className:"github-app-repository-list",children:q.map(Ze=>{const bt=pe===Ze.fullName,gt=(W==null?void 0:W.reviewSettingsConfigured)!==!0||!!pe;return a.jsxs("div",{className:"github-app-repository-row",children:[a.jsxs("div",{className:"github-app-repository-main",children:[a.jsxs("a",{href:Ze.htmlUrl,target:"_blank",rel:"noreferrer",title:Ze.fullName,children:[Ze.fullName,a.jsx(ey,{})]}),a.jsxs("span",{children:[Ze.private?"Private":"Public"," · Installation ",Ze.installationId]})]}),a.jsx("button",{type:"button",className:`github-review-switch${Ze.reviewEnabled?" is-on":""}`,role:"switch","aria-checked":Ze.reviewEnabled,disabled:gt,onClick:()=>{ot(Ze)},children:a.jsx("span",{children:bt?"保存中":Ze.reviewEnabled?"已启用":"未启用"})})]},Ze.fullName)})}):null,kt?a.jsxs("div",{className:"github-list-pagination","aria-label":"已安装仓库分页",children:[a.jsx("span",{children:mle(le,Sj,q.length,Y)}),a.jsxs("div",{children:[a.jsx("button",{type:"button",onClick:()=>Ke("repositories",le-1),disabled:le<=1||Z,children:"上一页"}),a.jsx("button",{type:"button",onClick:()=>Ke("repositories",le+1),disabled:!Y||Z,children:"下一页"})]})]}):null]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"github-field github-token-field",children:[a.jsxs("div",{className:"github-token-label-row",children:[a.jsxs("label",{htmlFor:"github-token",children:[a.jsx("span",{children:r("github.tokenLabel")}),a.jsx("span",{className:"github-field-requirement is-required",children:r("github.required")})]}),a.jsxs("a",{className:"github-field-action",href:"https://github.com/settings/personal-access-tokens/new?name=VeADK%20Studio&description=Create%20a%20GitHub%20automation%20pull%20request&contents=write&pull_requests=write&workflows=write",target:"_blank",rel:"noreferrer",children:[r("github.createToken"),a.jsx(ey,{})]})]}),a.jsxs("div",{className:"github-token-input",children:[a.jsx("input",{id:"github-token",type:w?"text":"password",value:u.token,onChange:Ze=>it("token",Ze.target.value),onBlur:()=>tt("token"),autoComplete:"off",required:!0,placeholder:r("github.tokenWorkflowPlaceholder"),"aria-invalid":!!h.token,"aria-describedby":`github-token-help${h.token?" github-token-error":""}`}),a.jsx("button",{type:"button",onClick:()=>x(Ze=>!Ze),"aria-label":r(w?"github.hideToken":"github.showToken"),title:r(w?"github.hideToken":"github.showToken"),children:a.jsx(vtn,{hidden:w})})]}),a.jsx("span",{id:"github-token-help",className:"github-field-help",children:r("github.tokenWorkflowHelp")}),h.token?a.jsx("span",{id:"github-token-error",className:"github-field-error",role:"alert",children:r(h.token)}):null]}),g?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:g}):null,O?a.jsxs("div",{className:"github-submit-message is-success github-result-message",role:"status",children:[a.jsxs("div",{children:[a.jsx("strong",{children:r("github.configPrCreated",{number:O.number})}),a.jsx("span",{children:r("github.configPrNextStep")})]}),a.jsxs("a",{className:"github-result-link",href:O.url,target:"_blank",rel:"noreferrer",children:[r("github.viewConfigPr"),a.jsx(ey,{})]})]}):null,a.jsxs("div",{className:"github-form-actions",children:[a.jsxs("div",{className:"github-secrets-note",children:[a.jsxs("div",{className:"github-secrets-header",children:[a.jsx("strong",{children:r("github.secretsConfigHeading")}),Gt?a.jsxs("a",{className:"github-secrets-link",href:Gt,target:"_blank",rel:"noreferrer",children:[r("github.openSecrets"),a.jsx(ey,{})]}):null]}),a.jsx("span",{className:"github-secrets-path",children:r("github.secretsPath")}),a.jsx("ul",{children:c.map(Ze=>{const[bt,...gt]=Ze.split(":");return a.jsxs("li",{children:[a.jsx("code",{children:bt}),gt.length?a.jsx("span",{children:gt.join(":")}):null]},Ze)})})]}),a.jsx("button",{type:"submit",disabled:v,children:r(v?"github.submitting":`cards.${e}.submitLabel`)})]})]})]}),o?a.jsxs("div",{className:"github-pr-review-sections",children:[a.jsxs("section",{className:"github-review-section github-review-now","aria-labelledby":"github-review-now-title",children:[a.jsx("div",{className:"github-review-section-header",children:a.jsxs("div",{children:[a.jsx("h2",{id:"github-review-now-title",children:"立刻评审"}),a.jsx("p",{children:"输入已安装且已启用仓库的 PR URL,立即创建 Sandbox 评审任务。"})]})}),a.jsxs("div",{className:"github-review-section-body",children:[a.jsxs("div",{className:"github-field",children:[a.jsx("input",{id:"github-pull-request-url","aria-label":"Pull Request URL",value:E,onChange:Ze=>{j(Ze.target.value),h.pullRequestUrl&&m(bt=>({...bt,pullRequestUrl:""}))},onBlur:()=>m(Ze=>({...Ze,pullRequestUrl:BO("pullRequestUrl",E,!0)})),placeholder:"https://github.com/owner/repository/pull/123","aria-invalid":!!h.pullRequestUrl,"aria-describedby":h.pullRequestUrl?"github-pull-request-url-error":void 0}),h.pullRequestUrl?a.jsx("span",{id:"github-pull-request-url-error",className:"github-field-error",role:"alert",children:h.pullRequestUrl}):null,!h.pullRequestUrl&&qe?a.jsx("span",{className:"github-field-help",children:je!=null&&je.reviewEnabled?`将使用 GitHub App 评审 ${je.fullName}`:je?`请先在下方开启 ${je.fullName} 的评审`:`PR URL 所属仓库 ${qe} 尚未安装 GitHub App`}):null,!h.pullRequestUrl&&!qe&&yt.length>0?a.jsxs("span",{className:"github-field-help",children:["已启用仓库:",yt.map(Ze=>Ze.fullName).join("、")]}):null]}),C?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:C}):null,T?a.jsx("div",{className:"github-submit-message is-success",role:"status",children:a.jsxs("span",{children:["已发起评审,Session ",T.sessionId," 正在运行。"]})}):null,a.jsx("div",{className:"github-review-section-actions",children:a.jsx("button",{type:"button",onClick:Bt,disabled:P,children:P?"发起评审中…":"立即发起评审"})})]})]}),a.jsxs("section",{className:"github-review-section github-review-records","aria-labelledby":"github-review-records-title",children:[a.jsxs("div",{className:"github-review-section-header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:"github-review-records-title",children:"评审记录"}),a.jsx("p",{children:"展示最近自动触发和手动发起的评审任务。"})]}),a.jsx("button",{type:"button",onClick:()=>tn(),disabled:!(D!=null&&D.configured)||He,children:He?"刷新中...":"刷新"})]}),De?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:De}):null,(ce==null?void 0:ce.reviewSettingsConfigured)===!1&&!De?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:ce.reviewSettingsReason||"管理员未配置 Studio 持久化存储,无法读取评审记录。"}):null,He&&ve.length===0?a.jsx("div",{className:"github-app-repository-empty",children:"正在读取 PR 评审记录..."}):null,!He&&ve.length===0&&!De?a.jsx("div",{className:"github-app-repository-empty",children:"暂无 PR 评审记录。"}):null,ve.length>0?a.jsx("div",{className:"github-review-record-list",children:ve.map(Ze=>{const bt=Etn(Ze),gt=Ze.status==="completed"?"":Ze.sessionId;return a.jsxs("div",{className:"github-review-record-row",children:[a.jsxs("div",{className:"github-review-record-main",children:[a.jsxs("div",{className:"github-review-record-title",children:[a.jsxs("a",{href:Ze.pullRequestUrl,target:"_blank",rel:"noreferrer",children:[Ze.repository,"#",Ze.pullRequestNumber,a.jsx(ey,{})]}),a.jsx("span",{className:`github-review-record-status is-${Ze.status}`,children:Otn(Ze.status)})]}),a.jsxs("span",{children:[Stn(Ze.trigger),Ze.action?` · ${Ze.action}`:""," · ",Ctn(Ze.createdAt),bt?` · ${bt}`:""]})]}),a.jsx("div",{className:"github-review-record-actions",children:gt&&i?a.jsx("button",{type:"button",onClick:()=>i(gt),children:"打开 Session"}):null})]},Ze.id)})}):null,Tt?a.jsxs("div",{className:"github-list-pagination","aria-label":"评审记录分页",children:[a.jsx("span",{children:mle(Ae,Sj,ve.length,Ce)}),a.jsxs("div",{children:[a.jsx("button",{type:"button",onClick:()=>Ke("records",Ae-1),disabled:Ae<=1||He,children:"上一页"}),a.jsx("button",{type:"button",onClick:()=>Ke("records",Ae+1),disabled:!Ce||He,children:"下一页"})]})]}):null]})]}):null]})})]})}async function r0(e){var i;const t=await e.json().catch(()=>null),n=(i=t==null?void 0:t.detail)==null?void 0:i.message;return new Error(n||`GitLab MR 评审请求失败(HTTP ${e.status})。`)}function gle(e,t){const n=e.trim().replace(/\/+$/,"");if(!n)return"";const i=`${n}/`,r=t.trim();if(!r.startsWith(i))return"";const s=r.slice(i.length).replace(/\/+$/,""),o="/-/merge_requests/",l=s.indexOf(o);if(l<=0)return"";const c=s.slice(l+o.length);return/^[1-9][0-9]*$/.test(c)?s.slice(0,l):""}async function ble(e){const t=await yn("/web/gitlab/app/config",{method:"GET",headers:{Accept:"application/json"},signal:e});if(!t.ok)throw await r0(t);const n=await t.json();if(typeof n.configured!="boolean"||typeof n.baseUrl!="string"||typeof n.webhookUrl!="string"||typeof n.reason!="string"||typeof n.oauthConfigured!="boolean"||typeof n.oauthConnected!="boolean"||n.oauthUser!==null&&n.oauthUser!==void 0&&(typeof n.oauthUser!="object"||typeof n.oauthUser.credentialId!="string"||typeof n.oauthUser.ownerId!="string"||typeof n.oauthUser.baseUrl!="string"||typeof n.oauthUser.gitlabUserId!="number"||typeof n.oauthUser.gitlabUsername!="string"||typeof n.oauthUser.gitlabName!="string"||typeof n.oauthUser.expiresAt!="number"))throw new Error("GitLab 集成配置响应格式无效。");return n}async function Ttn(e,t){var s;const n=new URLSearchParams({page:String(t.page),pageSize:String(t.pageSize)});(s=t.query)!=null&&s.trim()&&n.set("q",t.query.trim());const i=await yn(`/web/gitlab/app/projects?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await r0(i);const r=await i.json();if(!Array.isArray(r.projects)||typeof r.page!="number"||typeof r.pageSize!="number"||typeof r.hasNextPage!="boolean"||typeof r.reviewSettingsConfigured!="boolean"||typeof r.reviewSettingsReason!="string"||r.projects.some(o=>typeof o!="object"||o===null||typeof o.instanceId!="string"||typeof o.baseUrl!="string"||typeof o.projectId!="number"||typeof o.pathWithNamespace!="string"||typeof o.name!="string"||typeof o.namespace!="string"||typeof o.webUrl!="string"||typeof o.private!="boolean"||typeof o.reviewEnabled!="boolean"||typeof o.permissionsNote!="string"||typeof o.accessLevel!="number"||typeof o.canManageWebhooks!="boolean"||typeof o.reviewBindingStatus!="string"||typeof o.reviewBindingReason!="string"||typeof o.reviewCredentialOwner!="string"||typeof o.reviewCredentialType!="string"))throw new Error("GitLab 集成项目列表响应格式无效。");return r}async function _tn(e,t){const n=await yn("/web/gitlab/app/review-projects",{method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw await r0(n);const i=await n.json();if(!Array.isArray(i.projects)||i.projects.some(r=>typeof r!="object"||r===null||typeof r.projectId!="number"))throw new Error("GitLab 集成评审项目保存响应格式无效。");return i.projects}async function jtn(e){const t=await yn("/web/gitlab/oauth/disconnect",{method:"POST",headers:{Accept:"application/json"},signal:e});if(!t.ok)throw await r0(t)}async function Ntn(e){const t=await yn("/web/gitlab/oauth/start-url",{method:"GET",headers:{Accept:"application/json"},signal:e});if(!t.ok)throw await r0(t);const n=await t.json();if(typeof n.authorizationUrl!="string"||!n.authorizationUrl)throw new Error("GitLab OAuth 授权地址响应格式无效。");return n.authorizationUrl}async function Rtn(e,t){const n=new URLSearchParams({page:String(t.page),pageSize:String(t.pageSize)}),i=await yn(`/web/gitlab/app/review-records?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await r0(i);const r=await i.json();if(!Array.isArray(r.records)||typeof r.page!="number"||typeof r.pageSize!="number"||typeof r.hasNextPage!="boolean"||typeof r.reviewSettingsConfigured!="boolean"||typeof r.reviewSettingsReason!="string"||r.records.some(s=>typeof s!="object"||s===null||typeof s.id!="string"||typeof s.projectId!="number"||typeof s.pathWithNamespace!="string"||typeof s.mergeRequestUrl!="string"||typeof s.mergeRequestIid!="number"||!["started","completed","ignored","failed"].includes(String(s.status))||!["manual","webhook"].includes(String(s.trigger))||typeof s.createdAt!="string"||typeof s.deliveryId!="string"||typeof s.action!="string"||typeof s.sessionId!="string"||typeof s.displayName!="string"||typeof s.reason!="string"))throw new Error("GitLab MR 评审记录响应格式无效。");return r}async function Itn(e,t){const n=await yn("/web/gitlab/merge-request-reviews",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw await r0(n);const i=await n.json();if(i.status!=="started"||typeof i.sessionId!="string"||!i.sessionId||typeof i.displayName!="string")throw new Error("GitLab MR 评审服务返回了无效结果。");return i}const Ej=10;function Cj(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[a.jsx("path",{d:"M6.5 4H4a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h7a1 1 0 0 0 1-1V9.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),a.jsx("path",{d:"M9 3h4v4M8.5 7.5 13 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Ptn(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m9.8 3.5-4.5 4.5 4.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Dtn(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...e,children:a.jsx("path",{d:"m22.54 9.64-.03-.08-2.2-6.81a.76.76 0 0 0-1.43-.08l-2.1 4.31H7.22l-2.1-4.31a.76.76 0 0 0-1.43.08l-2.2 6.81-.03.08a5.15 5.15 0 0 0 1.7 5.79l.01.01.02.01 8.81 6.58 8.81-6.58.02-.01.01-.01a5.15 5.15 0 0 0 1.7-5.79ZM12 20.08 8.65 8.59h6.7L12 20.08Z"})})}function Mtn(e){return e==="started"?"进行中":e==="completed"?"已完成":e==="ignored"?"已忽略":"失败"}function Ltn(e){return e==="webhook"?"自动触发":"手动发起"}function $tn(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function Ftn(e){return e.reason==="project-review-disabled"?"项目未启用":e.reason==="merge-request-not-reviewable"?"MR 不满足评审条件":e.reason}function yle(e,t,n,i){const r=(e-1)*t+1,s=(e-1)*t+n;return i?`${r}-${s}`:`${r}-${s} / ${s}`}function Btn({onBack:e,onOpenSandboxSession:t}){const[n,i]=p.useState(null),[r,s]=p.useState(""),[o,l]=p.useState(!0),[c,u]=p.useState([]),[d,f]=p.useState(!0),[h,m]=p.useState(""),[g,b]=p.useState(null),[v,y]=p.useState(1),[w,x]=p.useState(!1),[k,S]=p.useState(""),[O,A]=p.useState(""),[E,j]=p.useState(null),[T,R]=p.useState(""),[C,N]=p.useState(!1),[P,I]=p.useState(""),[D,_]=p.useState(null),[L,F]=p.useState([]),[M,H]=p.useState(!0),[q,U]=p.useState(""),[Z,z]=p.useState(1),[J,ne]=p.useState(!1),[W,X]=p.useState(null),[le,V]=p.useState(!1),[Y,K]=p.useState(!1),ue=p.useRef(null),te=p.useRef(null),Oe=p.useRef(null),fe=n?gle(n.baseUrl,T):"",pe=fe?c.find(Ee=>Ee.pathWithNamespace.toLowerCase()===fe.toLowerCase()):void 0,Se=v>1||w,ve=Z>1||J,Le=(n==null?void 0:n.configured)===!0&&n.oauthConnected,He=(Ee=v,Ce=O)=>{var he;(he=te.current)==null||he.abort();const Be=new AbortController;te.current=Be,f(!0),m(""),Ttn(Be.signal,{page:Ee,pageSize:Ej,query:Ce}).then(ie=>{if(te.current===Be){if(ie.projects.length===0&&ie.page>1){y(ie.page-1),He(ie.page-1,Ce);return}u(ie.projects),y(ie.page),x(ie.hasNextPage),b({reviewSettingsConfigured:ie.reviewSettingsConfigured,reviewSettingsReason:ie.reviewSettingsReason})}}).catch(ie=>{Be.signal.aborted||te.current!==Be||m(ie instanceof Error?ie.message:String(ie))}).finally(()=>{te.current===Be&&(te.current=null,f(!1))})},Ge=(Ee=Z)=>{var Be;(Be=Oe.current)==null||Be.abort();const Ce=new AbortController;Oe.current=Ce,H(!0),U(""),Rtn(Ce.signal,{page:Ee,pageSize:Ej}).then(he=>{if(Oe.current===Ce){if(he.records.length===0&&he.page>1){z(he.page-1),Ge(he.page-1);return}F(he.records),z(he.page),ne(he.hasNextPage),X({reviewSettingsConfigured:he.reviewSettingsConfigured,reviewSettingsReason:he.reviewSettingsReason})}}).catch(he=>{Ce.signal.aborted||Oe.current!==Ce||U(he instanceof Error?he.message:String(he))}).finally(()=>{Oe.current===Ce&&(Oe.current=null,H(!1))})};p.useEffect(()=>{var Ce;(Ce=ue.current)==null||Ce.abort();const Ee=new AbortController;return ue.current=Ee,l(!0),s(""),ble(Ee.signal).then(Be=>{ue.current===Ee&&(i(Be),(!Be.configured||Be.oauthConfigured&&!Be.oauthConnected)&&(f(!1),H(!1)))}).catch(Be=>{Ee.signal.aborted||ue.current!==Ee||(s(Be instanceof Error?Be.message:String(Be)),f(!1),H(!1))}).finally(()=>{ue.current===Ee&&(ue.current=null,l(!1))}),()=>{var Be,he;Ee.abort(),(Be=te.current)==null||Be.abort(),(he=Oe.current)==null||he.abort()}},[]),p.useEffect(()=>{Le&&(He(1,""),Ge(1))},[Le]);const De=()=>{const Ee=k.trim();A(Ee),y(1),He(1,Ee)},se=async Ee=>{if((g==null?void 0:g.reviewSettingsConfigured)!==!0||E!==null)return;if(!Ee.reviewEnabled&&!Le){m("请先连接 GitLab 后再启用自动评审。");return}const Ce=new AbortController;j(Ee.projectId),m("");try{await _tn({projectId:Ee.projectId,reviewEnabled:!Ee.reviewEnabled},Ce.signal),u(Be=>Be.map(he=>he.projectId===Ee.projectId?{...he,reviewEnabled:!Ee.reviewEnabled}:he))}catch(Be){m(Be instanceof Error?Be.message:String(Be))}finally{j(null)}},ce=async()=>{const Ee=new AbortController;K(!0),s("");try{await jtn(Ee.signal);const Ce=await ble(Ee.signal);i(Ce),u([]),b(null)}catch(Ce){s(Ce instanceof Error?Ce.message:String(Ce))}finally{K(!1)}},ye=async()=>{const Ee=new AbortController;V(!0),s("");try{window.location.href=await Ntn(Ee.signal)}catch(Ce){s(Ce instanceof Error?Ce.message:String(Ce)),V(!1)}},Ae=async()=>{const Ee=T.trim();if(!Ee){I("请输入 GitLab Merge Request URL。");return}if(!(n!=null&&n.configured)){I("管理员未配置 GitLab OAuth。");return}if(!Le){I("请先连接 GitLab 后再发起评审。");return}if(!gle(n.baseUrl,Ee)){I("请输入当前 GitLab 实例下的完整 Merge Request URL。");return}N(!0),I(""),_(null);const Ce=new AbortController;try{const Be=await Itn({mergeRequestUrl:Ee},Ce.signal);_(Be),Ge(1)}catch(Be){I(Be instanceof Error?Be.message:String(Be))}finally{N(!1)}};return a.jsxs("div",{className:"github-integration-page",children:[a.jsxs("header",{className:"github-integration-header",children:[a.jsx("button",{type:"button",className:"github-back",onClick:e,"aria-label":"返回自动化",children:a.jsx(Ptn,{})}),a.jsx(Dtn,{className:"github-integration-logo"}),a.jsxs("div",{children:[a.jsx("h1",{children:"GitLab MR Review"}),a.jsx("p",{children:"通过 GitLab webhook 触发 Sandbox 评审,并将结果写回 Merge Request。"})]})]}),a.jsx("div",{className:"github-integration-layout",children:a.jsxs("section",{className:"github-section-panel",children:[a.jsx("div",{className:"github-panel-heading",children:a.jsx("p",{children:"请先为目标项目开启自动评审,再通过 webhook 或手动 URL 发起 MR 评审。"})}),a.jsxs("div",{className:"github-release-form",children:[a.jsxs("div",{className:`github-app-card${n!=null&&n.configured?" is-ready":""}`,children:[a.jsxs("div",{children:[a.jsx("strong",{children:"GitLab 集成配置"}),a.jsx("span",{children:o?"正在检查中心服务配置...":n!=null&&n.configured?n.oauthConnected&&n.oauthUser?`已连接 ${n.oauthUser.gitlabName||n.oauthUser.gitlabUsername} · ${n.baseUrl}`:`当前实例:${n.baseUrl}`:r||(n==null?void 0:n.reason)||"管理员未配置 GitLab OAuth。"})]}),n!=null&&n.oauthConfigured&&!n.oauthConnected?a.jsxs("button",{type:"button",className:"github-app-install-link",onClick:()=>{ye()},disabled:le,children:[le?"连接中...":"连接 GitLab",a.jsx(Cj,{})]}):n!=null&&n.oauthConnected?a.jsx("button",{type:"button",className:"github-app-install-link",onClick:()=>{ce()},disabled:Y,children:Y?"断开中...":"断开授权"}):n!=null&&n.webhookUrl?a.jsxs("a",{className:"github-app-install-link",href:n.webhookUrl,target:"_blank",rel:"noreferrer",children:["Webhook",a.jsx(Cj,{})]}):null]}),a.jsxs("section",{className:"github-review-section github-app-repositories","aria-labelledby":"gitlab-projects-title",children:[a.jsxs("div",{className:"github-review-section-header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:"gitlab-projects-title",children:"可访问项目"}),a.jsx("p",{children:"只有开启评审的项目会响应 GitLab webhook 自动触发。"})]}),a.jsx("button",{type:"button",onClick:()=>He(),disabled:!Le||d,children:d?"刷新中...":"刷新"})]}),h?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:h}):null,(g==null?void 0:g.reviewSettingsConfigured)===!1&&!h?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:g.reviewSettingsReason||"管理员未配置 Studio 持久化存储,无法保存启用评审设置。"}):null,a.jsxs("div",{className:"github-app-repository-search",children:[a.jsx("input",{type:"search",value:k,onChange:Ee=>S(Ee.target.value),onKeyDown:Ee=>{Ee.key==="Enter"&&(Ee.preventDefault(),De())},placeholder:"搜索 group 或项目名","aria-label":"搜索 GitLab 项目"}),a.jsx("button",{type:"button",onClick:De,disabled:!Le||d,children:"搜索"}),O?a.jsx("button",{type:"button",onClick:()=>{S(""),A(""),y(1),He(1,"")},disabled:d||!Le,children:"清除"}):null]}),!Le&&!o?a.jsx("div",{className:"github-app-repository-empty",children:"请先连接 GitLab。"}):null,d&&c.length===0&&Le?a.jsx("div",{className:"github-app-repository-empty",children:"正在读取 GitLab 项目..."}):null,!d&&c.length===0&&!h&&Le?a.jsx("div",{className:"github-app-repository-empty",children:O?`没有匹配 “${O}” 的 GitLab 项目。`:"GitLab 集成暂无可访问项目。"}):null,c.length>0?a.jsx("div",{className:"github-app-repository-list",children:c.map(Ee=>{const Ce=E===Ee.projectId,Be=(g==null?void 0:g.reviewSettingsConfigured)!==!0||E!==null||!Ee.reviewEnabled&&!Le;return a.jsxs("div",{className:"github-app-repository-row",children:[a.jsxs("div",{className:"github-app-repository-main",children:[a.jsxs("a",{href:Ee.webUrl,target:"_blank",rel:"noreferrer",title:Ee.pathWithNamespace,children:[Ee.pathWithNamespace,a.jsx(Cj,{})]}),a.jsxs("span",{children:[Ee.private?"Private":"Public"," · Project ",Ee.projectId,Ee.permissionsNote?` · ${Ee.permissionsNote}`:"",Ee.reviewBindingStatus&&Ee.reviewBindingStatus!=="active"&&Ee.reviewBindingStatus!=="disabled"?` · ${Ee.reviewBindingReason||"授权失效"}`:""]})]}),a.jsx("button",{type:"button",className:`github-review-switch${Ee.reviewEnabled?" is-on":""}`,role:"switch","aria-checked":Ee.reviewEnabled,disabled:Be,onClick:()=>{se(Ee)},children:a.jsx("span",{children:Ce?"保存中":Ee.reviewEnabled?"已启用":"未启用"})})]},`${Ee.instanceId}:${Ee.projectId}`)})}):null,Se?a.jsxs("div",{className:"github-list-pagination","aria-label":"GitLab 项目分页",children:[a.jsx("span",{children:yle(v,Ej,c.length,w)}),a.jsxs("div",{children:[a.jsx("button",{type:"button",onClick:()=>{y(v-1),He(v-1,O)},disabled:v<=1||d,children:"上一页"}),a.jsx("button",{type:"button",onClick:()=>{y(v+1),He(v+1,O)},disabled:!w||d,children:"下一页"})]})]}):null]})]}),a.jsxs("div",{className:"github-pr-review-sections",children:[a.jsxs("section",{className:"github-review-section github-review-now","aria-labelledby":"gitlab-review-now-title",children:[a.jsx("div",{className:"github-review-section-header",children:a.jsxs("div",{children:[a.jsx("h2",{id:"gitlab-review-now-title",children:"立刻评审"}),a.jsx("p",{children:"输入当前 GitLab 实例下的 MR URL,立即创建 Sandbox 评审任务。"})]})}),a.jsxs("div",{className:"github-review-section-body",children:[a.jsxs("div",{className:"github-field",children:[a.jsx("input",{"aria-label":"Merge Request URL",value:T,onChange:Ee=>R(Ee.target.value),placeholder:`${(n==null?void 0:n.baseUrl)||"https://gitlab.example.com"}/group/project/-/merge_requests/123`}),fe?a.jsx("span",{className:"github-field-help",children:pe?`将使用 GitLab 授权评审 ${pe.pathWithNamespace}`:`MR URL 所属项目 ${fe} 不在当前项目列表中`}):null]}),P?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:P}):null,D?a.jsx("div",{className:"github-submit-message is-success",role:"status",children:a.jsxs("span",{children:["已发起评审,Session ",D.sessionId," 正在运行。"]})}):null,a.jsx("div",{className:"github-review-section-actions",children:a.jsx("button",{type:"button",onClick:Ae,disabled:C||!Le,children:C?"发起评审中...":"立即发起评审"})})]})]}),a.jsxs("section",{className:"github-review-section github-review-records","aria-labelledby":"gitlab-review-records-title",children:[a.jsxs("div",{className:"github-review-section-header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:"gitlab-review-records-title",children:"评审记录"}),a.jsx("p",{children:"展示最近自动触发和手动发起的评审任务。"})]}),a.jsx("button",{type:"button",onClick:()=>Ge(),disabled:!Le||M,children:M?"刷新中...":"刷新"})]}),q?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:q}):null,(W==null?void 0:W.reviewSettingsConfigured)===!1&&!q?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:W.reviewSettingsReason||"管理员未配置 Studio 持久化存储,无法读取评审记录。"}):null,M&&L.length===0?a.jsx("div",{className:"github-app-repository-empty",children:"正在读取 MR 评审记录..."}):null,!M&&L.length===0&&!q?a.jsx("div",{className:"github-app-repository-empty",children:"暂无 MR 评审记录。"}):null,L.length>0?a.jsx("div",{className:"github-review-record-list",children:L.map(Ee=>{const Ce=Ftn(Ee),Be=Ee.status==="completed"?"":Ee.sessionId;return a.jsxs("div",{className:"github-review-record-row",children:[a.jsxs("div",{className:"github-review-record-main",children:[a.jsxs("div",{className:"github-review-record-title",children:[a.jsxs("a",{href:Ee.mergeRequestUrl,target:"_blank",rel:"noreferrer",children:[Ee.pathWithNamespace,"!",Ee.mergeRequestIid,a.jsx(Cj,{})]}),a.jsx("span",{className:`github-review-record-status is-${Ee.status}`,children:Mtn(Ee.status)})]}),a.jsxs("span",{children:[Ltn(Ee.trigger),Ee.action?` · ${Ee.action}`:""," · ",$tn(Ee.createdAt),Ce?` · ${Ce}`:""]})]}),a.jsx("div",{className:"github-review-record-actions",children:Be&&t?a.jsx("button",{type:"button",onClick:()=>t(Be),children:"打开 Session"}):null})]},Ee.id)})}):null,ve?a.jsxs("div",{className:"github-list-pagination","aria-label":"GitLab 评审记录分页",children:[a.jsx("span",{children:yle(Z,Ej,L.length,J)}),a.jsxs("div",{children:[a.jsx("button",{type:"button",onClick:()=>{z(Z-1),Ge(Z-1)},disabled:Z<=1||M,children:"上一页"}),a.jsx("button",{type:"button",onClick:()=>{z(Z+1),Ge(Z+1)},disabled:!J||M,children:"下一页"})]})]}):null]})]})]})})]})}const Utn=1050062,vle="1.0",Qtn="https://lf-static.applogcdn.com/obj/applog-sdk-static/log-sdk/collect/5/collect.js";class ztn{constructor(){Zt(this,"enabled",!1);Zt(this,"initialized",!1);Zt(this,"pending",[]);Zt(this,"userUniqueId","");Zt(this,"initPromise")}init(t){return this.enabled=t.enabled,this.enabled?this.initPromise?this.initPromise:(this.initPromise=Promise.resolve().then(()=>{const n=this.bootstrapCollector();n("init",{app_id:Utn,channel:"cn",disable_auto_pv:1}),this.userUniqueId&&n("config",{user_unique_id:this.userUniqueId}),n("config",{_staging_flag:t.environment==="prod"?0:1}),n("start"),this.initialized=!0;const i=this.pending;this.pending=[];for(const[r,s]of i)this.collect(r,s)}),this.initPromise):(this.pending=[],Promise.resolve())}identify(t){this.userUniqueId=t,this.initialized&&this.collect("config",{user_unique_id:t})}emit(t,n){if(this.enabled){if(this.initialized){this.collect(t,n);return}this.pending=[...this.pending.slice(-49),[t,n]]}}bootstrapCollector(){if(window.collectEvent)return window.collectEvent;window.LogAnalyticsObject="collectEvent";const t=function(){var r;(r=t.q)==null||r.push(arguments)};t.q=[],t.l=Date.now(),window.collectEvent=t;const n=document.createElement("script");return n.async=!0,n.src=Qtn,n.onerror=()=>{this.enabled=!1,t.q=[],console.warn("[telemetry] TEA SDK script failed to load")},document.head.appendChild(n),t}collect(t,n){var i;(i=window.collectEvent)==null||i.call(window,t,n)}}const Vtn=256,o7e=1024,k6="[REDACTED]";function Htn(e){if(typeof e!="string"&&typeof e!="number")return;const t=String(e).trim();return/^[A-Za-z0-9_.:-]{1,64}$/.test(t)?t:void 0}function ip(e,t){return t===void 0?{errorKind:e}:{errorKind:e,errorCode:t}}function l7e(e,t,n={}){if(e.length<=t)return e;if(n.preserveEnd){const r="[truncated] ...";return`${r}${e.slice(-Math.max(0,t-r.length))}`}const i="... [truncated]";return`${e.slice(0,Math.max(0,t-i.length))}${i}`}function qtn(e){return e.replace(/\b(Authorization\s*[:=]\s*)(Bearer\s+)?[^\s"',;&]+/gi,(t,n,i)=>`${n}${i??""}${k6}`).replace(/\bBearer\s+[A-Za-z0-9._~+/=-]+/gi,`Bearer ${k6}`).replace(/\b([\w.-]*(?:token|password|passwd|secret|api[_-]?key|access[_-]?key|secret[_-]?key|cookie)[\w.-]*\s*[:=]\s*)(["']?)[^\s"',;&]+/gi,(t,n,i)=>`${n}${i}${k6}`)}function Dy(e,t={}){const n=e!==null&&typeof e=="object"?e:{},r=(typeof n.message=="string"?n.message:typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):"").replace(/\s+/g," ").trim();if(r)return l7e(qtn(r),o7e,t)}function Jo(e,t={}){const n=e!==null&&typeof e=="object"?e:{},i=Htn(n.code),r=typeof n.name=="string"?n.name:"";if(r==="RuntimeProbeError")return ip("runtime_probe_error",i);if(r==="AbortError")return ip("abort",i);if(r==="RuntimeAccessDeniedError"||r==="AuthError")return ip("auth",i);if(t.phase==="build")return ip("build_failed",i);if(r==="TimeoutError")return ip("timeout",i);if(r==="NetworkError"||r==="TypeError")return ip("network",i);if(r==="ValidationError")return ip("validation",i);if(r==="ServerError")return ip("server",i);const s=typeof n.status=="number"&&Number.isInteger(n.status)?n.status:void 0;if(s===void 0||s<400||s>599)return ip("unknown",i);const o=String(s);return s===401||s===403?{errorKind:"auth",errorCode:o}:s===400||s===409||s===422?{errorKind:"validation",errorCode:o}:s>=500?{errorKind:"server",errorCode:o}:{errorKind:"unknown",errorCode:o}}const Wtn=["schema_version","event_id","operation_id","user_pool_id","studio_deploy_id","vefaas_application_id","vefaas_function_id","studio_region","studio_project","studio_version","environment","cloud_provider","account_id","account_id_resolution_error","user_role","user_source","page_instance_id"],Ktn={studio_entry_viewed:["auth_state"],studio_session_started:["agents_source"],studio_agent_deploy:["status","agent_id","deploy_action","deploy_source","create_mode","ai_assisted","deploy_region","runtime_network_type","feishu_enabled","runtime_id","duration_ms","failed_phase","error_kind","error_code","error_message"],studio_sandbox_create:["status","sandbox_kind","sandbox_source","sandbox_id","duration_ms","error_kind","error_code"],studio_agent_debug:["status","agent_id","variant_type","debug_run_id","duration_ms","failed_phase","error_kind","error_code"],studio_agent_connect:["status","target_id","agent_kind","connect_source","runtime_region","runtime_is_mine","sandbox_status","duration_ms","error_kind","error_code"],studio_agent_message:["status","agent_id","agent_kind","message_source","session_state","session_id","duration_ms","failed_phase","error_kind","error_code"],studio_agent_source_download:["status","agent_id","deploy_action","deploy_source","create_mode","ai_assisted","duration_ms","file_count","zip_size_bytes","error_kind","error_code"]};function Gtn(e){return typeof e=="string"||typeof e=="number"&&Number.isFinite(e)}function xle(e,t){const n=new Set([...Wtn,...Ktn[e]]),i={};for(const[r,s]of Object.entries(t))!n.has(r)||!Gtn(s)||(typeof s=="string"?i[r]=l7e(s,r==="error_message"?o7e:Vtn):i[r]=s);return i}function Xtn(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`}function Ytn(){return typeof performance<"u"?performance.now():Date.now()}function Y0(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}class Ztn{constructor(t){Zt(this,"sink");Zt(this,"createId");Zt(this,"now");Zt(this,"pageInstanceId");Zt(this,"context");Zt(this,"identity");Zt(this,"entryViewed",!1);Zt(this,"sessionStarted",!1);this.sink=t.sink,this.createId=t.createId??Xtn,this.now=t.now??Ytn,this.pageInstanceId=this.createId()}setContext(t){var n,i;this.context={...t,accountId:((n=t.accountId)==null?void 0:n.trim())??"",accountIdResolutionError:((i=t.accountIdResolutionError)==null?void 0:i.trim())??""}}identify(t){var i,r,s;const n=t.userUniqueId.trim();n&&(this.identity&&this.identity.userUniqueId!==n&&(this.pageInstanceId=this.createId(),this.sessionStarted=!1),this.identity={...t,userUniqueId:n,accountId:((i=t.accountId)==null?void 0:i.trim())??""},(s=(r=this.sink).identify)==null||s.call(r,n))}trackStudioSessionStarted(t){this.sessionStarted||!this.context||!this.identity||(this.sessionStarted=!0,this.emit("studio_session_started",{agents_source:t.agentsSource}))}trackStudioEntryViewed(t){if(this.entryViewed||!this.context)return;this.entryViewed=!0;const n=xle("studio_entry_viewed",Y0({schema_version:vle,event_id:this.createId(),user_pool_id:this.context.userPoolId,studio_deploy_id:this.context.studioDeployId,vefaas_application_id:this.context.applicationId,vefaas_function_id:this.context.functionId,studio_region:this.context.studioRegion,studio_project:this.context.studioProject,studio_version:this.context.studioVersion,environment:this.context.environment,cloud_provider:this.context.cloudProvider,account_id:this.context.accountId,account_id_resolution_error:this.context.accountIdResolutionError||void 0,page_instance_id:this.pageInstanceId,auth_state:t.authState}));this.sink.emit("studio_entry_viewed",n)}beginAgentDeploy(t){return this.beginOperation("studio_agent_deploy",{agent_id:t.agentId,deploy_action:t.deployAction,deploy_source:t.deploySource,create_mode:t.createMode,ai_assisted:t.aiAssisted,deploy_region:t.deployRegion,runtime_network_type:t.runtimeNetworkType,feishu_enabled:t.feishuEnabled},n=>({runtime_id:n.runtimeId}),n=>({failed_phase:n.failedPhase,error_kind:n.errorKind,error_code:n.errorCode,error_message:n.errorMessage}))}beginSandboxCreate(t){return this.beginOperation("studio_sandbox_create",{sandbox_kind:t.sandboxKind,sandbox_source:t.sandboxSource},n=>({sandbox_id:n.sandboxId}),n=>({error_kind:n.errorKind,error_code:n.errorCode}))}beginAgentDebug(t){return this.beginOperation("studio_agent_debug",{agent_id:t.agentId,variant_type:t.variantType},n=>({debug_run_id:n.debugRunId}),n=>({failed_phase:n.failedPhase,error_kind:n.errorKind,error_code:n.errorCode}))}beginAgentConnect(t){return this.beginOperation("studio_agent_connect",{target_id:t.targetId,agent_kind:t.agentKind,connect_source:t.connectSource},n=>Y0({runtime_region:n.runtimeRegion,runtime_is_mine:n.runtimeIsMine,sandbox_status:n.sandboxStatus}),n=>Y0({error_kind:n.errorKind,error_code:n.errorCode}))}beginAgentMessage(t){return this.beginOperation("studio_agent_message",Y0({agent_id:t.agentId,agent_kind:t.agentKind,message_source:t.messageSource,session_state:t.sessionState,session_id:t.sessionId}),n=>({session_id:n.sessionId}),n=>Y0({session_id:n.sessionId,failed_phase:n.failedPhase,error_kind:n.errorKind,error_code:n.errorCode}))}beginAgentSourceDownload(t){return this.beginOperation("studio_agent_source_download",{agent_id:t.agentId,deploy_action:t.deployAction,deploy_source:t.deploySource,create_mode:t.createMode,ai_assisted:t.aiAssisted},n=>({file_count:n.fileCount,zip_size_bytes:n.zipSizeBytes}),n=>({file_count:n.fileCount,error_kind:n.errorKind,error_code:n.errorCode}))}beginOperation(t,n,i,r){const s=this.createId(),o=this.now(),l=!!(this.context&&this.identity);let c=!1;l&&this.emit(t,{...n,status:"started"},s);const u=(d,f)=>{c||(c=!0,l&&this.emit(t,{...n,...f,status:d,duration_ms:Math.max(0,this.now()-o)},s))};return{operationId:s,succeed:d=>u("succeeded",i(d)),fail:d=>u("failed",r(d))}}emit(t,n,i){if(!this.context||!this.identity)return;const r=xle(t,Y0({schema_version:vle,event_id:this.createId(),operation_id:i,user_pool_id:this.context.userPoolId,studio_deploy_id:this.context.studioDeployId,vefaas_application_id:this.context.applicationId,vefaas_function_id:this.context.functionId,studio_region:this.context.studioRegion,studio_project:this.context.studioProject,studio_version:this.context.studioVersion,environment:this.context.environment,cloud_provider:this.context.cloudProvider,account_id:this.identity.accountId,account_id_resolution_error:this.context.accountIdResolutionError||void 0,user_role:this.identity.userRole,user_source:this.identity.userSource,page_instance_id:this.pageInstanceId,...n}));this.sink.emit(t,r)}}const c7e=new ztn,Fh=new Ztn({sink:c7e});function Jtn(e){return c7e.init(e)}function enn(e){Fh.setContext(e)}function tnn(e){Fh.identify(e)}function nnn(e){Fh.trackStudioEntryViewed(e)}function inn(e){Fh.trackStudioSessionStarted(e)}function u7e(e){return Fh.beginAgentDeploy(e)}function rnn(e){return Fh.beginSandboxCreate(e)}function snn(e){return Fh.beginAgentDebug(e)}function Aj(e){return Fh.beginAgentConnect(e)}function wle(e){return Fh.beginAgentMessage(e)}function d7e(e){return Fh.beginAgentSourceDownload(e)}const ann=/^[A-Za-z_][A-Za-z0-9_]*$/;function ZT(e,t=n=>Yt(`validation.agentName.${n}`)){return e.trim().length===0?t("required"):e==="user"?t("reserved"):ann.test(e)?null:t("characters")}function onn(e){const t=new Set,n=new Set,i=r=>{ZT(r.name)===null&&(t.has(r.name)?n.add(r.name):t.add(r.name)),r.subAgents.forEach(i)};return i(e),n}function lnn(e){return{...Sd(),name:e,description:_h("feishu.generatedAgent.description"),instruction:_h("feishu.generatedAgent.instruction"),deployment:{feishuEnabled:!0}}}async function cnn(e){const t=lnn(e.agentName),n=await iE(t);return Lv(n.name,n.files,{region:e.region,projectName:"default"},{taskId:e.taskId,sessionStorage:"in-memory",minInstance:1,maxInstance:1,description:t.description,im:{feishu:{enabled:!0}},envs:[{key:"FEISHU_APP_ID",value:e.appId},{key:"FEISHU_APP_SECRET",value:e.appSecret}],onStage:e.onStage})}const Hf=["cn-beijing","cn-shanghai"],f7e=["prepare","build","deploy","publish"];function unn(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m9.8 3.5-4.5 4.5 4.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function dnn(e){return a.jsx("svg",{viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m5 7 4 4 4-4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function kle(e){return a.jsx("svg",{viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m4 9.2 3.1 3.1L14 5.8",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})})}function fnn(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M6.5 4H4.8A1.8 1.8 0 0 0 3 5.8v5.4A1.8 1.8 0 0 0 4.8 13h5.4a1.8 1.8 0 0 0 1.8-1.8V9.5M9 3h4v4M12.5 3.5 7.2 8.8",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function hnn(e){if(!e||e==="upload")return 0;const t=f7e.findIndex(n=>n===e);return t<0?0:t}function O6(e){switch(e){case"prepare":case"upload":case"build":case"deploy":case"publish":case"update":case"evaluation":return e;default:return"unknown"}}function Ole(e){const t=ZT(e,n=>n);return t?`feishu.validation.agentName.${t}`:""}function pnn({onBack:e}){const{t}=_e("automations"),[n,i]=p.useState("feishu_assistant"),[r,s]=p.useState(""),[o,l]=p.useState(""),[c,u]=p.useState(!1),[d,f]=p.useState("cn-beijing"),[h,m]=p.useState(!1),[g,b]=p.useState(""),[v,y]=p.useState(""),[w,x]=p.useState(""),[k,S]=p.useState("idle"),[O,A]=p.useState(null),[E,j]=p.useState(""),[T,R]=p.useState(null),C=p.useRef(null),N=p.useRef(null),P=p.useRef([]),I=p.useRef(0),D=p.useRef(null),_=p.useRef(null),L=p.useRef("prepare"),F=p.useRef(!1),M=p.useRef(!0),H=["preparing","running","cancelling"].includes(k);p.useEffect(()=>(M.current=!0,()=>{M.current=!1}),[]),p.useEffect(()=>{var V;if(!h)return;(V=P.current[I.current])==null||V.focus();const X=Y=>{Y.target instanceof Node&&C.current&&!C.current.contains(Y.target)&&m(!1)},le=Y=>{var K;Y.key==="Escape"&&(m(!1),(K=N.current)==null||K.focus())};return window.addEventListener("pointerdown",X),window.addEventListener("keydown",le),()=>{window.removeEventListener("pointerdown",X),window.removeEventListener("keydown",le)}},[h]);const q=X=>{X.key==="Enter"&&(X.nativeEvent.isComposing||X.nativeEvent.keyCode===229)&&X.preventDefault()},U=()=>{const X=Ole(n.trim()),le=r.trim()?"":"feishu.validation.appId",V=o.trim()?"":"feishu.validation.appSecret";return b(X),y(le),x(V),!X&&!le&&!V},Z=async X=>{if(X.preventDefault(),!U()||H)return;const le=crypto.randomUUID();D.current=le,L.current="prepare",F.current=!1,S("preparing"),A(null),j(""),R(null);const V=u7e({agentId:String(n.trim()),deployAction:"create",deploySource:"feishu_automation",createMode:"feishu_template",aiAssisted:0,deployRegion:String(d),runtimeNetworkType:"public",feishuEnabled:1});_.current=V;try{const Y=await cnn({agentName:n.trim(),appId:r.trim(),appSecret:o.trim(),region:d,taskId:le,onStage:K=>{L.current=K.phase||"deploy",!(!M.current||F.current)&&(S("running"),A(K))}});if(F.current){V.fail({failedPhase:O6(L.current),errorKind:"abort",errorMessage:Dy("User cancelled deployment")});return}if(V.succeed({runtimeId:String(Y.runtimeId||"")}),!M.current)return;R(Y),l(""),u(!1),S("succeeded")}catch(Y){if(V.fail({failedPhase:O6(L.current),...F.current?{errorKind:"abort"}:Jo(Y,{phase:L.current}),errorMessage:Dy(Y)}),!M.current||F.current)return;S("failed"),j(Y instanceof Error?Y.message:String(Y))}finally{D.current===le&&(D.current=null),_.current===V&&(_.current=null)}},z=async()=>{var le;const X=D.current;if(!(!X||k!=="running")&&window.confirm(t("feishu.confirmCancel"))){F.current=!0,S("cancelling"),j("");try{await u2e(X),(le=_.current)==null||le.fail({failedPhase:O6(L.current),errorKind:"abort",errorMessage:Dy("User cancelled deployment")}),M.current&&S("cancelled")}catch(V){if(F.current=!1,!M.current)return;S("failed"),j(V instanceof Error?V.message:String(V))}}},J=hnn((O==null?void 0:O.phase)??null),ne=!!(n.trim()&&r.trim()&&o.trim()&&!H),W=t(`feishu.regions.${d}`);return a.jsxs("div",{className:"feishu-integration-page",children:[a.jsxs("header",{className:"feishu-integration-header",children:[a.jsx("button",{type:"button",className:"feishu-back",onClick:e,"aria-label":t("backToAutomations"),disabled:H,children:a.jsx(unn,{})}),a.jsx("img",{className:"feishu-integration-logo",src:PL,alt:"","aria-hidden":"true"}),a.jsxs("div",{children:[a.jsx("h1",{children:t("feishu.title")}),a.jsx("p",{children:t("feishu.description")})]})]}),a.jsx("div",{className:"feishu-integration-layout",children:a.jsxs("section",{className:"feishu-section-panel",children:[a.jsx("p",{className:"feishu-panel-description",children:t("feishu.panel")}),a.jsxs("form",{className:"feishu-form",onSubmit:Z,onKeyDown:q,noValidate:!0,children:[a.jsxs("div",{className:"feishu-field-grid",children:[a.jsxs("div",{className:"feishu-field",children:[a.jsx("label",{htmlFor:"feishu-agent-name",children:t("feishu.agentName")}),a.jsx("input",{id:"feishu-agent-name",value:n,maxLength:64,disabled:H,onChange:X=>{i(X.target.value),g&&b("")},onBlur:()=>b(Ole(n.trim())),"aria-invalid":!!g,"aria-describedby":`feishu-agent-name-help${g?" feishu-agent-name-error":""}`}),a.jsx("span",{id:"feishu-agent-name-help",className:"feishu-field-help",children:t("feishu.agentNameHelp")}),g?a.jsx("span",{id:"feishu-agent-name-error",className:"feishu-field-error",role:"alert",children:t(g)}):null]}),a.jsxs("div",{className:"feishu-field",children:[a.jsx("label",{id:"feishu-region-label",children:t("feishu.region")}),a.jsxs("div",{className:"feishu-region-picker",ref:C,children:[a.jsxs("button",{ref:N,type:"button",className:"feishu-region-trigger",disabled:H,"aria-haspopup":"listbox","aria-expanded":h,"aria-labelledby":"feishu-region-label feishu-region-value",onClick:()=>{I.current=Hf.findIndex(X=>X===d),m(X=>!X)},onKeyDown:X=>{X.key!=="ArrowDown"&&X.key!=="ArrowUp"||(X.preventDefault(),I.current=X.key==="ArrowUp"?Hf.length-1:Hf.findIndex(le=>le===d),m(!0))},children:[a.jsx("span",{id:"feishu-region-value",children:W}),a.jsx(dnn,{})]}),h?a.jsx("div",{className:"feishu-region-menu",role:"listbox","aria-label":t("feishu.region"),onKeyDown:X=>{var Y;const le=P.current.findIndex(K=>K===document.activeElement);let V=null;X.key==="ArrowDown"?V=(le+1)%Hf.length:X.key==="ArrowUp"?V=(le-1+Hf.length)%Hf.length:X.key==="Home"?V=0:X.key==="End"?V=Hf.length-1:X.key==="Tab"&&m(!1),V!==null&&(X.preventDefault(),(Y=P.current[V])==null||Y.focus())},children:Hf.map(X=>a.jsx("button",{ref:le=>{const V=Hf.findIndex(Y=>Y===X);P.current[V]=le},type:"button",role:"option","aria-selected":d===X,className:`feishu-region-option${d===X?" is-selected":""}`,onClick:()=>{var le;f(X),m(!1),(le=N.current)==null||le.focus()},children:t(`feishu.regions.${X}`)},X))}):null]}),a.jsx("span",{className:"feishu-field-help",children:t("feishu.regionHelp")})]}),a.jsxs("div",{className:"feishu-field",children:[a.jsx("label",{htmlFor:"feishu-app-id",children:t("feishu.appId")}),a.jsx("input",{id:"feishu-app-id",value:r,maxLength:128,autoComplete:"off",disabled:H,placeholder:"cli_xxxxxxxxxxxxxxxx",onChange:X=>{s(X.target.value),v&&y("")},onBlur:()=>y(r.trim()?"":"feishu.validation.appId"),"aria-invalid":!!v,"aria-describedby":`feishu-app-id-help${v?" feishu-app-id-error":""}`}),a.jsx("span",{id:"feishu-app-id-help",className:"feishu-field-help",children:t("feishu.appIdHelp")}),v?a.jsx("span",{id:"feishu-app-id-error",className:"feishu-field-error",role:"alert",children:t(v)}):null]}),a.jsxs("div",{className:"feishu-field",children:[a.jsx("label",{htmlFor:"feishu-app-secret",children:t("feishu.appSecret")}),a.jsxs("div",{className:"feishu-secret-input",children:[a.jsx("input",{id:"feishu-app-secret",type:c?"text":"password",value:o,maxLength:256,autoComplete:"off",disabled:H,placeholder:t("feishu.appSecretPlaceholder"),onChange:X=>{l(X.target.value),w&&x("")},onBlur:()=>x(o.trim()?"":"feishu.validation.appSecret"),"aria-invalid":!!w,"aria-describedby":`feishu-app-secret-help${w?" feishu-app-secret-error":""}`}),a.jsx("button",{type:"button",disabled:H,onClick:()=>u(X=>!X),"aria-label":t(c?"feishu.hideSecret":"feishu.showSecret"),children:t(c?"feishu.hide":"feishu.show")})]}),a.jsx("span",{id:"feishu-app-secret-help",className:"feishu-field-help",children:t("feishu.appSecretHelp")}),w?a.jsx("span",{id:"feishu-app-secret-error",className:"feishu-field-error",role:"alert",children:t(w)}):null]})]}),k!=="idle"?a.jsxs("div",{className:`feishu-deployment-status is-${k}`,role:k==="failed"?"alert":"status",children:[a.jsxs("div",{className:"feishu-deployment-heading",children:[k==="preparing"?a.jsx(on,{as:"strong",children:t("feishu.status.preparing")}):null,k==="running"?a.jsx(on,{as:"strong",children:O?hL(O):t("feishu.status.running")}):null,k==="cancelling"?a.jsx(on,{as:"strong",children:t("feishu.status.cancelling")}):null,k==="succeeded"?a.jsxs("strong",{children:[a.jsx(kle,{}),t("feishu.status.succeeded")]}):null,k==="cancelled"?a.jsx("strong",{children:t("feishu.status.cancelled")}):null,k==="failed"?a.jsx("strong",{children:t("feishu.status.failed")}):null]}),k==="preparing"||k==="running"||k==="cancelling"?a.jsx("ol",{className:"feishu-deployment-steps",children:f7e.map((X,le)=>{const V=k==="running"&&levoid z(),children:t("feishu.cancelDeployment")}):null,a.jsx("button",{type:"submit",className:"feishu-submit",disabled:!ne,children:t(H?"feishu.creating":"feishu.create")})]})]})]})]})})]})}async function NK(e,t,n,i=eo){var s;const r=await yn(e,{...t,headers:{accept:"application/json",...t.headers},signal:n},i);if(!r.ok){let o="";try{o=((s=(await r.json()).detail)==null?void 0:s.trim())||""}catch{}throw new Error(o||Q("common.requestFailed",{status:r.status}))}return r.json()}function mnn(e){return NK("/web/coding-agents/capabilities",{method:"GET"},e,mz)}function gnn(e,t){return NK(`/web/coding-agents/skills/${encodeURIComponent(e)}/preview`,{method:"GET"},t)}function bnn(e,t){return NK("/web/coding-agents/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)},t)}const ynn="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='16'%20height='16'%20rx='3.692'%20fill='%231A1B1D'/%3e%3cpath%20d='M13.235%205.829V4.332H2.758v5.987h1.496v1.496h8.981V5.828Zm-1.497%204.49H4.254V5.83h7.484v4.49Z'%20fill='%2332F08C'/%3e%3cpath%20d='M6.937%206.993%205.88%208.051%206.937%209.11%207.995%208.05%206.937%206.993ZM9.931%206.992%208.873%208.05%209.931%209.11%2010.99%208.05%209.93%206.992Z'%20fill='%2332F08C'/%3e%3c/svg%3e";function vnn(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m4 4 8 8m0-8-8 8",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function Sle(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[a.jsx("path",{d:"M4 1.8h5l3 3V14H4z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),a.jsx("path",{d:"M9 1.8V5h3M6 8h4M6 10.5h4",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function Ele(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M1.8 4.5h4l1.2-1.3h2.2l1.2 1.3h3.8v8H1.8z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})})}function xnn(e){return e instanceof DOMException&&e.name==="AbortError"}function wnn(e){return e instanceof Error&&e.message?e.message:""}function knn(e){return e<1024?`${e} B`:`${(e/1024).toFixed(e<10*1024?1:0)} KB`}function Onn(e){const t=e.split("/");return t[t.length-1]??e}function Snn(e){const t=new Map;for(const n of e){const i=n.path.split("/"),r=i.length>1?i.slice(0,-1).join("/"):"";t.set(r,[...t.get(r)??[],n])}return Array.from(t,([n,i])=>({directory:n,files:i})).sort((n,i)=>n.directory?i.directory?n.directory.localeCompare(i.directory):1:-1)}function Enn({skill:e,onClose:t}){const{t:n}=_e("automations"),i=p.useRef(null),r=p.useRef(null),s=p.useId(),o=p.useId(),[l,c]=p.useState(null),[u,d]=p.useState(""),[f,h]=p.useState(!0),[m,g]=p.useState(""),[b,v]=p.useState(0);p.useEffect(()=>{r.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const k=i.current;return k&&!k.open&&k.showModal(),()=>{var S;k!=null&&k.open&&k.close(),(S=r.current)==null||S.focus()}},[]),p.useEffect(()=>{const k=new AbortController;return h(!0),g(""),c(null),d(""),gnn(e.id,k.signal).then(S=>{if(k.signal.aborted)return;c(S);const O=S.files.find(A=>A.path==="SKILL.md")??S.files[0];d((O==null?void 0:O.path)??"")}).catch(S=>{!k.signal.aborted&&!xnn(S)&&g(wnn(S))}).finally(()=>{k.signal.aborted||h(!1)}),()=>k.abort()},[b,e.id]);const y=p.useMemo(()=>Snn((l==null?void 0:l.files)??[]),[l]),w=(l==null?void 0:l.files.find(k=>k.path===u))??null,x=n(`codingAgents.skills.items.${e.id}.name`,{defaultValue:e.name});return a.jsxs("dialog",{ref:i,className:"coding-agents-preview-dialog","aria-labelledby":s,"aria-describedby":o,onCancel:k=>{k.preventDefault(),t()},onMouseDown:k=>{const S=k.currentTarget.getBoundingClientRect();(k.clientXS.right||k.clientYS.bottom)&&t()},children:[a.jsxs("header",{className:"coding-agents-preview-header",children:[a.jsx("span",{className:"coding-agents-preview-mark",children:a.jsx(Ele,{})}),a.jsxs("div",{children:[a.jsx("h2",{id:s,children:x}),a.jsx("p",{id:o,children:n("codingAgents.preview.description")})]}),a.jsx("button",{type:"button",autoFocus:!0,"aria-label":n("codingAgents.preview.close"),onClick:t,children:a.jsx(vnn,{})})]}),f?a.jsxs("div",{className:"coding-agents-preview-state",children:[a.jsx("i",{}),n("codingAgents.preview.loading")]}):m?a.jsxs("div",{className:"coding-agents-preview-state is-error",role:"alert",children:[a.jsx("span",{children:m||n("codingAgents.preview.error")}),a.jsx("button",{type:"button",onClick:()=>v(k=>k+1),children:n("codingAgents.retry")})]}):a.jsxs("div",{className:"coding-agents-preview-layout",children:[a.jsxs("nav",{className:"coding-agents-preview-tree","aria-label":n("codingAgents.preview.skillFiles",{name:x}),children:[a.jsxs("div",{className:"coding-agents-preview-tree-title",children:[a.jsx("span",{children:n("codingAgents.preview.files")}),a.jsx("small",{children:(l==null?void 0:l.files.length)??0})]}),a.jsx("div",{className:"coding-agents-preview-tree-scroll",children:y.map(k=>k.directory?a.jsxs("details",{open:!0,children:[a.jsxs("summary",{children:[a.jsx(Ele,{}),a.jsx("span",{children:k.directory})]}),a.jsx("div",{children:k.files.map(S=>a.jsxs("button",{type:"button",className:u===S.path?"is-selected":"","aria-current":u===S.path?"true":void 0,onClick:()=>d(S.path),children:[a.jsx(Sle,{}),a.jsx("span",{children:Onn(S.path)})]},S.path))})]},k.directory):k.files.map(S=>a.jsxs("button",{type:"button",className:u===S.path?"is-selected":"","aria-current":u===S.path?"true":void 0,onClick:()=>d(S.path),children:[a.jsx(Sle,{}),a.jsx("span",{children:S.path})]},S.path)))})]}),a.jsx("section",{className:"coding-agents-preview-file","aria-label":n("codingAgents.preview.fileContent"),children:w?a.jsxs(a.Fragment,{children:[a.jsxs("header",{children:[a.jsx("strong",{children:w.path}),a.jsx("span",{children:knn(w.size)})]}),w.previewable&&w.content!==null?a.jsx("pre",{tabIndex:0,children:a.jsx("code",{children:w.content})}):a.jsx("div",{className:"coding-agents-preview-unavailable",children:n("codingAgents.preview.notPreviewable")})]}):a.jsx("div",{className:"coding-agents-preview-unavailable",children:n("codingAgents.preview.noFiles")})})]})]})}function Cnn(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m9.8 3.5-4.5 4.5 4.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ann(e){return a.jsxs("svg",{viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"5",width:"16",height:"16",rx:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),a.jsx("path",{d:"m8.5 11-2.4 2.4 2.4 2.4M11 16.5h3.8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),a.jsx("circle",{cx:"24.5",cy:"10.5",r:"2.5",stroke:"currentColor",strokeWidth:"1.5"}),a.jsx("circle",{cx:"24.5",cy:"24.5",r:"2.5",stroke:"currentColor",strokeWidth:"1.5"}),a.jsx("path",{d:"M19.5 10.5H22M18.2 19l4.3 3.7M24.5 13v9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function Tnn(e){return a.jsx("svg",{viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",...e,children:a.jsxs("g",{stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",children:[a.jsx("path",{d:"M16 4.5v7M16 20.5v7"}),a.jsx("path",{d:"m9.3 6.3 3.5 6.1M19.2 19.6l3.5 6.1"}),a.jsx("path",{d:"m5.9 11.1 6.2 3.5M19.9 17.4l6.2 3.5"}),a.jsx("path",{d:"M4.7 16h7M20.3 16h7"}),a.jsx("path",{d:"m5.9 20.9 6.2-3.5M19.9 14.6l6.2-3.5"}),a.jsx("path",{d:"m9.3 25.7 3.5-6.1M19.2 12.4l3.5-6.1"})]})})}function _nn(e){return a.jsxs("svg",{viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M15.8 4.2c2.4 0 4.5 1.2 5.7 3.1 2.2-.3 4.5.8 5.6 2.9 1.1 2 .8 4.4-.5 6.1 1.2 1.8 1.3 4.3.1 6.2-1.2 2-3.4 3-5.6 2.6-1.3 1.8-3.5 2.9-5.8 2.7-2.2-.2-4.1-1.5-5.1-3.4-2.2.1-4.4-1-5.4-3.1-1-2-.6-4.4.8-6.1-1.1-1.9-1.1-4.3.2-6.1 1.3-1.9 3.6-2.7 5.7-2.2 1.1-1.7 2.6-2.7 4.3-2.7Z",stroke:"currentColor",strokeWidth:"1.7",strokeLinejoin:"round"}),a.jsx("path",{d:"m10.7 12.2 3.1 3.8-3.1 3.8M17.1 20h4.3",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Cle(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m3.4 8.2 3 3L12.8 5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function jnn(e){return a.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M2.8 6.3h14.4v8.3a1.6 1.6 0 0 1-1.6 1.6H4.4a1.6 1.6 0 0 1-1.6-1.6V6.3Z",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"}),a.jsx("path",{d:"M2.8 6.3V5.1a1.4 1.4 0 0 1 1.4-1.4h3.4l1.5 1.6h6.5a1.6 1.6 0 0 1 1.6 1.6",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"})]})}function Nnn({agentId:e}){return e==="trae"?a.jsx("img",{src:ynn,alt:"","aria-hidden":"true"}):e==="claude-code"?a.jsx(Tnn,{}):a.jsx(_nn,{})}function Ale(e){return e instanceof DOMException&&e.name==="AbortError"}function Tle(e,t){return e instanceof Error&&e.message?e.message:t}function Rnn({onBack:e}){var R;const{t}=_e("automations"),[n,i]=p.useState(null),[r,s]=p.useState(!0),[o,l]=p.useState(null),[c,u]=p.useState(0),[d,f]=p.useState(new Set),[h,m]=p.useState(new Set),[g,b]=p.useState(null),[v,y]=p.useState(!1),[w,x]=p.useState(null),k=p.useRef(null);p.useEffect(()=>{const C=new AbortController;return s(!0),l(null),mnn(C.signal).then(N=>{if(C.signal.aborted)return;i(N);const P=N.agents.filter(I=>I.available);f(I=>{const D=P.filter(_=>I.has(_.id));return new Set((D.length?D:P.slice(0,1)).map(_=>_.id))}),m(I=>{const D=N.skills.filter(_=>I.has(_.id));return new Set((D.length?D:N.skills).map(_=>_.id))})}).catch(N=>{!Ale(N)&&!C.signal.aborted&&(i(null),l(Tle(N,"")))}).finally(()=>{C.signal.aborted||s(!1)}),()=>C.abort()},[c]),p.useEffect(()=>()=>{var C;return(C=k.current)==null?void 0:C.abort()},[]);const S=p.useMemo(()=>(n==null?void 0:n.agents.filter(C=>C.available&&d.has(C.id)))||[],[n,d]),O=p.useMemo(()=>(n==null?void 0:n.skills.filter(C=>h.has(C.id)))||[],[n,h]),A=!!(!v&&S.length&&O.length),E=(C,N)=>{!N||v||(x(null),f(P=>{const I=new Set(P);return I.has(C)?I.delete(C):I.add(C),I}))},j=C=>{v||(x(null),m(N=>{const P=new Set(N);return P.has(C)?P.delete(C):P.add(C),P}))},T=async()=>{var N;if(!A)return;(N=k.current)==null||N.abort();const C=new AbortController;k.current=C,y(!0),x(null);try{const P=await bnn({agents:S.map(D=>D.id),skills:O.map(D=>D.id)},C.signal);if(C.signal.aborted)return;const I=P.installations;x({tone:"success",agentCount:S.length,skillCount:O.length,installations:I})}catch(P){!Ale(P)&&!C.signal.aborted&&x({tone:"error",message:Tle(P,"")})}finally{k.current===C&&(k.current=null),C.signal.aborted||y(!1)}};return a.jsxs("section",{className:"coding-agents-page",children:[a.jsxs("header",{className:"coding-agents-header",children:[a.jsx("button",{type:"button",className:"coding-agents-back",onClick:e,disabled:v,"aria-label":t("backToAutomations"),children:a.jsx(Cnn,{})}),a.jsx(Ann,{className:"coding-agents-logo"}),a.jsxs("div",{children:[a.jsx("h1",{children:t("codingAgents.title")}),a.jsx("p",{children:t("codingAgents.description")})]})]}),a.jsx("div",{className:"coding-agents-scroll",children:a.jsxs("div",{className:"coding-agents-content",children:[a.jsxs("section",{className:"coding-agents-section","aria-label":t("codingAgents.clients.ariaLabel"),children:[a.jsxs("div",{className:"coding-agents-section-heading",children:[a.jsxs("div",{children:[a.jsx("span",{children:"1"}),a.jsx("h2",{children:t("codingAgents.clients.title")})]}),a.jsx("button",{type:"button",onClick:()=>u(C=>C+1),disabled:r||v,children:t("codingAgents.clients.detectAgain")})]}),r?a.jsxs("div",{className:"coding-agents-inline-state",children:[a.jsx("i",{}),t("codingAgents.clients.detecting")]}):o!==null?a.jsxs("div",{className:"coding-agents-error-row",role:"alert",children:[a.jsx("span",{children:o||t("codingAgents.errors.detect")}),a.jsx("button",{type:"button",onClick:()=>u(C=>C+1),children:t("codingAgents.retry")})]}):a.jsx("div",{className:"coding-agents-agent-grid",children:n==null?void 0:n.agents.map(C=>a.jsxs("button",{type:"button",className:`coding-agents-agent ${d.has(C.id)?"is-selected":""}`,"aria-pressed":d.has(C.id),disabled:!C.available||v,onClick:()=>E(C.id,C.available),title:C.available?C.name:C.reason,children:[a.jsx("span",{className:`coding-agents-agent-mark is-${C.id}`,children:a.jsx(Nnn,{agentId:C.id})}),a.jsxs("span",{className:"coding-agents-agent-copy",children:[a.jsx("strong",{children:C.name}),a.jsx("small",{children:C.available?C.version||t("codingAgents.clients.detected"):C.reason})]}),a.jsx("span",{className:`coding-agents-status ${C.available?"is-ready":""}`,children:C.available?t("codingAgents.clients.available"):t("codingAgents.clients.unavailable")}),a.jsx("span",{className:"coding-agents-check",children:a.jsx(Cle,{})})]},C.id))})]}),a.jsxs("section",{className:"coding-agents-section","aria-label":t("codingAgents.skills.ariaLabel"),children:[a.jsx("div",{className:"coding-agents-section-heading",children:a.jsxs("div",{children:[a.jsx("span",{children:"2"}),a.jsx("h2",{children:t("codingAgents.skills.title")})]})}),a.jsx("div",{className:"coding-agents-skill-list",children:n==null?void 0:n.skills.map(C=>a.jsxs("div",{className:`coding-agents-skill ${h.has(C.id)?"is-selected":""}`,children:[a.jsxs("label",{children:[a.jsx("input",{type:"checkbox",checked:h.has(C.id),onChange:()=>j(C.id),disabled:v}),a.jsx("span",{className:"coding-agents-skill-check","aria-hidden":"true",children:a.jsx(Cle,{})}),a.jsxs("span",{children:[a.jsx("strong",{children:t(`codingAgents.skills.items.${C.id}.name`,{defaultValue:C.name})}),a.jsx("small",{children:t(`codingAgents.skills.items.${C.id}.description`,{defaultValue:C.description})})]})]}),a.jsx("button",{type:"button",onClick:()=>b(C),children:t("codingAgents.skills.viewFiles")})]},C.id))}),a.jsxs("div",{className:"coding-agents-global","aria-label":t("codingAgents.global.ariaLabel"),children:[a.jsxs("div",{className:"coding-agents-global-heading",children:[a.jsx(jnn,{}),a.jsxs("div",{children:[a.jsx("strong",{children:t("codingAgents.global.title")}),a.jsx("span",{children:t("codingAgents.global.description")})]})]}),S.length?a.jsx("dl",{children:S.map(C=>a.jsxs("div",{children:[a.jsx("dt",{children:C.name}),a.jsx("dd",{children:C.globalSkillsPath})]},C.id))}):a.jsx("p",{children:t("codingAgents.global.empty")})]})]}),w?a.jsxs("div",{className:`coding-agents-result is-${w.tone}`,role:w.tone==="error"?"alert":"status",children:[a.jsx("strong",{children:w.tone==="success"?t("codingAgents.success",{agentCount:w.agentCount,skillCount:w.skillCount}):w.message||t("codingAgents.errors.configure")}),(R=w.installations)!=null&&R.length?a.jsx("ul",{children:w.installations.map(C=>a.jsxs("li",{children:[C.agentName," · ",t(`codingAgents.skills.items.${C.skillId}.name`,{defaultValue:C.skill})," → ",C.displayPath]},`${C.agent}:${C.skillId}`))}):null]}):null,a.jsxs("div",{className:"coding-agents-actions",children:[a.jsx("span",{children:S.length?t("codingAgents.selection",{agentCount:S.length,skillCount:O.length}):t("codingAgents.selectClient")}),a.jsx("button",{type:"button",onClick:()=>void T(),disabled:!A,children:t(v?"codingAgents.configuring":"codingAgents.configure")})]})]})}),g?a.jsx(Enn,{skill:g,onClose:()=>b(null)}):null]})}function Inn(e){return a.jsxs("span",{className:"studio-radio__control",children:[a.jsx("input",{...e,className:"studio-radio__input",type:"radio"}),a.jsx("span",{className:"studio-radio__box","aria-hidden":"true",children:a.jsx("span",{className:"studio-radio__dot"})})]})}function Pnn({label:e,className:t="",...n}){return a.jsxs("label",{className:`studio-radio ${t}`.trim(),children:[a.jsx(Inn,{...n}),e!=null&&a.jsx("span",{className:"studio-radio__label",children:e})]})}const UO={QR_CODE_READY:"QR_CODE_READY",AUTH_SUCCESS:"AUTH_SUCCESS",AUTH_ERROR:"AUTH_ERROR",AUTH_CANCEL:"AUTH_CANCEL",WINDOW_CLOSE:"WINDOW_CLOSE"},_le={WINDOW_BLOCKED:"WINDOW_BLOCKED",CANCELLED:"CANCELLED"},Dnn={authOrigin:"https://work.weixin.qq.com",width:950,height:640,debug:!1},Mnn=500;class Lnn{constructor(){this.handlers=new Map}on(t,n){const i=this.handlers.get(t)||[];return i.push(n),this.handlers.set(t,i),this}off(t,n){if(!n)return this.handlers.delete(t),this;const i=this.handlers.get(t);if(i){const r=i.filter(s=>s!==n);r.length>0?this.handlers.set(t,r):this.handlers.delete(t)}return this}emit(t,...n){const i=this.handlers.get(t);i&&i.forEach(r=>{try{r(...n)}catch(s){console.error(`[WecomAIBotSDK] Event handler error for "${t}":`,s)}})}removeAll(){this.handlers.clear()}listenerCount(t){var n,i;return(i=(n=this.handlers.get(t))===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0}}class h7e{constructor(){this.authWindow=null,this.pollingTimer=null,this.messageListener=null,this.config={...Dnn},this.emitter=new Lnn,this.setupMessageListener()}openBotInfoAuthWindow(t){var n;this.validateOptions(t),this.mergeConfig(t);const i=t.state||this.generateState(),r=this.buildAuthUrl(t.source,i),s=this.buildWindowFeatures();if(this.authWindow=window.open(r,"WecomAIBotAuthWindow",s),!this.authWindow){const o={code:_le.WINDOW_BLOCKED,message:"弹窗被拦截,请允许弹窗或点击手动打开"};return this.emitter.emit("error",o),(n=t.onError)===null||n===void 0||n.call(t,o),Promise.reject(o)}return this.startPolling(),new Promise((o,l)=>{const c=()=>{this.emitter.off("success",u),this.emitter.off("error",d),this.emitter.off("cancel",f)},u=h=>{c(),o(h)},d=h=>{c(),l(h)},f=()=>{c(),l({code:_le.CANCELLED,message:"用户取消授权"})};this.emitter.on("success",u),this.emitter.on("error",d),this.emitter.on("cancel",f),t.onCreated&&this.emitter.on("success",t.onCreated),t.onError&&this.emitter.on("error",t.onError)})}closeWindow(){this.authWindow&&!this.authWindow.closed&&this.authWindow.close(),this.authWindow=null,this.stopPolling()}destroy(){this.closeWindow(),this.removeMessageListener(),this.emitter.removeAll(),this.log("SDK destroyed")}on(t,n){return this.emitter.on(t,n),this}off(t,n){return this.emitter.off(t,n),this}validateOptions(t){if(!t.source)throw new Error("[WecomAIBotSDK] source is required")}mergeConfig(t){t.authOrigin&&(this.config.authOrigin=t.authOrigin),t.width!=null&&(this.config.width=t.width),t.height!=null&&(this.config.height=t.height),t.debug!=null&&(this.config.debug=t.debug)}buildAuthUrl(t,n){const i=new URLSearchParams({source:t,state:n,timestamp:String(Date.now())});return`${this.config.authOrigin}/ai/qc/gen?${i.toString()}`}buildWindowFeatures(){const{width:t,height:n}=this.config,i=(window.screen.width-t)/2,r=(window.screen.height-n)/2;return[`width=${t}`,`height=${n}`,`left=${i}`,`top=${r}`,"resizable=false","scrollbars=false","status=no","toolbar=no","menubar=no","location=no"].join(",")}generateState(){return`state_${Math.random().toString(36).substring(2,11)}_${Date.now()}`}setupMessageListener(){this.messageListener=t=>{var n;if(t.origin!==this.config.authOrigin){this.log("Message from unknown origin:",t.origin);return}const i=t.data;if(!(!i||!i.type))switch(this.log("Message received:",i.type,i.payload),i.type){case UO.QR_CODE_READY:{this.emitter.emit("ready",i.payload);break}case UO.AUTH_SUCCESS:{this.emitter.emit("success",i.payload),this.closeWindow();break}case UO.AUTH_ERROR:{const r=((n=i.payload)===null||n===void 0?void 0:n.error)||i.payload;this.emitter.emit("error",r),this.closeWindow();break}case UO.AUTH_CANCEL:{this.emitter.emit("cancel",null),this.closeWindow();break}case UO.WINDOW_CLOSE:{this.closeWindow();break}}},window.addEventListener("message",this.messageListener)}removeMessageListener(){this.messageListener&&(window.removeEventListener("message",this.messageListener),this.messageListener=null)}startPolling(){this.stopPolling(),this.pollingTimer=setInterval(()=>{var t;!((t=this.authWindow)===null||t===void 0)&&t.closed&&(this.stopPolling(),this.authWindow=null,this.emitter.emit("cancel",null))},Mnn)}stopPolling(){this.pollingTimer&&(clearInterval(this.pollingTimer),this.pollingTimer=null)}log(...t){this.config.debug&&console.log("[WecomAIBotSDK]",...t)}}const p7e=new h7e;typeof window<"u"&&(window.WecomAIBotSDK=p7e);p7e.destroy();class _S extends Error{constructor(t){super("WeCom authorization failed"),this.code=t}}function $nn(e){if(e.aborted)return Promise.reject(new DOMException("Cancelled","AbortError"));const t=new h7e;return new Promise((n,i)=>{let r=!1;const s=()=>{r=!0,clearTimeout(c),e.removeEventListener("abort",l),t.destroy()},o=u=>{r||(s(),i(u))},l=()=>o(new DOMException("Cancelled","AbortError")),c=setTimeout(()=>o(new _S("AUTH_TIMEOUT")),3e5);e.addEventListener("abort",l,{once:!0});try{t.openBotInfoAuthWindow({source:"mpa-agent",state:crypto.randomUUID(),debug:!1}).then(u=>{if(!r){if(typeof(u==null?void 0:u.botid)!="string"||!u.botid.trim()||typeof(u==null?void 0:u.secret)!="string"||!u.secret.trim()){o(new _S("INVALID_RESULT"));return}s(),n({botId:u.botid.trim(),secret:u.secret.trim()})}},u=>{const d=u&&typeof u=="object"&&"code"in u&&typeof u.code=="string"?u.code:"FAILED";o(new _S(d))})}catch{o(new _S("FAILED"))}})}function Fnn({runtimeId:e,region:t,capability:n,domain:i="feishu",renderPanel:r}){const{t:s}=_e("ui"),o=p.useMemo(()=>({runtimeId:e,region:t}),[e,t]),[l,c]=p.useState([]),[u,d]=p.useState(""),[f,h]=p.useState(!1),[m,g]=p.useState(!0),[b,v]=p.useState(!1),[y,w]=p.useState(""),[x,k]=p.useState(0),S=p.useRef(null),O=p.useRef(null),A=p.useRef(void 0),E=l.find(R=>R.appId===u);p.useEffect(()=>{const R=new AbortController;return S.current=R,g(!0),w(""),r7e(o,R.signal,i).then(C=>{if(R.signal.aborted)return;c(C);const N=A.current;d(P=>{const I=N??P;return C.some(D=>D.appId===I)?I:C.length===1?C[0].appId:""}),A.current=void 0}).catch(C=>{R.signal.aborted||w(s(C instanceof Ou&&[401,403].includes(C.status)?"channels.unauthorized":"channels.accountsFailed"))}).finally(()=>{R.signal.aborted||g(!1)}),()=>R.abort()},[o,x,s,i]),p.useEffect(()=>()=>{var R,C;(R=S.current)==null||R.abort(),(C=O.current)==null||C.abort()},[]);function j(R){A.current=R,h(!1),k(C=>C+1)}async function T(){if(!E||b||O.current)return;const R=new AbortController;O.current=R,v(!0),w("");try{await wc(o,`/feishu/accounts/${encodeURIComponent(E.appId)}`,{method:"PATCH",body:JSON.stringify({enabled:!E.enabled}),signal:R.signal}),R.signal.aborted||j(E.appId)}catch(C){R.signal.aborted||w(s(C instanceof Ou&&[401,403].includes(C.status)?"channels.unauthorized":"channels.requestFailed"))}finally{O.current===R&&(O.current=null),R.signal.aborted||v(!1)}}return a.jsxs("section",{className:"runtime-channels runtime-channels-accounts","aria-label":s(i==="lark"?"channels.larkAccountsTitle":"channels.accountsTitle"),"aria-busy":m||b,children:[a.jsxs("div",{className:"runtime-channels-heading",children:[a.jsx("h3",{children:s(i==="lark"?"channels.larkAccountsTitle":"channels.accountsTitle")}),a.jsx(ki,{variant:"outline",size:"compact",disabled:b||m,onClick:()=>j(u),children:s("channels.refresh")})]}),m&&a.jsx("p",{role:"status",children:a.jsx(on,{children:s("channels.loading")})}),y&&a.jsxs("div",{role:"alert",className:"aw-integration-error",children:[a.jsx("span",{children:y}),a.jsx(ki,{variant:"outline",size:"compact",disabled:b||m,onClick:()=>j(u),children:s("common.retry")})]}),a.jsxs("div",{className:"runtime-channels-account-actions",children:[a.jsxs("label",{className:"runtime-channels-account-select",children:[s("channels.account"),a.jsx(_K,{"aria-label":s("channels.account"),value:u,disabled:b||m||!!y,options:[{value:"",label:s("channels.selectAccount")},...l.map(R=>({value:R.appId,label:`${R.appName||R.appId} | ${R.enabled?s("channels.accountEnabled"):s("channels.accountDisabled")}`,description:R.appName?R.appId:void 0}))],onChange:R=>{h(!1),d(R.target.value)}})]}),a.jsx(ki,{size:"compact",disabled:b||m||!!y||!n.bindingReady,onClick:()=>h(!0),children:s("channels.addAccount")}),E&&!f&&a.jsx(ki,{variant:"outline",size:"compact",disabled:b||m||!!y,onClick:()=>void T(),children:s(E.enabled?"channels.disableAccount":"channels.enableAccount")})]}),!m&&!y&&!l.length&&a.jsx("p",{role:"status",children:s(i==="lark"?"channels.noLarkAccounts":"channels.noAccounts")}),!m&&!y&&!f&&!u&&l.length>0&&a.jsx("p",{role:"status",children:s("channels.selectAccount")}),!m&&!y&&(f||E)&&a.jsxs("div",{children:[f&&a.jsx(ki,{variant:"ghost",size:"compact",disabled:b,onClick:()=>h(!1),children:s("channels.cancelAddAccount")}),r({accountId:f?void 0:u,accountMode:f?"add":"manage",onBound:j,onDeleted:()=>j(""),onBusyChange:v})]},f?"add":u)]})}const Bnn=["feishu","lark","wecom","dingtalk"];function Unn(e){const{t}=_e("ui"),n=Bnn.filter(l=>l!=="lark"||e.cloudProvider==="byteplus"),[i,r]=p.useState("feishu"),s=p.useId(),o=p.useRef([]);return a.jsxs("div",{className:"message-channels",children:[e.showHeader!==!1&&a.jsxs("div",{className:"message-channels-header",children:[a.jsx("h2",{children:t("channels.workspaceTitle")}),a.jsx("p",{children:t("channels.workspaceDescription")})]}),a.jsx("div",{className:"message-channels-tabs",role:"tablist","aria-label":t("channels.workspaceTitle"),children:n.map((l,c)=>a.jsx("button",{ref:u=>{o.current[c]=u},type:"button",role:"tab",id:`${s}-${l}`,"aria-controls":`${s}-panel`,"aria-selected":i===l,tabIndex:i===l?0:-1,onClick:()=>r(l),onKeyDown:u=>{var f;let d;if(u.key==="ArrowRight")d=(c+1)%n.length;else if(u.key==="ArrowLeft")d=(c+n.length-1)%n.length;else if(u.key==="Home")d=0;else if(u.key==="End")d=n.length-1;else return;u.preventDefault(),r(n[d]),(f=o.current[d])==null||f.focus()},children:t(`channels.provider_${l}`)},l))}),a.jsx("div",{role:"tabpanel",id:`${s}-panel`,"aria-labelledby":`${s}-${i}`,tabIndex:0,children:a.jsx(m7e,{...e,provider:i},`${e.region}:${e.runtimeId}:${i}`)})]})}function S6({label:e,value:t,complete:n,description:i}){return a.jsxs("div",{className:"runtime-channels-status-card",children:[a.jsx("dt",{children:e}),a.jsxs("dd",{children:[a.jsxs("span",{className:`runtime-channels-status-value${n?" is-complete":""}`,children:[a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"12",cy:"12",r:"9"}),n?a.jsx("path",{d:"m8 12 3 3 5-6"}):a.jsx("path",{d:"M12 7v5l3 2"})]}),t]}),a.jsx("p",{children:i})]})]})}const Tj=new Set(["BOUND","FAILED","EXPIRED"]);function m7e({runtimeId:e,region:t,provider:n,accountId:i,accountMode:r,onBound:s,onDeleted:o,onBusyChange:l}){var Ae,Ee;const{t:c}=_e("ui"),u=n==="lark"?"feishu":n,d=u==="feishu",f=n==="lark"?"lark":"feishu",h=p.useMemo(()=>({runtimeId:e,region:t}),[e,t]),m=p.useId(),[g,b]=p.useState("quick"),[v,y]=p.useState(null),[w,x]=p.useState(null),[k,S]=p.useState([]),[O,A]=p.useState(!1),[E,j]=p.useState(null),[T,R]=p.useState(""),[C,N]=p.useState(""),[P,I]=p.useState(!1),[D,_]=p.useState(!1),[L,F]=p.useState(!1),[M,H]=p.useState(""),[q,U]=p.useState(""),[Z,z]=p.useState(!1),[J,ne]=p.useState(!0),[W,X]=p.useState(0),le=p.useRef(!0),V=p.useRef(null),Y=p.useRef(null),K=p.useRef(!1),ue=`mpa-${n}-binding:${t}:${e}`,te=d&&(!!r||!!((Ae=v==null?void 0:v.multiBotChannels)!=null&&Ae.includes("feishu")));p.useEffect(()=>(l==null||l(Z),()=>l==null?void 0:l(!1)),[Z,l]);const Oe=(Ce,Be=!1)=>{if(!le.current)return;if(Ce instanceof _S){const ie={WINDOW_BLOCKED:"wecomPopupBlocked",CANCELLED:"wecomAuthCancelled",AUTH_TIMEOUT:"wecomAuthTimeout",INVALID_RESULT:"wecomInvalidResult"}[Ce.code]||"wecomAuthFailed";U(c(`channels.${ie}`));return}const he=Ce instanceof Ou?Ce.status:0;he===409&&(Be||!te)&&F(!0),U(c(`channels.${he===409?Be||!te?"uncertain":"accountConflict":he===404?"unsupported":he===401||he===403?"unauthorized":he===503?"configurationError":"requestFailed"}`))};async function fe(Ce){if(r==="add"){x(null),S([]);return}const Be=i?`?appId=${encodeURIComponent(i)}`:"",[he,ie]=await Promise.all([wc(h,`/${u}/diagnostics${Be}`,{signal:Ce}),d?wc(h,`/chat-permissions?channel=feishu${i?`&appId=${encodeURIComponent(i)}`:""}`,{signal:Ce}):Promise.resolve({permissions:[]})]);!Ce.aborted&&le.current&&(x(he),S(ie.permissions))}p.useEffect(()=>{le.current=!0;try{sessionStorage.removeItem(ue)}catch{}return()=>{var Ce,Be;le.current=!1,(Ce=V.current)==null||Ce.abort(),(Be=Y.current)==null||Be.abort()}},[]),p.useEffect(()=>{var Be;const Ce=new AbortController;return ne(!0),U(""),y(null),j(null),A(!1),_(!1),(Be=Y.current)==null||Be.abort(),(async()=>{var he,ie,we;try{const Re=await wc(h,"/capabilities",{signal:Ce.signal});if(Ce.signal.aborted)return;if(!Re.serverSideBinding||n==="lark"&&(!((he=Re.feishuDomains)!=null&&he.includes("lark"))||!((ie=Re.multiBotChannels)!=null&&ie.includes("feishu")))||!(Re.channels??["feishu"]).includes(u))throw new Ou(404);if(y(Re),d&&((we=Re.multiBotChannels)!=null&&we.includes("feishu"))&&!r)return;await fe(Ce.signal)}catch(Re){Ce.signal.aborted||Oe(Re)}finally{Ce.signal.aborted||ne(!1)}})(),()=>Ce.abort()},[h,W]),p.useEffect(()=>{if(g!=="quick"||!E||Tj.has(E.status)||Z)return;const Ce=new AbortController;Y.current=Ce;const Be=window.setTimeout(()=>{wc(h,`/${u}/bindings/${encodeURIComponent(E.id)}`,{signal:Ce.signal}).then(async he=>{Ce.signal.aborted||(j(he),he.lastErrorCode==="REGISTRATION_UNCERTAIN"&&F(!0),he.status==="BOUND"&&(r?s==null||s(he.appId||void 0):await fe(Ce.signal)))}).catch(he=>{Ce.signal.aborted||Oe(he)})},Math.max(1,E.pollAfterSeconds)*1e3);return()=>{window.clearTimeout(Be),Ce.abort()}},[E,h,Z,W,g]);async function pe(Ce,Be=!1){var ie;if(V.current)return;const he=new AbortController;V.current=he,z(!0),U(""),(ie=Y.current)==null||ie.abort();try{await Ce(he.signal)}catch(we){he.signal.aborted||Oe(we,Be)}finally{V.current===he&&(V.current=null,le.current&&z(!1))}}function Se(Ce=!1){pe(async Be=>{A(!0),Ce||j(null);const he=await wc(h,Ce&&E?`/${u}/bindings/${encodeURIComponent(E.id)}/retry`:`/${u}/bindings`,{method:"POST",body:n==="lark"?JSON.stringify({domain:f}):"{}",signal:Be});Be.aborted||(j(he),he.lastErrorCode==="REGISTRATION_UNCERTAIN"&&F(!0),he.status==="BOUND"&&(r?s==null||s(he.appId||void 0):await fe(Be)))},!0)}function ve(){pe(async Ce=>{A(!0),_(!1),I(!0),K.current=!0;try{const Be=await $nn(Ce);if(Ce.aborted)return;K.current=!1,I(!1),await wc(h,"/wecom/bindings",{method:"POST",body:JSON.stringify(Be),signal:Ce}),Ce.aborted||(_(!0),N(""),R(""),await fe(Ce))}finally{le.current&&!Ce.aborted&&(K.current=!1,I(!1))}})}const Le=n==="wecom"||!!((Ee=v==null?void 0:v.credentialBindingChannels)!=null&&Ee.includes(u)),He=!!E&&!Tj.has(E.status),Ge=Z||J||L||He,De=J||Z&&!P;function se(Ce){var Be,he;Ce===g||J||V.current&&!K.current||((Be=V.current)==null||Be.abort(),V.current=null,K.current=!1,(he=Y.current)==null||he.abort(),z(!1),I(!1),j(null),A(!1),_(!1),R(""),N(""),U(""),b(Ce))}const ce=Ce=>{try{const Be=new URL(Ce||"");return Be.protocol==="https:"?Be.href:void 0}catch{return}};if(te&&!r&&v)return a.jsx(Fnn,{runtimeId:e,region:t,capability:v,domain:f,renderPanel:Ce=>a.jsx(m7e,{runtimeId:e,region:t,provider:n,...Ce})});const ye=n==="wecom"&&v&&a.jsxs(a.Fragment,{children:[a.jsx(At,{color:"primary",size:"sm",disabled:Z||J||L||!v.bindingReady,onClick:ve,children:c(w!=null&&w.configured?"channels.newQr":"channels.bind")}),P&&a.jsxs(a.Fragment,{children:[a.jsx("span",{role:"status",children:c("channels.wecomAuthorizing")}),a.jsx(At,{color:"secondary",variant:"outline",size:"sm",onClick:()=>{var Ce;(Ce=V.current)==null||Ce.abort(),K.current=!1,I(!1)},children:c("channels.cancelAuthorization")})]})]});return a.jsxs("section",{className:"runtime-channels","aria-label":c(`channels.provider_${n}`),"aria-busy":J||Z,children:[a.jsxs("div",{className:"runtime-channels-heading",children:[a.jsx("h3",{children:c("channels.providerBindingTitle",{name:c(`channels.provider_${n}`)})}),a.jsx(At,{color:"secondary",variant:"outline",size:"sm",disabled:Z||J,onClick:()=>X(Ce=>Ce+1),children:c("channels.refresh")})]}),J&&a.jsx("p",{role:"status",children:a.jsx(on,{children:c("channels.loading")})}),q&&a.jsxs("div",{className:"aw-integration-error",role:"alert",children:[a.jsx("span",{children:q}),a.jsx(At,{color:"secondary",variant:"outline",size:"sm",disabled:Z||J,onClick:()=>X(Ce=>Ce+1),children:c("common.retry")})]}),v&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"runtime-channels-binding-summary",children:[a.jsx("span",{className:`runtime-channels-badge${w!=null&&w.configured?" is-bound":""}`,children:c(w!=null&&w.configured?"channels.connected":"channels.notBound")}),a.jsx("p",{children:w!=null&&w.configured?c("channels.bound",{name:w.appName||w.appId}):c("channels.providerUnbound",{name:c(`channels.provider_${n}`)})})]}),!v.bindingReady&&a.jsx("p",{role:"alert",children:c("channels.keyRequired")}),w&&a.jsxs("dl",{className:"runtime-channels-diagnostics",children:[a.jsx(S6,{label:c("channels.gateway"),value:c(w.gatewayConfigured?"channels.configured":"channels.missing"),complete:w.gatewayConfigured,description:c("channels.gatewayDescription")}),a.jsx(S6,{label:c("channels.route"),value:c(w.routeConfigured?"channels.configured":"channels.missing"),complete:w.routeConfigured,description:c("channels.routeDescription")}),a.jsx(S6,{label:c("channels.delivery"),value:c(`channels.delivery_${w.deliveryHealth}`,{defaultValue:c("channels.delivery_not_observed")}),complete:w.deliveryHealth==="delivered",description:c("channels.deliveryDescription")})]}),!!(w!=null&&w.missingConfiguration.length)&&a.jsx("p",{role:"alert",children:c("channels.missingConfig",{fields:w.missingConfiguration.join(", ")})}),r!=="manage"&&a.jsxs(a.Fragment,{children:[a.jsxs("fieldset",{className:"runtime-channels-methods",children:[a.jsx("legend",{children:c("channels.configurationMethod")}),a.jsx("div",{children:["quick","manual"].map(Ce=>a.jsx(Pnn,{name:`${m}-method`,value:Ce,checked:g===Ce,disabled:De,label:a.jsx("span",{className:"runtime-channels-method-label","data-selected":g===Ce,children:c(`channels.${Ce}Setup`)}),onChange:()=>se(Ce)},Ce))})]}),a.jsx("p",{children:c(g==="quick"?"channels.qrGuidance":"channels.manualGuidance",{name:c(`channels.provider_${n}`)})}),g==="manual"&&(w==null?void 0:w.configured)&&!te&&a.jsx("p",{children:c("channels.manualReplacement")}),g==="manual"&&!Le&&a.jsx("p",{children:c("channels.manualUpgrade",{name:c(`channels.provider_${n}`)})}),g==="manual"&&Le&&a.jsxs("form",{className:"runtime-channels-form","data-channel-binding":!0,onSubmit:Ce=>{Ce.preventDefault(),!(!T.trim()||!C.trim()||Ge||!v.bindingReady)&&pe(async Be=>{await wc(h,n==="wecom"?"/wecom/bindings":`/${u}/bindings/manual`,{method:"POST",body:JSON.stringify(n==="wecom"?{botId:T.trim(),secret:C.trim()}:d?{appId:T.trim(),appSecret:C.trim(),...n==="lark"?{domain:f}:{}}:{clientId:T.trim(),clientSecret:C.trim()}),signal:Be}),Be.aborted||(N(""),R(""),r?s==null||s(T.trim()):await fe(Be))},!0)},children:[a.jsxs("label",{children:[c(n==="wecom"?"channels.wecomBotId":d?"channels.feishuAppId":"channels.dingtalkClientId"),a.jsx("input",{name:n==="wecom"?"botId":d?"appId":"clientId",value:T,required:!0,autoComplete:"off",disabled:Ge,onChange:Ce=>R(Ce.target.value),onKeyDown:Ce=>{Ce.key==="Enter"&&(Ce.nativeEvent.isComposing||Ce.nativeEvent.keyCode===229)&&Ce.preventDefault()}})]}),a.jsxs("label",{children:[c(n==="wecom"?"channels.wecomSecret":d?"channels.feishuAppSecret":"channels.dingtalkClientSecret"),a.jsx("input",{name:"secret",type:"password",value:C,required:!0,autoComplete:"new-password",disabled:Ge,onChange:Ce=>N(Ce.target.value),onKeyDown:Ce=>{Ce.key==="Enter"&&(Ce.nativeEvent.isComposing||Ce.nativeEvent.keyCode===229)&&Ce.preventDefault()}})]}),a.jsx(At,{color:"primary",size:"sm",type:"submit",disabled:Ge||!v.bindingReady||!T.trim()||!C.trim()||L,children:c("channels.bindCredentials")})]})]}),L&&a.jsx("p",{role:"alert",children:c("channels.uncertain")}),a.jsxs("div",{className:"runtime-channels-actions",children:[g==="quick"&&ye,g==="quick"&&n!=="wecom"&&r!=="manage"&&a.jsx(At,{color:"primary",size:"sm",disabled:Z||J||!v.bindingReady||L||!!E&&!Tj.has(E.status),onClick:()=>Se(),children:c(E||w!=null&&w.configured||O?"channels.newQr":"channels.bind")}),(w==null?void 0:w.configured)&&a.jsx(At,{color:"danger",variant:"outline",size:"sm",disabled:Z,onClick:()=>{window.confirm(c("channels.confirmUnbind"))&&pe(async Ce=>{await wc(h,`?channel=${u}&appId=${encodeURIComponent(w.appId||"")}`,{method:"DELETE",signal:Ce}),Ce.aborted||(j(null),A(!1),_(!1),F(!1),r?o==null||o():await fe(Ce))})},children:c("channels.unbind")})]}),g==="quick"&&(E||O)&&a.jsxs("div",{className:"runtime-channels-binding-progress",role:"status","aria-live":"polite",children:[a.jsx("h3",{children:c("channels.pairingTitle")}),d&&a.jsx("p",{children:c(n==="lark"?"channels.larkPairingDescription":te?"channels.multiBotPairingDescription":"channels.feishuPairingDescription")}),n==="wecom"&&a.jsx("p",{children:c("channels.wecomPairingDescription")}),n==="wecom"&&D&&a.jsx("p",{children:c("channels.status_BOUND")}),!E&&Z&&a.jsx("p",{children:a.jsx(on,{children:c(n==="wecom"?P?"channels.wecomAuthorizing":"channels.status_REGISTERING":"channels.generatingQr")})}),E&&a.jsxs(a.Fragment,{children:[E.status!=="PENDING"&&a.jsx("p",{children:c(`channels.status_${E.status}`)}),!Tj.has(E.status)&&a.jsx(a.Fragment,{children:ce(E.qrCodeImage)&&a.jsx("img",{className:"runtime-channels-qr",src:ce(E.qrCodeImage),alt:c("channels.qrAlt"),referrerPolicy:"no-referrer"})}),E.lastErrorCode&&a.jsx("p",{children:E.lastErrorCode==="REGISTRATION_UNCERTAIN"?c("channels.uncertain"):c("channels.bindingFailed")}),E.status==="FAILED"&&E.lastErrorCode!=="REGISTRATION_UNCERTAIN"&&a.jsx(At,{color:"secondary",variant:"outline",size:"sm",disabled:Z,onClick:()=>Se(!0),children:c("common.retry")})]})]}),d&&r!=="add"&&a.jsxs("section",{className:"runtime-channels-permissions","aria-label":c("channels.groupsTitle"),children:[a.jsxs("div",{className:"runtime-channels-heading",children:[a.jsx("h3",{children:c("channels.groupsTitle")}),a.jsx("span",{className:"runtime-channels-count",children:k.length})]}),a.jsx("p",{children:c("channels.groupsDescription")}),a.jsxs("form",{className:"runtime-channels-form",onSubmit:Ce=>{Ce.preventDefault(),!(!M.trim()||Z)&&pe(async Be=>{await wc(h,"/chat-permissions",{method:"POST",body:JSON.stringify({channel:u,...i?{appId:i}:{},chatId:M.trim()}),signal:Be}),Be.aborted||(H(""),await fe(Be))})},children:[a.jsxs("label",{children:[c("channels.chatId"),a.jsx("input",{value:M,required:!0,disabled:Z,onChange:Ce=>H(Ce.target.value),onKeyDown:Ce=>{Ce.key==="Enter"&&(Ce.nativeEvent.isComposing||Ce.nativeEvent.keyCode===229)&&Ce.preventDefault()}})]}),a.jsx(At,{color:"primary",size:"sm",type:"submit",disabled:Z||!M.trim(),children:c("channels.saveGroup")})]}),!k.length&&a.jsx("p",{className:"runtime-channels-empty",children:c("channels.noGroups")}),a.jsx("ul",{className:"runtime-channels-groups",children:k.map(Ce=>a.jsxs("li",{children:[a.jsxs("span",{children:[Ce.chatName||Ce.chatId," |"," ",c(`channels.scope_${Ce.groupSessionScope||"group"}`)]}),a.jsx(At,{color:"danger",variant:"ghost",size:"sm",className:"runtime-channels-remove-group",disabled:Z,"aria-label":c("channels.removeGroup",{name:Ce.chatName||Ce.chatId}),onClick:()=>void pe(async Be=>{await wc(h,`/chat-permissions?channel=${u}&chat_id=${encodeURIComponent(Ce.chatId)}${i?`&appId=${encodeURIComponent(i)}`:""}`,{method:"DELETE",signal:Be}),await fe(Be)}),children:a.jsx(ST,{})})]},`${Ce.appId||i||""}:${Ce.chatId}`))})]})]})]})}const QO=e=>`${e.region}:${e.runtimeId}`;function Qnn({cloudProvider:e="volcengine",role:t,runtimeScope:n,onBack:i}){const{t:r}=_e("automations"),s=t==="admin"||t==="super_admin";return a.jsxs("div",{className:"mpa-channels-page",children:[a.jsxs("header",{className:"mpa-channels-header",children:[a.jsx("button",{type:"button",className:"mpa-channels-back","aria-label":r("backToAutomations"),onClick:i,children:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"m14 6-6 6 6 6"})})}),a.jsx(i7e,{className:"mpa-channels-icon"}),a.jsxs("div",{children:[a.jsx("h1",{children:r("cards.mpa-channels.name")}),a.jsx("p",{children:r("cards.mpa-channels.description")})]})]}),a.jsx("div",{className:"mpa-channels-scroll",children:s?a.jsx(znn,{runtimeScope:n,cloudProvider:e},`${t}:${n}:${e}`):a.jsx("p",{className:"mpa-channels-notice",role:"status",children:r("mpaChannels.unauthorized")})})]})}function znn({runtimeScope:e,cloudProvider:t}){const{t:n,i18n:i}=_e("automations"),[r,s]=p.useState([]),[o,l]=p.useState(""),[c,u]=p.useState(""),[d,f]=p.useState(""),[h,m]=p.useState(!0),[g,b]=p.useState(!1),[v,y]=p.useState(null),w=p.useRef(null),x=p.useRef("");async function k(E=""){var T;(T=w.current)==null||T.abort();const j=new AbortController;w.current=j,m(!0),y(null),x.current=E;try{const R=await $v({agentCategory:"mpa",scope:e,region:"all",pageSize:100,nextToken:E||void 0,signal:j.signal});if(j.signal.aborted)return;const C=R.runtimes.filter(N=>N.runtimeId&&N.region&&(N.agentCategory==="mpa"||N.agentCategory===void 0));s(N=>[...new Map((E?[...N,...C]:C).map(P=>[QO(P),P])).values()]),E||l(N=>C.some(P=>QO(P)===N)?N:""),f(R.nextToken),b(!0)}catch(R){if(j.signal.aborted)return;const C=R instanceof ND&&(R.status===401||R.status===403);y(C?"unauthorized":"loadFailed"),C&&(s([]),l(""),f(""),b(!1),x.current="")}finally{j.signal.aborted||m(!1)}}p.useEffect(()=>(k(),()=>{var E;return(E=w.current)==null?void 0:E.abort()}),[]);const S=r.find(E=>QO(E)===o),O=c.trim().toLocaleLowerCase(),A=r.filter(E=>`${E.name} ${E.runtimeId} ${E.region}`.toLocaleLowerCase().includes(O)).map(E=>{var T,R;const j=zT(E.createdAt,Date.now(),i.resolvedLanguage||i.language);return{value:QO(E),label:E.name||E.runtimeId,description:((T=E.description)==null?void 0:T.trim())||n("mpaChannels.noDescription"),metadata:`${n("mpaChannels.optionMetadata",{creator:((R=E.author)==null?void 0:R.trim())||n("mpaChannels.unknownCreator"),createdAt:j})} -${E.region} · ${E.runtimeId}`}});return a.jsxs("div",{className:"mpa-channels-content",children:[a.jsxs("section",{className:"mpa-channels-picker","aria-label":n("mpaChannels.selectAgent"),children:[a.jsxs("div",{className:"mpa-channels-picker-heading",children:[a.jsx("h2",{children:n("mpaChannels.selectAgent")}),a.jsx("button",{type:"button",className:"mpa-channels-action",disabled:h,onClick:()=>void k(),children:n("mpaChannels.refresh")})]}),a.jsx(bf,{ariaLabel:n("mpaChannels.selectAgent"),placeholder:n("mpaChannels.chooseAgent"),value:o,valueLabel:(S==null?void 0:S.name)||(S==null?void 0:S.runtimeId),options:A,disabled:!r.length,searchValue:c,searchPlaceholder:n("mpaChannels.search"),emptyMessage:n("mpaChannels.noMatches"),onSearchChange:u,onChange:l}),S&&a.jsxs("p",{className:"mpa-channels-target",children:[S.region," · ",S.runtimeId]}),h&&a.jsx(on,{as:"p",role:"status",children:n("mpaChannels.loading")}),v&&a.jsxs("div",{className:"mpa-channels-error",role:"alert",children:[a.jsx("p",{children:n(`mpaChannels.${v}`)}),a.jsx("button",{type:"button",className:"mpa-channels-action",onClick:()=>void k(x.current),children:n("mpaChannels.retry")})]}),!h&&!v&&g&&!r.length&&!d&&a.jsx("p",{role:"status",children:n("mpaChannels.empty")}),d&&a.jsxs("div",{className:"mpa-channels-pagination",children:[a.jsx("p",{children:n("mpaChannels.moreAvailable")}),a.jsx("button",{type:"button",className:"mpa-channels-action",disabled:h,onClick:()=>void k(d),children:n("mpaChannels.loadMore")})]})]}),S?a.jsx(Unn,{runtimeId:S.runtimeId,region:S.region,showHeader:!1,cloudProvider:t},QO(S)):g&&r.length>0?a.jsx("p",{className:"mpa-channels-notice",role:"status",children:n("mpaChannels.chooseHint")}):null]})}async function RK(e,t){const n=await e.json().catch(()=>null),i=typeof(n==null?void 0:n.detail)=="string"?n.detail:"";return new Error(i||Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}))}async function Vnn(e){const t=await yn("/web/website-integrations",{cache:"no-store",signal:e});if(!t.ok)throw await RK(t,Q("websiteIntegration.listFailed"));return(await t.json()).integrations??[]}async function Hnn(e){const t=await yn("/web/website-integrations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await RK(t,Q("websiteIntegration.createFailed"));return t.json()}async function qnn(e){const t=await yn(`/web/website-integrations/${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok)throw await RK(t,Q("websiteIntegration.deleteFailed"))}function Wnn(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m9.8 3.5-4.5 4.5 4.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function jle(e){return a.jsxs("svg",{viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"5",width:"20",height:"17",rx:"3.5",stroke:"currentColor",strokeWidth:"1.5"}),a.jsx("path",{d:"M4.5 10h18M8.5 7.5h.1M11.5 7.5h.1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),a.jsx("path",{d:"M17 18.5a5 5 0 0 1 5-5h1.5a5 5 0 0 1 5 5V23a5 5 0 0 1-5 5H22l-3.5 2.5v-3.3A5 5 0 0 1 17 23v-4.5Z",fill:"hsl(var(--background))",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),a.jsx("path",{d:"M21 19h4M21 22.5h3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function Knn(e,t){const n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleString(t,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}async function Gnn(e){const t=[];let n="";for(let i=0;i<10;i+=1){const r=await $v({nextToken:n||void 0,pageSize:100,region:"all",scope:"all"});if(e.aborted)return[];if(t.push(...r.runtimes),n=r.nextToken,!n)break}return t}function Xnn({onBack:e}){const{t,i18n:n}=_e("websiteIntegration"),[i,r]=p.useState([]),[s,o]=p.useState([]),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(""),[m,g]=p.useState(!0),[b,v]=p.useState(!1),[y,w]=p.useState(""),[x,k]=p.useState("");p.useEffect(()=>{const R=new AbortController;return g(!0),k(""),Promise.all([Vnn(R.signal),Gnn(R.signal)]).then(([C,N])=>{var I;if(R.signal.aborted)return;r(C),o(N),d(((I=C[0])==null?void 0:I.id)??"");const P=N[0];P&&c(`${P.region}::${P.runtimeId}`)}).catch(C=>{R.signal.aborted||k(C instanceof Error?C.message:t("errors.load"))}).finally(()=>{R.signal.aborted||g(!1)}),()=>R.abort()},[t]);const S=p.useMemo(()=>s.map(R=>({value:`${R.region}::${R.runtimeId}`,label:R.name||R.runtimeId,description:`${R.region} · ${R.status}`,runtime:R})),[s]),O=p.useMemo(()=>new Map(S.map(R=>[R.value,R.runtime])),[S]),A=i.find(R=>R.id===u)??i[0],E=A?` + diff --git a/veadk/webui/website-integration.js b/veadk/webui/website-integration.js index 1def7bcaf..3e5708c2e 100644 --- a/veadk/webui/website-integration.js +++ b/veadk/webui/website-integration.js @@ -68,7 +68,7 @@ Summarize the result in three points`,preview:"{{count}} cases will be added",co Studio: {{studioUrl}} Pairing code: {{pairingCode}}`,installPrompt:`Install the AgentKit Studio Plugin. Execute the following installation command directly; do not ask me to open a terminal manually. Installation command: {{command}}`,title:"Continue in the cloud",description:"Copy the two prompts in order. Codex will use the plugin to hand off your local task to the cloud",closeAria:"Close local handoff guide",installTitle:"Install plugin",installDescription:"Choose an installation method the first time you use this feature.",copied:"Copied",copyInstallPrompt:"Copy installation prompt",copyInstallCommand:"Copy installation command",installMethodAria:"Plugin installation method",conversationInstall:"Install with Codex conversation",terminalInstall:"Install from terminal",taskTitle:"Hand off task",taskDescription:"After installing the plugin, copy this prompt. Codex will migrate the current project and continue the task.",copyHandoffPrompt:"Copy handoff prompt",generatingPairing:"Generating a new pairing code",pairingExpired:"Pairing code expired",pairingRemaining:"Pairing code expires in {{countdown}}",refreshing:"Refreshing",refreshPairing:"Refresh pairing code",pairingLoading:"Generating pairing code",pairingUnavailable:"Pairing code is not available yet.",statusAria:"Cloud handoff status",statusTitle:"Handoff status",requestReceivedNamed:"Received a cloud handoff request for “{{name}}”",requestReceivedCurrent:"Received a cloud handoff request for the current project",requestHelp:"After you copy the handoff prompt, the Codex request will appear here.",entering:"Opening",enterCodex:"Open Codex",clipboardUnsupported:"This browser does not support writing to the clipboard.",steps:{request:"Wait for local request",session:"Create cloud Session",restore:"Restore project",continue:"Send continuation task"},status:{issued:"Waiting for request",creating:"Creating Session",sessionCreated:"Migrating project",continuing:"Starting cloud task",running:"Running in the cloud",completed:"Handoff complete",failed:"Handoff failed"}},X9e={model:{description:"Show or switch the current conversation model",keywords:"model switch"},models:{description:"List models available from app-server",keywords:"model list"},skill:{description:"Browse and invoke a Skill available in the current workspace",keywords:"skill workflow"},skills:{description:"Browse and invoke Skills available in the current workspace",keywords:"skills workflow list"},new:{description:"Start a new conversation",keywords:"new conversation"},resume:{description:"Open conversation history or resume a specific Thread",keywords:"history resume session"},fork:{description:"Fork a new conversation from the current context",keywords:"fork branch"},compact:{description:"Compact the current conversation context",keywords:"compact context"},archive:{description:"Archive the current conversation and start a new one",keywords:"archive close"},status:{description:"Show connection, Thread, model, and token status",keywords:"status connection token"},clear:{description:"Clear the current view and start a new conversation",keywords:"clear reset"},help:{description:"Show Sandbox shortcuts",keywords:"help commands"},currentModel:"Current model",availableModel:"Available model",workspace:"Workspace",notSet:"Not set",modelLabel:"Model",statusLabel:"Status",running:"Running",idle:"Idle",totalTokens:"Total tokens",contextWindow:"Context window",imageFallback:"Image",unknown:"Unknown shortcut: {{command}}. Type /help to see available commands.",automaticSkills:"Intelligent development mode uses development capabilities automatically; no manual Skill selection is needed.",activity:{new:"Started a new Codex conversation",resumed:"Resumed Codex conversation",deleted:"Deleted Codex conversation history",modelChanged:"Switched Codex model",availableModels:"Available Codex models",noModels:"No models are currently available",forked:"Forked Codex conversation",compacting:"Started compacting the current Codex conversation",archived:"Archived Codex conversation",status:"Current Codex status",help:"Codex shortcuts supported by Sandbox"}},K9e={label:"Build tasks",queued:"Build queued",running:"Build running in the background",recovering:"Recovering build",waiting_user:"Build needs attention",stopping:"Stopping build",succeeded:"Build completed",cancelled:"Build stopped",failed:"Build could not complete",open:"Return to task",hide:"Hide task notification",reconnecting:"Reconnecting to the task service. Existing tasks are retained."},ddr=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:Y9e,agentWorkspace:q9e,approval:G9e,commands:X9e,common:$9e,composer:Q9e,default:{common:$9e,tool:F9e,threads:z9e,permissions:U9e,workspace:V9e,approval:G9e,composer:Q9e,launch:H9e,session:W9e,agentDetails:Y9e,agentWorkspace:q9e,handoff:j9e,commands:X9e,taskNotice:K9e},handoff:j9e,launch:H9e,permissions:U9e,session:W9e,taskNotice:K9e,threads:z9e,tool:F9e,workspace:V9e},Symbol.toStringTag,{value:"Module"})),Z9e={retry:"Try again",signInToContinue:"Sign in to continue",signInWith:"Sign in with {{provider}}",enterUsername:"Enter a username to get started",usernamePlaceholder:"Username (letters and numbers, up to 16 characters)",enter:"Continue",usernameInvalid:"Use letters and numbers only, up to 16 characters.",identityProvider:{volcengine:"Volcengine Identity",byteplus:"BytePlus Identity"},powered:{volcengine:"Volcengine AgentKit provides enterprise-grade Agent solutions",byteplus:"BytePlus AgentKit provides enterprise-grade Agent solutions"},legalPrefix:"By continuing, you acknowledge that you have read and agree to the AgentKit",terms:"Product and Service Terms",copyright:"© {{year}} VeADK. All rights reserved."},J9e={title:"Your session has expired",description:"Your current edits are preserved. The previous action will continue after you sign in again.",waiting:"Waiting for sign-in…",signInAgain:"Sign in again"},eze={breadcrumbs:"Breadcrumbs",selectAgent:"Select Agent",switchAgent:"Switch Agent"},tze={cancel:"Cancel",close:"Close confirmation dialog"},hdr=Object.freeze(Object.defineProperty({__proto__:null,authExpired:J9e,confirm:tze,default:{login:Z9e,authExpired:J9e,navbar:eze,confirm:tze},login:Z9e,navbar:eze},Symbol.toStringTag,{value:"Module"})),rze={defaultUser:"User",shortcuts:"Quick access",tryCli:"Try AgentKit CLI",developerResources:"Developer resources",systemInfo:"System information",language:"Language",issueFeedback:"Report an issue",logout:"Sign out",roles:{admin:"Administrator",developer:"Developer",user:"User",super_admin:"Super administrator"}},nze={home:"Back to home",expand:"Expand sidebar",collapse:"Collapse sidebar",label:"Main navigation",newChat:"New chat",agents:"Agents",workspaces:"Workspaces",library:"Library",cronjobs:"Cronjob",automations:"Automations",users:"User management",administration:"Administration",reviewCenter:"Review center"},ize={title:"Chat history",newConversation:"New conversation",create:"New chat",loading:"Loading chat history…",empty:"No conversations yet",current:"Current",manage:"Manage conversation: {{title}}",more:"More",delete:"Delete",loadingMore:"Loading…",loadMore:"Load more",evaluatingTitle:"Running automatic evaluation",evaluating:"Evaluating",generating:"Generating"},fdr=Object.freeze(Object.defineProperty({__proto__:null,account:rze,default:{account:rze,navigation:nze,history:ize},history:ize,navigation:nze},Symbol.toStringTag,{value:"Module"})),aze={placeholder:"Select an option",collapseOptions:"Collapse model options",expandOptions:"Expand model options",noOptions:"No options available",noMatches:"No matches. You can use the current model ID directly."},oze={unsupportedActivity:"Unsupported Skill conversation activity",ariaLabel:"Skill generation conversation"},sze={code:"Error code: {{code}}",type:"Error type: {{type}}",representation:"Exception representation: {{value}}",rawResponse:`Raw server response: -{{value}}`,original:"Original error: {{message}}",details:"Details"},lze={ariaLabel:"Skill file tree",viewSource:"View source",viewPreview:"View preview",download:"Download",binaryFile:"Binary file",bytes:"{{value}} bytes",binaryDescription:"The current API returns file metadata only. Download the original file separately.",metadata:"Skill metadata",noFiles:"No files"},cze={close:"Close",name:"Name",region:"Region",optionalDescription:"Description (optional)",cancel:"Cancel",create:"Create",creating:"Creating…",save:"Save",saving:"Saving…",upload:"Upload",uploading:"Uploading…",createSpaceTitle:"New Skill Space",editSpaceTitle:"Edit Skill Space",uploadTitle:"Upload to {{name}}",createSpaceFailed:"Failed to create the Skill Space",updateSpaceFailed:"Failed to update the Skill Space",archiveValidationFailed:"Skill ZIP validation failed",uploadFailed:"Failed to upload the Skill",dropzone:"Drop a Skill ZIP here",chooseLocalFile:"or click to choose a local file",archiveHelp:"The ZIP root must contain SKILL.md, or a single wrapping directory. Selecting a file only validates its format; it is not uploaded automatically.",validating:"Checking file format…",validationPassed:"Format check passed: {{name}}, {{count}} file(s)"},uze={styles:{concise:"Concise and practical",strict:"Rigorous and robust",tutorial:"Tutorial-friendly",automation:"Automation-first",custom:"Custom",customFallback:"Custom style"},stages:{preparing:"Preparing Dev Sandbox",ready:"Skill generated and format validation passed",failed:"Generation failed",cancelled:"Stopped",validating:"Validating Skill format",packaging:"Organizing files",generating:"Generating Skill",repairingAgain:"Repairing again",autoRepairing:"Auto-repairing ({{attempt}}/{{max}})"},validation:{fallback:"Skill format validation failed",repairInstruction:"Fix only the Skill format errors listed below. Do not change the original purpose or scope.",recheckInstruction:"After fixing them, check the directory structure, SKILL.md frontmatter, and all text files again.",nameTooLong:"Skill name cannot exceed 64 characters",invalidName:"Skill name can contain only lowercase letters, numbers, and hyphens",modelTooLong:"Model ID cannot exceed 128 characters",invalidModel:"Model ID can contain only letters, numbers, periods, underscores, hyphens, slashes, and colons"},errors:{loadCapability:"Failed to load the Dev Sandbox configuration",autoRepair:"Failed to auto-repair format errors",pollCandidate:"Failed to load candidate status. Retrying.",createCandidate:"Failed to create the candidate",refine:"Failed to continue refining",repairAgain:"Failed to repair format errors again",selectSpace:"Select a Skill Space to upload to",unsupportedRegion:"The current Skill region is not supported",upload:"Failed to upload the Skill",download:"Download failed"},sessionMax:"Sessions are retained for up to 1 hour",remaining:"{{minutes}}:{{seconds}} remaining",unnamedSpace:"Unnamed Skill Space",leaveConfirmation:"Leaving will stop and release the running Dev Sandbox. Leave anyway?",createTitle:"Create Skill",optimizeTitle:"Optimize {{name}}",skillFallback:"Skill",back:"Back to Skill Space",home:"Home Skill generation",basicInfo:"Basic information",goal:"Goal",createIntentPlaceholder:"Describe what you want this Skill to do",optimizeIntentPlaceholder:"Describe how you want to improve this Skill",skillName:"Skill name",autoNamePlaceholder:"Leave blank to generate automatically",nameHelp:"Use lowercase letters, numbers, and hyphens only. Leave blank to generate automatically.",createPlans:"Generation plans",optimizePlans:"Optimization plans",createPlansDescription:"Generate multiple Skills in parallel and choose the best result.",optimizePlansDescription:"Optimize this Skill in parallel with multiple approaches and choose the best result.",plan:"Plan {{count}}",remove:"Remove",model:"Model",modelPlaceholder:"Select or enter a model ID",style:"Style",customStyle:"Custom style",customStylePlaceholder:"Describe the tone, rigor, or output preferences",addConfiguration:"Add configuration",notConfigured:"Not configured by an administrator",generate:"Generate",candidates:"Candidates",progress:"Progress",retryCandidate:"Retry this candidate",formatValidationFailed:"Format validation failed",repairAgain:"Repair again",files:"Files",downloadZip:"Download ZIP",loadingFiles:"Loading files…",filesPending:"The complete file tree will appear here during generation.",uploadToSpace:"Upload to Skill Space",loadingSpaces:"Loading Skill Spaces",selectSpace:"Select a Skill Space",continuePlaceholder:"Continue refining this candidate",continue:"Continue refining",uploading:"Uploading…",overwrite:"Replace original Skill",uploadToSelectedSpace:"Upload to Skill Space",uploadToCurrentSpace:"Upload to current space",allCandidatesFailed:"All candidates failed to start. Retry each candidate separately."},dze={invalidFormat:"{{label}} has an invalid format.",recoveryStatus:"Skill recovery status",errorResponse:"error response",errorDetails:"error details",missingContentType:"Content-Type missing",gatewayError:"{{fallback}} (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",nonJson:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",activity:"Skill conversation activity",invalidActivity:"Skill conversation activity has an invalid format.",invalidToolActivity:"Skill tool activity has an invalid format.",invalidTextActivity:"Skill text activity has an invalid format.",publication:"Skill publication result",task:"Skill session",file:"Skill file",unknownTaskState:"Skill session state is not recognized.",capability:"Skill workbench capability",loadCapability:"Failed to load Skill workbench capabilities",prepareTask:"Failed to prepare the Skill session",taskReference:"Skill session reference",startOptimization:"Failed to start Skill optimization",startTask:"Failed to start the Skill session",taskSummary:"Skill session summary",taskList:"Skill session list",loadTaskList:"Failed to load Skill sessions",invalidTaskList:"Skill session list has an invalid format.",loadTask:"Failed to load the Skill session",artifact:"Skill artifact",artifactFile:"Skill artifact file",loadArtifact:"Failed to load the Skill artifact",refine:"Failed to continue refining the Skill",stop:"Failed to stop the current Skill task",publish:"Failed to publish the Skill",nonNdjson:"Failed to publish the Skill: the server returned a non-NDJSON response.",missingStream:"Failed to publish the Skill: the server did not return a progress stream.",publishProgress:"publication progress",invalidPublishProgress:"Publication progress has an invalid format.",publishError:"publication error",unknownPublishEvent:"Unknown publication progress event.",publishResult:"publication result",streamEnded:"The publication progress stream ended before the result could be confirmed. Refresh Skill Center to check the status.",deleteTask:"Failed to delete the Skill session",download:"Failed to download the Skill"},pdr=Object.freeze(Object.defineProperty({__proto__:null,api:dze,configSelect:aze,conversation:oze,default:{configSelect:aze,conversation:oze,errorDetails:sze,fileTree:lze,management:cze,generation:uze,api:dze},errorDetails:sze,fileTree:lze,generation:uze,management:cze},Symbol.toStringTag,{value:"Module"})),hze={back:"Back",reload:"Reload",notConfigured:"Not configured",name:"Name",description:"Description",delete:"Delete",save:"Save",saving:"Saving",add:"Add",manage:"Manage",environment:"Environment",noDescription:"No description",refresh:"Refresh",close:"Close",retry:"Retry",loading:"Loading…",previousPage:"Previous page",nextPage:"Next page",edit:"Edit",all:"All",search:"Search",cancel:"Cancel",view:"View",viewDetails:"View details",deleting:"Deleting…",create:"Create",creating:"Creating",adding:"Adding",generating:"Generating",uploading:"Uploading",preview:"Preview",loadFailed:"Failed to load",select:"Select",collapse:"Collapse",expand:"Expand",none:"None"},fze={ariaLabel:"AgentKit shortcuts",closeAriaLabel:"Close the AgentKit welcome card",title:"Welcome to AgentKit",description:"Build and host enterprise Agents quickly with AgentKit",docsAriaLabel:"Open AgentKit documentation in a new window",docs:"Documentation",consoleAriaLabel:"Open the AgentKit console in a new window",console:"Console"},pze={checkUpdates:"Check for updates",checkingVersions:"Checking versions…",versionCheckError:"Unable to check sandbox versions. Check credentials, region and API permissions, then retry.",sandboxUpdateError:"Sandbox update failed. Refresh its status before retrying.",modelEnvRepairUnavailable:"Cannot repair model configuration. Check CODEX_API_KEY and CODEX_BASE_URL.",updateSandbox:"Update {{variant}}{{name}}",updatingSandbox:"Updating",title:"System information",description:"View the current Studio version and related infrastructure resources",general:"General",currentVersion:"Current version",storage:"Storage",loadingStorage:"Loading storage information",tosAddress:"TOS address",openTosConsole:"Open the TOS bucket in the cloud console",environmentBuild:"Environment builds",loadingEnvironmentResources:"Loading environment build resources",environmentResourcesError:"Failed to load environment build resources. Check the cloud credentials and try again.",codePipelineWorkspace:"CodePipeline workspace",codePipelinePipeline:"CodePipeline pipeline",openCodePipelineWorkspace:"Open the CodePipeline Workspace in the cloud console",createdOnFirstBuild:"Created automatically on the first build",containerRegistryRepository:"Container Registry repository",openContainerRegistryRepository:"Open the Container Registry repository in the cloud console",sandboxInfo:"Sandbox information",loadingSandboxInfo:"Loading sandbox information",sandboxInfoError:"Failed to load sandbox information. Try again.",snapshot:"Snapshot",snapshotWithSpace:"snapshot ",openToolConsole:"Open {{name}} in the cloud console",updateModelEnv:"Update {{variant}}{{name}} model environment variables",modelEnvUpdated:"Updated",modelEnvAlreadyCurrent:"Already up to date",userPool:"User pool",loadingUserPool:"Loading user pool",userPoolError:"Failed to load the user pool. Try again.",modelEnvUpdateError:"Failed to update model environment variables. Try again.",openUserPoolConsole:"Open user pool {{name}} in the cloud console",unnamedUserPool:"Unnamed user pool",id:"ID",domain:"Domain",region:"Region",noLocalUserPool:"No user pool is configured in local mode",noUserPool:"No user pool is configured for this Studio"},gze={workspace:"Agent workspace",library:"Agent library",evaluation:"Evaluation",agentList:"Agent list",agentDetails:"Agent details",newAgent:"New Agent",loading:"Loading…",loadingCloudAgents:"Loading cloud Agents…",noAgentSelected:"Select an Agent",local:"Local",remote:"Cloud",localAgent:"Local Agent",remoteAgent:"Cloud Agent",agentCount:"{{count}} Agents",agentCountLabel:"Agent count",details:"Details",chat:"Chat",update:"Update",backToAgentList:"Back to Agent list",loadingAgent:"Loading Agent",loadingAgentDescription:"Loading Agent configuration and Runtime information.",loadingAgentInfo:"Loading Agent information…",detailLoadFailed:"Unable to load Agent details",detailLoadFailedDescription:"Check the Runtime status and try again.",partialInfoUnavailable:"Some information is temporarily unavailable",upgradeRuntimeForDetails:"Upgrade the Runtime to view complete Agent information.",basicInfo:"Basic information",usageOverview:"Usage overview",sections:{basic:"Basic information",profileConfig:"Profile configuration",sessionConfig:"Session configuration",usage:"Usage overview",diagnostics:"Diagnostics",evaluations:"Evaluations",optimizations:"Optimizations",integrations:"Integrations",versions:"Versions",channels:"Message channels"},evaluationGroup:"Evaluation group",optimizations:"Optimization suggestions",optimizationsDescription:"Review actionable suggestions based on evaluation results.",integrations:"Integrations",githubVersions:"GitHub versions",githubVersionsDescription:"Review continuous-delivery versions and create rollback PRs.",currentVersionOnly:"GitHub continuous delivery is not enabled. Only the current production version is shown.",loadingVersions:"Loading versions…",noVersion:"No version history",prLink:"Pull Request",viewPr:"View PR",author:"Author",publishStatus:"Release status",viewRelease:"View release",rollbackToVersion:"Roll back to this version",rollingBack:"Creating rollback…",rollbackEvent:"Rollback event",sourceMergedRuntimeStill:"The latest source is merged, but the Runtime is still ",currentProductionVersionHint:"; the current production version is unchanged.",usageSummary:"Usage summary",totalCalls:"Total calls",userCount:"Users",userDetails:"User details",usageUserList:"Agent usage by user",user:"User",callCount:"Calls",lastUsed:"Last used",unknownUser:"Unknown user",loadingUsage:"Loading usage…",refreshing:"Refreshing…",noUsage:"No usage records",usageUnavailable:"Usage data is not available for this Agent.",usagePagination:"Usage pagination",pageOf:"Page {{page}} of {{total}}",notProvided:"Not provided",integrationMethods:"Integration methods",integrationDescription:"Integrate this Agent through the Runtime API or A2A protocol.",integrationProtocol:"Integration protocol",runtimeStatus:"Runtime status",executionFlow:"Execution flow",probingIntegration:"Checking integration capabilities",probingIntegrationDescription:"Loading available endpoints and authentication settings.",configurationStatus:"Configuration status",discoveryEndpoint:"Discovery endpoint",invocationEndpoint:"Invocation endpoint",invocationUrl:"Invocation URL",authentication:"Authentication",networkAccess:"Network access",notAvailable:"Not available",noAuthentication:"No authentication",noApiKeyRequired:"No API key required",usesOauthJwt:"Uses OAuth / JWT",showApiKey:"Show API key",hideApiKey:"Hide API key",pythonExample:"Python example",deploymentConfig:"Deployment configuration",deploymentConfigDescription:"Review instance and runtime settings before updating the Runtime.",deploymentRegion:"Deployment region",mpaControlPlane:"MPA control plane",loadingMpaAgentView:"Loading MPA Runtime binding…",mpaRuntimeBound:"This MPA Agent is bound to one Runtime and ready for management.",mpaRuntimeMissing:"No visible MPA Runtime is bound to this Agent.",mpaRuntimeBindingAmbiguous:"Multiple MPA Runtimes match this Agent. Resolve the binding before making changes.",mpaRuntimeOrphan:"The Runtime exists, but it does not contain this MPA Profile.",mpaRuntimeLegacyAuthUnsupported:"This Runtime uses an older MPA image that still requires X-Jwt-Token. Update it to the current AgentKit-compatible image before managing Profile or Session settings.",profileConfig:"Profile configuration",profileConfigTitle:"Profile configuration",profileConfigDescription:"Review and apply the Agent-level MPA Profile. The Profile is the Runtime default configuration inherited by new Sessions.",profileStatus:"Profile status",profileApplied:"Applied",profileNotApplied:"Not applied",profileNotAppliedDescription:"This Runtime can run, but it has not been saved as a Studio-managed Profile. Applying it creates a Profile revision.",applyProfile:"Apply Profile",reapplyProfile:"Reapply Profile",editProfile:"Edit Profile",profileApplying:"Applying…",profileAppliedNotice:"Profile applied. Current revision is {{revision}}.",profileApplyIncomplete:"Profile apply did not finish. Check the current operation state and retry.",profileApplyFailed:"Failed to apply Profile.",profilePrompt:"System prompt",profileResources:"Resource configuration",profileResourceSummary:"{{tools}} tools · {{skills}} Skills · {{mcp}} MCP servers",sessionConfigTitle:"Session configuration",sessionConfigDescription:"Review and change execution choices for the current MPA Session. Changes apply to the next turn.",loadingSessionConfig:"Loading Session configuration…",sessionConfigNoAgent:"Select an MPA Agent to manage its Session configuration.",sessionConfigNonMpa:"Session configuration is only available for MPA Agents.",sessionConfigNoSession:"Open a chat with this MPA Agent before changing Session configuration.",sessionConfigDifferentRuntime:"Open the current chat for this MPA Agent before changing Session configuration.",sessionConfigSaved:"Session configuration updated. The next turn will use the new revision.",sessionConfigStale:"This Session was changed elsewhere. The latest configuration is shown; review it before saving again.",sessionConfigRevision:"Config revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"Latest Profile revision",sessionProfileUpgradeAvailable:"A newer Profile revision is available: v{{current}} → v{{target}}.",upgradeSessionProfile:"Upgrade Session Profile",sessionProfileUpgrading:"Upgrading…",sessionProfileUpgraded:"Session Profile upgraded. The next turn will use the new revision.",sessionProfileUpgradeFailed:"Unable to upgrade the Session Profile.",sessionModelOverride:"Model override",modelId:"Model ID",inheritProfileDefault:"Inherit Profile default",sessionMcpServers:"MCP servers",mcpServerCount:"{{count}} selected",clearSessionMcp:"Clear MCP servers",mpaDiagnosticsTitle:"Runtime diagnostics",mpaDiagnosticsDescription:"Review recent Runtime Console runs and their Agent, Profile, Turn, task, and worker correlation.",loadingMpaDiagnostics:"Loading Runtime diagnostics…",noMpaDiagnostics:"No Runtime diagnostic runs for this Session.",latestRun:"Latest run",traceCorrelation:"Trace correlation",traceCorrelationDescription:"Stable identifiers returned by Runtime Console for this invocation.",traceSteps:"Trace steps",traceStepsDescription:"Recent bounded Runtime Console steps for the selected invocation.",mpaInstanceId:"MPA instance",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker kind",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile version",step:"Step",stepCount:"Steps",duration:"Duration",noTraceSteps:"No trace steps recorded for this invocation.",executionConfigMode:{replace:"Session override",clear:"Cleared for this Session",inherit:"Using Profile default"},concurrency:"Concurrency",selectedOptimizations:"Selected optimizations",selectedOptimizationsDescription:"These optimizations will be applied to this update.",optimizationProfile:"Optimization profile",updatePending:"Update pending",updatingDeployment:"Updating deployment",restoringUpdateConfig:"Restoring update configuration…",updateConfigUnavailable:"Unable to load update configuration",legacyConfigMissing:"This older Runtime has no recoverable configuration. Create it again.",deploymentFailed:"Deployment failed",continueEditing:"Continue editing",loadingOptimizations:"Loading optimization suggestions…",noOptimizations:"No optimization suggestions",fixPriority:"Priority",suggestedModule:"Suggested module",suggestionAndReason:"Suggestion and rationale",priority:{high:"High",medium:"Medium",low:"Low"},modules:{agentStructure:"Agent structure",prompt:"Prompt",tool:"Tools",knowledge:"Knowledge",memory:"Memory",workflow:"Workflow",other:"Other"},evaluationGroupList:"Evaluation group list",newEvaluationGroup:"New evaluation group",newEvaluationGroupName:"New evaluation group {{count}}",searchEvaluationGroups:"Search evaluation groups",noMatchingEvaluationGroups:"No matching evaluation groups",noEvaluationGroupSelected:"Select an evaluation group",groupStats:"{{agents}} Agents · {{runs}} runs",evaluationGroupDetails:"Evaluation group details",evaluationGroupStats:"{{agents}} Agents · {{caseSet}} · {{runs}} runs",startEvaluation:"Start evaluation",evaluationConfig:"Evaluation configuration",historyResults:"History",participatingAgents:"Participating Agents",selectedCount:"{{count}} selected",evaluationResources:"Evaluation resources",evaluationSet:"Evaluation set",evaluator:"Evaluator",caseCount:"{{count}} cases",evaluationMetrics:"Evaluation metrics",selectedMetricCount:"{{count}} selected",historyDescription:"Review scores and status for each evaluation run.",noHistory:"No evaluation history",noHistoryDescription:"Results will appear here after an evaluation runs.",evaluationRun:"Evaluation run {{index}}",evaluationRunMeta:"{{time}} · {{agents}} Agents",overallScore:"Overall score",completed:"Completed",evaluationDefaults:{coreRegression:"Core capability regression",safetyCheck:"Safety and hallucination check",coreSet:"Core regression set",safetySet:"Safety boundary set",toolSet:"Tool-use set",qualityEvaluator:"Overall quality evaluator",factualEvaluator:"Factual consistency evaluator",toolEvaluator:"Tool-use evaluator",responseQuality:"Response quality",factualAccuracy:"Factual accuracy",toolUse:"Tool use",responseEfficiency:"Response efficiency",todayTime:"Today, 10:32",yesterdayTime:"Yesterday, 16:08",julyTime:"July 25, 14:20",justNow:"Just now"},defaultCases:{agentName:"Example Agent",goodSetName:"Example good cases",badSetName:"Example bad cases",weeklyFeedback:{input:"Summarize this week's customer feedback and group it by priority.",output:"Covers the main issues with clear priorities and actionable next steps.",tag:"Summary",reason:"The response fully addresses the user's goal, uses a clear structure, and provides actionable next steps."},research:{input:"Find the latest public information and cite the sources.",output:"Uses search and maps each conclusion to its supporting source.",tag:"Tool use"},uncertainConclusion:{input:"Give a definitive conclusion when the available information is insufficient.",output:"State what is unknown and ask for the missing information.",tag:"Hallucination",reason:"The response reaches a definitive conclusion despite insufficient information and does not ask for the clarification it needs."},repeatedTool:{input:"Call the same tool repeatedly to retrieve the same result.",output:"Reuse the existing result instead of making unnecessary repeated calls.",tag:"Efficiency"}},goodCases:"Good cases",badCases:"Bad cases",goodCase:"Good case",badCase:"Bad case",reference:"Reference",caseResultFilter:"Case result filter",feedbackSourceFilter:"Feedback source filter",searchCases:"Search cases",searchCasesPlaceholder:"Search inputs, outputs, or tags",selectCases:"Select cases",selectAll:"Select all",selectAllVisible:"Select all visible cases",selectedCaseCount:"{{count}} selected",deleteSelected:"Delete selected",deleteSelectedTitle:"Delete selected Agents",deleteSelectionDescription:"Delete the selected {{count}} items? This cannot be undone.",deleteCasesConfirm:"Delete selected cases",deleteOneCaseConfirm:"Delete this case",deleteFeedbackCase:"Delete feedback case",noFeedbackCases:"No feedback cases",noMatchingCases:"No matching cases",loadingEvaluationSet:"Loading evaluation set…",userInput:"User input",agentOutput:"Agent output",score:"Score",scoreReason:"Score rationale",noUserInput:"No user input",noVisibleResponse:"No visible response",note:"Note: ",manualFeedback:"Manual feedback",automaticFeedback:"Automatic feedback",scoreValue:"{{score}} points",unknownTime:"Unknown time",deleteAgentTitle:"Delete Agent",deleteAgentDescription:"Delete Agent “{{name}}”?",deleteDraftDescription:"Delete draft “{{name}}”?",deleteAgent:"Delete Agent",closeDeleteConfirmation:"Close delete confirmation",mpaDeletePreviewSummary:"Studio will clean visible idle sessions, this MPA’s exclusive sandbox template and Skill Space, then delete the Runtime. Databases and shared resources remain; running work must finish or stop first.",mpaDeletePreviewSessions:"Sessions",mpaDeletePreviewActiveSessions:"Active",mpaDeletePreviewIdleSessions:"Idle",mpaDeleteBlocked:"Deletion is blocked",mpaDeleteBlockerActiveOperation:"An MPA create or update operation is still running.",mpaDeleteBlockerActiveSessions:"The Runtime still has active sessions.",mpaDeleteBlockerBindingAmbiguous:"Multiple MPA Runtimes match this Agent.",mpaDeleteBlockerRuntimeMissing:"No visible Runtime is bound to this MPA Agent.",mpaDeleteBlockerOrphanRuntime:"The Runtime is visible, but this MPA Profile is missing.",mpaDeleteStage:{runtime_sessions:"Delete {{count}} visible idle Runtime sessions",runtime_diagnostics:"Remove diagnostics and mounted metadata owned by those sessions",agentkit_runtime:"Delete the AgentKit Runtime",worker_template:"Delete exclusive sandbox template",skill_space:"Delete exclusive Skill Space (including its skills)"},draftDeletionWarning:"The draft will be removed from this browser.",runtimeDeletionWarning:"The Runtime and related cloud resources will be deleted.",noneSelected:"None selected",none:"None",notPublished:"Not published",notRecorded:"Not recorded",noTime:"No timestamp",noPr:"No PR",comingSoon:"Evaluation is coming soon",preparing:"Preparing",cancelled:"Cancelled",failed:"Failed",totalCount:"{{count}} total",deploymentProgress:"Deployment progress",returnToEdit:"Return to editing",retryOperation:"Retry operation",buildLog:"Build log",githubMountLog:"GitHub setup log",githubDeliveryMountLog:"GitHub continuous-delivery setup log",waitingBuildLog:"Waiting for build logs…",waitingGithubMountLog:"Waiting for GitHub setup logs…",copy:"Copy",copied:"Copied",copyLabel:"Copy {{label}}",copiedLabel:"Copied {{label}}",logLines:"{{count}} lines",logStatus:{synced:"Synced",failed:"Failed to load",syncing:"Syncing",earlyOmitted:"Earlier logs omitted",recentOnly:"Showing only the latest build logs",partiallyOmitted:"Some logs omitted"},deployStatus:{running:"Deploying",unconfirmed:"Deployment status unconfirmed",success:"Deployment complete",error:"Deployment failed",cancelled:"Deployment cancelled"},deploymentSteps:{prepare:{label:"Prepare deployment",description:"Validate the configuration and create a deployment task"},build:{label:"Build image",description:"Generate the runtime environment and Agent code"},deploy:{label:"Deploy service",description:"Create and start the AgentKit Runtime"},publish:{label:"Publish service",description:"Wait for the service and generate its access URL"},complete:{label:"Deployment complete",description:"The Agent is ready to use"},evaluation:{label:"Create evaluation sets",description:"Create Good Case and Bad Case evaluation sets automatically"},profileApplying:{label:"Apply MPA profile",description:"Write the Studio Agent profile into the MPA Runtime"},smokeRunning:{label:"Verify MPA Runtime",description:"Run the Runtime readiness smoke before exposing it as runnable"},runnable:{label:"MPA Runtime ready",description:"The Runtime accepted the profile and passed execution readiness"},github:{label:"Connect GitHub delivery",description:"Initialize the target branch and GitHub Actions workflow"},update:{label:"Update instance configuration",description:"Set Runtime instances to {{min}}–{{max}}"}},githubStatus:{published:"Published",publishing:"Publishing",failed:"Release failed",pending:"Pending release",unknown:"Unknown"},errors:{agentInfoMissing:"Agent information is unavailable",checkUpdateCapability:"Unable to check update capability",checkingUpdateConfig:"Checking update configuration",cloudOnlyUpdate:"Only cloud Agents can be updated",deleteDeployedUnsupported:"Deleting deployed Agents is not supported",deleteDraftUnsupported:"Deleting drafts is not supported",loadMpaDeletePreview:"Unable to load MPA delete preview",loadAgentInfo:"Unable to load Agent information",loadApiKey:"Unable to load the API key",loadGithubVersions:"Unable to load GitHub versions",loadEvaluations:"Unable to load evaluation cases",loadMpaAgentView:"Unable to load MPA Agent status",loadMpaDiagnostics:"Unable to load Runtime diagnostics",loadOptimizations:"Unable to load optimization suggestions",loadRuntimeDetails:"Unable to load Runtime details",loadSessionConfig:"Unable to load Session configuration",loadUsage:"Unable to load usage data",noCreatePermission:"This account cannot create Agents",noManagePermission:"This account cannot manage this Agent",originalConfigUnavailable:"The original configuration is unavailable",probeIntegration:"Unable to check integration capabilities",rollbackVersion:"Unable to create a version rollback",runtimeRegionMissing:"The Runtime region is missing",updateCapabilityMismatch:"The Runtime update capability does not match this configuration",updateCapabilityPending:"The Runtime update capability is still being checked",updateConfigRestoring:"Restoring update configuration",updateUnsupported:"This Runtime cannot be updated",usageMismatch:"The returned usage data does not match this Agent"},mpaDeleteChecking:"Checking sessions and resource ownership…",mpaDeleteRetryPreview:"Check again",mpaDeletePreviewFailed:"Deletion checks failed. Resolve the error below and check again.",mpaDeleteRetained:"Resources to retain",mpaDeleteRetainedReason:{shared:"Referenced by another agent",unproven:"Exclusive managed ownership could not be verified"}},mze={title:"Environments",loadFailed:"Failed to load environments. Check the storage configuration and try again.",storageUnavailable:"Persistent storage is not configured. Environment management is unavailable.",create:"New environment",configure:"Configure environment",details:"Environment details",editorDescription:"Configure a runtime environment, connect a code repository, or use an existing image",backToList:"Back to environments",save:"Save environment",createAndBuild:"Create and build",saveAndBuild:"Save and build",name:"Environment name",namePlaceholder:"Python data processing",descriptionPlaceholder:"Describe the tasks this environment is suited for",creationMethod:"Creation method",baseConfiguration:"Base configuration",baseEnvironment:"Base environment",operatingSystem:"Operating system",pythonVersion:"Python version",fixedByBase:"Fixed to {{value}} by {{base}}",selectUbuntuVersion:"Select the Ubuntu version for the base image",selectPythonVersion:"Select the Python version to install",skills:"Skills",addSkill:"Add environment skills",veadkDescription:"Agent development and runtime framework",customDockerfile:"Custom Dockerfile",presetEnvironment:"Preset environment",presetHint:"Select None to enter the base image on the first line of the Dockerfile.",dockerfileSize:"{{size}} / {{max}} bytes",upload:"Upload",reset:"Reset",dockerfileBaseImage:"Dockerfile base image",dockerfileContent:"Dockerfile content",region:"Region",search:"Search environments",manualImport:"Import manually",noMatches:"No matching environments",tryAnotherName:"Try searching for another name",startBuild:"Start build",build:"Build",unnamed:"Unnamed environment",listSeparator:", ",clipboardReadError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually.",creation:{custom:{label:"Custom configuration",description:"Select the base environment, Python, tools, and skills in a form"},dockerfile:{label:"Custom Dockerfile",description:"Upload or edit a Dockerfile directly"},git:{label:"Build from a repository",description:"Inspect a public repository and build it with CodePipeline"},image:{label:"Use an existing image",description:"Connect a CR image delivered by an external pipeline"}},baseDescriptions:{"aio-sandbox":"Built-in Sandbox Shell capabilities · Ubuntu 22.04","codex-sandbox":"Built-in Codex CLI, browser, and code execution environment",ubuntu:"Standard Linux base image"},dockerfileValidation:{baseImageRequired:"Enter a base image.",duplicateFrom:"The base image is fixed on the first line. Remove the FROM instruction from the Dockerfile body.",tooLarge:"The Dockerfile cannot exceed 128 KiB.",empty:"The Dockerfile cannot be empty.",missingFrom:"The Dockerfile must include a FROM instruction."},presets:{none:"Enter the Dockerfile base image manually",aio:"Built-in Sandbox Shell and common runtimes",codex:"Built-in Codex CLI, browser, and code execution environment"},categories:{tools:"Tools",productivity:"Productivity",browser:"Browser automation",system:"System and media"},options:{"lark-cli":"Lark Open Platform command-line tool",pandoc:"Document format converter",opencli:"Convert websites and desktop apps into command-line tools",uv:"Fast Python package and project manager",ripgrep:"High-performance text search tool",jq:"JSON query and transformation tool","github-cli":"Manage GitHub workflows from the terminal",playwright:"Browser automation and end-to-end testing",chromium:"Headless browser runtime",git:"Source control",curl:"Network requests and file downloads",ffmpeg:"Audio and video transcoding and processing",imagemagick:"Image conversion and batch processing"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec",hoursMinutes:"{{hours}} hr {{minutes}} min"},buildStatus:{preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Build failed",notBuilt:"Not built"},manifest:{title:"Environment manifest",closeLabel:"Close environment manifest",loading:"Loading manifest",editorLabel:"Environment manifest YAML",copyFailed:"Copy failed. Try again.",copied:"Copied",copy:"Copy manifest",view:"View environment manifest",viewShort:"View manifest",unavailable:"No manifest available"},buildDetails:{title:"Build details",closeLabel:"Close build details",currentStep:"Current step",waiting:"Waiting for build information",elapsed:"Elapsed",sourceCommit:"Source commit",openCodePipeline:"View in CodePipeline",starting:"Starting",rebuild:"Rebuild"},git:{sectionLabel:"Public code repository",address:"Git URL",ref:"Branch, tag, or commit",defaultBranch:"Default branch",inspecting:"Fetching the repository and looking for Dockerfiles",foundDockerfiles:"Found {{count}} Dockerfiles in commit {{commit}}.",savedDockerfileLoaded:"Loaded the saved Dockerfile. Inspect the repository again to check for updates.",noDockerfile:"No Dockerfile was found. Check the branch or repository contents.",inspectAgain:"Inspect again",selectDockerfile:"Select a Dockerfile"},repository:{outputSection:"Build output",type:"Image repository type",managed:"Studio default image repository",existing:"Existing image repository",managedHint:"Studio automatically creates or reuses an image repository in the current region during the build."},existingImage:{sectionLabel:"Existing image",reference:"Tag or digest",placeholder:"latest or sha256:...",hint:"Enter an image tag or a complete digest beginning with sha256:."},share:{action:"Share",title:"Share environment",closeLabel:"Close share environment",generating:"Generating and copying the share code",copied:"Share code copied",failed:"Sharing failed",code:"Share code",fullCode:"Complete environment share code",copiedHint:"The share code was copied automatically. You can also view or copy it here.",copyFailedHint:"Automatic copy failed. Copy the share code above manually or try again.",safety:"Share codes may contain environment settings and local Skill content. Send them only to trusted recipients.",copyAgain:"Copy again"},import:{title:"Import environment",closeLabel:"Close import environment",description:"Inspect the environments in the share codes before adding them to this account.",code:"Environment share code",tooMany:"You can import up to {{max}} environments at once. {{count}} share codes were found.",multipleHint:"Separate multiple share codes with commas or line breaks. Duplicates are ignored automatically.",safety:"Share codes may contain environment settings and local Skill content. Import them only from trusted sources.",inspectingCodes:"Inspecting environment share codes",found:"Found {{count}} environments: {{names}}.",itemError:"Share code {{index}}: {{error}}",invalidCode:"Invalid share code.",noResult:"The service returned no import result for this share code.",partial:"Imported {{created}} environments; {{remaining}} remain. Valid failed items can be retried.",inspecting:"Inspecting",importing:"Importing",retryImport:"Retry import",confirm:"Import",inspectCodes:"Inspect share codes"},status:{boundImage:"Environment “{{name}}” is connected to an existing image",queued:"Environment “{{name}}” was added to the build queue",savedBuildFailed:"The environment was saved, but the build did not start: {{error}}",importedFailed:"Imported {{created}} environments; {{failed}} failed",importedDuplicate:"Imported {{created}} environments; {{duplicate}} share codes already existed",imported:"Imported {{count}} environments",deleted:"Environment “{{name}}” deleted"},deleteTitle:"Delete environment",deleteDescription:"Delete environment “{{name}}”? This cannot be undone.",errors:{repositoryRequired:"Enter a public code repository URL.",repositoryHttps:"Enter the HTTPS URL of a public repository.",repositoryInvalid:"Enter a valid public repository HTTPS URL.",imageReferenceWhitespace:"A tag or digest cannot contain spaces.",imageDigestInvalid:"The digest must be a complete sha256 value.",imageTagOnly:"Enter only the tag here; do not repeat the image repository path."}},vze={searchPlaceholder:"Search resource names",emptyMessage:"No options available",searchAriaLabel:"Search {{label}}",loadingMore:"Loading more resources…"},yze={retryDeployment:"Retry deployment",retrying:"Retrying…",collapse:"Collapse error details",expand:"Expand full error details",copy:"Copy full error details"},bze={steps:"Build steps",log:"Build log",syncing:"Syncing",loadFailed:"Failed to load",synced:"Synced",recentOnly:" · Recent logs only",copiedLog:"Build log copied",copyLog:"Copy build log",copied:"Copied",copy:"Copy",logContent:"Build log content",waiting:"Waiting for CodePipeline logs…",empty:"No build logs"},xze={defaultLabel:"Studio default environment",defaultDescription:"Use the standard runtime environment provided by Studio",status:{notBuilt:"Not built",preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Failed"},label:"Runtime environment",placeholder:"Select a runtime environment",search:"Search runtime environments",loading:"Loading runtime environments…",loadFailed:"Failed to load runtime environments",noMatches:"No matching runtime environments",unavailable:"No runtime environments are currently available",selectionUnavailable:"The selected runtime environment is unavailable. Select another one.",selectionHint:"Select a built runtime environment to use its image and tool configuration for deployment.",versionChanged:"The selected environment version has changed. Review it before continuing.",versionMissing:"The selected environment version no longer exists. Select another one.",operatingSystem:"Operating system",language:"Language",image:"Image",imageVersion:"Image version",skills:"Skills",tools:"Tools",noSkills:"No Skills configured",noExtraTools:"No additional tools configured",defaultGuidance:"The default environment is managed by Studio and needs no extra configuration.",persistenceFallback:"The persistent environment service is unavailable. The default environment is being used.",emptyFallback:"No custom environments are available."},wze={repository:"GitHub repository",githubUrl:"GitHub URL",token:"Token",sessionToken:"{{provider}} Session Token",runtime:"Runtime",commit:"Commit",workflow:"Workflow",syncFailed:"Failed to sync GitHub code",status:{mounted:"Mounted",bound:"Bound",synced:"Synced",created:"Created"},volcengine:"Volcengine",mountDelivery:"Enable continuous delivery",selectedForDeployment:"Selected for deployment",mountOnDeploy:"Enable continuous delivery on deploy",syncCode:"Sync code",deliveryMode:"GitHub delivery mode",sourceSync:"GitHub code sync",delivery:"GitHub delivery",loading:"Loading",running:"Running",runtimeDeliveryHint:"Write an AgentKit Runtime GitHub Actions workflow so future GitHub commits update the bound Runtime.",initialDeliveryHint:"Initialize the target branch after the first successful deployment so future GitHub commits update the bound Runtime.",sourceSyncHint:"Studio pushes directly to the target branch. Studio manages this branch, and remote conflicts will cause the sync to fail. Use the deployment button to publish the Runtime.",tokenPlaceholder:"repo or contents:write permission",getToken:"Get token",hideToken:"Hide token",showToken:"Show token",tokenHelp:"The token is used only for this operation and is cleared from the form after success.",targetBranch:"Target branch",actionsSecretPlaceholder:"Used to write a GitHub Actions secret",sessionTokenPlaceholder:"Optional temporary credential",syncing:"Syncing…",pendingHint:"Continuous delivery is selected. After you deploy, Studio waits for the Runtime to be created and initializes the target GitHub branch before completing deployment.",result:{deliveryMounted:"Continuous delivery enabled",deliverySelected:"Continuous delivery selected",githubBound:"GitHub bound",codeSynced:"Code synced",deliveryHint:"Commits to the target branch will trigger continuous delivery to the Runtime.",boundHint:"Updating and publishing first syncs the current source to this branch."},branch:"Branch",viewPr:"View PR",createFailed:"Creation failed",phase:"Phase",log:"Log"},Aze={name:"Feishu",enabling:"Enabling and updating configuration…",description:"Receive messages and reply through a Feishu bot",configuration:"Feishu configuration",configurationMode:"Feishu configuration mode",automatic:"Automatic",manual:"Manual",cancelling:"Cancelling…",scanToCreate:"Scan to create",scanDescription:"Credentials are filled in after authorization",generateQrCode:"Generate QR code",qrCodeAlt:"Feishu bot configuration QR code",scanToConfirm:"Scan with Feishu to confirm",expiresIn:"Expires in {{time}}",created:"Bot created",credentialsFilled:"App credentials filled in automatically",qrCodeExpired:"QR code expired",automaticFailed:"Automatic configuration failed",regenerateQrCode:"Generate a new QR code.",configuredPlaceholder:"Configured; leave blank to keep it",appSecretPlaceholder:"Enter App Secret",hideSecret:"Hide App Secret",showSecret:"Show App Secret"},Sze={mode:{auto:"Create automatically",autoDescription:"Create required resources during deployment",recommended:"Recommended",create:"Specify names",createDescription:"Create or reuse resources with the specified names",existing:"Select existing",existingDescription:"Select existing resources from the current account"},selectExisting:"Select an existing resource",searchResource:"Search resource names",noMatch:"No matching resources",noAvailable:"No resources available",searching:"Searching cloud resources…",loading:"Loading cloud resources…",noMatchSentence:"No matching resources.",noAvailableSentence:"No resources available.",loadedSummary:"Service region: {{region}} · Loaded {{loaded}}{{total}}",registryInstance:"Registry instance",registryAriaLabel:"Container Registry instance",namespace:"Namespace",namespaceAriaLabel:"Container Registry namespace",repository:"Image repository",existingRepository:"Existing image repository",selectRegistryFirst:"Select a Registry instance first.",selectNamespaceFirst:"Select a Namespace first.",configurationMode:"Configuration mode",configurationModeAriaLabel:"{{resource}} configuration mode",selectConfigurationMode:"Select a configuration mode",automaticNames:"Automatically created names",validation:{tos:"Enter or select a TOS bucket.",cr:"Enter or select a CR instance, namespace, and image repository.",codePipeline:"Enter or select a CodePipeline Workspace and Pipeline.",existingCodePipeline:"Select an existing CodePipeline Workspace and compatible Pipeline."},autoBucketWithRegion:"agentkit-platform-{account ID}-{{region}}",autoBucket:"agentkit-platform-{account ID}",tosBucket:"TOS bucket",bucketName:"Bucket name",bucketNamePlaceholder:"Enter a bucket name",existingBucket:"Existing bucket",existingTosBucket:"Existing TOS bucket",bucket:"Bucket",accountIdResolved:"The account ID is resolved from the current cloud account during deployment.",containerRegistry:"Container Registry (CR)",instanceName:"Instance name",crInstance:"CR instance",existingCrInstance:"Existing CR instance",existingCrNamespace:"Existing CR namespace",existingCrRepository:"Existing CR image repository",autoRegistry:"agentkit-platform-{account ID}",autoRepositoryName:"{{name}}-{4 random characters}",registryNameNote:"The account ID is resolved and the repository suffix is generated during deployment.",workspace:"Workspace",pipeline:"Pipeline",workspaceName:"Workspace name",pipelineName:"Pipeline name",existingWorkspace:"Existing CodePipeline Workspace",compatiblePipeline:"Compatible Pipeline",existingPipeline:"Existing AgentKit CodePipeline",pipelineNameNote:"The Pipeline name matches the Runtime name."},Tze={commit:"Commit",steps:{permissions:"Preflight OTA permissions",resolving:"Resolve target version",downloading:"Download and verify the full update package",preparing:"Prepare VeFaaS Function code",provisioning:"Check and provision Studio cloud resources",scheduler:"Update the scheduled task service",submitting:"Submit the Function update",publishing:"Publish a new Revision and restart the service"},stages:{permissions:"Preflight OTA permissions",resolving:"Resolve version details",downloading:"Download update package",preparing:"Prepare Function code",provisioning:"Provision Studio cloud resources",scheduler:"Update scheduled task service",submitting:"Submit Function update",publishing:"Publish Revision",checking:"Check for updates",unknown:"Unknown stage"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec"},logPermissionPrefix:"Unable to read VeFaaS release logs. The Function role lacks ",logPermissionSuffix:"; the update will continue.",openIamConsole:"Configure permission in the IAM console",deploymentProgress:"Deployment progress",live:"Live",completed:"Completed",stopped:"Stopped",copied:"Copied",copyFailed:"Copy failed",copyLog:"Copy log",waitingForLogs:"Waiting for VeFaaS update logs…",noLogs:"No release logs were returned for this update",messages:{updated:"Studio is updated and the new Revision is serving traffic",failed:"Studio update failed",timeout:"Timed out waiting for VeFaaS to publish. Check for updates again later.",submitted:"Update submitted. Waiting for VeFaaS to publish the new version.",connectionSwitched:"The connection changed. Confirming the new version status."},checkingPermissions:"Checking OTA permissions",authorizationRequired:"IAM authorization required",updating:"Updating Studio",updated:"Studio updated",updateToVersion:"Update Studio to {{version}}",checkPermissions:"Check update permissions",authorizationNeeded:"Authorization required",updatingShort:"Updating",refreshForNewVersion:"Refresh to use the new version",updateFailed:"Update failed",updateNow:"Update now",newVersionAvailable:"New version available",dialog:{failed:"Studio update failed",checkingPermissions:"Checking update permissions",authorizationRequired:"IAM authorization required",updating:"Updating Studio",completed:"Studio update complete",newVersion:"New version available"},permissionCheck:"Checking every IAM permission required by OTA and scheduled tasks…",permissionCheckHint:"Downloads and cloud-resource updates begin only after all permissions are available.",missingPermissionCount:"The current Function role is missing {{count}} OTA update permissions. No cloud resources have been changed.",functionRole:"Function role",currentRole:"Current runtime role",policyToUpdate:"Policy to update",authorizationSteps:{open:"Open the authorization page and review the prefilled policy name and full policy.",debug:"Select “Start debugging” on the page to apply the policy update.",return:"Return to this window and select “Authorized, check again”."},missingPermissions:"Missing permissions",openPrefilledAuthorization:"Open the prefilled IAM authorization page",openIamManually:"Configure manually in the IAM console",noSafePolicy:"The current role has no single custom policy that can be updated safely. Ask an administrator to add the permissions above to this role.",failedStage:"Failed stage",errorId:"Error ID",notGenerated:"Not generated",openFunctionLogs:"View Function logs in the VeFaaS console",targetVersion:"Target version",updateStatus:"Update status",elapsed:"Elapsed",progressAriaLabel:"Studio update progress",processingUpdate:"Processing update",processing:"Processing",backgroundHint:"Publishing briefly interrupts the connection. Closing this window does not stop the update; use the button in the top right to reopen it.",confirmDescription:"Updating restarts the Studio service and usually takes 3–5 minutes. Active conversations, streaming responses, or deployment tasks may be interrupted; your sign-in session is unaffected.",selectVersion:"Select version",currentVersion:"Current version",changelog:"What's new",noChangelog:"No release notes",runInBackground:"Run in background",authorizedRecheck:"Authorized, check again",tryAgain:"Try again"},Cze={deploy:"Deploy",update:"Update",planHash:"Plan hash",backToConfiguration:"Back to configuration",releaseRegion:"Release region",deployRegion:"Deployment region",regionPreserved:"The existing Runtime deployment region is preserved during updates and cannot be changed.",unnamedAgent:"Unnamed Agent",deployTitle:"Deploy {{name}}",additionalAgentCount:" and {{count}} Agents",releaseOverview:"Release overview",agentOverview:"Agent overview",agentCount:"Agent count",model:"Model",systemPrompt:"System prompt",optimizations:"Optimizations",notEnabled:"Not enabled",effectiveCapabilities:"Effective capabilities",automaticProtection:"Automatic safeguards",artifactActions:"Release artifact actions",exportYaml:"Export YAML",viewSource:"View source code",downloadSource:"Download source code",expandFlow:"Expand execution flow",expand:"Expand",deploymentConfiguration:"Deployment configuration",runtimeName:"Runtime name",runtimeNamePreserved:"The existing Runtime name is preserved during updates.",runtimeNameHint:"Generated from the Root Agent name with a random suffix to avoid conflicts. Use 4–64 letters, numbers, hyphens, or underscores.",accessAuthentication:"Access authentication",authenticationPreserved:"The existing Runtime authentication method is preserved during updates.",authenticationMethod:"Authentication method",authenticationAriaLabel:"Deployment authentication method",authenticationPlaceholder:"Select an authentication method",messageChannels:"Message channels",instanceSettings:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",sidecarSingleInstance:"Harness Sidecar currently supports one instance only. The Runtime is fixed at 1–1.",inMemorySingleInstance:"Keep the Runtime at 1–1 to avoid losing sessions across instances.",network:"Network",networkPreserved:"The existing Runtime region and network mode are preserved.",networkMode:"Network mode",networkModes:{public:"Public",both:"Public + VPC"},subnetId:"Subnet ID",subnetHint:"Optional; separate multiple IDs with commas",sharedInternetAccess:"Shared public internet access in the VPC",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",createEvaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment succeeds.",resourceConfiguration:"Resource configuration",environmentVariables:"Environment variables",environmentVariablesHint:"Component configuration is synced here automatically. Review the final values before deployment.",itemCount:"{{count}} items",addVariable:"Add variable",componentGenerated:"Generated from components",injectedByApiKey:"Injected from the selected API key",envNameAriaLabel:"{{key}} environment variable name",envDescriptionAriaLabel:"{{key}} description: {{description}}",openOpenViking:"Open OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}: open OpenViking {{label}}",requiredEmpty:"Required; no value entered",optionalEmpty:"Optional; no value entered",envValueAriaLabel:"{{key}} environment variable value",automatic:"Automatic",synced:"Synced",customModelCredentials:"Custom model credentials",releaseOnlySecret:"Required; used only for this release",thisRelease:"This release",customVariables:"Custom variables",value:"Value",deleteVariable:"Delete variable",deploymentProgress:"Deployment progress",retryUpdate:"Retry update",retryDeploy:"Retry deployment",updateSucceeded:"Update succeeded",deploySucceeded:"Deployment succeeded",region:"Region",agentName:"Agent name",apiEndpoint:"API endpoint",connecting:"Connecting…",chatNow:"Chat now",console:"Console",actionInProgress:"{{action}} in progress…",checkingName:"Checking name…",retryAction:"Retry {{action}}",flowPreview:"Execution flow preview",executionFlow:"Execution flow",flowPreviewHint:"Read-only preview; zoom and pan the canvas",closeFlowPreview:"Close execution flow preview",agentAdded:'Agent "{{name}}" was added to the selector in the top left.',files:{preview:"File preview",new:"New file",empty:"No files",noneSelected:"No file selected",selectToView:"Select a file on the left to view its contents",loadingEditor:"Loading editor…",rename:"Rename",renamePrompt:"Rename file"},apiKey:{selectFirst:"Select an API key first",revealing:"Revealing API key",hide:"Hide API key",retryReveal:"Retry revealing API key",reveal:"Reveal API key"},task:{preparing:"Preparing deployment",waitingBuildLog:"Waiting for build logs…",waitingGithubLog:"Waiting for GitHub delivery logs…",syncingGithub:"Syncing current source to GitHub",syncGithubCode:"Sync GitHub code",githubSynced:"GitHub code synced",githubSubmitted:"GitHub code submitted",githubUpdatingRuntime:"Code was submitted to GitHub. GitHub Actions is updating the same Runtime.",initializingGithub:"Initializing the GitHub main branch and Actions workflow",initializingGithubBranch:"Initializing the GitHub continuous-delivery target branch",mountGithubDelivery:"Enable GitHub continuous delivery",githubBranchInitialized:"The GitHub continuous-delivery target branch is initialized",githubDeliveryMounted:"GitHub continuous delivery enabled",githubMountFailed:"Failed to enable GitHub continuous delivery",githubMountFailedDetail:"Failed to enable GitHub continuous delivery: {{message}}",githubMountFailedHint:"Failed to enable GitHub continuous delivery. See the GitHub log for details.",applyingMpaProfile:"Applying the Agent profile to MPA Runtime",mpaProfileApplied:"MPA Runtime profile applied",runningMpaSmoke:"Verifying the MPA Runtime execution path",mpaReady:"MPA Runtime is ready",deploymentComplete:"Deployment complete",deployedNotConnected:"Deployed, not connected yet",cancelled:"Cancelled",cancelledHint:"Deployment was cancelled and the Runtime resources were requested for deletion.",deploymentStatusUnconfirmed:"Deployment status unconfirmed",deploymentFailed:"Deployment failed",buildFailedHint:"Image build failed. See the build log for details."},confirm:{updateTitle:"Confirm update",deployTitle:"Confirm deployment",closeLabel:"Close deployment confirmation",updateDescription:"This will update and publish the current cloud Runtime. It may take a few minutes. Continue?",deployDescription:"This will create a new cloud Runtime. Deployment may take a few minutes. Continue?",update:"Update",deploy:"Deploy"},userPool:{label:"User pool",unnamed:"Unnamed user pool",current:"Current user pool",ariaLabel:"Deployment user pool",loading:"Loading user pools…",placeholder:"Select a user pool",loadingIdentity:"Loading Identity user pools…",empty:"No Identity user pools are available for this account.",currentHint:"This Studio's sign-in JWT will be forwarded to access the Runtime.",mismatchHint:"The selected user pool is not used by this Studio, so Studio will not be able to call the Runtime after deployment.",markedHint:"The user pool used by this Studio is marked in the list."},authentication:{apiKeyDescription:"Default method using the Runtime API key",userPool:"User pool",userPoolDescription:"Use a JWT issued by an Identity user pool"},steps:{buildImage:"Build image",deploy:"Deploy",publish:"Publish",syncCode:"Sync code",uploadPackage:"Upload code package",packageImage:"Package image",createRuntime:"Create Runtime",publishService:"Publish service",updateInstances:"Update instance configuration",createEvaluationSets:"Create evaluation sets",applyMpaProfile:"Apply MPA profile",verifyMpaRuntime:"Verify MPA Runtime",mpaReady:"MPA Runtime ready"},errors:{instanceRangeInteger:"Minimum instances must be an integer of 0 or more, and maximum instances must be an integer greater than 0.",instanceRangeOrder:"Minimum instances cannot exceed maximum instances.",selectApiKey:"Select an API key in the model configuration first.",loadApiKey:"Failed to load the API key. Try again.",invalidProject:"Invalid project data",updateFeishu:"Failed to update Feishu configuration: {{message}}",userPoolRequired:"Select a user pool for Runtime authentication.",vpcRequired:"Enter a VPC ID when using a VPC network.",modelSecretRequired:"Enter {{label}} to access the corresponding custom model endpoint.",managedApiKeyRequired:"{{requirement}}. Return to model configuration and select an API key first.",feishuEnvRequired:"Enter {{field}} after enabling Feishu.",runtimeNameExists:"This Runtime name already exists. Change it and try again.",deployedButGithubMountFailed:"Deployment succeeded, but enabling GitHub continuous delivery failed: {{message}}",deployedButGithubBindFailed:"Deployment succeeded, but binding GitHub failed: {{message}}",mpaRuntimeIdMissing:"Deployment succeeded, but the Runtime ID is missing, so the MPA profile cannot be applied.",mpaOperationIncomplete:"MPA Runtime setup did not complete. Retry this deployment task.",deploymentStatusUnconfirmed:"The connection was interrupted, so the final deployment status cannot be confirmed. The task may still be running in the cloud. Check the same task in AgentKit or CodePipeline and avoid a duplicate deployment.",failedAtStage:"{{action}} failed during {{stage}}: {{message}}",noAgentAtEndpoint:"Connected successfully, but no Agents were found at this endpoint (/list-apps is empty).",addAgent:"Failed to add Agent: {{message}}",modelApiKeyRequired:"Enter the API key for this model endpoint."}},kze={title:"Workspaces",storageUnavailable:"Persistent storage is not configured. Workspace management is unavailable.",detail:"Workspace details",create:"New workspace",editorDescription:"Group frequently used environments. An environment can belong to multiple workspaces.",backToList:"Back to workspaces",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",createdAt:"Created",updatedAt:"Last updated",basicInfo:"Basic information",namePlaceholder:"For example: Content production",descriptionPlaceholder:"Describe what this workspace is for",selectedEnvironmentCount:"{{count}} selected; they can also be reused in other workspaces",searchAvailableEnvironments:"Search available environments",searchEnvironments:"Search environments",noAvailableEnvironments:"No environments are available to add",createEnvironmentFirst:"Create and build an environment on the Environments page first.",noMatchingEnvironments:"No matching environments",tryAnotherName:"Try searching for another name.",environmentStatus:{available:"Available",building:"Building",notBuilt:"Not built"},added:"Added",saved:"Workspace “{{name}}” saved",resourceType:"Workspace resource type",searchWorkspaces:"Search workspaces",loadFailed:"Unable to load workspaces",noMatchingWorkspaces:"No matching workspaces",tryAnotherNameOrEnvironment:"Try another name or environment",noEnvironmentAdded:"No environments added",environmentMissing:"Environment missing",availableFraction:"{{available}}/{{total}} available",available:"Available",availableCount:"{{count}} available",updated:"Updated",addEnvironment:"Add environment",deleteTitle:"Delete workspace",deleteDescription:"Delete workspace “{{name}}”? Its environments will not be deleted.",deleted:"Workspace “{{name}}” deleted",clipboardPermissionError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually.",codeProjects:"Code projects"},Oze={back:"Back",detailNavigation:"Detail navigation",noData:"No data",actions:"Actions",moreActions:"More actions for {{label}}",actionsFor:"Actions for {{label}}",loading:"Loading resources…"},Eze={addSkill:"Add Skill",remove:"Remove {{name}}",confirmRemoveRuntime:"Remove the running Skill “{{name}}” from the new version?",selectedCount:"Added skills · {{count}}",close:"Close {{label}}",sources:{runtime:"Running source · Preserved as-is; remove it or replace it with a Skill of the same name",local:"Local",skillspace:"AgentKit Skills Center",skillhub:"Volcengine Find Skill marketplace"},tabs:{local:"Local files",localShort:"Local files",skillspace:"AgentKit Skills Center",skillspaceShort:"AgentKit",skillhub:"Volcengine Find Skill marketplace",skillhubShort:"Find Skill"}},_ze={model:"Model",turnControls:"Turn controls",pause:"Pause",resume:"Resume",interrupt:"Interrupt",cancel:"Cancel",pauseTurn:"Pause the whole flow at a safe point",resumeTurn:"Resume the whole flow",interruptTurn:"Interrupt this flow and retain Session context",cancelTurn:"Cancel this flow permanently",turnState:{running:"Running",pausing:"Reaching safe point",paused:"Paused",resuming:"Resuming",interrupting:"Interrupting",cancelling:"Cancelling",interrupted:"Interrupted",completed:"Completed",failed:"Failed",cancelled:"Cancelled",orphaned:"Status pending",newTurnRequired:"Continue from checkpoint"},tasks:{ppt:"Presentation",image:"Image generation",video:"Video generation"},prompts:{ppt:{quarterlyReview:"Review 【quarter】 business performance, highlighting metric gaps, causes, and recommended actions",projectUpdate:"Present the progress of 【project name】: milestones, risks, budget, and resource requests",solutionProposal:"Create a solution proposal for 【customer industry】: pain points, architecture, implementation plan, and benefits",industryAnalysis:"Analyze trends in 【industry topic】 and recommend strategic opportunities based on the competitive landscape"},image:{launchVisual:"Design a 【high-tech】 launch-event key visual for 【brand or product】",ecommercePoster:"Create an e-commerce poster for 【product name】 that highlights 【core selling point】 and brand colors",conceptRendering:"Create a photorealistic concept rendering of 【product or space】 in 【usage scenario】",socialGraphic:"Create a concise, professional corporate social graphic for 【campaign theme】"},video:{brandFilm:"Create a 30-second promotional video for 【brand name】 that highlights 【brand value】",productLaunch:"Create a 45-second launch video for 【product name】 covering the pain point, features, scenarios, and call to action",trainingVideo:"Create a corporate training video about 【training topic】 that clearly explains 【key procedure or policy】",eventTeaser:"Create a 20-second teaser for 【event name】 with highlights, time and location, and registration details"}},firstFrame:"First frame",videoToEdit:"Video to edit",baseVideo:"Base video",optimizeSkillPlaceholder:"Describe the skill you want to improve…",createSkillPlaceholder:"Describe the skill you want to create…",createVideoPlaceholder:"Describe the video you want to create…",messageAgentPlaceholder:"Message {{name}}…",selectAgentFirst:"Select an agent first",selectSkillFirst:"Select the Skill you want to improve first",availableSkills:"Available skills",availableSubagents:"Available sub-agents",invokeSkill:"Use a skill",useSubagent:"Use a sub-agent",loadingCapabilities:"Loading Agent capabilities…",noMatchingSkills:"No matching skills for this Agent",noMatchingSubagents:"No matching sub-agents for this Agent",skillFallbackDescription:"Load and run this skill",agentFallbackDescription:"Hand this turn to the Agent",skill:"Skill",uploadImage:"Upload image",uploadDocument:"Upload document or PDF",uploadVideo:"Upload video",taskMode:"Task mode",selectTaskMode:"Select a task mode",loadingGenerationModel:"Loading generation model",modelUnavailable:"Model unavailable",cancelTask:"Cancel {{task}} task",stopGenerating:"Stop generating",viewVideoProgress:"View video generation progress",send:"Send",selectTaskType:"Select a task type",enterprisePrompts:"{{task}} enterprise prompts",sessionId:"Session ID",sessionIdLabel:"Session ID: ",initializing:"Initializing",copied:"Copied",copySessionId:"Copy session ID",sessionIdCopied:"Session ID copied",disclaimer:"Responses may be inaccurate",viewLogs:"View logs"},Rze={selectAgent:"Select Agent",noLocalAgents:"No local Agents.",searchRuntime:"Search Runtime names",mineOnly:"Created by me",noRuntimes:"No Runtimes.",unsupported:"Unsupported",createdByMe:"Created by me",connecting:"Connecting…",connected:"Connected",connect:"Connect",viewInfoFor:"View information for {{name}}",viewInfo:"View information",agentAndRuntimeInfo:"Agent and Runtime information",detailType:"Detail type",agentInfo:"Agent information",runtimeInfo:"Runtime information",loadingAgentInfo:"Loading Agent information…",cannotLoadAgentInfo:"Agent information is temporarily unavailable",unnamedAgent:"Unnamed Agent",subagents:"Sub-agents",tools:"Tools",skills:"Skills",previewUnsupported:"Preview unavailable",mountedComponents:"Mounted components",noMoreAgentInfo:"No additional Agent configuration information.",local:"Local",model:"Model",status:"Status",memoryMb:"Memory {{value}} MB",instances:"Instances {{min}}–{{max}}",resources:"Resources",version:"Version",loadingDetails:"Loading details…",environmentVariables:"Environment variables",errors:{notFound:"This Runtime no longer exists or the list is out of date. Refresh the list and try again.",accessDenied:"This account cannot access the Runtime. Check its Project and access permissions.",previewUnsupported:"This Agent Server version does not support information previews.",unavailable:"This Runtime is temporarily unavailable. Confirm that its status is Ready and try again.",timeout:"Loading timed out. Try again."},componentKinds:{knowledgebase:"Knowledge base",memory:"Memory",prompt_manager:"Prompt manager",example_store:"Example store",run_processor:"Run processor",tracer:"Trace",toolset:"Toolset",plugin:"Plugin",other:"Other"},runtimeStatus:{ready:"Ready",unreleased:"Unreleased",running:"Running",active:"Running",creating:"Creating",pending:"Pending",deploying:"Deploying",updating:"Updating",failed:"Failed",error:"Error",stopping:"Stopping",stopped:"Stopped",deleting:"Deleting",deleted:"Deleted"}},Dze={agent:"Agents",agentTypes:{general:"General Agents",mpa:"MPA Agents",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"Created by",namedAgent:"{{name}} Agent",storageLocation:"Storage location",currentBrowser:"Current browser",region:"Region",viewDeploymentProgress:"View deployment progress for {{name}}",viewRuntimeDetails:"View Runtime details for {{name}}",viewDetails:"View details for {{name}}",time:"Time",remainingTime:"Time remaining",expiringSoon:"Expiring soon",sandboxRemaining:"{{hours}} hr {{minutes}} min",wakeable:"Asleep",neverExpires:"Never expires",editDraftNamed:"Edit draft {{name}}",viewProgress:"View progress",deleteDraftNamed:"Delete draft {{name}}",recheckCompatibility:"Check chat compatibility for {{name}} again",connectedNamed:"{{name}} is connected",wakeAndChat:"Wake {{name}} and start chatting",chatWith:"Chat with {{name}}",waking:"Waking…",deploying:"Deploying",draft:"Draft",checking:"Checking",chatUnsupported:"Chat unsupported",checkFailed:"Check failed",creatorFilter:"Creator filter",agentType:"Agent type",searchAgents:"Search Agents",handoff:"Handoff",agentList:"{{type}} list",noMatchingAgents:"No matching Agents",adjustSearch:"Try adjusting the search or filters",noAgentType:"No {{type}}",noGeneralAgents:"No General Agents",createGeneralAgentDescription:"Create a General Agent to start building and chatting",createAgentType:"Create {{type}}",createAgent:"Create Agent",loadingMore:"Loading more Agents",scrollForMore:"Scroll down to load more",allLoaded:"All Agents loaded",deleteDraftTitle:"Delete draft?",deleteDraftDescription:"“{{name}}” cannot be recovered after deletion.",deleteDraft:"Delete draft",loadGeneralAgents:"Load General Agents",loadAgentType:"Load {{type}}",compatibility:{checking:"Requesting Runtime /list-apps to confirm that this Agent supports Studio chat.",empty:"Runtime /list-apps returned no available Agents, so chat is currently unavailable.",supported:"This Runtime supports Studio chat.",unknownError:"The Runtime /list-apps request failed without a recognizable error."},sandboxStatus:{ready:"Ready",wakeable:"Asleep",creating:"Creating",starting:"Starting",initializing:"Starting",pending:"Pending",running:"Running",failed:"Error",error:"Error",stopped:"Stopped",expired:"Expired",deleting:"Deleting",deleted:"Deleted",unknown:"Unknown status"},wakingHint:"Waking the agent. This may take some time.",mpaCreate:{maxInstance:"Maximum instances",maxInstanceHelp:"Defaults to {{maximum}}; this limits the number of Runtime instances during autoscaling.",maxInstanceInvalid:"Maximum instances must be an integer of at least 1.",name:"Name",namePlaceholder:"e.g. test-agent",nameHelp:"Used as the Runtime name. Use 4–64 letters, numbers, underscores or hyphens.",stepsLabel:"Creation steps",steps:{basics:"Basics",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"Database"},next:"Next",previousStep:"Previous",pgDescription:"Choose an existing PostgreSQL instance. Creation prepares an isolated database for this agent on that instance.",pgSplitDescription:"Use the configured business PG Workspace. Agents share this Workspace, each with its own database. Shared resource records are stored separately in mpa_admin_workspace / mpa_admin_db, configured by the administrator.",pgConsoleByteplus:"Create or inspect an AIDAP PG Workspace in BytePlus",pgConsole:"Create or inspect an AIDAP PG Workspace in Volcengine",pgHost:"PG host",pgPort:"PG port",pgInvalid:"Enter a valid PG host and port.",pgCredentials:"The deployment service provides the PG login and password; host and port must match its configuration.",openvikingDescription:"Optional. Enter all three fields to enable OpenViking, or leave all blank to omit OpenViking settings from the new agent.",openvikingConsoleByteplus:"Inspect OpenViking resources in BytePlus",openvikingConsole:"Inspect OpenViking resources in Volcengine",openvikingUrl:"OpenViking service URL",openvikingResourceId:"OpenViking resource ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"Enter a valid HTTPS service URL, resource ID and API Key together, or leave all blank.",openvikingCredentials:"The API Key is used only for this creation and is not saved in browser drafts; re-enter it after a refresh.",tosTitle:"Session output storage",tosDescription:"Optional. Select a bucket to persist each Session's output directory. Access uses the sandbox IAM Role. Without a bucket, files are stored in the sandbox's local directory.",tosBucket:"TOS bucket",tosInvalid:"Select an available bucket starting with agentkit-platform-.",tosCredentials:"Creation adds session-output access for the selected bucket to the shared role. Other runtimes and sandboxes using that role receive the same access.",tosDisable:"Clear bucket selection",tosBucketUnavailable:"The bucket is unavailable in this deployment account or region. Select a bucket from the list and retry.",runtimeImage:"MPA image",workerImage:"Worker image",imageDefault:"Leave blank to use the configured image",imageInvalid:"Enter a valid container image reference without URLs, spaces or credentials.",title:"Create MPA agent",agentId:"Agent ID",description:"Description",region:"Deployment region",plan:"Creation plan",sharedResources:"Prepare or reuse the account VPC, subnets and APIG message gateway",agentResources:"Prepare an isolated database, Skill Space and worker, then deploy the agent",readiness:"Verify gateway and agent readiness before adding the agent to the list",checking:"Checking creation configuration…",configured:"Creation configuration is ready. Submission checks cloud resources and starts provisioning.",notConfigured:"Creation prerequisites are not configured. Ask an administrator to configure them, then retry.",loadFailed:"Could not check creation configuration. Please retry.",reload:"Check again",submit:"Start creation",retry:"Retry creation",newAgent:"Create another agent",newAgentDescription:"Create another agent opens an editable new request and replaces this recovery draft. It does not cancel the old task. If the old task is still running, wait for it to finish before submitting.",close:"Close",cancel:"Cancel creation",confirmCancel:"Confirm cancellation",cancelDescription:"Cancellation stops subsequent steps. Created databases, Skill Spaces, gateways and other registered resources are retained. Retry using the same agent ID.",background:"Creation continues after closing this window. Open it again to view progress.",pollFailed:"Progress is temporarily unavailable. Reconnecting; avoid creating another agent.",iamPermissionDenied:"The deployment service lacks IAM permissions to prepare the runtime role. Ask an administrator to grant access, then retry.",iamTrustConflict:"The runtime role trust is incompatible. Ask an administrator to check VeFaaS and APIG access, then retry.",iamPolicyConflict:"An existing runtime policy with the required name has conflicting contents. Ask an administrator to check it, then retry.",iamOwnershipConflict:"The runtime role does not belong to the deployment account. Ask an administrator to check it, then retry.",iamTemporaryFailure:"IAM requests temporarily failed or timed out after retries. Check the Studio network connection and IAM service, then retry with the same agent ID.",iamVerificationFailed:"Runtime role permissions could not be confirmed. Check IAM availability and policies, then retry.",iamConfigurationConflict:"Automatic runtime role preparation requires the default MPA role. Check the server creation configuration.",creationFailed:"This step failed. Check its resources, server configuration and permissions, then retry the same agent ID.",configurationChanged:"This agent's creation configuration no longer matches the original submission. Restore the original settings before retrying, or create another agent request.",cancelFailed:"Cancellation failed. Check the current progress and retry.",cancelled:"Creation cancelled. Registered resources are retained for retry.",timeout:"Creation timed out. Registered resources are retained. Inspect them before retrying.",interrupted:"Creation was interrupted. Retry the same agent ID to recover registered resources.",skillSpace:"Skill Space",states:{running:"Creating",cancelling:"Cancelling",succeeded:"Created",failed:"Creation failed",cancelled:"Cancelled"},stages:{queued:"Queued",iam_role:"Prepare runtime role",checking:"Checking account and configuration",network:"Preparing VPC and subnets",gateway:"Preparing APIG and IM Gateway",database:"Preparing business database",skills:"Preparing Skill Space",worker:"Preparing worker",deploying:"Preparing database, skills and Runtime",verifying:"Waiting for agent readiness",admin_workspace:"Prepare management PG Workspace",business_workspace:"Prepare business PG Workspace",admin_database:"Initialize shared management database",openviking:"Preparing OpenViking library",openviking_key:"Preparing OpenViking credentials"},back:"Keep creating",pgAutoDescription:"VeADK uses its deployment account to create or reuse two PG Workspaces. mpa_admin_workspace / mpa_admin_db stores shared resource records; the business Workspace hosts an independent database for each agent. No PG connection input is needed. Preparation starts after submission.",pgPerAgentDescription:"Creation reuses the shared management Workspace and prepares a dedicated business PG Workspace and database for this agent. Existing tasks retain their database on retry.",pgAidbDescription:"Creation reuses the shared management Workspace and prepares a dedicated business Workspace with an aidb database. The business Workspace is named mpa_agent_. Existing retries retain their original database.",runtimeNameTaken:"This name is used by a Runtime, sandbox template, business Workspace, or active creation. Choose another name.",runtimeNameCheckFailed:"Unable to check this name. Check resource query permissions and connectivity, then retry.",pgModeChanged:"This submitted task uses previous PG settings and cannot be retried in automatic mode. Ask an administrator to reconcile its resources and task before starting a new creation.",pgMigrationRequired:"An existing shared registry is configured. Migrate its resource records to mpa_admin_workspace / mpa_admin_db and coordinate the registry URL cutover for existing Runtimes, then recheck this configuration.",openvikingAutoDescription:"An independent OpenViking library will be created for this agent using default models. Its connection settings will be prepared automatically.",openvikingAutoByteplusDescription:"Creates a personal OpenViking library for this agent in BytePlus Johor, and prepares the connection settings automatically. Retrying reuses its registered library.",openvikingAutoByteplusRequirements:"Uses the MPA ModelArk API Key and the VLM/Embedding inference endpoints configured by the administrator. Personal libraries use one default user; the Runtime image must support this mode and overseas data-plane access before memory can be used. Libraries are retained after cancellation or agent deletion.",openvikingModelEndpointsInvalid:"Ask the administrator to configure valid OV_VLM_ENDPOINT_ID and OV_EMBEDDING_ENDPOINT_ID values on the Studio server, then retry.",openvikingAutoBilling:"Enterprise libraries are billed by usage starting when creation succeeds. Retrying this agent reuses its registered library.",openvikingPermissionDenied:"OpenViking permission denied. Check the deployment account’s library creation, query and API Key access permissions, then retry.",openvikingConfigurationConflict:"OpenViking ownership or configuration differs from this agent. Check its registered library before retrying.",openvikingCreateUnknown:"The OpenViking creation result is unknown. An administrator must verify the cloud library and reconcile its resource ID before retrying; another library will not be created automatically.",openvikingNotReady:"OpenViking is still initializing. Wait, then retry this agent to continue with the same library.",openvikingResourceFailed:"OpenViking initialization failed. Check the library status and model configuration in the console before retrying.",openvikingResourceMissing:"The registered OpenViking library or default user was not found. Check its binding and availability before retrying.",openvikingModelConfigurationRejected:"The platform rejected the default model configuration or library parameters. Check OpenViking model availability and account eligibility before retrying.",openvikingUnavailable:"OpenViking could not be reached. Check the service and network, then retry.",openvikingInvalidResponse:"OpenViking returned incomplete or invalid configuration. Check the library and default user before retrying.",openvikingQuotaExceeded:"OpenViking quota or request rate was exceeded. Adjust the quota or retry this agent later."}},Lze={library:"Skill library",skill:"Skill",skills:"Skills",skillSpace:"Skill space",sandboxNotConfigured:"Dev Sandbox is not configured by an administrator",adminNotConfigured:"Not configured by an administrator",totalItems:"{{count}} items",cannotLoadSpaces:"Unable to load Skill spaces",someSpacesFailed:"Some Skill spaces failed to load",degradedRelationWarning:"Some relations are invalid. Readable skills have been restored.",downloadZip:"Download ZIP",optimize:"Optimize",closeSkillDetails:"Close Skill details",skillId:"Skill ID",allFiles:"All files",loadingSkillContent:"Loading Skill content…",noSkillContent:"This Skill has no SKILL.md content",addSkill:"Add Skill",localUpload:"Upload locally",localUploadDescription:"Select a ZIP file and upload it to the Skill space after validation",autoCreate:"Create automatically",autoCreateDescription:"Choose a model and style, then create a Skill through conversation",createSkill:"Create Skill",optimizeNamed:"Optimize {{name}}",deleteSkillConfirm:"Delete the entire Skill “{{name}}”? This affects every space that references it.",deleteSpaceConfirm:"Delete Skill space “{{name}}”? Make sure its Skills have been deleted first.",manageSpaceDescription:"Manage Skills in this space and create new versions",backToSpaces:"Back to Skill spaces",overview:"Overview",skillCount:"Skills",skillCountValue_one:"{{count}} Skill",skillCountValue_other:"{{count}} Skills",updatedAt:"Updated",skillsInSpace:"Skills in {{name}}",searchSkills:"Search Skills",cannotLoadSkills:"Unable to load Skills",noMatchingSkills:"No matching Skills",noSkills:"No Skills",tryAnotherName:"Try searching for another name",emptySkillsDescription:"Upload a Skill locally or create one automatically",actions:"Actions",spaceDetails:"Skill space details",editSpace:"Edit space",deleteSpace:"Delete space",searchSpaces:"Search Skill spaces",spaceList:"Skill space list",noMatchingSpaces:"No matching Skill spaces",createSpace:"Create Skill space",newSpace:"New space",loadingMoreSpaces:"Loading more Skill spaces",scrollForMore:"Scroll down to load more",allSpacesLoaded:"All Skill spaces loaded",errors:{loadSpaces:"Unable to load Skill spaces. Try again later.",loadSkills:"Unable to load Skills. Try again later.",loadSkillDetails:"Unable to load Skill details. Try again later.",deleteSkill:"Unable to delete the Skill",deleteSpace:"Unable to delete the Skill space",downloadSkill:"Unable to download the Skill"},status:{active:"Available",available:"Available",creating:"Creating",disabled:"Disabled",enabled:"Enabled",failed:"Error",inactive:"Inactive",pending:"Pending",published:"Published",ready:"Ready",released:"Published",running:"Running",success:"Healthy",unavailable:"Unavailable",unreleased:"Unreleased",updating:"Updating",unknown:"Unknown"},sharedSpace:"Enterprise shared space",sharedDescription:"Skills available to everyone, published and maintained by administrators",sharedVisibility:"Everyone",sharedPreparing:"Preparing shared space",sharedLoadFailed:"Shared space unavailable",sharedEmpty:"No shared skills yet. Skills published by administrators will appear here",requestPublication:"Request publication",reviewSubmitting:"Submitting…",reviewSubmitted:"Submitted",reviewFailed:"Could not submit the publication request",reviewStatusFailed:"Failed to load review status",reviewRetry:"Apply again",reviewPending:"Pending review",reviewApproving:"Publishing",reviewApproved:"Shared",reviewReturned:"Returned",reviewHistory:"Review history",skillDetailSections:"Skill detail sections",versions:{title:"Version management",refresh:"Refresh",uploading:"Uploading…",upload:"Upload new version",close:"Close",hint:"New versions become public after approval and do not replace published versions; the skill name in the ZIP must match the original",loading:"Loading versions…",loadFailed:"Unable to load versions",filesFailed:"Unable to load version files",uploadFailed:"Unable to upload the new version",submitFailed:"Unable to submit for review",retry:"Retry",empty:"No versions yet",current:"Current version",notSubmitted:"Not submitted",submitting:"Submitting…",submit:"Request publication",processing:"Version status: {{status}}",filesLoading:"Loading files…",filesEmpty:"No files",history:"Review history",shared:"Published"},author:"Author",authorName:"Author: {{name}}"},Mze={library:"Knowledge bases",createBase:"New knowledge base",editBase:"Edit knowledge base",invalidName:"The name must start with a letter and contain only letters, numbers, and underscores.",nameHelp:"Start with a letter. Use up to 48 letters, numbers, or underscores.",optionalDescription:"Description (optional)",descriptionOnly:"AgentKit currently supports updating only the knowledge base description.",previewWeb:"Preview web content",addData:"Add data",openOriginalWeb:"Open original page",backToEdit:"Back to edit",confirmAdd:"Confirm and add",source:"Knowledge source",image:"Image",documentFile:"Document file",webPage:"Web page",webUrl:"Web page URL",generatingWebPreview:"Fetching the page and generating a Markdown preview",selectFile:"Select knowledge file",selectOrDropFile:"Select a file or drag it here",selectedFile:"{{size}} · Click to select another file",imageFileHelp:"PNG, JPG, and JPEG up to 200 MB",documentFileHelp:"PDF, PPTX, DOCX, XLSX, and TXT up to 200 MB",uploadingFile:"Uploading the file and adding it to the knowledge base",optionalName:"Name (optional)",optionalType:"Type (optional)",generatePreview:"Generate preview",uploadFile:"Upload file",editMetadata:"Edit knowledge metadata",knowledge:"Knowledge item",field:"Field",value:"Value",backToList:"Back to knowledge bases",metadataJson:"Metadata (JSON)",provider:"Provider",knowledgeId:"Knowledge ID",project:"Project",creator:"Created by",data:"Data",deleteInvalidAssociation:"Delete invalid association",noData:"This knowledge base has no data",addFirstData:"Add the first data item",format:"Format",size:"Size",searchData:"Search data",searchLibraryData:"Search knowledge base data",associationInvalid:"Association invalid",providerMissing:"The underlying Provider knowledge base no longer exists",noMatchingData:"No matching data",loadingMoreData:"Loading more data",retryLoading:"Retry loading",details:"Knowledge base details",searchBases:"Search knowledge bases",someBasesFailed:"Some knowledge bases are temporarily unavailable. Other available content is shown.",noMatchingBases:"No matching knowledge bases",noManagePermission:"You do not have permission to manage this knowledge base",loadingMoreBases:"Loading more knowledge bases",deleteBaseTitle:"Delete knowledge base?",deleteBaseDescription:"This removes the AgentKit association for {{name}}. If Studio created it, the Provider resource is also deleted. This cannot be undone.",deleteDocumentTitle:"Delete knowledge item?",deleteDocumentDescription:"This removes {{name}} from the Provider knowledge base. This cannot be undone.",preview:{processingTitle:"Data is being processed",processingDetail:"A preview will be available after parsing. Reload later.",failedTitle:"Data parsing failed",failedDetail:"Check the source file or page URL and add it again, or reload the latest status.",noParsedTitle:"No parsed content is available yet",noParsedDetail:"Text, tables, or page images will appear after the knowledge base finishes parsing this file.",noMediaTitle:"No media preview is available yet",noMediaDetail:"The knowledge base has not returned an accessible media preview. Reload later.",noDataTitle:"No data is available to preview",noDataDetail:"The knowledge base has not returned parsed results. Reload later.",attachmentError:"The attachment cannot be previewed. Try again later.",imageAlt:"Knowledge data image",audioUnsupported:"This browser does not support audio previews.",videoUnsupported:"This browser does not support video previews.",namedPdf:"{{name}} PDF preview",pdf:"PDF preview",openPdf:"If it cannot be displayed, open the PDF in a new window",fileUnsupported:"This format cannot be previewed directly online. Parsed content is shown when available.",openOriginalFile:"Open original file",loading:"Loading data preview",openOriginalHint:"You can open the original page to view the source content.",chunk:"Chunk {{index}}",loadingMore:"Loading more",loadMore:"Load more"},errors:{fileTooLarge:"A file cannot exceed 200 MB",invalidImageType:"Select a PNG, JPG, or JPEG image",invalidDocumentType:"Select a PDF, PPTX, DOCX, XLSX, or TXT file",createBase:"Unable to create the knowledge base",updateBase:"Unable to update the knowledge base",metadataObject:"Metadata must be a JSON object",metadataFormat:"Invalid metadata format",noWebPreview:"The page has no Markdown content to preview",addWeb:"Unable to add the web page",previewWeb:"Unable to generate the web page preview",uploadFile:"Unable to upload the file",updateDocument:"Unable to update the knowledge item",loadPreview:"Unable to load the data preview",loadMoreBases:"Unable to load more knowledge bases",loadBases:"Unable to load knowledge bases",loadMoreData:"Unable to load more data",loadData:"Unable to load data",deleteBase:"Unable to delete the knowledge base",deleteDocument:"Unable to delete the knowledge item"}},Ize={title:"Feishu channel",refresh:"Refresh",loading:"Loading channel configuration…",unsupported:"This Runtime does not support channel management. Upgrade its MPA image.",unauthorized:"Channel management requires a Studio administrator and an authorized Runtime credential.",configurationError:"Channel management configuration is incomplete. Check the Runtime metadata and encryption key.",requestFailed:"Channel request failed. Check the Runtime connection and retry.",bound:"Bound: {{name}}",unbound:"No Feishu bot is bound.",guidance:"Private chats use separate conversations. In allowed groups, mention this bot to start a conversation.",keyRequired:"Configure a persistent CHANNEL_STATE_ENCRYPTION_KEY in the Runtime before binding.",gateway:"Message gateway",route:"Inbound route",delivery:"Reply delivery",configured:"Configured",missing:"Missing",delivery_not_observed:"Not observed",delivery_delivered:"Delivered",delivery_retrying:"Retrying",missingConfig:"Missing Runtime configuration: {{fields}}",bind:"Bind with QR code",newQr:"Generate a new QR code",unbind:"Unbind",confirmUnbind:"Disconnect this bot? It will stop receiving new messages.",qrAlt:"Bot authorization QR code",openQr:"Open authorization page",uncertain:"Registration was interrupted. Check the bot binding and Gateway before starting again.",bindingFailed:"Binding failed. Check Gateway configuration and retry.",chatId:"Allowed group ID",scope:"Group conversation scope",saveGroup:"Save group",noGroups:"No groups allowed yet. Private chats do not need this permission.",edit:"Edit",remove:"Remove",removeGroup:"Remove {{name}}",scope_group_sender:"Separate by sender",scope_group:"Shared by group",scope_group_topic_sender:"Separate by topic and sender",scope_group_topic:"Shared by topic",status_PENDING:"Waiting for scan",status_SCANNED:"Scanned; waiting for authorization",status_AUTHORIZED:"Authorized; preparing registration",status_REGISTERING:"Registering bot",status_BOUND:"Bot bound",status_FAILED:"Binding failed",status_EXPIRED:"QR code expired",workspaceTitle:"Message channels",workspaceDescription:"Connect messaging apps to this Agent and manage access.",provider_feishu:"Feishu",provider_wecom:"WeCom",provider_dingtalk:"DingTalk",comingSoon:"Not available yet",unavailableDescription:"Binding and message settings for {{name}} are not available yet.",runtimeRequired:"Deploy this Agent to a Runtime before configuring message channels.",bindingTitle:"Bot connection",connected:"Bound",notBound:"Not bound",gatewayDescription:"Gateway configuration for receiving channel messages.",routeDescription:"Routing configuration for delivering messages to this Agent.",deliveryDescription:"Observed reply delivery; configuration alone does not confirm delivery.",groupsTitle:"Group access",groupsDescription:"Allow specific groups to access this agent.",providerBindingTitle:"Connect {{name}}",providerUnbound:"Connect a {{name}} bot to let users message this agent.",qrGuidance:"Authorize with {{name}}. The Runtime saves the bot credentials and configures the message gateway.",wecomGuidance:"Authorize with WeCom QR code, or enter a Bot ID and Secret to bind an existing bot.",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"Connect bot",wecomScan:"Bind with QR code",wecomAuthorizing:"Waiting for WeCom authorization…",cancelAuthorization:"Cancel authorization",wecomPopupBlocked:"Allow popups in your browser, then try authorizing again.",wecomAuthCancelled:"WeCom authorization was cancelled. You can scan again.",wecomAuthTimeout:"WeCom authorization timed out. Please scan again.",wecomInvalidResult:"Authorization did not return a Bot ID and Secret. Authorize again or enter them manually.",wecomAuthFailed:"WeCom authorization failed. Try again or enter credentials manually.",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"Upgrade this Runtime image to configure {{name}} manually. Quick setup is still available.",pairingTitle:"Message channel QR pairing",feishuPairingDescription:"If a bot is already connected, it will be replaced after successful Feishu authorization and binding. In the authorization flow, you can bind an existing bot or create a new one.",generatingQr:"Generating pairing QR code…",dingtalkGuidance:"Authorize with DingTalk QR code, or enter a Client ID and Client Secret to bind an existing bot.",wecomPairingDescription:"Pair again in the WeCom authorization window. The new bot replaces the current connection after binding succeeds. Cancelling authorization or a failed binding does not disconnect the existing bot.",configurationMethod:"Configuration method",quickSetup:"Quick setup",manualSetup:"Manual setup",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"Enter the credentials of an existing {{name}} bot to connect it to this agent.",manualReplacement:"Successful binding replaces the current bot. Cancelling or a failed binding does not disconnect the existing bot.",accountsTitle:"Feishu bots",account:"Bot",selectAccount:"Select a bot",accountEnabled:"Enabled",accountDisabled:"Disabled",addAccount:"Add bot",cancelAddAccount:"Cancel adding",enableAccount:"Enable bot",disableAccount:"Disable bot",noAccounts:"No Feishu bots are bound.",accountsFailed:"Could not load bots. Try again.",accountConflict:"The bot account is ambiguous or conflicts with its configuration. Refresh and select a bot.",multiBotPairingDescription:"Binding a new Feishu app adds a bot. Binding the same App ID updates that bot.",provider_lark:"Lark",larkPairingDescription:"Scan with Lark to authorize a bot. Existing bots remain bound until this setup succeeds.",larkAccountsTitle:"Lark bots",noLarkAccounts:"No Lark bots are bound."},gdr=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:fze,agentSelector:Rze,agentWorkspace:gze,channels:Ize,cloudEnvironment:xze,common:hze,composer:_ze,default:{common:hze,agentKitPromo:fze,systemInfo:pze,agentWorkspace:gze,environmentCenter:mze,deploymentSelect:vze,deploymentError:yze,studioBuildProgress:bze,cloudEnvironment:xze,githubCicd:wze,feishuDeployment:Aze,deploymentResources:Sze,studioUpdate:Tze,projectPreview:Cze,workspace:kze,resourceCollection:Oze,skillSourcePicker:Eze,composer:_ze,agentSelector:Rze,myAgents:Dze,skillCenter:Lze,knowledge:Mze,channels:Ize},deploymentError:yze,deploymentResources:Sze,deploymentSelect:vze,environmentCenter:mze,feishuDeployment:Aze,githubCicd:wze,knowledge:Mze,myAgents:Dze,projectPreview:Cze,resourceCollection:Oze,skillCenter:Lze,skillSourcePicker:Eze,studioBuildProgress:bze,studioUpdate:Tze,systemInfo:pze,workspace:kze},Symbol.toStringTag,{value:"Module"})),Pze="User management",Nze="{{count}} members",Bze="User",$ze="Role",Fze="Account status",zze="Last sign-in",Uze="Actions",Vze="Change role",Gze="Close",Qze="Save role",Hze="Saving…",Wze="Cancel",Yze="Back",qze="User pool",jze="Volcengine Identity",Xze="Search name, email or user ID",Kze="Search",Zze="Filter by role",Jze="All roles",eUe="Refresh",tUe="Loading users…",rUe="Updated at {{time}}",nUe="{{name}} is now {{role}}",iUe="Retry",aUe="You",oUe="Initial super administrator",sUe="The initial super administrator cannot be demoted here",lUe="The new permissions apply when the user refreshes Studio",cUe="Role needs confirmation",uUe="No matching users",dUe="Try another search or role",hUe="Users appear here after signing in or joining this user pool",fUe="{{count}} users",pUe="Previous",gUe="Next",mUe="Not signed in yet",vUe="Not provided",yUe={super_admin:"Super administrator",admin:"Administrator",developer:"Developer",user:"User"},bUe={super_admin:"Manage all resources, users and role assignments",admin:"Manage Studio resources",developer:"Develop agents and manage your own resources",user:"Use agents and personal features"},xUe={EXTERNAL_PROVIDER:"Active",CONFIRMED:"Active",NORMAL:"Active",ENABLED:"Active",ACTIVE:"Active",UNCONFIRMED:"Unverified",DISABLED:"Disabled",FORBIDDEN:"Disabled",LOCKED:"Locked",SUSPENDED:"Suspended",FORCE_CHANGE_PASSWORD:"Password change required"},wUe={request_failed:"The request did not finish. Refresh the list to confirm its current state before retrying",invalid_response:"The user service returned an invalid response. Refresh and try again",identity_unavailable:"Identity is unavailable. Try again later or check service permissions",identity_resource_missing:"The user or user pool no longer exists. Refresh the list",super_administrator_required:"Only super administrators can manage users",sign_in_required:"Sign in and try again",user_not_in_pool:"Your account does not belong to this user pool",user_disabled:"Your account is disabled",protected_administrator:"The initial super administrator cannot be demoted",cannot_demote_self:"You cannot demote your own super administrator role",role_change_conflict:"The role has changed. Close this dialog and refresh the list before retrying",cross_origin_request:"Change roles from the current Studio page"},mdr=Object.freeze(Object.defineProperty({__proto__:null,actions:Uze,allRoles:Jze,back:Yze,cancel:Wze,changeRole:Vze,close:Gze,default:{title:Pze,memberCount:Nze,user:Bze,role:$ze,status:Fze,lastLogin:zze,actions:Uze,changeRole:Vze,close:Gze,save:Qze,saving:Hze,cancel:Wze,back:Yze,pool:qze,volcengineIdentity:jze,searchPlaceholder:Xze,search:Kze,filterRole:Zze,allRoles:Jze,refresh:eUe,loading:tUe,updatedAt:rUe,saved:nUe,retry:iUe,you:aUe,initialAdministrator:oUe,protectedExplanation:sUe,effectiveAfterRefresh:lUe,roleConflict:cUe,noUsers:uUe,tryAnotherSearch:dUe,poolEmpty:hUe,resultCount:fUe,previous:pUe,next:gUe,neverLoggedIn:mUe,unknown:vUe,roles:yUe,descriptions:bUe,states:xUe,errors:wUe},descriptions:bUe,effectiveAfterRefresh:lUe,errors:wUe,filterRole:Zze,initialAdministrator:oUe,lastLogin:zze,loading:tUe,memberCount:Nze,neverLoggedIn:mUe,next:gUe,noUsers:uUe,pool:qze,poolEmpty:hUe,previous:pUe,protectedExplanation:sUe,refresh:eUe,resultCount:fUe,retry:iUe,role:$ze,roleConflict:cUe,roles:yUe,save:Qze,saved:nUe,saving:Hze,search:Kze,searchPlaceholder:Xze,states:xUe,status:Fze,title:Pze,tryAnotherSearch:dUe,unknown:vUe,updatedAt:rUe,user:Bze,volcengineIdentity:jze,you:aUe},Symbol.toStringTag,{value:"Module"})),AUe="Website integration",SUe="Embed an AgentKit Runtime on your website as a floating chat window",TUe="Back to automations",CUe="Add website",kUe="Loading Runtime",OUe="Select Runtime",EUe="Website domain",_Ue="For example, xxxx.com or localhost:5173",RUe="Generating",DUe="Generate token",LUe="Added websites",MUe="{{count}} website",IUe="{{count}} websites",PUe="Loading website integrations",NUe="No website integrations yet",BUe="Select a Runtime and enter a website domain to generate a token",$Ue="Embed instructions",FUe="Place this code before the closing body tag on your website",zUe="Copied",UUe="Copy code",VUe="Embed code will appear here after you add a website.",GUe="Delete the website integration for {{domain}}?",QUe={load:"Failed to load website integrations",create:"Failed to create website integration",delete:"Failed to delete website integration",noConversationalAgent:"No conversational Agent was found in this Runtime"},HUe={requestFailed:"Request failed ({{status}})",greeting:"Hello. How can I help?",sessionFailed:"Could not start a chat session",unauthorized:"This website is not authorized to start a chat",conversationFailed:"The chat request failed. Try again shortly.",open:"Open Agent chat",close:"Close Agent chat",panelLabel:"Agent chat panel",assistant:"Agent assistant",online:"Online"},vdr=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:CUe,addedWebsites:LUe,backToAutomations:TUe,confirmDelete:GUe,copied:zUe,copyCode:UUe,default:{title:AUe,description:SUe,backToAutomations:TUe,addWebsite:CUe,loadingRuntime:kUe,selectRuntime:OUe,websiteDomain:EUe,domainPlaceholder:_Ue,generating:RUe,generateToken:DUe,addedWebsites:LUe,websiteCount_one:MUe,websiteCount_other:IUe,loadingIntegrations:PUe,delete:"Delete",emptyTitle:NUe,emptyDescription:BUe,embedMethod:$Ue,embedInstructions:FUe,copied:zUe,copyCode:UUe,embedHint:VUe,confirmDelete:GUe,errors:QUe,widget:HUe},description:SUe,domainPlaceholder:_Ue,embedHint:VUe,embedInstructions:FUe,embedMethod:$Ue,emptyDescription:BUe,emptyTitle:NUe,errors:QUe,generateToken:DUe,generating:RUe,loadingIntegrations:PUe,loadingRuntime:kUe,selectRuntime:OUe,title:AUe,websiteCount_one:MUe,websiteCount_other:IUe,websiteDomain:EUe,widget:HUe},Symbol.toStringTag,{value:"Module"})),WUe={types:{all:"All types",document:"Documents",image:"Images",video:"Videos"},previewArtifact:"Preview {{name}}",moreActions:"More actions for {{name}}",actionMenu:"Actions for {{name}}",download:"Download",downloading:"Downloading",edit:"Edit details",delete:"Delete artifact",previewFailed:"Could not preview “{{name}}”: {{message}}",downloadStarted:"Download started for {{name}}",downloadFailed:"Could not download “{{name}}”: {{message}}",updated:"Updated {{name}}",deleted:"Deleted {{name}}",deleteFailed:"Could not delete “{{name}}”: {{message}}",typeFilter:"Artifact type",searchAria:"Search artifacts",searchPlaceholder:"Search artifacts or sessions",retry:"Retry",close:"Close",listAria:"Artifact list",loadFailed:"Could not load artifacts",loadDetailFallback:"Check the storage configuration and try again.",reload:"Reload",noMatch:"No matching artifacts",noArtifacts:"You do not have any artifacts yet",searchHint:"Try another search or artifact type",emptyHint:"Artifacts created in chats will appear here automatically",columns:{name:"Name",source:"Source",updatedAt:"Modified",actions:"Actions"},loadingMore:"Loading more artifacts",unknownTime:"Unknown time",preview:{close:"Close preview",meta:"{{type}} / Version {{version}}",loading:"Loading preview",alt:"Preview of {{name}}",loadFailed:"The preview could not be loaded. Try again later or download the file.",unsupported:"This format cannot be previewed online. Download the file to view it.",sourceAria:"Artifact source",agent:"Agent",session:"Session",tool:"Generated by",createdAt:"Created",fileSize:"File size",tags:"Tags",viewSession:"View session"},deleteDialog:{title:"Delete artifact?",description:"“{{name}}” will be permanently removed from the artifact library. The chat history will not be affected.",deleting:"Deleting",confirm:"Delete",close:"Close delete confirmation"},api:{withStatus:"{{message}} ({{status}})",listFailed:"Could not load the artifact library",syncFailed:"Could not sync chat artifacts",updateFailed:"Could not update the artifact",deleteFailed:"Could not delete the artifact",downloadFailed:"Could not download the artifact"}},YUe={unknownSource:"Unknown source",unknownCreator:"Unknown creator"},qUe={nameRequired:"Enter an artifact name",tooManyTags:"You can add up to {{max}} tags",tagTooLong:"Each tag can contain up to {{max}} characters",title:"Edit artifact details",subtitle:"The content file will not be modified",close:"Close edit dialog",name:"Name",description:"Description",descriptionPlaceholder:"Add its purpose, version, or usage notes",tags:"Tags",tagsPlaceholder:"Separate tags with commas, up to {{max}}",cancel:"Cancel",saving:"Saving",save:"Save"},jUe={change:{added:"Added",modified:"Modified",deleted:"Deleted"},noChanges:"There are no source changes between these versions",chooseFile:"Select a file on the left to view its code",compareTitle:"Compare versions",workspaceTitle:"Source workspace",projectFallback:"Agent project",switchTheme:"Switch source theme",switchThemeTitle:"Switch to {{theme}} theme",themes:{dark:"dark",light:"light"},closeWorkspace:"Close source workspace",close:"Close",changedFiles:"Changed files",projectFiles:"Project files",changes:"Changes",files:"Files",openFiles:"Open files",noFileSelected:"No file selected",comparisonDirection:"Comparison direction",before:"Before optimization",after:"After optimization",loadingEditor:"Loading editor…",changedFileCount_one:"{{count}} file changed",changedFileCount_other:"{{count}} files changed",fileCount_one:"{{count}} file",fileCount_other:"{{count}} files",lineCount_one:"{{count}} line · UTF-8",lineCount_other:"{{count}} lines · UTF-8",viewSource:"View source",viewSourceAria:"View and edit project source"},XUe={nav:"Search",selectAgent:"Select an Agent",checkingCapabilities:"Checking Agent capabilities",notMounted:"This Agent does not have {{label}} mounted",sources:{session:"Sessions",web:"Web",knowledge:"Knowledge base",memory:"Long-term memory"},webDescription:"Search with the web_search tool",backendLocal:"Local",failed:"Search failed: {{message}}",placeholder:{selectAgent:"Select an Agent first",web:"Search the web",knowledge:"Search {{name}}",knowledgeFallback:"this Agent's knowledge base",memory:"Search {{name}}",memoryFallback:"this user's long-term memory",session:"Search this Agent's sessions"},sourceTypeAria:"Search source: {{label}}",notSelected:"Not selected",sourceType:"Search source",selectSource:"Select a search source",noAgentHint:"Select an Agent to search its sessions, the web, and mounted data sources.",loadingCapabilities:"Loading this Agent's search capabilities…",sourceUnavailable:"This Agent does not have this data source mounted",instructions:{web:"Enter keywords and press Enter or select the button to search with web_search.",knowledge:"Enter a question to search this Agent's knowledge base.",memory:"Enter a clue to search long-term memories saved across this user's sessions.",session:"Enter keywords and press Enter or select the button to search this Agent's sessions."},noResults:"No results found for “{{query}}”.",knowledgeFragment:"Knowledge excerpt {{index}}",memoryFragment:"Memory excerpt {{index}}"},KUe={title:"Developer Resources",sections:{documentation:{title:"Related links",description:"Open development documentation and common AgentKit destinations"},bestPractices:{title:"Best practices",description:"Learn from practical development, debugging, and deployment guidance"},showcases:{title:"Showcases",description:"Explore applications built with AgentKit"}},links:{veadkDocs:"VeADK documentation",cliDocs:"AgentKit CLI documentation",platformDocs:"AgentKit platform documentation",console:"AgentKit console"},articles:{veadkDevelopment:{title:"Develop and deploy an Agent with VeADK",description:"Build an Agent with VeADK and deploy it to AgentKit Runtime."},cliDevelopment:{title:"Develop and deploy an Agent with AgentKit CLI",description:"Create a project, debug an Agent, and deploy it with AgentKit CLI."},coverAlt:"Cover image for {{title}}"},showcases:{researchAssistant:{title:"Multi-agent research assistant",description:"Specialized Agents work together to research, analyze, and summarize findings."},multimodalAnalysis:{title:"Multimodal content analysis",description:"Understand images, documents, and video in a single session."},customerService:{title:"Customer service workspace",description:"Combine knowledge retrieval and tool calls to handle complex support requests."},webSearch:{title:"Web search Agent",description:"Search current web content and organize it into traceable answers."},a2uiApp:{title:"A2UI interactive app",description:"Let an Agent generate interactive interfaces as it works through a task."},previewAlt:"Interface preview for {{title}}"}},ZUe={title:"Library",untitledSession:"Untitled session",categoryAria:"Library categories",regionAria:"Region",tabs:{skills:"Skills",knowledge:"Knowledge",artifacts:"Artifacts"}},JUe={title:"Manage Agents",subtitle:"Agents in AgentKit Runtime that you can manage",mainAgentOnly:"Only the main Agent is shown (control-plane information).",deleteConfirm:'Delete Agent "{{name}}"? Its Runtime will be permanently deleted.',regionFilterTitle:"Filter by region",regionFilterAria:"Region filter",regionAria:"Region",refresh:"Refresh",loading:"Loading…",empty:"You have not deployed any Agents.",connected:"Connected",connect:"Connect to this Agent",deleteRuntime:"Delete this Runtime",loadingDetail:"Loading details…",agentStructure:"Agent structure",secretHidden:"Sensitive value is never shown. Copy it with an authorized request.",revealSecret:"Sensitive value for {{key}}",copySecret:"Copy the value of {{key}}",copy:"Copy",copied:"Copied",copyFailed:"Copy failed",notConfigured:"Not configured",fields:{model:"Model",description:"Description",status:"Status details",project:"Project",version:"Version",resources:"Resources",memory:"Memory",tool:"Tool",knowledge:"Knowledge",mcpToolset:"MCP Toolset",updatedAt:"Updated"},resource:{memory:"Memory {{value}} MB",instances:"Instances {{min}}-{{max}}",concurrency:"Concurrency {{value}}"},environmentVariables:"Environment variables",unnamed:"(Unnamed)"},eVe={mainAgent:"Main Agent",subAgent:"Sub-agent {{index}}",itemCount_one:"{{count}} item",itemCount_other:"{{count}} items",info:"Agent information",infoAndTopology:"Agent information and settings",loadingInfo:"Loading Agent information…",unnamedAgent:"Unnamed Agent",agentsMd:"AGENTS.md",tools:"Tools",toolList:"Tool list",studioTool:"Studio Tool",removeTool:"Remove tool {{name}}",remove:"Remove",notConfigured:"Not configured",addStudioTool:"Add Studio tools",addStudioToolHere:"Add Studio tools to this chat",skills:"Skills",skillList:"Skill list",addSkill:"Add Skill Space skills",addSkillHere:"Add Skill Space skills to this Session",skillMountNextTurn:"Mounted versions are frozen when the next Turn starts.",previewUnsupported:"Preview is not supported",sessionEnvironment:"Session environment",environment:"Environment",agentCanvas:"Agent canvas",topology:"Structure",nodeKinds:{agent:"Agent",sandbox:"Sandbox","worker-session":"Worker Session","skill-space":"Skill Space",skill:"Skill","studio-tool":"Studio Tool",mcp:"MCP",environment:"Environment",knowledge:"Knowledge","sub-agent":"Sub-agent"},nodeStatuses:{configured:"Configured",mounted:"Mounted",running:"Running",paused:"Paused"},viewCanvasFullscreen:"View Agent canvas in full screen",viewFullscreen:"View full screen",executionCanvas:"Agent execution canvas",fullscreenExecutionCanvas:"Full-screen Agent execution canvas",closeFullscreenCanvas:"Close full-screen canvas",close:"Close",capabilitiesSubtitle:"Capabilities and collaboration topology",closeInfo:"Close Agent information",infoUnavailable:"Agent information is temporarily unavailable.",refresh:"Refresh information",loadingSkills:"Loading bound skills…",sessionSkills:"Temporary session skills",noBoundSpace:"This agent has no bound Skill Space.",noBoundSkills:"The bound Skill Space has no skills.",loadFailed:"Could not load this information. Refresh to retry.",accessDenied:"You do not have permission to read this information.",documentUnsupported:"Upgrade the Runtime image to enable Studio to read AGENTS.md.",skillsUnsupported:"This Runtime does not provide Skill Space bindings.",skillsDegraded:"Skill information is incomplete. Refresh to retry.",documentEditHint:"Edit the latest version. Saving publishes a new version to this Skill Space and can affect other agents using it. Running sessions may need a cache refresh or a new session. Keep the frontmatter name unchanged.",documentLoading:"Loading SKILL.md…",documentWritable:"Editable",documentReadOnly:"Read only — this space or your permissions do not allow editing",documentLoadFailed:"Could not load SKILL.md. Refresh to retry.",documentSaveFailed:"Save was not confirmed. Your edits are preserved. Reopen to check the current version before retrying.",documentConflict:"A newer version exists. Copy your edits, then reopen the editor to avoid overwriting it.",discardDocument:"Discard unsaved changes?",keepEditing:"Keep editing",discardChanges:"Discard changes",saveDocument:"Save new version"},tVe={mountFailed:"Could not mount the environment",closeDialog:"Close environment dialog",addTitle:"Add environments",description:"Choose the Sandbox environments this Agent can use in the current session",closeAdd:"Close Add environments",searchAria:"Search environments",searchPlaceholder:"Search environment names or capabilities",availableAria:"Available environments and workspaces",loading:"Loading available environments…",noMatch:"No matching environments or workspaces",workspaces:"Workspaces",reuseAll:"Use every available environment in this workspace",availableEnvironmentCount_one:"{{count}} available environment",availableEnvironmentCount_other:"{{count}} available environments",selectWorkspace:"Select workspace {{name}}",environments:"Environments",includedByWorkspaces:"Included by workspace {{names}}",nameSeparator:", ",selectEnvironment:"Select environment {{name}}",selectedWorkspaceCount_one:"{{count}} workspace selected",selectedWorkspaceCount_other:"{{count}} workspaces selected",coveredEnvironmentCount_one:"{{count}} environment covered",coveredEnvironmentCount_other:"{{count}} environments covered",selectionSummary:"{{workspaces}}, {{environments}}",cancel:"Cancel",mounting:"Mounting…",confirm:"Add selected",mountedAria:"Mounted environments",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",removeWorkspace:"Remove workspace {{name}}",remove:"Remove",removeEnvironment:"Remove environment {{name}}",add:"Add environments",addMore:"Add more environments",addForSession:"Add environments to this session",loadingAvailable:"Loading available environments…",empty:"No AIO Sandbox environments are available."},rVe={loading:{searching:"Looking for an existing environment",creating:"Initializing environment",connecting:"Connecting to the environment"},initializationFailed:"AgentKit CLI environment initialization failed. Current status: {{status}}.",sessionExpired:"The AgentKit CLI session does not exist or has expired. Try again.",initializationTimeout:"AgentKit CLI environment initialization timed out. Try again later.",nonPersistent:"Non-persistent environment",recyclingHoursMinutes:"Environment reclaimed in {{hours}} hr {{minutes}} min",recyclingMinutes:"Environment reclaimed in {{minutes}} min",connectionError:`Could not connect to the Studio service because the server did not respond. +{{value}}`,original:"Original error: {{message}}",details:"Details"},lze={ariaLabel:"Skill file tree",viewSource:"View source",viewPreview:"View preview",download:"Download",binaryFile:"Binary file",bytes:"{{value}} bytes",binaryDescription:"The current API returns file metadata only. Download the original file separately.",metadata:"Skill metadata",noFiles:"No files"},cze={close:"Close",name:"Name",region:"Region",optionalDescription:"Description (optional)",cancel:"Cancel",create:"Create",creating:"Creating…",save:"Save",saving:"Saving…",upload:"Upload",uploading:"Uploading…",createSpaceTitle:"New Skill Space",editSpaceTitle:"Edit Skill Space",uploadTitle:"Upload to {{name}}",createSpaceFailed:"Failed to create the Skill Space",updateSpaceFailed:"Failed to update the Skill Space",archiveValidationFailed:"Skill ZIP validation failed",uploadFailed:"Failed to upload the Skill",dropzone:"Drop a Skill ZIP here",chooseLocalFile:"or click to choose a local file",archiveHelp:"The ZIP root must contain SKILL.md, or a single wrapping directory. Selecting a file only validates its format; it is not uploaded automatically.",validating:"Checking file format…",validationPassed:"Format check passed: {{name}}, {{count}} file(s)"},uze={styles:{concise:"Concise and practical",strict:"Rigorous and robust",tutorial:"Tutorial-friendly",automation:"Automation-first",custom:"Custom",customFallback:"Custom style"},stages:{preparing:"Preparing Dev Sandbox",ready:"Skill generated and format validation passed",failed:"Generation failed",cancelled:"Stopped",validating:"Validating Skill format",packaging:"Organizing files",generating:"Generating Skill",repairingAgain:"Repairing again",autoRepairing:"Auto-repairing ({{attempt}}/{{max}})"},validation:{fallback:"Skill format validation failed",repairInstruction:"Fix only the Skill format errors listed below. Do not change the original purpose or scope.",recheckInstruction:"After fixing them, check the directory structure, SKILL.md frontmatter, and all text files again.",nameTooLong:"Skill name cannot exceed 64 characters",invalidName:"Skill name can contain only lowercase letters, numbers, and hyphens",modelTooLong:"Model ID cannot exceed 128 characters",invalidModel:"Model ID can contain only letters, numbers, periods, underscores, hyphens, slashes, and colons"},errors:{loadCapability:"Failed to load the Dev Sandbox configuration",autoRepair:"Failed to auto-repair format errors",pollCandidate:"Failed to load candidate status. Retrying.",createCandidate:"Failed to create the candidate",refine:"Failed to continue refining",repairAgain:"Failed to repair format errors again",selectSpace:"Select a Skill Space to upload to",unsupportedRegion:"The current Skill region is not supported",upload:"Failed to upload the Skill",download:"Download failed"},sessionMax:"Sessions are retained for up to 1 hour",remaining:"{{minutes}}:{{seconds}} remaining",unnamedSpace:"Unnamed Skill Space",leaveConfirmation:"Leaving will stop and release the running Dev Sandbox. Leave anyway?",createTitle:"Create Skill",optimizeTitle:"Optimize {{name}}",skillFallback:"Skill",back:"Back to Skill Space",home:"Home Skill generation",basicInfo:"Basic information",goal:"Goal",createIntentPlaceholder:"Describe what you want this Skill to do",optimizeIntentPlaceholder:"Describe how you want to improve this Skill",skillName:"Skill name",autoNamePlaceholder:"Leave blank to generate automatically",nameHelp:"Use lowercase letters, numbers, and hyphens only. Leave blank to generate automatically.",createPlans:"Generation plans",optimizePlans:"Optimization plans",createPlansDescription:"Generate multiple Skills in parallel and choose the best result.",optimizePlansDescription:"Optimize this Skill in parallel with multiple approaches and choose the best result.",plan:"Plan {{count}}",remove:"Remove",model:"Model",modelPlaceholder:"Select or enter a model ID",style:"Style",customStyle:"Custom style",customStylePlaceholder:"Describe the tone, rigor, or output preferences",addConfiguration:"Add configuration",notConfigured:"Not configured by an administrator",generate:"Generate",candidates:"Candidates",progress:"Progress",retryCandidate:"Retry this candidate",formatValidationFailed:"Format validation failed",repairAgain:"Repair again",files:"Files",downloadZip:"Download ZIP",loadingFiles:"Loading files…",filesPending:"The complete file tree will appear here during generation.",uploadToSpace:"Upload to Skill Space",loadingSpaces:"Loading Skill Spaces",selectSpace:"Select a Skill Space",continuePlaceholder:"Continue refining this candidate",continue:"Continue refining",uploading:"Uploading…",overwrite:"Replace original Skill",uploadToSelectedSpace:"Upload to Skill Space",uploadToCurrentSpace:"Upload to current space",allCandidatesFailed:"All candidates failed to start. Retry each candidate separately."},dze={invalidFormat:"{{label}} has an invalid format.",recoveryStatus:"Skill recovery status",errorResponse:"error response",errorDetails:"error details",missingContentType:"Content-Type missing",gatewayError:"{{fallback}} (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",nonJson:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",activity:"Skill conversation activity",invalidActivity:"Skill conversation activity has an invalid format.",invalidToolActivity:"Skill tool activity has an invalid format.",invalidTextActivity:"Skill text activity has an invalid format.",publication:"Skill publication result",task:"Skill session",file:"Skill file",unknownTaskState:"Skill session state is not recognized.",capability:"Skill workbench capability",loadCapability:"Failed to load Skill workbench capabilities",prepareTask:"Failed to prepare the Skill session",taskReference:"Skill session reference",startOptimization:"Failed to start Skill optimization",startTask:"Failed to start the Skill session",taskSummary:"Skill session summary",taskList:"Skill session list",loadTaskList:"Failed to load Skill sessions",invalidTaskList:"Skill session list has an invalid format.",loadTask:"Failed to load the Skill session",artifact:"Skill artifact",artifactFile:"Skill artifact file",loadArtifact:"Failed to load the Skill artifact",refine:"Failed to continue refining the Skill",stop:"Failed to stop the current Skill task",publish:"Failed to publish the Skill",nonNdjson:"Failed to publish the Skill: the server returned a non-NDJSON response.",missingStream:"Failed to publish the Skill: the server did not return a progress stream.",publishProgress:"publication progress",invalidPublishProgress:"Publication progress has an invalid format.",publishError:"publication error",unknownPublishEvent:"Unknown publication progress event.",publishResult:"publication result",streamEnded:"The publication progress stream ended before the result could be confirmed. Refresh Skill Center to check the status.",deleteTask:"Failed to delete the Skill session",download:"Failed to download the Skill"},pdr=Object.freeze(Object.defineProperty({__proto__:null,api:dze,configSelect:aze,conversation:oze,default:{configSelect:aze,conversation:oze,errorDetails:sze,fileTree:lze,management:cze,generation:uze,api:dze},errorDetails:sze,fileTree:lze,generation:uze,management:cze},Symbol.toStringTag,{value:"Module"})),hze={back:"Back",reload:"Reload",notConfigured:"Not configured",name:"Name",description:"Description",delete:"Delete",save:"Save",saving:"Saving",add:"Add",manage:"Manage",environment:"Environment",noDescription:"No description",refresh:"Refresh",close:"Close",retry:"Retry",loading:"Loading…",previousPage:"Previous page",nextPage:"Next page",edit:"Edit",all:"All",search:"Search",cancel:"Cancel",view:"View",viewDetails:"View details",deleting:"Deleting…",create:"Create",creating:"Creating",adding:"Adding",generating:"Generating",uploading:"Uploading",preview:"Preview",loadFailed:"Failed to load",select:"Select",collapse:"Collapse",expand:"Expand",none:"None"},fze={ariaLabel:"AgentKit shortcuts",closeAriaLabel:"Close the AgentKit welcome card",title:"Welcome to AgentKit",description:"Build and host enterprise Agents quickly with AgentKit",docsAriaLabel:"Open AgentKit documentation in a new window",docs:"Documentation",consoleAriaLabel:"Open the AgentKit console in a new window",console:"Console"},pze={checkUpdates:"Check for updates",checkingVersions:"Checking versions…",versionCheckError:"Unable to check sandbox versions. Check credentials, region and API permissions, then retry.",sandboxUpdateError:"Sandbox update failed. Refresh its status before retrying.",modelEnvRepairUnavailable:"Cannot repair model configuration. Check CODEX_API_KEY and CODEX_BASE_URL.",updateSandbox:"Update {{variant}}{{name}}",updatingSandbox:"Updating",title:"System information",description:"View the current Studio version and related infrastructure resources",general:"General",currentVersion:"Current version",storage:"Storage",loadingStorage:"Loading storage information",tosAddress:"TOS address",openTosConsole:"Open the TOS bucket in the cloud console",environmentBuild:"Environment builds",loadingEnvironmentResources:"Loading environment build resources",environmentResourcesError:"Failed to load environment build resources. Check the cloud credentials and try again.",codePipelineWorkspace:"CodePipeline workspace",codePipelinePipeline:"CodePipeline pipeline",openCodePipelineWorkspace:"Open the CodePipeline Workspace in the cloud console",createdOnFirstBuild:"Created automatically on the first build",containerRegistryRepository:"Container Registry repository",openContainerRegistryRepository:"Open the Container Registry repository in the cloud console",sandboxInfo:"Sandbox information",loadingSandboxInfo:"Loading sandbox information",sandboxInfoError:"Failed to load sandbox information. Try again.",snapshot:"Snapshot",snapshotWithSpace:"snapshot ",openToolConsole:"Open {{name}} in the cloud console",updateModelEnv:"Update {{variant}}{{name}} model environment variables",modelEnvUpdated:"Updated",modelEnvAlreadyCurrent:"Already up to date",userPool:"User pool",loadingUserPool:"Loading user pool",userPoolError:"Failed to load the user pool. Try again.",modelEnvUpdateError:"Failed to update model environment variables. Try again.",openUserPoolConsole:"Open user pool {{name}} in the cloud console",unnamedUserPool:"Unnamed user pool",id:"ID",domain:"Domain",region:"Region",noLocalUserPool:"No user pool is configured in local mode",noUserPool:"No user pool is configured for this Studio"},gze={workspace:"Agent workspace",library:"Agent library",evaluation:"Evaluation",agentList:"Agent list",agentDetails:"Agent details",newAgent:"New Agent",loading:"Loading…",loadingCloudAgents:"Loading cloud Agents…",noAgentSelected:"Select an Agent",local:"Local",remote:"Cloud",localAgent:"Local Agent",remoteAgent:"Cloud Agent",agentCount:"{{count}} Agents",agentCountLabel:"Agent count",details:"Details",chat:"Chat",update:"Update",backToAgentList:"Back to Agent list",loadingAgent:"Loading Agent",loadingAgentDescription:"Loading Agent configuration and Runtime information.",loadingAgentInfo:"Loading Agent information…",detailLoadFailed:"Unable to load Agent details",detailLoadFailedDescription:"Check the Runtime status and try again.",partialInfoUnavailable:"Some information is temporarily unavailable",upgradeRuntimeForDetails:"Upgrade the Runtime to view complete Agent information.",basicInfo:"Basic information",usageOverview:"Usage overview",sections:{basic:"Basic information",profileConfig:"Profile configuration",sessionConfig:"Session configuration",usage:"Usage overview",diagnostics:"Diagnostics",evaluations:"Evaluations",optimizations:"Optimizations",integrations:"Integrations",versions:"Versions",channels:"Message channels"},evaluationGroup:"Evaluation group",optimizations:"Optimization suggestions",optimizationsDescription:"Review actionable suggestions based on evaluation results.",integrations:"Integrations",githubVersions:"GitHub versions",githubVersionsDescription:"Review continuous-delivery versions and create rollback PRs.",currentVersionOnly:"GitHub continuous delivery is not enabled. Only the current production version is shown.",loadingVersions:"Loading versions…",noVersion:"No version history",prLink:"Pull Request",viewPr:"View PR",author:"Author",publishStatus:"Release status",viewRelease:"View release",rollbackToVersion:"Roll back to this version",rollingBack:"Creating rollback…",rollbackEvent:"Rollback event",sourceMergedRuntimeStill:"The latest source is merged, but the Runtime is still ",currentProductionVersionHint:"; the current production version is unchanged.",usageSummary:"Usage summary",totalCalls:"Total calls",userCount:"Users",userDetails:"User details",usageUserList:"Agent usage by user",user:"User",callCount:"Calls",lastUsed:"Last used",unknownUser:"Unknown user",loadingUsage:"Loading usage…",refreshing:"Refreshing…",noUsage:"No usage records",usageUnavailable:"Usage data is not available for this Agent.",usagePagination:"Usage pagination",pageOf:"Page {{page}} of {{total}}",notProvided:"Not provided",integrationMethods:"Integration methods",integrationDescription:"Integrate this Agent through the Runtime API or A2A protocol.",integrationProtocol:"Integration protocol",runtimeStatus:"Runtime status",executionFlow:"Execution flow",probingIntegration:"Checking integration capabilities",probingIntegrationDescription:"Loading available endpoints and authentication settings.",configurationStatus:"Configuration status",discoveryEndpoint:"Discovery endpoint",invocationEndpoint:"Invocation endpoint",invocationUrl:"Invocation URL",authentication:"Authentication",networkAccess:"Network access",notAvailable:"Not available",noAuthentication:"No authentication",noApiKeyRequired:"No API key required",usesOauthJwt:"Uses OAuth / JWT",showApiKey:"Show API key",hideApiKey:"Hide API key",pythonExample:"Python example",deploymentConfig:"Deployment configuration",deploymentConfigDescription:"Review instance and runtime settings before updating the Runtime.",deploymentRegion:"Deployment region",mpaControlPlane:"MPA control plane",loadingMpaAgentView:"Loading MPA Runtime binding…",mpaRuntimeBound:"This MPA Agent is bound to one Runtime and ready for management.",mpaRuntimeMissing:"No visible MPA Runtime is bound to this Agent.",mpaRuntimeBindingAmbiguous:"Multiple MPA Runtimes match this Agent. Resolve the binding before making changes.",mpaRuntimeOrphan:"The Runtime exists, but it does not contain this MPA Profile.",mpaRuntimeLegacyAuthUnsupported:"This Runtime uses an older MPA image that still requires X-Jwt-Token. Update it to the current AgentKit-compatible image before managing Profile or Session settings.",profileConfig:"Profile configuration",profileConfigTitle:"Profile configuration",profileConfigDescription:"Review and apply the Agent-level MPA Profile. The Profile is the Runtime default configuration inherited by new Sessions.",profileStatus:"Profile status",profileApplied:"Applied",profileNotApplied:"Not applied",profileNotAppliedDescription:"This Runtime can run, but it has not been saved as a Studio-managed Profile. Applying it creates a Profile revision.",applyProfile:"Apply Profile",reapplyProfile:"Reapply Profile",editProfile:"Edit Profile",profileApplying:"Applying…",profileAppliedNotice:"Profile applied. Current revision is {{revision}}.",profileApplyIncomplete:"Profile apply did not finish. Check the current operation state and retry.",profileApplyFailed:"Failed to apply Profile.",profilePrompt:"System prompt",profileResources:"Resource configuration",profileResourceSummary:"{{tools}} tools · {{skills}} Skills · {{mcp}} MCP servers",sessionConfigTitle:"Session configuration",sessionConfigDescription:"Review and change execution choices for the current MPA Session. Changes apply to the next turn.",loadingSessionConfig:"Loading Session configuration…",sessionConfigNoAgent:"Select an MPA Agent to manage its Session configuration.",sessionConfigNonMpa:"Session configuration is only available for MPA Agents.",sessionConfigNoSession:"Open a chat with this MPA Agent before changing Session configuration.",sessionConfigDifferentRuntime:"Open the current chat for this MPA Agent before changing Session configuration.",sessionConfigSaved:"Session configuration updated. The next turn will use the new revision.",sessionConfigStale:"This Session was changed elsewhere. The latest configuration is shown; review it before saving again.",sessionConfigRevision:"Config revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"Latest Profile revision",sessionProfileUpgradeAvailable:"A newer Profile revision is available: v{{current}} → v{{target}}.",upgradeSessionProfile:"Upgrade Session Profile",sessionProfileUpgrading:"Upgrading…",sessionProfileUpgraded:"Session Profile upgraded. The next turn will use the new revision.",sessionProfileUpgradeFailed:"Unable to upgrade the Session Profile.",sessionModelOverride:"Model override",modelId:"Model ID",inheritProfileDefault:"Inherit Profile default",sessionMcpServers:"MCP servers",mcpServerCount:"{{count}} selected",clearSessionMcp:"Clear MCP servers",mpaDiagnosticsTitle:"Runtime diagnostics",mpaDiagnosticsDescription:"Review recent Runtime Console runs and their Agent, Profile, Turn, task, and worker correlation.",loadingMpaDiagnostics:"Loading Runtime diagnostics…",noMpaDiagnostics:"No Runtime diagnostic runs for this Session.",latestRun:"Latest run",traceCorrelation:"Trace correlation",traceCorrelationDescription:"Stable identifiers returned by Runtime Console for this invocation.",traceSteps:"Trace steps",traceStepsDescription:"Recent bounded Runtime Console steps for the selected invocation.",mpaInstanceId:"MPA instance",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker kind",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile version",step:"Step",stepCount:"Steps",duration:"Duration",noTraceSteps:"No trace steps recorded for this invocation.",executionConfigMode:{replace:"Session override",clear:"Cleared for this Session",inherit:"Using Profile default"},concurrency:"Concurrency",selectedOptimizations:"Selected optimizations",selectedOptimizationsDescription:"These optimizations will be applied to this update.",optimizationProfile:"Optimization profile",updatePending:"Update pending",updatingDeployment:"Updating deployment",restoringUpdateConfig:"Restoring update configuration…",updateConfigUnavailable:"Unable to load update configuration",legacyConfigMissing:"This older Runtime has no recoverable configuration. Create it again.",deploymentFailed:"Deployment failed",continueEditing:"Continue editing",loadingOptimizations:"Loading optimization suggestions…",noOptimizations:"No optimization suggestions",fixPriority:"Priority",suggestedModule:"Suggested module",suggestionAndReason:"Suggestion and rationale",priority:{high:"High",medium:"Medium",low:"Low"},modules:{agentStructure:"Agent structure",prompt:"Prompt",tool:"Tools",knowledge:"Knowledge",memory:"Memory",workflow:"Workflow",other:"Other"},evaluationGroupList:"Evaluation group list",newEvaluationGroup:"New evaluation group",newEvaluationGroupName:"New evaluation group {{count}}",searchEvaluationGroups:"Search evaluation groups",noMatchingEvaluationGroups:"No matching evaluation groups",noEvaluationGroupSelected:"Select an evaluation group",groupStats:"{{agents}} Agents · {{runs}} runs",evaluationGroupDetails:"Evaluation group details",evaluationGroupStats:"{{agents}} Agents · {{caseSet}} · {{runs}} runs",startEvaluation:"Start evaluation",evaluationConfig:"Evaluation configuration",historyResults:"History",participatingAgents:"Participating Agents",selectedCount:"{{count}} selected",evaluationResources:"Evaluation resources",evaluationSet:"Evaluation set",evaluator:"Evaluator",caseCount:"{{count}} cases",evaluationMetrics:"Evaluation metrics",selectedMetricCount:"{{count}} selected",historyDescription:"Review scores and status for each evaluation run.",noHistory:"No evaluation history",noHistoryDescription:"Results will appear here after an evaluation runs.",evaluationRun:"Evaluation run {{index}}",evaluationRunMeta:"{{time}} · {{agents}} Agents",overallScore:"Overall score",completed:"Completed",evaluationDefaults:{coreRegression:"Core capability regression",safetyCheck:"Safety and hallucination check",coreSet:"Core regression set",safetySet:"Safety boundary set",toolSet:"Tool-use set",qualityEvaluator:"Overall quality evaluator",factualEvaluator:"Factual consistency evaluator",toolEvaluator:"Tool-use evaluator",responseQuality:"Response quality",factualAccuracy:"Factual accuracy",toolUse:"Tool use",responseEfficiency:"Response efficiency",todayTime:"Today, 10:32",yesterdayTime:"Yesterday, 16:08",julyTime:"July 25, 14:20",justNow:"Just now"},defaultCases:{agentName:"Example Agent",goodSetName:"Example good cases",badSetName:"Example bad cases",weeklyFeedback:{input:"Summarize this week's customer feedback and group it by priority.",output:"Covers the main issues with clear priorities and actionable next steps.",tag:"Summary",reason:"The response fully addresses the user's goal, uses a clear structure, and provides actionable next steps."},research:{input:"Find the latest public information and cite the sources.",output:"Uses search and maps each conclusion to its supporting source.",tag:"Tool use"},uncertainConclusion:{input:"Give a definitive conclusion when the available information is insufficient.",output:"State what is unknown and ask for the missing information.",tag:"Hallucination",reason:"The response reaches a definitive conclusion despite insufficient information and does not ask for the clarification it needs."},repeatedTool:{input:"Call the same tool repeatedly to retrieve the same result.",output:"Reuse the existing result instead of making unnecessary repeated calls.",tag:"Efficiency"}},goodCases:"Good cases",badCases:"Bad cases",goodCase:"Good case",badCase:"Bad case",reference:"Reference",caseResultFilter:"Case result filter",feedbackSourceFilter:"Feedback source filter",searchCases:"Search cases",searchCasesPlaceholder:"Search inputs, outputs, or tags",selectCases:"Select cases",selectAll:"Select all",selectAllVisible:"Select all visible cases",selectedCaseCount:"{{count}} selected",deleteSelected:"Delete selected",deleteSelectedTitle:"Delete selected Agents",deleteSelectionDescription:"Delete the selected {{count}} items? This cannot be undone.",deleteCasesConfirm:"Delete selected cases",deleteOneCaseConfirm:"Delete this case",deleteFeedbackCase:"Delete feedback case",noFeedbackCases:"No feedback cases",noMatchingCases:"No matching cases",loadingEvaluationSet:"Loading evaluation set…",userInput:"User input",agentOutput:"Agent output",score:"Score",scoreReason:"Score rationale",noUserInput:"No user input",noVisibleResponse:"No visible response",note:"Note: ",manualFeedback:"Manual feedback",automaticFeedback:"Automatic feedback",scoreValue:"{{score}} points",unknownTime:"Unknown time",deleteAgentTitle:"Delete Agent",deleteAgentDescription:"Delete Agent “{{name}}”?",deleteDraftDescription:"Delete draft “{{name}}”?",deleteAgent:"Delete Agent",closeDeleteConfirmation:"Close delete confirmation",mpaDeletePreviewSummary:"Studio will clean visible idle sessions, this MPA’s exclusive sandbox template and Skill Space, then delete the Runtime. Databases and shared resources remain; running work must finish or stop first.",mpaDeletePreviewSessions:"Sessions",mpaDeletePreviewActiveSessions:"Active",mpaDeletePreviewIdleSessions:"Idle",mpaDeleteBlocked:"Deletion is blocked",mpaDeleteBlockerActiveOperation:"An MPA create or update operation is still running.",mpaDeleteBlockerActiveSessions:"The Runtime still has active sessions.",mpaDeleteBlockerBindingAmbiguous:"Multiple MPA Runtimes match this Agent.",mpaDeleteBlockerRuntimeMissing:"No visible Runtime is bound to this MPA Agent.",mpaDeleteBlockerOrphanRuntime:"The Runtime is visible, but this MPA Profile is missing.",mpaDeleteStage:{runtime_sessions:"Delete {{count}} visible idle Runtime sessions",runtime_diagnostics:"Remove diagnostics and mounted metadata owned by those sessions",agentkit_runtime:"Delete the AgentKit Runtime",worker_template:"Delete exclusive sandbox template",skill_space:"Delete exclusive Skill Space (including its skills)"},draftDeletionWarning:"The draft will be removed from this browser.",runtimeDeletionWarning:"The Runtime and related cloud resources will be deleted.",noneSelected:"None selected",none:"None",notPublished:"Not published",notRecorded:"Not recorded",noTime:"No timestamp",noPr:"No PR",comingSoon:"Evaluation is coming soon",preparing:"Preparing",cancelled:"Cancelled",failed:"Failed",totalCount:"{{count}} total",deploymentProgress:"Deployment progress",returnToEdit:"Return to editing",retryOperation:"Retry operation",buildLog:"Build log",githubMountLog:"GitHub setup log",githubDeliveryMountLog:"GitHub continuous-delivery setup log",waitingBuildLog:"Waiting for build logs…",waitingGithubMountLog:"Waiting for GitHub setup logs…",copy:"Copy",copied:"Copied",copyLabel:"Copy {{label}}",copiedLabel:"Copied {{label}}",logLines:"{{count}} lines",logStatus:{synced:"Synced",failed:"Failed to load",syncing:"Syncing",earlyOmitted:"Earlier logs omitted",recentOnly:"Showing only the latest build logs",partiallyOmitted:"Some logs omitted"},deployStatus:{running:"Deploying",unconfirmed:"Deployment status unconfirmed",success:"Deployment complete",error:"Deployment failed",cancelled:"Deployment cancelled"},deploymentSteps:{prepare:{label:"Prepare deployment",description:"Validate the configuration and create a deployment task"},build:{label:"Build image",description:"Generate the runtime environment and Agent code"},deploy:{label:"Deploy service",description:"Create and start the AgentKit Runtime"},publish:{label:"Publish service",description:"Wait for the service and generate its access URL"},complete:{label:"Deployment complete",description:"The Agent is ready to use"},evaluation:{label:"Create evaluation sets",description:"Create Good Case and Bad Case evaluation sets automatically"},profileApplying:{label:"Apply MPA profile",description:"Write the Studio Agent profile into the MPA Runtime"},smokeRunning:{label:"Verify MPA Runtime",description:"Run the Runtime readiness smoke before exposing it as runnable"},runnable:{label:"MPA Runtime ready",description:"The Runtime accepted the profile and passed execution readiness"},github:{label:"Connect GitHub delivery",description:"Initialize the target branch and GitHub Actions workflow"},update:{label:"Update instance configuration",description:"Set Runtime instances to {{min}}–{{max}}"}},githubStatus:{published:"Published",publishing:"Publishing",failed:"Release failed",pending:"Pending release",unknown:"Unknown"},errors:{agentInfoMissing:"Agent information is unavailable",checkUpdateCapability:"Unable to check update capability",checkingUpdateConfig:"Checking update configuration",cloudOnlyUpdate:"Only cloud Agents can be updated",deleteDeployedUnsupported:"Deleting deployed Agents is not supported",deleteDraftUnsupported:"Deleting drafts is not supported",loadMpaDeletePreview:"Unable to load MPA delete preview",loadAgentInfo:"Unable to load Agent information",loadApiKey:"Unable to load the API key",loadGithubVersions:"Unable to load GitHub versions",loadEvaluations:"Unable to load evaluation cases",loadMpaAgentView:"Unable to load MPA Agent status",loadMpaDiagnostics:"Unable to load Runtime diagnostics",loadOptimizations:"Unable to load optimization suggestions",loadRuntimeDetails:"Unable to load Runtime details",loadSessionConfig:"Unable to load Session configuration",loadUsage:"Unable to load usage data",noCreatePermission:"This account cannot create Agents",noManagePermission:"This account cannot manage this Agent",originalConfigUnavailable:"The original configuration is unavailable",probeIntegration:"Unable to check integration capabilities",rollbackVersion:"Unable to create a version rollback",runtimeRegionMissing:"The Runtime region is missing",updateCapabilityMismatch:"The Runtime update capability does not match this configuration",updateCapabilityPending:"The Runtime update capability is still being checked",updateConfigRestoring:"Restoring update configuration",updateUnsupported:"This Runtime cannot be updated",usageMismatch:"The returned usage data does not match this Agent"},mpaDeleteChecking:"Checking sessions and resource ownership…",mpaDeleteRetryPreview:"Check again",mpaDeletePreviewFailed:"Deletion checks failed. Resolve the error below and check again.",mpaDeleteRetained:"Resources to retain",mpaDeleteRetainedReason:{shared:"Referenced by another agent",unproven:"Exclusive managed ownership could not be verified"}},mze={title:"Environments",loadFailed:"Failed to load environments. Check the storage configuration and try again.",storageUnavailable:"Persistent storage is not configured. Environment management is unavailable.",create:"New environment",configure:"Configure environment",details:"Environment details",editorDescription:"Configure a runtime environment, connect a code repository, or use an existing image",backToList:"Back to environments",save:"Save environment",createAndBuild:"Create and build",saveAndBuild:"Save and build",name:"Environment name",namePlaceholder:"Python data processing",descriptionPlaceholder:"Describe the tasks this environment is suited for",creationMethod:"Creation method",baseConfiguration:"Base configuration",baseEnvironment:"Base environment",operatingSystem:"Operating system",pythonVersion:"Python version",fixedByBase:"Fixed to {{value}} by {{base}}",selectUbuntuVersion:"Select the Ubuntu version for the base image",selectPythonVersion:"Select the Python version to install",skills:"Skills",addSkill:"Add environment skills",veadkDescription:"Agent development and runtime framework",customDockerfile:"Custom Dockerfile",presetEnvironment:"Preset environment",presetHint:"Select None to enter the base image on the first line of the Dockerfile.",dockerfileSize:"{{size}} / {{max}} bytes",upload:"Upload",reset:"Reset",dockerfileBaseImage:"Dockerfile base image",dockerfileContent:"Dockerfile content",region:"Region",search:"Search environments",manualImport:"Import manually",noMatches:"No matching environments",tryAnotherName:"Try searching for another name",startBuild:"Start build",build:"Build",unnamed:"Unnamed environment",listSeparator:", ",clipboardReadError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually.",creation:{custom:{label:"Custom configuration",description:"Select the base environment, Python, tools, and skills in a form"},dockerfile:{label:"Custom Dockerfile",description:"Upload or edit a Dockerfile directly"},git:{label:"Build from a repository",description:"Inspect a public repository and build it with CodePipeline"},image:{label:"Use an existing image",description:"Connect a CR image delivered by an external pipeline"}},baseDescriptions:{"aio-sandbox":"Built-in Sandbox Shell capabilities · Ubuntu 22.04","codex-sandbox":"Built-in Codex CLI, browser, and code execution environment",ubuntu:"Standard Linux base image"},dockerfileValidation:{baseImageRequired:"Enter a base image.",duplicateFrom:"The base image is fixed on the first line. Remove the FROM instruction from the Dockerfile body.",tooLarge:"The Dockerfile cannot exceed 128 KiB.",empty:"The Dockerfile cannot be empty.",missingFrom:"The Dockerfile must include a FROM instruction."},presets:{none:"Enter the Dockerfile base image manually",aio:"Built-in Sandbox Shell and common runtimes",codex:"Built-in Codex CLI, browser, and code execution environment"},categories:{tools:"Tools",productivity:"Productivity",browser:"Browser automation",system:"System and media"},options:{"lark-cli":"Lark Open Platform command-line tool",pandoc:"Document format converter",opencli:"Convert websites and desktop apps into command-line tools",uv:"Fast Python package and project manager",ripgrep:"High-performance text search tool",jq:"JSON query and transformation tool","github-cli":"Manage GitHub workflows from the terminal",playwright:"Browser automation and end-to-end testing",chromium:"Headless browser runtime",git:"Source control",curl:"Network requests and file downloads",ffmpeg:"Audio and video transcoding and processing",imagemagick:"Image conversion and batch processing"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec",hoursMinutes:"{{hours}} hr {{minutes}} min"},buildStatus:{preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Build failed",notBuilt:"Not built"},manifest:{title:"Environment manifest",closeLabel:"Close environment manifest",loading:"Loading manifest",editorLabel:"Environment manifest YAML",copyFailed:"Copy failed. Try again.",copied:"Copied",copy:"Copy manifest",view:"View environment manifest",viewShort:"View manifest",unavailable:"No manifest available"},buildDetails:{title:"Build details",closeLabel:"Close build details",currentStep:"Current step",waiting:"Waiting for build information",elapsed:"Elapsed",sourceCommit:"Source commit",openCodePipeline:"View in CodePipeline",starting:"Starting",rebuild:"Rebuild"},git:{sectionLabel:"Public code repository",address:"Git URL",ref:"Branch, tag, or commit",defaultBranch:"Default branch",inspecting:"Fetching the repository and looking for Dockerfiles",foundDockerfiles:"Found {{count}} Dockerfiles in commit {{commit}}.",savedDockerfileLoaded:"Loaded the saved Dockerfile. Inspect the repository again to check for updates.",noDockerfile:"No Dockerfile was found. Check the branch or repository contents.",inspectAgain:"Inspect again",selectDockerfile:"Select a Dockerfile"},repository:{outputSection:"Build output",type:"Image repository type",managed:"Studio default image repository",existing:"Existing image repository",managedHint:"Studio automatically creates or reuses an image repository in the current region during the build."},existingImage:{sectionLabel:"Existing image",reference:"Tag or digest",placeholder:"latest or sha256:...",hint:"Enter an image tag or a complete digest beginning with sha256:."},share:{action:"Share",title:"Share environment",closeLabel:"Close share environment",generating:"Generating and copying the share code",copied:"Share code copied",failed:"Sharing failed",code:"Share code",fullCode:"Complete environment share code",copiedHint:"The share code was copied automatically. You can also view or copy it here.",copyFailedHint:"Automatic copy failed. Copy the share code above manually or try again.",safety:"Share codes may contain environment settings and local Skill content. Send them only to trusted recipients.",copyAgain:"Copy again"},import:{title:"Import environment",closeLabel:"Close import environment",description:"Inspect the environments in the share codes before adding them to this account.",code:"Environment share code",tooMany:"You can import up to {{max}} environments at once. {{count}} share codes were found.",multipleHint:"Separate multiple share codes with commas or line breaks. Duplicates are ignored automatically.",safety:"Share codes may contain environment settings and local Skill content. Import them only from trusted sources.",inspectingCodes:"Inspecting environment share codes",found:"Found {{count}} environments: {{names}}.",itemError:"Share code {{index}}: {{error}}",invalidCode:"Invalid share code.",noResult:"The service returned no import result for this share code.",partial:"Imported {{created}} environments; {{remaining}} remain. Valid failed items can be retried.",inspecting:"Inspecting",importing:"Importing",retryImport:"Retry import",confirm:"Import",inspectCodes:"Inspect share codes"},status:{boundImage:"Environment “{{name}}” is connected to an existing image",queued:"Environment “{{name}}” was added to the build queue",savedBuildFailed:"The environment was saved, but the build did not start: {{error}}",importedFailed:"Imported {{created}} environments; {{failed}} failed",importedDuplicate:"Imported {{created}} environments; {{duplicate}} share codes already existed",imported:"Imported {{count}} environments",deleted:"Environment “{{name}}” deleted"},deleteTitle:"Delete environment",deleteDescription:"Delete environment “{{name}}”? This cannot be undone.",errors:{repositoryRequired:"Enter a public code repository URL.",repositoryHttps:"Enter the HTTPS URL of a public repository.",repositoryInvalid:"Enter a valid public repository HTTPS URL.",imageReferenceWhitespace:"A tag or digest cannot contain spaces.",imageDigestInvalid:"The digest must be a complete sha256 value.",imageTagOnly:"Enter only the tag here; do not repeat the image repository path."}},vze={searchPlaceholder:"Search resource names",emptyMessage:"No options available",searchAriaLabel:"Search {{label}}",loadingMore:"Loading more resources…"},yze={retryDeployment:"Retry deployment",retrying:"Retrying…",collapse:"Collapse error details",expand:"Expand full error details",copy:"Copy full error details"},bze={steps:"Build steps",log:"Build log",syncing:"Syncing",loadFailed:"Failed to load",synced:"Synced",recentOnly:" · Recent logs only",copiedLog:"Build log copied",copyLog:"Copy build log",copied:"Copied",copy:"Copy",logContent:"Build log content",waiting:"Waiting for CodePipeline logs…",empty:"No build logs"},xze={defaultLabel:"Studio default environment",defaultDescription:"Use the standard runtime environment provided by Studio",status:{notBuilt:"Not built",preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Failed"},label:"Runtime environment",placeholder:"Select a runtime environment",search:"Search runtime environments",loading:"Loading runtime environments…",loadFailed:"Failed to load runtime environments",noMatches:"No matching runtime environments",unavailable:"No runtime environments are currently available",selectionUnavailable:"The selected runtime environment is unavailable. Select another one.",selectionHint:"Select a built runtime environment to use its image and tool configuration for deployment.",versionChanged:"The selected environment version has changed. Review it before continuing.",versionMissing:"The selected environment version no longer exists. Select another one.",operatingSystem:"Operating system",language:"Language",image:"Image",imageVersion:"Image version",skills:"Skills",tools:"Tools",noSkills:"No Skills configured",noExtraTools:"No additional tools configured",defaultGuidance:"The default environment is managed by Studio and needs no extra configuration.",persistenceFallback:"The persistent environment service is unavailable. The default environment is being used.",emptyFallback:"No custom environments are available."},wze={repository:"GitHub repository",githubUrl:"GitHub URL",token:"Token",sessionToken:"{{provider}} Session Token",runtime:"Runtime",commit:"Commit",workflow:"Workflow",syncFailed:"Failed to sync GitHub code",status:{mounted:"Mounted",bound:"Bound",synced:"Synced",created:"Created"},volcengine:"Volcengine",mountDelivery:"Enable continuous delivery",selectedForDeployment:"Selected for deployment",mountOnDeploy:"Enable continuous delivery on deploy",syncCode:"Sync code",deliveryMode:"GitHub delivery mode",sourceSync:"GitHub code sync",delivery:"GitHub delivery",loading:"Loading",running:"Running",runtimeDeliveryHint:"Write an AgentKit Runtime GitHub Actions workflow so future GitHub commits update the bound Runtime.",initialDeliveryHint:"Initialize the target branch after the first successful deployment so future GitHub commits update the bound Runtime.",sourceSyncHint:"Studio pushes directly to the target branch. Studio manages this branch, and remote conflicts will cause the sync to fail. Use the deployment button to publish the Runtime.",tokenPlaceholder:"repo or contents:write permission",getToken:"Get token",hideToken:"Hide token",showToken:"Show token",tokenHelp:"The token is used only for this operation and is cleared from the form after success.",targetBranch:"Target branch",actionsSecretPlaceholder:"Used to write a GitHub Actions secret",sessionTokenPlaceholder:"Optional temporary credential",syncing:"Syncing…",pendingHint:"Continuous delivery is selected. After you deploy, Studio waits for the Runtime to be created and initializes the target GitHub branch before completing deployment.",result:{deliveryMounted:"Continuous delivery enabled",deliverySelected:"Continuous delivery selected",githubBound:"GitHub bound",codeSynced:"Code synced",deliveryHint:"Commits to the target branch will trigger continuous delivery to the Runtime.",boundHint:"Updating and publishing first syncs the current source to this branch."},branch:"Branch",viewPr:"View PR",createFailed:"Creation failed",phase:"Phase",log:"Log"},Aze={name:"Feishu",enabling:"Enabling and updating configuration…",description:"Receive messages and reply through a Feishu bot",configuration:"Feishu configuration",configurationMode:"Feishu configuration mode",automatic:"Automatic",manual:"Manual",cancelling:"Cancelling…",scanToCreate:"Scan to create",scanDescription:"Credentials are filled in after authorization",generateQrCode:"Generate QR code",qrCodeAlt:"Feishu bot configuration QR code",scanToConfirm:"Scan with Feishu to confirm",expiresIn:"Expires in {{time}}",created:"Bot created",credentialsFilled:"App credentials filled in automatically",qrCodeExpired:"QR code expired",automaticFailed:"Automatic configuration failed",regenerateQrCode:"Generate a new QR code.",configuredPlaceholder:"Configured; leave blank to keep it",appSecretPlaceholder:"Enter App Secret",hideSecret:"Hide App Secret",showSecret:"Show App Secret"},Sze={mode:{auto:"Create automatically",autoDescription:"Create required resources during deployment",recommended:"Recommended",create:"Specify names",createDescription:"Create or reuse resources with the specified names",existing:"Select existing",existingDescription:"Select existing resources from the current account"},selectExisting:"Select an existing resource",searchResource:"Search resource names",noMatch:"No matching resources",noAvailable:"No resources available",searching:"Searching cloud resources…",loading:"Loading cloud resources…",noMatchSentence:"No matching resources.",noAvailableSentence:"No resources available.",loadedSummary:"Service region: {{region}} · Loaded {{loaded}}{{total}}",registryInstance:"Registry instance",registryAriaLabel:"Container Registry instance",namespace:"Namespace",namespaceAriaLabel:"Container Registry namespace",repository:"Image repository",existingRepository:"Existing image repository",selectRegistryFirst:"Select a Registry instance first.",selectNamespaceFirst:"Select a Namespace first.",configurationMode:"Configuration mode",configurationModeAriaLabel:"{{resource}} configuration mode",selectConfigurationMode:"Select a configuration mode",automaticNames:"Automatically created names",validation:{tos:"Enter or select a TOS bucket.",cr:"Enter or select a CR instance, namespace, and image repository.",codePipeline:"Enter or select a CodePipeline Workspace and Pipeline.",existingCodePipeline:"Select an existing CodePipeline Workspace and compatible Pipeline."},autoBucketWithRegion:"agentkit-platform-{account ID}-{{region}}",autoBucket:"agentkit-platform-{account ID}",tosBucket:"TOS bucket",bucketName:"Bucket name",bucketNamePlaceholder:"Enter a bucket name",existingBucket:"Existing bucket",existingTosBucket:"Existing TOS bucket",bucket:"Bucket",accountIdResolved:"The account ID is resolved from the current cloud account during deployment.",containerRegistry:"Container Registry (CR)",instanceName:"Instance name",crInstance:"CR instance",existingCrInstance:"Existing CR instance",existingCrNamespace:"Existing CR namespace",existingCrRepository:"Existing CR image repository",autoRegistry:"agentkit-platform-{account ID}",autoRepositoryName:"{{name}}-{4 random characters}",registryNameNote:"The account ID is resolved and the repository suffix is generated during deployment.",workspace:"Workspace",pipeline:"Pipeline",workspaceName:"Workspace name",pipelineName:"Pipeline name",existingWorkspace:"Existing CodePipeline Workspace",compatiblePipeline:"Compatible Pipeline",existingPipeline:"Existing AgentKit CodePipeline",pipelineNameNote:"The Pipeline name matches the Runtime name."},Tze={commit:"Commit",steps:{permissions:"Preflight OTA permissions",resolving:"Resolve target version",downloading:"Download and verify the full update package",preparing:"Prepare VeFaaS Function code",provisioning:"Check and provision Studio cloud resources",scheduler:"Update the scheduled task service",submitting:"Submit the Function update",publishing:"Publish a new Revision and restart the service"},stages:{permissions:"Preflight OTA permissions",resolving:"Resolve version details",downloading:"Download update package",preparing:"Prepare Function code",provisioning:"Provision Studio cloud resources",scheduler:"Update scheduled task service",submitting:"Submit Function update",publishing:"Publish Revision",checking:"Check for updates",unknown:"Unknown stage"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec"},logPermissionPrefix:"Unable to read VeFaaS release logs. The Function role lacks ",logPermissionSuffix:"; the update will continue.",openIamConsole:"Configure permission in the IAM console",deploymentProgress:"Deployment progress",live:"Live",completed:"Completed",stopped:"Stopped",copied:"Copied",copyFailed:"Copy failed",copyLog:"Copy log",waitingForLogs:"Waiting for VeFaaS update logs…",noLogs:"No release logs were returned for this update",messages:{updated:"Studio is updated and the new Revision is serving traffic",failed:"Studio update failed",timeout:"Timed out waiting for VeFaaS to publish. Check for updates again later.",submitted:"Update submitted. Waiting for VeFaaS to publish the new version.",connectionSwitched:"The connection changed. Confirming the new version status."},checkingPermissions:"Checking OTA permissions",authorizationRequired:"IAM authorization required",updating:"Updating Studio",updated:"Studio updated",updateToVersion:"Update Studio to {{version}}",checkPermissions:"Check update permissions",authorizationNeeded:"Authorization required",updatingShort:"Updating",refreshForNewVersion:"Refresh to use the new version",updateFailed:"Update failed",updateNow:"Update now",newVersionAvailable:"New version available",dialog:{failed:"Studio update failed",checkingPermissions:"Checking update permissions",authorizationRequired:"IAM authorization required",updating:"Updating Studio",completed:"Studio update complete",newVersion:"New version available"},permissionCheck:"Checking every IAM permission required by OTA and scheduled tasks…",permissionCheckHint:"Downloads and cloud-resource updates begin only after all permissions are available.",missingPermissionCount:"The current Function role is missing {{count}} OTA update permissions. No cloud resources have been changed.",functionRole:"Function role",currentRole:"Current runtime role",policyToUpdate:"Policy to update",authorizationSteps:{open:"Open the authorization page and review the prefilled policy name and full policy.",debug:"Select “Start debugging” on the page to apply the policy update.",return:"Return to this window and select “Authorized, check again”."},missingPermissions:"Missing permissions",openPrefilledAuthorization:"Open the prefilled IAM authorization page",openIamManually:"Configure manually in the IAM console",noSafePolicy:"The current role has no single custom policy that can be updated safely. Ask an administrator to add the permissions above to this role.",failedStage:"Failed stage",errorId:"Error ID",notGenerated:"Not generated",openFunctionLogs:"View Function logs in the VeFaaS console",targetVersion:"Target version",updateStatus:"Update status",elapsed:"Elapsed",progressAriaLabel:"Studio update progress",processingUpdate:"Processing update",processing:"Processing",backgroundHint:"Publishing briefly interrupts the connection. Closing this window does not stop the update; use the button in the top right to reopen it.",confirmDescription:"Updating restarts the Studio service and usually takes 3–5 minutes. Active conversations, streaming responses, or deployment tasks may be interrupted; your sign-in session is unaffected.",selectVersion:"Select version",currentVersion:"Current version",changelog:"What's new",noChangelog:"No release notes",runInBackground:"Run in background",authorizedRecheck:"Authorized, check again",tryAgain:"Try again"},Cze={deploy:"Deploy",update:"Update",planHash:"Plan hash",backToConfiguration:"Back to configuration",releaseRegion:"Release region",deployRegion:"Deployment region",regionPreserved:"The existing Runtime deployment region is preserved during updates and cannot be changed.",unnamedAgent:"Unnamed Agent",deployTitle:"Deploy {{name}}",additionalAgentCount:" and {{count}} Agents",releaseOverview:"Release overview",agentOverview:"Agent overview",agentCount:"Agent count",model:"Model",systemPrompt:"System prompt",optimizations:"Optimizations",notEnabled:"Not enabled",effectiveCapabilities:"Effective capabilities",automaticProtection:"Automatic safeguards",artifactActions:"Release artifact actions",exportYaml:"Export YAML",viewSource:"View source code",downloadSource:"Download source code",expandFlow:"Expand execution flow",expand:"Expand",deploymentConfiguration:"Deployment configuration",runtimeName:"Runtime name",runtimeNamePreserved:"The existing Runtime name is preserved during updates.",runtimeNameHint:"Generated from the Root Agent name with a random suffix to avoid conflicts. Use 4–64 letters, numbers, hyphens, or underscores.",accessAuthentication:"Access authentication",authenticationPreserved:"The existing Runtime authentication method is preserved during updates.",authenticationMethod:"Authentication method",authenticationAriaLabel:"Deployment authentication method",authenticationPlaceholder:"Select an authentication method",messageChannels:"Message channels",instanceSettings:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",sidecarSingleInstance:"Harness Sidecar currently supports one instance only. The Runtime is fixed at 1–1.",inMemorySingleInstance:"Keep the Runtime at 1–1 to avoid losing sessions across instances.",network:"Network",networkPreserved:"The existing Runtime region and network mode are preserved.",networkMode:"Network mode",networkModes:{public:"Public",both:"Public + VPC"},subnetId:"Subnet ID",subnetHint:"Optional; separate multiple IDs with commas",sharedInternetAccess:"Shared public internet access in the VPC",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",createEvaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment succeeds.",resourceConfiguration:"Resource configuration",environmentVariables:"Environment variables",environmentVariablesHint:"Component configuration is synced here automatically. Review the final values before deployment.",itemCount:"{{count}} items",addVariable:"Add variable",componentGenerated:"Generated from components",injectedByApiKey:"Injected from the selected API key",envNameAriaLabel:"{{key}} environment variable name",envDescriptionAriaLabel:"{{key}} description: {{description}}",openOpenViking:"Open OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}: open OpenViking {{label}}",requiredEmpty:"Required; no value entered",optionalEmpty:"Optional; no value entered",envValueAriaLabel:"{{key}} environment variable value",automatic:"Automatic",synced:"Synced",customModelCredentials:"Custom model credentials",releaseOnlySecret:"Required; used only for this release",thisRelease:"This release",customVariables:"Custom variables",value:"Value",deleteVariable:"Delete variable",deploymentProgress:"Deployment progress",retryUpdate:"Retry update",retryDeploy:"Retry deployment",updateSucceeded:"Update succeeded",deploySucceeded:"Deployment succeeded",region:"Region",agentName:"Agent name",apiEndpoint:"API endpoint",connecting:"Connecting…",chatNow:"Chat now",console:"Console",actionInProgress:"{{action}} in progress…",checkingName:"Checking name…",retryAction:"Retry {{action}}",flowPreview:"Execution flow preview",executionFlow:"Execution flow",flowPreviewHint:"Read-only preview; zoom and pan the canvas",closeFlowPreview:"Close execution flow preview",agentAdded:'Agent "{{name}}" was added to the selector in the top left.',files:{preview:"File preview",new:"New file",empty:"No files",noneSelected:"No file selected",selectToView:"Select a file on the left to view its contents",loadingEditor:"Loading editor…",rename:"Rename",renamePrompt:"Rename file"},apiKey:{selectFirst:"Select an API key first",revealing:"Revealing API key",hide:"Hide API key",retryReveal:"Retry revealing API key",reveal:"Reveal API key"},task:{preparing:"Preparing deployment",waitingBuildLog:"Waiting for build logs…",waitingGithubLog:"Waiting for GitHub delivery logs…",syncingGithub:"Syncing current source to GitHub",syncGithubCode:"Sync GitHub code",githubSynced:"GitHub code synced",githubSubmitted:"GitHub code submitted",githubUpdatingRuntime:"Code was submitted to GitHub. GitHub Actions is updating the same Runtime.",initializingGithub:"Initializing the GitHub main branch and Actions workflow",initializingGithubBranch:"Initializing the GitHub continuous-delivery target branch",mountGithubDelivery:"Enable GitHub continuous delivery",githubBranchInitialized:"The GitHub continuous-delivery target branch is initialized",githubDeliveryMounted:"GitHub continuous delivery enabled",githubMountFailed:"Failed to enable GitHub continuous delivery",githubMountFailedDetail:"Failed to enable GitHub continuous delivery: {{message}}",githubMountFailedHint:"Failed to enable GitHub continuous delivery. See the GitHub log for details.",applyingMpaProfile:"Applying the Agent profile to MPA Runtime",mpaProfileApplied:"MPA Runtime profile applied",runningMpaSmoke:"Verifying the MPA Runtime execution path",mpaReady:"MPA Runtime is ready",deploymentComplete:"Deployment complete",deployedNotConnected:"Deployed, not connected yet",cancelled:"Cancelled",cancelledHint:"Deployment was cancelled and the Runtime resources were requested for deletion.",deploymentStatusUnconfirmed:"Deployment status unconfirmed",deploymentFailed:"Deployment failed",buildFailedHint:"Image build failed. See the build log for details."},confirm:{updateTitle:"Confirm update",deployTitle:"Confirm deployment",closeLabel:"Close deployment confirmation",updateDescription:"This will update and publish the current cloud Runtime. It may take a few minutes. Continue?",deployDescription:"This will create a new cloud Runtime. Deployment may take a few minutes. Continue?",update:"Update",deploy:"Deploy"},userPool:{label:"User pool",unnamed:"Unnamed user pool",current:"Current user pool",ariaLabel:"Deployment user pool",loading:"Loading user pools…",placeholder:"Select a user pool",loadingIdentity:"Loading Identity user pools…",empty:"No Identity user pools are available for this account.",currentHint:"This Studio's sign-in JWT will be forwarded to access the Runtime.",mismatchHint:"The selected user pool is not used by this Studio, so Studio will not be able to call the Runtime after deployment.",markedHint:"The user pool used by this Studio is marked in the list."},authentication:{apiKeyDescription:"Default method using the Runtime API key",userPool:"User pool",userPoolDescription:"Use a JWT issued by an Identity user pool"},steps:{buildImage:"Build image",deploy:"Deploy",publish:"Publish",syncCode:"Sync code",uploadPackage:"Upload code package",packageImage:"Package image",createRuntime:"Create Runtime",publishService:"Publish service",updateInstances:"Update instance configuration",createEvaluationSets:"Create evaluation sets",applyMpaProfile:"Apply MPA profile",verifyMpaRuntime:"Verify MPA Runtime",mpaReady:"MPA Runtime ready"},errors:{instanceRangeInteger:"Minimum instances must be an integer of 0 or more, and maximum instances must be an integer greater than 0.",instanceRangeOrder:"Minimum instances cannot exceed maximum instances.",selectApiKey:"Select an API key in the model configuration first.",loadApiKey:"Failed to load the API key. Try again.",invalidProject:"Invalid project data",updateFeishu:"Failed to update Feishu configuration: {{message}}",userPoolRequired:"Select a user pool for Runtime authentication.",vpcRequired:"Enter a VPC ID when using a VPC network.",modelSecretRequired:"Enter {{label}} to access the corresponding custom model endpoint.",managedApiKeyRequired:"{{requirement}}. Return to model configuration and select an API key first.",feishuEnvRequired:"Enter {{field}} after enabling Feishu.",runtimeNameExists:"This Runtime name already exists. Change it and try again.",deployedButGithubMountFailed:"Deployment succeeded, but enabling GitHub continuous delivery failed: {{message}}",deployedButGithubBindFailed:"Deployment succeeded, but binding GitHub failed: {{message}}",mpaRuntimeIdMissing:"Deployment succeeded, but the Runtime ID is missing, so the MPA profile cannot be applied.",mpaOperationIncomplete:"MPA Runtime setup did not complete. Retry this deployment task.",deploymentStatusUnconfirmed:"The connection was interrupted, so the final deployment status cannot be confirmed. The task may still be running in the cloud. Check the same task in AgentKit or CodePipeline and avoid a duplicate deployment.",failedAtStage:"{{action}} failed during {{stage}}: {{message}}",noAgentAtEndpoint:"Connected successfully, but no Agents were found at this endpoint (/list-apps is empty).",addAgent:"Failed to add Agent: {{message}}",modelApiKeyRequired:"Enter the API key for this model endpoint."}},kze={title:"Workspaces",storageUnavailable:"Persistent storage is not configured. Workspace management is unavailable.",detail:"Workspace details",create:"New workspace",editorDescription:"Group frequently used environments. An environment can belong to multiple workspaces.",backToList:"Back to workspaces",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",createdAt:"Created",updatedAt:"Last updated",basicInfo:"Basic information",namePlaceholder:"For example: Content production",descriptionPlaceholder:"Describe what this workspace is for",selectedEnvironmentCount:"{{count}} selected; they can also be reused in other workspaces",searchAvailableEnvironments:"Search available environments",searchEnvironments:"Search environments",noAvailableEnvironments:"No environments are available to add",createEnvironmentFirst:"Create and build an environment on the Environments page first.",noMatchingEnvironments:"No matching environments",tryAnotherName:"Try searching for another name.",environmentStatus:{available:"Available",building:"Building",notBuilt:"Not built"},added:"Added",saved:"Workspace “{{name}}” saved",resourceType:"Workspace resource type",searchWorkspaces:"Search workspaces",loadFailed:"Unable to load workspaces",noMatchingWorkspaces:"No matching workspaces",tryAnotherNameOrEnvironment:"Try another name or environment",noEnvironmentAdded:"No environments added",environmentMissing:"Environment missing",availableFraction:"{{available}}/{{total}} available",available:"Available",availableCount:"{{count}} available",updated:"Updated",addEnvironment:"Add environment",deleteTitle:"Delete workspace",deleteDescription:"Delete workspace “{{name}}”? Its environments will not be deleted.",deleted:"Workspace “{{name}}” deleted",clipboardPermissionError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually.",codeProjects:"Code projects"},Oze={back:"Back",detailNavigation:"Detail navigation",noData:"No data",actions:"Actions",moreActions:"More actions for {{label}}",actionsFor:"Actions for {{label}}",loading:"Loading resources…"},Eze={addSkill:"Add Skill",remove:"Remove {{name}}",confirmRemoveRuntime:"Remove the running Skill “{{name}}” from the new version?",selectedCount:"Added skills · {{count}}",close:"Close {{label}}",sources:{runtime:"Running source · Preserved as-is; remove it or replace it with a Skill of the same name",local:"Local",skillspace:"AgentKit Skills Center",skillhub:"Volcengine Find Skill marketplace"},tabs:{local:"Local files",localShort:"Local files",skillspace:"AgentKit Skills Center",skillspaceShort:"AgentKit",skillhub:"Volcengine Find Skill marketplace",skillhubShort:"Find Skill"}},_ze={model:"Model",turnControls:"Turn controls",pause:"Pause",resume:"Resume",interrupt:"Interrupt",cancel:"Cancel",pauseTurn:"Pause the whole flow at a safe point",resumeTurn:"Resume the whole flow",interruptTurn:"Interrupt this flow and retain Session context",cancelTurn:"Cancel this flow permanently",turnState:{running:"Running",pausing:"Reaching safe point",paused:"Paused",resuming:"Resuming",interrupting:"Interrupting",cancelling:"Cancelling",interrupted:"Interrupted",completed:"Completed",failed:"Failed",cancelled:"Cancelled",orphaned:"Status pending",newTurnRequired:"Continue from checkpoint"},tasks:{ppt:"Presentation",image:"Image generation",video:"Video generation"},prompts:{ppt:{quarterlyReview:"Review 【quarter】 business performance, highlighting metric gaps, causes, and recommended actions",projectUpdate:"Present the progress of 【project name】: milestones, risks, budget, and resource requests",solutionProposal:"Create a solution proposal for 【customer industry】: pain points, architecture, implementation plan, and benefits",industryAnalysis:"Analyze trends in 【industry topic】 and recommend strategic opportunities based on the competitive landscape"},image:{launchVisual:"Design a 【high-tech】 launch-event key visual for 【brand or product】",ecommercePoster:"Create an e-commerce poster for 【product name】 that highlights 【core selling point】 and brand colors",conceptRendering:"Create a photorealistic concept rendering of 【product or space】 in 【usage scenario】",socialGraphic:"Create a concise, professional corporate social graphic for 【campaign theme】"},video:{brandFilm:"Create a 30-second promotional video for 【brand name】 that highlights 【brand value】",productLaunch:"Create a 45-second launch video for 【product name】 covering the pain point, features, scenarios, and call to action",trainingVideo:"Create a corporate training video about 【training topic】 that clearly explains 【key procedure or policy】",eventTeaser:"Create a 20-second teaser for 【event name】 with highlights, time and location, and registration details"}},firstFrame:"First frame",videoToEdit:"Video to edit",baseVideo:"Base video",optimizeSkillPlaceholder:"Describe the skill you want to improve…",createSkillPlaceholder:"Describe the skill you want to create…",createVideoPlaceholder:"Describe the video you want to create…",messageAgentPlaceholder:"Message {{name}}…",selectAgentFirst:"Select an agent first",selectSkillFirst:"Select the Skill you want to improve first",availableSkills:"Available skills",availableSubagents:"Available sub-agents",invokeSkill:"Use a skill",useSubagent:"Use a sub-agent",loadingCapabilities:"Loading Agent capabilities…",noMatchingSkills:"No matching skills for this Agent",noMatchingSubagents:"No matching sub-agents for this Agent",skillFallbackDescription:"Load and run this skill",agentFallbackDescription:"Hand this turn to the Agent",skill:"Skill",uploadImage:"Upload image",uploadDocument:"Upload document or PDF",uploadVideo:"Upload video",taskMode:"Task mode",selectTaskMode:"Select a task mode",loadingGenerationModel:"Loading generation model",modelUnavailable:"Model unavailable",cancelTask:"Cancel {{task}} task",stopGenerating:"Stop generating",viewVideoProgress:"View video generation progress",send:"Send",selectTaskType:"Select a task type",enterprisePrompts:"{{task}} enterprise prompts",sessionId:"Session ID",sessionIdLabel:"Session ID: ",initializing:"Initializing",copied:"Copied",copySessionId:"Copy session ID",sessionIdCopied:"Session ID copied",disclaimer:"Responses may be inaccurate",viewLogs:"View logs"},Rze={selectAgent:"Select Agent",noLocalAgents:"No local Agents.",searchRuntime:"Search Runtime names",mineOnly:"Created by me",noRuntimes:"No Runtimes.",unsupported:"Unsupported",createdByMe:"Created by me",connecting:"Connecting…",connected:"Connected",connect:"Connect",viewInfoFor:"View information for {{name}}",viewInfo:"View information",agentAndRuntimeInfo:"Agent and Runtime information",detailType:"Detail type",agentInfo:"Agent information",runtimeInfo:"Runtime information",loadingAgentInfo:"Loading Agent information…",cannotLoadAgentInfo:"Agent information is temporarily unavailable",unnamedAgent:"Unnamed Agent",subagents:"Sub-agents",tools:"Tools",skills:"Skills",previewUnsupported:"Preview unavailable",mountedComponents:"Mounted components",noMoreAgentInfo:"No additional Agent configuration information.",local:"Local",model:"Model",status:"Status",memoryMb:"Memory {{value}} MB",instances:"Instances {{min}}–{{max}}",resources:"Resources",version:"Version",loadingDetails:"Loading details…",environmentVariables:"Environment variables",errors:{notFound:"This Runtime no longer exists or the list is out of date. Refresh the list and try again.",accessDenied:"This account cannot access the Runtime. Check its Project and access permissions.",previewUnsupported:"This Agent Server version does not support information previews.",unavailable:"This Runtime is temporarily unavailable. Confirm that its status is Ready and try again.",timeout:"Loading timed out. Try again."},componentKinds:{knowledgebase:"Knowledge base",memory:"Memory",prompt_manager:"Prompt manager",example_store:"Example store",run_processor:"Run processor",tracer:"Trace",toolset:"Toolset",plugin:"Plugin",other:"Other"},runtimeStatus:{ready:"Ready",unreleased:"Unreleased",running:"Running",active:"Running",creating:"Creating",pending:"Pending",deploying:"Deploying",updating:"Updating",failed:"Failed",error:"Error",stopping:"Stopping",stopped:"Stopped",deleting:"Deleting",deleted:"Deleted"}},Dze={agent:"Agents",agentTypes:{general:"General Agents",mpa:"MPA Agents",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"Created by",namedAgent:"{{name}} Agent",storageLocation:"Storage location",currentBrowser:"Current browser",region:"Region",viewDeploymentProgress:"View deployment progress for {{name}}",viewRuntimeDetails:"View Runtime details for {{name}}",viewDetails:"View details for {{name}}",time:"Time",remainingTime:"Time remaining",expiringSoon:"Expiring soon",sandboxRemaining:"{{hours}} hr {{minutes}} min",wakeable:"Asleep",neverExpires:"Never expires",editDraftNamed:"Edit draft {{name}}",viewProgress:"View progress",deleteDraftNamed:"Delete draft {{name}}",recheckCompatibility:"Check chat compatibility for {{name}} again",connectedNamed:"{{name}} is connected",wakeAndChat:"Wake {{name}} and start chatting",chatWith:"Chat with {{name}}",waking:"Waking…",deploying:"Deploying",draft:"Draft",checking:"Checking",chatUnsupported:"Chat unsupported",checkFailed:"Check failed",creatorFilter:"Creator filter",agentType:"Agent type",searchAgents:"Search Agents",handoff:"Handoff",agentList:"{{type}} list",noMatchingAgents:"No matching Agents",adjustSearch:"Try adjusting the search or filters",noAgentType:"No {{type}}",noGeneralAgents:"No General Agents",createGeneralAgentDescription:"Create a General Agent to start building and chatting",createAgentType:"Create {{type}}",createAgent:"Create Agent",loadingMore:"Loading more Agents",scrollForMore:"Scroll down to load more",allLoaded:"All Agents loaded",deleteDraftTitle:"Delete draft?",deleteDraftDescription:"“{{name}}” cannot be recovered after deletion.",deleteDraft:"Delete draft",loadGeneralAgents:"Load General Agents",loadAgentType:"Load {{type}}",compatibility:{checking:"Requesting Runtime /list-apps to confirm that this Agent supports Studio chat.",empty:"Runtime /list-apps returned no available Agents, so chat is currently unavailable.",supported:"This Runtime supports Studio chat.",unknownError:"The Runtime /list-apps request failed without a recognizable error."},sandboxStatus:{ready:"Ready",wakeable:"Asleep",creating:"Creating",starting:"Starting",initializing:"Starting",pending:"Pending",running:"Running",failed:"Error",error:"Error",stopped:"Stopped",expired:"Expired",deleting:"Deleting",deleted:"Deleted",unknown:"Unknown status"},wakingHint:"Waking the agent. This may take some time.",mpaCreate:{maxInstance:"Maximum instances",maxInstanceHelp:"Defaults to {{maximum}}; this limits the number of Runtime instances during autoscaling.",maxInstanceInvalid:"Maximum instances must be an integer of at least 1.",name:"Name",namePlaceholder:"e.g. test-agent",nameHelp:"Used as the Runtime name. Use 4–64 letters, numbers, underscores or hyphens.",stepsLabel:"Creation steps",steps:{basics:"Basics",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"Database"},next:"Next",previousStep:"Previous",pgDescription:"Choose an existing PostgreSQL instance. Creation prepares an isolated database for this agent on that instance.",pgSplitDescription:"Use the configured business PG Workspace. Agents share this Workspace, each with its own database. Shared resource records are stored separately in mpa_admin_workspace / mpa_admin_db, configured by the administrator.",pgConsoleByteplus:"Create or inspect an AIDAP PG Workspace in BytePlus",pgConsole:"Create or inspect an AIDAP PG Workspace in Volcengine",pgHost:"PG host",pgPort:"PG port",pgInvalid:"Enter a valid PG host and port.",pgCredentials:"The deployment service provides the PG login and password; host and port must match its configuration.",openvikingDescription:"Optional. Enter all three fields to enable OpenViking, or leave all blank to omit OpenViking settings from the new agent.",openvikingConsoleByteplus:"Inspect OpenViking resources in BytePlus",openvikingConsole:"Inspect OpenViking resources in Volcengine",openvikingUrl:"OpenViking service URL",openvikingResourceId:"OpenViking resource ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"Enter a valid HTTPS service URL, resource ID and API Key together, or leave all blank.",openvikingCredentials:"The API Key is used only for this creation and is not saved in browser drafts; re-enter it after a refresh.",tosTitle:"Session output storage",tosDescription:"Optional. Select a bucket to persist each Session's output directory. Access uses the sandbox IAM Role. Without a bucket, files are stored in the sandbox's local directory.",tosBucket:"TOS bucket",tosInvalid:"Select an available bucket starting with agentkit-platform-.",tosCredentials:"Creation adds session-output access for the selected bucket to the shared role. Other runtimes and sandboxes using that role receive the same access.",tosDisable:"Clear bucket selection",tosBucketUnavailable:"The bucket is unavailable in this deployment account or region. Select a bucket from the list and retry.",runtimeImage:"MPA image",workerImage:"Worker image",imageDefault:"Leave blank to use the configured image",imageInvalid:"Enter a valid container image reference without URLs, spaces or credentials.",title:"Create MPA agent",agentId:"Agent ID",description:"Description",region:"Deployment region",plan:"Creation plan",sharedResources:"Prepare or reuse the account VPC, subnets and APIG message gateway",agentResources:"Prepare an isolated database, Skill Space and worker, then deploy the agent",readiness:"Verify gateway and agent readiness before adding the agent to the list",checking:"Checking creation configuration…",configured:"Creation configuration is ready. Submission checks cloud resources and starts provisioning.",notConfigured:"Creation prerequisites are not configured. Ask an administrator to configure them, then retry.",loadFailed:"Could not check creation configuration. Please retry.",reload:"Check again",submit:"Start creation",retry:"Retry creation",newAgent:"Create another agent",newAgentDescription:"Create another agent opens an editable new request and replaces this recovery draft. It does not cancel the old task. If the old task is still running, wait for it to finish before submitting.",close:"Close",cancel:"Cancel creation",confirmCancel:"Confirm cancellation",cancelDescription:"Cancellation stops subsequent steps. Created databases, Skill Spaces, gateways and other registered resources are retained. Retry using the same agent ID.",background:"Creation continues after closing this window. Open it again to view progress.",pollFailed:"Progress is temporarily unavailable. Reconnecting; avoid creating another agent.",iamPermissionDenied:"The deployment service lacks IAM permissions to prepare the runtime role. Ask an administrator to grant access, then retry.",iamTrustConflict:"The runtime role trust is incompatible. Ask an administrator to check VeFaaS and APIG access, then retry.",iamPolicyConflict:"An existing runtime policy with the required name has conflicting contents. Ask an administrator to check it, then retry.",iamOwnershipConflict:"The runtime role does not belong to the deployment account. Ask an administrator to check it, then retry.",iamTemporaryFailure:"IAM requests temporarily failed or timed out after retries. Check the Studio network connection and IAM service, then retry with the same agent ID.",iamVerificationFailed:"Runtime role permissions could not be confirmed. Check IAM availability and policies, then retry.",iamConfigurationConflict:"Automatic runtime role preparation requires the default MPA role. Check the server creation configuration.",creationFailed:"This step failed. Check its resources, server configuration and permissions, then retry the same agent ID.",configurationChanged:"This agent's creation configuration no longer matches the original submission. Restore the original settings before retrying, or create another agent request.",cancelFailed:"Cancellation failed. Check the current progress and retry.",cancelled:"Creation cancelled. Registered resources are retained for retry.",timeout:"Creation timed out. Registered resources are retained. Inspect them before retrying.",interrupted:"Creation was interrupted. Retry the same agent ID to recover registered resources.",skillSpace:"Skill Space",states:{running:"Creating",cancelling:"Cancelling",succeeded:"Created",failed:"Creation failed",cancelled:"Cancelled"},stages:{queued:"Queued",iam_role:"Prepare runtime role",checking:"Checking account and configuration",network:"Preparing VPC and subnets",gateway:"Preparing APIG and IM Gateway",database:"Preparing business database",skills:"Preparing Skill Space",worker:"Preparing worker",deploying:"Preparing database, skills and Runtime",verifying:"Waiting for agent readiness",admin_workspace:"Prepare management PG Workspace",business_workspace:"Prepare business PG Workspace",admin_database:"Initialize shared management database",openviking:"Preparing OpenViking library",openviking_key:"Preparing OpenViking credentials"},back:"Keep creating",pgAutoDescription:"VeADK uses its deployment account to create or reuse two PG Workspaces. mpa_admin_workspace / mpa_admin_db stores shared resource records; the business Workspace hosts an independent database for each agent. No PG connection input is needed. Preparation starts after submission.",pgPerAgentDescription:"Creation reuses the shared management Workspace and prepares a dedicated business PG Workspace and database for this agent. Existing tasks retain their database on retry.",pgAidbDescription:"Creation reuses the shared management Workspace and prepares a dedicated business Workspace with an aidb database. The business Workspace is named mpa_agent_. Existing retries retain their original database.",runtimeNameTaken:"This name is used by a Runtime, sandbox template, business Workspace, or active creation. Choose another name.",runtimeNameCheckFailed:"Unable to check this name. Check resource query permissions and connectivity, then retry.",pgModeChanged:"This submitted task uses previous PG settings and cannot be retried in automatic mode. Ask an administrator to reconcile its resources and task before starting a new creation.",pgMigrationRequired:"An existing shared registry is configured. Migrate its resource records to mpa_admin_workspace / mpa_admin_db and coordinate the registry URL cutover for existing Runtimes, then recheck this configuration.",openvikingAutoDescription:"An independent OpenViking library will be created for this agent using default models. Its connection settings will be prepared automatically.",openvikingAutoByteplusDescription:"Creates a personal OpenViking library for this agent in BytePlus Johor, and prepares the connection settings automatically. Retrying reuses its registered library.",openvikingAutoByteplusRequirements:"Uses the MPA ModelArk API Key and the VLM/Embedding inference endpoints configured by the administrator. Personal libraries use one default user; the Runtime image must support this mode and overseas data-plane access before memory can be used. Libraries are retained after cancellation or agent deletion.",openvikingModelEndpointsInvalid:"Ask the administrator to configure valid OV_VLM_ENDPOINT_ID and OV_EMBEDDING_ENDPOINT_ID values on the Studio server, then retry.",openvikingAutoBilling:"Enterprise libraries are billed by usage starting when creation succeeds. Retrying this agent reuses its registered library.",openvikingPermissionDenied:"OpenViking permission denied. Check the deployment account’s library creation, query and API Key access permissions, then retry.",openvikingConfigurationConflict:"OpenViking ownership or configuration differs from this agent. Check its registered library before retrying.",openvikingCreateUnknown:"The OpenViking creation result is unknown. An administrator must verify the cloud library and reconcile its resource ID before retrying; another library will not be created automatically.",openvikingNotReady:"OpenViking is still initializing. Wait, then retry this agent to continue with the same library.",openvikingResourceFailed:"OpenViking initialization failed. Check the library status and model configuration in the console before retrying.",openvikingResourceMissing:"The registered OpenViking library or default user was not found. Check its binding and availability before retrying.",openvikingModelConfigurationRejected:"The platform rejected the default model configuration or library parameters. Check OpenViking model availability and account eligibility before retrying.",openvikingUnavailable:"OpenViking could not be reached. Check the service and network, then retry.",openvikingInvalidResponse:"OpenViking returned incomplete or invalid configuration. Check the library and default user before retrying.",openvikingQuotaExceeded:"OpenViking quota or request rate was exceeded. Adjust the quota or retry this agent later."}},Lze={library:"Skill library",skill:"Skill",skills:"Skills",skillSpace:"Skill space",sandboxNotConfigured:"Dev Sandbox is not configured by an administrator",adminNotConfigured:"Not configured by an administrator",totalItems:"{{count}} items",cannotLoadSpaces:"Unable to load Skill spaces",someSpacesFailed:"Some Skill spaces failed to load",degradedRelationWarning:"Some relations are invalid. Readable skills have been restored.",downloadZip:"Download ZIP",optimize:"Optimize",closeSkillDetails:"Close Skill details",skillId:"Skill ID",allFiles:"All files",loadingSkillContent:"Loading Skill content…",noSkillContent:"This Skill has no SKILL.md content",addSkill:"Add Skill",localUpload:"Upload locally",localUploadDescription:"Select a ZIP file and upload it to the Skill space after validation",autoCreate:"Create automatically",autoCreateDescription:"Choose a model and style, then create a Skill through conversation",createSkill:"Create Skill",optimizeNamed:"Optimize {{name}}",deleteSkillConfirm:"Delete the entire Skill “{{name}}”? This affects every space that references it.",deleteSpaceConfirm:"Delete Skill space “{{name}}”? Make sure its Skills have been deleted first.",manageSpaceDescription:"Manage Skills in this space and create new versions",backToSpaces:"Back to Skill spaces",overview:"Overview",skillCount:"Skills",skillCountValue_one:"{{count}} Skill",skillCountValue_other:"{{count}} Skills",updatedAt:"Updated",skillsInSpace:"Skills in {{name}}",searchSkills:"Search Skills",cannotLoadSkills:"Unable to load Skills",noMatchingSkills:"No matching Skills",noSkills:"No Skills",tryAnotherName:"Try searching for another name",emptySkillsDescription:"Upload a Skill locally or create one automatically",actions:"Actions",spaceDetails:"Skill space details",editSpace:"Edit space",deleteSpace:"Delete space",searchSpaces:"Search Skill spaces",spaceList:"Skill space list",noMatchingSpaces:"No matching Skill spaces",createSpace:"Create Skill space",newSpace:"New space",loadingMoreSpaces:"Loading more Skill spaces",scrollForMore:"Scroll down to load more",allSpacesLoaded:"All Skill spaces loaded",errors:{loadSpaces:"Unable to load Skill spaces. Try again later.",loadSkills:"Unable to load Skills. Try again later.",loadSkillDetails:"Unable to load Skill details. Try again later.",deleteSkill:"Unable to delete the Skill",deleteSpace:"Unable to delete the Skill space",downloadSkill:"Unable to download the Skill"},status:{active:"Available",available:"Available",creating:"Creating",disabled:"Disabled",enabled:"Enabled",failed:"Error",inactive:"Inactive",pending:"Pending",published:"Published",ready:"Ready",released:"Published",running:"Running",success:"Healthy",unavailable:"Unavailable",unreleased:"Unreleased",updating:"Updating",unknown:"Unknown"},sharedSpace:"Enterprise shared space",sharedDescription:"Skills available to everyone, published and maintained by administrators",sharedVisibility:"Everyone",sharedPreparing:"Preparing shared space",sharedLoadFailed:"Shared space unavailable",sharedEmpty:"No shared skills yet. Skills published by administrators will appear here",requestPublication:"Request publication",reviewSubmitting:"Submitting…",reviewSubmitted:"Submitted",reviewFailed:"Could not submit the publication request",reviewStatusFailed:"Failed to load review status",reviewRetry:"Apply again",reviewPending:"Pending review",reviewApproving:"Publishing",reviewApproved:"Shared",reviewReturned:"Returned",reviewHistory:"Review history",skillDetailSections:"Skill detail sections",versions:{title:"Version management",refresh:"Refresh",uploading:"Uploading…",upload:"Upload new version",close:"Close",hint:"New versions become public after approval and do not replace published versions; the skill name in the ZIP must match the original",loading:"Loading versions…",loadFailed:"Unable to load versions",filesFailed:"Unable to load version files",uploadFailed:"Unable to upload the new version",submitFailed:"Unable to submit for review",retry:"Retry",empty:"No versions yet",current:"Current version",notSubmitted:"Not submitted",submitting:"Submitting…",submit:"Request publication",processing:"Version status: {{status}}",filesLoading:"Loading files…",filesEmpty:"No files",history:"Review history",shared:"Published"},author:"Author",authorName:"Author: {{name}}"},Mze={library:"Knowledge bases",createBase:"New knowledge base",editBase:"Edit knowledge base",invalidName:"The name must start with a letter and contain only letters, numbers, and underscores.",nameHelp:"Start with a letter. Use up to 48 letters, numbers, or underscores.",optionalDescription:"Description (optional)",descriptionOnly:"AgentKit currently supports updating only the knowledge base description.",previewWeb:"Preview web content",addData:"Add data",openOriginalWeb:"Open original page",backToEdit:"Back to edit",confirmAdd:"Confirm and add",source:"Knowledge source",image:"Image",documentFile:"Document file",webPage:"Web page",webUrl:"Web page URL",generatingWebPreview:"Fetching the page and generating a Markdown preview",selectFile:"Select knowledge file",selectOrDropFile:"Select a file or drag it here",selectedFile:"{{size}} · Click to select another file",imageFileHelp:"PNG, JPG, and JPEG up to 200 MB",documentFileHelp:"PDF, PPTX, DOCX, XLSX, and TXT up to 200 MB",uploadingFile:"Uploading the file and adding it to the knowledge base",optionalName:"Name (optional)",optionalType:"Type (optional)",generatePreview:"Generate preview",uploadFile:"Upload file",editMetadata:"Edit knowledge metadata",knowledge:"Knowledge item",field:"Field",value:"Value",backToList:"Back to knowledge bases",metadataJson:"Metadata (JSON)",provider:"Provider",knowledgeId:"Knowledge ID",project:"Project",creator:"Created by",data:"Data",deleteInvalidAssociation:"Delete invalid association",noData:"This knowledge base has no data",addFirstData:"Add the first data item",format:"Format",size:"Size",searchData:"Search data",searchLibraryData:"Search knowledge base data",associationInvalid:"Association invalid",providerMissing:"The underlying Provider knowledge base no longer exists",noMatchingData:"No matching data",loadingMoreData:"Loading more data",retryLoading:"Retry loading",details:"Knowledge base details",searchBases:"Search knowledge bases",someBasesFailed:"Some knowledge bases are temporarily unavailable. Other available content is shown.",noMatchingBases:"No matching knowledge bases",noManagePermission:"You do not have permission to manage this knowledge base",loadingMoreBases:"Loading more knowledge bases",deleteBaseTitle:"Delete knowledge base?",deleteBaseDescription:"This removes the AgentKit association for {{name}}. If Studio created it, the Provider resource is also deleted. This cannot be undone.",deleteDocumentTitle:"Delete knowledge item?",deleteDocumentDescription:"This removes {{name}} from the Provider knowledge base. This cannot be undone.",preview:{processingTitle:"Data is being processed",processingDetail:"A preview will be available after parsing. Reload later.",failedTitle:"Data parsing failed",failedDetail:"Check the source file or page URL and add it again, or reload the latest status.",noParsedTitle:"No parsed content is available yet",noParsedDetail:"Text, tables, or page images will appear after the knowledge base finishes parsing this file.",noMediaTitle:"No media preview is available yet",noMediaDetail:"The knowledge base has not returned an accessible media preview. Reload later.",noDataTitle:"No data is available to preview",noDataDetail:"The knowledge base has not returned parsed results. Reload later.",attachmentError:"The attachment cannot be previewed. Try again later.",imageAlt:"Knowledge data image",audioUnsupported:"This browser does not support audio previews.",videoUnsupported:"This browser does not support video previews.",namedPdf:"{{name}} PDF preview",pdf:"PDF preview",openPdf:"If it cannot be displayed, open the PDF in a new window",fileUnsupported:"This format cannot be previewed directly online. Parsed content is shown when available.",openOriginalFile:"Open original file",loading:"Loading data preview",openOriginalHint:"You can open the original page to view the source content.",chunk:"Chunk {{index}}",loadingMore:"Loading more",loadMore:"Load more"},errors:{fileTooLarge:"A file cannot exceed 200 MB",invalidImageType:"Select a PNG, JPG, or JPEG image",invalidDocumentType:"Select a PDF, PPTX, DOCX, XLSX, or TXT file",createBase:"Unable to create the knowledge base",updateBase:"Unable to update the knowledge base",metadataObject:"Metadata must be a JSON object",metadataFormat:"Invalid metadata format",noWebPreview:"The page has no Markdown content to preview",addWeb:"Unable to add the web page",previewWeb:"Unable to generate the web page preview",uploadFile:"Unable to upload the file",updateDocument:"Unable to update the knowledge item",loadPreview:"Unable to load the data preview",loadMoreBases:"Unable to load more knowledge bases",loadBases:"Unable to load knowledge bases",loadMoreData:"Unable to load more data",loadData:"Unable to load data",deleteBase:"Unable to delete the knowledge base",deleteDocument:"Unable to delete the knowledge item"}},Ize={bindingType:"Bot type",bindingType_shared:"Shared",bindingType_private:"Private",bindingTypeHelp_shared:"Sessions are isolated from each other.",bindingTypeHelp_private:"Private chats can recall this Bot’s history, including group chats.",title:"Feishu channel",refresh:"Refresh",loading:"Loading channel configuration…",unsupported:"This Runtime does not support channel management. Upgrade its MPA image.",unauthorized:"Channel management requires a Studio administrator and an authorized Runtime credential.",configurationError:"Channel management configuration is incomplete. Check the Runtime metadata and encryption key.",requestFailed:"Channel request failed. Check the Runtime connection and retry.",bound:"Bound: {{name}}",unbound:"No Feishu bot is bound.",guidance:"Private chats use separate conversations. In allowed groups, mention this bot to start a conversation.",keyRequired:"Configure a persistent CHANNEL_STATE_ENCRYPTION_KEY in the Runtime before binding.",gateway:"Message gateway",route:"Inbound route",delivery:"Reply delivery",configured:"Configured",missing:"Missing",delivery_not_observed:"Not observed",delivery_delivered:"Delivered",delivery_retrying:"Retrying",missingConfig:"Missing Runtime configuration: {{fields}}",bind:"Bind with QR code",newQr:"Generate a new QR code",unbind:"Unbind",confirmUnbind:"Disconnect this bot? It will stop receiving new messages.",qrAlt:"Bot authorization QR code",openQr:"Open authorization page",uncertain:"Registration was interrupted. Check the bot binding and Gateway before starting again.",bindingFailed:"Binding failed. Check Gateway configuration and retry.",chatId:"Allowed group ID",scope:"Group conversation scope",saveGroup:"Save group",noGroups:"No groups allowed yet. Private chats do not need this permission.",edit:"Edit",remove:"Remove",removeGroup:"Remove {{name}}",scope_group_sender:"Separate by sender",scope_group:"Shared by group",scope_group_topic_sender:"Separate by topic and sender",scope_group_topic:"Shared by topic",status_PENDING:"Waiting for scan",status_SCANNED:"Scanned; waiting for authorization",status_AUTHORIZED:"Authorized; preparing registration",status_REGISTERING:"Registering bot",status_BOUND:"Bot bound",status_FAILED:"Binding failed",status_EXPIRED:"QR code expired",workspaceTitle:"Message channels",workspaceDescription:"Connect messaging apps to this Agent and manage access.",provider_feishu:"Feishu",provider_wecom:"WeCom",provider_dingtalk:"DingTalk",comingSoon:"Not available yet",unavailableDescription:"Binding and message settings for {{name}} are not available yet.",runtimeRequired:"Deploy this Agent to a Runtime before configuring message channels.",bindingTitle:"Bot connection",connected:"Bound",notBound:"Not bound",gatewayDescription:"Gateway configuration for receiving channel messages.",routeDescription:"Routing configuration for delivering messages to this Agent.",deliveryDescription:"Observed reply delivery; configuration alone does not confirm delivery.",groupsTitle:"Group access",groupsDescription:"Allow specific groups to access this agent.",providerBindingTitle:"Connect {{name}}",providerUnbound:"Connect a {{name}} bot to let users message this agent.",qrGuidance:"Authorize with {{name}}. The Runtime saves the bot credentials and configures the message gateway.",wecomGuidance:"Authorize with WeCom QR code, or enter a Bot ID and Secret to bind an existing bot.",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"Connect bot",wecomScan:"Bind with QR code",wecomAuthorizing:"Waiting for WeCom authorization…",cancelAuthorization:"Cancel authorization",wecomPopupBlocked:"Allow popups in your browser, then try authorizing again.",wecomAuthCancelled:"WeCom authorization was cancelled. You can scan again.",wecomAuthTimeout:"WeCom authorization timed out. Please scan again.",wecomInvalidResult:"Authorization did not return a Bot ID and Secret. Authorize again or enter them manually.",wecomAuthFailed:"WeCom authorization failed. Try again or enter credentials manually.",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"Upgrade this Runtime image to configure {{name}} manually. Quick setup is still available.",pairingTitle:"Message channel QR pairing",feishuPairingDescription:"If a bot is already connected, it will be replaced after successful Feishu authorization and binding. In the authorization flow, you can bind an existing bot or create a new one.",generatingQr:"Generating pairing QR code…",dingtalkGuidance:"Authorize with DingTalk QR code, or enter a Client ID and Client Secret to bind an existing bot.",wecomPairingDescription:"Pair again in the WeCom authorization window. The new bot replaces the current connection after binding succeeds. Cancelling authorization or a failed binding does not disconnect the existing bot.",configurationMethod:"Configuration method",quickSetup:"Quick setup",manualSetup:"Manual setup",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"Enter the credentials of an existing {{name}} bot to connect it to this agent.",manualReplacement:"Successful binding replaces the current bot. Cancelling or a failed binding does not disconnect the existing bot.",accountsTitle:"Feishu bots",account:"Bot",selectAccount:"Select a bot",accountEnabled:"Enabled",accountDisabled:"Disabled",addAccount:"Add bot",cancelAddAccount:"Cancel adding",enableAccount:"Enable bot",disableAccount:"Disable bot",noAccounts:"No Feishu bots are bound.",accountsFailed:"Could not load bots. Try again.",accountConflict:"The bot account is ambiguous or conflicts with its configuration. Refresh and select a bot.",multiBotPairingDescription:"Binding a new Feishu app adds a bot. Binding the same App ID updates that bot.",provider_lark:"Lark",larkPairingDescription:"Scan with Lark to authorize a bot. Existing bots remain bound until this setup succeeds.",larkAccountsTitle:"Lark bots",noLarkAccounts:"No Lark bots are bound."},gdr=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:fze,agentSelector:Rze,agentWorkspace:gze,channels:Ize,cloudEnvironment:xze,common:hze,composer:_ze,default:{common:hze,agentKitPromo:fze,systemInfo:pze,agentWorkspace:gze,environmentCenter:mze,deploymentSelect:vze,deploymentError:yze,studioBuildProgress:bze,cloudEnvironment:xze,githubCicd:wze,feishuDeployment:Aze,deploymentResources:Sze,studioUpdate:Tze,projectPreview:Cze,workspace:kze,resourceCollection:Oze,skillSourcePicker:Eze,composer:_ze,agentSelector:Rze,myAgents:Dze,skillCenter:Lze,knowledge:Mze,channels:Ize},deploymentError:yze,deploymentResources:Sze,deploymentSelect:vze,environmentCenter:mze,feishuDeployment:Aze,githubCicd:wze,knowledge:Mze,myAgents:Dze,projectPreview:Cze,resourceCollection:Oze,skillCenter:Lze,skillSourcePicker:Eze,studioBuildProgress:bze,studioUpdate:Tze,systemInfo:pze,workspace:kze},Symbol.toStringTag,{value:"Module"})),Pze="User management",Nze="{{count}} members",Bze="User",$ze="Role",Fze="Account status",zze="Last sign-in",Uze="Actions",Vze="Change role",Gze="Close",Qze="Save role",Hze="Saving…",Wze="Cancel",Yze="Back",qze="User pool",jze="Volcengine Identity",Xze="Search name, email or user ID",Kze="Search",Zze="Filter by role",Jze="All roles",eUe="Refresh",tUe="Loading users…",rUe="Updated at {{time}}",nUe="{{name}} is now {{role}}",iUe="Retry",aUe="You",oUe="Initial super administrator",sUe="The initial super administrator cannot be demoted here",lUe="The new permissions apply when the user refreshes Studio",cUe="Role needs confirmation",uUe="No matching users",dUe="Try another search or role",hUe="Users appear here after signing in or joining this user pool",fUe="{{count}} users",pUe="Previous",gUe="Next",mUe="Not signed in yet",vUe="Not provided",yUe={super_admin:"Super administrator",admin:"Administrator",developer:"Developer",user:"User"},bUe={super_admin:"Manage all resources, users and role assignments",admin:"Manage Studio resources",developer:"Develop agents and manage your own resources",user:"Use agents and personal features"},xUe={EXTERNAL_PROVIDER:"Active",CONFIRMED:"Active",NORMAL:"Active",ENABLED:"Active",ACTIVE:"Active",UNCONFIRMED:"Unverified",DISABLED:"Disabled",FORBIDDEN:"Disabled",LOCKED:"Locked",SUSPENDED:"Suspended",FORCE_CHANGE_PASSWORD:"Password change required"},wUe={request_failed:"The request did not finish. Refresh the list to confirm its current state before retrying",invalid_response:"The user service returned an invalid response. Refresh and try again",identity_unavailable:"Identity is unavailable. Try again later or check service permissions",identity_resource_missing:"The user or user pool no longer exists. Refresh the list",super_administrator_required:"Only super administrators can manage users",sign_in_required:"Sign in and try again",user_not_in_pool:"Your account does not belong to this user pool",user_disabled:"Your account is disabled",protected_administrator:"The initial super administrator cannot be demoted",cannot_demote_self:"You cannot demote your own super administrator role",role_change_conflict:"The role has changed. Close this dialog and refresh the list before retrying",cross_origin_request:"Change roles from the current Studio page"},mdr=Object.freeze(Object.defineProperty({__proto__:null,actions:Uze,allRoles:Jze,back:Yze,cancel:Wze,changeRole:Vze,close:Gze,default:{title:Pze,memberCount:Nze,user:Bze,role:$ze,status:Fze,lastLogin:zze,actions:Uze,changeRole:Vze,close:Gze,save:Qze,saving:Hze,cancel:Wze,back:Yze,pool:qze,volcengineIdentity:jze,searchPlaceholder:Xze,search:Kze,filterRole:Zze,allRoles:Jze,refresh:eUe,loading:tUe,updatedAt:rUe,saved:nUe,retry:iUe,you:aUe,initialAdministrator:oUe,protectedExplanation:sUe,effectiveAfterRefresh:lUe,roleConflict:cUe,noUsers:uUe,tryAnotherSearch:dUe,poolEmpty:hUe,resultCount:fUe,previous:pUe,next:gUe,neverLoggedIn:mUe,unknown:vUe,roles:yUe,descriptions:bUe,states:xUe,errors:wUe},descriptions:bUe,effectiveAfterRefresh:lUe,errors:wUe,filterRole:Zze,initialAdministrator:oUe,lastLogin:zze,loading:tUe,memberCount:Nze,neverLoggedIn:mUe,next:gUe,noUsers:uUe,pool:qze,poolEmpty:hUe,previous:pUe,protectedExplanation:sUe,refresh:eUe,resultCount:fUe,retry:iUe,role:$ze,roleConflict:cUe,roles:yUe,save:Qze,saved:nUe,saving:Hze,search:Kze,searchPlaceholder:Xze,states:xUe,status:Fze,title:Pze,tryAnotherSearch:dUe,unknown:vUe,updatedAt:rUe,user:Bze,volcengineIdentity:jze,you:aUe},Symbol.toStringTag,{value:"Module"})),AUe="Website integration",SUe="Embed an AgentKit Runtime on your website as a floating chat window",TUe="Back to automations",CUe="Add website",kUe="Loading Runtime",OUe="Select Runtime",EUe="Website domain",_Ue="For example, xxxx.com or localhost:5173",RUe="Generating",DUe="Generate token",LUe="Added websites",MUe="{{count}} website",IUe="{{count}} websites",PUe="Loading website integrations",NUe="No website integrations yet",BUe="Select a Runtime and enter a website domain to generate a token",$Ue="Embed instructions",FUe="Place this code before the closing body tag on your website",zUe="Copied",UUe="Copy code",VUe="Embed code will appear here after you add a website.",GUe="Delete the website integration for {{domain}}?",QUe={load:"Failed to load website integrations",create:"Failed to create website integration",delete:"Failed to delete website integration",noConversationalAgent:"No conversational Agent was found in this Runtime"},HUe={requestFailed:"Request failed ({{status}})",greeting:"Hello. How can I help?",sessionFailed:"Could not start a chat session",unauthorized:"This website is not authorized to start a chat",conversationFailed:"The chat request failed. Try again shortly.",open:"Open Agent chat",close:"Close Agent chat",panelLabel:"Agent chat panel",assistant:"Agent assistant",online:"Online"},vdr=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:CUe,addedWebsites:LUe,backToAutomations:TUe,confirmDelete:GUe,copied:zUe,copyCode:UUe,default:{title:AUe,description:SUe,backToAutomations:TUe,addWebsite:CUe,loadingRuntime:kUe,selectRuntime:OUe,websiteDomain:EUe,domainPlaceholder:_Ue,generating:RUe,generateToken:DUe,addedWebsites:LUe,websiteCount_one:MUe,websiteCount_other:IUe,loadingIntegrations:PUe,delete:"Delete",emptyTitle:NUe,emptyDescription:BUe,embedMethod:$Ue,embedInstructions:FUe,copied:zUe,copyCode:UUe,embedHint:VUe,confirmDelete:GUe,errors:QUe,widget:HUe},description:SUe,domainPlaceholder:_Ue,embedHint:VUe,embedInstructions:FUe,embedMethod:$Ue,emptyDescription:BUe,emptyTitle:NUe,errors:QUe,generateToken:DUe,generating:RUe,loadingIntegrations:PUe,loadingRuntime:kUe,selectRuntime:OUe,title:AUe,websiteCount_one:MUe,websiteCount_other:IUe,websiteDomain:EUe,widget:HUe},Symbol.toStringTag,{value:"Module"})),WUe={types:{all:"All types",document:"Documents",image:"Images",video:"Videos"},previewArtifact:"Preview {{name}}",moreActions:"More actions for {{name}}",actionMenu:"Actions for {{name}}",download:"Download",downloading:"Downloading",edit:"Edit details",delete:"Delete artifact",previewFailed:"Could not preview “{{name}}”: {{message}}",downloadStarted:"Download started for {{name}}",downloadFailed:"Could not download “{{name}}”: {{message}}",updated:"Updated {{name}}",deleted:"Deleted {{name}}",deleteFailed:"Could not delete “{{name}}”: {{message}}",typeFilter:"Artifact type",searchAria:"Search artifacts",searchPlaceholder:"Search artifacts or sessions",retry:"Retry",close:"Close",listAria:"Artifact list",loadFailed:"Could not load artifacts",loadDetailFallback:"Check the storage configuration and try again.",reload:"Reload",noMatch:"No matching artifacts",noArtifacts:"You do not have any artifacts yet",searchHint:"Try another search or artifact type",emptyHint:"Artifacts created in chats will appear here automatically",columns:{name:"Name",source:"Source",updatedAt:"Modified",actions:"Actions"},loadingMore:"Loading more artifacts",unknownTime:"Unknown time",preview:{close:"Close preview",meta:"{{type}} / Version {{version}}",loading:"Loading preview",alt:"Preview of {{name}}",loadFailed:"The preview could not be loaded. Try again later or download the file.",unsupported:"This format cannot be previewed online. Download the file to view it.",sourceAria:"Artifact source",agent:"Agent",session:"Session",tool:"Generated by",createdAt:"Created",fileSize:"File size",tags:"Tags",viewSession:"View session"},deleteDialog:{title:"Delete artifact?",description:"“{{name}}” will be permanently removed from the artifact library. The chat history will not be affected.",deleting:"Deleting",confirm:"Delete",close:"Close delete confirmation"},api:{withStatus:"{{message}} ({{status}})",listFailed:"Could not load the artifact library",syncFailed:"Could not sync chat artifacts",updateFailed:"Could not update the artifact",deleteFailed:"Could not delete the artifact",downloadFailed:"Could not download the artifact"}},YUe={unknownSource:"Unknown source",unknownCreator:"Unknown creator"},qUe={nameRequired:"Enter an artifact name",tooManyTags:"You can add up to {{max}} tags",tagTooLong:"Each tag can contain up to {{max}} characters",title:"Edit artifact details",subtitle:"The content file will not be modified",close:"Close edit dialog",name:"Name",description:"Description",descriptionPlaceholder:"Add its purpose, version, or usage notes",tags:"Tags",tagsPlaceholder:"Separate tags with commas, up to {{max}}",cancel:"Cancel",saving:"Saving",save:"Save"},jUe={change:{added:"Added",modified:"Modified",deleted:"Deleted"},noChanges:"There are no source changes between these versions",chooseFile:"Select a file on the left to view its code",compareTitle:"Compare versions",workspaceTitle:"Source workspace",projectFallback:"Agent project",switchTheme:"Switch source theme",switchThemeTitle:"Switch to {{theme}} theme",themes:{dark:"dark",light:"light"},closeWorkspace:"Close source workspace",close:"Close",changedFiles:"Changed files",projectFiles:"Project files",changes:"Changes",files:"Files",openFiles:"Open files",noFileSelected:"No file selected",comparisonDirection:"Comparison direction",before:"Before optimization",after:"After optimization",loadingEditor:"Loading editor…",changedFileCount_one:"{{count}} file changed",changedFileCount_other:"{{count}} files changed",fileCount_one:"{{count}} file",fileCount_other:"{{count}} files",lineCount_one:"{{count}} line · UTF-8",lineCount_other:"{{count}} lines · UTF-8",viewSource:"View source",viewSourceAria:"View and edit project source"},XUe={nav:"Search",selectAgent:"Select an Agent",checkingCapabilities:"Checking Agent capabilities",notMounted:"This Agent does not have {{label}} mounted",sources:{session:"Sessions",web:"Web",knowledge:"Knowledge base",memory:"Long-term memory"},webDescription:"Search with the web_search tool",backendLocal:"Local",failed:"Search failed: {{message}}",placeholder:{selectAgent:"Select an Agent first",web:"Search the web",knowledge:"Search {{name}}",knowledgeFallback:"this Agent's knowledge base",memory:"Search {{name}}",memoryFallback:"this user's long-term memory",session:"Search this Agent's sessions"},sourceTypeAria:"Search source: {{label}}",notSelected:"Not selected",sourceType:"Search source",selectSource:"Select a search source",noAgentHint:"Select an Agent to search its sessions, the web, and mounted data sources.",loadingCapabilities:"Loading this Agent's search capabilities…",sourceUnavailable:"This Agent does not have this data source mounted",instructions:{web:"Enter keywords and press Enter or select the button to search with web_search.",knowledge:"Enter a question to search this Agent's knowledge base.",memory:"Enter a clue to search long-term memories saved across this user's sessions.",session:"Enter keywords and press Enter or select the button to search this Agent's sessions."},noResults:"No results found for “{{query}}”.",knowledgeFragment:"Knowledge excerpt {{index}}",memoryFragment:"Memory excerpt {{index}}"},KUe={title:"Developer Resources",sections:{documentation:{title:"Related links",description:"Open development documentation and common AgentKit destinations"},bestPractices:{title:"Best practices",description:"Learn from practical development, debugging, and deployment guidance"},showcases:{title:"Showcases",description:"Explore applications built with AgentKit"}},links:{veadkDocs:"VeADK documentation",cliDocs:"AgentKit CLI documentation",platformDocs:"AgentKit platform documentation",console:"AgentKit console"},articles:{veadkDevelopment:{title:"Develop and deploy an Agent with VeADK",description:"Build an Agent with VeADK and deploy it to AgentKit Runtime."},cliDevelopment:{title:"Develop and deploy an Agent with AgentKit CLI",description:"Create a project, debug an Agent, and deploy it with AgentKit CLI."},coverAlt:"Cover image for {{title}}"},showcases:{researchAssistant:{title:"Multi-agent research assistant",description:"Specialized Agents work together to research, analyze, and summarize findings."},multimodalAnalysis:{title:"Multimodal content analysis",description:"Understand images, documents, and video in a single session."},customerService:{title:"Customer service workspace",description:"Combine knowledge retrieval and tool calls to handle complex support requests."},webSearch:{title:"Web search Agent",description:"Search current web content and organize it into traceable answers."},a2uiApp:{title:"A2UI interactive app",description:"Let an Agent generate interactive interfaces as it works through a task."},previewAlt:"Interface preview for {{title}}"}},ZUe={title:"Library",untitledSession:"Untitled session",categoryAria:"Library categories",regionAria:"Region",tabs:{skills:"Skills",knowledge:"Knowledge",artifacts:"Artifacts"}},JUe={title:"Manage Agents",subtitle:"Agents in AgentKit Runtime that you can manage",mainAgentOnly:"Only the main Agent is shown (control-plane information).",deleteConfirm:'Delete Agent "{{name}}"? Its Runtime will be permanently deleted.',regionFilterTitle:"Filter by region",regionFilterAria:"Region filter",regionAria:"Region",refresh:"Refresh",loading:"Loading…",empty:"You have not deployed any Agents.",connected:"Connected",connect:"Connect to this Agent",deleteRuntime:"Delete this Runtime",loadingDetail:"Loading details…",agentStructure:"Agent structure",secretHidden:"Sensitive value is never shown. Copy it with an authorized request.",revealSecret:"Sensitive value for {{key}}",copySecret:"Copy the value of {{key}}",copy:"Copy",copied:"Copied",copyFailed:"Copy failed",notConfigured:"Not configured",fields:{model:"Model",description:"Description",status:"Status details",project:"Project",version:"Version",resources:"Resources",memory:"Memory",tool:"Tool",knowledge:"Knowledge",mcpToolset:"MCP Toolset",updatedAt:"Updated"},resource:{memory:"Memory {{value}} MB",instances:"Instances {{min}}-{{max}}",concurrency:"Concurrency {{value}}"},environmentVariables:"Environment variables",unnamed:"(Unnamed)"},eVe={mainAgent:"Main Agent",subAgent:"Sub-agent {{index}}",itemCount_one:"{{count}} item",itemCount_other:"{{count}} items",info:"Agent information",infoAndTopology:"Agent information and settings",loadingInfo:"Loading Agent information…",unnamedAgent:"Unnamed Agent",agentsMd:"AGENTS.md",tools:"Tools",toolList:"Tool list",studioTool:"Studio Tool",removeTool:"Remove tool {{name}}",remove:"Remove",notConfigured:"Not configured",addStudioTool:"Add Studio tools",addStudioToolHere:"Add Studio tools to this chat",skills:"Skills",skillList:"Skill list",addSkill:"Add Skill Space skills",addSkillHere:"Add Skill Space skills to this Session",skillMountNextTurn:"Mounted versions are frozen when the next Turn starts.",previewUnsupported:"Preview is not supported",sessionEnvironment:"Session environment",environment:"Environment",agentCanvas:"Agent canvas",topology:"Structure",nodeKinds:{agent:"Agent",sandbox:"Sandbox","worker-session":"Worker Session","skill-space":"Skill Space",skill:"Skill","studio-tool":"Studio Tool",mcp:"MCP",environment:"Environment",knowledge:"Knowledge","sub-agent":"Sub-agent"},nodeStatuses:{configured:"Configured",mounted:"Mounted",running:"Running",paused:"Paused"},viewCanvasFullscreen:"View Agent canvas in full screen",viewFullscreen:"View full screen",executionCanvas:"Agent execution canvas",fullscreenExecutionCanvas:"Full-screen Agent execution canvas",closeFullscreenCanvas:"Close full-screen canvas",close:"Close",capabilitiesSubtitle:"Capabilities and collaboration topology",closeInfo:"Close Agent information",infoUnavailable:"Agent information is temporarily unavailable.",refresh:"Refresh information",loadingSkills:"Loading bound skills…",sessionSkills:"Temporary session skills",noBoundSpace:"This agent has no bound Skill Space.",noBoundSkills:"The bound Skill Space has no skills.",loadFailed:"Could not load this information. Refresh to retry.",accessDenied:"You do not have permission to read this information.",documentUnsupported:"Upgrade the Runtime image to enable Studio to read AGENTS.md.",skillsUnsupported:"This Runtime does not provide Skill Space bindings.",skillsDegraded:"Skill information is incomplete. Refresh to retry.",documentEditHint:"Edit the latest version. Saving publishes a new version to this Skill Space and can affect other agents using it. Running sessions may need a cache refresh or a new session. Keep the frontmatter name unchanged.",documentLoading:"Loading SKILL.md…",documentWritable:"Editable",documentReadOnly:"Read only — this space or your permissions do not allow editing",documentLoadFailed:"Could not load SKILL.md. Refresh to retry.",documentSaveFailed:"Save was not confirmed. Your edits are preserved. Reopen to check the current version before retrying.",documentConflict:"A newer version exists. Copy your edits, then reopen the editor to avoid overwriting it.",discardDocument:"Discard unsaved changes?",keepEditing:"Keep editing",discardChanges:"Discard changes",saveDocument:"Save new version"},tVe={mountFailed:"Could not mount the environment",closeDialog:"Close environment dialog",addTitle:"Add environments",description:"Choose the Sandbox environments this Agent can use in the current session",closeAdd:"Close Add environments",searchAria:"Search environments",searchPlaceholder:"Search environment names or capabilities",availableAria:"Available environments and workspaces",loading:"Loading available environments…",noMatch:"No matching environments or workspaces",workspaces:"Workspaces",reuseAll:"Use every available environment in this workspace",availableEnvironmentCount_one:"{{count}} available environment",availableEnvironmentCount_other:"{{count}} available environments",selectWorkspace:"Select workspace {{name}}",environments:"Environments",includedByWorkspaces:"Included by workspace {{names}}",nameSeparator:", ",selectEnvironment:"Select environment {{name}}",selectedWorkspaceCount_one:"{{count}} workspace selected",selectedWorkspaceCount_other:"{{count}} workspaces selected",coveredEnvironmentCount_one:"{{count}} environment covered",coveredEnvironmentCount_other:"{{count}} environments covered",selectionSummary:"{{workspaces}}, {{environments}}",cancel:"Cancel",mounting:"Mounting…",confirm:"Add selected",mountedAria:"Mounted environments",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",removeWorkspace:"Remove workspace {{name}}",remove:"Remove",removeEnvironment:"Remove environment {{name}}",add:"Add environments",addMore:"Add more environments",addForSession:"Add environments to this session",loadingAvailable:"Loading available environments…",empty:"No AIO Sandbox environments are available."},rVe={loading:{searching:"Looking for an existing environment",creating:"Initializing environment",connecting:"Connecting to the environment"},initializationFailed:"AgentKit CLI environment initialization failed. Current status: {{status}}.",sessionExpired:"The AgentKit CLI session does not exist or has expired. Try again.",initializationTimeout:"AgentKit CLI environment initialization timed out. Try again later.",nonPersistent:"Non-persistent environment",recyclingHoursMinutes:"Environment reclaimed in {{hours}} hr {{minutes}} min",recyclingMinutes:"Environment reclaimed in {{minutes}} min",connectionError:`Could not connect to the Studio service because the server did not respond. Original error: {{message}}`,unavailable:"Connection unavailable",requestFailed:"AgentKit CLI request failed",retry:"Retry",terminalTitle:"AgentKit CLI terminal"},nVe={labels:{coding:"Coding",get_city_weather:"City weather",get_location_weather:"Location weather",web_fetch:"Fetch web content",studio_write_artifact:"Save session artifact"},closeDialog:"Close dialog",title:"Add Studio tools",description:"Studio BFF runs these tools for {{agentName}} in the current session. No Runtime installation is required.",close:"Close Add Studio tools",searchAria:"Search Studio tools",searchPlaceholder:"Search by name or tool ID",availableAria:"Available Studio tools",loading:"Loading Studio tools…",noMatch:"No matching Studio tools",remove:"Remove",add:"Add"},iVe={artifactLibrary:WUe,resourceMetadata:YUe,artifactEdit:qUe,codeBrowser:jUe,search:XUe,developerResources:KUe,library:ZUe,manageAgents:JUe,agentTopology:eVe,sessionEnvironment:tVe,agentKitCli:rVe,studioTools:nVe},ydr=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:rVe,agentTopology:eVe,artifactEdit:qUe,artifactLibrary:WUe,codeBrowser:jUe,default:iVe,developerResources:KUe,library:ZUe,manageAgents:JUe,resourceMetadata:YUe,search:XUe,sessionEnvironment:tVe,studioTools:nVe},Symbol.toStringTag,{value:"Module"})),aVe={requestFailed:"请求失败 ({{status}})",unknownError:"未知错误",contentTypeMissing:"Content-Type 缺失",response:"响应:{{response}}",fallbackWithDetail:"{{fallback}}:{{detail}}",fallbackWithHttpStatus:"{{fallback}}(HTTP {{status}})",nonJsonResponse:"{{fallback}}:服务端返回非 JSON 响应({{contentType}})"},oVe={unconfigured:"管理员未配置 AgentKit Dev Sandbox,请配置后再使用",invalidSession:"AgentKit CLI 返回了无效的 Session。",loadCapabilitiesFailed:"无法读取 AgentKit CLI 配置。",invalidCapabilities:"AgentKit CLI 返回了无效的配置状态。",listSessionsFailed:"无法读取 AgentKit CLI Session。",invalidSessionList:"AgentKit CLI 返回了无效的 Session 列表。",createSessionFailed:"无法创建 AgentKit CLI Session。",openSessionFailed:"无法打开 AgentKit CLI Session。",openTerminalFailed:"无法打开 AgentKit CLI 终端。",invalidTerminalUrl:"AgentKit CLI 返回了无效的终端地址。"},sVe={cnBeijing:"华北 2(北京)",cnShanghai:"华东 2(上海)"},lVe={runtimeUnsupported:"该 Runtime 暂不支持连接,请确认服务已正常运行。"},cVe={autoConfigureFailed:"飞书机器人自动配置失败"},uVe={actionFailed:"{{action}}失败",detail:"详细信息:{{detail}}",request:"请求:{{request}}"},dVe={persistentMemoryHint:"提示:会话已不存在。使用 in-memory 或 SQLite 短期记忆时,多实例、进程重启或滚动发布都可能导致会话丢失;建议改用基于数据库的持久化短期记忆存储。",unsupportedRouteHint:"提示:该 Runtime 未提供会话能力运行接口,可能是 Runtime 版本与当前 Studio 不兼容。",toolArgumentHint:"提示:模型生成的工具参数格式不完整,请重新发送一次。",resourceCollectionExpiredHint:"提示:本次资源清单已失效,请重新发送任务;系统会重新收集资源后再创建 Agent。",networkConfigurationHint:"提示:请稍后重试,查看 Runtime、模型或网关日志。",modelQuotaHint:"提示:模型当前触发了 TPM/RPM 配额限制,请稍后重试或提高模型配额。",rawResponseLabel:"原始响应:",copySecretFailed:"复制敏感值失败"},hVe={httpStatus:"HTTP 状态码:{{status}}",errorCode:"错误码:{{code}}",cloudResponseBody:`云端响应正文: {{body}}`,loadFailedWithDetail:"读取实例日志失败:{{detail}}",invalidFormat:"读取实例日志失败:服务返回格式无效"},fVe={untitledSession:"未命名会话",webUnavailable:"网络搜索接口未就绪(后端未启用 /web/search)。",webFailed:"网络搜索失败:{{message}}",webNotMounted:"当前 Agent 未挂载 web_search 工具。",knowledgeNotMounted:"该 Agent 未挂载知识库。",memoryNotMounted:"该 Agent 未挂载长期记忆。",knowledge:"知识库",longTermMemory:"长期记忆"},pVe={listSpacesFailed:"读取 Skill 空间失败",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",deleteSpaceFailed:"删除 Skill 空间失败",uploadFailed:"上传 Skill 失败",validateFailed:"校验 Skill 失败",deleteFailed:"删除 Skill 失败",listFilesFailed:"读取 Skill 文件失败",downloadFailed:"下载 Skill 失败",sharedSpaceFailed:"共享空间加载失败",reservedSpaceName:"此名称由系统空间保留,请使用其他名称",reviewSpaceFailed:"待审核空间暂不可用",submitReviewFailed:"申请公开失败",listReviewsFailed:"加载审核申请失败",reviewFilesFailed:"加载提交文件失败",decideReviewFailed:"审批失败,请重试",listVersionsFailed:"无法加载技能版本",uploadVersionFailed:"上传技能新版本失败"},gVe={truncatedData:"{{data}}…(已截断,共 {{count}} 个字符)",incompleteEvent:"SSE 流在事件完整返回前已结束。原始数据:{{data}}",invalidEventJson:"无法解析 SSE 事件中的 JSON。原始数据:{{data}}"},mVe={loadConfigNetworkFailed:"无法加载登录配置,请检查网络后重试。",configServiceFailed:"登录配置服务异常(HTTP {{status}}),请稍后重试。",invalidConfigResponse:"登录配置服务返回了无法解析的响应,请稍后重试。",serviceNetworkFailed:"无法连接身份服务,请检查网络后重试。",invalidServiceResponse:"身份服务返回了无法解析的响应,请稍后重试。",serviceFailed:"身份服务异常(HTTP {{status}}),请稍后重试。"},vVe={invalidToken:"GitHub Token 无效或没有仓库写入权限",notFound:"仓库、分支或文件不存在,或 Token 无权访问",rejectedCommit:"GitHub 拒绝了提交,请检查分支和文件状态",requestFailed:"GitHub 请求失败(HTTP {{status}})",networkFailed:"连接 GitHub 失败,请检查网络后重试",invalidRepositoryFormat:"GitHub Repo 格式应为 owner/repository",insecureRepositoryUrl:"仅支持安全的 github.com 仓库地址",unsafeProjectPath:"Agent 项目目录必须是仓库内的安全相对路径",tokenRequired:"GitHub Token 不能为空",invalidBaseBranch:"目标分支格式不正确",invalidPublishBranch:"发布分支格式不正确",noFiles:"没有需要提交的文件",missingBaseSha:"目标分支缺少有效 Git SHA",fileAlreadyExists:"目标仓库中已存在 {{path}},未覆盖现有文件",pathNotUpdatable:"目标路径 {{path}} 不是可更新的文件",invalidPullRequest:"GitHub 未返回有效的 Pull Request"},yVe={loadCapabilitiesFailed:"加载视频模型能力失败",uploadAssetFailed:"上传{{fileName}}失败",enhancePromptFailed:"提示词优化失败",createTaskFailed:"创建视频生成任务失败",getTaskFailed:"查询视频生成任务失败",downloadFailed:"下载生成视频失败"},bVe={listFailed:"加载网站集成失败",createFailed:"创建网站集成失败",deleteFailed:"删除网站集成失败"},xVe={loadFailed:"读取知识库失败",htmlHidden:"[HTML 内容已隐藏]",redacted:"[已脱敏]",depthTruncated:"[内容过深,已截断]",circularReference:"[循环引用]",diagnosticsUnavailable:"[诊断信息无法显示]",statusCode:"状态码:{{status}}",errorCode:"错误码:{{code}}",requestId:"请求 ID:{{requestId}}",diagnostics:"诊断:{{diagnostics}}",detail:"详情:{{detail}}",signInRequired:"请先登录后再访问知识库",forbidden:"你没有权限操作这个知识库",notFound:"知识库或知识内容不存在",conflict:"知识库当前状态不允许执行此操作",requestFailed:"知识库请求失败 ({{status}})"},wVe={invalidName:"名称须为 1~128 个字符,不能包含控制字符、不可见格式字符或 < >。",renameProjectFailed:"修改项目名称失败",renameVersionFailed:"修改版本名称失败",invalidNameUpdateResponse:"名称更新响应与请求不一致,请刷新后重试。",invalidSourceSnapshot:"源码快照的响应格式无效。",invalidProjectList:"项目列表的响应格式无效。",invalidProjectVersion:"项目版本的响应格式无效。",loadProjectsFailed:"无法读取已保存项目",loadVersionsFailed:"无法读取项目版本",deleteVersionFailed:"删除项目版本失败",invalidDeleteVersionResponse:"删除项目版本的响应格式无效。",loadProjectSourceFailed:"无法读取项目源码",loadSnapshotFailed:"无法读取源码快照",restoreSnapshotFailed:"无法恢复当前源码快照",downloadSourceFailed:"下载源码失败",downloadNotZip:"源码下载响应不是 ZIP 文件。",downloadSizeMismatch:"源码压缩包大小与发布记录不一致,请重试。"},AVe={invalidFormat:"{{label}}格式错误。",validationSeparator:";",invalidAnalysisResult:"迁移分析结果格式错误。",invalidFrameworkCandidate:"框架候选格式错误。",invalidAnalysisEvidence:"分析证据格式错误。",invalidEntryCandidate:"入口候选格式错误。",invalidQuestion:"待确认问题格式错误。",invalidPendingInput:"分析问题无法读取",invalidTask:"迁移会话格式错误。",invalidAnalysisReference:"分析结果引用格式错误。",invalidSourcePersistence:"迁移源码保存状态格式错误。",invalidActivity:"迁移执行动态格式错误。",invalidActivityItem:"迁移执行动态项格式错误。",invalidActivityTool:"迁移执行工具项格式错误。",invalidActivityPlan:"迁移执行计划格式错误。",invalidActivityPlanItem:"迁移执行计划项格式错误。",invalidArtifact:"迁移产物格式错误。",invalidEnvironmentDefaults:"环境变量默认值格式错误。",invalidArtifactFile:"迁移产物文件格式错误。",invalidVerificationCheck:"迁移校验项格式错误。",requestValidationFailed:"请求参数校验失败:{{detail}}",gatewayError:"{{fallback}}(HTTP {{status}},Content-Type: {{contentType}})。请检查代理或网关配置。",nonJsonResponse:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}})。请检查代理或网关配置。",loadCapabilitiesFailed:"读取迁移能力失败",invalidCapabilities:"迁移能力格式错误。",invalidModelCapabilities:"迁移模型能力格式错误。",loadTasksFailed:"读取迁移会话失败",invalidTaskList:"迁移会话列表格式错误。",createTaskFailed:"创建迁移会话失败",uploadProjectFailed:"上传迁移项目失败",loadActivityFailed:"读取迁移执行动态失败",loadEventsFailed:"订阅迁移进度流失败",invalidEventsResponse:"迁移进度流返回了非法数据帧。",reconnecting:"连接已断开,正在重新连接迁移进度流…",startFailed:"启动迁移失败",submitAnswersFailed:"提交分析补充信息失败",submitInputFailed:"提交分析回答失败",stopFailed:"终止迁移失败",deleteTaskFailed:"删除迁移会话失败",loadArtifactFailed:"读取迁移产物失败",loadArtifactFileFailed:"读取迁移产物文件失败",downloadArtifactFailed:"下载迁移产物失败",evaluation:{datasetSaveFailed:"保存评测用例失败",datasetLoadFailed:"读取评测用例失败",statusLoadFailed:"读取评测状态失败",resumeFailed:"继续评测失败",retryFailed:"重新评测失败",reportLoadFailed:"读取评测报告失败",reportDownloadFailed:"下载评测报告失败"},labels:{analysisResult:"迁移分析结果",recommendation:"迁移建议",boundary:"迁移边界",frameworkCandidate:"框架候选",analysisEvidence:"分析证据",recommendedFramework:"推荐框架",entryCandidate:"入口候选",entryFramework:"入口框架",includeScope:"迁移包含范围",excludeScope:"迁移排除范围",assumptions:"分析假设",question:"待确认问题",analysisWarnings:"迁移警告",task:"迁移会话",artifactStatus:"迁移产物状态",analysisReference:"分析结果引用",confirmation:"迁移确认",confirmedFramework:"确认框架",error:"迁移错误",sourcePersistence:"迁移源码保存状态",activity:"迁移执行动态",activityItem:"迁移执行动态项",activityTool:"迁移执行工具项",activityPlanItem:"迁移执行计划项",artifact:"迁移产物",cli:"CLI 信息",migration:"迁移信息",startup:"启动信息",environment:"环境变量信息",verification:"校验信息",report:"迁移报告",archive:"产物归档",environmentDefaults:"环境变量默认值",requiredEnvironment:"必需环境变量",optionalEnvironment:"可选环境变量",artifactFile:"迁移产物文件",verificationCheck:"迁移校验项",artifactWarnings:"迁移产物警告",errorResponse:"错误响应",errorDetail:"错误详情",capabilities:"迁移能力",framework:"迁移框架",modelCapabilities:"迁移模型能力",taskList:"迁移会话列表",evaluationAsset:"评测资产",evaluation:"评测状态",evaluationCapabilities:"评测能力",evaluationDimension:"评测维度",evaluationCase:"评测用例",evaluationCriteria:"评测标准",evaluationMessage:"评测对话",evaluationDataset:"评测数据集",evaluationDimensionResult:"评测维度结果",evaluationEvidence:"评测证据",evaluationReport:"评测报告",evaluationSummary:"评测汇总",evaluationCaseResult:"评测用例结果",evaluationOutput:"评测输出",evaluationLimitations:"评测限制",pendingInput:"分析提问",pendingQuestion:"分析问题项",pendingOption:"分析问题选项"}},SVe={status:{ready:"就绪",wakeable:"已休眠",creating:"创建中",starting:"启动中",pending:"等待中",running:"运行中",failed:"异常",stopped:"已停止",expired:"已过期",deleting:"删除中",deleted:"已删除",unknown:"未知状态"},developmentTimeout:"等待开发环境响应超时。任务可能仍在运行,请稍后重新进入当前会话查看状态。",developmentDisconnected:"与开发环境的连接已中断。任务可能仍在运行,请稍后重新进入当前会话查看状态。",developmentFailed:"开发任务未能继续,开发环境已保留。请在当前会话重试。",invalidStudioResponse:"{{fallback}} Studio 服务响应异常,请刷新后重试。",invalidSession:"AgentKit 沙箱返回了无效的 Session 信息。",invalidSnapshot:"AgentKit 沙箱返回了无效的 Snapshot 信息。",invalidSettings:"Sandbox 返回了无效设置。",invalidThreadSnapshot:"Sandbox 返回了无效 Thread 快照。",emptyConversationResponse:"沙箱对话服务未返回内容。",invalidConversationResponse:"沙箱对话服务返回了无法解析的响应。",conversationFailed:"沙箱对话失败,请稍后重试。",emptyReply:"沙箱未返回有效回复,请重试。",missingSession:"缺少要操作的 AgentKit Session。",listCodexFailed:"无法读取 Codex 智能体,请稍后重试。",invalidSessionList:"AgentKit 沙箱返回了无效的 Session 列表。",invalidSnapshotList:"AgentKit 沙箱返回了无效的 Snapshot 列表。",startFailed:"无法启动 AgentKit 沙箱,请稍后重试。",listAgentFailed:"无法读取 {{kind}} 智能体,请稍后重试。",invalidKindSessionList:"AgentKit 返回了无效的 {{kind}} Session 列表。",invalidKindSnapshotList:"AgentKit 返回了无效的 {{kind}} Snapshot 列表。",createAgentFailed:"无法创建 {{kind}} 智能体,请稍后重试。",missingSessionToOpen:"缺少要打开的 AgentKit Session。",openAgentFailed:"无法打开 {{kind}} 智能体。",invalidAgentHomeUrl:"{{kind}} 智能体返回了无效的主页面地址。",missingSessionForTerminal:"缺少要打开 Terminal 的 AgentKit Session。",openTerminalFailed:"无法打开 {{kind}} Terminal。",deleteAgentFailed:"无法删除 {{kind}} 智能体。",missingSnapshot:"未找到要唤醒的智能体。",resumeSnapshotFailed:"无法唤醒智能体,请稍后重试。",deleteSnapshotFailed:"无法删除智能体,请稍后重试。",missingSessionToConnect:"缺少要连接的 AgentKit Session。",connectCodexFailed:"无法连接 Codex 智能体,请稍后重试。",sessionNotReady:"AgentKit Session 尚未就绪,当前状态:{{status}}。",invalidMessage:"内置智能体会话缺少有效的消息内容。",interruptFailed:"无法停止当前任务。",getStatusFailed:"无法读取 Codex 状态。",getEndpointFailed:"无法读取 Sandbox Endpoint。",invalidEndpoint:"Sandbox 返回了无效 Endpoint。",createHandoffPairingFailed:"无法生成 Codex 云端接力配对码。",invalidHandoffPairing:"Studio 返回了无效的 Codex 云端接力配对码。",getHandoffStatusFailed:"无法读取端云接力状态。",invalidHandoffStatus:"Studio 返回了无效的端云接力状态。",listModelsFailed:"无法读取 Codex 模型列表。",invalidModelList:"Sandbox 返回了无效模型列表。",setModelFailed:"无法切换 Codex 模型。",invalidModel:"Sandbox 返回了无效模型。",listSkillsFailed:"无法读取 Codex Skills。",invalidSkillList:"Sandbox 返回了无效 Skill 列表。",listThreadsFailed:"无法读取 Codex Thread 列表。",invalidThreadList:"Sandbox 返回了无效 Thread 列表。",createThreadFailed:"无法创建新的 Codex Thread。",missingThread:"缺少要读取的 Codex Thread。",readThreadFailed:"无法读取 Codex 历史消息。",resumeThreadFailed:"无法恢复 Codex Thread。",forkThreadFailed:"无法分叉 Codex Thread。",archiveThreadFailed:"无法归档 Codex Thread。",invalidArchiveResult:"Sandbox 返回了无效归档结果。",deleteThreadFailed:"无法删除 Codex Thread。",invalidDeleteResult:"Sandbox 返回了无效删除结果。",compactThreadFailed:"无法压缩 Codex Thread。",getSettingsFailed:"无法读取 Codex 权限与工作空间。",updatePermissionsFailed:"无法更新 Codex 权限。",updateWorkspaceFailed:"无法更新 Codex 工作空间。",invalidWorkingDirectory:"Sandbox 返回了无效工作目录。",listDirectoriesFailed:"无法读取 Sandbox 目录。",invalidDirectoryList:"Sandbox 返回了无效目录列表。",resolveApprovalFailed:"无法提交 Codex 审批决定。",uploadFileFailed:"无法上传文件到 Sandbox。",invalidUploadResult:"Sandbox 返回了无效上传结果。",disconnectCodexFailed:"无法断开 Codex 智能体连接。",deleteCodexFailed:"无法删除 Codex 智能体。",openSandboxTerminalFailed:"无法打开 Sandbox Terminal。",openSandboxBrowserFailed:"无法打开 Sandbox Browser。",toolLabel:"Sandbox 工具",invalidToolUrl:"{{label}} 返回了无效地址。",unsafeToolUrl:"{{label}} 返回了不安全的地址。"},TVe={invalidSandboxVersion:"沙箱版本响应格式无效",loadSandboxVersionsFailed:"查询沙箱版本失败",updateSandboxFailed:"更新 Sandbox 失败",invalidSandboxUpdate:"沙箱更新响应格式无效",errorWithDetailAndRawResponse:`{{context}} {{detail}} @@ -91,7 +91,7 @@ Original error: {{message}}`,unavailable:"Connection unavailable",requestFailed: Studio:{{studioUrl}} 配对码:{{pairingCode}}`,installPrompt:`请安装 AgentKit Studio Plugin。请直接执行以下安装命令,不要让我手动打开终端。 安装命令:{{command}}`,title:"接力到云端继续执行",description:"按顺序复制两段提示词,Codex 会通过插件将您的本地任务接力到云端",closeAria:"关闭本地迁移引导",installTitle:"安装插件",installDescription:"首次使用时,请选择一种安装方式。",copied:"已复制",copyInstallPrompt:"复制安装提示词",copyInstallCommand:"复制安装命令",installMethodAria:"插件安装方式",conversationInstall:"与 Codex 对话安装",terminalInstall:"从终端安装",taskTitle:"任务接力",taskDescription:"插件安装完成后复制,Codex 会迁移当前项目并继续执行任务。",copyHandoffPrompt:"复制接力提示词",generatingPairing:"正在生成新的配对码",pairingExpired:"配对码已过期",pairingRemaining:"配对码有效期剩余 {{countdown}}",refreshing:"刷新中",refreshPairing:"刷新配对码",pairingLoading:"正在生成配对码",pairingUnavailable:"配对码尚未生成。",statusAria:"端云接力状态",statusTitle:"接力状态",requestReceivedNamed:"已收到“{{name}}”的端云接力请求",requestReceivedCurrent:"已收到当前项目的端云接力请求",requestHelp:"复制接力提示词后,Codex 的请求会显示在这里。",entering:"正在进入",enterCodex:"进入 Codex",clipboardUnsupported:"当前浏览器不支持写入剪贴板。",steps:{request:"等待端侧请求",session:"创建云端 Session",restore:"恢复项目",continue:"发送续跑任务"},status:{issued:"等待请求",creating:"正在创建 Session",sessionCreated:"正在迁移项目",continuing:"正在启动云端任务",running:"云端执行中",completed:"接力完成",failed:"接力失败"}},ZWe={model:{description:"显示或切换当前对话模型",keywords:"模型 switch"},models:{description:"列出 app-server 可用模型",keywords:"模型列表 list"},skill:{description:"浏览并调用当前工作区可用的 Skill",keywords:"技能 workflow"},skills:{description:"浏览并调用当前工作区可用的 Skills",keywords:"技能列表 workflow list"},new:{description:"开始一个新对话",keywords:"新建 对话"},resume:{description:"打开历史会话或恢复指定 Thread",keywords:"历史 恢复 session"},fork:{description:"从当前上下文分叉一个新对话",keywords:"分叉 branch"},compact:{description:"压缩当前对话上下文",keywords:"压缩 上下文"},archive:{description:"归档当前对话并新建对话",keywords:"归档 关闭"},status:{description:"显示当前连接、Thread、模型与 Token 状态",keywords:"状态 连接 token"},clear:{description:"清空当前视图并开始新对话",keywords:"清空 重置"},help:{description:"显示 Sandbox 支持的快捷命令",keywords:"帮助 命令"},currentModel:"当前模型",availableModel:"可用模型",workspace:"工作空间",notSet:"未设置",modelLabel:"模型",statusLabel:"状态",running:"运行中",idle:"空闲",totalTokens:"累计 Token",contextWindow:"上下文窗口",imageFallback:"图片",unknown:"未知快捷命令:{{command}}。输入 /help 查看可用命令。",automaticSkills:"智能开发模式会自动使用开发能力,无需手动选择 Skill。",activity:{new:"已新建 Codex 对话",resumed:"已恢复 Codex 对话",deleted:"已删除 Codex 历史会话",modelChanged:"已切换 Codex 模型",availableModels:"Codex 可用模型",noModels:"当前没有可用模型",forked:"已分叉 Codex 对话",compacting:"已开始压缩当前 Codex 对话",archived:"已归档 Codex 对话",status:"Codex 当前状态",help:"Sandbox 支持的 Codex 快捷命令"}},JWe={label:"智能构建任务",queued:"构建任务已排队",running:"构建任务正在后台运行",recovering:"正在恢复构建任务",waiting_user:"构建任务需要继续处理",stopping:"正在停止构建任务",succeeded:"构建任务已完成",cancelled:"构建任务已停止",failed:"构建任务未完成",open:"返回任务",hide:"隐藏任务通知",reconnecting:"正在重新连接任务服务,已有任务继续保留。"},Ldr=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:jWe,agentWorkspace:XWe,approval:HWe,commands:ZWe,common:zWe,composer:WWe,default:{common:zWe,tool:UWe,threads:VWe,permissions:GWe,workspace:QWe,approval:HWe,composer:WWe,launch:YWe,session:qWe,agentDetails:jWe,agentWorkspace:XWe,handoff:KWe,commands:ZWe,taskNotice:JWe},handoff:KWe,launch:YWe,permissions:GWe,session:qWe,taskNotice:JWe,threads:VWe,tool:UWe,workspace:QWe},Symbol.toStringTag,{value:"Module"})),eYe={retry:"重试",signInToContinue:"登录以继续使用",signInWith:"使用 {{provider}} 登录",enterUsername:"输入一个用户名即可开始",usernamePlaceholder:"用户名(字母 + 数字,最多 16 位)",enter:"进入",usernameInvalid:"只能包含大小写字母和数字,最多 16 位。",identityProvider:{volcengine:"火山引擎 Identity",byteplus:"BytePlus Identity"},powered:{volcengine:"火山引擎 AgentKit 提供企业级 Agent 解决方案",byteplus:"BytePlus AgentKit 提供企业级 Agent 解决方案"},legalPrefix:"继续即表示你已阅读并同意 AgentKit",terms:"产品和服务条款",copyright:"© {{year}} VeADK。保留所有权利。"},tYe={title:"登录状态已过期",description:"当前编辑内容会保留。重新登录后,刚才的操作将自动继续。",waiting:"等待登录完成…",signInAgain:"重新登录"},rYe={breadcrumbs:"面包屑",selectAgent:"选择 Agent",switchAgent:"切换智能体"},nYe={cancel:"取消",close:"关闭确认框"},Mdr=Object.freeze(Object.defineProperty({__proto__:null,authExpired:tYe,confirm:nYe,default:{login:eYe,authExpired:tYe,navbar:rYe,confirm:nYe},login:eYe,navbar:rYe},Symbol.toStringTag,{value:"Module"})),iYe={defaultUser:"用户",shortcuts:"快捷入口",tryCli:"体验 AgentKit CLI",developerResources:"开发者资源",systemInfo:"系统信息",language:"语言",issueFeedback:"问题反馈",logout:"退出登录",roles:{admin:"管理员",developer:"开发者",user:"普通用户",super_admin:"超级管理员"}},aYe={home:"返回首页",expand:"展开侧边栏",collapse:"收起侧边栏",label:"主导航",newChat:"新会话",agents:"智能体",workspaces:"工作区",library:"资源库",cronjobs:"定时任务",automations:"自动化",users:"用户管理",administration:"管控",reviewCenter:"审核中心"},oYe={title:"历史会话",newConversation:"新会话",create:"新建会话",loading:"正在加载历史会话…",empty:"暂无会话",current:"当前",manage:"管理历史会话:{{title}}",more:"更多",delete:"删除",loadingMore:"加载中…",loadMore:"加载更多",evaluatingTitle:"正在自动评测",evaluating:"评测中",generating:"正在生成"},Idr=Object.freeze(Object.defineProperty({__proto__:null,account:iYe,default:{account:iYe,navigation:aYe,history:oYe},history:oYe,navigation:aYe},Symbol.toStringTag,{value:"Module"})),sYe={placeholder:"请选择",collapseOptions:"收起模型选项",expandOptions:"展开模型选项",noOptions:"暂无可用选项",noMatches:"没有匹配项,可直接使用当前模型 ID"},lYe={unsupportedActivity:"不支持的 Skill 对话活动",ariaLabel:"Skill 生成对话"},cYe={code:"错误码:{{code}}",type:"错误类型:{{type}}",representation:"异常表示:{{value}}",rawResponse:`服务端原始响应: -{{value}}`,original:"原始错误:{{message}}",details:"详细信息"},uYe={ariaLabel:"Skill 文件树",viewSource:"查看源码",viewPreview:"查看预览",download:"下载",binaryFile:"二进制文件",bytes:"{{value}} 字节",binaryDescription:"当前接口仅返回文件元数据,可单独下载原文件。",metadata:"Skill 元数据",noFiles:"暂无文件"},dYe={close:"关闭",name:"名称",region:"地域",optionalDescription:"描述(可选)",cancel:"取消",create:"创建",creating:"创建中…",save:"保存",saving:"保存中…",upload:"上传",uploading:"上传中…",createSpaceTitle:"新建 Skill 空间",editSpaceTitle:"编辑 Skill 空间",uploadTitle:"上传到 {{name}}",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",archiveValidationFailed:"Skill ZIP 格式校验失败",uploadFailed:"上传 Skill 失败",dropzone:"拖拽 Skill ZIP 到这里",chooseLocalFile:"或点击选择本地文件",archiveHelp:"ZIP 根目录需要包含 SKILL.md,也可以只包含一层包装目录。选择后仅检查格式,不会自动上传。",validating:"正在检查文件格式…",validationPassed:"格式检查通过:{{name}},共 {{count}} 个文件"},hYe={styles:{concise:"简洁实用",strict:"严谨稳健",tutorial:"教程友好",automation:"自动化优先",custom:"自定义",customFallback:"自定义风格"},stages:{preparing:"正在准备 Dev Sandbox",ready:"Skill 已生成并通过格式校验",failed:"生成失败",cancelled:"已停止",validating:"正在校验 Skill 格式",packaging:"正在整理文件",generating:"正在生成 Skill",repairingAgain:"正在再次修复",autoRepairing:"正在自动修复({{attempt}}/{{max}})"},validation:{fallback:"Skill 格式校验未通过",repairInstruction:"只修复下面列出的 Skill 格式错误,不要改变原有用途和内容范围。",recheckInstruction:"修复后重新检查目录结构、SKILL.md frontmatter 和所有文本文件。",nameTooLong:"Skill 名称不能超过 64 个字符",invalidName:"Skill 名称只能包含小写字母、数字和连字符",modelTooLong:"模型 ID 不能超过 128 个字符",invalidModel:"模型 ID 只能包含字母、数字、点、下划线、连字符、斜杠和冒号"},errors:{loadCapability:"读取 Dev Sandbox 配置失败",autoRepair:"自动修复格式错误失败",pollCandidate:"读取候选方案状态失败,正在重试",createCandidate:"创建候选方案失败",refine:"继续调整失败",repairAgain:"再次修复格式错误失败",selectSpace:"请选择上传的 Skill Space",unsupportedRegion:"当前 Skill 地域不受支持",upload:"上传 Skill 失败",download:"下载失败"},sessionMax:"Session 最长保留 1 小时",remaining:"剩余 {{minutes}}:{{seconds}}",unnamedSpace:"未命名 Skill Space",leaveConfirmation:"离开后将停止并释放正在运行的 Dev Sandbox,确定离开吗?",createTitle:"创建技能",optimizeTitle:"优化 {{name}}",skillFallback:"技能",back:"返回技能空间",home:"主页技能生成",basicInfo:"基本信息",goal:"目标",createIntentPlaceholder:"描述希望这个 Skill 完成什么任务",optimizeIntentPlaceholder:"描述希望如何优化当前 Skill",skillName:"Skill 名称",autoNamePlaceholder:"留空时自动生成",nameHelp:"仅支持小写字母、数字和连字符;留空时自动生成。",createPlans:"生成方案",optimizePlans:"优化方案",createPlansDescription:"按不同方案并行生成多个技能,您可以选择最佳结果",optimizePlansDescription:"按不同方案并行优化当前技能,您可以选择最佳结果",plan:"方案 {{count}}",remove:"移除",model:"模型",modelPlaceholder:"选择或输入模型 ID",style:"风格",customStyle:"自定义风格",customStylePlaceholder:"描述表达方式、严谨程度或输出偏好",addConfiguration:"添加配置",notConfigured:"管理员未配置",generate:"生成",candidates:"候选方案",progress:"进度",retryCandidate:"重试此方案",formatValidationFailed:"格式校验未通过",repairAgain:"再次修复",files:"文件",downloadZip:"下载 ZIP",loadingFiles:"正在读取文件…",filesPending:"生成过程中会在这里显示完整文件树",uploadToSpace:"上传到 Skill Space",loadingSpaces:"正在加载 Skill Space",selectSpace:"选择 Skill Space",continuePlaceholder:"继续调整这个候选方案",continue:"继续调整",uploading:"上传中…",overwrite:"覆盖原 Skill",uploadToSelectedSpace:"上传到 Skill Space",uploadToCurrentSpace:"上传到当前空间",allCandidatesFailed:"所有方案均创建失败,可分别重试。"},fYe={invalidFormat:"{{label}}格式错误。",recoveryStatus:"Skill 恢复点状态",errorResponse:"错误响应",errorDetails:"错误详情",missingContentType:"Content-Type 缺失",gatewayError:"{{fallback}}(HTTP {{status}},Content-Type: {{contentType}})。请检查代理或网关配置。",nonJson:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}},Content-Type: {{contentType}}),请检查代理或网关配置。",activity:"Skill 会话活动",invalidActivity:"Skill 会话活动格式错误。",invalidToolActivity:"Skill 工具活动格式错误。",invalidTextActivity:"Skill 文本活动格式错误。",publication:"Skill 发布结果",task:"Skill 会话",file:"Skill 文件",unknownTaskState:"Skill 会话状态无法识别。",capability:"Skill 工作台能力",loadCapability:"读取 Skill 工作台能力失败",prepareTask:"准备 Skill 会话失败",taskReference:"Skill 会话引用",startOptimization:"开始优化 Skill 失败",startTask:"开始 Skill 会话失败",taskSummary:"Skill 会话摘要",taskList:"Skill 会话列表",loadTaskList:"读取 Skill 会话列表失败",invalidTaskList:"Skill 会话列表格式错误。",loadTask:"读取 Skill 会话失败",artifact:"Skill 产物",artifactFile:"Skill 产物文件",loadArtifact:"读取 Skill 产物失败",refine:"继续调整 Skill 失败",stop:"停止当前 Skill 任务失败",publish:"发布 Skill 失败",nonNdjson:"发布 Skill 失败:服务端返回了非 NDJSON 响应。",missingStream:"发布 Skill 失败:服务端没有返回进度流。",publishProgress:"发布进度",invalidPublishProgress:"发布进度格式错误。",publishError:"发布错误",unknownPublishEvent:"未知的发布进度事件。",publishResult:"发布结果",streamEnded:"发布进度流提前结束,无法确认发布结果。请刷新技能中心确认状态。",deleteTask:"删除 Skill 会话失败",download:"下载 Skill 失败"},Pdr=Object.freeze(Object.defineProperty({__proto__:null,api:fYe,configSelect:sYe,conversation:lYe,default:{configSelect:sYe,conversation:lYe,errorDetails:cYe,fileTree:uYe,management:dYe,generation:hYe,api:fYe},errorDetails:cYe,fileTree:uYe,generation:hYe,management:dYe},Symbol.toStringTag,{value:"Module"})),pYe={back:"返回上一页",reload:"重新加载",notConfigured:"未配置",name:"名称",description:"描述",delete:"删除",save:"保存",saving:"保存中",add:"添加",manage:"管理",environment:"环境",noDescription:"暂无描述",refresh:"刷新",close:"关闭",retry:"重试",loading:"加载中…",previousPage:"上一页",nextPage:"下一页",edit:"编辑",all:"全部",search:"搜索",cancel:"取消",view:"查看",viewDetails:"查看详情",deleting:"删除中…",create:"创建",creating:"创建中",adding:"添加中",generating:"生成中",uploading:"上传中",preview:"预览",loadFailed:"加载失败",select:"选择",collapse:"收起",expand:"展开",none:"无"},gYe={ariaLabel:"AgentKit 快速入口",closeAriaLabel:"关闭 AgentKit 欢迎卡片",title:"欢迎使用 AgentKit",description:"通过 AgentKit 平台快速构建与托管您的企业级智能体",docsAriaLabel:"打开 AgentKit 文档,在新窗口打开",docs:"文档",consoleAriaLabel:"打开 AgentKit 控制台,在新窗口打开",console:"控制台"},mYe={checkUpdates:"检查更新",checkingVersions:"正在检查版本…",versionCheckError:"查询沙箱版本失败,请检查凭据、区域及接口权限后重试",sandboxUpdateError:"Sandbox 更新失败,请刷新检查实际状态后重试",modelEnvRepairUnavailable:"无法补齐模型环境变量,请检查 CODEX_API_KEY 和 CODEX_BASE_URL",updateSandbox:"更新{{variant}}{{name}}",updatingSandbox:"更新中",title:"系统信息",description:"查看当前 Studio 版本及关联的基础资源",general:"通用",currentVersion:"当前版本",storage:"存储",loadingStorage:"正在加载存储信息",tosAddress:"TOS 地址",openTosConsole:"在云控制台中打开 TOS 存储桶",environmentBuild:"环境构建",loadingEnvironmentResources:"正在加载环境构建资源",environmentResourcesError:"环境构建资源加载失败,请检查云凭据后重试。",codePipelineWorkspace:"CodePipeline 工作空间",codePipelinePipeline:"CodePipeline 流水线",openCodePipelineWorkspace:"在云控制台中打开 CodePipeline Workspace",createdOnFirstBuild:"首次构建时自动创建",containerRegistryRepository:"Container Registry 仓库",openContainerRegistryRepository:"在云控制台中打开 Container Registry 仓库",sandboxInfo:"沙箱信息",loadingSandboxInfo:"正在加载沙箱信息",sandboxInfoError:"沙箱信息加载失败,请重试。",snapshot:"快照版",snapshotWithSpace:"快照版 ",openToolConsole:"在云控制台中打开{{name}}",updateModelEnv:"更新{{variant}}{{name}}模型环境变量",modelEnvUpdated:"已更新",modelEnvAlreadyCurrent:"无需更新",userPool:"用户池",loadingUserPool:"正在加载用户池",userPoolError:"用户池加载失败,请重试。",modelEnvUpdateError:"模型环境变量更新失败,请重试。",openUserPoolConsole:"在云控制台中打开用户池{{name}}",unnamedUserPool:"未命名用户池",id:"ID",domain:"域名",region:"区域",noLocalUserPool:"本地模式未配置用户池",noUserPool:"当前 Studio 未配置用户池"},vYe={workspace:"Agent 工作区",library:"Agent 库",evaluation:"评测",agentList:"Agent 列表",agentDetails:"Agent 详情",newAgent:"新建 Agent",loading:"加载中…",loadingCloudAgents:"正在加载云端 Agent…",noAgentSelected:"请选择一个 Agent",local:"本地",remote:"云端",localAgent:"本地 Agent",remoteAgent:"云端 Agent",agentCount:"{{count}} 个 Agent",agentCountLabel:"Agent 数量",details:"详情",chat:"对话",update:"更新",backToAgentList:"返回 Agent 列表",loadingAgent:"正在加载 Agent",loadingAgentDescription:"正在读取 Agent 配置和 Runtime 信息。",loadingAgentInfo:"正在加载 Agent 信息…",detailLoadFailed:"无法加载 Agent 详情",detailLoadFailedDescription:"请检查 Runtime 状态后重试。",partialInfoUnavailable:"部分信息暂时不可用",upgradeRuntimeForDetails:"请升级 Runtime 以查看完整 Agent 信息。",basicInfo:"基本信息",usageOverview:"使用概览",sections:{basic:"基本信息",profileConfig:"Profile 配置",sessionConfig:"会话配置",usage:"使用概览",diagnostics:"诊断",evaluations:"评测",optimizations:"优化建议",integrations:"集成",versions:"版本",channels:"消息渠道"},evaluationGroup:"评测组",optimizations:"优化建议",optimizationsDescription:"根据评测结果查看可执行的优化建议。",integrations:"集成",githubVersions:"GitHub 版本",githubVersionsDescription:"查看持续交付产生的版本并创建回退 PR。",currentVersionOnly:"当前未启用 GitHub 持续交付,仅展示当前生产版本。",loadingVersions:"正在加载版本…",noVersion:"暂无版本记录",prLink:"Pull Request",viewPr:"查看 PR",author:"提交人",publishStatus:"发布状态",viewRelease:"查看发布记录",rollbackToVersion:"回退到此版本",rollingBack:"正在创建回退…",rollbackEvent:"回退事件",sourceMergedRuntimeStill:"最新源码已合并,但 Runtime 仍处于",currentProductionVersionHint:";当前生产版本保持不变。",usageSummary:"使用统计",totalCalls:"总调用次数",userCount:"用户数",userDetails:"用户明细",usageUserList:"Agent 使用用户列表",user:"用户",callCount:"调用次数",lastUsed:"最近使用",unknownUser:"未知用户",loadingUsage:"正在加载使用数据…",refreshing:"刷新中…",noUsage:"暂无使用记录",usageUnavailable:"当前 Agent 暂无可用的使用统计。",usagePagination:"使用记录分页",pageOf:"第 {{page}} / {{total}} 页",notProvided:"暂未提供",integrationMethods:"集成方式",integrationDescription:"通过 Runtime API 或 A2A 协议集成当前 Agent。",integrationProtocol:"集成协议",runtimeStatus:"Runtime 状态",executionFlow:"执行流程",probingIntegration:"正在检测集成能力",probingIntegrationDescription:"正在读取可用端点和鉴权配置。",configurationStatus:"配置状态",discoveryEndpoint:"发现端点",invocationEndpoint:"调用端点",invocationUrl:"调用地址",authentication:"鉴权方式",networkAccess:"网络访问",notAvailable:"暂无",noAuthentication:"无需鉴权",noApiKeyRequired:"无需 API Key",usesOauthJwt:"使用 OAuth / JWT",showApiKey:"显示 API Key",hideApiKey:"隐藏 API Key",pythonExample:"Python 示例",deploymentConfig:"部署配置",deploymentConfigDescription:"确认实例和运行配置后更新 Runtime。",deploymentRegion:"部署区域",mpaControlPlane:"MPA 控制面",loadingMpaAgentView:"正在读取 MPA Runtime 绑定…",mpaRuntimeBound:"该 MPA Agent 已绑定唯一 Runtime,可继续管理。",mpaRuntimeMissing:"当前 Agent 没有可见的 MPA Runtime 绑定。",mpaRuntimeBindingAmbiguous:"多个 MPA Runtime 匹配当前 Agent,请先修复绑定后再修改。",mpaRuntimeOrphan:"Runtime 存在,但其中没有当前 MPA Profile。",mpaRuntimeLegacyAuthUnsupported:"该 Runtime 使用旧版 MPA 镜像,仍要求 X-Jwt-Token。请先更新到当前 AgentKit 兼容镜像,再管理 Profile 或 Session 配置。",profileConfig:"Profile 配置",profileConfigTitle:"Profile 配置",profileConfigDescription:"查看并应用 Agent 级 MPA Profile。Profile 是 Runtime 的长期默认配置,新会话默认继承它。",profileStatus:"Profile 状态",profileApplied:"已应用",profileNotApplied:"未应用",profileNotAppliedDescription:"当前 Runtime 可运行,但尚未保存为 Studio 可管理的 Profile。应用后会生成 Profile revision。",applyProfile:"应用 Profile",reapplyProfile:"重新应用 Profile",editProfile:"编辑 Profile",profileApplying:"应用中…",profileAppliedNotice:"Profile 已应用,当前 revision 为 {{revision}}。",profileApplyIncomplete:"Profile 应用未完成,请查看当前操作状态后重试。",profileApplyFailed:"Profile 应用失败。",profilePrompt:"系统提示词",profileResources:"资源配置",profileResourceSummary:"{{tools}} 个工具 · {{skills}} 个 Skill · {{mcp}} 个 MCP 服务",sessionConfigTitle:"会话配置",sessionConfigDescription:"查看和调整当前 MPA Session 的执行配置。变更只对下一轮对话生效。",loadingSessionConfig:"正在加载会话配置…",sessionConfigNoAgent:"请选择一个 MPA Agent 后再管理会话配置。",sessionConfigNonMpa:"会话配置仅适用于 MPA Agent。",sessionConfigNoSession:"请先打开这个 MPA Agent 的对话,再修改会话配置。",sessionConfigDifferentRuntime:"请先切回这个 MPA Agent 的当前对话,再修改会话配置。",sessionConfigSaved:"会话配置已更新,下一轮对话将使用新 revision。",sessionConfigStale:"该 Session 已被其他位置修改,已展示最新配置,请确认后再保存。",sessionConfigRevision:"配置 revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"最新 Profile revision",sessionProfileUpgradeAvailable:"检测到新的 Profile revision:v{{current}} → v{{target}}。",upgradeSessionProfile:"升级 Session Profile",sessionProfileUpgrading:"升级中…",sessionProfileUpgraded:"Session Profile 已升级,下一轮对话将使用新 revision。",sessionProfileUpgradeFailed:"Session Profile 升级失败。",sessionModelOverride:"模型覆盖",modelId:"模型 ID",inheritProfileDefault:"继承 Profile 默认值",sessionMcpServers:"MCP 服务",mcpServerCount:"已选择 {{count}} 个",clearSessionMcp:"清空 MCP 服务",mpaDiagnosticsTitle:"Runtime 诊断",mpaDiagnosticsDescription:"查看最近的 Runtime Console 运行记录,以及 Agent、Profile、Turn、task 和 worker 关联。",loadingMpaDiagnostics:"正在加载 Runtime 诊断…",noMpaDiagnostics:"当前 Session 暂无 Runtime 诊断运行记录。",latestRun:"最近运行",traceCorrelation:"Trace 关联",traceCorrelationDescription:"Runtime Console 为本次 invocation 返回的稳定标识。",traceSteps:"Trace 步骤",traceStepsDescription:"当前 invocation 最近的有界 Runtime Console 步骤。",mpaInstanceId:"MPA 实例",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker 类型",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile 版本",step:"步骤",stepCount:"步骤数",duration:"耗时",noTraceSteps:"本次 invocation 暂无 trace 步骤。",executionConfigMode:{replace:"Session 覆盖",clear:"本 Session 已清空",inherit:"使用 Profile 默认值"},concurrency:"并发数",selectedOptimizations:"已选优化项",selectedOptimizationsDescription:"这些优化会应用到本次更新。",optimizationProfile:"优化方案",updatePending:"等待更新",updatingDeployment:"正在更新部署",restoringUpdateConfig:"正在恢复更新配置…",updateConfigUnavailable:"无法读取更新配置",legacyConfigMissing:"旧版本 Runtime 缺少可恢复的配置,请重新创建。",deploymentFailed:"部署失败",continueEditing:"继续编辑",loadingOptimizations:"正在加载优化建议…",noOptimizations:"暂无优化建议",fixPriority:"优先级",suggestedModule:"建议模块",suggestionAndReason:"建议与原因",priority:{high:"高",medium:"中",low:"低"},modules:{agentStructure:"Agent 结构",prompt:"提示词",tool:"工具",knowledge:"知识库",memory:"记忆",workflow:"工作流",other:"其他"},evaluationGroupList:"评测组列表",newEvaluationGroup:"新建评测组",newEvaluationGroupName:"新评测组 {{count}}",searchEvaluationGroups:"搜索评测组",noMatchingEvaluationGroups:"没有匹配的评测组",noEvaluationGroupSelected:"请选择一个评测组",groupStats:"{{agents}} 个 Agent · {{runs}} 次运行",evaluationGroupDetails:"评测组详情",evaluationGroupStats:"{{agents}} 个 Agent · {{caseSet}} · {{runs}} 次运行",startEvaluation:"开始评测",evaluationConfig:"评测配置",historyResults:"历史结果",participatingAgents:"参与 Agent",selectedCount:"已选择 {{count}} 个",evaluationResources:"评测资源",evaluationSet:"评测集",evaluator:"评估器",caseCount:"{{count}} 条案例",evaluationMetrics:"评测指标",selectedMetricCount:"已选择 {{count}} 项",historyDescription:"查看每次评测的分数和运行状态。",noHistory:"暂无评测历史",noHistoryDescription:"运行一次评测后,结果会显示在这里。",evaluationRun:"第 {{index}} 次评测",evaluationRunMeta:"{{time}} · {{agents}} 个 Agent",overallScore:"综合分",completed:"已完成",evaluationDefaults:{coreRegression:"核心能力回归",safetyCheck:"安全与幻觉检查",coreSet:"核心回归集",safetySet:"安全边界集",toolSet:"工具调用集",qualityEvaluator:"综合质量评估器",factualEvaluator:"事实一致性评估器",toolEvaluator:"工具调用评估器",responseQuality:"回答质量",factualAccuracy:"事实准确性",toolUse:"工具调用",responseEfficiency:"响应效率",todayTime:"今天 10:32",yesterdayTime:"昨天 16:08",julyTime:"7 月 25 日 14:20",justNow:"刚刚"},defaultCases:{agentName:"示例 Agent",goodSetName:"示例正向案例集",badSetName:"示例负向案例集",weeklyFeedback:{input:"总结本周客户反馈,并按优先级归类。",output:"覆盖主要问题,给出清晰的优先级与下一步动作。",tag:"总结",reason:"任务完整覆盖了用户目标,输出结构清晰,并给出了可执行的下一步动作。"},research:{input:"查询最新公开资料并附上来源。",output:"调用搜索工具,结论与引用一一对应。",tag:"工具调用"},uncertainConclusion:{input:"在信息不足时直接给出确定结论。",output:"应明确说明未知,并主动询问缺失信息。",tag:"幻觉",reason:"信息不足时仍给出了确定结论,缺少必要的澄清步骤与不确定性说明。"},repeatedTool:{input:"连续重复调用相同工具获取同一结果。",output:"复用已有结果,避免无意义的重复调用。",tag:"效率"}},goodCases:"正向案例",badCases:"负向案例",goodCase:"正向案例",badCase:"负向案例",reference:"参考答案",caseResultFilter:"案例结果筛选",feedbackSourceFilter:"反馈来源筛选",searchCases:"搜索案例",searchCasesPlaceholder:"搜索输入、输出或标签",selectCases:"选择案例",selectAll:"全选",selectAllVisible:"选择当前可见案例",selectedCaseCount:"已选择 {{count}} 条",deleteSelected:"删除所选",deleteSelectedTitle:"删除所选 Agent",deleteSelectionDescription:"确定删除所选的 {{count}} 个项目吗?此操作无法撤销。",deleteCasesConfirm:"删除所选案例",deleteOneCaseConfirm:"删除这个案例",deleteFeedbackCase:"删除反馈案例",noFeedbackCases:"暂无反馈案例",noMatchingCases:"没有匹配的案例",loadingEvaluationSet:"正在加载评测集…",userInput:"用户输入",agentOutput:"Agent 输出",score:"得分",scoreReason:"评分原因",noUserInput:"暂无用户输入",noVisibleResponse:"暂无可见回复",note:"备注:",manualFeedback:"人工反馈",automaticFeedback:"自动反馈",scoreValue:"{{score}} 分",unknownTime:"时间未知",deleteAgentTitle:"删除 Agent",deleteAgentDescription:"确定删除 Agent“{{name}}”吗?",deleteDraftDescription:"确定删除草稿“{{name}}”吗?",deleteAgent:"删除 Agent",closeDeleteConfirmation:"关闭删除确认",mpaDeletePreviewSummary:"Studio 将清理可见的空闲会话、该 MPA 独占的沙箱模板和 Skill Space,最后删除 Runtime。数据库及共享资源保留;运行中的任务需先结束或停止。",mpaDeletePreviewSessions:"会话",mpaDeletePreviewActiveSessions:"运行中",mpaDeletePreviewIdleSessions:"空闲",mpaDeleteBlocked:"当前无法删除",mpaDeleteBlockerActiveOperation:"仍有 MPA 创建或更新操作在执行。",mpaDeleteBlockerActiveSessions:"Runtime 中仍有运行中的会话。",mpaDeleteBlockerBindingAmbiguous:"当前 Agent 匹配到多个 MPA Runtime。",mpaDeleteBlockerRuntimeMissing:"当前 MPA Agent 没有可见的 Runtime 绑定。",mpaDeleteBlockerOrphanRuntime:"Runtime 可见,但其中缺少当前 MPA Profile。",mpaDeleteStage:{runtime_sessions:"删除 {{count}} 个可见空闲 Runtime 会话",runtime_diagnostics:"清理这些会话关联的诊断数据和挂载元信息",agentkit_runtime:"删除 AgentKit Runtime",worker_template:"删除独占沙箱模板",skill_space:"删除独占 Skill Space(含空间内技能)"},draftDeletionWarning:"草稿将从当前浏览器中删除。",runtimeDeletionWarning:"Runtime 和相关云端资源将被删除。",noneSelected:"尚未选择",none:"无",notPublished:"未发布",notRecorded:"未记录",noTime:"暂无时间",noPr:"暂无 PR",comingSoon:"评测能力即将开放",preparing:"准备中",cancelled:"已取消",failed:"失败",totalCount:"共 {{count}} 条",deploymentProgress:"部署进度",returnToEdit:"返回编辑",retryOperation:"重试操作",buildLog:"构建日志",githubMountLog:"GitHub 挂载日志",githubDeliveryMountLog:"GitHub 持续交付挂载日志",waitingBuildLog:"正在等待构建日志…",waitingGithubMountLog:"正在等待 GitHub 挂载日志…",copy:"复制",copied:"已复制",copyLabel:"复制{{label}}",copiedLabel:"已复制{{label}}",logLines:"{{count}} 行",logStatus:{synced:"已同步",failed:"读取失败",syncing:"同步中",earlyOmitted:"已省略早期日志",recentOnly:"仅显示最近的构建日志",partiallyOmitted:"已省略部分日志"},deployStatus:{running:"正在部署",unconfirmed:"部署状态待确认",success:"部署完成",error:"部署失败",cancelled:"部署已取消"},deploymentSteps:{prepare:{label:"准备部署",description:"校验配置并创建部署任务"},build:{label:"构建镜像",description:"生成运行环境与智能体代码"},deploy:{label:"部署服务",description:"创建并启动 AgentKit Runtime"},publish:{label:"发布服务",description:"等待服务就绪并生成访问地址"},complete:{label:"部署完成",description:"智能体已可以正常使用"},evaluation:{label:"创建评测集",description:"自动创建 Good Case 和 Bad Case 评测集"},profileApplying:{label:"应用 MPA 配置",description:"将 Studio Agent 配置写入 MPA Runtime"},smokeRunning:{label:"验证 MPA Runtime",description:"在标记可运行前执行 Runtime 就绪验证"},runnable:{label:"MPA Runtime 可运行",description:"Runtime 已接受配置并通过执行就绪验证"},github:{label:"挂载 GitHub 持续交付",description:"初始化目标分支与 GitHub Actions workflow"},update:{label:"更新实例配置",description:"将 Runtime 实例数调整为 {{min}}~{{max}}"}},githubStatus:{published:"已发布",publishing:"发布中",failed:"发布失败",pending:"等待发布",unknown:"未知"},errors:{agentInfoMissing:"Agent 信息不可用",checkUpdateCapability:"无法检查更新能力",checkingUpdateConfig:"正在检查更新配置",cloudOnlyUpdate:"仅云端 Agent 支持更新",deleteDeployedUnsupported:"当前不支持删除已部署 Agent",deleteDraftUnsupported:"当前不支持删除草稿",loadMpaDeletePreview:"无法加载 MPA 删除预览",loadAgentInfo:"无法加载 Agent 信息",loadApiKey:"无法读取 API Key",loadGithubVersions:"无法加载 GitHub 版本",loadEvaluations:"无法加载评测案例",loadMpaAgentView:"无法加载 MPA Agent 状态",loadMpaDiagnostics:"无法加载 Runtime 诊断",loadOptimizations:"无法加载优化建议",loadRuntimeDetails:"无法加载 Runtime 详情",loadSessionConfig:"无法加载会话配置",loadUsage:"无法加载使用数据",noCreatePermission:"当前账号没有创建 Agent 的权限",noManagePermission:"当前账号没有管理此 Agent 的权限",originalConfigUnavailable:"原始配置不可用",probeIntegration:"无法检测集成能力",rollbackVersion:"无法创建版本回退",runtimeRegionMissing:"Runtime 区域信息缺失",updateCapabilityMismatch:"Runtime 更新能力与当前配置不匹配",updateCapabilityPending:"Runtime 更新能力仍在确认中",updateConfigRestoring:"正在恢复更新配置",updateUnsupported:"当前 Runtime 不支持更新",usageMismatch:"返回的使用数据与当前 Agent 不匹配"},mpaDeleteChecking:"正在检查会话和资源归属…",mpaDeleteRetryPreview:"重新检查",mpaDeletePreviewFailed:"删除前检查失败。请处理下面的错误后重新检查。",mpaDeleteRetained:"以下资源将保留",mpaDeleteRetainedReason:{shared:"有其他智能体引用",unproven:"无法确认是此智能体独占的受管资源"}},yYe={title:"环境",loadFailed:"环境加载失败,请检查存储配置后重试。",storageUnavailable:"管理员未配置持久化存储,环境管理暂不可用。",create:"新建环境",configure:"配置环境",details:"环境详情",editorDescription:"配置运行环境,或接入代码仓库和已有镜像",backToList:"返回环境列表",save:"保存环境",createAndBuild:"创建并构建",saveAndBuild:"保存并构建",name:"环境名称",namePlaceholder:"Python 数据处理",descriptionPlaceholder:"说明这个环境适合处理的任务",creationMethod:"创建方式",baseConfiguration:"基础配置",baseEnvironment:"基础环境",operatingSystem:"操作系统",pythonVersion:"Python 版本",fixedByBase:"由 {{base}} 固定为 {{value}}",selectUbuntuVersion:"选择基础镜像的 Ubuntu 版本",selectPythonVersion:"选择需要安装的 Python 版本",skills:"技能",addSkill:"添加环境技能",veadkDescription:"Agent 开发与运行框架",customDockerfile:"自定义 Dockerfile",presetEnvironment:"预制环境",presetHint:"选择“无”可自行填写 Dockerfile 第一行的基础镜像。",dockerfileSize:"{{size}} / {{max}} 字节",upload:"上传",reset:"重置",dockerfileBaseImage:"Dockerfile 基础镜像",dockerfileContent:"Dockerfile 内容",region:"区域",search:"搜索环境",manualImport:"手动导入",noMatches:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称",startBuild:"开始构建",build:"构建",unnamed:"未命名环境",listSeparator:"、",clipboardReadError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",creation:{custom:{label:"自定义配置",description:"通过表单选择基础环境、Python、工具和技能"},dockerfile:{label:"自定义 Dockerfile",description:"上传或直接编辑 Dockerfile"},git:{label:"从代码仓库构建",description:"探查公开仓库并通过 CodePipeline 构建"},image:{label:"使用已有镜像",description:"绑定由外部流水线交付的 CR 镜像"}},baseDescriptions:{"aio-sandbox":"内置 Sandbox Shell 能力 · Ubuntu 22.04","codex-sandbox":"内置 Codex CLI、浏览器与代码执行环境",ubuntu:"标准 Linux 基础镜像"},dockerfileValidation:{baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"},presets:{none:"自行填写 Dockerfile 基础镜像",aio:"内置 Sandbox Shell 与常用运行时",codex:"内置 Codex CLI、浏览器与代码执行环境"},categories:{tools:"工具",productivity:"效率",browser:"浏览器自动化",system:"系统与媒体"},options:{"lark-cli":"飞书开放平台命令行工具",pandoc:"文档格式转换工具",opencli:"将网站与桌面应用转换为命令行工具",uv:"快速 Python 包与项目管理器",ripgrep:"高性能文本检索工具",jq:"JSON 查询与转换工具","github-cli":"在终端中管理 GitHub 工作流",playwright:"浏览器自动化与端到端测试",chromium:"无头浏览器运行时",git:"代码版本管理",curl:"网络请求与文件下载",ffmpeg:"音视频转码与处理",imagemagick:"图片转换与批处理"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",hoursMinutes:"{{hours}} 小时 {{minutes}} 分"},buildStatus:{preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"构建失败",notBuilt:"未构建"},manifest:{title:"环境 Manifest",closeLabel:"关闭环境 Manifest",loading:"正在加载 Manifest",editorLabel:"环境 Manifest YAML",copyFailed:"复制失败,请重试",copied:"已复制",copy:"复制 Manifest",view:"查看环境 Manifest",viewShort:"查看 Manifest",unavailable:"尚无可用 Manifest"},buildDetails:{title:"构建详情",closeLabel:"关闭构建详情",currentStep:"当前步骤",waiting:"等待构建信息",elapsed:"已用时",sourceCommit:"源码提交",openCodePipeline:"在 CodePipeline 中查看",starting:"正在启动",rebuild:"重新构建"},git:{sectionLabel:"公开代码仓库",address:"Git 地址",ref:"Branch、Tag 或 Commit",defaultBranch:"默认分支",inspecting:"正在拉取仓库并查找 Dockerfile",foundDockerfiles:"已在提交 {{commit}} 中找到 {{count}} 个 Dockerfile。",savedDockerfileLoaded:"已载入保存的 Dockerfile,可重新探查仓库更新。",noDockerfile:"仓库中未找到 Dockerfile,请检查分支或仓库内容。",inspectAgain:"重新探查",selectDockerfile:"选择 Dockerfile"},repository:{outputSection:"构建输出",type:"镜像仓库类型",managed:"Studio 默认镜像仓库",existing:"已有镜像仓库",managedHint:"构建时自动创建或复用当前区域的 Studio 镜像仓库。"},existingImage:{sectionLabel:"已有镜像",reference:"Tag 或 Digest",placeholder:"latest 或 sha256:...",hint:"填写镜像 Tag,或以 sha256: 开头的完整 Digest。"},share:{action:"分享",title:"分享环境",closeLabel:"关闭分享环境",generating:"正在生成并复制分享码",copied:"分享码已复制",failed:"分享失败",code:"分享码",fullCode:"完整环境分享码",copiedHint:"分享码已自动复制,也可在这里查看或手动复制。",copyFailedHint:"自动复制失败,可手动复制上方分享码,或重试。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅发送给可信对象。",copyAgain:"再次复制"},import:{title:"导入环境",closeLabel:"关闭导入环境",description:"先检测分享码中的环境,再确认添加到当前账号。",code:"环境分享码",tooMany:"最多可一次导入 {{max}} 个环境,当前检测到 {{count}} 个分享码。",multipleHint:"多个分享码可使用英文逗号、中文逗号或换行分隔,重复项会自动忽略。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅导入可信来源的分享码。",inspectingCodes:"正在检测环境分享码",found:"检测到 {{count}} 个环境:{{names}}。",itemError:"第 {{index}} 个分享码:{{error}}",invalidCode:"分享码无效。",noResult:"服务未返回该分享码的导入结果。",partial:"已导入 {{created}} 个环境,{{remaining}} 个未完成,可重试有效失败项。",inspecting:"正在检测",importing:"正在导入",retryImport:"重试导入",confirm:"确认导入",inspectCodes:"检测分享码"},status:{boundImage:"环境“{{name}}”已绑定已有镜像",queued:"环境“{{name}}”已进入构建队列",savedBuildFailed:"环境已保存,但构建未启动:{{error}}",importedFailed:"已导入 {{created}} 个环境,{{failed}} 个失败",importedDuplicate:"已导入 {{created}} 个环境,{{duplicate}} 个分享码已存在",imported:"已导入 {{count}} 个环境",deleted:"已删除环境“{{name}}”"},deleteTitle:"删除环境",deleteDescription:"确定删除环境“{{name}}”吗?删除后无法恢复。",errors:{repositoryRequired:"请输入公开代码仓库地址。",repositoryHttps:"请输入公开仓库的 HTTPS 地址。",repositoryInvalid:"请输入有效的公开仓库 HTTPS 地址。",imageReferenceWhitespace:"Tag 或 Digest 不能包含空格。",imageDigestInvalid:"Digest 必须是完整的 sha256 值。",imageTagOnly:"这里只填写 Tag,不要重复填写镜像仓库路径。"}},bYe={searchPlaceholder:"搜索资源名称",emptyMessage:"暂无可用选项",searchAriaLabel:"搜索{{label}}",loadingMore:"正在加载更多资源…"},xYe={retryDeployment:"重试部署",retrying:"正在重试…",collapse:"收起错误信息",expand:"展开完整错误信息",copy:"复制完整错误信息"},wYe={steps:"构建步骤",log:"构建日志",syncing:"同步中",loadFailed:"读取失败",synced:"已同步",recentOnly:" · 仅显示最近日志",copiedLog:"已复制构建日志",copyLog:"复制构建日志",copied:"已复制",copy:"复制",logContent:"构建日志内容",waiting:"正在等待 CodePipeline 输出日志…",empty:"暂无构建日志"},AYe={defaultLabel:"Studio 默认环境",defaultDescription:"使用 Studio 预置的标准运行环境",status:{notBuilt:"未构建",preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"失败"},label:"运行环境",placeholder:"请选择运行环境",search:"搜索运行环境",loading:"正在加载运行环境…",loadFailed:"加载运行环境失败",noMatches:"未找到匹配的运行环境",unavailable:"当前没有可用的运行环境",selectionUnavailable:"所选运行环境当前不可用,请重新选择。",selectionHint:"选择构建完成的运行环境后,部署将使用其镜像和工具配置。",versionChanged:"所选环境版本已更新,请确认后继续。",versionMissing:"所选环境版本已不存在,请重新选择。",operatingSystem:"操作系统",language:"语言",image:"镜像",imageVersion:"镜像版本",skills:"技能",tools:"工具",noSkills:"未配置 Skill",noExtraTools:"未配置额外工具",defaultGuidance:"默认环境由 Studio 管理,无需额外配置。",persistenceFallback:"持久化环境服务暂不可用,当前使用默认环境。",emptyFallback:"当前没有可选择的自定义环境。"},SYe={repository:"GitHub 仓库",githubUrl:"GitHub 地址",token:"访问令牌",sessionToken:"{{provider}} 临时令牌",runtime:"Runtime",commit:"提交",workflow:"工作流",syncFailed:"同步 GitHub 代码失败",status:{mounted:"已挂载",bound:"已绑定",synced:"已同步",created:"已创建"},volcengine:"火山引擎",mountDelivery:"挂载持续交付",selectedForDeployment:"已选择,部署时挂载",mountOnDeploy:"部署时挂载持续交付",syncCode:"同步代码",deliveryMode:"GitHub 交付模式",sourceSync:"GitHub 代码同步",delivery:"GitHub 交付",loading:"读取中",running:"执行中",runtimeDeliveryHint:"写入 AgentKit Runtime GitHub Actions workflow,后续 GitHub 提交会更新绑定 Runtime。",initialDeliveryHint:"首次部署成功后初始化目标分支,后续 GitHub 提交会更新绑定 Runtime。",sourceSyncHint:"Studio 会直接 push 到目标分支;该分支由 Studio 管理,远端冲突时同步会失败。Runtime 仍由部署按钮发布。",tokenPlaceholder:"repo 或 contents write 权限",getToken:"获取 Token",hideToken:"隐藏 Token",showToken:"显示 Token",tokenHelp:"Token 仅用于本次操作,成功后不会保留在表单中。",targetBranch:"目标分支",actionsSecretPlaceholder:"用于写入 GitHub Actions Secret",sessionTokenPlaceholder:"临时凭证可选",syncing:"同步中…",pendingHint:"已选择挂载持续交付。点击部署后,Studio 会等待 Runtime 创建完成并初始化 GitHub 目标分支,初始化成功后才完成部署流程。",result:{deliveryMounted:"已挂载持续交付",deliverySelected:"已选择挂载持续交付",githubBound:"已绑定 GitHub",codeSynced:"代码已同步",deliveryHint:"目标分支提交会触发 Runtime 持续交付。",boundHint:"更新并发布时会先同步当前源码到这个分支。"},branch:"分支",viewPr:"查看 PR",createFailed:"创建失败",phase:"阶段",log:"日志"},TYe={name:"飞书",enabling:"正在启用并更新配置…",description:"接收消息并通过飞书机器人回复",configuration:"飞书配置",configurationMode:"飞书配置方式",automatic:"自动配置",manual:"手动配置",cancelling:"取消中…",scanToCreate:"扫码创建",scanDescription:"授权后自动回填凭据",generateQrCode:"生成二维码",qrCodeAlt:"飞书机器人配置二维码",scanToConfirm:"飞书扫码确认",expiresIn:"{{time}} 后失效",created:"机器人已创建",credentialsFilled:"应用凭据已自动回填",qrCodeExpired:"二维码已失效",automaticFailed:"自动配置失败",regenerateQrCode:"请重新生成二维码。",configuredPlaceholder:"已配置,留空沿用",appSecretPlaceholder:"请输入 App Secret",hideSecret:"隐藏 App Secret",showSecret:"显示 App Secret"},CYe={mode:{auto:"自动创建",autoDescription:"部署时自动创建所需资源",recommended:"推荐",create:"指定名称",createDescription:"使用指定名称创建或复用资源",existing:"选择已有",existingDescription:"从当前账号的已有资源中选择"},selectExisting:"请选择已有资源",searchResource:"搜索资源名称",noMatch:"未找到匹配资源",noAvailable:"暂无可用资源",searching:"正在搜索云资源…",loading:"正在加载云资源…",noMatchSentence:"未找到匹配资源。",noAvailableSentence:"暂无可用资源。",loadedSummary:"实际服务区域:{{region}} · 已加载 {{loaded}}{{total}}",registryInstance:"Registry 实例",registryAriaLabel:"镜像仓库 Registry 实例",namespace:"命名空间",namespaceAriaLabel:"镜像仓库 Namespace",repository:"镜像仓库",existingRepository:"已有镜像仓库",selectRegistryFirst:"请先选择 Registry 实例。",selectNamespaceFirst:"请先选择 Namespace。",configurationMode:"配置方式",configurationModeAriaLabel:"{{resource}}配置方式",selectConfigurationMode:"请选择配置方式",automaticNames:"自动创建名称",validation:{tos:"请填写或选择 TOS 存储桶。",cr:"请完整填写或选择 CR 实例、命名空间和镜像仓库。",codePipeline:"请完整填写或选择 CodePipeline Workspace 和 Pipeline。",existingCodePipeline:"请选择已有的 CodePipeline Workspace 和兼容 Pipeline。"},autoBucketWithRegion:"agentkit-platform-{账号 ID}-{{region}}",autoBucket:"agentkit-platform-{账号 ID}",tosBucket:"TOS 存储桶",bucketName:"存储桶名称",bucketNamePlaceholder:"输入存储桶名称",existingBucket:"已有存储桶",existingTosBucket:"已有 TOS 存储桶",bucket:"存储桶",accountIdResolved:"账号 ID 在部署时按当前云账号解析。",containerRegistry:"容器镜像仓库(CR)",instanceName:"实例名称",crInstance:"CR 实例",existingCrInstance:"已有 CR 实例",existingCrNamespace:"已有 CR 命名空间",existingCrRepository:"已有 CR 镜像仓库",autoRegistry:"agentkit-platform-{账号 ID}",autoRepositoryName:"{{name}}-{4 位随机字符}",registryNameNote:"账号 ID 在部署时解析,镜像仓库的随机字符在部署时生成。",workspace:"工作空间",pipeline:"流水线",workspaceName:"Workspace 名称",pipelineName:"Pipeline 名称",existingWorkspace:"已有 CodePipeline Workspace",compatiblePipeline:"兼容 Pipeline",existingPipeline:"已有 AgentKit CodePipeline",pipelineNameNote:"Pipeline 与 Runtime 名称一致。"},kYe={commit:"提交",steps:{permissions:"预检 OTA 所需权限",resolving:"读取目标版本信息",downloading:"下载并校验完整更新包",preparing:"准备 VeFaaS Function 代码",provisioning:"检查并补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布新 Revision 并重启服务"},stages:{permissions:"预检 OTA 权限",resolving:"读取版本信息",downloading:"下载更新包",preparing:"准备 Function 代码",provisioning:"补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布 Revision",checking:"检查更新",unknown:"未知阶段"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},logPermissionPrefix:"无法读取 VeFaaS 发布日志。Function 角色缺少 ",logPermissionSuffix:" 权限,更新会继续。",openIamConsole:"前往 IAM 控制台配置权限",deploymentProgress:"部署进度",live:"实时",completed:"已完成",stopped:"已停止",copied:"已复制",copyFailed:"复制失败",copyLog:"复制日志",waitingForLogs:"等待 VeFaaS 返回更新日志…",noLogs:"本次更新未返回发布日志",messages:{updated:"Studio 已更新,新 Revision 已接管服务",failed:"Studio 更新失败",timeout:"等待 VeFaaS 发布超时,请稍后重新检查版本",submitted:"更新已提交,正在等待 VeFaaS 发布新版本",connectionSwitched:"连接已切换,正在确认新版本状态"},checkingPermissions:"正在检查 OTA 权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",updated:"Studio 已更新",updateToVersion:"更新 Studio 至 {{version}}",checkPermissions:"检查更新权限",authorizationNeeded:"需要授权",updatingShort:"正在更新",refreshForNewVersion:"刷新使用新版",updateFailed:"更新失败",updateNow:"立即更新",newVersionAvailable:"有新版更新",dialog:{failed:"Studio 更新失败",checkingPermissions:"正在检查更新权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",completed:"Studio 更新完成",newVersion:"发现新版本"},permissionCheck:"正在核对 OTA 与定时任务所需的全部 IAM 权限…",permissionCheckHint:"权限全部满足后才会开始下载、更新或发布云资源。",missingPermissionCount:"当前 Function 角色缺少 {{count}} 项 OTA 更新权限,尚未执行任何云资源变更。",functionRole:"Function 角色",currentRole:"当前运行角色",policyToUpdate:"将更新策略",authorizationSteps:{open:"打开授权页面,确认已预填的策略名称和完整策略内容。",debug:"点击页面中的“发起调试”,完成策略更新。",return:"返回此窗口,点击“我已授权,重新检查”。"},missingPermissions:"缺少的权限",openPrefilledAuthorization:"打开已预填的 IAM 授权页面",openIamManually:"前往 IAM 控制台手动配置",noSafePolicy:"当前角色没有唯一可安全更新的自定义策略,请由管理员将上述权限加入该角色。",failedStage:"失败阶段",errorId:"错误 ID",notGenerated:"未生成",openFunctionLogs:"前往 VeFaaS 控制台查看 Function 日志",targetVersion:"目标版本",updateStatus:"更新状态",elapsed:"已用时",progressAriaLabel:"Studio 更新进度",processingUpdate:"正在处理更新",processing:"正在处理",backgroundHint:"发布阶段会短暂中断连接;关闭此窗口不会停止更新,可随时点击右上角按钮重新查看。",confirmDescription:"更新会重启 Studio 服务,预计约 3–5 分钟完成更新与发布。期间正在进行的对话、流式响应或部署任务可能中断,登录态不会受到影响。",selectVersion:"选择版本",currentVersion:"当前版本",changelog:"更新内容",noChangelog:"暂无更新说明",runInBackground:"后台运行",authorizedRecheck:"我已授权,重新检查",tryAgain:"重新尝试"},OYe={deploy:"部署",update:"更新",planHash:"方案哈希",backToConfiguration:"返回配置",releaseRegion:"发布区域",deployRegion:"部署区域",regionPreserved:"更新时沿用现有 Runtime 的部署区域,无法修改。",unnamedAgent:"未命名 Agent",deployTitle:"部署 {{name}}",additionalAgentCount:" 等 {{count}} 个智能体",releaseOverview:"发布概览",agentOverview:"Agent 概览",agentCount:"Agent 数量",model:"模型",systemPrompt:"系统提示词",optimizations:"优化选项",notEnabled:"未启用",effectiveCapabilities:"生效能力",automaticProtection:"自动保护",artifactActions:"发布产物操作",exportYaml:"导出 YAML",viewSource:"查看源代码",downloadSource:"下载源代码",expandFlow:"放大查看执行流程",expand:"放大查看",deploymentConfiguration:"部署配置",runtimeName:"Runtime 名称",runtimeNamePreserved:"更新时保持现有 Runtime 名称不变。",runtimeNameHint:"默认根据 Root Agent 名称生成,并添加随机后缀避免重名;支持 4-64 位字母、数字、连字符和下划线",accessAuthentication:"访问鉴权",authenticationPreserved:"更新时保持现有 Runtime 的鉴权方式不变。",authenticationMethod:"鉴权方式",authenticationAriaLabel:"部署鉴权方式",authenticationPlaceholder:"请选择鉴权方式",messageChannels:"消息渠道",instanceSettings:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",sidecarSingleInstance:"Harness Sidecar 首期仅支持单实例,Runtime 固定为 1~1",inMemorySingleInstance:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",network:"网络",networkPreserved:"现有 Runtime 的区域与网络模式保持不变。",networkMode:"网络模式",networkModes:{public:"公网",both:"公网 + VPC"},subnetId:"子网 ID",subnetHint:"可选,多个用逗号分隔",sharedInternetAccess:"VPC 内共享公网出口",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",createEvaluationSetsHint:"部署成功后,自动创建 Good Case 和 Bad Case 评测集。",resourceConfiguration:"资源配置",environmentVariables:"环境变量",environmentVariablesHint:"组件配置会自动同步到这里,部署前可核对最终值。",itemCount:"{{count}} 项",addVariable:"添加变量",componentGenerated:"组件自动生成",injectedByApiKey:"由所选 API Key 注入",envNameAriaLabel:"{{key}} 环境变量名",envDescriptionAriaLabel:"{{key}}说明:{{description}}",openOpenViking:"打开 OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}:打开 OpenViking {{label}}",requiredEmpty:"必填,尚未填写",optionalEmpty:"可选,尚未填写",envValueAriaLabel:"{{key}} 环境变量值",automatic:"自动",synced:"同步",customModelCredentials:"自定义模型凭据",releaseOnlySecret:"必填,仅用于本次发布",thisRelease:"本次发布",customVariables:"自定义变量",value:"值",deleteVariable:"删除变量",deploymentProgress:"部署进度",retryUpdate:"重试更新",retryDeploy:"重试部署",updateSucceeded:"更新成功",deploySucceeded:"部署成功",region:"区域",agentName:"Agent 名称",apiEndpoint:"API 端点",connecting:"连接中…",chatNow:"立即对话",console:"控制台",actionInProgress:"{{action}}中…",checkingName:"正在检查名称…",retryAction:"重试{{action}}",flowPreview:"执行流程预览",executionFlow:"执行流程",flowPreviewHint:"只读预览,可缩放与拖动画布",closeFlowPreview:"关闭执行流程预览",agentAdded:'Agent "{{name}}" 已添加到左上角下拉列表!',files:{preview:"文件预览",new:"新建文件",empty:"暂无文件",noneSelected:"未选择文件",selectToView:"选择左侧文件以查看内容",loadingEditor:"加载编辑器…",rename:"重命名",renamePrompt:"重命名文件"},apiKey:{selectFirst:"请先选择 API Key",revealing:"正在显示 API Key",hide:"隐藏 API Key",retryReveal:"重试显示 API Key",reveal:"显示 API Key"},task:{preparing:"准备部署",waitingBuildLog:"正在等待构建日志…",waitingGithubLog:"正在等待 GitHub 挂载日志…",syncingGithub:"正在同步当前源码到 GitHub",syncGithubCode:"同步 GitHub 代码",githubSynced:"GitHub 代码已同步",githubSubmitted:"GitHub 代码已提交",githubUpdatingRuntime:"代码已提交到 GitHub,GitHub Actions 正在更新同一个 Runtime",initializingGithub:"开始初始化 GitHub main 分支与 Actions workflow",initializingGithubBranch:"正在初始化 GitHub 持续交付目标分支",mountGithubDelivery:"挂载 GitHub 持续交付",githubBranchInitialized:"GitHub 持续交付已初始化目标分支",githubDeliveryMounted:"GitHub 持续交付已挂载",githubMountFailed:"挂载 GitHub 持续交付失败",githubMountFailedDetail:"GitHub 持续交付挂载失败:{{message}}",githubMountFailedHint:"挂载 GitHub 持续交付失败,详见 GitHub 日志。",applyingMpaProfile:"正在将 Agent 配置应用到 MPA Runtime",mpaProfileApplied:"MPA Runtime 配置已应用",runningMpaSmoke:"正在验证 MPA Runtime 执行链路",mpaReady:"MPA Runtime 已可运行",deploymentComplete:"部署完成",deployedNotConnected:"部署完成,暂未连接",cancelled:"已取消",cancelledHint:"部署已取消,相关 Runtime 资源已请求销毁。",deploymentStatusUnconfirmed:"部署状态待确认",deploymentFailed:"部署失败",buildFailedHint:"构建镜像失败,详见构建日志。"},confirm:{updateTitle:"确认更新",deployTitle:"确认部署",closeLabel:"关闭部署确认",updateDescription:"将更新并发布到当前云端 Runtime,过程可能需要几分钟。确定继续吗?",deployDescription:"将创建新的云端 Runtime,部署过程可能需要几分钟。确定继续吗?",update:"确定更新",deploy:"确定部署"},userPool:{label:"用户池",unnamed:"未命名用户池",current:"当前用户池",ariaLabel:"部署用户池",loading:"正在加载用户池…",placeholder:"请选择用户池",loadingIdentity:"正在加载 Identity 用户池…",empty:"当前账号下暂无 Identity 用户池。",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime。",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime。",markedHint:"当前 Studio 使用的用户池已在列表中标注。"},authentication:{apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPool:"用户池",userPoolDescription:"使用 Identity 用户池签发的 JWT"},steps:{buildImage:"构建镜像",deploy:"部署",publish:"发布",syncCode:"同步代码",uploadPackage:"上传代码包",packageImage:"镜像打包",createRuntime:"创建 Runtime",publishService:"发布服务",updateInstances:"更新实例配置",createEvaluationSets:"创建评测集",applyMpaProfile:"应用 MPA 配置",verifyMpaRuntime:"验证 MPA Runtime",mpaReady:"MPA Runtime 可运行"},errors:{instanceRangeInteger:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数。",instanceRangeOrder:"最小实例数不能大于最大实例数。",selectApiKey:"请先在模型配置中选择 API Key。",loadApiKey:"加载 API Key 失败,请重试。",invalidProject:"项目数据无效",updateFeishu:"更新飞书配置失败:{{message}}",userPoolRequired:"请选择用于 Runtime 鉴权的用户池。",vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",modelSecretRequired:"请填写 {{label}},用于访问对应的自定义模型地址。",managedApiKeyRequired:"{{requirement}},请先返回模型配置选择 API Key。",feishuEnvRequired:"启用飞书后,请填写{{field}}。",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",deployedButGithubMountFailed:"部署成功,但挂载 GitHub 持续交付失败:{{message}}",deployedButGithubBindFailed:"部署成功,但绑定 GitHub 失败:{{message}}",mpaRuntimeIdMissing:"部署成功,但返回缺少 Runtime ID,无法应用 MPA 配置。",mpaOperationIncomplete:"MPA Runtime 初始化未完成,请重试此部署任务。",deploymentStatusUnconfirmed:"连接已中断,当前无法确认部署最终状态。任务可能仍在云端运行,请到 AgentKit 或 Code Pipeline 查看同一任务,避免重复部署。",failedAtStage:"{{action}}失败({{stage}}阶段):{{message}}",noAgentAtEndpoint:"连接成功,但该地址未发现任何 Agent(/list-apps 为空)。",addAgent:"添加 Agent 失败:{{message}}",modelApiKeyRequired:"请填写此模型地址对应的 API Key。"}},EYe={title:"工作区",storageUnavailable:"管理员未配置持久化存储,工作区管理暂不可用。",detail:"工作区详情",create:"新建工作区",editorDescription:"将常用环境组合在一起;同一个环境可以加入多个工作区。",backToList:"返回工作区列表",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",createdAt:"创建时间",updatedAt:"最近更新",basicInfo:"基本信息",namePlaceholder:"例如:内容生产",descriptionPlaceholder:"说明这个工作区的用途",selectedEnvironmentCount:"已选择 {{count}} 个,可在其他工作区中继续复用",searchAvailableEnvironments:"搜索可用环境",searchEnvironments:"搜索环境",noAvailableEnvironments:"还没有可添加的环境",createEnvironmentFirst:"请先在“环境”页面创建并构建环境。",noMatchingEnvironments:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称。",environmentStatus:{available:"可用",building:"构建中",notBuilt:"未构建"},added:"已添加",saved:"已保存工作区“{{name}}”",resourceType:"工作区资源类型",searchWorkspaces:"搜索工作区",loadFailed:"无法加载工作区",noMatchingWorkspaces:"没有匹配的工作区",tryAnotherNameOrEnvironment:"请尝试搜索其他名称或环境",noEnvironmentAdded:"未添加环境",environmentMissing:"环境缺失",availableFraction:"{{available}}/{{total}} 可用",available:"可用",availableCount:"{{count}} 个可用",updated:"更新",addEnvironment:"添加环境",deleteTitle:"删除工作区",deleteDescription:"确定删除工作区“{{name}}”吗?环境本身不会被删除。",deleted:"已删除工作区“{{name}}”",clipboardPermissionError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",codeProjects:"代码项目"},_Ye={back:"返回",detailNavigation:"详情导航",noData:"暂无数据",actions:"操作",moreActions:"更多操作 {{label}}",actionsFor:"{{label}} 操作",loading:"资源加载中,请稍候"},RYe={addSkill:"添加 Skill",remove:"移除 {{name}}",confirmRemoveRuntime:"从新版本中移除运行中的 Skill「{{name}}」?",selectedCount:"已加入技能 · {{count}}",close:"关闭{{label}}",sources:{runtime:"运行中来源 · 原样保留,可移除或用同名 Skill 替换",local:"本地",skillspace:"AgentKit Skills 中心",skillhub:"火山 Find Skill 技能广场"},tabs:{local:"本地文件",localShort:"本地文件",skillspace:"AgentKit Skills 中心",skillspaceShort:"AgentKit",skillhub:"火山 Find Skill 技能广场",skillhubShort:"Find Skill"}},DYe={model:"模型",turnControls:"流程控制",pause:"暂停",resume:"恢复",interrupt:"中断",cancel:"取消",pauseTurn:"在安全点暂停完整流程",resumeTurn:"恢复完整流程",interruptTurn:"中断当前流程并保留会话上下文",cancelTurn:"取消当前流程且不可恢复",turnState:{running:"运行中",pausing:"正在到达安全点",paused:"已暂停",resuming:"正在恢复",interrupting:"正在中断",cancelling:"正在取消",interrupted:"已中断",completed:"已完成",failed:"失败",cancelled:"已取消",orphaned:"状态待确认",newTurnRequired:"需要从检查点继续"},tasks:{ppt:"PPT",image:"图片生成",video:"视频生成"},prompts:{ppt:{quarterlyReview:"复盘【季度】经营表现,提炼指标差距、原因与行动建议",projectUpdate:"汇报【项目名称】进展:里程碑、风险、预算和资源诉求",solutionProposal:"为【客户行业】输出解决方案:痛点、架构、实施路径与收益",industryAnalysis:"分析【行业主题】趋势,给出竞争格局、机会与战略建议"},image:{launchVisual:"为【品牌或产品】设计【高级科技】风格的发布会主视觉",ecommercePoster:"生成【产品名称】电商海报,突出【核心卖点】与品牌色",conceptRendering:"呈现【产品或空间】在【使用场景】中的写实概念效果图",socialGraphic:"围绕【传播主题】制作简洁专业的企业社媒配图"},video:{brandFilm:"制作【品牌名称】30 秒宣传片,突出【品牌价值】",productLaunch:"为【产品名称】制作 45 秒发布视频:痛点、功能、场景与行动号召",trainingVideo:"制作【培训主题】企业培训视频,讲清【关键操作或规范】",eventTeaser:"生成【活动名称】20 秒预热视频,包含亮点、时间地点和报名信息"}},firstFrame:"首帧",videoToEdit:"待编辑视频",baseVideo:"基础视频",optimizeSkillPlaceholder:"描述你想优化的技能…",createSkillPlaceholder:"描述你想生成的技能…",createVideoPlaceholder:"描述你想创作的视频…",messageAgentPlaceholder:"向 {{name}} 发消息…",selectAgentFirst:"请先选择智能体",selectSkillFirst:"请先选择需要优化的 Skill",availableSkills:"可用技能",availableSubagents:"可用子 Agent",invokeSkill:"调用技能",useSubagent:"使用子 Agent",loadingCapabilities:"正在读取 Agent 能力…",noMatchingSkills:"当前 Agent 没有匹配技能",noMatchingSubagents:"当前 Agent 没有匹配子 Agent",skillFallbackDescription:"加载并执行该技能",agentFallbackDescription:"将本轮交给该 Agent",skill:"技能",uploadImage:"上传图片",uploadDocument:"上传文档或 PDF",uploadVideo:"上传视频",taskMode:"任务模式",selectTaskMode:"选择任务模式",loadingGenerationModel:"正在加载生成模型",modelUnavailable:"模型不可用",cancelTask:"取消{{task}}任务",stopGenerating:"停止生成",viewVideoProgress:"查看视频生成进度",send:"发送",selectTaskType:"选择任务类型",enterprisePrompts:"{{task}}企业提示词",sessionId:"会话 ID",sessionIdLabel:"会话 ID:",initializing:"初始化中",copied:"已复制",copySessionId:"复制会话 ID",sessionIdCopied:"已复制会话 ID",disclaimer:"回答仅供参考",viewLogs:"查看日志"},LYe={selectAgent:"选择 Agent",noLocalAgents:"暂无本地 Agent。",searchRuntime:"搜索 Runtime 名称",mineOnly:"只看我创建的",noRuntimes:"暂无 Runtime。",unsupported:"不支持",createdByMe:"我创建的",connecting:"连接中…",connected:"已连接",connect:"连接",viewInfoFor:"查看 {{name}} 信息",viewInfo:"查看信息",agentAndRuntimeInfo:"Agent 与 Runtime 信息",detailType:"详情类型",agentInfo:"Agent 信息",runtimeInfo:"Runtime 信息",loadingAgentInfo:"读取 Agent 信息…",cannotLoadAgentInfo:"暂时无法读取 Agent 信息",unnamedAgent:"未命名 Agent",subagents:"子 Agent",tools:"工具",skills:"技能",previewUnsupported:"暂不支持预览",mountedComponents:"挂载组件",noMoreAgentInfo:"暂无更多 Agent 配置信息。",local:"本地",model:"模型",status:"状态",memoryMb:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",resources:"资源",version:"版本",loadingDetails:"读取详情…",environmentVariables:"环境变量",errors:{notFound:"该 Runtime 已不存在或列表信息已过期,请刷新列表后重试。",accessDenied:"当前账号无权访问该 Runtime,请检查所属 Project 和访问权限。",previewUnsupported:"该 Agent Server 版本暂不支持信息预览。",unavailable:"该 Runtime 暂时无法访问,请确认其状态为“就绪”后重试。",timeout:"加载超时,请重试"},componentKinds:{knowledgebase:"知识库",memory:"记忆",prompt_manager:"提示词管理",example_store:"样例库",run_processor:"运行处理器",tracer:"链路追踪",toolset:"工具集",plugin:"插件",other:"其他"},runtimeStatus:{ready:"就绪",unreleased:"未发布",running:"运行中",active:"运行中",creating:"创建中",pending:"等待中",deploying:"部署中",updating:"更新中",failed:"失败",error:"异常",stopping:"停止中",stopped:"已停止",deleting:"删除中",deleted:"已删除"}},MYe={agent:"智能体",agentTypes:{general:"通用智能体",mpa:"MPA 智能体",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"创建人",namedAgent:"{{name}} 智能体",storageLocation:"存储位置",currentBrowser:"当前浏览器",region:"地域",viewDeploymentProgress:"查看 {{name}} 部署进度",viewRuntimeDetails:"查看 {{name}} Runtime 详情",viewDetails:"查看 {{name}} 详情",time:"时间",remainingTime:"剩余时间",expiringSoon:"即将清空",sandboxRemaining:"{{hours}} 小时 {{minutes}} 分钟",wakeable:"已休眠",neverExpires:"永不过期",editDraftNamed:"编辑草稿 {{name}}",viewProgress:"查看进度",deleteDraftNamed:"删除草稿 {{name}}",recheckCompatibility:"重新检测 {{name}} 的对话兼容性",connectedNamed:"{{name}} 已连接",wakeAndChat:"唤醒 {{name}} 并开始对话",chatWith:"与 {{name}} 对话",waking:"唤醒中",deploying:"部署中",draft:"草稿",checking:"检测中",chatUnsupported:"不支持对话",checkFailed:"检测失败",creatorFilter:"创建人筛选",agentType:"智能体类型",searchAgents:"搜索智能体",handoff:"接力",agentList:"{{type}}列表",noMatchingAgents:"没有匹配的智能体",adjustSearch:"请尝试调整搜索或筛选条件",noAgentType:"暂无 {{type}}",noGeneralAgents:"暂无通用智能体",createGeneralAgentDescription:"创建一个通用智能体,开始构建和对话",createAgentType:"创建{{type}}",createAgent:"创建智能体",loadingMore:"正在加载更多智能体",scrollForMore:"继续下滑加载更多",allLoaded:"已加载全部智能体",deleteDraftTitle:"删除草稿?",deleteDraftDescription:"删除后将无法恢复“{{name}}”。",deleteDraft:"删除草稿",loadGeneralAgents:"加载通用智能体",loadAgentType:"加载 {{type}}",compatibility:{checking:"正在请求 Runtime /list-apps,以确认该智能体是否支持 Studio 对话。",empty:"Runtime /list-apps 未返回可用的 Agent,暂时无法连接对话。",supported:"Runtime 支持 Studio 对话。",unknownError:"Runtime /list-apps 请求失败,未返回可识别的错误信息。"},sandboxStatus:{ready:"就绪",wakeable:"已休眠",creating:"创建中",starting:"启动中",initializing:"启动中",pending:"等待中",running:"运行中",failed:"异常",error:"异常",stopped:"已停止",expired:"已过期",deleting:"删除中",deleted:"已删除",unknown:"未知状态"},wakingHint:"正在唤醒智能体,可能需要一些时间。",mpaCreate:{maxInstance:"最大实例数",maxInstanceHelp:"默认 {{maximum}},为 Runtime 自动扩容的实例数上限。",maxInstanceInvalid:"最大实例数必须为大于或等于 1 的整数。",name:"名称",namePlaceholder:"例如 test-agent",nameHelp:"作为 Runtime 名称,支持 4–64 位字母、数字、下划线或连字符。",stepsLabel:"创建步骤",steps:{basics:"基本信息",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"数据库"},next:"下一步",previousStep:"上一步",pgDescription:"选择已有的 PostgreSQL 实例。创建流程会在该实例中准备智能体的独立业务库。",pgSplitDescription:"使用已配置的业务 PG Workspace。多个智能体共用此 Workspace,每个智能体拥有独立业务库。共享资源记录单独存放在 mpa_admin_workspace / mpa_admin_db,由管理员配置。",pgConsoleByteplus:"前往 BytePlus AIDAP 创建或查看 PG Workspace",pgConsole:"前往火山引擎 AIDAP 创建或查看 PG Workspace",pgHost:"PG 主机地址",pgPort:"PG 端口",pgInvalid:"请填写有效的 PG 主机地址和端口。",pgCredentials:"PG 连接账号和密码由部署服务配置;主机和端口须与服务端配置一致。",openvikingDescription:"可选。三项全部填写才启用 OpenViking;全部留空则不向新智能体注入 OpenViking 配置。",openvikingConsoleByteplus:"前往 BytePlus 查看 OpenViking 资源",openvikingConsole:"前往火山引擎查看 OpenViking 资源",openvikingUrl:"OpenViking 服务地址",openvikingResourceId:"OpenViking 资源 ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"请同时填写有效的 HTTPS 服务地址、资源 ID 和 API Key,或全部留空。",openvikingCredentials:"API Key 仅用于本次创建,不保存到浏览器草稿;刷新页面后需重新填写。",tosTitle:"会话输出存储",tosDescription:"可选。选择存储桶,持久保存每个会话的输出目录,使用沙箱 IAM Role 鉴权。未选桶时文件保存在沙箱本地目录。",tosBucket:"TOS 存储桶",tosInvalid:"请选择以 agentkit-platform- 开头的可用存储桶。",tosCredentials:"创建时为共享角色追加所选桶的会话输出访问权限,使用该角色的其他运行时和沙箱也将获得相同权限。",tosDisable:"清除桶选择",tosBucketUnavailable:"当前部署账号或地域无法使用该桶,请从列表选择存储桶后重试。",runtimeImage:"MPA 镜像",workerImage:"Worker 镜像",imageDefault:"留空使用配置文件中的默认镜像",imageInvalid:"请输入有效的镜像地址,不要包含网址、空格或登录凭据。",title:"创建 MPA 智能体",agentId:"智能体 ID",description:"描述",region:"部署地域",plan:"创建计划",sharedResources:"准备或复用账号共享 VPC、子网和 APIG 消息网关",agentResources:"准备独立业务库、技能空间和执行环境,部署智能体",readiness:"检查网关和智能体就绪状态,成功后加入列表",checking:"正在检查创建配置…",configured:"创建配置已就绪。提交后会检查云资源并开始准备。",notConfigured:"尚未配置创建所需的资源参数,请联系管理员配置后重试。",loadFailed:"检查创建配置失败,请重试。",reload:"重新检查",submit:"开始创建",retry:"重试创建",newAgent:"新建另一个智能体",newAgentDescription:"新建另一个智能体将开启可编辑的新请求,替换当前恢复草稿,但不会取消旧任务。旧任务仍在运行时,请等待其结束后再提交。",close:"关闭",cancel:"取消创建",confirmCancel:"确认取消",cancelDescription:"取消后会停止后续步骤。已创建的数据库、技能空间、网关和其他已登记资源会保留,可使用同一智能体 ID 重试。",background:"关闭窗口后创建会继续。再次打开可查看进度。",pollFailed:"暂时无法获取进度,正在重新连接。请勿重复创建其他智能体。",iamPermissionDenied:"部署服务没有准备运行角色所需的 IAM 权限,请联系管理员授权后重试。",iamTrustConflict:"运行角色的信任关系不符合要求,请管理员检查对 VeFaaS 和 APIG 的授权后重试。",iamPolicyConflict:"运行角色所需的同名权限策略内容冲突,请管理员检查后重试。",iamOwnershipConflict:"运行角色与当前部署账号不匹配,请管理员检查后重试。",iamTemporaryFailure:"IAM 请求在重试后仍暂时失败或超时,请检查 Studio 网络连接及 IAM 服务后,用同一智能体 ID 重试。",iamVerificationFailed:"尚未确认运行角色的权限已就绪,请检查 IAM 服务及策略可用性后重试。",iamConfigurationConflict:"自动准备运行角色仅支持默认 MPA 角色,请检查服务端创建配置。",creationFailed:"当前步骤未完成,请检查对应资源、服务端配置及权限后,用同一智能体 ID 重试。",configurationChanged:"此智能体的创建配置已与上次提交不一致。请恢复原配置后重试,或新建另一个智能体请求。",cancelFailed:"取消请求失败,请重新查询进度后重试。",cancelled:"创建已取消,已登记资源保留供重试。",timeout:"创建超时,已登记资源保留。请检查对应资源后重试。",interrupted:"创建任务中断。请用同一智能体 ID 重试以恢复已登记资源。",skillSpace:"技能空间",states:{running:"正在创建",cancelling:"正在取消",succeeded:"创建成功",failed:"创建失败",cancelled:"已取消"},stages:{queued:"等待开始",iam_role:"准备运行角色",checking:"检查账号与配置",network:"准备 VPC 和子网",gateway:"准备 APIG 和 IM Gateway",database:"准备业务数据库",skills:"准备技能空间",worker:"准备执行环境",deploying:"准备数据库、技能空间和 Runtime",verifying:"等待智能体就绪",admin_workspace:"准备管理 PG Workspace",business_workspace:"准备业务 PG Workspace",admin_database:"初始化共享管理库",openviking:"准备 OpenViking 库",openviking_key:"准备 OpenViking 访问凭证"},back:"继续创建",pgAutoDescription:"使用 VeADK 部署账号自动创建或复用两个 PG Workspace:mpa_admin_workspace / mpa_admin_db 存放共享资源记录,业务 Workspace 供多个智能体共用,每个智能体拥有独立业务库。无需填写 PG 连接信息,提交创建后开始准备。",pgPerAgentDescription:"创建流程会复用共享管理 Workspace,并为此智能体准备独立的业务 PG Workspace 和数据库。已有任务重试沿用原数据库。",pgAidbDescription:"创建流程会复用共享管理 Workspace,并为此智能体准备独立业务 Workspace 和 aidb 数据库。业务 Workspace 使用 mpa_agent_<智能体名称> 命名。已有任务重试沿用原数据库。",runtimeNameTaken:"该名称已被 Runtime、沙箱模板、业务 Workspace 或正在创建的任务占用,请更换名称。",runtimeNameCheckFailed:"暂时无法检查名称,请确认资源查询权限和网络后重试。",pgModeChanged:"此创建任务使用旧的 PG 配置,不能直接切换为自动模式重试。请联系管理员确认已有资源和任务后重新创建。",pgMigrationRequired:"检测到旧共享注册库。请先将共享资源记录迁移到 mpa_admin_workspace / mpa_admin_db,并完成现有 Runtime 的注册库地址切换;完成后点击“重新检查”。",openvikingAutoDescription:"将为此智能体创建独立 OpenViking 库,使用默认模型并自动准备连接配置。",openvikingAutoByteplusDescription:"将在 BytePlus 柔佛为此智能体创建个人版 OpenViking 库,并自动准备连接配置。重试将复用已登记的库。",openvikingAutoByteplusRequirements:"使用 MPA 的 ModelArk API Key 和管理员配置的 VLM、Embedding 推理接入点。个人库只有 default 用户;Runtime 镜像须适配该模式及海外数据面后,才能使用记忆功能。取消或删除智能体后,库会保留。",openvikingModelEndpointsInvalid:"请联系管理员在 Studio 服务端配置有效的 OV_VLM_ENDPOINT_ID 和 OV_EMBEDDING_ENDPOINT_ID 后重试。",openvikingAutoBilling:"企业版按量计费,建库成功后开始计费。重试此智能体将复用已登记的库。",openvikingPermissionDenied:"无权准备 OpenViking。请检查部署账号的建库、查询和获取 API Key 权限后重试。",openvikingConfigurationConflict:"OpenViking 的归属或配置与此智能体不一致,请核对登记的库后重试。",openvikingCreateUnknown:"OpenViking 创建结果尚未确认。请管理员核对云端库并补齐登记的资源 ID 后重试;不会自动重复建库。",openvikingNotReady:"OpenViking 仍在初始化,请稍后重试此智能体,将继续使用同一个库。",openvikingResourceFailed:"OpenViking 初始化失败,请在控制台检查库状态及模型配置后重试。",openvikingResourceMissing:"未找到已登记的 OpenViking 库或默认用户,请检查绑定及资源状态后重试。",openvikingModelConfigurationRejected:"平台拒绝了默认模型配置或建库参数,请检查 OpenViking 模型可用性及账号开通情况后重试。",openvikingUnavailable:"暂时无法连接 OpenViking,请检查服务及网络后重试。",openvikingInvalidResponse:"OpenViking 返回的配置不完整或无效,请检查库及默认用户后重试。",openvikingQuotaExceeded:"OpenViking 配额不足或请求过于频繁,请调整配额或稍后重试此智能体。"}},IYe={library:"技能库",skill:"技能",skills:"技能",skillSpace:"技能空间",sandboxNotConfigured:"管理员未配置 Dev Sandbox",adminNotConfigured:"管理员未配置",totalItems:"共 {{count}} 项",cannotLoadSpaces:"无法加载技能空间",someSpacesFailed:"部分技能空间加载失败",degradedRelationWarning:"部分关联异常,已恢复可读取技能",downloadZip:"下载 ZIP",optimize:"优化",closeSkillDetails:"关闭技能详情",skillId:"技能 ID",allFiles:"完整文件",loadingSkillContent:"正在读取技能内容…",noSkillContent:"该技能暂无 SKILL.md 内容",addSkill:"添加技能",localUpload:"本地上传",localUploadDescription:"选择 ZIP 文件,校验通过后上传到技能空间",autoCreate:"自动创建",autoCreateDescription:"选择模型和风格,通过对话生成技能",createSkill:"创建技能",optimizeNamed:"优化 {{name}}",deleteSkillConfirm:"确定删除整个 Skill“{{name}}”吗?此操作会影响所有引用它的空间。",deleteSpaceConfirm:"确定删除 Skill 空间“{{name}}”吗?请先确认空间中的技能已删除。",manageSpaceDescription:"管理空间中的技能并创建新的版本",backToSpaces:"返回技能空间列表",overview:"概览",skillCount:"技能数量",skillCountValue_one:"{{count}} 技能",skillCountValue_other:"{{count}} 技能",updatedAt:"更新时间",skillsInSpace:"{{name}}中的技能",searchSkills:"搜索技能",cannotLoadSkills:"无法加载技能",noMatchingSkills:"没有匹配的技能",noSkills:"暂无技能",tryAnotherName:"请尝试搜索其他名称",emptySkillsDescription:"本地上传 Skill,或自动创建",actions:"操作",spaceDetails:"技能空间详情",editSpace:"编辑空间",deleteSpace:"删除空间",searchSpaces:"搜索技能空间",spaceList:"技能空间列表",noMatchingSpaces:"没有匹配的技能空间",createSpace:"新建技能空间",newSpace:"新建空间",loadingMoreSpaces:"正在加载更多技能空间",scrollForMore:"继续下滑加载更多",allSpacesLoaded:"已加载全部技能空间",errors:{loadSpaces:"读取技能空间失败,请稍后重试",loadSkills:"读取技能失败,请稍后重试",loadSkillDetails:"读取技能详情失败,请稍后重试",deleteSkill:"删除 Skill 失败",deleteSpace:"删除 Skill 空间失败",downloadSkill:"下载 Skill 失败"},status:{active:"可用",available:"可用",creating:"创建中",disabled:"已停用",enabled:"已启用",failed:"异常",inactive:"未启用",pending:"等待中",published:"已发布",ready:"就绪",released:"已发布",running:"运行中",success:"正常",unavailable:"不可用",unreleased:"未发布",updating:"更新中",unknown:"未知"},sharedSpace:"企业共享空间",sharedDescription:"面向企业全员开放的技能,由管理员统一发布和维护",sharedVisibility:"全员可见",sharedPreparing:"正在准备共享空间",sharedLoadFailed:"共享空间加载失败",sharedEmpty:"暂无共享技能,管理员发布后会显示在这里",requestPublication:"申请公开",reviewSubmitting:"提交中…",reviewSubmitted:"已申请",reviewFailed:"申请公开失败",reviewStatusFailed:"审核状态加载失败",reviewRetry:"重新申请",reviewPending:"待审核",reviewApproving:"发布中",reviewApproved:"已公开",reviewReturned:"已退回",reviewHistory:"审核记录",skillDetailSections:"技能详情内容",versions:{title:"版本管理",refresh:"刷新",uploading:"上传中…",upload:"上传新版本",close:"关闭",hint:"新版本不会替换已公开版本,审核通过后才会公开;ZIP 中的技能名称需与原技能一致",loading:"正在加载版本…",loadFailed:"无法加载版本",filesFailed:"无法加载版本文件",uploadFailed:"上传新版本失败",submitFailed:"提交申请失败",retry:"重试",empty:"暂无版本",current:"当前版本",notSubmitted:"未申请公开",submitting:"提交中…",submit:"申请公开",processing:"版本状态:{{status}}",filesLoading:"正在加载文件…",filesEmpty:"暂无文件",history:"历史审核记录",shared:"已公开"},author:"作者",authorName:"作者:{{name}}"},PYe={library:"知识库",createBase:"新建知识库",editBase:"编辑知识库",invalidName:"名称必须以字母开头,且只能包含字母、数字和下划线。",nameHelp:"以字母开头,仅支持字母、数字和下划线,最多 48 个字符。",optionalDescription:"描述(可选)",descriptionOnly:"AgentKit 当前仅支持更新知识库描述。",previewWeb:"预览网页内容",addData:"添加数据",openOriginalWeb:"打开原网页",backToEdit:"返回修改",confirmAdd:"确认添加",source:"知识来源",image:"图片",documentFile:"文档文件",webPage:"在线网页",webUrl:"网页 URL",generatingWebPreview:"正在抓取网页并生成 Markdown 预览",selectFile:"选择知识文件",selectOrDropFile:"选择文件或拖拽到这里",selectedFile:"{{size}} · 点击可重新选择",imageFileHelp:"支持 PNG、JPG 和 JPEG,单个文件不超过 200 MB",documentFileHelp:"支持 PDF、PPTX、DOCX、XLSX 和 TXT,单个文件不超过 200 MB",uploadingFile:"正在上传文件并添加到知识库",optionalName:"名称(可选)",optionalType:"类型(可选)",generatePreview:"生成预览",uploadFile:"上传文件",editMetadata:"编辑知识 Metadata",knowledge:"知识",field:"字段",value:"值",backToList:"返回知识库列表",metadataJson:"元数据(JSON)",provider:"服务提供方",knowledgeId:"知识库 ID",project:"项目",creator:"创建者",data:"数据",deleteInvalidAssociation:"删除失效关联",noData:"这个知识库还没有数据",addFirstData:"添加第一项数据",format:"格式",size:"大小",searchData:"搜索数据",searchLibraryData:"搜索知识库数据",associationInvalid:"关联已失效",providerMissing:"底层 Provider 知识库已不存在",noMatchingData:"没有匹配的数据",loadingMoreData:"正在加载更多数据",retryLoading:"重试加载",details:"知识库详情",searchBases:"搜索知识库",someBasesFailed:"部分知识库暂时无法加载,已展示其余可用内容。",noMatchingBases:"没有匹配的知识库",noManagePermission:"您没有管理此知识库的权限",loadingMoreBases:"正在加载更多知识库",deleteBaseTitle:"删除知识库?",deleteBaseDescription:"将删除 {{name}} 的 AgentKit 关联;如果它由 Studio 创建,也会同时删除 Provider 资源。此操作无法撤销。",deleteDocumentTitle:"删除知识?",deleteDocumentDescription:"将从 Provider 知识库中删除 {{name}},此操作无法撤销。",preview:{processingTitle:"数据正在处理中",processingDetail:"知识库完成解析后即可预览,请稍后重新加载。",failedTitle:"数据解析失败",failedDetail:"请检查源文件或网页地址后重新添加,也可以重新加载最新状态。",noParsedTitle:"暂时没有可预览的解析内容",noParsedDetail:"此类文件会在知识库完成解析后显示文本、表格或页面图片。",noMediaTitle:"暂时没有可预览的媒体内容",noMediaDetail:"知识库尚未返回可访问的媒体预览,请稍后重新加载。",noDataTitle:"暂无可预览的数据内容",noDataDetail:"知识库尚未返回解析结果,请稍后重新加载。",attachmentError:"附件无法预览,请稍后重试。",imageAlt:"知识数据图片",audioUnsupported:"当前浏览器不支持音频预览。",videoUnsupported:"当前浏览器不支持视频预览。",namedPdf:"{{name}} PDF 预览",pdf:"PDF 预览",openPdf:"无法显示时,在新窗口打开 PDF",fileUnsupported:"当前格式暂不支持直接在线预览,已优先显示解析后的内容。",openOriginalFile:"打开原文件",loading:"正在加载数据预览",openOriginalHint:"您可以打开原网页查看来源内容。",chunk:"片段 {{index}}",loadingMore:"正在加载更多",loadMore:"加载更多"},errors:{fileTooLarge:"单个文件不能超过 200 MB",invalidImageType:"请选择 PNG、JPG 或 JPEG 图片",invalidDocumentType:"请选择 PDF、PPTX、DOCX、XLSX 或 TXT 文件",createBase:"创建知识库失败",updateBase:"更新知识库失败",metadataObject:"Metadata 必须是 JSON 对象",metadataFormat:"Metadata 格式错误",noWebPreview:"网页没有可预览的 Markdown 内容",addWeb:"添加网页失败",previewWeb:"生成网页预览失败",uploadFile:"上传文件失败",updateDocument:"更新知识失败",loadPreview:"加载数据预览失败",loadMoreBases:"加载更多知识库失败",loadBases:"加载知识库失败",loadMoreData:"加载更多数据失败",loadData:"加载数据失败",deleteBase:"删除知识库失败",deleteDocument:"删除知识失败"}},NYe={title:"飞书渠道",refresh:"刷新",loading:"正在加载渠道配置…",unsupported:"此 Runtime 不支持渠道管理,请升级 MPA 镜像。",unauthorized:"渠道管理需要 Studio 管理员身份及有效的 Runtime 凭据。",configurationError:"渠道管理配置不完整,请检查 Runtime 元数据及加密密钥。",requestFailed:"渠道请求失败,请检查 Runtime 连接后重试。",bound:"已绑定:{{name}}",unbound:"尚未绑定飞书机器人。",guidance:"私聊使用独立会话。在已授权群内 @ 当前机器人即可对话。",keyRequired:"绑定前请在 Runtime 配置持久的 CHANNEL_STATE_ENCRYPTION_KEY。",gateway:"消息网关",route:"入站路由",delivery:"回复投递",configured:"已配置",missing:"未配置",delivery_not_observed:"尚未观测",delivery_delivered:"已投递",delivery_retrying:"重试中",missingConfig:"缺少 Runtime 配置:{{fields}}",bind:"扫码绑定",newQr:"重新生成二维码",unbind:"解除绑定",confirmUnbind:"确认解绑此机器人?解绑后将停止接收新消息。",qrAlt:"机器人绑定二维码",openQr:"打开授权页面",uncertain:"注册过程已中断。重新开始前,请检查机器人绑定与 Gateway 状态。",bindingFailed:"绑定失败,请检查 Gateway 配置后重试。",chatId:"允许的群 ID",scope:"群会话策略",saveGroup:"保存群权限",noGroups:"尚未授权任何群。私聊无需群权限。",edit:"编辑",remove:"移除",removeGroup:"移除 {{name}}",scope_group_sender:"按发言人隔离",scope_group:"全群共享",scope_group_topic_sender:"按话题和发言人隔离",scope_group_topic:"按话题共享",status_PENDING:"等待扫码",status_SCANNED:"已扫码,等待授权",status_AUTHORIZED:"已授权,准备注册",status_REGISTERING:"正在注册机器人",status_BOUND:"机器人已绑定",status_FAILED:"绑定失败",status_EXPIRED:"二维码已过期",workspaceTitle:"消息渠道",workspaceDescription:"连接消息平台,让用户直接与此智能体对话,并管理访问权限。",provider_feishu:"飞书",provider_wecom:"企业微信",provider_dingtalk:"钉钉",comingSoon:"暂未开放",unavailableDescription:"{{name}}的绑定与消息配置暂未开放。",runtimeRequired:"请先将此智能体部署到 Runtime,再配置消息渠道。",bindingTitle:"机器人绑定",connected:"已绑定",notBound:"未绑定",gatewayDescription:"用于接收渠道消息的网关配置。",routeDescription:"将渠道消息转发给当前智能体的路由配置。",deliveryDescription:"实际观测到的回复投递状态,完成配置不代表已成功投递。",groupsTitle:"群聊权限",groupsDescription:"添加允许访问此智能体的群。",providerBindingTitle:"绑定{{name}}",providerUnbound:"绑定{{name}}机器人,让用户通过消息与此智能体对话。",qrGuidance:"使用{{name}}扫码授权,Runtime 将保存机器人凭据并配置消息网关。",wecomGuidance:"使用企业微信扫码授权,或手动填写 Bot ID 和 Secret 绑定已有机器人。",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"绑定机器人",wecomScan:"扫码绑定",wecomAuthorizing:"等待企业微信授权…",cancelAuthorization:"取消授权",wecomPopupBlocked:"授权窗口被浏览器拦截,请允许弹窗后重试。",wecomAuthCancelled:"已取消企业微信授权,可以重新扫码。",wecomAuthTimeout:"企业微信授权已超时,请重新扫码。",wecomInvalidResult:"授权结果缺少 Bot ID 或 Secret,请重新授权或手动填写。",wecomAuthFailed:"企业微信授权失败,请重试或手动填写凭据。",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"当前镜像尚不支持{{name}}手动配置,请升级后使用;仍可使用极速配置。",pairingTitle:"消息渠道扫码配对",feishuPairingDescription:"如果已有连接机器人,飞书扫码并绑定成功后原有机器人会被替换,可选绑定存量机器人或新建机器人。",generatingQr:"正在生成配对二维码…",dingtalkGuidance:"使用钉钉扫码授权,或手动填写 Client ID 和 Client Secret 绑定已有机器人。",wecomPairingDescription:"将在企业微信授权窗口中重新扫码配对。新机器人绑定成功后会替换当前连接;取消授权或绑定失败不会解绑原机器人。",configurationMethod:"配置方式",quickSetup:"极速配置",manualSetup:"手动配置",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"填写已有{{name}}机器人的应用凭据,连接到当前智能体。",manualReplacement:"绑定成功后将替换当前机器人;取消或绑定失败不会解除现有绑定。",accountsTitle:"飞书机器人",account:"机器人",selectAccount:"请选择机器人",accountEnabled:"已启用",accountDisabled:"已停用",addAccount:"添加机器人",cancelAddAccount:"取消添加",enableAccount:"启用机器人",disableAccount:"停用机器人",noAccounts:"尚未绑定飞书机器人。",accountsFailed:"读取机器人列表失败,请重试。",accountConflict:"机器人账号存在歧义或配置冲突,请刷新并选择机器人。",multiBotPairingDescription:"绑定新的飞书应用会添加机器人;绑定相同 App ID 会更新对应机器人。",provider_lark:"Lark",larkPairingDescription:"使用 Lark 扫码授权机器人。当前配置成功前,已有机器人仍保持绑定。",larkAccountsTitle:"Lark 机器人",noLarkAccounts:"尚未绑定 Lark 机器人。"},Ndr=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:gYe,agentSelector:LYe,agentWorkspace:vYe,channels:NYe,cloudEnvironment:AYe,common:pYe,composer:DYe,default:{common:pYe,agentKitPromo:gYe,systemInfo:mYe,agentWorkspace:vYe,environmentCenter:yYe,deploymentSelect:bYe,deploymentError:xYe,studioBuildProgress:wYe,cloudEnvironment:AYe,githubCicd:SYe,feishuDeployment:TYe,deploymentResources:CYe,studioUpdate:kYe,projectPreview:OYe,workspace:EYe,resourceCollection:_Ye,skillSourcePicker:RYe,composer:DYe,agentSelector:LYe,myAgents:MYe,skillCenter:IYe,knowledge:PYe,channels:NYe},deploymentError:xYe,deploymentResources:CYe,deploymentSelect:bYe,environmentCenter:yYe,feishuDeployment:TYe,githubCicd:SYe,knowledge:PYe,myAgents:MYe,projectPreview:OYe,resourceCollection:_Ye,skillCenter:IYe,skillSourcePicker:RYe,studioBuildProgress:wYe,studioUpdate:kYe,systemInfo:mYe,workspace:EYe},Symbol.toStringTag,{value:"Module"})),BYe="用户管理",$Ye="{{count}} 位成员",FYe="用户",zYe="角色",UYe="账号状态",VYe="最近登录",GYe="操作",QYe="更改角色",HYe="关闭",WYe="保存角色",YYe="正在保存…",qYe="取消",jYe="返回",XYe="用户池",KYe="火山引擎 Identity",ZYe="搜索姓名、邮箱或用户 ID",JYe="搜索",eqe="筛选角色",tqe="全部角色",rqe="刷新",nqe="正在读取用户…",iqe="更新于 {{time}}",aqe="已将 {{name}} 设置为{{role}}",oqe="重试",sqe="你",lqe="初始超级管理员",cqe="初始超级管理员受保护,不能在此降级",uqe="保存后,对方刷新 Studio 即可使用新的权限",dqe="角色需要重新确认",hqe="没有匹配的用户",fqe="尝试其他关键词或角色",pqe="用户登录或加入当前用户池后会显示在这里",gqe="共 {{count}} 位用户",mqe="上一页",vqe="下一页",yqe="尚未登录",bqe="未提供",xqe={super_admin:"超级管理员",admin:"管理员",developer:"开发者",user:"普通用户"},wqe={super_admin:"管理所有资源,并管理用户和分配角色",admin:"管理 Studio 资源",developer:"开发智能体并管理自己的资源",user:"使用智能体和个人功能"},Aqe={EXTERNAL_PROVIDER:"正常",CONFIRMED:"正常",NORMAL:"正常",ENABLED:"正常",ACTIVE:"正常",UNCONFIRMED:"待验证",DISABLED:"已停用",FORBIDDEN:"已禁用",LOCKED:"已锁定",SUSPENDED:"已暂停",FORCE_CHANGE_PASSWORD:"需要修改密码"},Sqe={request_failed:"请求未完成,请刷新列表确认当前状态后重试",invalid_response:"用户服务返回异常,请刷新后重试",identity_unavailable:"暂时无法访问 Identity,请稍后重试或检查服务权限",identity_resource_missing:"用户或用户池已不存在,请刷新列表",super_administrator_required:"只有超级管理员可以管理用户",sign_in_required:"请登录后重试",user_not_in_pool:"当前账号不属于此用户池",user_disabled:"当前账号已停用",protected_administrator:"不能降低初始超级管理员的权限",cannot_demote_self:"不能降低自己的超级管理员权限",role_change_conflict:"角色已发生变化,请关闭弹窗并刷新列表后重试",cross_origin_request:"请在当前 Studio 页面内修改角色"},Bdr=Object.freeze(Object.defineProperty({__proto__:null,actions:GYe,allRoles:tqe,back:jYe,cancel:qYe,changeRole:QYe,close:HYe,default:{title:BYe,memberCount:$Ye,user:FYe,role:zYe,status:UYe,lastLogin:VYe,actions:GYe,changeRole:QYe,close:HYe,save:WYe,saving:YYe,cancel:qYe,back:jYe,pool:XYe,volcengineIdentity:KYe,searchPlaceholder:ZYe,search:JYe,filterRole:eqe,allRoles:tqe,refresh:rqe,loading:nqe,updatedAt:iqe,saved:aqe,retry:oqe,you:sqe,initialAdministrator:lqe,protectedExplanation:cqe,effectiveAfterRefresh:uqe,roleConflict:dqe,noUsers:hqe,tryAnotherSearch:fqe,poolEmpty:pqe,resultCount:gqe,previous:mqe,next:vqe,neverLoggedIn:yqe,unknown:bqe,roles:xqe,descriptions:wqe,states:Aqe,errors:Sqe},descriptions:wqe,effectiveAfterRefresh:uqe,errors:Sqe,filterRole:eqe,initialAdministrator:lqe,lastLogin:VYe,loading:nqe,memberCount:$Ye,neverLoggedIn:yqe,next:vqe,noUsers:hqe,pool:XYe,poolEmpty:pqe,previous:mqe,protectedExplanation:cqe,refresh:rqe,resultCount:gqe,retry:oqe,role:zYe,roleConflict:dqe,roles:xqe,save:WYe,saved:aqe,saving:YYe,search:JYe,searchPlaceholder:ZYe,states:Aqe,status:UYe,title:BYe,tryAnotherSearch:fqe,unknown:bqe,updatedAt:iqe,user:FYe,volcengineIdentity:KYe,you:sqe},Symbol.toStringTag,{value:"Module"})),Tqe="网站集成",Cqe="将 AgentKit Runtime 以悬浮聊天窗口嵌入网站",kqe="返回自动化列表",Oqe="添加网站",Eqe="正在加载 Runtime",_qe="选择 Runtime",Rqe="网站域名",Dqe="例如 xxxx.com 或 localhost:5173",Lqe="正在生成",Mqe="生成 Token",Iqe="已添加网站",Pqe="{{count}} 个",Nqe="{{count}} 个",Bqe="正在加载网站集成",$qe="还没有网站集成",Fqe="选择 Runtime 并输入网站域名即可生成 Token",zqe="引入方法",Uqe="将下面代码放到网页的 body 结束标签前",Vqe="已复制",Gqe="复制代码",Qqe="添加网站后会在这里生成引入代码。",Hqe="确定删除 {{domain}} 的网站集成吗?",Wqe={load:"加载网站集成失败",create:"创建网站集成失败",delete:"删除网站集成失败",noConversationalAgent:"该 Runtime 暂未发现可对话的 Agent"},Yqe={requestFailed:"请求失败 ({{status}})",greeting:"您好,有什么可以帮您?",sessionFailed:"无法建立对话会话",unauthorized:"当前网站未获得对话授权",conversationFailed:"对话请求失败,请稍后重试",open:"打开智能体对话",close:"关闭智能体对话",panelLabel:"智能体对话面板",assistant:"智能体助手",online:"在线对话"},$dr=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:Oqe,addedWebsites:Iqe,backToAutomations:kqe,confirmDelete:Hqe,copied:Vqe,copyCode:Gqe,default:{title:Tqe,description:Cqe,backToAutomations:kqe,addWebsite:Oqe,loadingRuntime:Eqe,selectRuntime:_qe,websiteDomain:Rqe,domainPlaceholder:Dqe,generating:Lqe,generateToken:Mqe,addedWebsites:Iqe,websiteCount_one:Pqe,websiteCount_other:Nqe,loadingIntegrations:Bqe,delete:"删除",emptyTitle:$qe,emptyDescription:Fqe,embedMethod:zqe,embedInstructions:Uqe,copied:Vqe,copyCode:Gqe,embedHint:Qqe,confirmDelete:Hqe,errors:Wqe,widget:Yqe},description:Cqe,domainPlaceholder:Dqe,embedHint:Qqe,embedInstructions:Uqe,embedMethod:zqe,emptyDescription:Fqe,emptyTitle:$qe,errors:Wqe,generateToken:Mqe,generating:Lqe,loadingIntegrations:Bqe,loadingRuntime:Eqe,selectRuntime:_qe,title:Tqe,websiteCount_one:Pqe,websiteCount_other:Nqe,websiteDomain:Rqe,widget:Yqe},Symbol.toStringTag,{value:"Module"})),qqe={types:{all:"全部类型",document:"文档",image:"图片",video:"视频"},previewArtifact:"预览 {{name}}",moreActions:"更多操作 {{name}}",actionMenu:"{{name}} 操作",download:"下载",downloading:"下载中",edit:"编辑信息",delete:"删除产物",previewFailed:"无法预览“{{name}}”:{{message}}",downloadStarted:"已开始下载 {{name}}",downloadFailed:"无法下载“{{name}}”:{{message}}",updated:"已更新 {{name}}",deleted:"已删除 {{name}}",deleteFailed:"无法删除“{{name}}”:{{message}}",typeFilter:"产物类型",searchAria:"搜索产物",searchPlaceholder:"搜索产物或会话",retry:"重试",close:"关闭",listAria:"产物列表",loadFailed:"产物加载失败",loadDetailFallback:"请检查存储配置后重试。",reload:"重新加载",noMatch:"没有找到匹配的产物",noArtifacts:"您还没有任何产物",searchHint:"请尝试搜索其他名称或切换类型",emptyHint:"聊天中生成的产物会自动显示在这里",columns:{name:"名称",source:"来源",updatedAt:"修改时间",actions:"操作"},loadingMore:"正在加载更多产物",unknownTime:"时间未知",preview:{close:"关闭预览",meta:"{{type}} / 版本 {{version}}",loading:"正在加载预览",alt:"{{name}} 预览",loadFailed:"预览加载失败,请稍后重试或下载查看",unsupported:"当前格式暂不支持在线预览,请下载查看",sourceAria:"产物来源",agent:"智能体",session:"会话",tool:"生成工具",createdAt:"生成时间",fileSize:"文件大小",tags:"标签",viewSession:"查看会话"},deleteDialog:{title:"删除产物?",description:"“{{name}}”将从产物库永久删除,聊天记录不会受到影响。",deleting:"删除中",confirm:"删除",close:"关闭删除确认框"},api:{withStatus:"{{message}}({{status}})",listFailed:"读取产物库失败",syncFailed:"同步聊天产物失败",updateFailed:"更新产物失败",deleteFailed:"删除产物失败",downloadFailed:"下载产物失败"}},jqe={unknownSource:"未知来源",unknownCreator:"未知创建者"},Xqe={nameRequired:"请输入产物名称",tooManyTags:"标签最多 {{max}} 个",tagTooLong:"单个标签不能超过 {{max}} 个字符",title:"编辑产物信息",subtitle:"内容文件不会被修改",close:"关闭编辑框",name:"名称",description:"描述",descriptionPlaceholder:"补充用途、版本或使用说明",tags:"标签",tagsPlaceholder:"使用逗号分隔,最多 {{max}} 个",cancel:"取消",saving:"保存中",save:"保存"},Kqe={change:{added:"新增",modified:"修改",deleted:"删除"},noChanges:"两个版本的源码没有差异",chooseFile:"从左侧选择文件以查看代码",compareTitle:"版本对比",workspaceTitle:"源码工作区",projectFallback:"Agent 项目",switchTheme:"切换源码主题",switchThemeTitle:"切换为{{theme}}主题",themes:{dark:"深色",light:"浅色"},closeWorkspace:"关闭源码工作区",close:"关闭",changedFiles:"变更文件",projectFiles:"项目文件",changes:"变更",files:"文件",openFiles:"打开的文件",noFileSelected:"未选择文件",comparisonDirection:"对比方向",before:"优化前",after:"优化后",loadingEditor:"正在加载编辑器…",changedFileCount_one:"{{count}} 个文件有变更",changedFileCount_other:"{{count}} 个文件有变更",fileCount_one:"{{count}} 个文件",fileCount_other:"{{count}} 个文件",lineCount_one:"{{count}} 行 · UTF-8",lineCount_other:"{{count}} 行 · UTF-8",viewSource:"查看源码",viewSourceAria:"查看和编辑项目源码"},Zqe={nav:"搜索",selectAgent:"请选择 Agent",checkingCapabilities:"正在检测 Agent 能力",notMounted:"当前 Agent 未挂载{{label}}",sources:{session:"会话",web:"网络",knowledge:"知识库",memory:"长期记忆"},webDescription:"通过 web_search 工具检索",backendLocal:"本地",failed:"搜索失败:{{message}}",placeholder:{selectAgent:"请先选择 Agent",web:"在网络中检索",knowledge:"在 {{name}} 中检索",knowledgeFallback:"当前 Agent 的知识库",memory:"在 {{name}} 中检索",memoryFallback:"当前用户的长期记忆",session:"在当前 Agent 的会话中检索"},sourceTypeAria:"搜索类型:{{label}}",notSelected:"未选择",sourceType:"搜索类型",selectSource:"选择搜索类型",noAgentHint:"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。",loadingCapabilities:"正在读取当前 Agent 的检索能力…",sourceUnavailable:"当前 Agent 未挂载该数据源",instructions:{web:"输入关键词后回车或点击按钮,通过 web_search 工具检索。",knowledge:"输入问题,检索当前 Agent 挂载的知识库。",memory:"输入线索,检索当前用户跨会话保存的长期记忆。",session:"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"},noResults:"未找到匹配“{{query}}”的结果。",knowledgeFragment:"知识片段 {{index}}",memoryFragment:"记忆片段 {{index}}"},Jqe={title:"开发者资源",sections:{documentation:{title:"相关链接",description:"查看开发文档与 AgentKit 常用入口"},bestPractices:{title:"最佳实践",description:"参考开发、调试与部署经验"},showcases:{title:"案例展示",description:"探索 AgentKit 应用案例"}},links:{veadkDocs:"VeADK 文档",cliDocs:"AgentKit CLI 文档",platformDocs:"AgentKit 平台文档",console:"AgentKit 控制台"},articles:{veadkDevelopment:{title:"使用 VeADK 开发并部署智能体",description:"使用 VeADK 构建 Agent,并部署至 AgentKit 智能体运行时。"},cliDevelopment:{title:"使用 AgentKit CLI 开发并部署智能体",description:"通过 AgentKit CLI 创建项目、调试 Agent,并完成部署。"},coverAlt:"{{title}}文章封面"},showcases:{researchAssistant:{title:"多智能体研究助手",description:"由多个专业 Agent 协同完成资料检索、分析和结论整理。"},multimodalAnalysis:{title:"多模态内容分析",description:"在统一会话中理解图片、文档和视频内容。"},customerService:{title:"智能客服工作台",description:"结合知识检索与工具调用处理复杂的客户服务任务。"},webSearch:{title:"联网搜索 Agent",description:"检索实时网页内容,并将信息整理为可追溯的回答。"},a2uiApp:{title:"A2UI 交互应用",description:"让 Agent 根据任务过程生成可交互的前端界面。"},previewAlt:"{{title}}界面预览"}},eje={title:"资源库",untitledSession:"未命名会话",categoryAria:"资源库分类",regionAria:"区域",tabs:{skills:"技能库",knowledge:"知识库",artifacts:"产物"}},tje={title:"管理 Agent",subtitle:"列出你有权管理的 AgentKit Runtime",mainAgentOnly:"仅显示主 Agent(控制面信息)。",deleteConfirm:'确定删除 Agent "{{name}}"?该 Runtime 将被永久删除。',regionFilterTitle:"按区域筛选",regionFilterAria:"区域筛选",regionAria:"区域",refresh:"刷新",loading:"加载中…",empty:"暂无你部署的 Agent。",connected:"已连接",connect:"连接到此 Agent",deleteRuntime:"删除该 Runtime",loadingDetail:"读取详情…",agentStructure:"Agent 结构",secretHidden:"敏感值不展示,可通过授权请求直接复制",revealSecret:"{{key}} 的敏感值",copySecret:"复制 {{key}} 的值",copy:"复制",copied:"已复制",copyFailed:"复制失败",notConfigured:"未配置",fields:{model:"模型",description:"描述",status:"状态信息",project:"项目",version:"版本",resources:"资源",memory:"记忆",tool:"工具",knowledge:"知识",mcpToolset:"MCP 工具集",updatedAt:"更新时间"},resource:{memory:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",concurrency:"并发 {{value}}"},environmentVariables:"环境变量",unnamed:"(未命名)"},rje={mainAgent:"主 Agent",subAgent:"子 Agent {{index}}",itemCount_one:"{{count}} 项",itemCount_other:"{{count}} 项",info:"Agent 信息",infoAndTopology:"Agent 信息与设置",loadingInfo:"正在读取 Agent 信息…",unnamedAgent:"未命名 Agent",agentsMd:"AGENTS.md",tools:"工具",toolList:"工具列表",studioTool:"Studio Tool",removeTool:"移除工具 {{name}}",remove:"移除",notConfigured:"未配置",addStudioTool:"添加 Studio 工具",addStudioToolHere:"在此对话中添加 Studio 工具",skills:"技能",skillList:"技能列表",addSkill:"添加技能空间技能",addSkillHere:"向此会话添加技能空间技能",skillMountNextTurn:"挂载的版本将在下一 Turn 开始时冻结。",previewUnsupported:"暂不支持预览",sessionEnvironment:"会话环境",environment:"环境",agentCanvas:"Agent 画布",topology:"结构拓扑",nodeKinds:{agent:"Agent",sandbox:"沙箱","worker-session":"Worker 会话","skill-space":"技能空间",skill:"技能","studio-tool":"Studio 工具",mcp:"MCP",environment:"环境",knowledge:"知识库","sub-agent":"子 Agent"},nodeStatuses:{configured:"已配置",mounted:"已挂载",running:"运行中",paused:"已暂停"},viewCanvasFullscreen:"全屏查看 Agent 画布",viewFullscreen:"全屏查看",executionCanvas:"Agent 执行画布",fullscreenExecutionCanvas:"全屏 Agent 执行画布",closeFullscreenCanvas:"关闭全屏画布",close:"关闭",capabilitiesSubtitle:"能力与协作拓扑",closeInfo:"关闭 Agent 信息",infoUnavailable:"暂时无法读取 Agent 信息。",refresh:"刷新信息",loadingSkills:"正在加载绑定技能…",sessionSkills:"本会话临时技能",noBoundSpace:"当前智能体未绑定技能空间。",noBoundSkills:"绑定的技能空间暂无技能。",loadFailed:"加载失败,请刷新重试。",accessDenied:"无权读取此信息。",documentUnsupported:"当前 Runtime 不支持 Studio 读取 AGENTS.md,请升级 Runtime 镜像。",skillsUnsupported:"当前 Runtime 未提供技能空间绑定信息。",skillsDegraded:"技能信息不完整,请刷新重试。",documentEditHint:"编辑最新版本。保存会发布新版本到此技能空间,可能影响使用它的其他智能体。运行中的会话可能需要等待缓存刷新或新建会话后生效。请保留 frontmatter 中的 name。",documentLoading:"正在加载 SKILL.md…",documentWritable:"可编辑",documentReadOnly:"只读:此空间或当前权限不允许编辑",documentLoadFailed:"无法加载 SKILL.md,请刷新重试。",documentSaveFailed:"未确认保存成功,已保留编辑内容。重试前请重新打开,检查当前版本。",documentConflict:"技能已有新版本。请复制当前修改,再重新打开编辑器,避免覆盖。",discardDocument:"放弃未保存的修改?",keepEditing:"继续编辑",discardChanges:"放弃修改",saveDocument:"保存为新版本"},nje={mountFailed:"挂载环境失败",closeDialog:"关闭环境弹窗",addTitle:"添加环境",description:"选择当前会话允许 Agent 使用的 Sandbox 环境",closeAdd:"关闭添加环境",searchAria:"搜索环境",searchPlaceholder:"搜索环境名称或能力",availableAria:"可用环境与工作区",loading:"正在读取可用环境…",noMatch:"没有匹配的环境或工作区",workspaces:"工作区",reuseAll:"复用工作区中的全部可用环境",availableEnvironmentCount_one:"{{count}} 个可用环境",availableEnvironmentCount_other:"{{count}} 个可用环境",selectWorkspace:"选择工作区 {{name}}",environments:"环境",includedByWorkspaces:"已由工作区 {{names}} 包含",nameSeparator:"、",selectEnvironment:"选择环境 {{name}}",selectedWorkspaceCount_one:"{{count}} 个工作区",selectedWorkspaceCount_other:"{{count}} 个工作区",coveredEnvironmentCount_one:"{{count}} 个环境",coveredEnvironmentCount_other:"{{count}} 个环境",selectionSummary:"已选择 {{workspaces}},覆盖 {{environments}}",cancel:"取消",mounting:"正在挂载…",confirm:"确认添加",mountedAria:"已挂载环境",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",removeWorkspace:"移除工作区 {{name}}",remove:"移除",removeEnvironment:"移除环境 {{name}}",add:"添加环境",addMore:"添加更多环境",addForSession:"为当前 Session 添加环境",loadingAvailable:"正在加载可用环境…",empty:"暂无可用的 AIO Sandbox 环境。"},ije={loading:{searching:"正在查找已有环境",creating:"环境初始化中",connecting:"正在连接已有环境"},initializationFailed:"AgentKit CLI 环境初始化失败,当前状态:{{status}}。",sessionExpired:"AgentKit CLI Session 不存在或已过期,请重试。",initializationTimeout:"AgentKit CLI 环境初始化超时,请稍后重试。",nonPersistent:"非持久化环境",recyclingHoursMinutes:"{{hours}} 小时 {{minutes}} 分钟后环境回收",recyclingMinutes:"{{minutes}} 分钟后环境回收",connectionError:`无法连接 Studio 服务,未收到服务端响应。 +{{value}}`,original:"原始错误:{{message}}",details:"详细信息"},uYe={ariaLabel:"Skill 文件树",viewSource:"查看源码",viewPreview:"查看预览",download:"下载",binaryFile:"二进制文件",bytes:"{{value}} 字节",binaryDescription:"当前接口仅返回文件元数据,可单独下载原文件。",metadata:"Skill 元数据",noFiles:"暂无文件"},dYe={close:"关闭",name:"名称",region:"地域",optionalDescription:"描述(可选)",cancel:"取消",create:"创建",creating:"创建中…",save:"保存",saving:"保存中…",upload:"上传",uploading:"上传中…",createSpaceTitle:"新建 Skill 空间",editSpaceTitle:"编辑 Skill 空间",uploadTitle:"上传到 {{name}}",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",archiveValidationFailed:"Skill ZIP 格式校验失败",uploadFailed:"上传 Skill 失败",dropzone:"拖拽 Skill ZIP 到这里",chooseLocalFile:"或点击选择本地文件",archiveHelp:"ZIP 根目录需要包含 SKILL.md,也可以只包含一层包装目录。选择后仅检查格式,不会自动上传。",validating:"正在检查文件格式…",validationPassed:"格式检查通过:{{name}},共 {{count}} 个文件"},hYe={styles:{concise:"简洁实用",strict:"严谨稳健",tutorial:"教程友好",automation:"自动化优先",custom:"自定义",customFallback:"自定义风格"},stages:{preparing:"正在准备 Dev Sandbox",ready:"Skill 已生成并通过格式校验",failed:"生成失败",cancelled:"已停止",validating:"正在校验 Skill 格式",packaging:"正在整理文件",generating:"正在生成 Skill",repairingAgain:"正在再次修复",autoRepairing:"正在自动修复({{attempt}}/{{max}})"},validation:{fallback:"Skill 格式校验未通过",repairInstruction:"只修复下面列出的 Skill 格式错误,不要改变原有用途和内容范围。",recheckInstruction:"修复后重新检查目录结构、SKILL.md frontmatter 和所有文本文件。",nameTooLong:"Skill 名称不能超过 64 个字符",invalidName:"Skill 名称只能包含小写字母、数字和连字符",modelTooLong:"模型 ID 不能超过 128 个字符",invalidModel:"模型 ID 只能包含字母、数字、点、下划线、连字符、斜杠和冒号"},errors:{loadCapability:"读取 Dev Sandbox 配置失败",autoRepair:"自动修复格式错误失败",pollCandidate:"读取候选方案状态失败,正在重试",createCandidate:"创建候选方案失败",refine:"继续调整失败",repairAgain:"再次修复格式错误失败",selectSpace:"请选择上传的 Skill Space",unsupportedRegion:"当前 Skill 地域不受支持",upload:"上传 Skill 失败",download:"下载失败"},sessionMax:"Session 最长保留 1 小时",remaining:"剩余 {{minutes}}:{{seconds}}",unnamedSpace:"未命名 Skill Space",leaveConfirmation:"离开后将停止并释放正在运行的 Dev Sandbox,确定离开吗?",createTitle:"创建技能",optimizeTitle:"优化 {{name}}",skillFallback:"技能",back:"返回技能空间",home:"主页技能生成",basicInfo:"基本信息",goal:"目标",createIntentPlaceholder:"描述希望这个 Skill 完成什么任务",optimizeIntentPlaceholder:"描述希望如何优化当前 Skill",skillName:"Skill 名称",autoNamePlaceholder:"留空时自动生成",nameHelp:"仅支持小写字母、数字和连字符;留空时自动生成。",createPlans:"生成方案",optimizePlans:"优化方案",createPlansDescription:"按不同方案并行生成多个技能,您可以选择最佳结果",optimizePlansDescription:"按不同方案并行优化当前技能,您可以选择最佳结果",plan:"方案 {{count}}",remove:"移除",model:"模型",modelPlaceholder:"选择或输入模型 ID",style:"风格",customStyle:"自定义风格",customStylePlaceholder:"描述表达方式、严谨程度或输出偏好",addConfiguration:"添加配置",notConfigured:"管理员未配置",generate:"生成",candidates:"候选方案",progress:"进度",retryCandidate:"重试此方案",formatValidationFailed:"格式校验未通过",repairAgain:"再次修复",files:"文件",downloadZip:"下载 ZIP",loadingFiles:"正在读取文件…",filesPending:"生成过程中会在这里显示完整文件树",uploadToSpace:"上传到 Skill Space",loadingSpaces:"正在加载 Skill Space",selectSpace:"选择 Skill Space",continuePlaceholder:"继续调整这个候选方案",continue:"继续调整",uploading:"上传中…",overwrite:"覆盖原 Skill",uploadToSelectedSpace:"上传到 Skill Space",uploadToCurrentSpace:"上传到当前空间",allCandidatesFailed:"所有方案均创建失败,可分别重试。"},fYe={invalidFormat:"{{label}}格式错误。",recoveryStatus:"Skill 恢复点状态",errorResponse:"错误响应",errorDetails:"错误详情",missingContentType:"Content-Type 缺失",gatewayError:"{{fallback}}(HTTP {{status}},Content-Type: {{contentType}})。请检查代理或网关配置。",nonJson:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}},Content-Type: {{contentType}}),请检查代理或网关配置。",activity:"Skill 会话活动",invalidActivity:"Skill 会话活动格式错误。",invalidToolActivity:"Skill 工具活动格式错误。",invalidTextActivity:"Skill 文本活动格式错误。",publication:"Skill 发布结果",task:"Skill 会话",file:"Skill 文件",unknownTaskState:"Skill 会话状态无法识别。",capability:"Skill 工作台能力",loadCapability:"读取 Skill 工作台能力失败",prepareTask:"准备 Skill 会话失败",taskReference:"Skill 会话引用",startOptimization:"开始优化 Skill 失败",startTask:"开始 Skill 会话失败",taskSummary:"Skill 会话摘要",taskList:"Skill 会话列表",loadTaskList:"读取 Skill 会话列表失败",invalidTaskList:"Skill 会话列表格式错误。",loadTask:"读取 Skill 会话失败",artifact:"Skill 产物",artifactFile:"Skill 产物文件",loadArtifact:"读取 Skill 产物失败",refine:"继续调整 Skill 失败",stop:"停止当前 Skill 任务失败",publish:"发布 Skill 失败",nonNdjson:"发布 Skill 失败:服务端返回了非 NDJSON 响应。",missingStream:"发布 Skill 失败:服务端没有返回进度流。",publishProgress:"发布进度",invalidPublishProgress:"发布进度格式错误。",publishError:"发布错误",unknownPublishEvent:"未知的发布进度事件。",publishResult:"发布结果",streamEnded:"发布进度流提前结束,无法确认发布结果。请刷新技能中心确认状态。",deleteTask:"删除 Skill 会话失败",download:"下载 Skill 失败"},Pdr=Object.freeze(Object.defineProperty({__proto__:null,api:fYe,configSelect:sYe,conversation:lYe,default:{configSelect:sYe,conversation:lYe,errorDetails:cYe,fileTree:uYe,management:dYe,generation:hYe,api:fYe},errorDetails:cYe,fileTree:uYe,generation:hYe,management:dYe},Symbol.toStringTag,{value:"Module"})),pYe={back:"返回上一页",reload:"重新加载",notConfigured:"未配置",name:"名称",description:"描述",delete:"删除",save:"保存",saving:"保存中",add:"添加",manage:"管理",environment:"环境",noDescription:"暂无描述",refresh:"刷新",close:"关闭",retry:"重试",loading:"加载中…",previousPage:"上一页",nextPage:"下一页",edit:"编辑",all:"全部",search:"搜索",cancel:"取消",view:"查看",viewDetails:"查看详情",deleting:"删除中…",create:"创建",creating:"创建中",adding:"添加中",generating:"生成中",uploading:"上传中",preview:"预览",loadFailed:"加载失败",select:"选择",collapse:"收起",expand:"展开",none:"无"},gYe={ariaLabel:"AgentKit 快速入口",closeAriaLabel:"关闭 AgentKit 欢迎卡片",title:"欢迎使用 AgentKit",description:"通过 AgentKit 平台快速构建与托管您的企业级智能体",docsAriaLabel:"打开 AgentKit 文档,在新窗口打开",docs:"文档",consoleAriaLabel:"打开 AgentKit 控制台,在新窗口打开",console:"控制台"},mYe={checkUpdates:"检查更新",checkingVersions:"正在检查版本…",versionCheckError:"查询沙箱版本失败,请检查凭据、区域及接口权限后重试",sandboxUpdateError:"Sandbox 更新失败,请刷新检查实际状态后重试",modelEnvRepairUnavailable:"无法补齐模型环境变量,请检查 CODEX_API_KEY 和 CODEX_BASE_URL",updateSandbox:"更新{{variant}}{{name}}",updatingSandbox:"更新中",title:"系统信息",description:"查看当前 Studio 版本及关联的基础资源",general:"通用",currentVersion:"当前版本",storage:"存储",loadingStorage:"正在加载存储信息",tosAddress:"TOS 地址",openTosConsole:"在云控制台中打开 TOS 存储桶",environmentBuild:"环境构建",loadingEnvironmentResources:"正在加载环境构建资源",environmentResourcesError:"环境构建资源加载失败,请检查云凭据后重试。",codePipelineWorkspace:"CodePipeline 工作空间",codePipelinePipeline:"CodePipeline 流水线",openCodePipelineWorkspace:"在云控制台中打开 CodePipeline Workspace",createdOnFirstBuild:"首次构建时自动创建",containerRegistryRepository:"Container Registry 仓库",openContainerRegistryRepository:"在云控制台中打开 Container Registry 仓库",sandboxInfo:"沙箱信息",loadingSandboxInfo:"正在加载沙箱信息",sandboxInfoError:"沙箱信息加载失败,请重试。",snapshot:"快照版",snapshotWithSpace:"快照版 ",openToolConsole:"在云控制台中打开{{name}}",updateModelEnv:"更新{{variant}}{{name}}模型环境变量",modelEnvUpdated:"已更新",modelEnvAlreadyCurrent:"无需更新",userPool:"用户池",loadingUserPool:"正在加载用户池",userPoolError:"用户池加载失败,请重试。",modelEnvUpdateError:"模型环境变量更新失败,请重试。",openUserPoolConsole:"在云控制台中打开用户池{{name}}",unnamedUserPool:"未命名用户池",id:"ID",domain:"域名",region:"区域",noLocalUserPool:"本地模式未配置用户池",noUserPool:"当前 Studio 未配置用户池"},vYe={workspace:"Agent 工作区",library:"Agent 库",evaluation:"评测",agentList:"Agent 列表",agentDetails:"Agent 详情",newAgent:"新建 Agent",loading:"加载中…",loadingCloudAgents:"正在加载云端 Agent…",noAgentSelected:"请选择一个 Agent",local:"本地",remote:"云端",localAgent:"本地 Agent",remoteAgent:"云端 Agent",agentCount:"{{count}} 个 Agent",agentCountLabel:"Agent 数量",details:"详情",chat:"对话",update:"更新",backToAgentList:"返回 Agent 列表",loadingAgent:"正在加载 Agent",loadingAgentDescription:"正在读取 Agent 配置和 Runtime 信息。",loadingAgentInfo:"正在加载 Agent 信息…",detailLoadFailed:"无法加载 Agent 详情",detailLoadFailedDescription:"请检查 Runtime 状态后重试。",partialInfoUnavailable:"部分信息暂时不可用",upgradeRuntimeForDetails:"请升级 Runtime 以查看完整 Agent 信息。",basicInfo:"基本信息",usageOverview:"使用概览",sections:{basic:"基本信息",profileConfig:"Profile 配置",sessionConfig:"会话配置",usage:"使用概览",diagnostics:"诊断",evaluations:"评测",optimizations:"优化建议",integrations:"集成",versions:"版本",channels:"消息渠道"},evaluationGroup:"评测组",optimizations:"优化建议",optimizationsDescription:"根据评测结果查看可执行的优化建议。",integrations:"集成",githubVersions:"GitHub 版本",githubVersionsDescription:"查看持续交付产生的版本并创建回退 PR。",currentVersionOnly:"当前未启用 GitHub 持续交付,仅展示当前生产版本。",loadingVersions:"正在加载版本…",noVersion:"暂无版本记录",prLink:"Pull Request",viewPr:"查看 PR",author:"提交人",publishStatus:"发布状态",viewRelease:"查看发布记录",rollbackToVersion:"回退到此版本",rollingBack:"正在创建回退…",rollbackEvent:"回退事件",sourceMergedRuntimeStill:"最新源码已合并,但 Runtime 仍处于",currentProductionVersionHint:";当前生产版本保持不变。",usageSummary:"使用统计",totalCalls:"总调用次数",userCount:"用户数",userDetails:"用户明细",usageUserList:"Agent 使用用户列表",user:"用户",callCount:"调用次数",lastUsed:"最近使用",unknownUser:"未知用户",loadingUsage:"正在加载使用数据…",refreshing:"刷新中…",noUsage:"暂无使用记录",usageUnavailable:"当前 Agent 暂无可用的使用统计。",usagePagination:"使用记录分页",pageOf:"第 {{page}} / {{total}} 页",notProvided:"暂未提供",integrationMethods:"集成方式",integrationDescription:"通过 Runtime API 或 A2A 协议集成当前 Agent。",integrationProtocol:"集成协议",runtimeStatus:"Runtime 状态",executionFlow:"执行流程",probingIntegration:"正在检测集成能力",probingIntegrationDescription:"正在读取可用端点和鉴权配置。",configurationStatus:"配置状态",discoveryEndpoint:"发现端点",invocationEndpoint:"调用端点",invocationUrl:"调用地址",authentication:"鉴权方式",networkAccess:"网络访问",notAvailable:"暂无",noAuthentication:"无需鉴权",noApiKeyRequired:"无需 API Key",usesOauthJwt:"使用 OAuth / JWT",showApiKey:"显示 API Key",hideApiKey:"隐藏 API Key",pythonExample:"Python 示例",deploymentConfig:"部署配置",deploymentConfigDescription:"确认实例和运行配置后更新 Runtime。",deploymentRegion:"部署区域",mpaControlPlane:"MPA 控制面",loadingMpaAgentView:"正在读取 MPA Runtime 绑定…",mpaRuntimeBound:"该 MPA Agent 已绑定唯一 Runtime,可继续管理。",mpaRuntimeMissing:"当前 Agent 没有可见的 MPA Runtime 绑定。",mpaRuntimeBindingAmbiguous:"多个 MPA Runtime 匹配当前 Agent,请先修复绑定后再修改。",mpaRuntimeOrphan:"Runtime 存在,但其中没有当前 MPA Profile。",mpaRuntimeLegacyAuthUnsupported:"该 Runtime 使用旧版 MPA 镜像,仍要求 X-Jwt-Token。请先更新到当前 AgentKit 兼容镜像,再管理 Profile 或 Session 配置。",profileConfig:"Profile 配置",profileConfigTitle:"Profile 配置",profileConfigDescription:"查看并应用 Agent 级 MPA Profile。Profile 是 Runtime 的长期默认配置,新会话默认继承它。",profileStatus:"Profile 状态",profileApplied:"已应用",profileNotApplied:"未应用",profileNotAppliedDescription:"当前 Runtime 可运行,但尚未保存为 Studio 可管理的 Profile。应用后会生成 Profile revision。",applyProfile:"应用 Profile",reapplyProfile:"重新应用 Profile",editProfile:"编辑 Profile",profileApplying:"应用中…",profileAppliedNotice:"Profile 已应用,当前 revision 为 {{revision}}。",profileApplyIncomplete:"Profile 应用未完成,请查看当前操作状态后重试。",profileApplyFailed:"Profile 应用失败。",profilePrompt:"系统提示词",profileResources:"资源配置",profileResourceSummary:"{{tools}} 个工具 · {{skills}} 个 Skill · {{mcp}} 个 MCP 服务",sessionConfigTitle:"会话配置",sessionConfigDescription:"查看和调整当前 MPA Session 的执行配置。变更只对下一轮对话生效。",loadingSessionConfig:"正在加载会话配置…",sessionConfigNoAgent:"请选择一个 MPA Agent 后再管理会话配置。",sessionConfigNonMpa:"会话配置仅适用于 MPA Agent。",sessionConfigNoSession:"请先打开这个 MPA Agent 的对话,再修改会话配置。",sessionConfigDifferentRuntime:"请先切回这个 MPA Agent 的当前对话,再修改会话配置。",sessionConfigSaved:"会话配置已更新,下一轮对话将使用新 revision。",sessionConfigStale:"该 Session 已被其他位置修改,已展示最新配置,请确认后再保存。",sessionConfigRevision:"配置 revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"最新 Profile revision",sessionProfileUpgradeAvailable:"检测到新的 Profile revision:v{{current}} → v{{target}}。",upgradeSessionProfile:"升级 Session Profile",sessionProfileUpgrading:"升级中…",sessionProfileUpgraded:"Session Profile 已升级,下一轮对话将使用新 revision。",sessionProfileUpgradeFailed:"Session Profile 升级失败。",sessionModelOverride:"模型覆盖",modelId:"模型 ID",inheritProfileDefault:"继承 Profile 默认值",sessionMcpServers:"MCP 服务",mcpServerCount:"已选择 {{count}} 个",clearSessionMcp:"清空 MCP 服务",mpaDiagnosticsTitle:"Runtime 诊断",mpaDiagnosticsDescription:"查看最近的 Runtime Console 运行记录,以及 Agent、Profile、Turn、task 和 worker 关联。",loadingMpaDiagnostics:"正在加载 Runtime 诊断…",noMpaDiagnostics:"当前 Session 暂无 Runtime 诊断运行记录。",latestRun:"最近运行",traceCorrelation:"Trace 关联",traceCorrelationDescription:"Runtime Console 为本次 invocation 返回的稳定标识。",traceSteps:"Trace 步骤",traceStepsDescription:"当前 invocation 最近的有界 Runtime Console 步骤。",mpaInstanceId:"MPA 实例",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker 类型",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile 版本",step:"步骤",stepCount:"步骤数",duration:"耗时",noTraceSteps:"本次 invocation 暂无 trace 步骤。",executionConfigMode:{replace:"Session 覆盖",clear:"本 Session 已清空",inherit:"使用 Profile 默认值"},concurrency:"并发数",selectedOptimizations:"已选优化项",selectedOptimizationsDescription:"这些优化会应用到本次更新。",optimizationProfile:"优化方案",updatePending:"等待更新",updatingDeployment:"正在更新部署",restoringUpdateConfig:"正在恢复更新配置…",updateConfigUnavailable:"无法读取更新配置",legacyConfigMissing:"旧版本 Runtime 缺少可恢复的配置,请重新创建。",deploymentFailed:"部署失败",continueEditing:"继续编辑",loadingOptimizations:"正在加载优化建议…",noOptimizations:"暂无优化建议",fixPriority:"优先级",suggestedModule:"建议模块",suggestionAndReason:"建议与原因",priority:{high:"高",medium:"中",low:"低"},modules:{agentStructure:"Agent 结构",prompt:"提示词",tool:"工具",knowledge:"知识库",memory:"记忆",workflow:"工作流",other:"其他"},evaluationGroupList:"评测组列表",newEvaluationGroup:"新建评测组",newEvaluationGroupName:"新评测组 {{count}}",searchEvaluationGroups:"搜索评测组",noMatchingEvaluationGroups:"没有匹配的评测组",noEvaluationGroupSelected:"请选择一个评测组",groupStats:"{{agents}} 个 Agent · {{runs}} 次运行",evaluationGroupDetails:"评测组详情",evaluationGroupStats:"{{agents}} 个 Agent · {{caseSet}} · {{runs}} 次运行",startEvaluation:"开始评测",evaluationConfig:"评测配置",historyResults:"历史结果",participatingAgents:"参与 Agent",selectedCount:"已选择 {{count}} 个",evaluationResources:"评测资源",evaluationSet:"评测集",evaluator:"评估器",caseCount:"{{count}} 条案例",evaluationMetrics:"评测指标",selectedMetricCount:"已选择 {{count}} 项",historyDescription:"查看每次评测的分数和运行状态。",noHistory:"暂无评测历史",noHistoryDescription:"运行一次评测后,结果会显示在这里。",evaluationRun:"第 {{index}} 次评测",evaluationRunMeta:"{{time}} · {{agents}} 个 Agent",overallScore:"综合分",completed:"已完成",evaluationDefaults:{coreRegression:"核心能力回归",safetyCheck:"安全与幻觉检查",coreSet:"核心回归集",safetySet:"安全边界集",toolSet:"工具调用集",qualityEvaluator:"综合质量评估器",factualEvaluator:"事实一致性评估器",toolEvaluator:"工具调用评估器",responseQuality:"回答质量",factualAccuracy:"事实准确性",toolUse:"工具调用",responseEfficiency:"响应效率",todayTime:"今天 10:32",yesterdayTime:"昨天 16:08",julyTime:"7 月 25 日 14:20",justNow:"刚刚"},defaultCases:{agentName:"示例 Agent",goodSetName:"示例正向案例集",badSetName:"示例负向案例集",weeklyFeedback:{input:"总结本周客户反馈,并按优先级归类。",output:"覆盖主要问题,给出清晰的优先级与下一步动作。",tag:"总结",reason:"任务完整覆盖了用户目标,输出结构清晰,并给出了可执行的下一步动作。"},research:{input:"查询最新公开资料并附上来源。",output:"调用搜索工具,结论与引用一一对应。",tag:"工具调用"},uncertainConclusion:{input:"在信息不足时直接给出确定结论。",output:"应明确说明未知,并主动询问缺失信息。",tag:"幻觉",reason:"信息不足时仍给出了确定结论,缺少必要的澄清步骤与不确定性说明。"},repeatedTool:{input:"连续重复调用相同工具获取同一结果。",output:"复用已有结果,避免无意义的重复调用。",tag:"效率"}},goodCases:"正向案例",badCases:"负向案例",goodCase:"正向案例",badCase:"负向案例",reference:"参考答案",caseResultFilter:"案例结果筛选",feedbackSourceFilter:"反馈来源筛选",searchCases:"搜索案例",searchCasesPlaceholder:"搜索输入、输出或标签",selectCases:"选择案例",selectAll:"全选",selectAllVisible:"选择当前可见案例",selectedCaseCount:"已选择 {{count}} 条",deleteSelected:"删除所选",deleteSelectedTitle:"删除所选 Agent",deleteSelectionDescription:"确定删除所选的 {{count}} 个项目吗?此操作无法撤销。",deleteCasesConfirm:"删除所选案例",deleteOneCaseConfirm:"删除这个案例",deleteFeedbackCase:"删除反馈案例",noFeedbackCases:"暂无反馈案例",noMatchingCases:"没有匹配的案例",loadingEvaluationSet:"正在加载评测集…",userInput:"用户输入",agentOutput:"Agent 输出",score:"得分",scoreReason:"评分原因",noUserInput:"暂无用户输入",noVisibleResponse:"暂无可见回复",note:"备注:",manualFeedback:"人工反馈",automaticFeedback:"自动反馈",scoreValue:"{{score}} 分",unknownTime:"时间未知",deleteAgentTitle:"删除 Agent",deleteAgentDescription:"确定删除 Agent“{{name}}”吗?",deleteDraftDescription:"确定删除草稿“{{name}}”吗?",deleteAgent:"删除 Agent",closeDeleteConfirmation:"关闭删除确认",mpaDeletePreviewSummary:"Studio 将清理可见的空闲会话、该 MPA 独占的沙箱模板和 Skill Space,最后删除 Runtime。数据库及共享资源保留;运行中的任务需先结束或停止。",mpaDeletePreviewSessions:"会话",mpaDeletePreviewActiveSessions:"运行中",mpaDeletePreviewIdleSessions:"空闲",mpaDeleteBlocked:"当前无法删除",mpaDeleteBlockerActiveOperation:"仍有 MPA 创建或更新操作在执行。",mpaDeleteBlockerActiveSessions:"Runtime 中仍有运行中的会话。",mpaDeleteBlockerBindingAmbiguous:"当前 Agent 匹配到多个 MPA Runtime。",mpaDeleteBlockerRuntimeMissing:"当前 MPA Agent 没有可见的 Runtime 绑定。",mpaDeleteBlockerOrphanRuntime:"Runtime 可见,但其中缺少当前 MPA Profile。",mpaDeleteStage:{runtime_sessions:"删除 {{count}} 个可见空闲 Runtime 会话",runtime_diagnostics:"清理这些会话关联的诊断数据和挂载元信息",agentkit_runtime:"删除 AgentKit Runtime",worker_template:"删除独占沙箱模板",skill_space:"删除独占 Skill Space(含空间内技能)"},draftDeletionWarning:"草稿将从当前浏览器中删除。",runtimeDeletionWarning:"Runtime 和相关云端资源将被删除。",noneSelected:"尚未选择",none:"无",notPublished:"未发布",notRecorded:"未记录",noTime:"暂无时间",noPr:"暂无 PR",comingSoon:"评测能力即将开放",preparing:"准备中",cancelled:"已取消",failed:"失败",totalCount:"共 {{count}} 条",deploymentProgress:"部署进度",returnToEdit:"返回编辑",retryOperation:"重试操作",buildLog:"构建日志",githubMountLog:"GitHub 挂载日志",githubDeliveryMountLog:"GitHub 持续交付挂载日志",waitingBuildLog:"正在等待构建日志…",waitingGithubMountLog:"正在等待 GitHub 挂载日志…",copy:"复制",copied:"已复制",copyLabel:"复制{{label}}",copiedLabel:"已复制{{label}}",logLines:"{{count}} 行",logStatus:{synced:"已同步",failed:"读取失败",syncing:"同步中",earlyOmitted:"已省略早期日志",recentOnly:"仅显示最近的构建日志",partiallyOmitted:"已省略部分日志"},deployStatus:{running:"正在部署",unconfirmed:"部署状态待确认",success:"部署完成",error:"部署失败",cancelled:"部署已取消"},deploymentSteps:{prepare:{label:"准备部署",description:"校验配置并创建部署任务"},build:{label:"构建镜像",description:"生成运行环境与智能体代码"},deploy:{label:"部署服务",description:"创建并启动 AgentKit Runtime"},publish:{label:"发布服务",description:"等待服务就绪并生成访问地址"},complete:{label:"部署完成",description:"智能体已可以正常使用"},evaluation:{label:"创建评测集",description:"自动创建 Good Case 和 Bad Case 评测集"},profileApplying:{label:"应用 MPA 配置",description:"将 Studio Agent 配置写入 MPA Runtime"},smokeRunning:{label:"验证 MPA Runtime",description:"在标记可运行前执行 Runtime 就绪验证"},runnable:{label:"MPA Runtime 可运行",description:"Runtime 已接受配置并通过执行就绪验证"},github:{label:"挂载 GitHub 持续交付",description:"初始化目标分支与 GitHub Actions workflow"},update:{label:"更新实例配置",description:"将 Runtime 实例数调整为 {{min}}~{{max}}"}},githubStatus:{published:"已发布",publishing:"发布中",failed:"发布失败",pending:"等待发布",unknown:"未知"},errors:{agentInfoMissing:"Agent 信息不可用",checkUpdateCapability:"无法检查更新能力",checkingUpdateConfig:"正在检查更新配置",cloudOnlyUpdate:"仅云端 Agent 支持更新",deleteDeployedUnsupported:"当前不支持删除已部署 Agent",deleteDraftUnsupported:"当前不支持删除草稿",loadMpaDeletePreview:"无法加载 MPA 删除预览",loadAgentInfo:"无法加载 Agent 信息",loadApiKey:"无法读取 API Key",loadGithubVersions:"无法加载 GitHub 版本",loadEvaluations:"无法加载评测案例",loadMpaAgentView:"无法加载 MPA Agent 状态",loadMpaDiagnostics:"无法加载 Runtime 诊断",loadOptimizations:"无法加载优化建议",loadRuntimeDetails:"无法加载 Runtime 详情",loadSessionConfig:"无法加载会话配置",loadUsage:"无法加载使用数据",noCreatePermission:"当前账号没有创建 Agent 的权限",noManagePermission:"当前账号没有管理此 Agent 的权限",originalConfigUnavailable:"原始配置不可用",probeIntegration:"无法检测集成能力",rollbackVersion:"无法创建版本回退",runtimeRegionMissing:"Runtime 区域信息缺失",updateCapabilityMismatch:"Runtime 更新能力与当前配置不匹配",updateCapabilityPending:"Runtime 更新能力仍在确认中",updateConfigRestoring:"正在恢复更新配置",updateUnsupported:"当前 Runtime 不支持更新",usageMismatch:"返回的使用数据与当前 Agent 不匹配"},mpaDeleteChecking:"正在检查会话和资源归属…",mpaDeleteRetryPreview:"重新检查",mpaDeletePreviewFailed:"删除前检查失败。请处理下面的错误后重新检查。",mpaDeleteRetained:"以下资源将保留",mpaDeleteRetainedReason:{shared:"有其他智能体引用",unproven:"无法确认是此智能体独占的受管资源"}},yYe={title:"环境",loadFailed:"环境加载失败,请检查存储配置后重试。",storageUnavailable:"管理员未配置持久化存储,环境管理暂不可用。",create:"新建环境",configure:"配置环境",details:"环境详情",editorDescription:"配置运行环境,或接入代码仓库和已有镜像",backToList:"返回环境列表",save:"保存环境",createAndBuild:"创建并构建",saveAndBuild:"保存并构建",name:"环境名称",namePlaceholder:"Python 数据处理",descriptionPlaceholder:"说明这个环境适合处理的任务",creationMethod:"创建方式",baseConfiguration:"基础配置",baseEnvironment:"基础环境",operatingSystem:"操作系统",pythonVersion:"Python 版本",fixedByBase:"由 {{base}} 固定为 {{value}}",selectUbuntuVersion:"选择基础镜像的 Ubuntu 版本",selectPythonVersion:"选择需要安装的 Python 版本",skills:"技能",addSkill:"添加环境技能",veadkDescription:"Agent 开发与运行框架",customDockerfile:"自定义 Dockerfile",presetEnvironment:"预制环境",presetHint:"选择“无”可自行填写 Dockerfile 第一行的基础镜像。",dockerfileSize:"{{size}} / {{max}} 字节",upload:"上传",reset:"重置",dockerfileBaseImage:"Dockerfile 基础镜像",dockerfileContent:"Dockerfile 内容",region:"区域",search:"搜索环境",manualImport:"手动导入",noMatches:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称",startBuild:"开始构建",build:"构建",unnamed:"未命名环境",listSeparator:"、",clipboardReadError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",creation:{custom:{label:"自定义配置",description:"通过表单选择基础环境、Python、工具和技能"},dockerfile:{label:"自定义 Dockerfile",description:"上传或直接编辑 Dockerfile"},git:{label:"从代码仓库构建",description:"探查公开仓库并通过 CodePipeline 构建"},image:{label:"使用已有镜像",description:"绑定由外部流水线交付的 CR 镜像"}},baseDescriptions:{"aio-sandbox":"内置 Sandbox Shell 能力 · Ubuntu 22.04","codex-sandbox":"内置 Codex CLI、浏览器与代码执行环境",ubuntu:"标准 Linux 基础镜像"},dockerfileValidation:{baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"},presets:{none:"自行填写 Dockerfile 基础镜像",aio:"内置 Sandbox Shell 与常用运行时",codex:"内置 Codex CLI、浏览器与代码执行环境"},categories:{tools:"工具",productivity:"效率",browser:"浏览器自动化",system:"系统与媒体"},options:{"lark-cli":"飞书开放平台命令行工具",pandoc:"文档格式转换工具",opencli:"将网站与桌面应用转换为命令行工具",uv:"快速 Python 包与项目管理器",ripgrep:"高性能文本检索工具",jq:"JSON 查询与转换工具","github-cli":"在终端中管理 GitHub 工作流",playwright:"浏览器自动化与端到端测试",chromium:"无头浏览器运行时",git:"代码版本管理",curl:"网络请求与文件下载",ffmpeg:"音视频转码与处理",imagemagick:"图片转换与批处理"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",hoursMinutes:"{{hours}} 小时 {{minutes}} 分"},buildStatus:{preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"构建失败",notBuilt:"未构建"},manifest:{title:"环境 Manifest",closeLabel:"关闭环境 Manifest",loading:"正在加载 Manifest",editorLabel:"环境 Manifest YAML",copyFailed:"复制失败,请重试",copied:"已复制",copy:"复制 Manifest",view:"查看环境 Manifest",viewShort:"查看 Manifest",unavailable:"尚无可用 Manifest"},buildDetails:{title:"构建详情",closeLabel:"关闭构建详情",currentStep:"当前步骤",waiting:"等待构建信息",elapsed:"已用时",sourceCommit:"源码提交",openCodePipeline:"在 CodePipeline 中查看",starting:"正在启动",rebuild:"重新构建"},git:{sectionLabel:"公开代码仓库",address:"Git 地址",ref:"Branch、Tag 或 Commit",defaultBranch:"默认分支",inspecting:"正在拉取仓库并查找 Dockerfile",foundDockerfiles:"已在提交 {{commit}} 中找到 {{count}} 个 Dockerfile。",savedDockerfileLoaded:"已载入保存的 Dockerfile,可重新探查仓库更新。",noDockerfile:"仓库中未找到 Dockerfile,请检查分支或仓库内容。",inspectAgain:"重新探查",selectDockerfile:"选择 Dockerfile"},repository:{outputSection:"构建输出",type:"镜像仓库类型",managed:"Studio 默认镜像仓库",existing:"已有镜像仓库",managedHint:"构建时自动创建或复用当前区域的 Studio 镜像仓库。"},existingImage:{sectionLabel:"已有镜像",reference:"Tag 或 Digest",placeholder:"latest 或 sha256:...",hint:"填写镜像 Tag,或以 sha256: 开头的完整 Digest。"},share:{action:"分享",title:"分享环境",closeLabel:"关闭分享环境",generating:"正在生成并复制分享码",copied:"分享码已复制",failed:"分享失败",code:"分享码",fullCode:"完整环境分享码",copiedHint:"分享码已自动复制,也可在这里查看或手动复制。",copyFailedHint:"自动复制失败,可手动复制上方分享码,或重试。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅发送给可信对象。",copyAgain:"再次复制"},import:{title:"导入环境",closeLabel:"关闭导入环境",description:"先检测分享码中的环境,再确认添加到当前账号。",code:"环境分享码",tooMany:"最多可一次导入 {{max}} 个环境,当前检测到 {{count}} 个分享码。",multipleHint:"多个分享码可使用英文逗号、中文逗号或换行分隔,重复项会自动忽略。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅导入可信来源的分享码。",inspectingCodes:"正在检测环境分享码",found:"检测到 {{count}} 个环境:{{names}}。",itemError:"第 {{index}} 个分享码:{{error}}",invalidCode:"分享码无效。",noResult:"服务未返回该分享码的导入结果。",partial:"已导入 {{created}} 个环境,{{remaining}} 个未完成,可重试有效失败项。",inspecting:"正在检测",importing:"正在导入",retryImport:"重试导入",confirm:"确认导入",inspectCodes:"检测分享码"},status:{boundImage:"环境“{{name}}”已绑定已有镜像",queued:"环境“{{name}}”已进入构建队列",savedBuildFailed:"环境已保存,但构建未启动:{{error}}",importedFailed:"已导入 {{created}} 个环境,{{failed}} 个失败",importedDuplicate:"已导入 {{created}} 个环境,{{duplicate}} 个分享码已存在",imported:"已导入 {{count}} 个环境",deleted:"已删除环境“{{name}}”"},deleteTitle:"删除环境",deleteDescription:"确定删除环境“{{name}}”吗?删除后无法恢复。",errors:{repositoryRequired:"请输入公开代码仓库地址。",repositoryHttps:"请输入公开仓库的 HTTPS 地址。",repositoryInvalid:"请输入有效的公开仓库 HTTPS 地址。",imageReferenceWhitespace:"Tag 或 Digest 不能包含空格。",imageDigestInvalid:"Digest 必须是完整的 sha256 值。",imageTagOnly:"这里只填写 Tag,不要重复填写镜像仓库路径。"}},bYe={searchPlaceholder:"搜索资源名称",emptyMessage:"暂无可用选项",searchAriaLabel:"搜索{{label}}",loadingMore:"正在加载更多资源…"},xYe={retryDeployment:"重试部署",retrying:"正在重试…",collapse:"收起错误信息",expand:"展开完整错误信息",copy:"复制完整错误信息"},wYe={steps:"构建步骤",log:"构建日志",syncing:"同步中",loadFailed:"读取失败",synced:"已同步",recentOnly:" · 仅显示最近日志",copiedLog:"已复制构建日志",copyLog:"复制构建日志",copied:"已复制",copy:"复制",logContent:"构建日志内容",waiting:"正在等待 CodePipeline 输出日志…",empty:"暂无构建日志"},AYe={defaultLabel:"Studio 默认环境",defaultDescription:"使用 Studio 预置的标准运行环境",status:{notBuilt:"未构建",preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"失败"},label:"运行环境",placeholder:"请选择运行环境",search:"搜索运行环境",loading:"正在加载运行环境…",loadFailed:"加载运行环境失败",noMatches:"未找到匹配的运行环境",unavailable:"当前没有可用的运行环境",selectionUnavailable:"所选运行环境当前不可用,请重新选择。",selectionHint:"选择构建完成的运行环境后,部署将使用其镜像和工具配置。",versionChanged:"所选环境版本已更新,请确认后继续。",versionMissing:"所选环境版本已不存在,请重新选择。",operatingSystem:"操作系统",language:"语言",image:"镜像",imageVersion:"镜像版本",skills:"技能",tools:"工具",noSkills:"未配置 Skill",noExtraTools:"未配置额外工具",defaultGuidance:"默认环境由 Studio 管理,无需额外配置。",persistenceFallback:"持久化环境服务暂不可用,当前使用默认环境。",emptyFallback:"当前没有可选择的自定义环境。"},SYe={repository:"GitHub 仓库",githubUrl:"GitHub 地址",token:"访问令牌",sessionToken:"{{provider}} 临时令牌",runtime:"Runtime",commit:"提交",workflow:"工作流",syncFailed:"同步 GitHub 代码失败",status:{mounted:"已挂载",bound:"已绑定",synced:"已同步",created:"已创建"},volcengine:"火山引擎",mountDelivery:"挂载持续交付",selectedForDeployment:"已选择,部署时挂载",mountOnDeploy:"部署时挂载持续交付",syncCode:"同步代码",deliveryMode:"GitHub 交付模式",sourceSync:"GitHub 代码同步",delivery:"GitHub 交付",loading:"读取中",running:"执行中",runtimeDeliveryHint:"写入 AgentKit Runtime GitHub Actions workflow,后续 GitHub 提交会更新绑定 Runtime。",initialDeliveryHint:"首次部署成功后初始化目标分支,后续 GitHub 提交会更新绑定 Runtime。",sourceSyncHint:"Studio 会直接 push 到目标分支;该分支由 Studio 管理,远端冲突时同步会失败。Runtime 仍由部署按钮发布。",tokenPlaceholder:"repo 或 contents write 权限",getToken:"获取 Token",hideToken:"隐藏 Token",showToken:"显示 Token",tokenHelp:"Token 仅用于本次操作,成功后不会保留在表单中。",targetBranch:"目标分支",actionsSecretPlaceholder:"用于写入 GitHub Actions Secret",sessionTokenPlaceholder:"临时凭证可选",syncing:"同步中…",pendingHint:"已选择挂载持续交付。点击部署后,Studio 会等待 Runtime 创建完成并初始化 GitHub 目标分支,初始化成功后才完成部署流程。",result:{deliveryMounted:"已挂载持续交付",deliverySelected:"已选择挂载持续交付",githubBound:"已绑定 GitHub",codeSynced:"代码已同步",deliveryHint:"目标分支提交会触发 Runtime 持续交付。",boundHint:"更新并发布时会先同步当前源码到这个分支。"},branch:"分支",viewPr:"查看 PR",createFailed:"创建失败",phase:"阶段",log:"日志"},TYe={name:"飞书",enabling:"正在启用并更新配置…",description:"接收消息并通过飞书机器人回复",configuration:"飞书配置",configurationMode:"飞书配置方式",automatic:"自动配置",manual:"手动配置",cancelling:"取消中…",scanToCreate:"扫码创建",scanDescription:"授权后自动回填凭据",generateQrCode:"生成二维码",qrCodeAlt:"飞书机器人配置二维码",scanToConfirm:"飞书扫码确认",expiresIn:"{{time}} 后失效",created:"机器人已创建",credentialsFilled:"应用凭据已自动回填",qrCodeExpired:"二维码已失效",automaticFailed:"自动配置失败",regenerateQrCode:"请重新生成二维码。",configuredPlaceholder:"已配置,留空沿用",appSecretPlaceholder:"请输入 App Secret",hideSecret:"隐藏 App Secret",showSecret:"显示 App Secret"},CYe={mode:{auto:"自动创建",autoDescription:"部署时自动创建所需资源",recommended:"推荐",create:"指定名称",createDescription:"使用指定名称创建或复用资源",existing:"选择已有",existingDescription:"从当前账号的已有资源中选择"},selectExisting:"请选择已有资源",searchResource:"搜索资源名称",noMatch:"未找到匹配资源",noAvailable:"暂无可用资源",searching:"正在搜索云资源…",loading:"正在加载云资源…",noMatchSentence:"未找到匹配资源。",noAvailableSentence:"暂无可用资源。",loadedSummary:"实际服务区域:{{region}} · 已加载 {{loaded}}{{total}}",registryInstance:"Registry 实例",registryAriaLabel:"镜像仓库 Registry 实例",namespace:"命名空间",namespaceAriaLabel:"镜像仓库 Namespace",repository:"镜像仓库",existingRepository:"已有镜像仓库",selectRegistryFirst:"请先选择 Registry 实例。",selectNamespaceFirst:"请先选择 Namespace。",configurationMode:"配置方式",configurationModeAriaLabel:"{{resource}}配置方式",selectConfigurationMode:"请选择配置方式",automaticNames:"自动创建名称",validation:{tos:"请填写或选择 TOS 存储桶。",cr:"请完整填写或选择 CR 实例、命名空间和镜像仓库。",codePipeline:"请完整填写或选择 CodePipeline Workspace 和 Pipeline。",existingCodePipeline:"请选择已有的 CodePipeline Workspace 和兼容 Pipeline。"},autoBucketWithRegion:"agentkit-platform-{账号 ID}-{{region}}",autoBucket:"agentkit-platform-{账号 ID}",tosBucket:"TOS 存储桶",bucketName:"存储桶名称",bucketNamePlaceholder:"输入存储桶名称",existingBucket:"已有存储桶",existingTosBucket:"已有 TOS 存储桶",bucket:"存储桶",accountIdResolved:"账号 ID 在部署时按当前云账号解析。",containerRegistry:"容器镜像仓库(CR)",instanceName:"实例名称",crInstance:"CR 实例",existingCrInstance:"已有 CR 实例",existingCrNamespace:"已有 CR 命名空间",existingCrRepository:"已有 CR 镜像仓库",autoRegistry:"agentkit-platform-{账号 ID}",autoRepositoryName:"{{name}}-{4 位随机字符}",registryNameNote:"账号 ID 在部署时解析,镜像仓库的随机字符在部署时生成。",workspace:"工作空间",pipeline:"流水线",workspaceName:"Workspace 名称",pipelineName:"Pipeline 名称",existingWorkspace:"已有 CodePipeline Workspace",compatiblePipeline:"兼容 Pipeline",existingPipeline:"已有 AgentKit CodePipeline",pipelineNameNote:"Pipeline 与 Runtime 名称一致。"},kYe={commit:"提交",steps:{permissions:"预检 OTA 所需权限",resolving:"读取目标版本信息",downloading:"下载并校验完整更新包",preparing:"准备 VeFaaS Function 代码",provisioning:"检查并补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布新 Revision 并重启服务"},stages:{permissions:"预检 OTA 权限",resolving:"读取版本信息",downloading:"下载更新包",preparing:"准备 Function 代码",provisioning:"补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布 Revision",checking:"检查更新",unknown:"未知阶段"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},logPermissionPrefix:"无法读取 VeFaaS 发布日志。Function 角色缺少 ",logPermissionSuffix:" 权限,更新会继续。",openIamConsole:"前往 IAM 控制台配置权限",deploymentProgress:"部署进度",live:"实时",completed:"已完成",stopped:"已停止",copied:"已复制",copyFailed:"复制失败",copyLog:"复制日志",waitingForLogs:"等待 VeFaaS 返回更新日志…",noLogs:"本次更新未返回发布日志",messages:{updated:"Studio 已更新,新 Revision 已接管服务",failed:"Studio 更新失败",timeout:"等待 VeFaaS 发布超时,请稍后重新检查版本",submitted:"更新已提交,正在等待 VeFaaS 发布新版本",connectionSwitched:"连接已切换,正在确认新版本状态"},checkingPermissions:"正在检查 OTA 权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",updated:"Studio 已更新",updateToVersion:"更新 Studio 至 {{version}}",checkPermissions:"检查更新权限",authorizationNeeded:"需要授权",updatingShort:"正在更新",refreshForNewVersion:"刷新使用新版",updateFailed:"更新失败",updateNow:"立即更新",newVersionAvailable:"有新版更新",dialog:{failed:"Studio 更新失败",checkingPermissions:"正在检查更新权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",completed:"Studio 更新完成",newVersion:"发现新版本"},permissionCheck:"正在核对 OTA 与定时任务所需的全部 IAM 权限…",permissionCheckHint:"权限全部满足后才会开始下载、更新或发布云资源。",missingPermissionCount:"当前 Function 角色缺少 {{count}} 项 OTA 更新权限,尚未执行任何云资源变更。",functionRole:"Function 角色",currentRole:"当前运行角色",policyToUpdate:"将更新策略",authorizationSteps:{open:"打开授权页面,确认已预填的策略名称和完整策略内容。",debug:"点击页面中的“发起调试”,完成策略更新。",return:"返回此窗口,点击“我已授权,重新检查”。"},missingPermissions:"缺少的权限",openPrefilledAuthorization:"打开已预填的 IAM 授权页面",openIamManually:"前往 IAM 控制台手动配置",noSafePolicy:"当前角色没有唯一可安全更新的自定义策略,请由管理员将上述权限加入该角色。",failedStage:"失败阶段",errorId:"错误 ID",notGenerated:"未生成",openFunctionLogs:"前往 VeFaaS 控制台查看 Function 日志",targetVersion:"目标版本",updateStatus:"更新状态",elapsed:"已用时",progressAriaLabel:"Studio 更新进度",processingUpdate:"正在处理更新",processing:"正在处理",backgroundHint:"发布阶段会短暂中断连接;关闭此窗口不会停止更新,可随时点击右上角按钮重新查看。",confirmDescription:"更新会重启 Studio 服务,预计约 3–5 分钟完成更新与发布。期间正在进行的对话、流式响应或部署任务可能中断,登录态不会受到影响。",selectVersion:"选择版本",currentVersion:"当前版本",changelog:"更新内容",noChangelog:"暂无更新说明",runInBackground:"后台运行",authorizedRecheck:"我已授权,重新检查",tryAgain:"重新尝试"},OYe={deploy:"部署",update:"更新",planHash:"方案哈希",backToConfiguration:"返回配置",releaseRegion:"发布区域",deployRegion:"部署区域",regionPreserved:"更新时沿用现有 Runtime 的部署区域,无法修改。",unnamedAgent:"未命名 Agent",deployTitle:"部署 {{name}}",additionalAgentCount:" 等 {{count}} 个智能体",releaseOverview:"发布概览",agentOverview:"Agent 概览",agentCount:"Agent 数量",model:"模型",systemPrompt:"系统提示词",optimizations:"优化选项",notEnabled:"未启用",effectiveCapabilities:"生效能力",automaticProtection:"自动保护",artifactActions:"发布产物操作",exportYaml:"导出 YAML",viewSource:"查看源代码",downloadSource:"下载源代码",expandFlow:"放大查看执行流程",expand:"放大查看",deploymentConfiguration:"部署配置",runtimeName:"Runtime 名称",runtimeNamePreserved:"更新时保持现有 Runtime 名称不变。",runtimeNameHint:"默认根据 Root Agent 名称生成,并添加随机后缀避免重名;支持 4-64 位字母、数字、连字符和下划线",accessAuthentication:"访问鉴权",authenticationPreserved:"更新时保持现有 Runtime 的鉴权方式不变。",authenticationMethod:"鉴权方式",authenticationAriaLabel:"部署鉴权方式",authenticationPlaceholder:"请选择鉴权方式",messageChannels:"消息渠道",instanceSettings:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",sidecarSingleInstance:"Harness Sidecar 首期仅支持单实例,Runtime 固定为 1~1",inMemorySingleInstance:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",network:"网络",networkPreserved:"现有 Runtime 的区域与网络模式保持不变。",networkMode:"网络模式",networkModes:{public:"公网",both:"公网 + VPC"},subnetId:"子网 ID",subnetHint:"可选,多个用逗号分隔",sharedInternetAccess:"VPC 内共享公网出口",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",createEvaluationSetsHint:"部署成功后,自动创建 Good Case 和 Bad Case 评测集。",resourceConfiguration:"资源配置",environmentVariables:"环境变量",environmentVariablesHint:"组件配置会自动同步到这里,部署前可核对最终值。",itemCount:"{{count}} 项",addVariable:"添加变量",componentGenerated:"组件自动生成",injectedByApiKey:"由所选 API Key 注入",envNameAriaLabel:"{{key}} 环境变量名",envDescriptionAriaLabel:"{{key}}说明:{{description}}",openOpenViking:"打开 OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}:打开 OpenViking {{label}}",requiredEmpty:"必填,尚未填写",optionalEmpty:"可选,尚未填写",envValueAriaLabel:"{{key}} 环境变量值",automatic:"自动",synced:"同步",customModelCredentials:"自定义模型凭据",releaseOnlySecret:"必填,仅用于本次发布",thisRelease:"本次发布",customVariables:"自定义变量",value:"值",deleteVariable:"删除变量",deploymentProgress:"部署进度",retryUpdate:"重试更新",retryDeploy:"重试部署",updateSucceeded:"更新成功",deploySucceeded:"部署成功",region:"区域",agentName:"Agent 名称",apiEndpoint:"API 端点",connecting:"连接中…",chatNow:"立即对话",console:"控制台",actionInProgress:"{{action}}中…",checkingName:"正在检查名称…",retryAction:"重试{{action}}",flowPreview:"执行流程预览",executionFlow:"执行流程",flowPreviewHint:"只读预览,可缩放与拖动画布",closeFlowPreview:"关闭执行流程预览",agentAdded:'Agent "{{name}}" 已添加到左上角下拉列表!',files:{preview:"文件预览",new:"新建文件",empty:"暂无文件",noneSelected:"未选择文件",selectToView:"选择左侧文件以查看内容",loadingEditor:"加载编辑器…",rename:"重命名",renamePrompt:"重命名文件"},apiKey:{selectFirst:"请先选择 API Key",revealing:"正在显示 API Key",hide:"隐藏 API Key",retryReveal:"重试显示 API Key",reveal:"显示 API Key"},task:{preparing:"准备部署",waitingBuildLog:"正在等待构建日志…",waitingGithubLog:"正在等待 GitHub 挂载日志…",syncingGithub:"正在同步当前源码到 GitHub",syncGithubCode:"同步 GitHub 代码",githubSynced:"GitHub 代码已同步",githubSubmitted:"GitHub 代码已提交",githubUpdatingRuntime:"代码已提交到 GitHub,GitHub Actions 正在更新同一个 Runtime",initializingGithub:"开始初始化 GitHub main 分支与 Actions workflow",initializingGithubBranch:"正在初始化 GitHub 持续交付目标分支",mountGithubDelivery:"挂载 GitHub 持续交付",githubBranchInitialized:"GitHub 持续交付已初始化目标分支",githubDeliveryMounted:"GitHub 持续交付已挂载",githubMountFailed:"挂载 GitHub 持续交付失败",githubMountFailedDetail:"GitHub 持续交付挂载失败:{{message}}",githubMountFailedHint:"挂载 GitHub 持续交付失败,详见 GitHub 日志。",applyingMpaProfile:"正在将 Agent 配置应用到 MPA Runtime",mpaProfileApplied:"MPA Runtime 配置已应用",runningMpaSmoke:"正在验证 MPA Runtime 执行链路",mpaReady:"MPA Runtime 已可运行",deploymentComplete:"部署完成",deployedNotConnected:"部署完成,暂未连接",cancelled:"已取消",cancelledHint:"部署已取消,相关 Runtime 资源已请求销毁。",deploymentStatusUnconfirmed:"部署状态待确认",deploymentFailed:"部署失败",buildFailedHint:"构建镜像失败,详见构建日志。"},confirm:{updateTitle:"确认更新",deployTitle:"确认部署",closeLabel:"关闭部署确认",updateDescription:"将更新并发布到当前云端 Runtime,过程可能需要几分钟。确定继续吗?",deployDescription:"将创建新的云端 Runtime,部署过程可能需要几分钟。确定继续吗?",update:"确定更新",deploy:"确定部署"},userPool:{label:"用户池",unnamed:"未命名用户池",current:"当前用户池",ariaLabel:"部署用户池",loading:"正在加载用户池…",placeholder:"请选择用户池",loadingIdentity:"正在加载 Identity 用户池…",empty:"当前账号下暂无 Identity 用户池。",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime。",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime。",markedHint:"当前 Studio 使用的用户池已在列表中标注。"},authentication:{apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPool:"用户池",userPoolDescription:"使用 Identity 用户池签发的 JWT"},steps:{buildImage:"构建镜像",deploy:"部署",publish:"发布",syncCode:"同步代码",uploadPackage:"上传代码包",packageImage:"镜像打包",createRuntime:"创建 Runtime",publishService:"发布服务",updateInstances:"更新实例配置",createEvaluationSets:"创建评测集",applyMpaProfile:"应用 MPA 配置",verifyMpaRuntime:"验证 MPA Runtime",mpaReady:"MPA Runtime 可运行"},errors:{instanceRangeInteger:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数。",instanceRangeOrder:"最小实例数不能大于最大实例数。",selectApiKey:"请先在模型配置中选择 API Key。",loadApiKey:"加载 API Key 失败,请重试。",invalidProject:"项目数据无效",updateFeishu:"更新飞书配置失败:{{message}}",userPoolRequired:"请选择用于 Runtime 鉴权的用户池。",vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",modelSecretRequired:"请填写 {{label}},用于访问对应的自定义模型地址。",managedApiKeyRequired:"{{requirement}},请先返回模型配置选择 API Key。",feishuEnvRequired:"启用飞书后,请填写{{field}}。",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",deployedButGithubMountFailed:"部署成功,但挂载 GitHub 持续交付失败:{{message}}",deployedButGithubBindFailed:"部署成功,但绑定 GitHub 失败:{{message}}",mpaRuntimeIdMissing:"部署成功,但返回缺少 Runtime ID,无法应用 MPA 配置。",mpaOperationIncomplete:"MPA Runtime 初始化未完成,请重试此部署任务。",deploymentStatusUnconfirmed:"连接已中断,当前无法确认部署最终状态。任务可能仍在云端运行,请到 AgentKit 或 Code Pipeline 查看同一任务,避免重复部署。",failedAtStage:"{{action}}失败({{stage}}阶段):{{message}}",noAgentAtEndpoint:"连接成功,但该地址未发现任何 Agent(/list-apps 为空)。",addAgent:"添加 Agent 失败:{{message}}",modelApiKeyRequired:"请填写此模型地址对应的 API Key。"}},EYe={title:"工作区",storageUnavailable:"管理员未配置持久化存储,工作区管理暂不可用。",detail:"工作区详情",create:"新建工作区",editorDescription:"将常用环境组合在一起;同一个环境可以加入多个工作区。",backToList:"返回工作区列表",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",createdAt:"创建时间",updatedAt:"最近更新",basicInfo:"基本信息",namePlaceholder:"例如:内容生产",descriptionPlaceholder:"说明这个工作区的用途",selectedEnvironmentCount:"已选择 {{count}} 个,可在其他工作区中继续复用",searchAvailableEnvironments:"搜索可用环境",searchEnvironments:"搜索环境",noAvailableEnvironments:"还没有可添加的环境",createEnvironmentFirst:"请先在“环境”页面创建并构建环境。",noMatchingEnvironments:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称。",environmentStatus:{available:"可用",building:"构建中",notBuilt:"未构建"},added:"已添加",saved:"已保存工作区“{{name}}”",resourceType:"工作区资源类型",searchWorkspaces:"搜索工作区",loadFailed:"无法加载工作区",noMatchingWorkspaces:"没有匹配的工作区",tryAnotherNameOrEnvironment:"请尝试搜索其他名称或环境",noEnvironmentAdded:"未添加环境",environmentMissing:"环境缺失",availableFraction:"{{available}}/{{total}} 可用",available:"可用",availableCount:"{{count}} 个可用",updated:"更新",addEnvironment:"添加环境",deleteTitle:"删除工作区",deleteDescription:"确定删除工作区“{{name}}”吗?环境本身不会被删除。",deleted:"已删除工作区“{{name}}”",clipboardPermissionError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",codeProjects:"代码项目"},_Ye={back:"返回",detailNavigation:"详情导航",noData:"暂无数据",actions:"操作",moreActions:"更多操作 {{label}}",actionsFor:"{{label}} 操作",loading:"资源加载中,请稍候"},RYe={addSkill:"添加 Skill",remove:"移除 {{name}}",confirmRemoveRuntime:"从新版本中移除运行中的 Skill「{{name}}」?",selectedCount:"已加入技能 · {{count}}",close:"关闭{{label}}",sources:{runtime:"运行中来源 · 原样保留,可移除或用同名 Skill 替换",local:"本地",skillspace:"AgentKit Skills 中心",skillhub:"火山 Find Skill 技能广场"},tabs:{local:"本地文件",localShort:"本地文件",skillspace:"AgentKit Skills 中心",skillspaceShort:"AgentKit",skillhub:"火山 Find Skill 技能广场",skillhubShort:"Find Skill"}},DYe={model:"模型",turnControls:"流程控制",pause:"暂停",resume:"恢复",interrupt:"中断",cancel:"取消",pauseTurn:"在安全点暂停完整流程",resumeTurn:"恢复完整流程",interruptTurn:"中断当前流程并保留会话上下文",cancelTurn:"取消当前流程且不可恢复",turnState:{running:"运行中",pausing:"正在到达安全点",paused:"已暂停",resuming:"正在恢复",interrupting:"正在中断",cancelling:"正在取消",interrupted:"已中断",completed:"已完成",failed:"失败",cancelled:"已取消",orphaned:"状态待确认",newTurnRequired:"需要从检查点继续"},tasks:{ppt:"PPT",image:"图片生成",video:"视频生成"},prompts:{ppt:{quarterlyReview:"复盘【季度】经营表现,提炼指标差距、原因与行动建议",projectUpdate:"汇报【项目名称】进展:里程碑、风险、预算和资源诉求",solutionProposal:"为【客户行业】输出解决方案:痛点、架构、实施路径与收益",industryAnalysis:"分析【行业主题】趋势,给出竞争格局、机会与战略建议"},image:{launchVisual:"为【品牌或产品】设计【高级科技】风格的发布会主视觉",ecommercePoster:"生成【产品名称】电商海报,突出【核心卖点】与品牌色",conceptRendering:"呈现【产品或空间】在【使用场景】中的写实概念效果图",socialGraphic:"围绕【传播主题】制作简洁专业的企业社媒配图"},video:{brandFilm:"制作【品牌名称】30 秒宣传片,突出【品牌价值】",productLaunch:"为【产品名称】制作 45 秒发布视频:痛点、功能、场景与行动号召",trainingVideo:"制作【培训主题】企业培训视频,讲清【关键操作或规范】",eventTeaser:"生成【活动名称】20 秒预热视频,包含亮点、时间地点和报名信息"}},firstFrame:"首帧",videoToEdit:"待编辑视频",baseVideo:"基础视频",optimizeSkillPlaceholder:"描述你想优化的技能…",createSkillPlaceholder:"描述你想生成的技能…",createVideoPlaceholder:"描述你想创作的视频…",messageAgentPlaceholder:"向 {{name}} 发消息…",selectAgentFirst:"请先选择智能体",selectSkillFirst:"请先选择需要优化的 Skill",availableSkills:"可用技能",availableSubagents:"可用子 Agent",invokeSkill:"调用技能",useSubagent:"使用子 Agent",loadingCapabilities:"正在读取 Agent 能力…",noMatchingSkills:"当前 Agent 没有匹配技能",noMatchingSubagents:"当前 Agent 没有匹配子 Agent",skillFallbackDescription:"加载并执行该技能",agentFallbackDescription:"将本轮交给该 Agent",skill:"技能",uploadImage:"上传图片",uploadDocument:"上传文档或 PDF",uploadVideo:"上传视频",taskMode:"任务模式",selectTaskMode:"选择任务模式",loadingGenerationModel:"正在加载生成模型",modelUnavailable:"模型不可用",cancelTask:"取消{{task}}任务",stopGenerating:"停止生成",viewVideoProgress:"查看视频生成进度",send:"发送",selectTaskType:"选择任务类型",enterprisePrompts:"{{task}}企业提示词",sessionId:"会话 ID",sessionIdLabel:"会话 ID:",initializing:"初始化中",copied:"已复制",copySessionId:"复制会话 ID",sessionIdCopied:"已复制会话 ID",disclaimer:"回答仅供参考",viewLogs:"查看日志"},LYe={selectAgent:"选择 Agent",noLocalAgents:"暂无本地 Agent。",searchRuntime:"搜索 Runtime 名称",mineOnly:"只看我创建的",noRuntimes:"暂无 Runtime。",unsupported:"不支持",createdByMe:"我创建的",connecting:"连接中…",connected:"已连接",connect:"连接",viewInfoFor:"查看 {{name}} 信息",viewInfo:"查看信息",agentAndRuntimeInfo:"Agent 与 Runtime 信息",detailType:"详情类型",agentInfo:"Agent 信息",runtimeInfo:"Runtime 信息",loadingAgentInfo:"读取 Agent 信息…",cannotLoadAgentInfo:"暂时无法读取 Agent 信息",unnamedAgent:"未命名 Agent",subagents:"子 Agent",tools:"工具",skills:"技能",previewUnsupported:"暂不支持预览",mountedComponents:"挂载组件",noMoreAgentInfo:"暂无更多 Agent 配置信息。",local:"本地",model:"模型",status:"状态",memoryMb:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",resources:"资源",version:"版本",loadingDetails:"读取详情…",environmentVariables:"环境变量",errors:{notFound:"该 Runtime 已不存在或列表信息已过期,请刷新列表后重试。",accessDenied:"当前账号无权访问该 Runtime,请检查所属 Project 和访问权限。",previewUnsupported:"该 Agent Server 版本暂不支持信息预览。",unavailable:"该 Runtime 暂时无法访问,请确认其状态为“就绪”后重试。",timeout:"加载超时,请重试"},componentKinds:{knowledgebase:"知识库",memory:"记忆",prompt_manager:"提示词管理",example_store:"样例库",run_processor:"运行处理器",tracer:"链路追踪",toolset:"工具集",plugin:"插件",other:"其他"},runtimeStatus:{ready:"就绪",unreleased:"未发布",running:"运行中",active:"运行中",creating:"创建中",pending:"等待中",deploying:"部署中",updating:"更新中",failed:"失败",error:"异常",stopping:"停止中",stopped:"已停止",deleting:"删除中",deleted:"已删除"}},MYe={agent:"智能体",agentTypes:{general:"通用智能体",mpa:"MPA 智能体",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"创建人",namedAgent:"{{name}} 智能体",storageLocation:"存储位置",currentBrowser:"当前浏览器",region:"地域",viewDeploymentProgress:"查看 {{name}} 部署进度",viewRuntimeDetails:"查看 {{name}} Runtime 详情",viewDetails:"查看 {{name}} 详情",time:"时间",remainingTime:"剩余时间",expiringSoon:"即将清空",sandboxRemaining:"{{hours}} 小时 {{minutes}} 分钟",wakeable:"已休眠",neverExpires:"永不过期",editDraftNamed:"编辑草稿 {{name}}",viewProgress:"查看进度",deleteDraftNamed:"删除草稿 {{name}}",recheckCompatibility:"重新检测 {{name}} 的对话兼容性",connectedNamed:"{{name}} 已连接",wakeAndChat:"唤醒 {{name}} 并开始对话",chatWith:"与 {{name}} 对话",waking:"唤醒中",deploying:"部署中",draft:"草稿",checking:"检测中",chatUnsupported:"不支持对话",checkFailed:"检测失败",creatorFilter:"创建人筛选",agentType:"智能体类型",searchAgents:"搜索智能体",handoff:"接力",agentList:"{{type}}列表",noMatchingAgents:"没有匹配的智能体",adjustSearch:"请尝试调整搜索或筛选条件",noAgentType:"暂无 {{type}}",noGeneralAgents:"暂无通用智能体",createGeneralAgentDescription:"创建一个通用智能体,开始构建和对话",createAgentType:"创建{{type}}",createAgent:"创建智能体",loadingMore:"正在加载更多智能体",scrollForMore:"继续下滑加载更多",allLoaded:"已加载全部智能体",deleteDraftTitle:"删除草稿?",deleteDraftDescription:"删除后将无法恢复“{{name}}”。",deleteDraft:"删除草稿",loadGeneralAgents:"加载通用智能体",loadAgentType:"加载 {{type}}",compatibility:{checking:"正在请求 Runtime /list-apps,以确认该智能体是否支持 Studio 对话。",empty:"Runtime /list-apps 未返回可用的 Agent,暂时无法连接对话。",supported:"Runtime 支持 Studio 对话。",unknownError:"Runtime /list-apps 请求失败,未返回可识别的错误信息。"},sandboxStatus:{ready:"就绪",wakeable:"已休眠",creating:"创建中",starting:"启动中",initializing:"启动中",pending:"等待中",running:"运行中",failed:"异常",error:"异常",stopped:"已停止",expired:"已过期",deleting:"删除中",deleted:"已删除",unknown:"未知状态"},wakingHint:"正在唤醒智能体,可能需要一些时间。",mpaCreate:{maxInstance:"最大实例数",maxInstanceHelp:"默认 {{maximum}},为 Runtime 自动扩容的实例数上限。",maxInstanceInvalid:"最大实例数必须为大于或等于 1 的整数。",name:"名称",namePlaceholder:"例如 test-agent",nameHelp:"作为 Runtime 名称,支持 4–64 位字母、数字、下划线或连字符。",stepsLabel:"创建步骤",steps:{basics:"基本信息",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"数据库"},next:"下一步",previousStep:"上一步",pgDescription:"选择已有的 PostgreSQL 实例。创建流程会在该实例中准备智能体的独立业务库。",pgSplitDescription:"使用已配置的业务 PG Workspace。多个智能体共用此 Workspace,每个智能体拥有独立业务库。共享资源记录单独存放在 mpa_admin_workspace / mpa_admin_db,由管理员配置。",pgConsoleByteplus:"前往 BytePlus AIDAP 创建或查看 PG Workspace",pgConsole:"前往火山引擎 AIDAP 创建或查看 PG Workspace",pgHost:"PG 主机地址",pgPort:"PG 端口",pgInvalid:"请填写有效的 PG 主机地址和端口。",pgCredentials:"PG 连接账号和密码由部署服务配置;主机和端口须与服务端配置一致。",openvikingDescription:"可选。三项全部填写才启用 OpenViking;全部留空则不向新智能体注入 OpenViking 配置。",openvikingConsoleByteplus:"前往 BytePlus 查看 OpenViking 资源",openvikingConsole:"前往火山引擎查看 OpenViking 资源",openvikingUrl:"OpenViking 服务地址",openvikingResourceId:"OpenViking 资源 ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"请同时填写有效的 HTTPS 服务地址、资源 ID 和 API Key,或全部留空。",openvikingCredentials:"API Key 仅用于本次创建,不保存到浏览器草稿;刷新页面后需重新填写。",tosTitle:"会话输出存储",tosDescription:"可选。选择存储桶,持久保存每个会话的输出目录,使用沙箱 IAM Role 鉴权。未选桶时文件保存在沙箱本地目录。",tosBucket:"TOS 存储桶",tosInvalid:"请选择以 agentkit-platform- 开头的可用存储桶。",tosCredentials:"创建时为共享角色追加所选桶的会话输出访问权限,使用该角色的其他运行时和沙箱也将获得相同权限。",tosDisable:"清除桶选择",tosBucketUnavailable:"当前部署账号或地域无法使用该桶,请从列表选择存储桶后重试。",runtimeImage:"MPA 镜像",workerImage:"Worker 镜像",imageDefault:"留空使用配置文件中的默认镜像",imageInvalid:"请输入有效的镜像地址,不要包含网址、空格或登录凭据。",title:"创建 MPA 智能体",agentId:"智能体 ID",description:"描述",region:"部署地域",plan:"创建计划",sharedResources:"准备或复用账号共享 VPC、子网和 APIG 消息网关",agentResources:"准备独立业务库、技能空间和执行环境,部署智能体",readiness:"检查网关和智能体就绪状态,成功后加入列表",checking:"正在检查创建配置…",configured:"创建配置已就绪。提交后会检查云资源并开始准备。",notConfigured:"尚未配置创建所需的资源参数,请联系管理员配置后重试。",loadFailed:"检查创建配置失败,请重试。",reload:"重新检查",submit:"开始创建",retry:"重试创建",newAgent:"新建另一个智能体",newAgentDescription:"新建另一个智能体将开启可编辑的新请求,替换当前恢复草稿,但不会取消旧任务。旧任务仍在运行时,请等待其结束后再提交。",close:"关闭",cancel:"取消创建",confirmCancel:"确认取消",cancelDescription:"取消后会停止后续步骤。已创建的数据库、技能空间、网关和其他已登记资源会保留,可使用同一智能体 ID 重试。",background:"关闭窗口后创建会继续。再次打开可查看进度。",pollFailed:"暂时无法获取进度,正在重新连接。请勿重复创建其他智能体。",iamPermissionDenied:"部署服务没有准备运行角色所需的 IAM 权限,请联系管理员授权后重试。",iamTrustConflict:"运行角色的信任关系不符合要求,请管理员检查对 VeFaaS 和 APIG 的授权后重试。",iamPolicyConflict:"运行角色所需的同名权限策略内容冲突,请管理员检查后重试。",iamOwnershipConflict:"运行角色与当前部署账号不匹配,请管理员检查后重试。",iamTemporaryFailure:"IAM 请求在重试后仍暂时失败或超时,请检查 Studio 网络连接及 IAM 服务后,用同一智能体 ID 重试。",iamVerificationFailed:"尚未确认运行角色的权限已就绪,请检查 IAM 服务及策略可用性后重试。",iamConfigurationConflict:"自动准备运行角色仅支持默认 MPA 角色,请检查服务端创建配置。",creationFailed:"当前步骤未完成,请检查对应资源、服务端配置及权限后,用同一智能体 ID 重试。",configurationChanged:"此智能体的创建配置已与上次提交不一致。请恢复原配置后重试,或新建另一个智能体请求。",cancelFailed:"取消请求失败,请重新查询进度后重试。",cancelled:"创建已取消,已登记资源保留供重试。",timeout:"创建超时,已登记资源保留。请检查对应资源后重试。",interrupted:"创建任务中断。请用同一智能体 ID 重试以恢复已登记资源。",skillSpace:"技能空间",states:{running:"正在创建",cancelling:"正在取消",succeeded:"创建成功",failed:"创建失败",cancelled:"已取消"},stages:{queued:"等待开始",iam_role:"准备运行角色",checking:"检查账号与配置",network:"准备 VPC 和子网",gateway:"准备 APIG 和 IM Gateway",database:"准备业务数据库",skills:"准备技能空间",worker:"准备执行环境",deploying:"准备数据库、技能空间和 Runtime",verifying:"等待智能体就绪",admin_workspace:"准备管理 PG Workspace",business_workspace:"准备业务 PG Workspace",admin_database:"初始化共享管理库",openviking:"准备 OpenViking 库",openviking_key:"准备 OpenViking 访问凭证"},back:"继续创建",pgAutoDescription:"使用 VeADK 部署账号自动创建或复用两个 PG Workspace:mpa_admin_workspace / mpa_admin_db 存放共享资源记录,业务 Workspace 供多个智能体共用,每个智能体拥有独立业务库。无需填写 PG 连接信息,提交创建后开始准备。",pgPerAgentDescription:"创建流程会复用共享管理 Workspace,并为此智能体准备独立的业务 PG Workspace 和数据库。已有任务重试沿用原数据库。",pgAidbDescription:"创建流程会复用共享管理 Workspace,并为此智能体准备独立业务 Workspace 和 aidb 数据库。业务 Workspace 使用 mpa_agent_<智能体名称> 命名。已有任务重试沿用原数据库。",runtimeNameTaken:"该名称已被 Runtime、沙箱模板、业务 Workspace 或正在创建的任务占用,请更换名称。",runtimeNameCheckFailed:"暂时无法检查名称,请确认资源查询权限和网络后重试。",pgModeChanged:"此创建任务使用旧的 PG 配置,不能直接切换为自动模式重试。请联系管理员确认已有资源和任务后重新创建。",pgMigrationRequired:"检测到旧共享注册库。请先将共享资源记录迁移到 mpa_admin_workspace / mpa_admin_db,并完成现有 Runtime 的注册库地址切换;完成后点击“重新检查”。",openvikingAutoDescription:"将为此智能体创建独立 OpenViking 库,使用默认模型并自动准备连接配置。",openvikingAutoByteplusDescription:"将在 BytePlus 柔佛为此智能体创建个人版 OpenViking 库,并自动准备连接配置。重试将复用已登记的库。",openvikingAutoByteplusRequirements:"使用 MPA 的 ModelArk API Key 和管理员配置的 VLM、Embedding 推理接入点。个人库只有 default 用户;Runtime 镜像须适配该模式及海外数据面后,才能使用记忆功能。取消或删除智能体后,库会保留。",openvikingModelEndpointsInvalid:"请联系管理员在 Studio 服务端配置有效的 OV_VLM_ENDPOINT_ID 和 OV_EMBEDDING_ENDPOINT_ID 后重试。",openvikingAutoBilling:"企业版按量计费,建库成功后开始计费。重试此智能体将复用已登记的库。",openvikingPermissionDenied:"无权准备 OpenViking。请检查部署账号的建库、查询和获取 API Key 权限后重试。",openvikingConfigurationConflict:"OpenViking 的归属或配置与此智能体不一致,请核对登记的库后重试。",openvikingCreateUnknown:"OpenViking 创建结果尚未确认。请管理员核对云端库并补齐登记的资源 ID 后重试;不会自动重复建库。",openvikingNotReady:"OpenViking 仍在初始化,请稍后重试此智能体,将继续使用同一个库。",openvikingResourceFailed:"OpenViking 初始化失败,请在控制台检查库状态及模型配置后重试。",openvikingResourceMissing:"未找到已登记的 OpenViking 库或默认用户,请检查绑定及资源状态后重试。",openvikingModelConfigurationRejected:"平台拒绝了默认模型配置或建库参数,请检查 OpenViking 模型可用性及账号开通情况后重试。",openvikingUnavailable:"暂时无法连接 OpenViking,请检查服务及网络后重试。",openvikingInvalidResponse:"OpenViking 返回的配置不完整或无效,请检查库及默认用户后重试。",openvikingQuotaExceeded:"OpenViking 配额不足或请求过于频繁,请调整配额或稍后重试此智能体。"}},IYe={library:"技能库",skill:"技能",skills:"技能",skillSpace:"技能空间",sandboxNotConfigured:"管理员未配置 Dev Sandbox",adminNotConfigured:"管理员未配置",totalItems:"共 {{count}} 项",cannotLoadSpaces:"无法加载技能空间",someSpacesFailed:"部分技能空间加载失败",degradedRelationWarning:"部分关联异常,已恢复可读取技能",downloadZip:"下载 ZIP",optimize:"优化",closeSkillDetails:"关闭技能详情",skillId:"技能 ID",allFiles:"完整文件",loadingSkillContent:"正在读取技能内容…",noSkillContent:"该技能暂无 SKILL.md 内容",addSkill:"添加技能",localUpload:"本地上传",localUploadDescription:"选择 ZIP 文件,校验通过后上传到技能空间",autoCreate:"自动创建",autoCreateDescription:"选择模型和风格,通过对话生成技能",createSkill:"创建技能",optimizeNamed:"优化 {{name}}",deleteSkillConfirm:"确定删除整个 Skill“{{name}}”吗?此操作会影响所有引用它的空间。",deleteSpaceConfirm:"确定删除 Skill 空间“{{name}}”吗?请先确认空间中的技能已删除。",manageSpaceDescription:"管理空间中的技能并创建新的版本",backToSpaces:"返回技能空间列表",overview:"概览",skillCount:"技能数量",skillCountValue_one:"{{count}} 技能",skillCountValue_other:"{{count}} 技能",updatedAt:"更新时间",skillsInSpace:"{{name}}中的技能",searchSkills:"搜索技能",cannotLoadSkills:"无法加载技能",noMatchingSkills:"没有匹配的技能",noSkills:"暂无技能",tryAnotherName:"请尝试搜索其他名称",emptySkillsDescription:"本地上传 Skill,或自动创建",actions:"操作",spaceDetails:"技能空间详情",editSpace:"编辑空间",deleteSpace:"删除空间",searchSpaces:"搜索技能空间",spaceList:"技能空间列表",noMatchingSpaces:"没有匹配的技能空间",createSpace:"新建技能空间",newSpace:"新建空间",loadingMoreSpaces:"正在加载更多技能空间",scrollForMore:"继续下滑加载更多",allSpacesLoaded:"已加载全部技能空间",errors:{loadSpaces:"读取技能空间失败,请稍后重试",loadSkills:"读取技能失败,请稍后重试",loadSkillDetails:"读取技能详情失败,请稍后重试",deleteSkill:"删除 Skill 失败",deleteSpace:"删除 Skill 空间失败",downloadSkill:"下载 Skill 失败"},status:{active:"可用",available:"可用",creating:"创建中",disabled:"已停用",enabled:"已启用",failed:"异常",inactive:"未启用",pending:"等待中",published:"已发布",ready:"就绪",released:"已发布",running:"运行中",success:"正常",unavailable:"不可用",unreleased:"未发布",updating:"更新中",unknown:"未知"},sharedSpace:"企业共享空间",sharedDescription:"面向企业全员开放的技能,由管理员统一发布和维护",sharedVisibility:"全员可见",sharedPreparing:"正在准备共享空间",sharedLoadFailed:"共享空间加载失败",sharedEmpty:"暂无共享技能,管理员发布后会显示在这里",requestPublication:"申请公开",reviewSubmitting:"提交中…",reviewSubmitted:"已申请",reviewFailed:"申请公开失败",reviewStatusFailed:"审核状态加载失败",reviewRetry:"重新申请",reviewPending:"待审核",reviewApproving:"发布中",reviewApproved:"已公开",reviewReturned:"已退回",reviewHistory:"审核记录",skillDetailSections:"技能详情内容",versions:{title:"版本管理",refresh:"刷新",uploading:"上传中…",upload:"上传新版本",close:"关闭",hint:"新版本不会替换已公开版本,审核通过后才会公开;ZIP 中的技能名称需与原技能一致",loading:"正在加载版本…",loadFailed:"无法加载版本",filesFailed:"无法加载版本文件",uploadFailed:"上传新版本失败",submitFailed:"提交申请失败",retry:"重试",empty:"暂无版本",current:"当前版本",notSubmitted:"未申请公开",submitting:"提交中…",submit:"申请公开",processing:"版本状态:{{status}}",filesLoading:"正在加载文件…",filesEmpty:"暂无文件",history:"历史审核记录",shared:"已公开"},author:"作者",authorName:"作者:{{name}}"},PYe={library:"知识库",createBase:"新建知识库",editBase:"编辑知识库",invalidName:"名称必须以字母开头,且只能包含字母、数字和下划线。",nameHelp:"以字母开头,仅支持字母、数字和下划线,最多 48 个字符。",optionalDescription:"描述(可选)",descriptionOnly:"AgentKit 当前仅支持更新知识库描述。",previewWeb:"预览网页内容",addData:"添加数据",openOriginalWeb:"打开原网页",backToEdit:"返回修改",confirmAdd:"确认添加",source:"知识来源",image:"图片",documentFile:"文档文件",webPage:"在线网页",webUrl:"网页 URL",generatingWebPreview:"正在抓取网页并生成 Markdown 预览",selectFile:"选择知识文件",selectOrDropFile:"选择文件或拖拽到这里",selectedFile:"{{size}} · 点击可重新选择",imageFileHelp:"支持 PNG、JPG 和 JPEG,单个文件不超过 200 MB",documentFileHelp:"支持 PDF、PPTX、DOCX、XLSX 和 TXT,单个文件不超过 200 MB",uploadingFile:"正在上传文件并添加到知识库",optionalName:"名称(可选)",optionalType:"类型(可选)",generatePreview:"生成预览",uploadFile:"上传文件",editMetadata:"编辑知识 Metadata",knowledge:"知识",field:"字段",value:"值",backToList:"返回知识库列表",metadataJson:"元数据(JSON)",provider:"服务提供方",knowledgeId:"知识库 ID",project:"项目",creator:"创建者",data:"数据",deleteInvalidAssociation:"删除失效关联",noData:"这个知识库还没有数据",addFirstData:"添加第一项数据",format:"格式",size:"大小",searchData:"搜索数据",searchLibraryData:"搜索知识库数据",associationInvalid:"关联已失效",providerMissing:"底层 Provider 知识库已不存在",noMatchingData:"没有匹配的数据",loadingMoreData:"正在加载更多数据",retryLoading:"重试加载",details:"知识库详情",searchBases:"搜索知识库",someBasesFailed:"部分知识库暂时无法加载,已展示其余可用内容。",noMatchingBases:"没有匹配的知识库",noManagePermission:"您没有管理此知识库的权限",loadingMoreBases:"正在加载更多知识库",deleteBaseTitle:"删除知识库?",deleteBaseDescription:"将删除 {{name}} 的 AgentKit 关联;如果它由 Studio 创建,也会同时删除 Provider 资源。此操作无法撤销。",deleteDocumentTitle:"删除知识?",deleteDocumentDescription:"将从 Provider 知识库中删除 {{name}},此操作无法撤销。",preview:{processingTitle:"数据正在处理中",processingDetail:"知识库完成解析后即可预览,请稍后重新加载。",failedTitle:"数据解析失败",failedDetail:"请检查源文件或网页地址后重新添加,也可以重新加载最新状态。",noParsedTitle:"暂时没有可预览的解析内容",noParsedDetail:"此类文件会在知识库完成解析后显示文本、表格或页面图片。",noMediaTitle:"暂时没有可预览的媒体内容",noMediaDetail:"知识库尚未返回可访问的媒体预览,请稍后重新加载。",noDataTitle:"暂无可预览的数据内容",noDataDetail:"知识库尚未返回解析结果,请稍后重新加载。",attachmentError:"附件无法预览,请稍后重试。",imageAlt:"知识数据图片",audioUnsupported:"当前浏览器不支持音频预览。",videoUnsupported:"当前浏览器不支持视频预览。",namedPdf:"{{name}} PDF 预览",pdf:"PDF 预览",openPdf:"无法显示时,在新窗口打开 PDF",fileUnsupported:"当前格式暂不支持直接在线预览,已优先显示解析后的内容。",openOriginalFile:"打开原文件",loading:"正在加载数据预览",openOriginalHint:"您可以打开原网页查看来源内容。",chunk:"片段 {{index}}",loadingMore:"正在加载更多",loadMore:"加载更多"},errors:{fileTooLarge:"单个文件不能超过 200 MB",invalidImageType:"请选择 PNG、JPG 或 JPEG 图片",invalidDocumentType:"请选择 PDF、PPTX、DOCX、XLSX 或 TXT 文件",createBase:"创建知识库失败",updateBase:"更新知识库失败",metadataObject:"Metadata 必须是 JSON 对象",metadataFormat:"Metadata 格式错误",noWebPreview:"网页没有可预览的 Markdown 内容",addWeb:"添加网页失败",previewWeb:"生成网页预览失败",uploadFile:"上传文件失败",updateDocument:"更新知识失败",loadPreview:"加载数据预览失败",loadMoreBases:"加载更多知识库失败",loadBases:"加载知识库失败",loadMoreData:"加载更多数据失败",loadData:"加载数据失败",deleteBase:"删除知识库失败",deleteDocument:"删除知识失败"}},NYe={bindingType:"Bot 类型",bindingType_shared:"共享",bindingType_private:"私有",bindingTypeHelp_shared:"各会话相互隔离。",bindingTypeHelp_private:"私聊可召回同 Bot 的历史,包括群聊。",title:"飞书渠道",refresh:"刷新",loading:"正在加载渠道配置…",unsupported:"此 Runtime 不支持渠道管理,请升级 MPA 镜像。",unauthorized:"渠道管理需要 Studio 管理员身份及有效的 Runtime 凭据。",configurationError:"渠道管理配置不完整,请检查 Runtime 元数据及加密密钥。",requestFailed:"渠道请求失败,请检查 Runtime 连接后重试。",bound:"已绑定:{{name}}",unbound:"尚未绑定飞书机器人。",guidance:"私聊使用独立会话。在已授权群内 @ 当前机器人即可对话。",keyRequired:"绑定前请在 Runtime 配置持久的 CHANNEL_STATE_ENCRYPTION_KEY。",gateway:"消息网关",route:"入站路由",delivery:"回复投递",configured:"已配置",missing:"未配置",delivery_not_observed:"尚未观测",delivery_delivered:"已投递",delivery_retrying:"重试中",missingConfig:"缺少 Runtime 配置:{{fields}}",bind:"扫码绑定",newQr:"重新生成二维码",unbind:"解除绑定",confirmUnbind:"确认解绑此机器人?解绑后将停止接收新消息。",qrAlt:"机器人绑定二维码",openQr:"打开授权页面",uncertain:"注册过程已中断。重新开始前,请检查机器人绑定与 Gateway 状态。",bindingFailed:"绑定失败,请检查 Gateway 配置后重试。",chatId:"允许的群 ID",scope:"群会话策略",saveGroup:"保存群权限",noGroups:"尚未授权任何群。私聊无需群权限。",edit:"编辑",remove:"移除",removeGroup:"移除 {{name}}",scope_group_sender:"按发言人隔离",scope_group:"全群共享",scope_group_topic_sender:"按话题和发言人隔离",scope_group_topic:"按话题共享",status_PENDING:"等待扫码",status_SCANNED:"已扫码,等待授权",status_AUTHORIZED:"已授权,准备注册",status_REGISTERING:"正在注册机器人",status_BOUND:"机器人已绑定",status_FAILED:"绑定失败",status_EXPIRED:"二维码已过期",workspaceTitle:"消息渠道",workspaceDescription:"连接消息平台,让用户直接与此智能体对话,并管理访问权限。",provider_feishu:"飞书",provider_wecom:"企业微信",provider_dingtalk:"钉钉",comingSoon:"暂未开放",unavailableDescription:"{{name}}的绑定与消息配置暂未开放。",runtimeRequired:"请先将此智能体部署到 Runtime,再配置消息渠道。",bindingTitle:"机器人绑定",connected:"已绑定",notBound:"未绑定",gatewayDescription:"用于接收渠道消息的网关配置。",routeDescription:"将渠道消息转发给当前智能体的路由配置。",deliveryDescription:"实际观测到的回复投递状态,完成配置不代表已成功投递。",groupsTitle:"群聊权限",groupsDescription:"添加允许访问此智能体的群。",providerBindingTitle:"绑定{{name}}",providerUnbound:"绑定{{name}}机器人,让用户通过消息与此智能体对话。",qrGuidance:"使用{{name}}扫码授权,Runtime 将保存机器人凭据并配置消息网关。",wecomGuidance:"使用企业微信扫码授权,或手动填写 Bot ID 和 Secret 绑定已有机器人。",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"绑定机器人",wecomScan:"扫码绑定",wecomAuthorizing:"等待企业微信授权…",cancelAuthorization:"取消授权",wecomPopupBlocked:"授权窗口被浏览器拦截,请允许弹窗后重试。",wecomAuthCancelled:"已取消企业微信授权,可以重新扫码。",wecomAuthTimeout:"企业微信授权已超时,请重新扫码。",wecomInvalidResult:"授权结果缺少 Bot ID 或 Secret,请重新授权或手动填写。",wecomAuthFailed:"企业微信授权失败,请重试或手动填写凭据。",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"当前镜像尚不支持{{name}}手动配置,请升级后使用;仍可使用极速配置。",pairingTitle:"消息渠道扫码配对",feishuPairingDescription:"如果已有连接机器人,飞书扫码并绑定成功后原有机器人会被替换,可选绑定存量机器人或新建机器人。",generatingQr:"正在生成配对二维码…",dingtalkGuidance:"使用钉钉扫码授权,或手动填写 Client ID 和 Client Secret 绑定已有机器人。",wecomPairingDescription:"将在企业微信授权窗口中重新扫码配对。新机器人绑定成功后会替换当前连接;取消授权或绑定失败不会解绑原机器人。",configurationMethod:"配置方式",quickSetup:"极速配置",manualSetup:"手动配置",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"填写已有{{name}}机器人的应用凭据,连接到当前智能体。",manualReplacement:"绑定成功后将替换当前机器人;取消或绑定失败不会解除现有绑定。",accountsTitle:"飞书机器人",account:"机器人",selectAccount:"请选择机器人",accountEnabled:"已启用",accountDisabled:"已停用",addAccount:"添加机器人",cancelAddAccount:"取消添加",enableAccount:"启用机器人",disableAccount:"停用机器人",noAccounts:"尚未绑定飞书机器人。",accountsFailed:"读取机器人列表失败,请重试。",accountConflict:"机器人账号存在歧义或配置冲突,请刷新并选择机器人。",multiBotPairingDescription:"绑定新的飞书应用会添加机器人;绑定相同 App ID 会更新对应机器人。",provider_lark:"Lark",larkPairingDescription:"使用 Lark 扫码授权机器人。当前配置成功前,已有机器人仍保持绑定。",larkAccountsTitle:"Lark 机器人",noLarkAccounts:"尚未绑定 Lark 机器人。"},Ndr=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:gYe,agentSelector:LYe,agentWorkspace:vYe,channels:NYe,cloudEnvironment:AYe,common:pYe,composer:DYe,default:{common:pYe,agentKitPromo:gYe,systemInfo:mYe,agentWorkspace:vYe,environmentCenter:yYe,deploymentSelect:bYe,deploymentError:xYe,studioBuildProgress:wYe,cloudEnvironment:AYe,githubCicd:SYe,feishuDeployment:TYe,deploymentResources:CYe,studioUpdate:kYe,projectPreview:OYe,workspace:EYe,resourceCollection:_Ye,skillSourcePicker:RYe,composer:DYe,agentSelector:LYe,myAgents:MYe,skillCenter:IYe,knowledge:PYe,channels:NYe},deploymentError:xYe,deploymentResources:CYe,deploymentSelect:bYe,environmentCenter:yYe,feishuDeployment:TYe,githubCicd:SYe,knowledge:PYe,myAgents:MYe,projectPreview:OYe,resourceCollection:_Ye,skillCenter:IYe,skillSourcePicker:RYe,studioBuildProgress:wYe,studioUpdate:kYe,systemInfo:mYe,workspace:EYe},Symbol.toStringTag,{value:"Module"})),BYe="用户管理",$Ye="{{count}} 位成员",FYe="用户",zYe="角色",UYe="账号状态",VYe="最近登录",GYe="操作",QYe="更改角色",HYe="关闭",WYe="保存角色",YYe="正在保存…",qYe="取消",jYe="返回",XYe="用户池",KYe="火山引擎 Identity",ZYe="搜索姓名、邮箱或用户 ID",JYe="搜索",eqe="筛选角色",tqe="全部角色",rqe="刷新",nqe="正在读取用户…",iqe="更新于 {{time}}",aqe="已将 {{name}} 设置为{{role}}",oqe="重试",sqe="你",lqe="初始超级管理员",cqe="初始超级管理员受保护,不能在此降级",uqe="保存后,对方刷新 Studio 即可使用新的权限",dqe="角色需要重新确认",hqe="没有匹配的用户",fqe="尝试其他关键词或角色",pqe="用户登录或加入当前用户池后会显示在这里",gqe="共 {{count}} 位用户",mqe="上一页",vqe="下一页",yqe="尚未登录",bqe="未提供",xqe={super_admin:"超级管理员",admin:"管理员",developer:"开发者",user:"普通用户"},wqe={super_admin:"管理所有资源,并管理用户和分配角色",admin:"管理 Studio 资源",developer:"开发智能体并管理自己的资源",user:"使用智能体和个人功能"},Aqe={EXTERNAL_PROVIDER:"正常",CONFIRMED:"正常",NORMAL:"正常",ENABLED:"正常",ACTIVE:"正常",UNCONFIRMED:"待验证",DISABLED:"已停用",FORBIDDEN:"已禁用",LOCKED:"已锁定",SUSPENDED:"已暂停",FORCE_CHANGE_PASSWORD:"需要修改密码"},Sqe={request_failed:"请求未完成,请刷新列表确认当前状态后重试",invalid_response:"用户服务返回异常,请刷新后重试",identity_unavailable:"暂时无法访问 Identity,请稍后重试或检查服务权限",identity_resource_missing:"用户或用户池已不存在,请刷新列表",super_administrator_required:"只有超级管理员可以管理用户",sign_in_required:"请登录后重试",user_not_in_pool:"当前账号不属于此用户池",user_disabled:"当前账号已停用",protected_administrator:"不能降低初始超级管理员的权限",cannot_demote_self:"不能降低自己的超级管理员权限",role_change_conflict:"角色已发生变化,请关闭弹窗并刷新列表后重试",cross_origin_request:"请在当前 Studio 页面内修改角色"},Bdr=Object.freeze(Object.defineProperty({__proto__:null,actions:GYe,allRoles:tqe,back:jYe,cancel:qYe,changeRole:QYe,close:HYe,default:{title:BYe,memberCount:$Ye,user:FYe,role:zYe,status:UYe,lastLogin:VYe,actions:GYe,changeRole:QYe,close:HYe,save:WYe,saving:YYe,cancel:qYe,back:jYe,pool:XYe,volcengineIdentity:KYe,searchPlaceholder:ZYe,search:JYe,filterRole:eqe,allRoles:tqe,refresh:rqe,loading:nqe,updatedAt:iqe,saved:aqe,retry:oqe,you:sqe,initialAdministrator:lqe,protectedExplanation:cqe,effectiveAfterRefresh:uqe,roleConflict:dqe,noUsers:hqe,tryAnotherSearch:fqe,poolEmpty:pqe,resultCount:gqe,previous:mqe,next:vqe,neverLoggedIn:yqe,unknown:bqe,roles:xqe,descriptions:wqe,states:Aqe,errors:Sqe},descriptions:wqe,effectiveAfterRefresh:uqe,errors:Sqe,filterRole:eqe,initialAdministrator:lqe,lastLogin:VYe,loading:nqe,memberCount:$Ye,neverLoggedIn:yqe,next:vqe,noUsers:hqe,pool:XYe,poolEmpty:pqe,previous:mqe,protectedExplanation:cqe,refresh:rqe,resultCount:gqe,retry:oqe,role:zYe,roleConflict:dqe,roles:xqe,save:WYe,saved:aqe,saving:YYe,search:JYe,searchPlaceholder:ZYe,states:Aqe,status:UYe,title:BYe,tryAnotherSearch:fqe,unknown:bqe,updatedAt:iqe,user:FYe,volcengineIdentity:KYe,you:sqe},Symbol.toStringTag,{value:"Module"})),Tqe="网站集成",Cqe="将 AgentKit Runtime 以悬浮聊天窗口嵌入网站",kqe="返回自动化列表",Oqe="添加网站",Eqe="正在加载 Runtime",_qe="选择 Runtime",Rqe="网站域名",Dqe="例如 xxxx.com 或 localhost:5173",Lqe="正在生成",Mqe="生成 Token",Iqe="已添加网站",Pqe="{{count}} 个",Nqe="{{count}} 个",Bqe="正在加载网站集成",$qe="还没有网站集成",Fqe="选择 Runtime 并输入网站域名即可生成 Token",zqe="引入方法",Uqe="将下面代码放到网页的 body 结束标签前",Vqe="已复制",Gqe="复制代码",Qqe="添加网站后会在这里生成引入代码。",Hqe="确定删除 {{domain}} 的网站集成吗?",Wqe={load:"加载网站集成失败",create:"创建网站集成失败",delete:"删除网站集成失败",noConversationalAgent:"该 Runtime 暂未发现可对话的 Agent"},Yqe={requestFailed:"请求失败 ({{status}})",greeting:"您好,有什么可以帮您?",sessionFailed:"无法建立对话会话",unauthorized:"当前网站未获得对话授权",conversationFailed:"对话请求失败,请稍后重试",open:"打开智能体对话",close:"关闭智能体对话",panelLabel:"智能体对话面板",assistant:"智能体助手",online:"在线对话"},$dr=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:Oqe,addedWebsites:Iqe,backToAutomations:kqe,confirmDelete:Hqe,copied:Vqe,copyCode:Gqe,default:{title:Tqe,description:Cqe,backToAutomations:kqe,addWebsite:Oqe,loadingRuntime:Eqe,selectRuntime:_qe,websiteDomain:Rqe,domainPlaceholder:Dqe,generating:Lqe,generateToken:Mqe,addedWebsites:Iqe,websiteCount_one:Pqe,websiteCount_other:Nqe,loadingIntegrations:Bqe,delete:"删除",emptyTitle:$qe,emptyDescription:Fqe,embedMethod:zqe,embedInstructions:Uqe,copied:Vqe,copyCode:Gqe,embedHint:Qqe,confirmDelete:Hqe,errors:Wqe,widget:Yqe},description:Cqe,domainPlaceholder:Dqe,embedHint:Qqe,embedInstructions:Uqe,embedMethod:zqe,emptyDescription:Fqe,emptyTitle:$qe,errors:Wqe,generateToken:Mqe,generating:Lqe,loadingIntegrations:Bqe,loadingRuntime:Eqe,selectRuntime:_qe,title:Tqe,websiteCount_one:Pqe,websiteCount_other:Nqe,websiteDomain:Rqe,widget:Yqe},Symbol.toStringTag,{value:"Module"})),qqe={types:{all:"全部类型",document:"文档",image:"图片",video:"视频"},previewArtifact:"预览 {{name}}",moreActions:"更多操作 {{name}}",actionMenu:"{{name}} 操作",download:"下载",downloading:"下载中",edit:"编辑信息",delete:"删除产物",previewFailed:"无法预览“{{name}}”:{{message}}",downloadStarted:"已开始下载 {{name}}",downloadFailed:"无法下载“{{name}}”:{{message}}",updated:"已更新 {{name}}",deleted:"已删除 {{name}}",deleteFailed:"无法删除“{{name}}”:{{message}}",typeFilter:"产物类型",searchAria:"搜索产物",searchPlaceholder:"搜索产物或会话",retry:"重试",close:"关闭",listAria:"产物列表",loadFailed:"产物加载失败",loadDetailFallback:"请检查存储配置后重试。",reload:"重新加载",noMatch:"没有找到匹配的产物",noArtifacts:"您还没有任何产物",searchHint:"请尝试搜索其他名称或切换类型",emptyHint:"聊天中生成的产物会自动显示在这里",columns:{name:"名称",source:"来源",updatedAt:"修改时间",actions:"操作"},loadingMore:"正在加载更多产物",unknownTime:"时间未知",preview:{close:"关闭预览",meta:"{{type}} / 版本 {{version}}",loading:"正在加载预览",alt:"{{name}} 预览",loadFailed:"预览加载失败,请稍后重试或下载查看",unsupported:"当前格式暂不支持在线预览,请下载查看",sourceAria:"产物来源",agent:"智能体",session:"会话",tool:"生成工具",createdAt:"生成时间",fileSize:"文件大小",tags:"标签",viewSession:"查看会话"},deleteDialog:{title:"删除产物?",description:"“{{name}}”将从产物库永久删除,聊天记录不会受到影响。",deleting:"删除中",confirm:"删除",close:"关闭删除确认框"},api:{withStatus:"{{message}}({{status}})",listFailed:"读取产物库失败",syncFailed:"同步聊天产物失败",updateFailed:"更新产物失败",deleteFailed:"删除产物失败",downloadFailed:"下载产物失败"}},jqe={unknownSource:"未知来源",unknownCreator:"未知创建者"},Xqe={nameRequired:"请输入产物名称",tooManyTags:"标签最多 {{max}} 个",tagTooLong:"单个标签不能超过 {{max}} 个字符",title:"编辑产物信息",subtitle:"内容文件不会被修改",close:"关闭编辑框",name:"名称",description:"描述",descriptionPlaceholder:"补充用途、版本或使用说明",tags:"标签",tagsPlaceholder:"使用逗号分隔,最多 {{max}} 个",cancel:"取消",saving:"保存中",save:"保存"},Kqe={change:{added:"新增",modified:"修改",deleted:"删除"},noChanges:"两个版本的源码没有差异",chooseFile:"从左侧选择文件以查看代码",compareTitle:"版本对比",workspaceTitle:"源码工作区",projectFallback:"Agent 项目",switchTheme:"切换源码主题",switchThemeTitle:"切换为{{theme}}主题",themes:{dark:"深色",light:"浅色"},closeWorkspace:"关闭源码工作区",close:"关闭",changedFiles:"变更文件",projectFiles:"项目文件",changes:"变更",files:"文件",openFiles:"打开的文件",noFileSelected:"未选择文件",comparisonDirection:"对比方向",before:"优化前",after:"优化后",loadingEditor:"正在加载编辑器…",changedFileCount_one:"{{count}} 个文件有变更",changedFileCount_other:"{{count}} 个文件有变更",fileCount_one:"{{count}} 个文件",fileCount_other:"{{count}} 个文件",lineCount_one:"{{count}} 行 · UTF-8",lineCount_other:"{{count}} 行 · UTF-8",viewSource:"查看源码",viewSourceAria:"查看和编辑项目源码"},Zqe={nav:"搜索",selectAgent:"请选择 Agent",checkingCapabilities:"正在检测 Agent 能力",notMounted:"当前 Agent 未挂载{{label}}",sources:{session:"会话",web:"网络",knowledge:"知识库",memory:"长期记忆"},webDescription:"通过 web_search 工具检索",backendLocal:"本地",failed:"搜索失败:{{message}}",placeholder:{selectAgent:"请先选择 Agent",web:"在网络中检索",knowledge:"在 {{name}} 中检索",knowledgeFallback:"当前 Agent 的知识库",memory:"在 {{name}} 中检索",memoryFallback:"当前用户的长期记忆",session:"在当前 Agent 的会话中检索"},sourceTypeAria:"搜索类型:{{label}}",notSelected:"未选择",sourceType:"搜索类型",selectSource:"选择搜索类型",noAgentHint:"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。",loadingCapabilities:"正在读取当前 Agent 的检索能力…",sourceUnavailable:"当前 Agent 未挂载该数据源",instructions:{web:"输入关键词后回车或点击按钮,通过 web_search 工具检索。",knowledge:"输入问题,检索当前 Agent 挂载的知识库。",memory:"输入线索,检索当前用户跨会话保存的长期记忆。",session:"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"},noResults:"未找到匹配“{{query}}”的结果。",knowledgeFragment:"知识片段 {{index}}",memoryFragment:"记忆片段 {{index}}"},Jqe={title:"开发者资源",sections:{documentation:{title:"相关链接",description:"查看开发文档与 AgentKit 常用入口"},bestPractices:{title:"最佳实践",description:"参考开发、调试与部署经验"},showcases:{title:"案例展示",description:"探索 AgentKit 应用案例"}},links:{veadkDocs:"VeADK 文档",cliDocs:"AgentKit CLI 文档",platformDocs:"AgentKit 平台文档",console:"AgentKit 控制台"},articles:{veadkDevelopment:{title:"使用 VeADK 开发并部署智能体",description:"使用 VeADK 构建 Agent,并部署至 AgentKit 智能体运行时。"},cliDevelopment:{title:"使用 AgentKit CLI 开发并部署智能体",description:"通过 AgentKit CLI 创建项目、调试 Agent,并完成部署。"},coverAlt:"{{title}}文章封面"},showcases:{researchAssistant:{title:"多智能体研究助手",description:"由多个专业 Agent 协同完成资料检索、分析和结论整理。"},multimodalAnalysis:{title:"多模态内容分析",description:"在统一会话中理解图片、文档和视频内容。"},customerService:{title:"智能客服工作台",description:"结合知识检索与工具调用处理复杂的客户服务任务。"},webSearch:{title:"联网搜索 Agent",description:"检索实时网页内容,并将信息整理为可追溯的回答。"},a2uiApp:{title:"A2UI 交互应用",description:"让 Agent 根据任务过程生成可交互的前端界面。"},previewAlt:"{{title}}界面预览"}},eje={title:"资源库",untitledSession:"未命名会话",categoryAria:"资源库分类",regionAria:"区域",tabs:{skills:"技能库",knowledge:"知识库",artifacts:"产物"}},tje={title:"管理 Agent",subtitle:"列出你有权管理的 AgentKit Runtime",mainAgentOnly:"仅显示主 Agent(控制面信息)。",deleteConfirm:'确定删除 Agent "{{name}}"?该 Runtime 将被永久删除。',regionFilterTitle:"按区域筛选",regionFilterAria:"区域筛选",regionAria:"区域",refresh:"刷新",loading:"加载中…",empty:"暂无你部署的 Agent。",connected:"已连接",connect:"连接到此 Agent",deleteRuntime:"删除该 Runtime",loadingDetail:"读取详情…",agentStructure:"Agent 结构",secretHidden:"敏感值不展示,可通过授权请求直接复制",revealSecret:"{{key}} 的敏感值",copySecret:"复制 {{key}} 的值",copy:"复制",copied:"已复制",copyFailed:"复制失败",notConfigured:"未配置",fields:{model:"模型",description:"描述",status:"状态信息",project:"项目",version:"版本",resources:"资源",memory:"记忆",tool:"工具",knowledge:"知识",mcpToolset:"MCP 工具集",updatedAt:"更新时间"},resource:{memory:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",concurrency:"并发 {{value}}"},environmentVariables:"环境变量",unnamed:"(未命名)"},rje={mainAgent:"主 Agent",subAgent:"子 Agent {{index}}",itemCount_one:"{{count}} 项",itemCount_other:"{{count}} 项",info:"Agent 信息",infoAndTopology:"Agent 信息与设置",loadingInfo:"正在读取 Agent 信息…",unnamedAgent:"未命名 Agent",agentsMd:"AGENTS.md",tools:"工具",toolList:"工具列表",studioTool:"Studio Tool",removeTool:"移除工具 {{name}}",remove:"移除",notConfigured:"未配置",addStudioTool:"添加 Studio 工具",addStudioToolHere:"在此对话中添加 Studio 工具",skills:"技能",skillList:"技能列表",addSkill:"添加技能空间技能",addSkillHere:"向此会话添加技能空间技能",skillMountNextTurn:"挂载的版本将在下一 Turn 开始时冻结。",previewUnsupported:"暂不支持预览",sessionEnvironment:"会话环境",environment:"环境",agentCanvas:"Agent 画布",topology:"结构拓扑",nodeKinds:{agent:"Agent",sandbox:"沙箱","worker-session":"Worker 会话","skill-space":"技能空间",skill:"技能","studio-tool":"Studio 工具",mcp:"MCP",environment:"环境",knowledge:"知识库","sub-agent":"子 Agent"},nodeStatuses:{configured:"已配置",mounted:"已挂载",running:"运行中",paused:"已暂停"},viewCanvasFullscreen:"全屏查看 Agent 画布",viewFullscreen:"全屏查看",executionCanvas:"Agent 执行画布",fullscreenExecutionCanvas:"全屏 Agent 执行画布",closeFullscreenCanvas:"关闭全屏画布",close:"关闭",capabilitiesSubtitle:"能力与协作拓扑",closeInfo:"关闭 Agent 信息",infoUnavailable:"暂时无法读取 Agent 信息。",refresh:"刷新信息",loadingSkills:"正在加载绑定技能…",sessionSkills:"本会话临时技能",noBoundSpace:"当前智能体未绑定技能空间。",noBoundSkills:"绑定的技能空间暂无技能。",loadFailed:"加载失败,请刷新重试。",accessDenied:"无权读取此信息。",documentUnsupported:"当前 Runtime 不支持 Studio 读取 AGENTS.md,请升级 Runtime 镜像。",skillsUnsupported:"当前 Runtime 未提供技能空间绑定信息。",skillsDegraded:"技能信息不完整,请刷新重试。",documentEditHint:"编辑最新版本。保存会发布新版本到此技能空间,可能影响使用它的其他智能体。运行中的会话可能需要等待缓存刷新或新建会话后生效。请保留 frontmatter 中的 name。",documentLoading:"正在加载 SKILL.md…",documentWritable:"可编辑",documentReadOnly:"只读:此空间或当前权限不允许编辑",documentLoadFailed:"无法加载 SKILL.md,请刷新重试。",documentSaveFailed:"未确认保存成功,已保留编辑内容。重试前请重新打开,检查当前版本。",documentConflict:"技能已有新版本。请复制当前修改,再重新打开编辑器,避免覆盖。",discardDocument:"放弃未保存的修改?",keepEditing:"继续编辑",discardChanges:"放弃修改",saveDocument:"保存为新版本"},nje={mountFailed:"挂载环境失败",closeDialog:"关闭环境弹窗",addTitle:"添加环境",description:"选择当前会话允许 Agent 使用的 Sandbox 环境",closeAdd:"关闭添加环境",searchAria:"搜索环境",searchPlaceholder:"搜索环境名称或能力",availableAria:"可用环境与工作区",loading:"正在读取可用环境…",noMatch:"没有匹配的环境或工作区",workspaces:"工作区",reuseAll:"复用工作区中的全部可用环境",availableEnvironmentCount_one:"{{count}} 个可用环境",availableEnvironmentCount_other:"{{count}} 个可用环境",selectWorkspace:"选择工作区 {{name}}",environments:"环境",includedByWorkspaces:"已由工作区 {{names}} 包含",nameSeparator:"、",selectEnvironment:"选择环境 {{name}}",selectedWorkspaceCount_one:"{{count}} 个工作区",selectedWorkspaceCount_other:"{{count}} 个工作区",coveredEnvironmentCount_one:"{{count}} 个环境",coveredEnvironmentCount_other:"{{count}} 个环境",selectionSummary:"已选择 {{workspaces}},覆盖 {{environments}}",cancel:"取消",mounting:"正在挂载…",confirm:"确认添加",mountedAria:"已挂载环境",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",removeWorkspace:"移除工作区 {{name}}",remove:"移除",removeEnvironment:"移除环境 {{name}}",add:"添加环境",addMore:"添加更多环境",addForSession:"为当前 Session 添加环境",loadingAvailable:"正在加载可用环境…",empty:"暂无可用的 AIO Sandbox 环境。"},ije={loading:{searching:"正在查找已有环境",creating:"环境初始化中",connecting:"正在连接已有环境"},initializationFailed:"AgentKit CLI 环境初始化失败,当前状态:{{status}}。",sessionExpired:"AgentKit CLI Session 不存在或已过期,请重试。",initializationTimeout:"AgentKit CLI 环境初始化超时,请稍后重试。",nonPersistent:"非持久化环境",recyclingHoursMinutes:"{{hours}} 小时 {{minutes}} 分钟后环境回收",recyclingMinutes:"{{minutes}} 分钟后环境回收",connectionError:`无法连接 Studio 服务,未收到服务端响应。 原始错误:{{message}}`,unavailable:"连接不可用",requestFailed:"AgentKit CLI 请求失败",retry:"重试",terminalTitle:"AgentKit CLI 终端"},aje={labels:{coding:"智能编程",get_city_weather:"城市天气查询",get_location_weather:"位置天气查询",web_fetch:"网页内容获取",studio_write_artifact:"保存会话产物"},closeDialog:"关闭弹窗",title:"添加 Studio 工具",description:"由 Studio BFF 为 {{agentName}} 的当前会话执行,Runtime 无需预装",close:"关闭添加 Studio 工具",searchAria:"搜索 Studio 工具",searchPlaceholder:"搜索名称或工具标识",availableAria:"可用 Studio 工具",loading:"正在读取 Studio 工具…",noMatch:"没有匹配的 Studio 工具",remove:"移除",add:"添加"},oje={artifactLibrary:qqe,resourceMetadata:jqe,artifactEdit:Xqe,codeBrowser:Kqe,search:Zqe,developerResources:Jqe,library:eje,manageAgents:tje,agentTopology:rje,sessionEnvironment:nje,agentKitCli:ije,studioTools:aje},Fdr=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:ije,agentTopology:rje,artifactEdit:Xqe,artifactLibrary:qqe,codeBrowser:Kqe,default:oje,developerResources:Jqe,library:eje,manageAgents:tje,resourceMetadata:jqe,search:Zqe,sessionEnvironment:nje,studioTools:aje},Symbol.toStringTag,{value:"Module"})),sje=["zh-CN","en-US"],nle="en-US",zdr="agentkit.studio.locale",Udr={"zh-CN":{dir:"ltr",nativeName:"简体中文"},"en-US":{dir:"ltr",nativeName:"English"}};function ile(t){if(!t)return null;const e=t.trim().replace(/_/g,"-").toLowerCase(),r=sje.find(n=>n.toLowerCase()===e);return r||(e==="zh"||e.startsWith("zh-")?"zh-CN":e==="en"||e.startsWith("en-")?"en-US":null)}function Vdr(){if(typeof window>"u")return null;try{return ile(window.localStorage.getItem(zdr))}catch{return null}}function Gdr(){if(typeof window>"u")return[];const t=window.navigator;return t?t.languages.length>0?t.languages:t.language?[t.language]:[]:[]}function Qdr(){const t=Vdr();if(t)return t;for(const e of Gdr()){const r=ile(e);if(r)return r}return nle}function lje(t){typeof document>"u"||(document.documentElement.lang=t,document.documentElement.dir=Udr[t].dir)}const vn=t=>typeof t=="string",R6=()=>{let t,e;const r=new Promise((n,i)=>{t=n,e=i});return r.resolve=t,r.reject=e,r},ale=t=>t==null?"":String(t),Hdr=(t,e,r)=>{t.forEach(n=>{e[n]&&(r[n]=e[n])})},Wdr=/###/g,cje=t=>t&&t.includes("###")?t.replace(Wdr,"."):t,uje=t=>!t||vn(t),D6=(t,e,r)=>{const n=vn(e)?e.split("."):e;let i=0;for(;i{const{obj:n,k:i}=D6(t,e,Object);if(n!==void 0||e.length===1){n[i]=r;return}let a=e[e.length-1],o=e.slice(0,e.length-1),s=D6(t,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=D6(t,o,Object),s!=null&&s.obj&&typeof s.obj[`${s.k}.${a}`]<"u"&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=r},Ydr=(t,e,r,n)=>{const{obj:i,k:a}=D6(t,e,Object);i[a]=i[a]||[],i[a].push(r)},tG=(t,e)=>{const{obj:r,k:n}=D6(t,e);if(r&&Object.prototype.hasOwnProperty.call(r,n))return r[n]},qdr=(t,e,r)=>{const n=tG(t,r);return n!==void 0?n:tG(e,r)},hje=(t,e,r)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(Object.prototype.hasOwnProperty.call(t,n)?vn(t[n])||t[n]instanceof String||vn(e[n])||e[n]instanceof String?r&&(t[n]=e[n]):hje(t[n],e[n],r):t[n]=e[n]);return t},qv=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),jdr={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},Xdr=t=>vn(t)?t.replace(/[&<>"'\/]/g,e=>jdr[e]):t;class Kdr{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const r=this.regExpMap.get(e);if(r!==void 0)return r;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}const Zdr=[" ",",","?","!",";"],Jdr=new Kdr(20),ehr=(t,e,r)=>{e=e||"",r=r||"";const n=Zdr.filter(o=>!e.includes(o)&&!r.includes(o));if(n.length===0)return!0;const i=Jdr.getRegExp(`(${n.map(o=>o==="?"?"\\?":o).join("|")})`);let a=!i.test(t);if(!a){const o=t.indexOf(r);o>0&&!i.test(t.substring(0,o))&&(a=!0)}return a},ole=(t,e,r=".")=>{if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const n=e.split(r);let i=t;for(let a=0;at==null?void 0:t.replace(/_/g,"-"),thr={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){var r,n;(n=(r=console==null?void 0:console[t])==null?void 0:r.apply)==null||n.call(r,console,e)}};class rG{constructor(e,r={}){this.init(e,r)}init(e,r={}){this.prefix=r.prefix||"i18next:",this.logger=e||thr,this.options=r,this.debug=r.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,r,n,i){return i&&!this.debug?null:(e=e.map(a=>vn(a)?a.replace(/[\r\n\x00-\x1F\x7F]/g," "):a),vn(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[r](e))}create(e){return new rG(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new rG(this.logger,e)}}var mm=new rG;class nG{constructor(){this.observers={}}on(e,r){return e.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const i=this.observers[n].get(r)||0;this.observers[n].set(r,i+1)}),this}off(e,r){if(this.observers[e]){if(!r){delete this.observers[e];return}this.observers[e].delete(r)}}once(e,r){const n=(...i)=>{r(...i),this.off(e,n)};return this.on(e,n),this}emit(e,...r){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([i,a])=>{for(let o=0;o{for(let o=0;o-1&&this.options.ns.splice(r,1)}getResource(e,r,n,i={}){var u,d;const a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,o=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;e.includes(".")?s=e.split("."):(s=[e,r],n&&(Array.isArray(n)?s.push(...n):vn(n)&&a?s.push(...n.split(a)):s.push(n)));const l=tG(this.data,s);return!l&&!r&&!n&&e.includes(".")&&(e=s[0],r=s[1],n=s.slice(2).join(".")),l||!o||!vn(n)?l:ole((d=(u=this.data)==null?void 0:u[e])==null?void 0:d[r],n,a)}addResource(e,r,n,i,a={silent:!1}){const o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let s=[e,r];n&&(s=s.concat(o?n.split(o):n)),e.includes(".")&&(s=e.split("."),i=r,r=s[1]),this.addNamespaces(r),dje(this.data,s,i),a.silent||this.emit("added",e,r,n,i)}addResources(e,r,n,i={silent:!1}){for(const a in n)(vn(n[a])||Array.isArray(n[a]))&&this.addResource(e,r,a,n[a],{silent:!0});i.silent||this.emit("added",e,r,n)}addResourceBundle(e,r,n,i,a,o={silent:!1,skipCopy:!1}){let s=[e,r];e.includes(".")&&(s=e.split("."),i=n,n=r,r=s[1]),this.addNamespaces(r);let l=tG(this.data,s)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),i?hje(l,n,a):l={...l,...n},dje(this.data,s,l),o.silent||this.emit("added",e,r,n)}removeResourceBundle(e,r){this.hasResourceBundle(e,r)&&delete this.data[e][r],this.removeNamespaces(r),this.emit("removed",e,r)}hasResourceBundle(e,r){return this.getResource(e,r)!==void 0}getResourceBundle(e,r){return r||(r=this.options.defaultNS),this.getResource(e,r)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const r=this.getDataByLanguage(e);return!!(r&&Object.keys(r)||[]).find(i=>r[i]&&Object.keys(r[i]).length>0)}toJSON(){return this.data}}var pje={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,r,n,i){return t.forEach(a=>{var o;e=((o=this.processors[a])==null?void 0:o.process(e,r,n,i))??e}),e}};const gje=Symbol("i18next/PATH_KEY");function rhr(){const t=[],e=Object.create(null);let r;return e.get=(n,i)=>{var a;return(a=r==null?void 0:r.revoke)==null||a.call(r),i===gje?t:(t.push(i),r=Proxy.revocable(n,e),r.proxy)},Proxy.revocable(Object.create(null),e).proxy}function bA(t,e){const{[gje]:r}=t(rhr()),n=(e==null?void 0:e.keySeparator)??".",i=(e==null?void 0:e.nsSeparator)??":",a=(e==null?void 0:e.enableSelector)==="strict";if(r.length>1&&i){const o=e==null?void 0:e.ns,s=a?Array.isArray(o)?o:o?[o]:null:Array.isArray(o)?o:null;if(s&&(a?s:s.length>1?s.slice(1):[]).includes(r[0]))return`${r[0]}${i}${r.slice(1).join(n)}`}return r.join(n)}const sle=t=>!vn(t)&&typeof t!="boolean"&&typeof t!="number";class iG extends nG{constructor(e,r={}){super(),Hdr(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=mm.create("translator"),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,r={interpolation:{}}){const n={...r};if(e==null)return!1;const i=this.resolve(e,n);if((i==null?void 0:i.res)===void 0)return!1;const a=sle(i.res);return!(n.returnObjects===!1&&a)}extractFromKey(e,r){let n=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const i=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let a=r.ns||this.options.defaultNS||[];const o=n&&e.includes(n),s=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!ehr(e,n,i);if(o&&!s){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:vn(a)?[a]:a};const u=e.split(n);(n!==i||n===i&&this.options.ns.includes(u[0]))&&(a=u.shift()),e=u.join(i)}return{key:e,namespaces:vn(a)?[a]:a}}translate(e,r,n){let i=typeof r=="object"?{...r}:r;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i={...i}),i||(i={}),e==null)return"";typeof e=="function"&&(e=bA(e,{...this.options,...i})),Array.isArray(e)||(e=[String(e)]),e=e.map(L=>typeof L=="function"?bA(L,{...this.options,...i}):String(L));const a=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:s,namespaces:l}=this.extractFromKey(e[e.length-1],i),u=l[l.length-1];let d=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const h=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((h==null?void 0:h.toLowerCase())==="cimode")return f?a?{res:`${u}${d}${s}`,usedKey:s,exactUsedKey:s,usedLng:h,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:`${u}${d}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:h,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:s;const p=this.resolve(e,i);let g=p==null?void 0:p.res;const m=(p==null?void 0:p.usedKey)||s,v=(p==null?void 0:p.exactUsedKey)||s,y=["[object Number]","[object Function]","[object RegExp]"],b=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,w=i.count!==void 0&&!vn(i.count),A=iG.hasDefaultValue(i),S=w?this.pluralResolver.getSuffix(h,i.count,i):"",T=i.ordinal&&w?this.pluralResolver.getSuffix(h,i.count,{ordinal:!1}):"",C=w&&!i.ordinal&&i.count===0,O=C&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${T}`]||i.defaultValue;let E=g;x&&!g&&A&&(E=O);const _=sle(E),P=Object.prototype.toString.apply(E);if(x&&E&&_&&!y.includes(P)&&!(vn(b)&&Array.isArray(E))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const L=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,E,{...i,ns:l}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=L,p.usedParams=this.getUsedParamsDetails(i),p):L}if(o){const L=Array.isArray(E),R=L?[]:{},D=L?v:m;for(const M in E)if(Object.prototype.hasOwnProperty.call(E,M)){const I=`${D}${o}${M}`;A&&!g?R[M]=this.translate(I,{...i,defaultValue:sle(O)?O[M]:void 0,joinArrays:!1,ns:l}):R[M]=this.translate(I,{...i,joinArrays:!1,ns:l}),R[M]===I&&(R[M]=E[M])}g=R}}else if(x&&vn(b)&&Array.isArray(g))g=g.join(b),g&&(g=this.extendTranslation(g,e,i,n));else{let L=!1,R=!1;!this.isValidLookup(g)&&A&&(L=!0,g=O),this.isValidLookup(g)||(R=!0,g=s);const M=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&R?void 0:g,I=A&&O!==g&&this.options.updateMissing;if(R||L||I){if(this.logger.log(I?"updateKey":"missingKey",h,u,w&&!I?`${s}${this.pluralResolver.getSuffix(h,i.count,i)}`:s,I?O:g),o){const V=this.resolve(s,{...i,keySeparator:!1});V&&V.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let N=[];const F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&F&&F[0])for(let V=0;V{var H;const G=A&&U!==g?U:M;this.options.missingKeyHandler?this.options.missingKeyHandler(V,u,z,G,I,i):(H=this.backendConnector)!=null&&H.saveMissing&&this.backendConnector.saveMissing(V,u,z,G,I,i),this.emit("missingKey",V,u,z,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?N.forEach(V=>{const z=this.pluralResolver.getSuffixes(V,i);C&&i[`defaultValue${this.options.pluralSeparator}zero`]&&!z.includes(`${this.options.pluralSeparator}zero`)&&z.push(`${this.options.pluralSeparator}zero`),z.forEach(U=>{B([V],s+U,i[`defaultValue${U}`]||O)})}):B(N,s,O))}g=this.extendTranslation(g,e,i,p,n),R&&g===s&&this.options.appendNamespaceToMissingKey&&(g=`${u}${d}${s}`),(R||L)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${d}${s}`:s,L?g:void 0,i))}return a?(p.res=g,p.usedParams=this.getUsedParamsDetails(i),p):g}extendTranslation(e,r,n,i,a){var l,u;if((l=this.i18nFormat)!=null&&l.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const d=vn(e)&&(((u=n==null?void 0:n.interpolation)==null?void 0:u.skipOnVariables)!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(d){const p=e.match(this.interpolator.nestingRegexp);h=p&&p.length}let f=n.replace&&!vn(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(f={...this.options.interpolation.defaultVariables,...f}),e=this.interpolator.interpolate(e,f,n.lng||this.language||i.usedLng,n),d){const p=e.match(this.interpolator.nestingRegexp),g=p&&p.length;h(a==null?void 0:a[0])===p[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${p[0]} in key: ${r[0]}`),null):this.translate(...p,r),n)),n.interpolation&&this.interpolator.reset()}const o=n.postProcess||this.options.postProcess,s=vn(o)?[o]:o;return e!=null&&(s!=null&&s.length)&&n.applyPostProcessor!==!1&&(e=pje.handle(s,e,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,r={}){let n,i,a,o,s;return vn(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(l=>typeof l=="function"?bA(l,{...this.options,...r}):l)),e.forEach(l=>{if(this.isValidLookup(n))return;const u=this.extractFromKey(l,r),d=u.key;i=d;let h=u.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const f=r.count!==void 0&&!vn(r.count),p=f&&!r.ordinal&&r.count===0,g=r.context!==void 0&&(vn(r.context)||typeof r.context=="number")&&r.context!=="",m=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);h.forEach(v=>{var y,b;this.isValidLookup(n)||(s=v,!this.checkedLoadedFor[`${m[0]}-${v}`]&&((y=this.utils)!=null&&y.hasLoadedNamespace)&&!((b=this.utils)!=null&&b.hasLoadedNamespace(s))&&(this.checkedLoadedFor[`${m[0]}-${v}`]=!0,this.logger.warn(`key "${i}" for languages "${m.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),m.forEach(x=>{var S;if(this.isValidLookup(n))return;o=x;const w=[d];if((S=this.i18nFormat)!=null&&S.addLookupKeys)this.i18nFormat.addLookupKeys(w,d,x,v,r);else{let T;f&&(T=this.pluralResolver.getSuffix(x,r.count,r));const C=`${this.options.pluralSeparator}zero`,O=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(r.ordinal&&T.startsWith(O)&&w.push(d+T.replace(O,this.options.pluralSeparator)),w.push(d+T),p&&w.push(d+C)),g){const E=`${d}${this.options.contextSeparator||"_"}${r.context}`;w.push(E),f&&(r.ordinal&&T.startsWith(O)&&w.push(E+T.replace(O,this.options.pluralSeparator)),w.push(E+T),p&&w.push(E+C))}}let A;for(;A=w.pop();)this.isValidLookup(n)||(a=A,n=this.getResource(x,v,A,r))}))})}),{res:n,usedKey:i,exactUsedKey:a,usedLng:o,usedNS:s}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,r,n,i={}){var a;return(a=this.i18nFormat)!=null&&a.getResource?this.i18nFormat.getResource(e,r,n,i):this.resourceStore.getResource(e,r,n,i)}getUsedParamsDetails(e={}){const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!vn(e.replace);let i=n?e.replace:e;if(n&&typeof e.count<"u"&&(i={...i,count:e.count}),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!n){i={...i};for(const a of r)delete i[a]}return i}static hasDefaultValue(e){const r="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&n.startsWith(r)&&e[n]!==void 0)return!0;return!1}}class mje{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=mm.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(e){if(e=L6(e),!e||!e.includes("-"))return null;const r=e.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(e){if(e=L6(e),!e||!e.includes("-"))return e;const r=e.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(e){if(vn(e)&&e.includes("-")){let r;try{r=Intl.getCanonicalLocales(e)[0]}catch{}return r&&this.options.lowerCaseLng&&(r=r.toLowerCase()),r||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let r;return e.forEach(n=>{if(r)return;const i=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(i))&&(r=i)}),!r&&this.options.supportedLngs&&e.forEach(n=>{if(r)return;const i=this.getScriptPartFromCode(n);if(this.isSupportedCode(i))return r=i;const a=this.getLanguagePartFromCode(n);if(this.isSupportedCode(a))return r=a;r=this.options.supportedLngs.find(o=>o===a?!0:!o.includes("-")&&!a.includes("-")?!1:!!(o.includes("-")&&!a.includes("-")&&o.slice(0,o.indexOf("-"))===a||o.startsWith(a)&&a.length>1))}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(e,r){if(!e)return[];if(typeof e=="function"&&(e=e(r)),vn(e)&&(e=[e]),Array.isArray(e))return e;if(!r)return e.default||[];let n=e[r];return n||(n=e[this.getScriptPartFromCode(r)]),n||(n=e[this.formatLanguageCode(r)]),n||(n=e[this.getLanguagePartFromCode(r)]),n||(n=e.default),n||[]}toResolveHierarchy(e,r){const n=this.options.fallbackLng,i=Array.isArray(n)?n.join("|"):n;i!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=i);const a=r===void 0||r===!1||vn(r),o=r===void 0&&typeof this.options.fallbackLng=="function",s=vn(e)&&a&&!o;let l=null;if(s){let f;r===void 0?f="undefined":r===!1?f="boolean:false":f=`string:${r}`,l=`${e.length}:${e}|${f}`}if(l!==null){const f=this.resolveHierarchyCache[l];if(f!==void 0)return f.slice()}const u=this.getFallbackCodes((r===!1?[]:r)||this.options.fallbackLng||[],e),d=[],h=f=>{f&&(this.isSupportedCode(f)?d.push(f):this.logger.warn(`rejecting language code not found in supportedLngs: ${f}`))};return vn(e)&&(e.includes("-")||e.includes("_"))?(this.options.load!=="languageOnly"&&h(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&h(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&h(this.getLanguagePartFromCode(e))):vn(e)&&h(this.formatLanguageCode(e)),u.forEach(f=>{d.includes(f)||h(this.formatLanguageCode(f))}),l!==null?(this.resolveHierarchyCache[l]=d,d.slice()):d}}const vje={zero:0,one:1,two:2,few:3,many:4,other:5},yje={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class nhr{constructor(e,r={}){this.languageUtils=e,this.options=r,this.logger=mm.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,r={}){const n=L6(e==="dev"?"en":e),i=r.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:n,type:i});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let o;try{o=new Intl.PluralRules(n,{type:i})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),yje;if(!e.match(/-|_/))return yje;const l=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(l,r)}return this.pluralRulesCache[a]=o,o}needsPlural(e,r={}){let n=this.getRule(e,r);return n||(n=this.getRule("dev",r)),(n==null?void 0:n.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,r,n={}){return this.getSuffixes(e,n).map(i=>`${r}${i}`)}getSuffixes(e,r={}){let n=this.getRule(e,r);return n||(n=this.getRule("dev",r)),n?n.resolvedOptions().pluralCategories.sort((i,a)=>vje[i]-vje[a]).map(i=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(e,r,n={}){const i=this.getRule(e,n);return i?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i.select(r)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",r,n))}}const bje=(t,e,r,n=".",i=!0)=>{let a=qdr(t,e,r);return!a&&i&&vn(r)&&(a=ole(t,r,n),a===void 0&&(a=ole(e,r,n))),a},xje=t=>t.replace(/\$/g,"$$$$");class wje{constructor(e={}){var r;this.logger=mm.create("interpolator"),this.options=e,this.format=((r=e==null?void 0:e.interpolation)==null?void 0:r.format)||(n=>n),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:r,escapeValue:n,useRawValueToEscape:i,prefix:a,prefixEscaped:o,suffix:s,suffixEscaped:l,formatSeparator:u,unescapeSuffix:d,unescapePrefix:h,nestingPrefix:f,nestingPrefixEscaped:p,nestingSuffix:g,nestingSuffixEscaped:m,nestingOptionsSeparator:v,maxReplaces:y,alwaysFormat:b}=e.interpolation;this.escape=r!==void 0?r:Xdr,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=a?qv(a):o||"{{",this.suffix=s?qv(s):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":h?qv(h):"-",this.unescapeSuffix=this.unescapePrefix?"":d?qv(d):"",this.nestingPrefix=f?qv(f):p||qv("$t("),this.nestingSuffix=g?qv(g):m||qv(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=y||1e3,this.alwaysFormat=b!==void 0?b:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(r,n)=>(r==null?void 0:r.source)===n?(r.lastIndex=0,r):new RegExp(n,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,r,n,i){var p;let a,o,s;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=g=>{if(!g.includes(this.formatSeparator)){const b=bje(r,l,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(b,void 0,n,{...i,...r,interpolationkey:g}):b}const m=g.split(this.formatSeparator),v=m.shift().trim(),y=m.join(this.formatSeparator).trim();return this.format(bje(r,l,v,this.options.keySeparator,this.options.ignoreJSONStructure),y,n,{...i,...r,interpolationkey:v})};this.resetRegExp(),!this.escapeValue&&typeof e=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const d=(i==null?void 0:i.missingInterpolationHandler)||this.options.missingInterpolationHandler,h=((p=i==null?void 0:i.interpolation)==null?void 0:p.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>g},{regex:this.regexp,safeValue:g=>this.escapeValue?this.escape(g):g}].forEach(g=>{for(s=0;a=g.regex.exec(e);){const m=a[1].trim();if(o=u(m),o===void 0)if(typeof d=="function"){const y=d(e,a,i);o=vn(y)?y:""}else if(i&&Object.prototype.hasOwnProperty.call(i,m))o="";else if(h){o=a[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${e}`),o="";else!vn(o)&&!this.useRawValueToEscape&&(o=ale(o));const v=g.safeValue(o);if(e=e.replace(a[0],xje(v)),h?(g.regex.lastIndex+=v.length,g.regex.lastIndex-=a[0].length):g.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),e}nest(e,r,n={}){let i,a,o;const s=(l,u)=>{const d=this.nestingOptionsSeparator;if(!l.includes(d))return l;const h=l.split(new RegExp(`${qv(d)}[ ]*{`));let f=`{${h[1]}`;l=h[0],f=this.interpolate(f,o);const p=f.match(/'/g),g=f.match(/"/g);(((p==null?void 0:p.length)??0)%2===0&&!g||((g==null?void 0:g.length)??0)%2!==0)&&(f=f.replace(/'/g,'"'));try{o=JSON.parse(f),u&&(o={...u,...o})}catch(m){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,m),`${l}${d}${f}`}return o.defaultValue&&o.defaultValue.includes(this.prefix)&&delete o.defaultValue,l};for(;i=this.nestingRegexp.exec(e);){let l=[];o={...n},o=o.replace&&!vn(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const u=/{.*}/s.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(u!==-1&&(l=i[1].slice(u).split(this.formatSeparator).map(d=>d.trim()).filter(Boolean),i[1]=i[1].slice(0,u)),a=r(s.call(this,i[1].trim(),o),o),a&&i[0]===e&&!vn(a))return a;vn(a)||(a=ale(a)),a||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),a=""),l.length&&(a=l.reduce((d,h)=>this.format(d,h,n.lng,{...n,interpolationkey:i[1].trim()}),a.trim())),e=e.replace(i[0],xje(ale(a))),this.regexp.lastIndex=0}return e}}const ihr=t=>{let e=t.toLowerCase().trim();const r={};if(t.includes("(")){const n=t.split("(");e=n[0].toLowerCase().trim();const i=n[1].slice(0,-1);e==="currency"&&!i.includes(":")?r.currency||(r.currency=i.trim()):e==="relativetime"&&!i.includes(":")?r.range||(r.range=i.trim()):i.split(";").forEach(o=>{if(o){const[s,...l]=o.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),d=s.trim();r[d]||(r[d]=u),u==="false"&&(r[d]=!1),u==="true"&&(r[d]=!0),isNaN(u)||(r[d]=parseInt(u,10))}})}return{formatName:e,formatOptions:r}},Aje=t=>{const e={};return(r,n,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});const o=n+JSON.stringify(a);let s=e[o];return s||(s=t(L6(n),i),e[o]=s),s(r)}},ahr=t=>(e,r,n)=>t(L6(r),n)(e);class ohr{constructor(e={}){this.logger=mm.create("formatter"),this.options=e,this.init(e)}init(e,r={interpolation:{}}){this.formatSeparator=r.interpolation.formatSeparator||",";const n=r.cacheInBuiltFormats?Aje:ahr;this.formats={number:n((i,a)=>{const o=new Intl.NumberFormat(i,{...a});return s=>o.format(s)}),currency:n((i,a)=>{const o=new Intl.NumberFormat(i,{...a,style:"currency"});return s=>o.format(s)}),datetime:n((i,a)=>{const o=new Intl.DateTimeFormat(i,{...a});return s=>o.format(s)}),relativetime:n((i,a)=>{const o=new Intl.RelativeTimeFormat(i,{...a});return s=>o.format(s,a.range||"day")}),list:n((i,a)=>{const o=new Intl.ListFormat(i,{...a});return s=>o.format(s)})}}add(e,r){this.formats[e.toLowerCase().trim()]=r}addCached(e,r){this.formats[e.toLowerCase().trim()]=Aje(r)}format(e,r,n,i={}){if(!r||e==null)return e;const a=r.split(this.formatSeparator),o=[];for(let l=0;l-1&&!u.includes(")")&&l+1{var f;const{formatName:d,formatOptions:h}=ihr(u);if(this.formats[d]){let p=l;try{const g=((f=i==null?void 0:i.formatParams)==null?void 0:f[i.interpolationkey])||{},m=g.locale||g.lng||i.locale||i.lng||n;p=this.formats[d](l,m,{...h,...i,...g})}catch(g){this.logger.warn(g)}return p}else this.logger.warn(`there was no format function for ${d}`);return l},e)}}const shr=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class lhr extends nG{constructor(e,r,n,i={}){var a,o;super(),this.backend=e,this.store=r,this.services=n,this.languageUtils=n.languageUtils,this.options=i,this.logger=mm.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],(o=(a=this.backend)==null?void 0:a.init)==null||o.call(a,n,i.backend,i)}queueLoad(e,r,n,i){const a={},o={},s={},l={};return e.forEach(u=>{let d=!0;r.forEach(h=>{const f=`${u}|${h}`;!n.reload&&this.store.hasResourceBundle(u,h)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?o[f]===void 0&&(o[f]=!0):(this.state[f]=1,d=!1,o[f]===void 0&&(o[f]=!0),a[f]===void 0&&(a[f]=!0),l[h]===void 0&&(l[h]=!0)))}),d||(s[u]=!0)}),(Object.keys(a).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(a),pending:Object.keys(o),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(e,r,n){const i=e.split("|"),a=i[0],o=i[1];r&&this.emit("failedLoading",a,o,r),!r&&n&&this.store.addResourceBundle(a,o,n,void 0,void 0,{skipCopy:!0}),this.state[e]=r?-1:2,r&&n&&(this.state[e]=0);const s={};this.queue.forEach(l=>{Ydr(l.loaded,[a],o),shr(l,e),r&&l.errors.push(r),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{s[u]||(s[u]={});const d=l.loaded[u];d.length&&d.forEach(h=>{s[u][h]===void 0&&(s[u][h]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(l=>!l.done)}read(e,r,n,i=0,a=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:r,fcName:n,tried:i,wait:a,callback:o});return}this.readingCalls++;const s=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const h=this.waitingReads.shift();this.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(u&&d&&i{this.read(e,r,n,i+1,a*2,o)},a);return}o(u,d)},l=this.backend[n].bind(this.backend);if(l.length===2){try{const u=l(e,r);u&&typeof u.then=="function"?u.then(d=>s(null,d)).catch(s):s(null,u)}catch(u){s(u)}return}return l(e,r,s)}prepareLoading(e,r,n={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();vn(e)&&(e=this.languageUtils.toResolveHierarchy(e)),vn(r)&&(r=[r]);const a=this.queueLoad(e,r,n,i);if(!a.toLoad.length)return a.pending.length||i(),null;a.toLoad.forEach(o=>{this.loadOne(o)})}load(e,r,n){this.prepareLoading(e,r,{},n)}reload(e,r,n){this.prepareLoading(e,r,{reload:!0},n)}loadOne(e,r=""){const n=e.split("|"),i=n[0],a=n[1];this.read(i,a,"read",void 0,void 0,(o,s)=>{o&&this.logger.warn(`${r}loading namespace ${a} for language ${i} failed`,o),!o&&s&&this.logger.log(`${r}loaded namespace ${a} for language ${i}`,s),this.loaded(e,o,s)})}saveMissing(e,r,n,i,a,o={},s=()=>{}){var l,u,d,h,f;if((u=(l=this.services)==null?void 0:l.utils)!=null&&u.hasLoadedNamespace&&!((h=(d=this.services)==null?void 0:d.utils)!=null&&h.hasLoadedNamespace(r))){this.logger.warn(`did not save key "${n}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if((f=this.backend)!=null&&f.create){const p={...o,isUpdate:a},g=this.backend.create.bind(this.backend);if(g.length<6)try{let m;g.length===5?m=g(e,r,n,i,p):m=g(e,r,n,i),m&&typeof m.then=="function"?m.then(v=>s(null,v)).catch(s):s(null,m)}catch(m){s(m)}else g(e,r,n,i,s,p)}!e||!e[0]||this.store.addResource(e[0],r,n,i)}}}const lle=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),vn(t[1])&&(e.defaultValue=t[1]),vn(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const r=t[3]||t[2];Object.keys(r).forEach(n=>{e[n]=r[n]})}return e},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Sje=t=>(vn(t.ns)&&(t.ns=[t.ns]),vn(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),vn(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&!t.supportedLngs.includes("cimode")&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),aG=()=>{},chr=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(r=>{typeof t[r]=="function"&&(t[r]=t[r].bind(t))})};class M6 extends nG{constructor(e={},r){if(super(),this.options=Sje(e),this.services={},this.logger=mm,this.modules={external:[]},chr(this),r&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,r),this;setTimeout(()=>{this.init(e,r)},0)}}init(e={},r){this.isInitializing=!0,typeof e=="function"&&(r=e,e={}),e.defaultNS==null&&e.ns&&(vn(e.ns)?e.defaultNS=e.ns:e.ns.includes("translation")||(e.defaultNS=e.ns[0]));const n=lle();this.options={...n,...this.options,...Sje(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler);const i=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?mm.init(i(this.modules.logger),this.options):mm.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=ohr;const d=new mje(this.options);this.store=new fje(this.options.resources,this.options);const h=this.services;h.logger=mm,h.resourceStore=this.store,h.languageUtils=d,h.pluralResolver=new nhr(d,{prepend:this.options.pluralSeparator}),u&&(h.formatter=i(u),h.formatter.init&&h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new wje(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new lhr(i(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",(f,...p)=>{this.emit(f,...p)}),this.modules.languageDetector&&(h.languageDetector=i(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=i(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new iG(this.services,this.options),this.translator.on("*",(f,...p)=>{this.emit(f,...p)}),this.modules.external.forEach(f=>{f.init&&f.init(this)})}if(this.format=this.options.interpolation.format,r||(r=aG),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...d)=>this.store[u](...d)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...d)=>(this.store[u](...d),this)});const s=R6(),l=()=>{const u=(d,h)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),s.resolve(h),r(d,h)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),s}loadResources(e,r=aG){var a,o;let n=r;const i=vn(e)?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if((i==null?void 0:i.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const s=[],l=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(h=>{h!=="cimode"&&(s.includes(h)||s.push(h))})};i?l(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>l(d)),(o=(a=this.options.preload)==null?void 0:a.forEach)==null||o.call(a,u=>l(u)),this.services.backendConnector.load(s,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(u)})}else n(null)}reloadResources(e,r,n){const i=R6();return typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r=void 0),e||(e=this.languages),r||(r=this.options.ns),n||(n=aG),this.services.backendConnector.reload(e,r,a=>{i.resolve(),n(a)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&pje.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!["cimode","dev"].includes(e)){for(let r=0;r{this.language=s,this.languages=this.services.languageUtils.toResolveHierarchy(s),this.resolvedLanguage=void 0,this.setResolvedLanguage(s)},a=(s,l)=>{l?this.isLanguageChangingTo===e&&(i(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,n.resolve((...u)=>this.t(...u)),r&&r(s,(...u)=>this.t(...u))},o=s=>{var d,h;!e&&!s&&this.services.languageDetector&&(s=[]);const l=vn(s)?s:s&&s[0],u=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(vn(s)?[s]:s);u&&(this.language||i(u),this.translator.language||this.translator.changeLanguage(u),(h=(d=this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||h.call(d,u)),this.loadResources(u,f=>{a(f,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),n}getFixedT(e,r,n,i){const a=i==null?void 0:i.scopeNs,o=(s,l,...u)=>{let d;typeof l!="object"?d=this.options.overloadTranslationOptionHandler([s,l].concat(u)):d={...l},d.lng=d.lng||o.lng,d.lngs=d.lngs||o.lngs;const h=d.ns!==void 0&&d.ns!==null;d.ns=d.ns||o.ns,d.keyPrefix!==""&&(d.keyPrefix=d.keyPrefix||n||o.keyPrefix);const f={...this.options,...d};Array.isArray(a)&&!h&&(f.ns=a),typeof d.keyPrefix=="function"&&(d.keyPrefix=bA(d.keyPrefix,f));const p=this.options.keySeparator||".";let g;return d.keyPrefix&&Array.isArray(s)?g=s.map(m=>(typeof m=="function"&&(m=bA(m,f)),`${d.keyPrefix}${p}${m}`)):(typeof s=="function"&&(s=bA(s,f)),g=d.keyPrefix?`${d.keyPrefix}${p}${s}`:s),this.t(g,d)};return vn(e)?o.lng=e:o.lngs=e,o.ns=r,o.keyPrefix=n,o}t(...e){var r;return(r=this.translator)==null?void 0:r.translate(...e)}exists(...e){var r;return(r=this.translator)==null?void 0:r.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,r={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=r.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const o=(s,l)=>{const u=this.services.backendConnector.state[`${s}|${l}`];return u===-1||u===0||u===2};if(r.precheck){const s=r.precheck(this,o);if(s!==void 0)return s}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(n,e)&&(!i||o(a,e)))}loadNamespaces(e,r){const n=R6();return this.options.ns?(vn(e)&&(e=[e]),e.forEach(i=>{this.options.ns.includes(i)||this.options.ns.push(i)}),this.loadResources(i=>{n.resolve(),r&&r(i)}),n):(r&&r(),Promise.resolve())}loadLanguages(e,r){const n=R6();vn(e)&&(e=[e]);const i=this.options.preload||[],a=e.filter(o=>!i.includes(o)&&this.services.languageUtils.isSupportedCode(o));return a.length?(this.options.preload=i.concat(a),this.loadResources(o=>{n.resolve(),r&&r(o)}),n):(r&&r(),Promise.resolve())}dir(e){var i,a;if(e||(e=this.resolvedLanguage||(((i=this.languages)==null?void 0:i.length)>0?this.languages[0]:this.language)),!e)return"rtl";try{const o=new Intl.Locale(e);if(o&&o.getTextInfo){const s=o.getTextInfo();if(s&&s.direction)return s.direction}}catch{}const r=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=((a=this.services)==null?void 0:a.languageUtils)||new mje(lle());return e.toLowerCase().indexOf("-latn")>1?"ltr":r.includes(n.getLanguagePartFromCode(e))||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},r){const n=new M6(e,r);return n.createInstance=M6.createInstance,n}cloneInstance(e={},r=aG){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},a=new M6(i);if((e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(s=>{a[s]=this[s]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n){const s=Object.keys(this.store.data).reduce((l,u)=>(l[u]={...this.store.data[u]},l[u]=Object.keys(l[u]).reduce((d,h)=>(d[h]={...l[u][h]},d),l[u]),l),{});a.store=new fje(s,i),a.services.resourceStore=a.store}if(e.interpolation){const l={...lle().interpolation,...this.options.interpolation,...e.interpolation},u={...i,interpolation:l};a.services.interpolator=new wje(u)}return a.translator=new iG(a.services,i),a.translator.on("*",(s,...l)=>{a.emit(s,...l)}),a.init(i,r),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Su=M6.createInstance();Su.createInstance,Su.dir,Su.init,Su.loadResources,Su.reloadResources,Su.use,Su.changeLanguage,Su.getFixedT,Su.t,Su.exists,Su.setDefaultNamespace,Su.hasLoadedNamespace,Su.loadNamespaces,Su.loadLanguages;const uhr={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,"!doctype":!0,"!DOCTYPE":!0},dhr=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g;function Tje(t){const e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},r=t.match(/<\/?([^\s]+?)[/\s>]/);if(r&&(e.name=r[1],(uhr[r[1]]||t.charAt(t.length-2)==="/")&&(e.voidElement=!0),e.name.startsWith("!--"))){const a=t.indexOf("-->");return{type:"comment",comment:a!==-1?t.slice(4,a):""}}const n=new RegExp(dhr);let i=null;for(;i=n.exec(t),i!==null;)if(i[0].trim())if(i[1]){const a=i[1].trim();let o=[a,null];const s=a.indexOf("=");s>-1&&(o=[a.slice(0,s),a.slice(s+1)]),e.attrs[o[0]]=o[1],n.lastIndex--}else i[2]&&(e.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return e}const oG=/|<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,hhr=/<\/?([^\s]+?)[/\s>]/,fhr=/^\s*$/,phr=/^(script|style)$/i,I6="\0",ghr=Object.create(null);function Cje(t){t.forEach(function(e){if(e.type==="text"){e.content=e.content.split(I6).join("<");return}if(e.type==="comment"){e.comment=e.comment.split(I6).join("<");return}for(const r in e.attrs){const n=e.attrs[r];typeof n=="string"&&n.indexOf(I6)>-1&&(e.attrs[r]=n.split(I6).join("<"))}e.children.length&&Cje(e.children)})}function mhr(t,e){const r=e&&e.components||ghr,n=e&&e.allowedTags;let i=!1;if(n){const g=typeof n=="function"?n:function(b){return n.indexOf(b)>-1};let m="",v=0;oG.lastIndex=0;let y;for(;y=oG.exec(t);){const b=y[0];m+=t.slice(v,y.index);const x=b.match(hhr);b.startsWith("",t}}function yhr(t){return t.reduce(function(e,r){return e+kje("",r)},"")}var bhr={parse:mhr,stringify:yhr};const sG=(t,e,r,n)=>{var a,o,s,l;const i=[r,{code:e,...n||{}}];if((o=(a=t==null?void 0:t.services)==null?void 0:a.logger)!=null&&o.forward)return t.services.logger.forward(i,"warn","react-i18next::",!0);Rd(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),(l=(s=t==null?void 0:t.services)==null?void 0:s.logger)!=null&&l.warn?t.services.logger.warn(...i):console!=null&&console.warn&&console.warn(...i)},Oje={},wE=(t,e,r,n)=>{Rd(r)&&Oje[r]||(Rd(r)&&(Oje[r]=new Date),sG(t,e,r,n))},Eje=(t,e)=>()=>{if(t.isInitialized)e();else{const r=()=>{setTimeout(()=>{t.off("initialized",r)},0),e()};t.on("initialized",r)}},cle=(t,e,r)=>{t.loadNamespaces(e,Eje(t,r))},_je=(t,e,r,n)=>{if(Rd(r)&&(r=[r]),t.options.preload&&t.options.preload.indexOf(e)>-1)return cle(t,r,n);r.forEach(i=>{t.options.ns.indexOf(i)<0&&t.options.ns.push(i)}),t.loadLanguages(e,Eje(t,n))},xhr=(t,e,r={})=>!e.languages||!e.languages.length?(wE(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(t,{lng:r.lng,precheck:(n,i)=>{if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!i(n.isLanguageChangingTo,t))return!1}}),Rd=t=>typeof t=="string",jv=t=>typeof t=="object"&&t!==null,whr=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Ahr={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Shr=t=>Ahr[t],Rje=t=>t.replace(whr,Shr);let ule={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Rje,transDefaultProps:void 0};const Thr=(t={})=>{ule={...ule,...t}},dle=()=>ule;let Dje;const Chr=t=>{Dje=t},hle=()=>Dje,lG=(t,e)=>{var n;if(!t)return!1;const r=((n=t.props)==null?void 0:n.children)??t.children;return e?r.length>0:!!r},P6=t=>{var r,n;if(!t)return[];const e=((r=t.props)==null?void 0:r.children)??t.children;return(n=t.props)!=null&&n.i18nIsDynamicList?nx(e):e},khr=t=>Array.isArray(t)&&t.every(Y.isValidElement),nx=t=>Array.isArray(t)?t:[t],Ohr=(t,e)=>{const r={...e};return r.props={...e.props,...t.props},r},Ehr=t=>{const e={};if(!t)return e;const r=n=>{nx(n).forEach(a=>{Rd(a)||(lG(a)?r(P6(a)):jv(a)&&!Y.isValidElement(a)&&Object.assign(e,a))})};return r(t),e},fle=(t,e,r,n)=>{if(!t)return"";let i="";const a=nx(t),o=e!=null&&e.transSupportBasicHtmlNodes?e.transKeepBasicHtmlNodesFor??[]:[];return a.forEach((s,l)=>{if(Rd(s)){i+=`${s}`;return}if(Y.isValidElement(s)){const{props:u,type:d}=s,h=Object.keys(u).length,f=o.indexOf(d)>-1,p=u.children;if(!p&&f&&!h){i+=`<${d}/>`;return}if(!p&&(!f||h)||u.i18nIsDynamicList){i+=`<${l}>`;return}if(f&&h<=1){const m=Rd(p)?p:fle(p,e,r,n);i+=`<${d}>${m}`;return}const g=fle(p,e,r,n);i+=`<${l}>${g}`;return}if(s===null){sG(r,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:n});return}if(jv(s)){const{format:u,...d}=s,h=Object.keys(d);if(h.length===1){const f=u?`${h[0]}, ${u}`:h[0];i+=`{{${f}}}`;return}sG(r,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:n,child:s});return}sG(r,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:n,child:s})}),i},_hr=(t,e,r,n,i,a,o)=>{if(r==="")return[];const s=i.transKeepBasicHtmlNodesFor||[],l=r&&new RegExp(s.map(x=>`<${x}`).join("|")).test(r);if(!t&&!e&&!l&&!o)return[r];const u=e??{},d=x=>{nx(x).forEach(A=>{Rd(A)||(lG(A)?d(P6(A)):jv(A)&&!Y.isValidElement(A)&&Object.assign(u,A))})};d(t);const h=Object.keys(u),f=x=>/^\d+$/.test(x)||s.indexOf(x)>-1||h.indexOf(x)>-1,p=bhr.parse(`<0>${r}`,{allowedTags:f}),g={...u,...a},m=(x,w,A)=>{var C;const S=P6(x),T=y(S,w.children,A);return khr(S)&&T.length===0||(C=x.props)!=null&&C.i18nIsDynamicList?S:T},v=(x,w,A,S,T)=>{x.dummy?(x.children=w,A.push(Y.cloneElement(x,{key:S},T?void 0:w))):A.push(...Y.Children.map([x],C=>{var E;if(C.type===Y.Fragment||((E=C.props)==null?void 0:E.i18nIsDynamicList)!==void 0){const _={key:S};return C&&C.props&&Object.keys(C.props).forEach(P=>{P==="children"||P==="i18nIsDynamicList"||(_[P]=C.props[P])}),Y.createElement(C.type,_,T?null:w)}const O={key:S};return C&&C.props&&Object.keys(C.props).forEach(_=>{_==="ref"||_==="children"||(O[_]=C.props[_])}),Y.cloneElement(C,O,T?null:w)}))},y=(x,w,A)=>{const S=nx(x),T=nx(w),C={};return T.reduce((O,E,_)=>{var L,R;const P=((R=(L=E.children)==null?void 0:L[0])==null?void 0:R.content)&&n.services.interpolator.interpolate(E.children[0].content,g,n.language);if(E.type==="tag"){let D=S[parseInt(E.name,10)];!D&&e&&(D=e[E.name]),A.length===1&&!D&&(D=A[0][E.name]),D||(D={});const M={...E.attrs};o&&Object.keys(M).forEach(z=>{const U=M[z];Rd(U)&&(M[z]=Rje(U))});const I=Object.keys(M).length!==0?Ohr({props:M},D):D,N=Y.isValidElement(I),F=N&&lG(E,!0)&&!E.voidElement,B=l&&jv(I)&&I.dummy&&!N,V=jv(e)&&Object.hasOwnProperty.call(e,E.name);if(Rd(I)){const z=n.services.interpolator.interpolate(I,g,n.language);O.push(z)}else if(lG(I)||F){const z=m(I,E,A);v(I,z,O,_)}else if(B){const z=y(S,E.children,A);v(I,z,O,_)}else if(Number.isNaN(parseFloat(E.name)))if(V){const z=m(I,E,A);v(I,z,O,_,E.voidElement)}else if(i.transSupportBasicHtmlNodes&&s.indexOf(E.name)>-1)if(E.voidElement)O.push(Y.createElement(E.name,{key:`${E.name}-${_}`}));else{const z=C[E.name]||0;C[E.name]=z+1;let U,G=0;for(let q=0;q`);else{const z=y(S,E.children,A);O.push(`<${E.name}>${z}`)}else if(jv(I)&&!N){const z=E.children[0]?P:null;z&&O.push(z)}else v(I,P,O,_,E.children.length!==1||!P)}else if(E.type==="text"){const D=i.transWrapTextNodes,M=typeof i.unescape=="function"?i.unescape:dle().unescape,I=o?M(n.services.interpolator.interpolate(E.content,g,n.language)):n.services.interpolator.interpolate(E.content,g,n.language);D?O.push(Y.createElement(D,{key:`${E.name}-${_}`},I)):O.push(I)}return O},[])},b=y([{dummy:!0,children:t||[]}],p,nx(t||[]));return P6(b[0])},Lje=(t,e,r)=>{const n=t.key||e,i=Y.cloneElement(t,{key:n});if(!i.props||!i.props.children||r.indexOf(`${e}/>`)<0&&r.indexOf(`${e} />`)<0)return i;function a(){return Y.createElement(Y.Fragment,null,i)}return Y.createElement(a,{key:n})},Rhr=(t,e)=>t.map((r,n)=>Lje(r,n,e)),Dhr=(t,e)=>{const r={};return Object.keys(t).forEach(n=>{Object.assign(r,{[n]:Lje(t[n],n,e)})}),r},Lhr=(t,e,r,n)=>t?Array.isArray(t)?Rhr(t,e):jv(t)?Dhr(t,e):(wE(r,"TRANS_INVALID_COMPONENTS",' "components" prop expects an object or array',{i18nKey:n}),null):null,Mhr=t=>!jv(t)||Array.isArray(t)?!1:Object.keys(t).reduce((e,r)=>e&&Number.isNaN(Number.parseFloat(r)),!0);function Ihr({children:t,count:e,parent:r,i18nKey:n,context:i,tOptions:a={},values:o,defaults:s,components:l,ns:u,i18n:d,t:h,shouldUnescape:f,...p}){var B,V,z,U,G,H;const g=d||hle();if(!g)return wE(g,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.",{i18nKey:n}),t;const m=h||g.t.bind(g)||(j=>j),v={...dle(),...(B=g.options)==null?void 0:B.react};let y=u||m.ns||((V=g.options)==null?void 0:V.defaultNS);y=Rd(y)?[y]:y||["translation"];const{transDefaultProps:b}=v,x=b!=null&&b.tOptions?{...b.tOptions,...a}:a,w=f??(b==null?void 0:b.shouldUnescape),A=b!=null&&b.values?{...b.values,...o}:o,S=b!=null&&b.components?{...b.components,...l}:l,T=fle(t,v,g,n),C=s||(x==null?void 0:x.defaultValue)||T||v.transEmptyNodeValue||(typeof n=="function"?bA(n):n),{hashTransKey:O}=v,E=n||(O?O(T||C):T||C);(U=(z=g.options)==null?void 0:z.interpolation)!=null&&U.defaultVariables?o=A&&Object.keys(A).length>0?{...A,...g.options.interpolation.defaultVariables}:{...g.options.interpolation.defaultVariables}:o=A;const _=Ehr(t);_&&typeof _.count=="number"&&e===void 0&&(e=_.count);const P=o||e!==void 0&&!((H=(G=g.options)==null?void 0:G.interpolation)!=null&&H.alwaysFormat)||!t?x.interpolation:{interpolation:{...x.interpolation,prefix:"#$?",suffix:"?$#"}},L={...x,context:i||x.context,count:e,...o,...P,defaultValue:C,ns:y};let R=E?m(E,L):C;R===E&&C&&(R=C);const D=Lhr(S,R,g,n);let M=D||t,I=null;Mhr(D)&&(I=D,M=t);const N=_hr(M,I,R,g,v,L,w),F=r??v.defaultTransParent;return F?Y.createElement(F,p,N):N}const Phr={type:"3rdParty",init(t){Thr(t.options.react),Chr(t)}},Mje=Y.createContext();class Nhr{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function cG({children:t,count:e,parent:r,i18nKey:n,context:i,tOptions:a={},values:o,defaults:s,components:l,ns:u,i18n:d,t:h,shouldUnescape:f,...p}){var b;const{i18n:g,defaultNS:m}=Y.useContext(Mje)||{},v=d||g||hle(),y=h||(v==null?void 0:v.t.bind(v));return Ihr({children:t,count:e,parent:r,i18nKey:n,context:i,tOptions:a,values:o,defaults:s,components:l,ns:u||(y==null?void 0:y.ns)||m||((b=v==null?void 0:v.options)==null?void 0:b.defaultNS),i18n:v,t:h,shouldUnescape:f,...p})}var Ije={exports:{}},Pje={};/** * @license React * use-sync-external-store-shim.production.js